add/change conf-file options; add debug login

This commit is contained in:
lare 2022-11-17 07:20:03 +01:00
parent 1770eeb201
commit c1663e42cc
4 changed files with 23 additions and 14 deletions

View file

@ -1,13 +1,13 @@
{
"nodes": {
"<nodename>": {
"pub-endpoint": "<clearnet-fqdn/ip-address>",
"api-con": "http://<node-(internal)-ip/hostname>:<port>/",
"pub-endpoint": "<clearnet-fqdn/ip-address>", //optional, recommended
"api-con": "http://<node-(internal)-ip/hostname>:<port>/", // required
"comment": "/* from here: data to be displayed on the webinterface */",
"country": "...", // Countrycode: 2 capital letters
"city": "...",
"wg-key": "...=", // pubkey of node
"internal-v4": "172.2x.xxx.xxx",
"wg-key": "...=", // pubkey of node; required
"internal-v4": "172.2x.xxx.xxx", //at least one ipv{4,6} addr required
"internal-v6": "fdxx:...",
"internal-v4ll": "169.254.xxx.xxx",
"internal-v6ll": "fe80::..."
@ -17,7 +17,8 @@
"listen": "0.0.0.0",
"port": 8042,
"domain": "example.org", // domain to use for kioubit verification service
"base-dir": "/", //optional:directury for which it is reachable (if behind some sort of reverse proxy) default "/"
"debug-mode": false, // optional; whethet to enable debugging; default false
"flask-secret-key": "<secret-please-replace>", // secret key for session cookies
"flask-debug": false, // optional; default false
"flask-template-dir": "../frontend/" // optional; default "../frontend"
}

View file

@ -36,9 +36,10 @@ class Config (dict):
if not "flask-template-dir" in self._config:
self._config["flask-template-dir"] = "../frontend"
if not "flask-debug" in self._config:
self._config["flask-debug"] = False
if not "debug-mode" in self._config:
self._config["debug-mode"] = False
if not "base-dir" in self._config:
self._config["base-dir"] = "/"
print(self._config)
config = Config()
@ -122,7 +123,7 @@ def main():
app.static_folder= config["flask-template-dir"]+"/static/"
app.template_folder=config["flask-template-dir"]
app.secret_key = config["flask-secret-key"]
app.run(host=config["listen"], port=config["port"], debug=config["flask-debug"], threaded=True)
app.run(host=config["listen"], port=config["port"], debug=config["debug-mode"], threaded=True)
if __name__ == "__main__":