Configuration in its own dir

This commit is contained in:
Éloi Rivard 2020-08-27 15:30:21 +02:00
parent 47c594d911
commit f587eb4093
3 changed files with 6 additions and 3 deletions

View file

@ -6,7 +6,8 @@ NAME = "MyDomain"
LANGUAGE = "en" LANGUAGE = "en"
# Path to the RFC8414 metadata file # Path to the RFC8414 metadata file
OAUTH2_METADATA_FILE = "oauth-authorization-server" OAUTH2_METADATA_FILE = "conf/oauth-authorization-server"
OIDC_METADATA_FILE = "conf/openid_configuration"
[LDAP] [LDAP]
URI = "ldap://ldap" URI = "ldap://ldap"

View file

@ -28,8 +28,10 @@ def create_app(config=None):
app.config.from_mapping(config) app.config.from_mapping(config)
elif "CONFIG" in os.environ: elif "CONFIG" in os.environ:
app.config.from_mapping(toml.load(os.environ.get("CONFIG"))) app.config.from_mapping(toml.load(os.environ.get("CONFIG")))
elif os.path.exists("config.toml"): elif os.path.exists("conf/config.toml"):
app.config.from_mapping(toml.load("config.toml")) app.config.from_mapping(toml.load("conf/config.toml"))
else:
raise Exception("No configuration file found.")
setup_app(app) setup_app(app)
return app return app