osixia / docker-phpLDAPadmin

phpLDAPadmin container image 🐳🌴
MIT License
844 stars 197 forks source link

Fix PHPLDAPADMIN_LDAP_HOSTS to treat as a valid environment variable. #24

Closed shinnya closed 7 years ago

shinnya commented 7 years ago

Hi. I found that I set PHPLDAPADMIN_LDAP_HOSTS environment variable, but it didn't reflect my setting. I think image/service/phpldapadmin/startup.sh doesn't handle the environment variable properly because $ is missing.

Best Regards,

osixia commented 7 years ago

Hi, Sorry this may not fix you issue. Please refer to: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/complex-bash-env

Can you describe your probleme instead ?

shinnya commented 7 years ago

Thank you for your quick reply! Uhmm, It seems that I misunderstood complex-bash-env.

My problem was that I created my container with docker-compose and couldn't configure /var/www/phpldapadmin/config/config.php properly. When I executed docker-compose up -d multiple times without shutting down my containers by docker-compose down, the following settings listed in README weren't generated.

$servers->newServer('ldap_pla');
$servers->setValue('server','name','ldap.example.org');
$servers->setValue('server','host','ldap.example.org');
$servers->setValue('server','tls',true);
$servers->setValue('login','bind_id','cn=admin,dc=example,dc=org');
$servers->newServer('ldap_pla');
$servers->setValue('server','name','ldap2.example.org');
$servers->setValue('server','host','ldap2.example.org');
$servers->newServer('ldap_pla');
$servers->setValue('server','name','ldap3.example.org');
$servers->setValue('server','host','ldap3.example.org');

Alternatively I got the following:

{{ PHPLDAPADMIN_SERVERS }}

Anyway, now I've succeded in setting up my LDAP server correctly. Thank you.