diff --git a/Dockerfile b/Dockerfile index cec9f54..cbfb305 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,18 +47,18 @@ ENV HTTPS_ONLY=$use_https ARG whoogle_port=5000 ENV EXPOSE_PORT=$whoogle_port -ARG twitter_alt='nitter.net' +ARG twitter_alt='farside.link/nitter' ENV WHOOGLE_ALT_TW=$twitter_alt -ARG youtube_alt='invidious.snopyta.org' +ARG youtube_alt='farside.link/invidious' ENV WHOOGLE_ALT_YT=$youtube_alt -ARG instagram_alt='bibliogram.art/u' +ARG instagram_alt='farside.link/bibliogram' ENV WHOOGLE_ALT_IG=$instagram_alt -ARG reddit_alt='libredd.it' +ARG reddit_alt='farside.link/libreddit' ENV WHOOGLE_ALT_RD=$reddit_alt +ARG medium_alt='farside.link/scribe' +ENV WHOOGLE_ALT_MD=$medium_alt ARG translate_alt='lingva.ml' ENV WHOOGLE_ALT_TL=$translate_alt -ARG medium_alt='scribe.rip' -ENV WHOOGLE_ALT_MD=$medium_alt WORKDIR /whoogle diff --git a/README.md b/README.md index 2320f04..c908526 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ Provides: - Free HTTPS url (https://\.herokuapp.com) - Downtime after periods of inactivity \([solution](https://github.com/benbusby/whoogle-search#prevent-downtime-heroku-only)\) -Notes: +Notes: - Requires a (free) Heroku account - Sometimes has issues with auto-redirecting to `https`. Make sure to navigate to the `https` version of your app before adding as a default search engine. @@ -196,13 +196,13 @@ Description=Whoogle #Environment=WHOOGLE_PROXY_LOC= # Site alternative configurations, uncomment to enable # Note: If not set, the feature will still be available -# with default values. -#Environment=WHOOGLE_ALT_TW=nitter.net -#Environment=WHOOGLE_ALT_YT=invidious.snopyta.org -#Environment=WHOOGLE_ALT_IG=bibliogram.art/u -#Environment=WHOOGLE_ALT_RD=libredd.it +# with default values. +#Environment=WHOOGLE_ALT_TW=farside.link/nitter +#Environment=WHOOGLE_ALT_YT=farside.link/invidious +#Environment=WHOOGLE_ALT_IG=farside.link/bibliogram/u +#Environment=WHOOGLE_ALT_RD=farside.link/libreddit +#Environment=WHOOGLE_ALT_MD=farside.link/scribe #Environment=WHOOGLE_ALT_TL=lingva.ml -#Environment=WHOOGLE_ALT_MD=scribe.rip # Load values from dotenv only #Environment=WHOOGLE_DOTENV=1 Type=simple @@ -422,7 +422,7 @@ Note: You should have your own domain name and [an https certificate](https://le - Docker image: Set the environment variable HTTPS_ONLY=1 - Pip/Pipx: Add the `--https-only` flag to the end of the `whoogle-search` command - Default `run` script: Modify the script locally to include the `--https-only` flag at the end of the python run command - + ### Using with Firefox Containers Unfortunately, Firefox Containers do not currently pass through `POST` requests (the default) to the engine, and Firefox caches the opensearch template on initial page load. To get around this, you can take the following steps to get it working as expected: @@ -457,7 +457,7 @@ Under the hood, Whoogle is a basic Flask app with the following structure: - CSS/Javascript files, should be self-explanatory - `static/settings` - Key-value JSON files for establishing valid configuration values - + If you're new to the project, the easiest way to get started would be to try fixing [an open bug report](https://github.com/benbusby/whoogle-search/issues?q=is%3Aissue+is%3Aopen+label%3Abug). If there aren't any open, or if the open ones are too stale, try taking on a [feature request](https://github.com/benbusby/whoogle-search/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement). Generally speaking, if you can write something that has any potential of breaking down in the future, you should write a test for it. @@ -476,7 +476,7 @@ def contains(x: list, y: int) -> bool: """ return y in x -``` +``` #### Translating @@ -516,7 +516,7 @@ A lot of the app currently piggybacks on Google's existing support for fetching | Website | Country | Language | |-|-|-| -| [http://whoglqjdkgt2an4tdepberwqz3hk7tjo4kqgdnuj77rt7nshw2xqhqad.onion](http://whoglqjdkgt2an4tdepberwqz3hk7tjo4kqgdnuj77rt7nshw2xqhqad.onion) | 🇺🇸 US | Multi-choice +| [http://whoglqjdkgt2an4tdepberwqz3hk7tjo4kqgdnuj77rt7nshw2xqhqad.onion](http://whoglqjdkgt2an4tdepberwqz3hk7tjo4kqgdnuj77rt7nshw2xqhqad.onion) | 🇺🇸 US | Multi-choice ## Screenshots #### Desktop diff --git a/app.json b/app.json index c3d2dc3..c67d7b7 100644 --- a/app.json +++ b/app.json @@ -47,22 +47,27 @@ }, "WHOOGLE_ALT_TW": { "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 }, "WHOOGLE_ALT_YT": { "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 }, "WHOOGLE_ALT_IG": { "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 }, "WHOOGLE_ALT_RD": { "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 }, "WHOOGLE_ALT_TL": { @@ -70,11 +75,6 @@ "value": "lingva.ml", "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": { "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 0b445af..920f76d 100644 --- a/app/utils/results.py +++ b/app/utils/results.py @@ -24,14 +24,14 @@ BLACKLIST = [ ] SITE_ALTS = { - 'twitter.com': os.getenv('WHOOGLE_ALT_TW', 'nitter.net'), - 'youtube.com': os.getenv('WHOOGLE_ALT_YT', 'invidious.snopyta.org'), - 'instagram.com': os.getenv('WHOOGLE_ALT_IG', 'bibliogram.art/u'), - 'reddit.com': os.getenv('WHOOGLE_ALT_RD', 'libredd.it'), + 'twitter.com': os.getenv('WHOOGLE_ALT_TW', 'farside.link/nitter'), + 'youtube.com': os.getenv('WHOOGLE_ALT_YT', 'farside.link/invidious'), + 'instagram.com': os.getenv('WHOOGLE_ALT_IG', 'farside.link/bibliogram/u'), + 'reddit.com': os.getenv('WHOOGLE_ALT_RD', 'farside.link/libreddit'), **dict.fromkeys([ 'medium.com', 'levelup.gitconnected.com' - ], os.getenv('WHOOGLE_ALT_MD', 'scribe.rip')) + ], os.getenv('WHOOGLE_ALT_MD', 'farside.link/scribe')) } diff --git a/docker-compose.yml b/docker-compose.yml index 52abf4d..002d9ca 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,13 +31,13 @@ services: #- WHOOGLE_PROXY_LOC= # Site alternative configurations, uncomment to enable # Note: If not set, the feature will still be available - # with default values. - #- WHOOGLE_ALT_TW=nitter.net - #- WHOOGLE_ALT_YT=invidious.snopyta.org - #- WHOOGLE_ALT_IG=bibliogram.art/u - #- WHOOGLE_ALT_RD=libredd.it + # with default values. + #- WHOOGLE_ALT_TW=farside.link/nitter + #- WHOOGLE_ALT_YT=farside.link/invidious + #- WHOOGLE_ALT_IG=farside.link/bibliogram/u + #- WHOOGLE_ALT_RD=farside.link/libreddit + #- WHOOGLE_ALT_MD=farside.link/scribe #- WHOOGLE_ALT_TL=lingva.ml - #- WHOOGLE_ALT_MD=scribe.rip #env_file: # Alternatively, load variables from whoogle.env #- whoogle.env ports: diff --git a/test/test_results.py b/test/test_results.py index d278afb..f5a402c 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -85,20 +85,6 @@ def test_block_results(client): 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): times = { 'past year': 365, diff --git a/whoogle.template.env b/whoogle.template.env index 425cef5..5d517bf 100644 --- a/whoogle.template.env +++ b/whoogle.template.env @@ -7,12 +7,12 @@ # - docker-compose: Uncomment the env_file option # - docker: Add "--env-file ./whoogle.env" to your build command -#WHOOGLE_ALT_TW=nitter.net -#WHOOGLE_ALT_YT=invidious.snopyta.org -#WHOOGLE_ALT_IG=bibliogram.art/u -#WHOOGLE_ALT_RD=libredd.it +#WHOOGLE_ALT_TW=farside.link/nitter +#WHOOGLE_ALT_YT=farside.link/invidious +#WHOOGLE_ALT_IG=farside.link/bibliogram/u +#WHOOGLE_ALT_RD=farside.link/libreddit +#WHOOGLE_ALT_MD=farside.link/scribe #WHOOGLE_ALT_TL=lingva.ml -#WHOOGLE_ALT_MD=scribe.rip #WHOOGLE_USER="" #WHOOGLE_PASS="" #WHOOGLE_PROXY_USER="" @@ -56,7 +56,7 @@ #WHOOGLE_CONFIG_NEW_TAB=1 # Enable View Image option -#WHOOGLE_CONFIG_VIEW_IMAGE=1 +#WHOOGLE_CONFIG_VIEW_IMAGE=1 # Search using GET requests only (exposes query in logs) #WHOOGLE_CONFIG_GET_ONLY=1