From c42640e21c924115ea9af19fca20ce71ad133501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Tue, 20 Sep 2022 19:11:27 +0200 Subject: [PATCH] Use `read_config_bool` for vars in app init (#848) --- app/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index cdcf95e..1f6a310 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -15,6 +15,8 @@ from dotenv import load_dotenv from werkzeug.middleware.proxy_fix import ProxyFix +from app.utils.misc import read_config_bool + app = Flask(__name__, static_folder=os.path.dirname( os.path.abspath(__file__)) + '/static') @@ -25,12 +27,12 @@ dot_env_path = ( '../whoogle.env')) # Load .env file if enabled -if os.getenv('WHOOGLE_DOTENV', ''): +if read_config_bool('WHOOGLE_DOTENV'): load_dotenv(dot_env_path) app.default_key = generate_user_key() -if os.getenv('HTTPS_ONLY'): +if read_config_bool('HTTPS_ONLY'): app.config['SESSION_COOKIE_NAME'] = '__Secure-session' app.config['SESSION_COOKIE_SECURE'] = True