allow overriding git related configs w/ env var and log permissions stuff on boot
This commit is contained in:
parent
0da4d04f60
commit
812c26ad9d
|
@ -82,13 +82,19 @@ def setup_config(app: Flask) -> None:
|
||||||
app.config.from_pyfile(f"{app.instance_path}/config.py", silent=True)
|
app.config.from_pyfile(f"{app.instance_path}/config.py", silent=True)
|
||||||
|
|
||||||
app.config["PERMISSIONS_FILE_FULLPATH"] = None
|
app.config["PERMISSIONS_FILE_FULLPATH"] = None
|
||||||
if app.config["SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME"]:
|
permissions_file_name = app.config["SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME"]
|
||||||
|
if permissions_file_name is not None:
|
||||||
app.config["PERMISSIONS_FILE_FULLPATH"] = os.path.join(
|
app.config["PERMISSIONS_FILE_FULLPATH"] = os.path.join(
|
||||||
app.root_path,
|
app.root_path,
|
||||||
"config",
|
"config",
|
||||||
"permissions",
|
"permissions",
|
||||||
app.config["SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME"],
|
permissions_file_name,
|
||||||
)
|
)
|
||||||
|
print(f"base_permissions: loaded permissions file: {permissions_file_name}")
|
||||||
|
else:
|
||||||
|
print("base_permissions: no permissions file loaded")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# unversioned (see .gitignore) config that can override everything and include secrets.
|
# unversioned (see .gitignore) config that can override everything and include secrets.
|
||||||
# src/spiffworkflow_backend/config/secrets.py
|
# src/spiffworkflow_backend/config/secrets.py
|
||||||
|
|
|
@ -69,6 +69,8 @@ GIT_BRANCH = environ.get("GIT_BRANCH")
|
||||||
GIT_CLONE_URL_FOR_PUBLISHING = environ.get("GIT_CLONE_URL")
|
GIT_CLONE_URL_FOR_PUBLISHING = environ.get("GIT_CLONE_URL")
|
||||||
GIT_COMMIT_ON_SAVE = environ.get("GIT_COMMIT_ON_SAVE", default="false") == "true"
|
GIT_COMMIT_ON_SAVE = environ.get("GIT_COMMIT_ON_SAVE", default="false") == "true"
|
||||||
GIT_SSH_PRIVATE_KEY = environ.get("GIT_SSH_PRIVATE_KEY")
|
GIT_SSH_PRIVATE_KEY = environ.get("GIT_SSH_PRIVATE_KEY")
|
||||||
|
GIT_USERNAME = environ.get("GIT_USERNAME")
|
||||||
|
GIT_USER_EMAIL = environ.get("GIT_USER_EMAIL")
|
||||||
|
|
||||||
# Datbase Configuration
|
# Datbase Configuration
|
||||||
SPIFF_DATABASE_TYPE = environ.get(
|
SPIFF_DATABASE_TYPE = environ.get(
|
||||||
|
|
Loading…
Reference in New Issue