Skip to content

Commit 582b08d

Browse files
committed
Merge branch 'hotfix-0.6.4' into stable
2 parents eaf1326 + 902f0df commit 582b08d

File tree

9 files changed

+66
-55
lines changed

9 files changed

+66
-55
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
# Changelog
22

3+
## 0.6.4
4+
- Upgrade baseimage: web-baseimage:0.1.5
5+
- Remove listen on http when https is enable
6+
- externalise ldap-client config from phpLdapAdmin
7+
38
## 0.6.3
4-
- Upgrade baseimage: osixia/web-baseimage:0.1.3
9+
- Upgrade baseimage: web-baseimage:0.1.3
510

611
## 0.6.2
712
- Better way to add custom config
813

914
## 0.6.1
10-
- Upgrade baseimage: osixia/web-baseimage:0.1.1
15+
- Upgrade baseimage: web-baseimage:0.1.1
1116
- Rename environment variables
1217

1318
## 0.6.0
14-
- Use new baseimage: osixia/light-baseimage
19+
- Use new baseimage: light-baseimage
1520

1621
## 0.5.1
1722
- Fix #1 (can't activate SSL with own certificates)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = osixia/phpldapadmin
2-
VERSION = 0.6.3
2+
VERSION = 0.6.4
33

44
.PHONY: all build test tag_latest release
55

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Example script:
2929
LDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP_CID)
3030

3131
# Run phpLDAPadmin and set ldap host to ldap ip
32-
PHPLDAP_CID=$(docker run -h phpldapadmin.example.org -e PHPLDAPADMIN_LDAP_HOSTS=$LDAP_IP -d osixia/phpldapadmin:0.6.2)
32+
PHPLDAP_CID=$(docker run -h phpldapadmin.example.org -e PHPLDAPADMIN_LDAP_HOSTS=$LDAP_IP -d osixia/phpldapadmin:0.6.4)
3333

3434
# We get phpLDAPadmin container ip
3535
PHPLDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $PHPLDAP_CID)
@@ -112,9 +112,9 @@ Ldap client TLS/LDAPS :
112112

113113
- **PHPLDAPADMIN_LDAP_CLIENT_TLS**: Enable ldap client tls config, ldap serveur certificate check and set client certificate. Defaults to `true`
114114
- **PHPLDAPADMIN_LDAP_CLIENT_TLS_REQCERT**: Set ldap.conf TLS_REQCERT. Defaults to `demand`
115-
- **PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME**: Set ldap.conf TLS_CACERT to /container/service/phpldapadmin/assets/ldap-client/certs/$PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME. Defaults to `ldap-ca.crt`
116-
- **PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME**: Set .ldaprc TLS_CERT to /container/service/phpldapadmin/assets/ldap-client/certs/$PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME. Defaults to `ldap-client.crt`
117-
- **PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME**: Set .ldaprc TLS_KEY to /container/service/phpldapadmin/assets/ldap-client/certs/$PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME. Defaults to `ldap-client.key`
115+
- **PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME**: Set ldap.conf TLS_CACERT to /container/service/ldap-client/assets/certs/$PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME. Defaults to `ldap-ca.crt`
116+
- **PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME**: Set .ldaprc TLS_CERT to /container/service/ldap-client/assets/certs/$PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME. Defaults to `ldap-client.crt`
117+
- **PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME**: Set .ldaprc TLS_KEY to /container/service/ldap-client/assets/certs/$PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME. Defaults to `ldap-client.key`
118118

119119
More information at : http://www.openldap.org/doc/admin24/tls.html (16.2.2. Client Configuration)
120120

@@ -140,7 +140,7 @@ Clone this project :
140140
Adapt Makefile, set your image NAME and VERSION, for example :
141141

142142
NAME = osixia/phpldapadmin
143-
VERSION = 0.6.2
143+
VERSION = 0.6.4
144144

145145
becomes :
146146
NAME = billy-the-king/phpldapadmin

image/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM osixia/web-baseimage:0.1.3
1+
FROM osixia/web-baseimage:0.1.5
22
MAINTAINER Bertrand Gouny <bertrand.gouny@osixia.net>
33

44
# phpLDAPadmin version
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add your ldap client certificate, key and CA certificate here
2+
or during docker run mount a data volume with thoses files to /container/service/ldap-client/assets/certs
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash -e
2+
3+
FIRST_START_DONE="/etc/docker-ldap-client-first-start-done"
4+
5+
# container first start
6+
if [ ! -e "$FIRST_START_DONE" ]; then
7+
8+
if [ "${PHPLDAPADMIN_LDAP_CLIENT_TLS,,}" == "true" ]; then
9+
10+
# check certificat and key or create it
11+
/sbin/ssl-helper "/container/service/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME}" "/container/service/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME}" --ca-crt=/container/service/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME} --gnutls
12+
13+
# ldap client config
14+
sed -i "s,TLS_CACERT.*,TLS_CACERT /container/service/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME},g" /etc/ldap/ldap.conf
15+
echo "TLS_REQCERT $PHPLDAPADMIN_LDAP_CLIENT_TLS_REQCERT" >> /etc/ldap/ldap.conf
16+
17+
www_data_homedir=$( getent passwd "www-data" | cut -d: -f6 )
18+
19+
[[ -f "$www_data_homedir/.ldaprc" ]] && rm -f $www_data_homedir/.ldaprc
20+
touch $www_data_homedir/.ldaprc
21+
echo "TLS_CERT /container/service/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME}" >> $www_data_homedir/.ldaprc
22+
echo "TLS_KEY /container/service/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME}" >> $www_data_homedir/.ldaprc
23+
24+
chown www-data:www-data -R /container/service/ldap-client/assets/certs/
25+
fi
26+
27+
touch $FIRST_START_DONE
28+
fi
29+
30+
exit 0
Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
1-
<VirtualHost *:80>
2-
ServerName ${HOSTNAME}
3-
Redirect permanent / https://${HOSTNAME}/
4-
</VirtualHost>
5-
6-
<IfModule mod_ssl.c>
7-
<VirtualHost _default_:443>
1+
<VirtualHost _default_:443>
82

9-
ServerName ${HOSTNAME}
10-
ServerAdmin ${PHPLDAPADMIN_SERVER_ADMIN}
11-
ServerPath /phpldapadmin
3+
ServerName ${HOSTNAME}
4+
ServerAdmin ${PHPLDAPADMIN_SERVER_ADMIN}
5+
ServerPath /phpldapadmin
126

13-
DocumentRoot /var/www/phpldapadmin/htdocs
7+
DocumentRoot /var/www/phpldapadmin/htdocs
148

15-
ErrorLog ${APACHE_LOG_DIR}/error.log
16-
CustomLog ${APACHE_LOG_DIR}/access.log combined
9+
ErrorLog ${APACHE_LOG_DIR}/error.log
10+
CustomLog ${APACHE_LOG_DIR}/access.log combined
1711

18-
Include /etc/apache2/conf-available/vhost-partial-ssl.conf
12+
Include /etc/apache2/conf-available/vhost-partial-ssl.conf
1913

20-
SSLCertificateFile /container/service/phpldapadmin/assets/apache2/certs/${PHPLDAPADMIN_HTTPS_CRT_FILENAME}
21-
SSLCertificateKeyFile /container/service/phpldapadmin/assets/apache2/certs/${PHPLDAPADMIN_HTTPS_KEY_FILENAME}
22-
#SSLCACertificateFile /container/service/phpldapadmin/assets/apache2/certs/${PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME}
14+
SSLCertificateFile /container/service/phpldapadmin/assets/apache2/certs/${PHPLDAPADMIN_HTTPS_CRT_FILENAME}
15+
SSLCertificateKeyFile /container/service/phpldapadmin/assets/apache2/certs/${PHPLDAPADMIN_HTTPS_KEY_FILENAME}
16+
#SSLCACertificateFile /container/service/phpldapadmin/assets/apache2/certs/${PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME}
2317

24-
<Directory /var/www/phpldapadmin/htdocs >
25-
Require all granted
26-
</Directory>
18+
<Directory /var/www/phpldapadmin/htdocs >
19+
Require all granted
20+
</Directory>
2721

28-
<files config.php >
29-
Require all denied
30-
</files>
22+
<files config.php >
23+
Require all denied
24+
</files>
3125

32-
</VirtualHost>
33-
</IfModule>
26+
</VirtualHost>

image/service/phpldapadmin/container-start.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -131,25 +131,6 @@ if [ ! -e "$FIRST_START_DONE" ]; then
131131

132132
fi
133133

134-
if [ "${PHPLDAPADMIN_LDAP_CLIENT_TLS,,}" == "true" ]; then
135-
136-
# check certificat and key or create it
137-
/sbin/ssl-helper "/container/service/phpldapadmin/assets/ldap-client/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME}" "/container/service/phpldapadmin/assets/ldap-client/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME}" --ca-crt=/container/service/phpldapadmin/assets/ldap-client/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME} --gnutls
138-
139-
# ldap client config
140-
sed -i "s,TLS_CACERT.*,TLS_CACERT /container/service/phpldapadmin/assets/ldap-client/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME},g" /etc/ldap/ldap.conf
141-
echo "TLS_REQCERT $PHPLDAPADMIN_LDAP_CLIENT_TLS_REQCERT" >> /etc/ldap/ldap.conf
142-
143-
www_data_homedir=$( getent passwd "www-data" | cut -d: -f6 )
144-
145-
[[ -f "$www_data_homedir/.ldaprc" ]] && rm -f $www_data_homedir/.ldaprc
146-
touch $www_data_homedir/.ldaprc
147-
echo "TLS_CERT /container/service/phpldapadmin/assets/ldap-client/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME}" >> $www_data_homedir/.ldaprc
148-
echo "TLS_KEY /container/service/phpldapadmin/assets/ldap-client/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME}" >> $www_data_homedir/.ldaprc
149-
150-
chown www-data:www-data -R /container/service/phpldapadmin/assets/ldap-client/certs/
151-
fi
152-
153134
# fix file permission
154135
find /var/www/ -type d -exec chmod 755 {} \;
155136
find /var/www/ -type f -exec chmod 644 {} \;

test/test.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ load test_helper
2929
tmp_file="$BATS_TMPDIR/docker-test"
3030

3131
# we start a new openldap container
32-
LDAP_CID=$(docker run -d osixia/openldap:1.0.1)
32+
LDAP_CID=$(docker run -d osixia/openldap:1.0.4)
3333
LDAP_IP=$(get_container_ip_by_cid $LDAP_CID)
3434

3535
# we start the wordpress container and set DB_HOSTS

0 commit comments

Comments
 (0)