Skip to content

Commit

Permalink
move php config file to config dir
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandGouny committed Jul 19, 2017
1 parent 419a6a3 commit 1317579
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Changelog

## 0.7.0
- add config.php in config folder
- Upgrade baseimage: web-baseimage:1.1.0 (debian stretch, php7)

## 0.6.12
- Fixes Parse error: syntax error, unexpected '}' in /container/service/phpldapadmin/assets/config.php on line 68 #23
- Fixes Parse error: syntax error, unexpected '}' in config.php on line 68 #23
- Upgrade baseimage: web-baseimage:1.0.0

## 0.6.11
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ Example script:
This image comes with a phpLDAPadmin config.php file that can be easily customized via environment variables for a quick bootstrap,
but setting your own config.php is possible. 2 options:

- Link your config file at run time to `/container/service/phpldapadmin/assets/config.php` :
- 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.php --detach osixia/phpldapadmin:0.7.0
docker run --volume /data/my-config.php:/container/service/phpldapadmin/assets/config/config.php --detach osixia/phpldapadmin:0.7.0

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

Expand Down Expand Up @@ -231,7 +231,7 @@ Dockerfile example:

ADD https-certs /container/service/phpldapadmin/assets/apache2/certs
ADD ldap-certs /container/service/ldap-client/assets/certs
ADD my-config.php /container/service/phpldapadmin/assets/config.php
ADD my-config.php /container/service/phpldapadmin/assets/config/config.php
ADD environment /container/environment/01-custom


Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Add your custom config.php file here or mount one at docker run to /container/service/phpldapadmin/assets/config.php
Add your custom config.php file here or mount one at docker run to /container/service/phpldapadmin/assets/config/config.php
10 changes: 5 additions & 5 deletions image/service/phpldapadmin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ if [ ! -e "/var/www/phpldapadmin/config/config.php" ]; then

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

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

append_value_to_file() {
Expand Down Expand Up @@ -129,13 +129,13 @@ if [ ! -e "/var/www/phpldapadmin/config/config.php" ]; then
fi
done

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

touch $FIRST_START_DONE
fi

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

fi

Expand Down

0 comments on commit 1317579

Please sign in to comment.