From 33f56bb0cb68e5e0d128d8076414aaf775318c48 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Tue, 1 Feb 2022 15:29:22 -0700 Subject: [PATCH] Read `WHOOGLE_CONFIG_DISABLE` var as bool in app init Fixes #636, which pointed out that the var was being interpreted as "active" (config hidden) regardless of the value that was set. --- app/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index ac626fb..8ae241e 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -2,7 +2,7 @@ from app.filter import clean_query from app.request import send_tor_signal from app.utils.session import generate_user_key from app.utils.bangs import gen_bangs_json -from app.utils.misc import gen_file_hash +from app.utils.misc import gen_file_hash, read_config_bool from flask import Flask from flask_session import Session import json @@ -58,7 +58,7 @@ app.config['CONFIG_PATH'] = os.getenv( app.config['DEFAULT_CONFIG'] = os.path.join( app.config['CONFIG_PATH'], 'config.json') -app.config['CONFIG_DISABLE'] = os.getenv('WHOOGLE_CONFIG_DISABLE', '') +app.config['CONFIG_DISABLE'] = read_config_bool('WHOOGLE_CONFIG_DISABLE') app.config['SESSION_FILE_DIR'] = os.path.join( app.config['CONFIG_PATH'], 'session')