Skip to content

Commit c6861a7

Browse files
committed
Merge branch 'release-0.7.0' into stable
2 parents 1eabb92 + 0c56031 commit c6861a7

File tree

15 files changed

+63
-65
lines changed

15 files changed

+63
-65
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Changelog
22

3+
## 0.7.0
4+
- add config.php in config folder
5+
- Upgrade baseimage: web-baseimage:1.1.0 (debian stretch, php7)
6+
37
## 0.6.12
4-
- Fixes Parse error: syntax error, unexpected '}' in /container/service/phpldapadmin/assets/config.php on line 68 #23
8+
- Fixes Parse error: syntax error, unexpected '}' in config.php on line 68 #23
59
- Upgrade baseimage: web-baseimage:1.0.0
610

711
## 0.6.11

Makefile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
NAME = osixia/phpldapadmin
2-
VERSION = 0.6.12
2+
VERSION = 0.7.0
33

4-
.PHONY: all build build-nocache test tag_latest release
5-
6-
all: build
4+
.PHONY: build build-nocache test tag-latest push push-latest release git-tag-version
75

86
build:
97
docker build -t $(NAME):$(VERSION) --rm image
@@ -14,10 +12,17 @@ build-nocache:
1412
test:
1513
env NAME=$(NAME) VERSION=$(VERSION) bats test/test.bats
1614

17-
tag_latest:
15+
tag-latest:
1816
docker tag $(NAME):$(VERSION) $(NAME):latest
1917

20-
release: build test tag_latest
21-
@if ! docker images $(NAME) | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME) version $(VERSION) is not yet built. Please run 'make build'"; false; fi
22-
docker push $(NAME)
23-
@echo "*** Don't forget to run 'twgit release/hotfix finish' :)"
18+
push:
19+
docker push $(NAME):$(VERSION)
20+
21+
push-latest:
22+
docker push $(NAME):latest
23+
24+
release: build test tag-latest push push-latest
25+
26+
git-tag-version: release
27+
git tag -a v$(VERSION) -m "v$(VERSION)"
28+
git push origin v$(VERSION)

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[hub]: https://hub.docker.com/r/osixia/phpldapadmin/
77

8-
Latest release: 0.6.12 - phpLDAPadmin 1.2.3 (with php5.5 patch) - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/phpldapadmin/) 
8+
Latest release: 0.7.0 - phpLDAPadmin 1.2.3 (with php7 patch) - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/phpldapadmin/) 
99

1010
**A docker image to run phpLDAPadmin.**
1111
> [phpldapadmin.sourceforge.net](http://phpldapadmin.sourceforge.net)
@@ -26,7 +26,7 @@ Latest release: 0.6.12 - phpLDAPadmin 1.2.3 (with php5.5 patch) - [Changelog](CH
2626
- [Link environment file](#link-environment-file)
2727
- [Make your own image or extend this image](#make-your-own-image-or-extend-this-image)
2828
- [Advanced User Guide](#advanced-user-guide)
29-
- [Extend osixia/phpldapadmin:0.6.12 image](#extend-osixiaphpldapadmin0612-image)
29+
- [Extend osixia/phpldapadmin:0.7.0 image](#extend-osixiaphpldapadmin070-image)
3030
- [Make your own phpLDAPadmin image](#make-your-own-phpldapadmin-image)
3131
- [Tests](#tests)
3232
- [Kubernetes](#kubernetes)
@@ -39,7 +39,7 @@ Run a phpLDAPadmin docker image by replacing `ldap.example.com` with your ldap h
3939

4040
docker run -p 6443:443 \
4141
--env PHPLDAPADMIN_LDAP_HOSTS=ldap.example.com \
42-
--detach osixia/phpldapadmin:0.6.12
42+
--detach osixia/phpldapadmin:0.7.0
4343

4444
That's it :) you can access phpLDAPadmin on [https://localhost:6443](https://localhost:6443)
4545

@@ -49,7 +49,7 @@ Example script:
4949

5050
#!/bin/bash -e
5151
docker run --name ldap-service --hostname ldap-service --detach osixia/openldap:1.1.8
52-
docker run --name phpldapadmin-service --hostname phpldapadmin-service --link ldap-service:ldap-host --env PHPLDAPADMIN_LDAP_HOSTS=ldap-host --detach osixia/phpldapadmin:0.6.12
52+
docker run --name phpldapadmin-service --hostname phpldapadmin-service --link ldap-service:ldap-host --env PHPLDAPADMIN_LDAP_HOSTS=ldap-host --detach osixia/phpldapadmin:0.7.0
5353

5454
PHPLDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" phpldapadmin-service)
5555

@@ -64,9 +64,9 @@ Example script:
6464
This image comes with a phpLDAPadmin config.php file that can be easily customized via environment variables for a quick bootstrap,
6565
but setting your own config.php is possible. 2 options:
6666

67-
- Link your config file at run time to `/container/service/phpldapadmin/assets/config.php` :
67+
- Link your config file at run time to `/container/service/phpldapadmin/assets/config/config.php` :
6868

69-
docker run --volume /data/my-config.php:/container/service/phpldapadmin/assets/config.php --detach osixia/phpldapadmin:0.6.12
69+
docker run --volume /data/my-config.php:/container/service/phpldapadmin/assets/config/config.php --detach osixia/phpldapadmin:0.7.0
7070

7171
- Add your config file by extending or cloning this image, please refer to the [Advanced User Guide](#advanced-user-guide)
7272

@@ -75,7 +75,7 @@ but setting your own config.php is possible. 2 options:
7575
#### Use autogenerated certificate
7676
By default HTTPS is enable, a certificate is created with the container hostname (it can be set by docker run --hostname option eg: phpldapadmin.my-company.com).
7777

78-
docker run --hostname phpldapadmin.my-company.com --detach osixia/phpldapadmin:0.6.12
78+
docker run --hostname phpldapadmin.my-company.com --detach osixia/phpldapadmin:0.7.0
7979

8080
#### Use your own certificate
8181

@@ -85,22 +85,22 @@ You can set your custom certificate at run time, by mounting a directory contain
8585
--env PHPLDAPADMIN_HTTPS_CRT_FILENAME=my-cert.crt \
8686
--env PHPLDAPADMIN_HTTPS_KEY_FILENAME=my-cert.key \
8787
--env PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME=the-ca.crt \
88-
--detach osixia/phpldapadmin:0.6.12
88+
--detach osixia/phpldapadmin:0.7.0
8989

9090
Other solutions are available please refer to the [Advanced User Guide](#advanced-user-guide)
9191

9292
#### Disable HTTPS
9393
Add --env PHPLDAPADMIN_HTTPS=false to the run command :
9494

95-
docker run --env PHPLDAPADMIN_HTTPS=false --detach osixia/phpldapadmin:0.6.12
95+
docker run --env PHPLDAPADMIN_HTTPS=false --detach osixia/phpldapadmin:0.7.0
9696

9797
### Fix docker mounted file problems
9898

9999
You may have some problems with mounted files on some systems. The startup script try to make some file adjustment and fix files owner and permissions, this can result in multiple errors. See [Docker documentation](https://docs.docker.com/v1.4/userguide/dockervolumes/#mount-a-host-file-as-a-data-volume).
100100

101101
To fix that run the container with `--copy-service` argument :
102102

103-
docker run [your options] osixia/phpldapadmin:0.6.12 --copy-service
103+
docker run [your options] osixia/phpldapadmin:0.7.0 --copy-service
104104

105105
### Debug
106106

@@ -109,11 +109,11 @@ Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.
109109

110110
Example command to run the container in `debug` mode:
111111

112-
docker run --detach osixia/phpldapadmin:0.6.12 --loglevel debug
112+
docker run --detach osixia/phpldapadmin:0.7.0 --loglevel debug
113113

114114
See all command line options:
115115

116-
docker run osixia/phpldapadmin:0.6.12 --help
116+
docker run osixia/phpldapadmin:0.7.0 --help
117117

118118
## Environment Variables
119119

@@ -133,7 +133,7 @@ See how to [set your own environment variables](#set-your-own-environment-variab
133133
- ldap3.example.org
134134
```
135135
This will be converted in the phpldapadmin config.php file to :
136-
```php5
136+
```php7
137137
$servers->newServer('ldap_pla');
138138
$servers->setValue('server','name','ldap.example.org');
139139
$servers->setValue('server','host','ldap.example.org');
@@ -166,7 +166,7 @@ See how to [set your own environment variables](#set-your-own-environment-variab
166166
167167
If you want to set this variable at docker run command add the tag `#PYTHON2BASH:` and convert the yaml in python:
168168

169-
docker run --env PHPLDAPADMIN_LDAP_HOSTS="#PYTHON2BASH:[{'ldap.example.org': [{'server': [{'tls': True}]},{'login': [{'bind_id': 'cn=admin,dc=example,dc=org'}]}]}, 'ldap2.example.org', 'ldap3.example.org']" --detach osixia/phpldapadmin:0.6.12
169+
docker run --env PHPLDAPADMIN_LDAP_HOSTS="#PYTHON2BASH:[{'ldap.example.org': [{'server': [{'tls': True}]},{'login': [{'bind_id': 'cn=admin,dc=example,dc=org'}]}]}, 'ldap2.example.org', 'ldap3.example.org']" --detach osixia/phpldapadmin:0.7.0
170170

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

@@ -203,14 +203,14 @@ Other environment variables:
203203
Environment variables can be set by adding the --env argument in the command line, for example:
204204

205205
docker run --env PHPLDAPADMIN_LDAP_HOSTS="ldap.example.org" \
206-
--detach osixia/phpldapadmin:0.6.12
206+
--detach osixia/phpldapadmin:0.7.0
207207

208208
#### Link environment file
209209

210210
For example if your environment file is in : /data/environment/my-env.yaml
211211

212212
docker run --volume /data/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
213-
--detach osixia/phpldapadmin:0.6.12
213+
--detach osixia/phpldapadmin:0.7.0
214214

215215
Take care to link your environment file to `/container/environment/XX-somedir` (with XX < 99 so they will be processed before default environment files) and not directly to `/container/environment` because this directory contains predefined baseimage environment files to fix container environment (INITRD, LANG, LANGUAGE and LC_CTYPE).
216216

@@ -220,18 +220,18 @@ This is the best solution if you have a private registry. Please refer to the [A
220220

221221
## Advanced User Guide
222222

223-
### Extend osixia/phpldapadmin:0.6.12 image
223+
### Extend osixia/phpldapadmin:0.7.0 image
224224

225225
If you need to add your custom TLS certificate, bootstrap config or environment files the easiest way is to extends this image.
226226

227227
Dockerfile example:
228228

229-
FROM osixia/phpldapadmin:0.6.12
229+
FROM osixia/phpldapadmin:0.7.0
230230
MAINTAINER Your Name <[email protected]>
231231

232232
ADD https-certs /container/service/phpldapadmin/assets/apache2/certs
233233
ADD ldap-certs /container/service/ldap-client/assets/certs
234-
ADD my-config.php /container/service/phpldapadmin/assets/config.php
234+
ADD my-config.php /container/service/phpldapadmin/assets/config/config.php
235235
ADD environment /container/environment/01-custom
236236

237237

@@ -248,7 +248,7 @@ Clone this project :
248248
Adapt Makefile, set your image NAME and VERSION, for example :
249249

250250
NAME = osixia/phpldapadmin
251-
VERSION = 0.6.12
251+
VERSION = 0.7.0
252252

253253
becomes :
254254
NAME = billy-the-king/phpldapadmin

example/kubernetes/phpldapadmin-rc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
spec:
1616
containers:
1717
- name: phpldapadmin
18-
image: osixia/phpldapadmin:0.6.12
18+
image: osixia/phpldapadmin:0.7.0
1919
volumeMounts:
2020
- name: phpldapadmin-certs
2121
mountPath: /container/service/phpldapadmin/assets/apache2/certs

image/Dockerfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
FROM osixia/web-baseimage:1.0.0
1+
FROM osixia/web-baseimage:1.1.0
22
MAINTAINER Bertrand Gouny <[email protected]>
33

44
# phpLDAPadmin version
5-
ENV PHPLDAPADMIN_VERSION 1.2.3
6-
ENV PHPLDAPADMIN_SHA1 669fca66c75e24137e106fdd02e3832f81146e23
5+
ARG PHPLDAPADMIN_VERSION=1.2.3
6+
ARG PHPLDAPADMIN_SHA1=669fca66c75e24137e106fdd02e3832f81146e23
77

8-
# Add multiple process stack to supervise apache2 and php5-fpm
8+
# Add multiple process stack to supervise apache2 and php7.0-fpm
99
# sources: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-multiple-process-stack
1010
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-service-available
1111
#  https://github.com/osixia/docker-web-baseimage/blob/stable/image/service-available/:apache2/download.sh
12-
# https://github.com/osixia/docker-web-baseimage/blob/stable/image/service-available/:php5-fpm/download.sh
12+
# https://github.com/osixia/docker-web-baseimage/blob/stable/image/service-available/:php7.0-fpm/download.sh
1313
# https://github.com/osixia/light-baseimage/blob/stable/image/service-available/:ssl-tools/download.sh
1414
# Install ca-certificates, curl and php dependencies
1515
# Download phpLDAPadmin, check file integrity, and unzip phpLDAPadmin to /var/www/phpldapadmin_bootstrap
1616
# Remove curl
1717
RUN apt-get update \
1818
&& /container/tool/add-multiple-process-stack \
19-
&& /container/tool/add-service-available :apache2 :php5-fpm :ssl-tools \
20-
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes --no-install-recommends \
19+
&& /container/tool/add-service-available :apache2 :php7.0-fpm :ssl-tools \
20+
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
2121
ca-certificates \
2222
curl \
2323
patch \
24-
php5-ldap \
25-
php5-readline \
24+
php7.0-ldap \
25+
php7.0-readline \
26+
php7.0-xml \
2627
&& curl -o phpldapadmin.tgz -SL https://downloads.sourceforge.net/project/phpldapadmin/phpldapadmin-php5/${PHPLDAPADMIN_VERSION}/phpldapadmin-${PHPLDAPADMIN_VERSION}.tgz \
2728
&& echo "$PHPLDAPADMIN_SHA1 *phpldapadmin.tgz" | sha1sum -c - \
2829
&& mkdir -p /var/www/phpldapadmin_bootstrap /var/www/phpldapadmin \

image/environment/default.startup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME: ldap-client.key
1717
# ssl-helper environment variables prefix
1818
LDAP_CLIENT_SSL_HELPER_PREFIX: ldap # ssl-helper first search config from LDAP_SSL_HELPER_* variables, before SSL_HELPER_* variables.
1919

20-
SSL_HELPER_AUTO_RENEW_SERVICES_IMPACTED: :apache2 :php5-fpm
20+
SSL_HELPER_AUTO_RENEW_SERVICES_IMPACTED: :apache2 :php7.0-fpm

image/service/phpldapadmin/assets/apache2/http.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
DocumentRoot /var/www/phpldapadmin/htdocs
88

9-
ErrorLog ${APACHE_LOG_DIR}/error.log
10-
CustomLog ${APACHE_LOG_DIR}/access.log combined
11-
129
<Directory /var/www/phpldapadmin/htdocs >
1310
Require all granted
1411
</Directory>

image/service/phpldapadmin/assets/apache2/https.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
DocumentRoot /var/www/phpldapadmin/htdocs
88

9-
ErrorLog ${APACHE_LOG_DIR}/error.log
10-
CustomLog ${APACHE_LOG_DIR}/access.log combined
11-
129
Include /etc/apache2/conf-available/vhost-partial-ssl.conf
1310

1411
SSLCertificateFile ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/apache2/certs/${PHPLDAPADMIN_HTTPS_CRT_FILENAME}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add your custom config.php file here or mount one at docker run to /container/service/phpldapadmin/assets/config.php
1+
Add your custom config.php file here or mount one at docker run to /container/service/phpldapadmin/assets/config/config.php

image/service/phpldapadmin/assets/php5-fpm/pool.conf

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
php_value[include_path] = .

image/service/phpldapadmin/install.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash -e
22
# this script is run during the image build
33

4-
cat /container/service/phpldapadmin/assets/php5-fpm/pool.conf >> /etc/php5/fpm/pool.d/www.conf
5-
rm /container/service/phpldapadmin/assets/php5-fpm/pool.conf
4+
cat /container/service/phpldapadmin/assets/php7.0-fpm/pool.conf >> /etc/php/7.0/fpm/pool.d/www.conf
5+
rm /container/service/phpldapadmin/assets/php7.0-fpm/pool.conf
66

77
mkdir -p /var/www/tmp
88
chown www-data:www-data /var/www/tmp
@@ -17,6 +17,3 @@ rm -rf /var/www/phpldapadmin_bootstrap/doc
1717
# apply php5.5 patch
1818
patch -p1 -d /var/www/phpldapadmin_bootstrap < /container/service/phpldapadmin/assets/php5.5.patch
1919
sed -i "s/password_hash/password_hash_custom/g" /var/www/phpldapadmin_bootstrap/lib/TemplateRender.php
20-
21-
# fix php5-fpm $_SERVER['SCRIPT_NAME'] bad value with cgi.fix_pathinfo=0
22-
sed -i "s/'SCRIPT_NAME'/'PATH_INFO'/g" /var/www/phpldapadmin_bootstrap/lib/common.php

image/service/phpldapadmin/startup.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ if [ ! -e "/var/www/phpldapadmin/config/config.php" ]; then
6464

6565
# phpLDAPadmin cookie secret
6666
get_salt
67-
sed -i "s|{{ PHPLDAPADMIN_CONFIG_BLOWFISH }}|${salt}|g" ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/config.php
67+
sed -i "s|{{ PHPLDAPADMIN_CONFIG_BLOWFISH }}|${salt}|g" ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/config/config.php
6868

6969
append_to_file() {
7070
TO_APPEND=$1
71-
sed -i "s|{{ PHPLDAPADMIN_SERVERS }}|${TO_APPEND}\n{{ PHPLDAPADMIN_SERVERS }}|g" ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/config.php
71+
sed -i "s|{{ PHPLDAPADMIN_SERVERS }}|${TO_APPEND}\n{{ PHPLDAPADMIN_SERVERS }}|g" ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/config/config.php
7272
}
7373

7474
append_value_to_file() {
@@ -129,13 +129,13 @@ if [ ! -e "/var/www/phpldapadmin/config/config.php" ]; then
129129
fi
130130
done
131131

132-
sed -i "/{{ PHPLDAPADMIN_SERVERS }}/d" ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/config.php
132+
sed -i "/{{ PHPLDAPADMIN_SERVERS }}/d" ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/config/config.php
133133

134134
touch $FIRST_START_DONE
135135
fi
136136

137-
log-helper debug "link ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/config.php to /var/www/phpldapadmin/config/config.php"
138-
cp -f ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/config.php /var/www/phpldapadmin/config/config.php
137+
log-helper debug "link ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/config/config.php to /var/www/phpldapadmin/config/config.php"
138+
cp -f ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/config/config.php /var/www/phpldapadmin/config/config.php
139139

140140
fi
141141

test/test.bats

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ load test_helper
1313
tmp_file="$BATS_TMPDIR/docker-test"
1414

1515
run_image
16-
wait_process apache2 php5-fpm
16+
wait_process apache2 php-fpm7.0
1717
curl --silent --insecure https://$CONTAINER_IP >> $tmp_file
1818
run grep -c "Use the menu to the left to navigate" $tmp_file
1919
rm $tmp_file
@@ -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.1.6)
32+
LDAP_CID=$(docker run -d osixia/openldap:1.1.9)
3333
LDAP_IP=$(get_container_ip_by_cid $LDAP_CID)
3434

3535
# we start the wordpress container and set DB_HOSTS
@@ -39,7 +39,7 @@ load test_helper
3939
wait_process_by_cid $LDAP_CID slapd
4040

4141
# wait phpLDAPadmin container apache2 service
42-
wait_process apache2 php5-fpm
42+
wait_process apache2 php-fpm7.0
4343

4444
curl -L --silent --insecure -c $BATS_TMPDIR/cookie.txt https://$CONTAINER_IP >> $tmp_file
4545

0 commit comments

Comments
 (0)