summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvuko <vuko@hackerspace.pl>2020-10-24 01:11:00 +0200
committervuko <vuko@hackerspace.pl>2020-10-24 01:11:42 +0200
commit01aaf4b80b106d9adfa0a6a2a39c012109dfb578 (patch)
tree168fa7b84e3294ada9b842590265fa4a4fe45a82
parent9aaab2f04ff11a88d31908d91a4dbdd5b8d93f45 (diff)
downloadcheckinator-01aaf4b80b106d9adfa0a6a2a39c012109dfb578.tar.gz
checkinator-01aaf4b80b106d9adfa0a6a2a39c012109dfb578.tar.bz2
checkinator-01aaf4b80b106d9adfa0a6a2a39c012109dfb578.zip
load config from environment variable
-rw-r--r--at/webapp.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/at/webapp.py b/at/webapp.py
index 2da0e7b..d26eac4 100644
--- a/at/webapp.py
+++ b/at/webapp.py
@@ -4,6 +4,7 @@ import at.web
from at.dhcp import DhcpdUpdater
from pathlib import Path
import yaml
+import os
import grpc
from at.tracker_pb2 import ClientsRequest
@@ -40,7 +41,8 @@ class DevicesApi:
return None, None
-config = yaml.safe_load(Path('web-config.yaml').read_text())
+config_path = Path(os.environ.get("CHECKINATOR_WEB_CONFIG", 'web-config.yaml'))
+config = yaml.safe_load(config_path.read_text())
#updater = DhcpdUpdater(config['LEASE_FILE'], config['TIMEOUT'])
#updater.start()