Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SETTING_AUTH_LDAP_GROUP_TYPE and import statement not passed through properly the entrypoint script #252

Open
tobiasjj opened this issue Apr 25, 2020 · 1 comment

Comments

@tobiasjj
Copy link

To make LDAP group authentication for an Active Directory work, I have to add the following to the settings.py file:

from django_auth_ldap.config import ActiveDirectoryGroupType
AUTH_LDAP_GROUP_TYPE = ActiveDirectoryGroupType(name_attr="cn")

However, trying to add

SETTING_AUTH_LDAP_GROUP_TYPE: ActiveDirectoryGroupType(name_attr="cn") 

to the docker-compose.yml file, results in an error upon LDAP requests. The value ActiveDirectoryGroupType(name_attr="cn") is added to settings.py as a string and the proper import statement for the class ActiveDirectoryGroupType is missing.

Setting the following in docker-compose.yml solves the issue:
ZULIP_CUSTOM_SETTINGS: 'from django_auth_ldap.config import ActiveDirectoryGroupType\nAUTH_LDAP_GROUP_TYPE = ActiveDirectoryGroupType(name_attr="cn")'

I suggest adding rules to process AUTH_LDAP_GROUP_TYPE in entrypoint.sh and automatically import missing classes.

@timabbott
Copy link
Member

Yeah, we should probably just import the full set of things that are useful in prod_settings_template.py to avoid this. @hackerkid FYI.

ivanbakel pushed a commit to ivanbakel/zulip that referenced this issue Feb 7, 2024
All of these types may potentially be used by users of this settings
template, so it's handy to add them in. This avoids missing import
errors later.

This is an especially helpful change for the Zulip docker image, where
importing extra types is a bit annoying.

Fixes zulip/docker-zulip#252
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants