Update default fallback links to farside.link/<service>

This commit is contained in:
Ben Busby 2021-12-06 20:22:55 -07:00
parent 9b89cfc00e
commit 5468950ed9
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1
7 changed files with 43 additions and 57 deletions

View File

@ -47,18 +47,18 @@ ENV HTTPS_ONLY=$use_https
ARG whoogle_port=5000 ARG whoogle_port=5000
ENV EXPOSE_PORT=$whoogle_port ENV EXPOSE_PORT=$whoogle_port
ARG twitter_alt='nitter.net' ARG twitter_alt='farside.link/nitter'
ENV WHOOGLE_ALT_TW=$twitter_alt ENV WHOOGLE_ALT_TW=$twitter_alt
ARG youtube_alt='invidious.snopyta.org' ARG youtube_alt='farside.link/invidious'
ENV WHOOGLE_ALT_YT=$youtube_alt ENV WHOOGLE_ALT_YT=$youtube_alt
ARG instagram_alt='bibliogram.art/u' ARG instagram_alt='farside.link/bibliogram'
ENV WHOOGLE_ALT_IG=$instagram_alt ENV WHOOGLE_ALT_IG=$instagram_alt
ARG reddit_alt='libredd.it' ARG reddit_alt='farside.link/libreddit'
ENV WHOOGLE_ALT_RD=$reddit_alt ENV WHOOGLE_ALT_RD=$reddit_alt
ARG medium_alt='farside.link/scribe'
ENV WHOOGLE_ALT_MD=$medium_alt
ARG translate_alt='lingva.ml' ARG translate_alt='lingva.ml'
ENV WHOOGLE_ALT_TL=$translate_alt ENV WHOOGLE_ALT_TL=$translate_alt
ARG medium_alt='scribe.rip'
ENV WHOOGLE_ALT_MD=$medium_alt
WORKDIR /whoogle WORKDIR /whoogle

View File

@ -197,12 +197,12 @@ Description=Whoogle
# Site alternative configurations, uncomment to enable # Site alternative configurations, uncomment to enable
# Note: If not set, the feature will still be available # Note: If not set, the feature will still be available
# with default values. # with default values.
#Environment=WHOOGLE_ALT_TW=nitter.net #Environment=WHOOGLE_ALT_TW=farside.link/nitter
#Environment=WHOOGLE_ALT_YT=invidious.snopyta.org #Environment=WHOOGLE_ALT_YT=farside.link/invidious
#Environment=WHOOGLE_ALT_IG=bibliogram.art/u #Environment=WHOOGLE_ALT_IG=farside.link/bibliogram/u
#Environment=WHOOGLE_ALT_RD=libredd.it #Environment=WHOOGLE_ALT_RD=farside.link/libreddit
#Environment=WHOOGLE_ALT_MD=farside.link/scribe
#Environment=WHOOGLE_ALT_TL=lingva.ml #Environment=WHOOGLE_ALT_TL=lingva.ml
#Environment=WHOOGLE_ALT_MD=scribe.rip
# Load values from dotenv only # Load values from dotenv only
#Environment=WHOOGLE_DOTENV=1 #Environment=WHOOGLE_DOTENV=1
Type=simple Type=simple

View File

@ -47,22 +47,27 @@
}, },
"WHOOGLE_ALT_TW": { "WHOOGLE_ALT_TW": {
"description": "The site to use as a replacement for twitter.com when site alternatives are enabled in the config.", "description": "The site to use as a replacement for twitter.com when site alternatives are enabled in the config.",
"value": "nitter.net", "value": "farside.link/nitter",
"required": false "required": false
}, },
"WHOOGLE_ALT_YT": { "WHOOGLE_ALT_YT": {
"description": "The site to use as a replacement for youtube.com when site alternatives are enabled in the config.", "description": "The site to use as a replacement for youtube.com when site alternatives are enabled in the config.",
"value": "invidious.snopyta.org", "value": "farside.link/invidious",
"required": false "required": false
}, },
"WHOOGLE_ALT_IG": { "WHOOGLE_ALT_IG": {
"description": "The site to use as a replacement for instagram.com when site alternatives are enabled in the config.", "description": "The site to use as a replacement for instagram.com when site alternatives are enabled in the config.",
"value": "bibliogram.art/u", "value": "farside.link/bibliogram/u",
"required": false "required": false
}, },
"WHOOGLE_ALT_RD": { "WHOOGLE_ALT_RD": {
"description": "The site to use as a replacement for reddit.com when site alternatives are enabled in the config.", "description": "The site to use as a replacement for reddit.com when site alternatives are enabled in the config.",
"value": "libredd.it", "value": "farside.link/libreddit",
"required": false
},
"WHOOGLE_ALT_MD": {
"description": "The site to use as a replacement for medium.com when site alternatives are enabled in the config.",
"value": "farside.link/scribe",
"required": false "required": false
}, },
"WHOOGLE_ALT_TL": { "WHOOGLE_ALT_TL": {
@ -70,11 +75,6 @@
"value": "lingva.ml", "value": "lingva.ml",
"required": false "required": false
}, },
"WHOOGLE_ALT_MD": {
"description": "The site to use as a replacement for medium.com when site alternatives are enabled in the config.",
"value": "scribe.rip",
"required": false
},
"WHOOGLE_MINIMAL": { "WHOOGLE_MINIMAL": {
"description": "Remove everything except basic result cards from all search queries (set to 1 or leave blank)", "description": "Remove everything except basic result cards from all search queries (set to 1 or leave blank)",
"value": "", "value": "",

View File

@ -24,14 +24,14 @@ BLACKLIST = [
] ]
SITE_ALTS = { SITE_ALTS = {
'twitter.com': os.getenv('WHOOGLE_ALT_TW', 'nitter.net'), 'twitter.com': os.getenv('WHOOGLE_ALT_TW', 'farside.link/nitter'),
'youtube.com': os.getenv('WHOOGLE_ALT_YT', 'invidious.snopyta.org'), 'youtube.com': os.getenv('WHOOGLE_ALT_YT', 'farside.link/invidious'),
'instagram.com': os.getenv('WHOOGLE_ALT_IG', 'bibliogram.art/u'), 'instagram.com': os.getenv('WHOOGLE_ALT_IG', 'farside.link/bibliogram/u'),
'reddit.com': os.getenv('WHOOGLE_ALT_RD', 'libredd.it'), 'reddit.com': os.getenv('WHOOGLE_ALT_RD', 'farside.link/libreddit'),
**dict.fromkeys([ **dict.fromkeys([
'medium.com', 'medium.com',
'levelup.gitconnected.com' 'levelup.gitconnected.com'
], os.getenv('WHOOGLE_ALT_MD', 'scribe.rip')) ], os.getenv('WHOOGLE_ALT_MD', 'farside.link/scribe'))
} }

View File

@ -32,12 +32,12 @@ services:
# Site alternative configurations, uncomment to enable # Site alternative configurations, uncomment to enable
# Note: If not set, the feature will still be available # Note: If not set, the feature will still be available
# with default values. # with default values.
#- WHOOGLE_ALT_TW=nitter.net #- WHOOGLE_ALT_TW=farside.link/nitter
#- WHOOGLE_ALT_YT=invidious.snopyta.org #- WHOOGLE_ALT_YT=farside.link/invidious
#- WHOOGLE_ALT_IG=bibliogram.art/u #- WHOOGLE_ALT_IG=farside.link/bibliogram/u
#- WHOOGLE_ALT_RD=libredd.it #- WHOOGLE_ALT_RD=farside.link/libreddit
#- WHOOGLE_ALT_MD=farside.link/scribe
#- WHOOGLE_ALT_TL=lingva.ml #- WHOOGLE_ALT_TL=lingva.ml
#- WHOOGLE_ALT_MD=scribe.rip
#env_file: # Alternatively, load variables from whoogle.env #env_file: # Alternatively, load variables from whoogle.env
#- whoogle.env #- whoogle.env
ports: ports:

View File

@ -85,20 +85,6 @@ def test_block_results(client):
assert 'pinterest.com' not in urlparse(link['href']).netloc assert 'pinterest.com' not in urlparse(link['href']).netloc
# TODO: Unit test the site alt method instead -- the results returned
# are too unreliable for this test in particular.
# def test_site_alts(client):
# rv = client.post('/search', data=dict(q='twitter official account'))
# assert b'twitter.com/Twitter' in rv.data
# client.post('/config', data=dict(alts=True))
# assert json.loads(client.get('/config').data)['alts']
# rv = client.post('/search', data=dict(q='twitter official account'))
# assert b'twitter.com/Twitter' not in rv.data
# assert b'nitter.net/Twitter' in rv.data
def test_recent_results(client): def test_recent_results(client):
times = { times = {
'past year': 365, 'past year': 365,

View File

@ -7,12 +7,12 @@
# - docker-compose: Uncomment the env_file option # - docker-compose: Uncomment the env_file option
# - docker: Add "--env-file ./whoogle.env" to your build command # - docker: Add "--env-file ./whoogle.env" to your build command
#WHOOGLE_ALT_TW=nitter.net #WHOOGLE_ALT_TW=farside.link/nitter
#WHOOGLE_ALT_YT=invidious.snopyta.org #WHOOGLE_ALT_YT=farside.link/invidious
#WHOOGLE_ALT_IG=bibliogram.art/u #WHOOGLE_ALT_IG=farside.link/bibliogram/u
#WHOOGLE_ALT_RD=libredd.it #WHOOGLE_ALT_RD=farside.link/libreddit
#WHOOGLE_ALT_MD=farside.link/scribe
#WHOOGLE_ALT_TL=lingva.ml #WHOOGLE_ALT_TL=lingva.ml
#WHOOGLE_ALT_MD=scribe.rip
#WHOOGLE_USER="" #WHOOGLE_USER=""
#WHOOGLE_PASS="" #WHOOGLE_PASS=""
#WHOOGLE_PROXY_USER="" #WHOOGLE_PROXY_USER=""