#503#522
Conversation
This method takes 2 arguments:
1.) Environment Variable Prefix
2.) String of files separated by whitespace
e.g.
export LDAP_SEARCH_BASE=dc=domain,dc=loc
export LDAP_BIND_PW=test
overwrite_config "LDAP_" "/etc/postfix/ldap-users.cf
/etc/postfix/ldap-groups.cf"
Logic:
+ all env vars will be search for vars with the prefix LDAP_
+ afterwards they will be dissembled in key value pairs
LDAP_BIND_PW=test --> bind_pw test
+ the key and value will be substituted within the provided files
via sed
…container provisioning within /tmp/docker-mailserver
* check custom configs copied
* check environment variables substituted
|
Anyone using LDAP wanting to give a feedback on this PR? |
|
LDAP users, anyone? :-) |
|
@alinmear nobody want to help you I think :) |
|
@tomav :) ... I will write the README Section on my own within this PR. |
|
A page in the Wiki may be better to maintain. |
|
@tomav, sry for the delay, i need a day with 48 hours. This pr should be save to merge ... But 1 Thing to mention: we are only covering postfix and it's ldap parameterisation but not in detail the Dovecot side. For example we are not covering the I left this untouched but marked the section with the following:
We should open an issue The integration tests are covering test cases for successfully copying provided config files and also overriding the config with specified ENV-VARs. |
|
Hi @alinmear, same here for 48h days |
* Add method overwrite_config()
This method takes 2 arguments:
1.) Environment Variable Prefix
2.) String of files separated by whitespace
e.g.
export LDAP_SEARCH_BASE=dc=domain,dc=loc
export LDAP_BIND_PW=test
overwrite_config "LDAP_" "/etc/postfix/ldap-users.cf
/etc/postfix/ldap-groups.cf"
Logic:
+ all env vars will be search for vars with the prefix LDAP_
+ afterwards they will be dissembled in key value pairs
LDAP_BIND_PW=test --> bind_pw test
+ the key and value will be substituted within the provided files
via sed
* Fix docker-mailserver#503 added logic for custom configs provided at container
provisioning within /tmp/docker-mailserver
* Add additional unit tests for postfix ldap integration
* check custom configs copied
* check environment variables substituted
* Fix quoting problems in tests.bats
* Fix missing brackets in function _fix_var_amavis_permissions()
* Fix typo in _setup_ldap
* Fix notify in overwrite_config
* Fix typo
* Fix added dovecot ldap config provisioning again and Add notify for tasks
This PR fixes issue #503.
I also introduced a new method/logic to deal with config substitution "override_configs".
This method parses takes 2 argument: an env var prefix (like LDAP_) and a config file. See start-mailserver.sh for details. I think this could make the provisioning also for other config implementations much easier. Maybe we could write a section for developers at the end of the README.me to point at stuff like this.