From 2ff0ca382fc16bbcc619acff566f9ace07da3655 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 11 Apr 2021 10:26:09 +0200 Subject: [PATCH] make config file location configurable via environment variables --- service.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service.py b/service.py index ecaa714..965d66f 100755 --- a/service.py +++ b/service.py @@ -2,11 +2,14 @@ import requests import urllib3 +from os import environ import tomlkit urllib3.disable_warnings() +CONFIGFILE = environ.get('STATUSPAGE_CONFIG', 'config.toml') + class StatusPage: def get_api_result(self): if self.services: @@ -141,7 +144,7 @@ class StatusPage: def __init__(self): - self.config = tomlkit.loads(open('config.toml').read()) + self.config = tomlkit.loads(open(CONFIGFILE).read()) self.services = {} self.ragecounter = 0