diff --git a/bin/configuration.py b/bin/configuration.py index 763faf8..121a1f5 100644 --- a/bin/configuration.py +++ b/bin/configuration.py @@ -17,7 +17,14 @@ def read (file = None): if file is None: file = prefix+"/etc/config.yaml" with open(file, "r") as fd: - return _load(fd) + cfg = _load(fd) + + if "db" in cfg and "connection_string" in cfg["db"] and os.environ.get("PGDATABASE"): + # This should cause the PostgreSQL library to use the environment variables + cfg["db"]["connection_string"] = "" + print("Using environment variables for database connection") + + return cfg def files (globspec = None, include_archived = False): """