Skip to content

Commit

Permalink
Add LDAP settings support (Fix victor-rds#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-rds committed Dec 9, 2022
1 parent 44be40b commit 8495159
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ If **DB_ENGINE** is set to **`postgres`** the following variables can be used, (
- **DATABASE_HOST**: `database`
- **DATABASE_PORT**: `5432`

For LDAP integration use the following variables, this is advanced usage please refer to the [etesync/server@fac36aa](https://github.com/etesync/server/commit/fac36aae1186201fdc5ae4874065a3528626ef68) commit on how to use and more details:

- **LDAP_SERVER**: The URL to LDAP server;
- **LDAP_BINDDN**: LDAP "user" to bind as. Must be a bind user;
- **LDAP_BIND_PW**: The password to authenticate as your bind user;
- **LDAP_FILTER**: LDAP filter query ('%%s' will be substituted for the username);
- **LDAP_SEARCH_BASE**: Search base;
- **LDAP_CACHE_TTL**: In case a cache TTL of 1 hour is too short for you, set `cache_ttl` to the preferred amount of hours a cache entry should be viewed as valid (optional);

### Docker Secrets

As an alternative to passing sensitive information via environment variables, _FILE may be appended to some of the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/<secret_name> files. For example:
Expand Down
14 changes: 14 additions & 0 deletions context/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,20 @@ gen_inifile() {
EOF
fi

if [ -n "${LDAP_SERVER}" ]; then
file_env 'LDAP_BIND_PW'

cat <<- EOF >> "${ETEBASE_EASY_CONFIG_PATH}"
[ldap]
server = ${LDAP_SERVER}
bind_dn = ${LDAP_BINDDN}
bind_pw = ${LDAP_BIND_PW}
search_base = ${LDAP_SEARCH_BASE}
filter = ${LDAP_FILTER}
${LDAP_CACHE_TTL:+cache_ttl = ${LDAP_CACHE_TTL}}
EOF
fi

dckr_info "Generated ${ETEBASE_EASY_CONFIG_PATH}"
}

Expand Down

0 comments on commit 8495159

Please sign in to comment.