forked from Github-Mirrors/canaille
Configuration in its own dir
This commit is contained in:
parent
47c594d911
commit
f587eb4093
3 changed files with 6 additions and 3 deletions
|
@ -6,7 +6,8 @@ NAME = "MyDomain"
|
|||
LANGUAGE = "en"
|
||||
|
||||
# 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]
|
||||
URI = "ldap://ldap"
|
|
@ -28,8 +28,10 @@ def create_app(config=None):
|
|||
app.config.from_mapping(config)
|
||||
elif "CONFIG" in os.environ:
|
||||
app.config.from_mapping(toml.load(os.environ.get("CONFIG")))
|
||||
elif os.path.exists("config.toml"):
|
||||
app.config.from_mapping(toml.load("config.toml"))
|
||||
elif os.path.exists("conf/config.toml"):
|
||||
app.config.from_mapping(toml.load("conf/config.toml"))
|
||||
else:
|
||||
raise Exception("No configuration file found.")
|
||||
|
||||
setup_app(app)
|
||||
return app
|
||||
|
|
Loading…
Reference in a new issue