diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a809b9..fd47398 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. 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.8.0] - 2019-05-29 +### Changed + - phpLDAPadmin 1.2.4 + - Upgrade baseimage to web-baseimage:1.1.2 + ## [0.7.2] - 2018-09-04 ### Added - Ability to sepcifiy different values for ldap 'host' and 'name' #46 @@ -93,6 +98,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [0.5.0] - 2015-03-03 New version initial release, no changelog before this sorry. +[0.8.0]: https://github.com/osixia/docker-phpLDAPadmin/compare/v0.7.2...v0.8.0 [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 diff --git a/Makefile b/Makefile index 999e290..954e77e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = osixia/phpldapadmin -VERSION = 0.7.2 +VERSION = 0.8.0 .PHONY: build build-nocache test tag-latest push push-latest release git-tag-version diff --git a/README.md b/README.md index 3eb0128..2dc57f6 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [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/)  +Latest release: 0.8.0 - phpLDAPadmin 1.2.4 (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) @@ -27,7 +27,7 @@ Latest release: 0.7.2 - phpLDAPadmin 1.2.3 (with php7 patch) - [Changelog](CHANG - [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) + - [Extend osixia/phpldapadmin:0.8.0 image](#extend-osixiaphpldapadmin080-image) - [Make your own phpLDAPadmin image](#make-your-own-phpldapadmin-image) - [Tests](#tests) - [Kubernetes](#kubernetes) @@ -41,7 +41,7 @@ Run a phpLDAPadmin docker image by replacing `ldap.example.com` with your ldap h docker run -p 6443:443 \ --env PHPLDAPADMIN_LDAP_HOSTS=ldap.example.com \ - --detach osixia/phpldapadmin:0.7.2 + --detach osixia/phpldapadmin:0.8.0 That's it :) you can access phpLDAPadmin on [https://localhost:6443](https://localhost:6443) @@ -51,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.2 + docker run --name phpldapadmin-service --hostname phpldapadmin-service --link ldap-service:ldap-host --env PHPLDAPADMIN_LDAP_HOSTS=ldap-host --detach osixia/phpldapadmin:0.8.0 PHPLDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" phpldapadmin-service) @@ -68,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.2 + docker run --volume /data/my-config.php:/container/service/phpldapadmin/assets/config/config.php --detach osixia/phpldapadmin:0.8.0 - Add your config file by extending or cloning this image, please refer to the [Advanced User Guide](#advanced-user-guide) @@ -77,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.2 + docker run --hostname phpldapadmin.my-company.com --detach osixia/phpldapadmin:0.8.0 #### Use your own certificate @@ -87,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.2 + --detach osixia/phpldapadmin:0.8.0 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.2 + docker run --env PHPLDAPADMIN_HTTPS=false --detach osixia/phpldapadmin:0.8.0 ### Fix docker mounted file problems @@ -102,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.2 --copy-service + docker run [your options] osixia/phpldapadmin:0.8.0 --copy-service ### Debug @@ -111,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.2 --loglevel debug + docker run --detach osixia/phpldapadmin:0.8.0 --loglevel debug See all command line options: - docker run osixia/phpldapadmin:0.7.2 --help + docker run osixia/phpldapadmin:0.8.0 --help ## Environment Variables @@ -168,7 +168,7 @@ 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.2 + 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.8.0 To convert yaml to python online: http://yaml-online-parser.appspot.com/ @@ -215,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.2 + --detach osixia/phpldapadmin:0.8.0 #### 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.2 + --detach osixia/phpldapadmin:0.8.0 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). @@ -232,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.2 image +### Extend osixia/phpldapadmin:0.8.0 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.2 + FROM osixia/phpldapadmin:0.8.0 MAINTAINER Your Name ADD https-certs /container/service/phpldapadmin/assets/apache2/certs diff --git a/example/kubernetes/phpldapadmin-rc.yaml b/example/kubernetes/phpldapadmin-rc.yaml index 4e9f1e0..cf4b60a 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.2 + image: osixia/phpldapadmin:0.8.0 volumeMounts: - name: phpldapadmin-certs mountPath: /container/service/phpldapadmin/assets/apache2/certs diff --git a/image/Dockerfile b/image/Dockerfile index 872df13..b91421d 100644 --- a/image/Dockerfile +++ b/image/Dockerfile @@ -1,8 +1,7 @@ -FROM osixia/web-baseimage:1.1.1 +FROM osixia/web-baseimage:1.1.2 # phpLDAPadmin version -ARG PHPLDAPADMIN_VERSION=1.2.3 -ARG PHPLDAPADMIN_SHA1=669fca66c75e24137e106fdd02e3832f81146e23 +ARG PHPLDAPADMIN_VERSION=1.2.4 # Add multiple process stack to supervise apache2 and php7.0-fpm # sources: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-multiple-process-stack @@ -19,16 +18,14 @@ RUN apt-get update \ && 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 - \ + && curl -o phpldapadmin.tar.gz -SL https://github.com/leenooks/phpLDAPadmin/archive/${PHPLDAPADMIN_VERSION}.tar.gz \ && mkdir -p /var/www/phpldapadmin_bootstrap /var/www/phpldapadmin \ - && tar -xzf phpldapadmin.tgz --strip 1 -C /var/www/phpldapadmin_bootstrap \ + && tar -xzf phpldapadmin.tar.gz --strip 1 -C /var/www/phpldapadmin_bootstrap \ && apt-get remove -y --purge --auto-remove curl ca-certificates \ - && rm phpldapadmin.tgz \ + && rm phpldapadmin.tar.gz \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/image/service/phpldapadmin/assets/php5.5.patch b/image/service/phpldapadmin/assets/php5.5.patch deleted file mode 100644 index 2138452..0000000 --- a/image/service/phpldapadmin/assets/php5.5.patch +++ /dev/null @@ -1,144 +0,0 @@ -diff --git a/lib/PageRender.php b/lib/PageRender.php -index 7d86a54..eed5d5f 100644 ---- a/lib/PageRender.php -+++ b/lib/PageRender.php -@@ -287,7 +287,7 @@ class PageRender extends Visitor { - break; - - default: -- $vals[$i] = password_hash($passwordvalue,$enc); -+ $vals[$i] = password_hash_custom($passwordvalue,$enc); - } - - $vals = array_unique($vals); -@@ -957,7 +957,7 @@ class PageRender extends Visitor { - if (trim($val)) - $enc_type = get_enc_type($val); - else -- $enc_type = $server->getValue('appearance','password_hash'); -+ $enc_type = $server->getValue('appearance','password_hash_custom'); - - $obfuscate_password = obfuscate_password_display($enc_type); - -@@ -982,7 +982,7 @@ class PageRender extends Visitor { - if (trim($val)) - $enc_type = get_enc_type($val); - else -- $enc_type = $server->getValue('appearance','password_hash'); -+ $enc_type = $server->getValue('appearance','password_hash_custom'); - - echo '
'; - -diff --git a/lib/ds_ldap.php b/lib/ds_ldap.php -index c346660..7532539 100644 ---- a/lib/ds_ldap.php -+++ b/lib/ds_ldap.php -@@ -1116,13 +1116,24 @@ class ldap extends DS { - - if (is_array($dn)) { - $a = array(); -- foreach ($dn as $key => $rdn) -- $a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn); -+ foreach ($dn as $key => $rdn) { -+ $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', -+ function ($m) { -+ return ''.chr(hexdec('\\1')).''; -+ }, -+ $rdn -+ ); -+ } - - return $a; - - } else -- return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn); -+ return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', -+ function ($m) { -+ return ''.chr(hexdec('\\1')).''; -+ }, -+ $dn -+ ); - } - - public function getRootDSE($method=null) { -diff --git a/lib/ds_ldap_pla.php b/lib/ds_ldap_pla.php -index 7ece393..6b0990e 100644 ---- a/lib/ds_ldap_pla.php -+++ b/lib/ds_ldap_pla.php -@@ -16,7 +16,7 @@ class ldap_pla extends ldap { - function __construct($index) { - parent::__construct($index); - -- $this->default->appearance['password_hash'] = array( -+ $this->default->appearance['password_hash_custom'] = array( - 'desc'=>'Default HASH to use for passwords', - 'default'=>'md5'); - -diff --git a/lib/functions.php b/lib/functions.php -index 56d8bf3..5ac3caf 100644 ---- a/lib/functions.php -+++ b/lib/functions.php -@@ -2127,7 +2127,7 @@ function password_types() { - * crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, sha512, or clear. - * @return string The hashed password. - */ --function password_hash($password_clear,$enc_type) { -+function password_hash_custom($password_clear,$enc_type) { - if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) - debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); - -@@ -2318,7 +2318,7 @@ function password_check($cryptedpassword,$plainpassword,$attribute='userpassword - - # SHA crypted passwords - case 'sha': -- if (strcasecmp(password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0) -+ if (strcasecmp(password_hash_custom($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0) - return true; - else - return false; -@@ -2327,7 +2327,7 @@ function password_check($cryptedpassword,$plainpassword,$attribute='userpassword - - # MD5 crypted passwords - case 'md5': -- if( strcasecmp(password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0) -+ if( strcasecmp(password_hash_custom($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0) - return true; - else - return false; -@@ -2392,7 +2392,7 @@ function password_check($cryptedpassword,$plainpassword,$attribute='userpassword - - # SHA512 crypted passwords - case 'sha512': -- if (strcasecmp(password_hash($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0) -+ if (strcasecmp(password_hash_custom($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0) - return true; - else - return false; -@@ -2564,13 +2564,24 @@ function dn_unescape($dn) { - if (is_array($dn)) { - $a = array(); - -- foreach ($dn as $key => $rdn) -- $a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn); -+ foreach ($dn as $key => $rdn) { -+ $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', -+ function ($m) { -+ return ''.chr(hexdec('\\1')).''; -+ }, -+ $rdn -+ ); -+ } - - return $a; - - } else { -- return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn); -+ return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', -+ function ($m) { -+ return ''.chr(hexdec('\\1')).''; -+ }, -+ $dn -+ ); - } - } - diff --git a/image/service/phpldapadmin/install.sh b/image/service/phpldapadmin/install.sh index c99c033..6f06248 100755 --- a/image/service/phpldapadmin/install.sh +++ b/image/service/phpldapadmin/install.sh @@ -19,7 +19,3 @@ a2enmod deflate expires # delete unnecessary files rm -rf /var/www/phpldapadmin_bootstrap/doc - -# apply php5.5 patch -patch -p1 -d /var/www/phpldapadmin_bootstrap < /container/service/phpldapadmin/assets/php5.5.patch -sed -i "s/password_hash/password_hash_custom/g" /var/www/phpldapadmin_bootstrap/lib/TemplateRender.php