From a509169110c7dbc761865eec439effaf301e22c7 Mon Sep 17 00:00:00 2001 From: Matt Burns <1515005+m6urns@users.noreply.github.com> Date: Mon, 30 Sep 2024 10:34:54 -0600 Subject: [PATCH] Add SO as a default site alternative (#1168) SO -> farside.link/anonymousoverflow --- Dockerfile | 4 +++- README.md | 2 ++ app.json | 5 +++++ app/utils/results.py | 3 ++- charts/whoogle/values.yaml | 1 + docker-compose-traefik.yaml | 1 + docker-compose.yml | 1 + whoogle.template.env | 1 + 8 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ac3b7fb..dcaf27c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,6 +52,7 @@ ARG imgur_alt='farside.link/rimgo' ARG wikipedia_alt='farside.link/wikiless' ARG imdb_alt='farside.link/libremdb' ARG quora_alt='farside.link/quetre' +ARG so_alt='farside.link/anonymousoverflow' ENV CONFIG_VOLUME=$config_dir \ WHOOGLE_URL_PREFIX=$url_prefix \ @@ -72,7 +73,8 @@ ENV CONFIG_VOLUME=$config_dir \ WHOOGLE_ALT_IMG=$imgur_alt \ WHOOGLE_ALT_WIKI=$wikipedia_alt \ WHOOGLE_ALT_IMDB=$imdb_alt \ - WHOOGLE_ALT_QUORA=$quora_alt + WHOOGLE_ALT_QUORA=$quora_alt \ + WHOOGLE_ALT_SO=$so_alt WORKDIR /whoogle diff --git a/README.md b/README.md index 5029bb5..96dfe40 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,7 @@ Description=Whoogle #Environment=WHOOGLE_ALT_WIKI=farside.link/wikiless #Environment=WHOOGLE_ALT_IMDB=farside.link/libremdb #Environment=WHOOGLE_ALT_QUORA=farside.link/quetre +#Environment=WHOOGLE_ALT_SO=farside.link/anonymousoverflow # Load values from dotenv only #Environment=WHOOGLE_DOTENV=1 Type=simple @@ -431,6 +432,7 @@ There are a few optional environment variables available for customizing a Whoog | WHOOGLE_ALT_WIKI | The wikipedia.org alternative to use when site alternatives are enabled in the config. Set to "" to disable. | | WHOOGLE_ALT_IMDB | The imdb.com alternative to use when site alternatives are enabled in the config. Set to "" to disable. | | WHOOGLE_ALT_QUORA | The quora.com alternative to use when site alternatives are enabled in the config. Set to "" to disable. | +| WHOOGLE_ALT_SO | The stackoverflow.com alternative to use when site alternatives are enabled in the config. Set to "" to disable. | | 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 87be096..6a9b7e8 100644 --- a/app.json +++ b/app.json @@ -95,6 +95,11 @@ "value": "farside.link/quetre", "required": false }, + "WHOOGLE_ALT_SO": { + "description": "The site to use as a replacement for stackoverflow.com when site alternatives are enabled in the config.", + "value": "farside.link/anonymousoverflow", + "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 dbd60cc..0fb9929 100644 --- a/app/utils/results.py +++ b/app/utils/results.py @@ -41,7 +41,8 @@ SITE_ALTS = { 'imgur.com': os.getenv('WHOOGLE_ALT_IMG', 'farside.link/rimgo'), 'wikipedia.org': os.getenv('WHOOGLE_ALT_WIKI', 'farside.link/wikiless'), 'imdb.com': os.getenv('WHOOGLE_ALT_IMDB', 'farside.link/libremdb'), - 'quora.com': os.getenv('WHOOGLE_ALT_QUORA', 'farside.link/quetre') + 'quora.com': os.getenv('WHOOGLE_ALT_QUORA', 'farside.link/quetre'), + 'stackoverflow.com': os.getenv('WHOOGLE_ALT_SO', 'farside.link/anonymousoverflow') } # Include custom site redirects from WHOOGLE_REDIRECTS diff --git a/charts/whoogle/values.yaml b/charts/whoogle/values.yaml index ab01a6d..54beded 100644 --- a/charts/whoogle/values.yaml +++ b/charts/whoogle/values.yaml @@ -43,6 +43,7 @@ conf: {} # WHOOGLE_ALT_WIKI: "" # The wikipedia.com alternative to use when site alternatives are enabled in the config. # WHOOGLE_ALT_IMDB: "" # The imdb.com alternative to use. Set to "" to continue using imdb.com when site alternatives are enabled. # WHOOGLE_ALT_QUORA: "" # The quora.com alternative to use. Set to "" to continue using quora.com when site alternatives are enabled. + # WHOOGLE_ALT_SO: "" # The stackoverflow.com alternative to use. Set to "" to continue using stackoverflow.com when site alternatives are enabled. # 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-traefik.yaml b/docker-compose-traefik.yaml index 7aaedfd..4cfb588 100644 --- a/docker-compose-traefik.yaml +++ b/docker-compose-traefik.yaml @@ -68,6 +68,7 @@ services: #- WHOOGLE_ALT_WIKI=farside.link/wikiless #- WHOOGLE_ALT_IMDB=farside.link/libremdb #- WHOOGLE_ALT_QUORA=farside.link/quetre + #- WHOOGLE_ALT_SO=farside.link/anonymousoverflow # - WHOOGLE_CONFIG_DISABLE=1 # - WHOOGLE_CONFIG_SEARCH_LANGUAGE=lang_en # - WHOOGLE_CONFIG_GET_ONLY=1 diff --git a/docker-compose.yml b/docker-compose.yml index 8e1428c..0a693e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,6 +42,7 @@ services: #- WHOOGLE_ALT_WIKI=farside.link/wikiless #- WHOOGLE_ALT_IMDB=farside.link/libremdb #- WHOOGLE_ALT_QUORA=farside.link/quetre + #- WHOOGLE_ALT_SO=farside.link/anonymousoverflow #env_file: # Alternatively, load variables from whoogle.env #- whoogle.env ports: diff --git a/whoogle.template.env b/whoogle.template.env index 8e752a5..ee2a502 100644 --- a/whoogle.template.env +++ b/whoogle.template.env @@ -17,6 +17,7 @@ #WHOOGLE_ALT_WIKI=farside.link/wikiless #WHOOGLE_ALT_IMDB=farside.link/libremdb #WHOOGLE_ALT_QUORA=farside.link/quetre +#WHOOGLE_ALT_SO=farside.link/anonymousoverflow #WHOOGLE_USER="" #WHOOGLE_PASS="" #WHOOGLE_PROXY_USER=""