From 0a6575d21901f70ed4089aa4c5c64fe812f23d57 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Sun, 7 Feb 2021 18:55:27 -0500 Subject: [PATCH] Hotfix: Move language/country json to app dir Pip installs of whoogle search were missing access to the misc/ folder, which previously contained the language and country json files. These have been moved to app/misc, and the previous root level misc/ was renamed to config/ (since it now only contains the tor config files). Bump to 0.3.1. --- Dockerfile | 4 ++-- MANIFEST.in | 1 + app/__init__.py | 6 +++--- {misc => app/misc}/countries.json | 0 {misc => app/misc}/languages.json | 0 {misc => config}/tor/start-tor.sh | 0 {misc => config}/tor/torrc | 0 setup.py | 4 ++-- test/misc | 1 + 9 files changed, 9 insertions(+), 7 deletions(-) rename {misc => app/misc}/countries.json (100%) rename {misc => app/misc}/languages.json (100%) rename {misc => config}/tor/start-tor.sh (100%) rename {misc => config}/tor/torrc (100%) create mode 120000 test/misc diff --git a/Dockerfile b/Dockerfile index 3c45daa..7a3f4b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y \ libffi-dev \ tor -COPY misc/tor/torrc /etc/tor/torrc +COPY config/tor/torrc /etc/tor/torrc COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt @@ -50,4 +50,4 @@ COPY . . EXPOSE $EXPOSE_PORT -CMD misc/tor/start-tor.sh & ./run +CMD config/tor/start-tor.sh & ./run diff --git a/MANIFEST.in b/MANIFEST.in index 1601bc8..d3a0ad4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ graft app/static graft app/templates +graft app/misc include requirements.txt global-exclude *.pyc diff --git a/app/__init__.py b/app/__init__.py index 3d6d6db..ace1c4d 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -14,14 +14,14 @@ app.default_key_set = generate_user_keys() app.no_cookie_ips = [] app.config['SECRET_KEY'] = os.urandom(32) app.config['SESSION_TYPE'] = 'filesystem' -app.config['VERSION_NUMBER'] = '0.3.0' +app.config['VERSION_NUMBER'] = '0.3.1' app.config['APP_ROOT'] = os.getenv( 'APP_ROOT', os.path.dirname(os.path.abspath(__file__))) app.config['LANGUAGES'] = json.load(open( - os.path.join(app.config['APP_ROOT'], '../misc/languages.json'))) + os.path.join(app.config['APP_ROOT'], 'misc/languages.json'))) app.config['COUNTRIES'] = json.load(open( - os.path.join(app.config['APP_ROOT'], '../misc/countries.json'))) + os.path.join(app.config['APP_ROOT'], 'misc/countries.json'))) app.config['STATIC_FOLDER'] = os.getenv( 'STATIC_FOLDER', os.path.join(app.config['APP_ROOT'], 'static')) diff --git a/misc/countries.json b/app/misc/countries.json similarity index 100% rename from misc/countries.json rename to app/misc/countries.json diff --git a/misc/languages.json b/app/misc/languages.json similarity index 100% rename from misc/languages.json rename to app/misc/languages.json diff --git a/misc/tor/start-tor.sh b/config/tor/start-tor.sh similarity index 100% rename from misc/tor/start-tor.sh rename to config/tor/start-tor.sh diff --git a/misc/tor/torrc b/config/tor/torrc similarity index 100% rename from misc/tor/torrc rename to config/tor/torrc diff --git a/setup.py b/setup.py index 84a8acd..ef0c673 100644 --- a/setup.py +++ b/setup.py @@ -8,10 +8,10 @@ setuptools.setup( author='Ben Busby', author_email='benbusby@protonmail.com', name='whoogle-search', - version='0.3.0', + version='0.3.1', include_package_data=True, install_requires=requirements, - description='Self-hosted, ad-free, privacy-respecting Google metasearch engine', + description='Self-hosted, ad-free, privacy-respecting metasearch engine', long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/benbusby/whoogle-search', diff --git a/test/misc b/test/misc new file mode 120000 index 0000000..4b8163d --- /dev/null +++ b/test/misc @@ -0,0 +1 @@ +../app/misc/ \ No newline at end of file