summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Busby <contact@benbusby.com>2025-02-25 15:38:33 -0700
committerBen Busby <contact@benbusby.com>2025-02-25 15:38:33 -0700
commitf3ab726ceced4ca9ba197f7e85ef609567fd4559 (patch)
treef21d3cb47896a1ccf87546ecb73d94a2a818e24e
parent4b19ad5228a3a8c47bc9fa1a246b9cdffbc9c49f (diff)
downloadfarside-f3ab726ceced4ca9ba197f7e85ef609567fd4559.tar.gz
Add missing handling for 4get and LibreY, remove LibreX
-rw-r--r--.github/workflows/update-instances.yml6
-rw-r--r--server/server.go3
-rw-r--r--services-full.json23
-rw-r--r--services.json23
-rw-r--r--services/mappings.go14
5 files changed, 16 insertions, 53 deletions
diff --git a/.github/workflows/update-instances.yml b/.github/workflows/update-instances.yml
index f52d73d..d099f37 100644
--- a/.github/workflows/update-instances.yml
+++ b/.github/workflows/update-instances.yml
@@ -251,12 +251,6 @@ jobs:
.clearnet] |
sort' > librey-tmp.json
- jq --slurpfile librex librey-tmp.json \
- '( .[] | select(.type == "librex") )
- .instances |= $librex[0]' services-full.json > services-tmp.json
-
- mv services-tmp.json services-full.json
-
jq --slurpfile librey librey-tmp.json \
'( .[] | select(.type == "librey") )
.instances |= $librey[0]' services-full.json > services-tmp.json
diff --git a/server/server.go b/server/server.go
index b4ebb80..b066a5f 100644
--- a/server/server.go
+++ b/server/server.go
@@ -86,8 +86,9 @@ func routing(w http.ResponseWriter, r *http.Request, jsEnabled bool, query strin
target, err := services.MatchRequest(segments[0])
if err != nil {
+ errMsg := fmt.Sprintf("No routing found for '%s'", segments[0])
log.Printf("Error during match request: %v\n", err)
- http.Error(w, "No routing found for "+target, http.StatusBadRequest)
+ http.Error(w, errMsg, http.StatusBadRequest)
return
}
diff --git a/services-full.json b/services-full.json
index 87e3043..489ffcd 100644
--- a/services-full.json
+++ b/services-full.json
@@ -397,29 +397,6 @@
]
},
{
- "type": "librex",
- "test_url": "/search.php?q=<%=query%>",
- "fallback": "https://librex.myroware.eu",
- "instances": [
- "https://libre.blitzw.in",
- "https://librex.nohost.network",
- "https://librey.4o1x5.dev",
- "https://librey.baczek.me",
- "https://librey.darkness.services",
- "https://librey.nube-gran.de",
- "https://librey.org",
- "https://librey.sny.sh",
- "https://ly.owo.si",
- "https://search.davidovski.xyz",
- "https://search.funami.tech",
- "https://search.liv.town",
- "https://search.revvy.de",
- "https://search.technicalvoid.dev",
- "https://search.uwabaki.party",
- "https://serp.catswords.net"
- ]
- },
- {
"type": "quetre",
"test_url": "/How-does-the-Z-boson-decay",
"fallback": "https://quetre.iket.me",
diff --git a/services.json b/services.json
index 279d1eb..648a434 100644
--- a/services.json
+++ b/services.json
@@ -367,29 +367,6 @@
]
},
{
- "type": "librex",
- "test_url": "/search.php?q=<%=query%>",
- "fallback": "https://librex.myroware.eu",
- "instances": [
- "https://libre.blitzw.in",
- "https://librex.nohost.network",
- "https://librey.4o1x5.dev",
- "https://librey.baczek.me",
- "https://librey.darkness.services",
- "https://librey.nube-gran.de",
- "https://librey.org",
- "https://librey.sny.sh",
- "https://ly.owo.si",
- "https://search.davidovski.xyz",
- "https://search.funami.tech",
- "https://search.liv.town",
- "https://search.revvy.de",
- "https://search.technicalvoid.dev",
- "https://search.uwabaki.party",
- "https://serp.catswords.net"
- ]
- },
- {
"type": "quetre",
"test_url": "/How-does-the-Z-boson-decay",
"fallback": "https://quetre.iket.me",
diff --git a/services/mappings.go b/services/mappings.go
index 0099ecd..8766863 100644
--- a/services/mappings.go
+++ b/services/mappings.go
@@ -97,6 +97,20 @@ var regexMap = []RegexMapping{
Pattern: regexp.MustCompile(`genius\.com|dumb`),
Targets: []string{"dumb"},
},
+ {
+ // 4get
+ // Note: Could be used for redirecting other search engine
+ // requests, but would need special handling
+ Pattern: regexp.MustCompile("4get"),
+ Targets: []string{"4get"},
+ },
+ {
+ // LibreY
+ // Note: Could be used for redirecting other search engine
+ // requests, but would need special handling
+ Pattern: regexp.MustCompile("librex|librey"),
+ Targets: []string{"librey"},
+ },
}
func MatchRequest(service string) (string, error) {