| |
@@ -170,15 +170,43 @@
|
| |
temp.write(os.environ["CLIENT_SECRETS"])
|
| |
temp.close()
|
| |
config_object["OIDC_CLIENT_SECRETS"] = temp.name
|
| |
- except(KeyError):
|
| |
+ except KeyError:
|
| |
print("OpenShift mode enabled but required values couldn't be fetched. "
|
| |
"Check, if you have these variables defined in you env: "
|
| |
- "(POSTGRESQL_[USER, PASSWORD, DATABASE, SERVICE_HOST, SERVICE_PORT], SECRET_KEY, CLIENT_SECRETS)", file=sys.stderr)
|
| |
+ "(POSTGRESQL_[USER, PASSWORD, DATABASE, SERVICE_HOST, SERVICE_PORT], SECRET_KEY, CLIENT_SECRETS)",
|
| |
+ file=sys.stderr)
|
| |
+ sys.exit(1)
|
| |
+
|
| |
+ # Let's try redis
|
| |
+ try:
|
| |
+ config_object["CELERY_BROKER_URL"] = "redis://:%s@%s:%s" % (
|
| |
+ os.environ["REDIS_PASSWORD"],
|
| |
+ os.environ["REDIS_SERVICE_HOST"],
|
| |
+ os.environ["REDIS_SERVICE_PORT_REDIS"]
|
| |
+ )
|
| |
+ config_object["CELERY_RESULT_BACKEND"] = config_object["CELERY_BROKER_URL"]
|
| |
+ except KeyError:
|
| |
+ print("OpenShift mode enabled but Redis instance couldn't be reached."
|
| |
+ "Please, make sure REDIS_[PASSWORD, SERVICE_HOST, SERVICE_PORT_REDIS] are available in env.",
|
| |
+ file=sys.stderr)
|
| |
sys.exit(1)
|
| |
|
| |
# Get some more data from OpenShift, if set
|
| |
if os.getenv("KANBAN_CONFIG"):
|
| |
config_object["KANBAN_CONFIG"] = os.getenv("KANBAN_CONFIG")
|
| |
+ if os.getenv("ALLOWED_PACKAGER_GROUPS"):
|
| |
+ config_object["ALLOWED_PACKAGER_GROUPS"] = os.getenv("ALLOWED_PACKAGER_GROUPS")
|
| |
+ if os.getenv("EPEL_RELEASES"):
|
| |
+ config_object["EPEL_RELEASES"] = os.getenv("EPEL_RELEASES")
|
| |
+ if os.getenv("SMTP_CONFIG"):
|
| |
+ smtp_config = os.getenv("SMTP_CONFIG").split(";")
|
| |
+ config_object["SEND_ERROR_EMAILS"] = True
|
| |
+ config_object["SMTP_SERVER"] = smtp_config[0]
|
| |
+ config_object["SMTP_PORT"] = smtp_config[1]
|
| |
+ config_object["SMTP_LOGIN"] = smtp_config[2]
|
| |
+ config_object["SMTP_SENDER"] = smtp_config[3]
|
| |
+ config_object["SMTP_PASSWORD"] = smtp_config[4]
|
| |
+ config_object["ADMIN_EMAILS"] = os.getenv("ADMIN_EMAILS")
|
| |
|
| |
# Some final touches for oidc
|
| |
if os.getenv("OVERWRITE_REDIRECT_URI"):
|
| |
Current state: Container builds and runs , both in podman (dev) and OpenShift (production).