From 11fa44eec13ee11155db67933466dde4901ac588 Mon Sep 17 00:00:00 2001 From: Ben Busby <33362396+benbusby@users.noreply.github.com> Date: Fri, 15 May 2020 16:47:39 -0600 Subject: [PATCH] Minor refactoring for clarification Executable renamed to "run" to avoid confusion with pip installed script Updated heroku deploy button to use the heroku-app branch, which by default enforces HTTPS Added instructions for enforcing HTTPS on various deployment options, with note about how this isn't a required task. Updated setup.py description to use improved app description --- .travis.yml | 2 +- Dockerfile | 2 +- README.md | 12 ++++++++++-- whoogle-search => run | 4 ++-- setup.py | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) rename whoogle-search => run (83%) diff --git a/.travis.yml b/.travis.yml index 8695c53..3775cce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,4 @@ before_install: install: - pip install -r requirements.txt script: - - ./whoogle-search test + - ./run test diff --git a/Dockerfile b/Dockerfile index 18551cc..30ab242 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,4 +20,4 @@ COPY . . EXPOSE $EXPOSE_PORT -CMD ["./whoogle-search"] +CMD ["./run"] diff --git a/README.md b/README.md index 67219fd..d63450f 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ If using Heroku Quick Deploy, **you can skip this section**. There are a few different ways to begin using the app, depending on your preferences: ### A) [Heroku Quick Deploy](https://heroku.com/about) -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/benbusby/whoogle-search) +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/benbusby/whoogle-search/tree/heroku-app) *Note: Requires a (free) Heroku account* @@ -93,7 +93,7 @@ cd whoogle-search python3 -m venv venv source venv/bin/activate pip install -r requirements.txt -./whoogle-search +./run ``` ### E) Manual (Docker) @@ -200,6 +200,14 @@ For instance, adding `*/20 7-23 * * * curl https://.heroku Since the instance is destroyed and rebuilt after inactivity, config settings will be reset once the app enters downtime. If you have configuration settings active that you'd like to keep between periods of downtime (like dark mode for example), you could instead add `*/20 7-23 * * * curl -d "dark=1" -X POST https://.herokuapp.com/config > /home//whoogle-refresh` to keep these settings more or less permanent, and still keep the app from entering downtime when you're using it. +### HTTPS Enforcement +Only needed if your setup requires Flask to redirect to HTTPS on its own -- generally this is something that doesn't need to be handled by Whoogle Search. + +- Heroku: Enforced by default +- Docker: Add `--build-arg use_https=1` to your run command +- 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 + Available config values are `near`, `nojs`, `dark` and `url`. ## FAQ **What's the difference between this and [Searx](https://github.com/asciimoo/searx)?** diff --git a/whoogle-search b/run similarity index 83% rename from whoogle-search rename to run index 72f272d..b2eedbd 100755 --- a/whoogle-search +++ b/run @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# ./whoogle-search # Runs the full web app -# ./whoogle-search test # Runs the testing suite +# ./run # Runs the full web app +# ./run test # Runs the testing suite set -euo pipefail diff --git a/setup.py b/setup.py index 29d6290..1723f6b 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setuptools.setup( scripts=['whoogle-search'], include_package_data=True, install_requires=requirements, - description='Self-hosted, ad-free, privacy-respecting alternative to Google search', + description='Self-hosted, ad-free, privacy-respecting Google metasearch engine', long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/benbusby/whoogle-search',