From 0a526a84f1272a4a33a49bb0300a80152ef138f0 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Tue, 27 Sep 2022 11:19:00 -0700 Subject: [PATCH] add extra environment settings --- webhooks.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/webhooks.py b/webhooks.py index 36d29d0..f84ac3c 100644 --- a/webhooks.py +++ b/webhooks.py @@ -13,9 +13,18 @@ app = Flask(__name__) # setup the environment SNAP_USER_DATA = os.environ.get('SNAP_USER_DATA') +CONFIG_FILE = os.environ.get('CONFIG_FILE') +LOG_FILE = os.environ.get('LOG_FILE') if SNAP_USER_DATA is None: - filename = 'config.yaml' - log_file = 'webhook.log' + if CONFIG_FILE is None: + filename = 'config.yaml' + else: + filename = CONFIG_FILE + + if LOG_FILE is None: + log_file = 'webhook.log' + else: + log_file = LOG_FILE else: filename = SNAP_USER_DATA + '/config.yaml' log_file = SNAP_USER_DATA + '/webhook.log'