From efbe2fba030bc0ccafd64609a915446fe7636eee Mon Sep 17 00:00:00 2001 From: Adam W Zheng Date: Tue, 21 Nov 2017 10:41:12 -0600 Subject: [PATCH 1/3] Add support for seeding new locales directory in 1.15.0 --- 1.15.0/install-simplesamlphp.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/1.15.0/install-simplesamlphp.sh b/1.15.0/install-simplesamlphp.sh index 89caad5..9eab0a1 100644 --- a/1.15.0/install-simplesamlphp.sh +++ b/1.15.0/install-simplesamlphp.sh @@ -62,13 +62,14 @@ if [ "$DOCKER_REDIRECTLOGS" = "true" ]; then echo "[$0] [WARN] DOCKER_REDIRECTLOGS is set to true but the log directory is volume mounted. It makes no sense to do this as logs are redirected to a pipe." echo "[$0] If a simplesamlphp logfile is desired instead of docker logs, set DOCKER_REDIRECTLOGS to 'false'." echo "[$0] Pausing 5 seconds due to above warning." - sleep 5 + sleep 5 fi else if [ "$CONFIG_LOGGINGHANDLER" = "file" ]; then echo "[$0] [WARN] CONFIG_LOGGINGHANDLER is set to 'file' but the log directory is not volume mounted." echo "[$0] [WARN] This will cause the container to grow with a logfile and is in most cases very undesirable." echo "[$0] Pausing 5 seconds due to above warning." + sleep 5 fi fi ln -sf /proc/1/fd/1 /var/simplesamlphp/log/$CONFIG_LOGFILE @@ -103,8 +104,8 @@ else ls -A /var/simplesamlphp/cert/breadcrumb &> /dev/null if ! [ $? -ne 0 ]; then echo "[$0] [WARN] cert directory is not volume mounted and probably should be." - echo "[$0] Pausing 3 seconds due to above warning." - sleep 3 + echo "[$0] Pausing 5 seconds due to above warning." + sleep 5 fi if [ -z "$(ls -A /var/simplesamlphp/config/)" ]; then echo "[$0] config directory seems to be Docker volume mounted as it is empty. Seeding." @@ -123,6 +124,9 @@ else tar xzvf /var/simplesamlphp.tar.gz simplesamlphp*/dictionaries > /dev/null mv /simplesamlphp-1.*/dictionaries/* /var/simplesamlphp/dictionaries/ echo "[$0] Seed complete. Directory dictionaries will not be part of future upgrades and will need upgraded manually." + echo "[$0] [WARN] usage of dictionaries are deprecated in 1.15.0 and will be removed in 2.0. Use locales instead." + echo "[$0] Pausing 5 seconds due to above warning." + sleep 5 fi if [ -z "$(ls -A /var/simplesamlphp/docs/)" ]; then echo "[$0] docs directory seems to be Docker volume mounted as it is empty. Seeding." @@ -142,6 +146,12 @@ else mv /simplesamlphp-1.*/lib/* /var/simplesamlphp/lib/ echo "[$0] Seed complete. Directory lib will not be part of future upgrades and will need upgraded manually." fi + if [ -z "$(ls -A /var/simplesamlphp/locales/)" ]; then + echo "[$0] locales directory seems to be Docker volume mounted as it is empty. Seeding." + tar xzvf /var/simplesamlphp.tar.gz simplesamlphp*/lib > /dev/null + mv /simplesamlphp-1.*/lib/* /var/simplesamlphp/lib/ + echo "[$0] Seed complete. Directory locales will not be part of future upgrades and will need upgraded manually." + fi if [ -z "$(ls -A /var/simplesamlphp/metadata/)" ]; then echo "[$0] metadata directory seems to be Docker volume mounted as it is empty. Seeding." tar xzvf /var/simplesamlphp.tar.gz simplesamlphp*/metadata > /dev/null From 7c909fef2a462eb2f82bce3e685d3ab168d0e0b3 Mon Sep 17 00:00:00 2001 From: Adam W Zheng Date: Tue, 21 Nov 2017 10:42:08 -0600 Subject: [PATCH 2/3] Replace deprecated dictionaries volume with 1.15.0 locales volume --- 1.15.0/docker-compose.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/1.15.0/docker-compose.yml b/1.15.0/docker-compose.yml index 985381d..6ecd71e 100644 --- a/1.15.0/docker-compose.yml +++ b/1.15.0/docker-compose.yml @@ -31,14 +31,15 @@ services: # - WWW_INDEX=core/authenticate.php?as=admin - OPENLDAP_TLS_REQCERT=always volumes: -# - /opt/docker/volumes/idp-simplesamlphp/config/authsources.php:/var/simplesamlphp/config/authsources.php - - /opt/docker/volumes/idp-simplesamlphp/cert/:/var/simplesamlphp/cert/ - - /opt/docker/volumes/idp-simplesamlphp/dictionaries/:/var/simplesamlphp/dictionaries/ - - /opt/docker/volumes/idp-simplesamlphp/log/:/var/simplesamlphp/log - - /opt/docker/volumes/idp-simplesamlphp/metadata/:/var/simplesamlphp/metadata - - /opt/docker/volumes/idp-simplesamlphp/modules/:/var/simplesamlphp/modules - - /opt/docker/volumes/idp-simplesamlphp/templates/:/var/simplesamlphp/templates - - /opt/docker/volumes/idp-simplesamlphp/www/:/var/simplesamlphp/www +# - /opt/docker/volumes/idp-simplesamlphp/cache/:/var/simplesamlphp/cache/:Z +# - /opt/docker/volumes/idp-simplesamlphp/config/authsources.php:/var/simplesamlphp/config/authsources.php:Z + - /opt/docker/volumes/idp-simplesamlphp/cert/:/var/simplesamlphp/cert/:Z + - /opt/docker/volumes/idp-simplesamlphp/locales/:/var/simplesamlphp/locales/:Z + - /opt/docker/volumes/idp-simplesamlphp/log/:/var/simplesamlphp/log/:Z + - /opt/docker/volumes/idp-simplesamlphp/metadata/:/var/simplesamlphp/metadata/:Z + - /opt/docker/volumes/idp-simplesamlphp/modules/:/var/simplesamlphp/modules/:Z + - /opt/docker/volumes/idp-simplesamlphp/templates/:/var/simplesamlphp/templates/:Z + - /opt/docker/volumes/idp-simplesamlphp/www/:/var/simplesamlphp/www/:Z restart: always a01-memcached: From 2796fc844ece54ce6d3ebcdb7f058c213d214e91 Mon Sep 17 00:00:00 2001 From: Adam W Zheng Date: Tue, 21 Nov 2017 11:34:54 -0600 Subject: [PATCH 3/3] Fix copy paste error in locales tar extraction --- 1.15.0/install-simplesamlphp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1.15.0/install-simplesamlphp.sh b/1.15.0/install-simplesamlphp.sh index 9eab0a1..98569df 100644 --- a/1.15.0/install-simplesamlphp.sh +++ b/1.15.0/install-simplesamlphp.sh @@ -148,8 +148,8 @@ else fi if [ -z "$(ls -A /var/simplesamlphp/locales/)" ]; then echo "[$0] locales directory seems to be Docker volume mounted as it is empty. Seeding." - tar xzvf /var/simplesamlphp.tar.gz simplesamlphp*/lib > /dev/null - mv /simplesamlphp-1.*/lib/* /var/simplesamlphp/lib/ + tar xzvf /var/simplesamlphp.tar.gz simplesamlphp*/locales > /dev/null + mv /simplesamlphp-1.*/locales/* /var/simplesamlphp/locales/ echo "[$0] Seed complete. Directory locales will not be part of future upgrades and will need upgraded manually." fi if [ -z "$(ls -A /var/simplesamlphp/metadata/)" ]; then