Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/workflows/update-instances.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,6 @@ jobs:

apply_update

# ==============================================================
# Whoogle update
# ==============================================================
curl -s https://raw.githubusercontent.com/benbusby/whoogle-search/main/misc/instances.txt > whoogle-out
jq -ncR '[inputs]' <<< "$(cat whoogle-out | sort)" > whoogle-tmp.json

jq --slurpfile whoogle whoogle-tmp.json \
'( .[] | select(.type == "whoogle") )
.instances |= $whoogle[0]' services-full.json > services-tmp.json

apply_update

# ==============================================================
# Invidious update
# ==============================================================
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Contents
1. [Environment Variables](#environment-variables)
6. [Search Integration](#search-integration)
1. [Kagi](#kagi)
2. [Whoogle Search](#whoogle-search)

## About

Expand Down Expand Up @@ -255,9 +254,3 @@ For example:

`^https://([^/]+).fandom.com/(.*)|https://farside.link/breezewiki/$1/$2`

### Whoogle Search

https://github.com/benbusby/whoogle-search

Whoogle automatically routes eligible links through Farside when the `Replace
Social Media Links` option in the home page settings menu is enabled.
8 changes: 0 additions & 8 deletions services-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,6 @@
"https://rmgur.com"
]
},
{
"type": "whoogle",
"test_url": "/search?cookies_disabled=1&q=<%=query%>",
"fallback": "https://search.sethforprivacy.com",
"instances": [
"https://search.garudalinux.org"
]
},
{
"type": "searxng",
"test_url": "/",
Expand Down
6 changes: 0 additions & 6 deletions services.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@
"https://rmgur.com"
]
},
{
"type": "whoogle",
"test_url": "/search?cookies_disabled=1&q=<%=query%>",
"fallback": "https://search.sethforprivacy.com",
"instances": []
},
{
"type": "searxng",
"test_url": "/",
Expand Down
21 changes: 20 additions & 1 deletion services/mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ var regexMap = []RegexMapping{
},
{
// Google Search
// whoogle stays in the pattern so existing Whoogle links keep
// routing, but it is no longer a target: the project was archived
// in Aug 2026 and every known instance is dead.
Pattern: regexp.MustCompile(`google\.com|whoogle|searx|searxng`),
Targets: []string{"whoogle", "searxng"},
Targets: []string{"searxng"},
},
{
// Medium
Expand Down Expand Up @@ -108,7 +111,23 @@ var regexMap = []RegexMapping{
},
}

// retiredAliases maps a retired frontend onto a living equivalent. A bare
// service name (no ".") otherwise passes through MatchRequest unchanged, so
// without this a link minted before the service was retired -- /whoogle/...,
// /searx/... -- resolves to a service that no longer exists and errors out.
// URL-form requests are unaffected: those still go through regexMap.
var retiredAliases = map[string]string{
"whoogle": "searxng", // archived Aug 2026, every known instance dead
"searx": "searxng", // discontinued upstream; SearXNG is the successor
"piped": "invidious",
}

func MatchRequest(service string) (string, error) {
if !strings.Contains(service, ".") {
if alias, ok := retiredAliases[strings.ToLower(service)]; ok {
return alias, nil
}
}

for _, mapping := range regexMap {
hasMatch := mapping.Pattern.MatchString(service)
Expand Down
47 changes: 47 additions & 0 deletions services/mappings_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package services

import "testing"

// Retired frontends must not resolve to themselves: a bare service name
// otherwise passes through MatchRequest unchanged, which would send
// pre-existing /whoogle/... and /searx/... links to a service that no longer
// exists. They should land on the living replacement instead.
func TestRetiredServicesAlias(t *testing.T) {
cases := map[string]string{
"whoogle": "searxng",
"searx": "searxng",
"piped": "invidious",
"Whoogle": "searxng", // case-insensitive
}

for in, want := range cases {
got, err := MatchRequest(in)
if err != nil {
t.Errorf("MatchRequest(%q) returned error: %v", in, err)
continue
}
if got != want {
t.Errorf("MatchRequest(%q) = %q, want %q", in, got, want)
}
}
}

// Live services must still pass through untouched, and URL-form requests must
// still go through regexMap rather than the alias table.
func TestLiveServicesUnaffected(t *testing.T) {
for _, in := range []string{"searxng", "invidious", "nitter", "tent"} {
got, err := MatchRequest(in)
if err != nil || got != in {
t.Errorf("MatchRequest(%q) = %q, %v; want %q, nil", in, got, err, in)
}
}

// google.com has no "whoogle" target any more, so it must pick searxng.
got, err := MatchRequest("google.com")
if err != nil {
t.Fatalf("MatchRequest(\"google.com\") returned error: %v", err)
}
if got != "searxng" {
t.Errorf("MatchRequest(\"google.com\") = %q, want \"searxng\"", got)
}
}
2 changes: 0 additions & 2 deletions tools/check-registries.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ def _hosts(body):
lambda b: sum(1 for v in _hosts(b) if v.get("healthy"))),
("simplytranslate", "https://codeberg.org/SimpleWeb/Website/raw/branch/master/config.json",
lambda b: len(next(p for p in json.loads(b)["projects"] if p["id"] == "simplytranslate")["instances"])),
("whoogle", "https://raw.githubusercontent.com/benbusby/whoogle-search/main/misc/instances.txt",
lambda b: sum(1 for l in b.splitlines() if l.strip().startswith("http"))),
("invidious", "https://api.invidious.io/instances.json",
lambda b: sum(1 for e in json.loads(b) if e[1].get("type") == "https")),
("scribe", "https://git.sr.ht/~edwardloveall/scribe/blob/main/docs/instances.json",
Expand Down
5 changes: 0 additions & 5 deletions tools/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@
"sources": ["https://raw.githubusercontent.com/nesaku/BiblioReads/main/README.md"],
"lr": "biblioReads",
"test_url": "/search?q=dune", "markers": ["biblioreads"]},
# whoogle's own instances.txt is tiny these days; LibRedirect finds more
"whoogle": {
"sources": [], "lr": "whoogle",
"test_url": "/search?cookies_disabled=1&q=current+weather",
"markers": ["whoogle"]},
# scribe's sourcehut registry is dead (HTTP 418); LibRedirect is the only
# living source of scribe instances
"scribe": {
Expand Down