WebHost: automatically fill PATCH_TARGET -> HOST_ADDRESS and re-use it for rooms (#1518)

This commit is contained in:
Fabian Dill
2023-03-09 21:31:00 +01:00
committed by GitHub
parent 2e76085cf1
commit 7fdf38b2ad
9 changed files with 23 additions and 15 deletions

View File

@@ -33,6 +33,11 @@ def get_app():
import yaml
app.config.from_file(configpath, yaml.safe_load)
logging.info(f"Updated config from {configpath}")
if not app.config["HOST_ADDRESS"]:
logging.info("Getting public IP, as HOST_ADDRESS is empty.")
app.config["HOST_ADDRESS"] = Utils.get_public_ipv4()
logging.info(f"HOST_ADDRESS was set to {app.config['HOST_ADDRESS']}")
db.bind(**app.config["PONY"])
db.generate_mapping(create_tables=True)
return app