From 74cb48086ccd243a0c91834cb88e15c00512369d Mon Sep 17 00:00:00 2001 From: DUO Labs Date: Fri, 14 Jan 2022 11:59:03 -0500 Subject: [PATCH] Introduce site alts for imgur and wikipedia (#609) * Add `WHOOGLE_ALT_IMG` for a replacement for imgur. * Add `WHOOGLE_ALT_WIKI` for Wikipedia --- Dockerfile | 4 ++++ README.md | 4 ++++ app.json | 10 ++++++++++ app/utils/results.py | 4 +++- charts/whoogle/values.yaml | 2 ++ docker-compose.yml | 2 ++ whoogle.template.env | 2 ++ 7 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index edfe1a1..1cfa572 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,8 @@ ARG instagram_alt='farside.link/bibliogram' ARG reddit_alt='farside.link/libreddit' ARG medium_alt='farside.link/scribe' ARG translate_alt='lingva.ml' +ARG imgur_alt='imgin.voidnet.tech' +ARG wikipedia_alt='wikiless.org' ENV CONFIG_VOLUME=$config_dir \ WHOOGLE_USER=$username \ @@ -53,6 +55,8 @@ ENV CONFIG_VOLUME=$config_dir \ WHOOGLE_ALT_RD=$reddit_alt \ WHOOGLE_ALT_MD=$medium_alt \ WHOOGLE_ALT_TL=$translate_alt + WHOOGLE_ALT_IMG=$imgur_alt + WHOOGLE_ALT_WIKI=$wikipedia_alt WORKDIR /whoogle diff --git a/README.md b/README.md index aa85e64..5acef07 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,8 @@ Description=Whoogle #Environment=WHOOGLE_ALT_RD=farside.link/libreddit #Environment=WHOOGLE_ALT_MD=farside.link/scribe #Environment=WHOOGLE_ALT_TL=lingva.ml +#Environment=WHOOGLE_ALT_IMG=imgin.voidnet.tech +#Environment=WHOOGLE_ALT_WIKI=wikiless.org # Load values from dotenv only #Environment=WHOOGLE_DOTENV=1 Type=simple @@ -334,6 +336,8 @@ There are a few optional environment variables available for customizing a Whoog | WHOOGLE_ALT_RD | The reddit.com alternative to use when site alternatives are enabled in the config. | | WHOOGLE_ALT_TL | The Google Translate alternative to use. This is used for all "translate ____" searches. | | WHOOGLE_ALT_MD | The medium.com alternative to use when site alternatives are enabled in the config. | +| WHOOGLE_ALT_IMG | The imgur.com alternative to use when site alternatives are enabled in the config. | +| WHOOGLE_ALT_WIKI | The wikipedia.com alternative to use when site alternatives are enabled in the config. | | WHOOGLE_AUTOCOMPLETE | Controls visibility of autocomplete/search suggestions. Default on -- use '0' to disable | | WHOOGLE_MINIMAL | Remove everything except basic result cards from all search queries. | | WHOOGLE_CSP | Sets a default set of 'Content-Security-Policy' headers | diff --git a/app.json b/app.json index c67d7b7..a3b391e 100644 --- a/app.json +++ b/app.json @@ -75,6 +75,16 @@ "value": "lingva.ml", "required": false }, + "WHOOGLE_ALT_IMG": { + "description": "The site to use as a replacement for imgur.com when site alternatives are enabled in the config.", + "value": "imgin.voidnet.tech", + "required": false + }, + "WHOOGLE_ALT_WIKI": { + "description": "The site to use as a replacement for wikipedia.com when site alternatives are enabled in the config.", + "value": "wikiless.org", + "required": false + }, "WHOOGLE_MINIMAL": { "description": "Remove everything except basic result cards from all search queries (set to 1 or leave blank)", "value": "", diff --git a/app/utils/results.py b/app/utils/results.py index 5b1e116..6c710d6 100644 --- a/app/utils/results.py +++ b/app/utils/results.py @@ -31,7 +31,9 @@ SITE_ALTS = { **dict.fromkeys([ 'medium.com', 'levelup.gitconnected.com' - ], os.getenv('WHOOGLE_ALT_MD', 'farside.link/scribe')) + ], os.getenv('WHOOGLE_ALT_MD', 'farside.link/scribe')), + 'imgur.com': os.getenv('WHOOGLE_ALT_IMG', 'imgin.voidnet.tech'), + 'wikipedia.com': os.getenv('WHOOGLE_ALT_WIKI', 'wikiless.org') } diff --git a/charts/whoogle/values.yaml b/charts/whoogle/values.yaml index 05e45bd..68ae256 100644 --- a/charts/whoogle/values.yaml +++ b/charts/whoogle/values.yaml @@ -39,6 +39,8 @@ conf: {} # WHOOGLE_ALT_RD: "" # The reddit.com alternative to use when site alternatives are enabled in the config. # WHOOGLE_ALT_TL: "" # The Google Translate alternative to use. This is used for all "translate ____" searches. # WHOOGLE_ALT_MD: "" # The medium.com alternative to use when site alternatives are enabled in the config. + # WHOOGLE_ALT_IMG: "" # The imgur.com alternative to use when site alternatives are enabled in the config. + # WHOOGLE_ALT_WIKI: "" # The wikipedia.com alternative to use when site alternatives are enabled in the config. # WHOOGLE_AUTOCOMPLETE: "" # Controls visibility of autocomplete/search suggestions. Default on -- use '0' to disable # WHOOGLE_MINIMAL: "" # Remove everything except basic result cards from all search queries. diff --git a/docker-compose.yml b/docker-compose.yml index 002d9ca..84c0502 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,8 @@ services: #- WHOOGLE_ALT_RD=farside.link/libreddit #- WHOOGLE_ALT_MD=farside.link/scribe #- WHOOGLE_ALT_TL=lingva.ml + #- WHOOGLE_ALT_IMG=imgin.voidnet.tech + #- WHOOGLE_ALT_WIKI=wikiless.org #env_file: # Alternatively, load variables from whoogle.env #- whoogle.env ports: diff --git a/whoogle.template.env b/whoogle.template.env index 0fb97ad..70e1c40 100644 --- a/whoogle.template.env +++ b/whoogle.template.env @@ -13,6 +13,8 @@ #WHOOGLE_ALT_RD=farside.link/libreddit #WHOOGLE_ALT_MD=farside.link/scribe #WHOOGLE_ALT_TL=lingva.ml +#WHOOGLE_ALT_IMG=imgin.voidnet.tech +#WHOOGLE_ALT_WIKI=wikiless.org #WHOOGLE_USER="" #WHOOGLE_PASS="" #WHOOGLE_PROXY_USER=""