Skip to content

Commit 2187415

Browse files
committed
Merge branch 'release-0.5.0' into stable
2 parents ff003f7 + 84bbf16 commit 2187415

30 files changed

+658
-313
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## 0.5.0 (release date: 2015-03-03)
2+
- New version initial release

Dockerfile

Lines changed: 0 additions & 43 deletions
This file was deleted.

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
NAME = osixia/phpldapadmin
2-
VERSION = 0.4.1
2+
VERSION = 0.5.0
33

44
.PHONY: all build test tag_latest release
55

66
all: build
77

88
build:
9-
docker.io build -t $(NAME):$(VERSION) --rm .
9+
docker build -t $(NAME):$(VERSION) --rm image
1010

1111
test:
12-
env NAME=$(NAME) VERSION=$(VERSION) ./test.sh debug
12+
env NAME=$(NAME) VERSION=$(VERSION) bats test/test.bats
1313

1414
tag_latest:
15-
docker.io tag $(NAME):$(VERSION) $(NAME):latest
15+
docker tag -f $(NAME):$(VERSION) $(NAME):latest
1616

1717
release: build test tag_latest
18-
@if ! docker.io images $(NAME) | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME) version $(VERSION) is not yet built. Please run 'make build'"; false; fi
19-
docker.io push $(NAME)
20-
@echo "*** Don't forget to run 'twgit release finish' :)"
18+
@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
19+
@if ! head -n 1 CHANGELOG.md | grep -q 'release date'; then echo 'Please note the release date in Changelog.md.' && false; fi
20+
docker push $(NAME)
21+
@echo "*** Don't forget to run 'twgit release/hotfix finish' :)"
2122

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A docker image to run phpLDAPadmin
77
### Get phpLDAPadmin in 1''
88
Run docker container with your custom environment variables :
99

10-
sudo docker.io run -p 443:443 \
10+
sudo docker run -p 443:443 \
1111
-e LDAP_HOST=ldap.example.com \
1212
-e LDAP_BASE_DN=dc=example,dc=com \
1313
-e LDAP_LOGIN_DN=cn=admin,dc=example,dc=com \
@@ -43,5 +43,5 @@ Clone the repository
4343

4444
Build image
4545

46-
sudo docker.io build -t phpldapadmin .
46+
sudo docker build -t phpldapadmin .
4747

image/Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM osixia/baseimage:0.10.3
2+
MAINTAINER Bertrand Gouny <[email protected]>
3+
4+
# phpLDAPadmin version
5+
ENV PHPLDAPADMIN_VERSION 1.2.3
6+
ENV PHPLDAPADMIN_SHA1 669fca66c75e24137e106fdd02e3832f81146e23
7+
8+
# Use baseimage-docker's init system.
9+
CMD ["/sbin/my_init"]
10+
11+
# Install apache2 and php5-fpm using osixia/baseimage utils
12+
# Caution: /sbin/enable-service arguments order is important
13+
# php5-fpm install will detect apache2 and configure it
14+
15+
# Download, check integrity and unzip phpLDAPadmin to /var/www/phpldapadmin_bootstrap
16+
RUN apt-get update && /sbin/enable-service apache2 php5-fpm ssl-kit \
17+
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends patch php5-ldap php5-readline \
18+
&& curl -o phpldapadmin.tgz -SL http://downloads.sourceforge.net/project/phpldapadmin/phpldapadmin-php5/${PHPLDAPADMIN_VERSION}/phpldapadmin-${PHPLDAPADMIN_VERSION}.tgz \
19+
&& echo "$PHPLDAPADMIN_SHA1 *phpldapadmin.tgz" | sha1sum -c - \
20+
&& mkdir -p /var/www/phpldapadmin_bootstrap /var/www/phpldapadmin \
21+
&& tar -xzf phpldapadmin.tgz --strip 1 -C /var/www/phpldapadmin_bootstrap
22+
23+
# Add install script and phpLDAPadmin assets
24+
ADD service/install.sh /tmp/install.sh
25+
ADD service/phpldapadmin/assets /osixia/phpldapadmin
26+
27+
# Run install script and clean all
28+
RUN ./tmp/install.sh \
29+
&& rm phpldapadmin.tgz \
30+
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
31+
32+
# Add default env variables
33+
ADD env.yml /etc/env.yml
34+
35+
# Add phpLDAPadmin container start config
36+
ADD service/phpldapadmin/container-start.sh /etc/my_init.d/phpldapadmin
37+
38+
# Set phpLDAPadmin data directory in a data volume
39+
VOLUME ["/var/www/phpldapadmin"]
40+
41+
# Expose http and https default ports
42+
EXPOSE 80 443

image/env.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
LDAP_HOSTS:
2+
- ldap1.example.org:
3+
- server:
4+
- tls: true
5+
- login:
6+
- bind_id: cn=admin,dc=example,dc=org
7+
- ldap2.example.org
8+
- ldap3.example.org
9+
10+
# Apache
11+
SERVER_NAME: example.org
12+
SERVER_ADMIN: [email protected]
13+
14+
# Self signed certificat will be generated
15+
# if HTTPS is set to true and no certificat and key are provided.
16+
17+
# To use your custom certificat and key 2 options :
18+
# - add them in service/phpldapadmin/assets/apache2/ssl and build the image
19+
# - or during docker run mount a data volume with thoses files to /osixia/phpldapadmin/apache2/ssl
20+
HTTPS: true
21+
SSL_CRT_FILENAME: phpldapadmin.crt
22+
SSL_KEY_FILENAME: phpldapadmin.key
23+
SSL_CA_CRT_FILENAME: ca.crt

image/service/install.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash -e
2+
# this script is run during the image build
3+
4+
# Add phpLDAPadmin virtualhosts
5+
ln -s /osixia/phpldapadmin/apache2/phpldapadmin.conf /etc/apache2/sites-available/phpldapadmin.conf
6+
ln -s /osixia/phpldapadmin/apache2/phpldapadmin-ssl.conf /etc/apache2/sites-available/phpldapadmin-ssl.conf
7+
8+
cp /osixia/phpldapadmin/config.php /var/www/phpldapadmin_bootstrap/config/config.php
9+
rm /osixia/phpldapadmin/config.php
10+
11+
cat /osixia/phpldapadmin/php5-fpm/pool.conf >> /etc/php5/fpm/pool.d/www.conf
12+
rm /osixia/phpldapadmin/php5-fpm/pool.conf
13+
14+
mkdir -p /var/www/tmp
15+
chown www-data:www-data /var/www/tmp
16+
17+
# Remove apache default host
18+
a2dissite 000-default
19+
rm -rf /var/www/html
20+
21+
# Delete unnecessary files
22+
rm -rf /var/www/phpldapadmin_bootstrap/doc
23+
24+
# apply php5.5 patch
25+
patch -p1 -d /var/www/phpldapadmin_bootstrap < /osixia/phpldapadmin/php5.5.patch
26+
sed -i "s/password_hash/password_hash_custom/g" /var/www/phpldapadmin_bootstrap/lib/TemplateRender.php
27+
28+
# fix php5-fpm $_SERVER['SCRIPT_NAME'] bad value with cgi.fix_pathinfo=0
29+
sed -i "s/'SCRIPT_NAME'/'PATH_INFO'/g" /var/www/phpldapadmin_bootstrap/lib/common.php
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<VirtualHost *:80>
2+
ServerName ${SERVER_NAME}
3+
Redirect permanent / https://${SERVER_NAME}/
4+
</VirtualHost>
5+
6+
<IfModule mod_ssl.c>
7+
<VirtualHost _default_:443>
8+
9+
ServerName ${SERVER_NAME}
10+
ServerAdmin ${SERVER_ADMIN}
11+
12+
DocumentRoot /var/www/phpldapadmin/htdocs
13+
14+
ErrorLog ${APACHE_LOG_DIR}/error.log
15+
CustomLog ${APACHE_LOG_DIR}/access.log combined
16+
17+
Include /etc/apache2/conf-available/vhost-partial-ssl.conf
18+
19+
SSLCertificateFile /osixia/phpldapadmin/apache2/ssl/${SSL_CRT_FILENAME}
20+
SSLCertificateKeyFile /osixia/phpldapadmin/apache2/ssl/${SSL_KEY_FILENAME}
21+
#SSLCACertificateFile /osixia/phpldapadmin/apache2/ssl/${SSL_CA_CRT_FILENAME
22+
23+
<Directory /var/www/phpldapadmin/htdocs >
24+
Require all granted
25+
</Directory>
26+
27+
<files config.php >
28+
Require all denied
29+
</files>
30+
31+
</VirtualHost>
32+
</IfModule>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<VirtualHost *:80>
2+
ServerName ${SERVER_NAME}
3+
4+
ServerAdmin ${SERVER_ADMIN}
5+
DocumentRoot /var/www/phpldapadmin/htdocs
6+
7+
ErrorLog ${APACHE_LOG_DIR}/error.log
8+
CustomLog ${APACHE_LOG_DIR}/access.log combined
9+
10+
<Directory /var/www/phpldapadmin/htdocs >
11+
Require all granted
12+
</Directory>
13+
14+
<files config.php >
15+
Require all denied
16+
</files>
17+
18+
</VirtualHost>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add your ssl crt, key and ca crt here
2+
or during docker run mount a data volume with thoses files to /osixia/phpldapadmin/apache2/ssl

0 commit comments

Comments
 (0)