From f65529f328a971e75b3f188b2a1b5ab2051329d0 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Fri, 19 May 2023 12:15:15 -0600 Subject: [PATCH] Allow defining custom redirects with `WHOOGLE_REDIRECTS` Redirects to alternative frontends can now be defined using the WHOOGLE_REDIRECTS environment variable. Usage is documented in the readme, but is basically defined as :. Closes #988 --- README.md | 37 +++++++++++++++++++++++++++++++++---- app/utils/misc.py | 7 +++++++ app/utils/results.py | 4 ++++ 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6efe7d3..cc9ed70 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,11 @@ Contents 5. [Usage](#usage) 6. [Extra Steps](#extra-steps) 1. [Set Primary Search Engine](#set-whoogle-as-your-primary-search-engine) - 2. [Prevent Downtime (Heroku Only)](#prevent-downtime-heroku-only) - 3. [Manual HTTPS Enforcement](#https-enforcement) - 4. [Using with Firefox Containers](#using-with-firefox-containers) - 5. [Reverse Proxying](#reverse-proxying) + 2. [Custom Redirecting](#custom-redirecting) + 3. [Prevent Downtime (Heroku Only)](#prevent-downtime-heroku-only) + 4. [Manual HTTPS Enforcement](#https-enforcement) + 5. [Using with Firefox Containers](#using-with-firefox-containers) + 6. [Reverse Proxying](#reverse-proxying) 1. [Nginx](#nginx) 7. [Contributing](#contributing) 8. [FAQ](#faq) @@ -401,6 +402,7 @@ There are a few optional environment variables available for customizing a Whoog | WHOOGLE_USER_AGENT | The desktop user agent to use. Defaults to a randomly generated one. | | WHOOGLE_USER_AGENT_MOBILE | The mobile user agent to use. Defaults to a randomly generated one. | | WHOOGLE_USE_CLIENT_USER_AGENT | Enable to use your own user agent for all requests. Defaults to false. | +| WHOOGLE_REDIRECTS | Specify sites that should be redirected elsewhere. See (custom redirecting)(#custom-redirecting). | | EXPOSE_PORT | The port where Whoogle will be exposed. | | HTTPS_ONLY | Enforce HTTPS. (See [here](https://github.com/benbusby/whoogle-search#https-enforcement)) | | WHOOGLE_ALT_TW | The twitter.com alternative to use when site alternatives are enabled in the config. Set to "" to disable. | @@ -451,6 +453,7 @@ Same as most search engines, with the exception of filtering by time range. To filter by a range of time, append ":past