Skip to content

Commit

Permalink
Added ability to sepcifiy different values for ldap 'host' and 'name'…
Browse files Browse the repository at this point in the history
… useful for k8s which will often have different internal and external names
  • Loading branch information
timothyclarke committed Aug 30, 2018
1 parent 887d2b6 commit 5abb107
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@ See how to [set your own environment variables](#set-your-own-environment-variab

To convert yaml to python online: http://yaml-online-parser.appspot.com/

If you would like to skip the display name == hostname element of the above use the **PHPLDAPADMIN_LDAP_HOSTS_FRIENDLY** environmental variable. This then uses the top most name as the display name of the server. You will then need to add host to the yaml within the server section. Note this is a global setting, if you do it for one server, you must do it for all. eg
```yaml
- Primary:
- server:
- host: ldap-master.example.org
- Backup:
- server:
- host: 192.168.0.100
```

Apache :
- **PHPLDAPADMIN_SERVER_ADMIN**: Server admin email. Defaults to `webmaster@example.org`
- **PHPLDAPADMIN_SERVER_PATH**: Server path (usefull if behind a reverse proxy). Defaults to `/phpldapadmin`
Expand Down
4 changes: 3 additions & 1 deletion image/service/phpldapadmin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ if [ ! -e "/var/www/phpldapadmin/config/config.php" ]; then
hostname=$(complex-bash-env getRowKey "${!host}")
info=$(complex-bash-env getRowValueVarName "${!host}")

if [ "${PHPLDAPADMIN_LDAP_HOSTS_FRIENDLY,,}" != "true" ]; then
append_to_file "\$servers->setValue('server','host','$hostname');"
fi
append_to_file "\$servers->setValue('server','name','$hostname');"
append_to_file "\$servers->setValue('server','host','$hostname');"
host_info "" "$info"

else
Expand Down

0 comments on commit 5abb107

Please sign in to comment.