zulip / docker-zulip

Container configurations, images, and examples for Zulip.
https://zulip.com/
Apache License 2.0
550 stars 227 forks source link

Allow setting SCIM_CONFIG via env var #443

Open ariep opened 1 month ago

ariep commented 1 month ago

For configuring SCIM (user provisioning protocol) in Zulip, I need to set SCIM_CONFIG in settings.py. However, when I set SETTING_SCIM_CONFIG to the right value -- the string representation of a python dict -- this is written as a string value in settings.py. Reading entrypoint.sh, it seems SCIM_CONFIG could be added to its list of variables that take an array value, that would be the easy fix here.

Alternatively or additionally, it would help to extend the automatic detection in entrypoint.sh: it already checks if the value starts with [ or (; adding { to that would also cover this case.

sevmonster commented 1 month ago
diff --git a/entrypoint.sh b/entrypoint.sh
index 11f0b00..18b5fd6 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -282,6 +282,7 @@ zulipConfiguration() {
            [ "$setting_key" = "SOCIAL_AUTH_SAML_ENABLED_IDPS" ] || \
            [ "$setting_key" = "SOCIAL_AUTH_SAML_ORG_INFO" ] || \
            { [ "$setting_key" = "LDAP_APPEND_DOMAIN" ] && [ "$setting_var" = "None" ]; } || \
+           [ "$setting_key" = "SCIM_CONFIG" ] || \
            [ "$setting_key" = "SECURE_PROXY_SSL_HEADER" ] || \
            [[ "$setting_key" = "CSRF_"* ]] || \
            [ "$setting_key" = "REALM_HOSTS" ] || \

I've had this in my local copy for a long time.