diff --git a/CHANGELOG.md b/CHANGELOG.md index 2215e05..7a809b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,60 +1,113 @@ # Changelog +All notable changes to this project will be documented in this file. -## 0.7.1 +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [0.7.2] - 2018-09-04 +### Added + - Ability to sepcifiy different values for ldap 'host' and 'name' #46 + +## [0.7.1] - 2017-12-05 +### Added + - Opcache config + +### Changed - Optimise apache config - - Add opcache config - - Upgrade baseimage: web-baseimage:1.1.1 + - Upgrade baseimage to web-baseimage:1.1.1 -## 0.7.0 +## [0.7.0] - 2017-07-19 +### Added - add config.php in config folder - - Upgrade baseimage: web-baseimage:1.1.0 (debian stretch, php7) -## 0.6.12 +### Changed + - Upgrade baseimage to web-baseimage:1.1.0 (debian stretch, php7) + +## [0.6.12] - 2017-03-27 +### Changed + - Upgrade baseimage to web-baseimage:1.0.0 + +### Fixed - Fixes Parse error: syntax error, unexpected '}' in config.php on line 68 #23 - - Upgrade baseimage: web-baseimage:1.0.0 -## 0.6.11 - - Upgrade baseimage: web-baseimage:0.1.10 +## [0.6.11] - 2016-09-02 +### Changed + - Upgrade baseimage to web-baseimage:0.1.10 -## 0.6.10 +## [0.6.10] - 2016-07-26 +### Added - Add PHPLDAPADMIN_SERVER_PATH environment variable -## 0.6.9 - - Upgrade baseimage: web-baseimage:0.1.10 +## [0.6.9] - 2016-06-09 +### Changed + - Upgrade baseimage to web-baseimage:0.1.10 -## 0.6.8 - - Upgrade baseimage: web-baseimage:0.1.9 +## [0.6.8] - 2016-02-20 +### Changed + - Upgrade baseimage to web-baseimage:0.1.9 -## 0.6.7 - - Upgrade baseimage: web-baseimage:0.1.8 +## [0.6.7] - 2016-01-25 +### Changed + - Upgrade baseimage to web-baseimage:0.1.8 -## 0.6.6 - - Upgrade baseimage: web-baseimage:0.1.7 +## [0.6.6] - 2015-12-16 +### Added - Makefile with build no cache -## 0.6.5 - - Upgrade baseimage: web-baseimage:0.1.6 +### Changed + - Upgrade baseimage to web-baseimage:0.1.7 -## 0.6.4 - - Upgrade baseimage: web-baseimage:0.1.5 - - Remove listen on http when https is enable +## [0.6.5] - 2015-11-20 +### Changed + - Upgrade baseimage to web-baseimage:0.1.6 + +## [0.6.4] - 2015-11-19 +### Changed + - Upgrade baseimage to web-baseimage:0.1.5 - externalise ldap-client config from phpLdapAdmin -## 0.6.3 - - Upgrade baseimage: web-baseimage:0.1.3 +### Removed + - Remove listen on http when https is enable + +## [0.6.3] - 2015-10-26 +### Changed + - Upgrade baseimage to web-baseimage:0.1.3 -## 0.6.2 +## [0.6.2] - 2015-08-21 +### Changed - Better way to add custom config -## 0.6.1 - - Upgrade baseimage: web-baseimage:0.1.1 +## [0.6.1] - 2015-08-20 +### Changed + - Upgrade baseimage to web-baseimage:0.1.1 - Rename environment variables -## 0.6.0 +## [0.6.0] - 2015-07-24 +### Changed - Use new baseimage: light-baseimage -## 0.5.1 +## [0.5.1] - 2015-05-17 +### Fixed - Fix #1 (can't activate SSL with own certificates) -## 0.5.0 - - New version initial release +## [0.5.0] - 2015-03-03 +New version initial release, no changelog before this sorry. + +[0.7.2]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.7.1...v0.7.2 +[0.7.1]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.7.0...v0.7.1 +[0.7.0]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.12...v0.7.0 +[0.6.12]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.11...v0.6.12 +[0.6.11]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.10...v0.6.11 +[0.6.10]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.9...v0.6.10 +[0.6.9]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.8...v0.6.9 +[0.6.8]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.7...v0.6.8 +[0.6.7]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.6...v0.6.7 +[0.6.6]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.5...v0.6.6 +[0.6.5]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.4...v0.6.5 +[0.6.4]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.3...v0.6.4 +[0.6.3]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.2...v0.6.3 +[0.6.2]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.1...v0.6.2 +[0.6.1]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.6.0...v0.6.1 +[0.6.0]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.5.1...v0.6.0 +[0.5.1]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.5.0...v0.5.1 +[0.5.0]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.1.0...v0.5.0 \ No newline at end of file diff --git a/Makefile b/Makefile index c0281a8..999e290 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = osixia/phpldapadmin -VERSION = 0.7.1 +VERSION = 0.7.2 .PHONY: build build-nocache test tag-latest push push-latest release git-tag-version diff --git a/README.md b/README.md index b6f796a..3eb0128 100644 --- a/README.md +++ b/README.md @@ -5,41 +5,43 @@ [hub]: https://hub.docker.com/r/osixia/phpldapadmin/ -Latest release: 0.7.1 - phpLDAPadmin 1.2.3 (with php7 patch) - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/phpldapadmin/)  +Latest release: 0.7.2 - phpLDAPadmin 1.2.3 (with php7 patch) - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/phpldapadmin/)  **A docker image to run phpLDAPadmin.** > [phpldapadmin.sourceforge.net](http://phpldapadmin.sourceforge.net) -- [Quick start](#quick-start) - - [OpenLDAP & phpLDAPadmin in 1'](#openldap--phpldapadmin-in-1) -- [Beginner Guide](#beginner-guide) - - [Use your own phpLDAPadmin config](#use-your-own-phpldapadmin-config) - - [HTTPS](#https) - - [Use autogenerated certificate](#use-autogenerated-certificate) - - [Use your own certificate](#use-your-own-certificate) - - [Disable HTTPS](#disable-https) - - [Fix docker mounted file problems](#fix-docker-mounted-file-problems) - - [Debug](#debug) -- [Environment Variables](#environment-variables) - - [Set your own environment variables](#set-your-own-environment-variables) - - [Use command line argument](#use-command-line-argument) - - [Link environment file](#link-environment-file) - - [Make your own image or extend this image](#make-your-own-image-or-extend-this-image) -- [Advanced User Guide](#advanced-user-guide) - - [Extend osixia/phpldapadmin:0.7.1 image](#extend-osixiaphpldapadmin070-image) - - [Make your own phpLDAPadmin image](#make-your-own-phpldapadmin-image) - - [Tests](#tests) - - [Kubernetes](#kubernetes) - - [Under the hood: osixia/web-baseimage](#under-the-hood-osixiaweb-baseimage) -- [Changelog](#changelog) +- [osixia/phpldapadmin](#osixiaphpldapadmin) + - [Quick start](#quick-start) + - [OpenLDAP & phpLDAPadmin in 1'](#openldap--phpldapadmin-in-1) + - [Beginner Guide](#beginner-guide) + - [Use your own phpLDAPadmin config](#use-your-own-phpldapadmin-config) + - [HTTPS](#https) + - [Use autogenerated certificate](#use-autogenerated-certificate) + - [Use your own certificate](#use-your-own-certificate) + - [Disable HTTPS](#disable-https) + - [Fix docker mounted file problems](#fix-docker-mounted-file-problems) + - [Debug](#debug) + - [Environment Variables](#environment-variables) + - [Set your own environment variables](#set-your-own-environment-variables) + - [Use command line argument](#use-command-line-argument) + - [Link environment file](#link-environment-file) + - [Make your own image or extend this image](#make-your-own-image-or-extend-this-image) + - [Advanced User Guide](#advanced-user-guide) + - [Extend osixia/phpldapadmin:0.7.2 image](#extend-osixiaphpldapadmin072-image) + - [Make your own phpLDAPadmin image](#make-your-own-phpldapadmin-image) + - [Tests](#tests) + - [Kubernetes](#kubernetes) + - [Under the hood: osixia/web-baseimage](#under-the-hood-osixiaweb-baseimage) + - [Security](#security) + - [Changelog](#changelog) ## Quick start Run a phpLDAPadmin docker image by replacing `ldap.example.com` with your ldap host or IP : docker run -p 6443:443 \ - --env PHPLDAPADMIN_LDAP_HOSTS=ldap.example.com \ - --detach osixia/phpldapadmin:0.7.1 + --env PHPLDAPADMIN_LDAP_HOSTS=ldap.example.com \ + --detach osixia/phpldapadmin:0.7.2 That's it :) you can access phpLDAPadmin on [https://localhost:6443](https://localhost:6443) @@ -49,7 +51,7 @@ Example script: #!/bin/bash -e docker run --name ldap-service --hostname ldap-service --detach osixia/openldap:1.1.8 - docker run --name phpldapadmin-service --hostname phpldapadmin-service --link ldap-service:ldap-host --env PHPLDAPADMIN_LDAP_HOSTS=ldap-host --detach osixia/phpldapadmin:0.7.1 + docker run --name phpldapadmin-service --hostname phpldapadmin-service --link ldap-service:ldap-host --env PHPLDAPADMIN_LDAP_HOSTS=ldap-host --detach osixia/phpldapadmin:0.7.2 PHPLDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" phpldapadmin-service) @@ -66,7 +68,7 @@ but setting your own config.php is possible. 2 options: - Link your config file at run time to `/container/service/phpldapadmin/assets/config/config.php` : - docker run --volume /data/my-config.php:/container/service/phpldapadmin/assets/config/config.php --detach osixia/phpldapadmin:0.7.1 + docker run --volume /data/my-config.php:/container/service/phpldapadmin/assets/config/config.php --detach osixia/phpldapadmin:0.7.2 - Add your config file by extending or cloning this image, please refer to the [Advanced User Guide](#advanced-user-guide) @@ -75,7 +77,7 @@ but setting your own config.php is possible. 2 options: #### Use autogenerated certificate 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). - docker run --hostname phpldapadmin.my-company.com --detach osixia/phpldapadmin:0.7.1 + docker run --hostname phpldapadmin.my-company.com --detach osixia/phpldapadmin:0.7.2 #### Use your own certificate @@ -85,14 +87,14 @@ You can set your custom certificate at run time, by mounting a directory contain --env PHPLDAPADMIN_HTTPS_CRT_FILENAME=my-cert.crt \ --env PHPLDAPADMIN_HTTPS_KEY_FILENAME=my-cert.key \ --env PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME=the-ca.crt \ - --detach osixia/phpldapadmin:0.7.1 + --detach osixia/phpldapadmin:0.7.2 Other solutions are available please refer to the [Advanced User Guide](#advanced-user-guide) #### Disable HTTPS Add --env PHPLDAPADMIN_HTTPS=false to the run command : - docker run --env PHPLDAPADMIN_HTTPS=false --detach osixia/phpldapadmin:0.7.1 + docker run --env PHPLDAPADMIN_HTTPS=false --detach osixia/phpldapadmin:0.7.2 ### Fix docker mounted file problems @@ -100,7 +102,7 @@ You may have some problems with mounted files on some systems. The startup scrip To fix that run the container with `--copy-service` argument : - docker run [your options] osixia/phpldapadmin:0.7.1 --copy-service + docker run [your options] osixia/phpldapadmin:0.7.2 --copy-service ### Debug @@ -109,11 +111,11 @@ Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`. Example command to run the container in `debug` mode: - docker run --detach osixia/phpldapadmin:0.7.1 --loglevel debug + docker run --detach osixia/phpldapadmin:0.7.2 --loglevel debug See all command line options: - docker run osixia/phpldapadmin:0.7.1 --help + docker run osixia/phpldapadmin:0.7.2 --help ## Environment Variables @@ -166,10 +168,20 @@ See how to [set your own environment variables](#set-your-own-environment-variab If you want to set this variable at docker run command add the tag `#PYTHON2BASH:` and convert the yaml in python: - 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.1 + 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.2 To convert yaml to python online: http://yaml-online-parser.appspot.com/ + If you would like to skip the display name == hostname element of the above use the **PHPLDAPADMIN_LDAP_HOSTS_FRIENDLY** environmental variable. This then uses the top most name as the display name of the server. You will then need to add host to the yaml within the server section. Note this is a global setting, if you do it for one server, you must do it for all. eg + ```yaml + - Primary: + - server: + - host: ldap-master.example.org + - Backup: + - server: + - host: 192.168.0.100 + ``` + Apache : - **PHPLDAPADMIN_SERVER_ADMIN**: Server admin email. Defaults to `webmaster@example.org` - **PHPLDAPADMIN_SERVER_PATH**: Server path (usefull if behind a reverse proxy). Defaults to `/phpldapadmin` @@ -203,14 +215,14 @@ Other environment variables: Environment variables can be set by adding the --env argument in the command line, for example: docker run --env PHPLDAPADMIN_LDAP_HOSTS="ldap.example.org" \ - --detach osixia/phpldapadmin:0.7.1 + --detach osixia/phpldapadmin:0.7.2 #### Link environment file For example if your environment file is in : /data/environment/my-env.yaml docker run --volume /data/environment/my-env.yaml:/container/environment/01-custom/env.yaml \ - --detach osixia/phpldapadmin:0.7.1 + --detach osixia/phpldapadmin:0.7.2 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). @@ -220,13 +232,13 @@ This is the best solution if you have a private registry. Please refer to the [A ## Advanced User Guide -### Extend osixia/phpldapadmin:0.7.1 image +### Extend osixia/phpldapadmin:0.7.2 image If you need to add your custom TLS certificate, bootstrap config or environment files the easiest way is to extends this image. Dockerfile example: - FROM osixia/phpldapadmin:0.7.1 + FROM osixia/phpldapadmin:0.7.2 MAINTAINER Your Name ADD https-certs /container/service/phpldapadmin/assets/apache2/certs @@ -289,6 +301,11 @@ A kubernetes example is available in **example/kubernetes** This image is based on osixia/web-baseimage. More info: https://github.com/osixia/docker-web-baseimage +## Security +If you discover a security vulnerability within this docker image, please send an email to the Osixia! team at security@osixia.net. For minor vulnerabilities feel free to add an issue here on github. + +Please include as many details as possible. + ## Changelog Please refer to: [CHANGELOG.md](CHANGELOG.md) diff --git a/example/kubernetes/phpldapadmin-rc.yaml b/example/kubernetes/phpldapadmin-rc.yaml index e7ff119..4c9eb52 100644 --- a/example/kubernetes/phpldapadmin-rc.yaml +++ b/example/kubernetes/phpldapadmin-rc.yaml @@ -15,7 +15,7 @@ spec: spec: containers: - name: phpldapadmin - image: osixia/phpldapadmin:0.7.1 + image: osixia/phpldapadmin:0.7.2 volumeMounts: - name: phpldapadmin-certs mountPath: /container/service/phpldapadmin/assets/apache2/certs diff --git a/image/Dockerfile b/image/Dockerfile index 05fc555..872df13 100644 --- a/image/Dockerfile +++ b/image/Dockerfile @@ -1,5 +1,4 @@ FROM osixia/web-baseimage:1.1.1 -MAINTAINER Bertrand Gouny # phpLDAPadmin version ARG PHPLDAPADMIN_VERSION=1.2.3 @@ -15,23 +14,23 @@ ARG PHPLDAPADMIN_SHA1=669fca66c75e24137e106fdd02e3832f81146e23 # Download phpLDAPadmin, check file integrity, and unzip phpLDAPadmin to /var/www/phpldapadmin_bootstrap # Remove curl RUN apt-get update \ - && /container/tool/add-multiple-process-stack \ - && /container/tool/add-service-available :apache2 :php7.0-fpm :ssl-tools \ - && LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - patch \ - php7.0-ldap \ - php7.0-readline \ - php7.0-xml \ - && curl -o phpldapadmin.tgz -SL https://downloads.sourceforge.net/project/phpldapadmin/phpldapadmin-php5/${PHPLDAPADMIN_VERSION}/phpldapadmin-${PHPLDAPADMIN_VERSION}.tgz \ - && echo "$PHPLDAPADMIN_SHA1 *phpldapadmin.tgz" | sha1sum -c - \ - && mkdir -p /var/www/phpldapadmin_bootstrap /var/www/phpldapadmin \ - && tar -xzf phpldapadmin.tgz --strip 1 -C /var/www/phpldapadmin_bootstrap \ - && apt-get remove -y --purge --auto-remove curl ca-certificates \ - && rm phpldapadmin.tgz \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + && /container/tool/add-multiple-process-stack \ + && /container/tool/add-service-available :apache2 :php7.0-fpm :ssl-tools \ + && LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + patch \ + php7.0-ldap \ + php7.0-readline \ + php7.0-xml \ + && curl -o phpldapadmin.tgz -SL https://downloads.sourceforge.net/project/phpldapadmin/phpldapadmin-php5/${PHPLDAPADMIN_VERSION}/phpldapadmin-${PHPLDAPADMIN_VERSION}.tgz \ + && echo "$PHPLDAPADMIN_SHA1 *phpldapadmin.tgz" | sha1sum -c - \ + && mkdir -p /var/www/phpldapadmin_bootstrap /var/www/phpldapadmin \ + && tar -xzf phpldapadmin.tgz --strip 1 -C /var/www/phpldapadmin_bootstrap \ + && apt-get remove -y --purge --auto-remove curl ca-certificates \ + && rm phpldapadmin.tgz \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Add service directory to /container/service ADD service /container/service diff --git a/image/service/phpldapadmin/startup.sh b/image/service/phpldapadmin/startup.sh index e35222e..048971c 100755 --- a/image/service/phpldapadmin/startup.sh +++ b/image/service/phpldapadmin/startup.sh @@ -119,8 +119,10 @@ if [ ! -e "/var/www/phpldapadmin/config/config.php" ]; then hostname=$(complex-bash-env getRowKey "${!host}") info=$(complex-bash-env getRowValueVarName "${!host}") + if [ "${PHPLDAPADMIN_LDAP_HOSTS_FRIENDLY,,}" != "true" ]; then + append_to_file "\$servers->setValue('server','host','$hostname');" + fi append_to_file "\$servers->setValue('server','name','$hostname');" - append_to_file "\$servers->setValue('server','host','$hostname');" host_info "" "$info" else