make config file location configurable via environment variables

This commit is contained in:
Franzi 2021-04-11 10:26:09 +02:00
parent 48232c50cf
commit 2ff0ca382f
Signed by untrusted user: kunsi
GPG Key ID: 12E3D2136B818350
1 changed files with 4 additions and 1 deletions

View File

@ -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