Closed typekpb closed 7 years ago
I have the same problem.
To go further, when I ran "docker exec ...", the environment variable "PHPLDAPADMIN_SERVERS" is well set.
It's maybe a problem with the startup.sh call?
Problem detected on 0.6.9, 0.6.8 versions. The 0.6.7 version is working.
@lcotonea thanks for the version hint!
Seems to be a regression. downgrading to 0.6.7 locally, until fix arrives.
hi guys, i tried with this docker-compose.yml :
version: '2'
services:
ldap:
image: osixia/openldap
container_name: openldap_container
phpldapadmin:
image: osixia/phpldapadmin:0.6.9
container_name: phpldapadmin_container
depends_on:
- ldap
ports:
- "8092:80"
environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap
- PHPLDAPADMIN_HTTPS=false
everything seems ok. Could you provide your docker-compose.yml files ? Thanks.
Here my extract (docker-compose V1):
openldap:
image: dinkel/openldap
environment:
- SLAPD_ORGANIZATION=XXX
- SLAPD_DOMAIN=dc=xxx,dc=yyy,dc=com
- SLAPD_RECONFIGURE=true
volumes:
- $PWD/openldap/data/var/lib/ldap:/var/lib/ldap
- $PWD/openldap/data/etc/ldap:/etc/ldap
phpLDAPadmin:
image: osixia/phpldapadmin
environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap
- PHPLDAPADMIN_HTTPS=false
links:
- openldap:ldap
ports:
- "0.0.0.0:8081:80"
this works for me:
openldap:
image: dinkel/openldap
environment:
- SLAPD_ORGANIZATION=XXX
- SLAPD_DOMAIN=dc=xxx,dc=yyy,dc=com
- SLAPD_RECONFIGURE=true
- SLAPD_PASSWORD=test
volumes:
- $PWD/openldap/data/var/lib/ldap:/var/lib/ldap
- $PWD/openldap/data/etc/ldap:/etc/ldap
phpLDAPadmin:
image: osixia/phpldapadmin:0.6.7
environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap
- PHPLDAPADMIN_HTTPS=false
links:
- openldap:ldap
ports:
- "0.0.0.0:8081:80"
i added SLAPD_PASSWORD=test
to get it working otherwise a got Cannot link to a non running container
The following phpLDAPadmin configuration is created :
<?php
/** NOTE **
** Make sure that <?php is the FIRST line of this file!
** IE: There should NOT be any blank lines or spaces BEFORE <?php
**/
/*********************************************
* Useful important configuration overrides *
*********************************************/
/* If you are asked to put PLA in debug mode, this is how you do it: */
$config->custom->debug['level'] = 0;
$config->custom->debug['syslog'] = true;
# $config->custom->debug['file'] = '/tmp/pla_debug.log';
/**
* The phpLDAPadmin config file
* See: http://phpldapadmin.sourceforge.net/wiki/index.php/Config.php
*/
/* The temporary storage directory where we will put jpegPhoto data
This directory must be readable and writable by your web server. */
$config->custom->jpeg['tmpdir'] = '/var/www/tmp';
/* phpLDAPadmin can encrypt the content of sensitive cookies if you set this
to a big random string. */
/*
* Autogenerated value will be automatically added by phpldapadmin/startup.sh
*/
$config->custom->session['blowfish'] = 'YHjZd/=qvO!UY_ssP#ObXjuaP{.k]Vuy]z^aiFDt$?Ppw?L%%X[jh$f[*_:J/>Ew';
/*********************************************
* Appearance *
*********************************************/
/* Hide the warnings for invalid objectClasses/attributes in templates. */
$config->custom->appearance['hide_template_warning'] = true;
/*********************************************
* User-friendly attribute translation *
*********************************************/
/* Use this array to map attribute names to user friendly names. For example, if
you don't want to see "facsimileTelephoneNumber" but rather "Fax". */
// $config->custom->appearance['friendly_attrs'] = array();
$config->custom->appearance['friendly_attrs'] = array(
'facsimileTelephoneNumber' => 'Fax',
'gid' => 'Group',
'mail' => 'Email',
'telephoneNumber' => 'Telephone',
'uid' => 'User Name',
'userPassword' => 'Password'
);
/*********************************************
* Define your LDAP servers in this section *
*********************************************/
$servers = new Datastore();
/*
* Autogenerated servers variables will come here
*/
$servers->newServer('ldap_pla');
$servers->setValue('server','name','ldap');
$servers->setValue('server','host','ldap');
in /var/www/phpldapadmin/config/config.php
The version of osixia/phpldapadmin is 0.6.7 in your test (my fault, because of a wrong copy&paste). Can you test with the latest version please ?
Just tried with 0.6.8 and 0.6.9 with the same result eveything seems ok. can you tried running this and show the outputs ?
openldap:
image: dinkel/openldap
environment:
- SLAPD_ORGANIZATION=XXX
- SLAPD_DOMAIN=dc=xxx,dc=yyy,dc=com
- SLAPD_RECONFIGURE=true
- SLAPD_PASSWORD=test
volumes:
- $PWD/openldap/data/var/lib/ldap:/var/lib/ldap
- $PWD/openldap/data/etc/ldap:/etc/ldap
phpLDAPadmin:
image: osixia/phpldapadmin:0.6.9
environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap
- PHPLDAPADMIN_HTTPS=false
command: -l debug
links:
- openldap:ldap
ports:
- "0.0.0.0:8081:80"
(command: -l debug
was added)
if there is nothing special with -l debug run with -l trace please :)
Ok, I think I've identified the problem.... When I sent you the sample docker compose file, I've replaced my SLAPD_ORGANIZATION variable by XXX. But in my file, there is some spaces into the variable value.
Try with that and the problem will occur:
openldap:
image: dinkel/openldap
environment:
- SLAPD_ORGANIZATION=My Organisation Com
- SLAPD_DOMAIN=dc=my,dc=organisation,dc=com
- SLAPD_RECONFIGURE=true
- SLAPD_PASSWORD=test
volumes:
- $PWD/openldap/data/var/lib/ldap:/var/lib/ldap
- $PWD/openldap/data/etc/ldap:/etc/ldap
phpLDAPadmin:
image: osixia/phpldapadmin:0.6.9
environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap
- PHPLDAPADMIN_HTTPS=false
command: -l debug
links:
- openldap:ldap
ports:
- "0.0.0.0:8081:80"
@osixia Any updates here? Don't want to rush, rather just curious. On Jun 14, 2016 12:30, "Loïc Cotonéa" notifications@github.com wrote:
Ok, I think I've identified the problem.... When I sent you the sample docker compose file, I've replaced my SLAPD_ORGANIZATION variable by XXX. But in my file, there is some spaces into the variable value.
Try with that and the problem will occur:
openldap: image: dinkel/openldap environment:
- SLAPD_ORGANIZATION=My Organisation Com
- SLAPD_DOMAIN=dc=my,dc=organisation,dc=com
- SLAPD_RECONFIGURE=true
- SLAPD_PASSWORD=test volumes:
- $PWD/openldap/data/var/lib/ldap:/var/lib/ldap
- $PWD/openldap/data/etc/ldap:/etc/ldap phpLDAPadmin: image: osixia/phpldapadmin:0.6.9 environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap
- PHPLDAPADMIN_HTTPS=false command: -l debug links:
- openldap:ldap ports:
- "0.0.0.0:8081:80"
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/osixia/docker-phpLDAPadmin/issues/23#issuecomment-225842350, or mute the thread https://github.com/notifications/unsubscribe/AAegbFq2tru-33T1hvAXpHqK6WJxW6HXks5qLoLTgaJpZM4Ivyc6 .
I'm fairly certain that the problem is the blowfish value that's autogenerated. Sometimes, a character is in the string that isn't properly escaped and PHP has a parsing error. This is why the problem is intermittent.
Unfortunately, since it's intermittent, I'm having an issue reproducing it to be absolutely certain. 😆
@cfairweather yes me too :smile:
For me it looked to be caused by the {{ PHPLDAPADMIN_SERVERS }}
line in config.php not being replaced (line 68)
It seemed to happen when the ldap-admin container would start before the ldap container - causing it to appear intermittent.
Using docker-compose depends_on fixed it for me
ldap-admin:
image: osixia/phpldapadmin
depends_on:
- ldap
environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap
...
Agreed, I actual saw this issue happen today where the "templating" wasn't applied to the configuration file.
Cristoffer
On Jul 6, 2016, at 16:25, Taylor Ludwig notifications@github.com wrote:
For me it looked to be caused by the {{ PHPLDAPADMIN_SERVERS }} line in config.php not being replaced (line 68)
It seemed to happen when the ldap-admin container would start before the ldap container - causing it to appear intermittent.
Using docker-compose depends_on fixed it for me
ldap-admin: image: osixia/phpldapadmin depends_on:
- ldap environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap ... — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Still getting the same error here, with 0.6.11
and depends_on
set:
compose.yml:
ldap:
container_name: ldap
image: 'osixia/openldap:1.1.6'
environment:
LDAP_ORGANISATION: 'xx'
LDAP_DOMAIN: 'xx.com'
LDAP_ADMIN_PASSWORD: 'admin'
volumes:
- /usr/local/ldapdata:/var/lib/ldap
- /usr/local/ldapcfg:/etc/ldap/slapd.d
ldap_admin:
container_name: ldap_admin
image: 'osixia/phpldapadmin:0.6.11'
links:
- ldap
depends_on:
- ldap
environment:
PHPLDAPADMIN_HTTPS: 'false'
PHPLDAPADMIN_LDAP_HOSTS: 'ldap'
ports:
- '6080:80'
command: '-l debug'
last bit of log:
ldap_admin | *** Set environment for container process
ldap_admin | *** Environment files will be proccessed in this order :
ldap_admin | Caution: previously defined variables will not be overriden.
ldap_admin | /container/environment/99-default/default.yaml
ldap_admin |
ldap_admin | *** --- process file : /container/environment/99-default/default.yaml ---
ldap_admin | *** ignore : PHPLDAPADMIN_HTTPS = True (keep PHPLDAPADMIN_HTTPS = false )
ldap_admin | *** Run commands before process...
ldap_admin | *** ------------ Environment dump ------------
ldap_admin | *** PHPLDAPADMIN_HTTPS = false
ldap_admin | *** LC_CTYPE = C.UTF-8
ldap_admin | *** PHPLDAPADMIN_SSL_HELPER_PREFIX = phpldapadmin
ldap_admin | *** PHPLDAPADMIN_VERSION = 1.2.3
ldap_admin | *** INITRD = no
ldap_admin | *** HOME = /root
ldap_admin | *** PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ldap_admin | *** PHPLDAPADMIN_HTTPS_KEY_FILENAME = phpldapadmin.key
ldap_admin | *** LANG = C.UTF-8
ldap_admin | *** affinity:container = =64ecd3c116d91d415007c1a5f5662d221dedb783e3a12d6548a9322d886d8e71
ldap_admin | *** PHPLDAPADMIN_SERVER_ADMIN = webmaster@example.org
ldap_admin | *** CONTAINER_SERVICE_DIR = /container/service
ldap_admin | *** PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME = ca.crt
ldap_admin | *** LANGUAGE = C.UTF-8
ldap_admin | *** PHPLDAPADMIN_HTTPS_CRT_FILENAME = phpldapadmin.crt
ldap_admin | *** PHPLDAPADMIN_TRUST_PROXY_SSL = False
ldap_admin | *** PHPLDAPADMIN_LDAP_HOSTS = ldap
ldap_admin | *** PHPLDAPADMIN_SHA1 = 669fca66c75e24137e106fdd02e3832f81146e23
ldap_admin | *** CONTAINER_LOG_LEVEL = 4
ldap_admin | *** HOSTNAME = 12bcc2afbc95
ldap_admin | *** CONTAINER_STATE_DIR = /container/run/state
ldap_admin | *** PHPLDAPADMIN_SERVER_PATH = /phpldapadmin
ldap_admin | *** ------------------------------------------
ldap_admin | *** Running runit daemon...
ldap_admin | *** runit daemon started as PID 1431
ldap_admin | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.6. Set the 'ServerName' directive globally to suppress this message
inside container the last bit of config.php still has templating intact:
/*********************************************
* Define your LDAP servers in this section *
*********************************************/
$servers = new Datastore();
/*
* Autogenerated servers variables will come here
*/
{{ PHPLDAPADMIN_SERVERS }}
Any ideas?
Any way I can add a startup delay to the admin container to make sure the ldap container has time to start up properly?
I'm also having this issue. Tried it with 0.6.9, -10 and 11. Stripped out the space in my organisation name.
PHPLDAPADMIN_SERVERS is not replaced in the config.
@thearrow did you find a solution?
@sirrapa I ended up just using this docker image instead: https://hub.docker.com/r/dinkel/phpldapadmin/
running in docker-compose, relevant section is:
docker-compose up
output (filtered for specific container):however, once started and navigating to http://localhost:8092/, I see:
I checked the contents of the specific file:
The problematic line referred to is the last one. How can I fix it?