From 39fe4e82a15caeb5a1acfe4b49832fbda0bea61f Mon Sep 17 00:00:00 2001 From: mlan Date: Sat, 19 Dec 2020 00:46:26 +0100 Subject: [PATCH] - [docker](Dockerfile) Make a copy of the kopano-webapp config files. --- CHANGELOG.md | 2 ++ Dockerfile | 2 ++ README.md | 2 +- src/docker/entry.d/20-docker-print-versions | 2 +- src/kopano/entry.d/30-kopano-migrate | 8 ++++---- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be99d95..f242106 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ - [docker](src/docker/bin/docker-config.sh) Add provision to set up crontab using envvars. - [docker](README.md) Updated documentation. - [kopano](src/kopano) `MIGRATE_CONFIG=2` make sure WebApp plugins have configuration files in place. +- [docker](Dockerfile) Make a copy of the kopano-webapp config files. + # 1.2.4 - [kopano](src/kopano) Now, use man pages and sample config files to find valid keys to match envvar. diff --git a/Dockerfile b/Dockerfile index 29ac3b1..69fc97b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ DOCKER_CRONTAB_FILE=/etc/kopano/docker-crontab \ DOCKER_CRONTAB_DIR=/etc/cron.d \ DOCKER_CONF_DIR1=/etc/kopano \ + DOCKER_SMPL_DIR1=/usr/share/doc/kopano/example-config \ DOCKER_CONF_DIR2=/usr/share/z-push \ DOCKER_APPL_LIB=/var/lib/kopano \ DOCKER_APPL_SSL_DIR=/etc/kopano/ssl \ @@ -204,6 +205,7 @@ RUN apt-get install --yes --no-install-recommends apache2 libapache2-mod-php \ && a2dissite 000-default.conf \ && a2ensite kopano-webapp \ && rm -rf $DOCKER_BUILD_DEB_DIR \ + && cp -r $DOCKER_CONF_DIR1/webapp $DOCKER_SMPL_DIR1 \ && docker-service.sh "-f -s /etc/apache2/envvars -q apache2 -DFOREGROUND -DNO_DETACH -k start" # # Ports diff --git a/README.md b/README.md index 48e0510..df9bd33 100644 --- a/README.md +++ b/README.md @@ -487,7 +487,7 @@ Prior to Kopano WebApp version 5.0.0 the parameter was `define("INSECURE_COOKIES ### `MIGRATE_CONFIG=2` Make sure WebApp plugins have configuration files in place -The WebApp plugins S/MIME and MDM has recently been add to the `mlan/kopano` image. Old deployments might not have the related configuration files in place, preventing these plugins from running. This fix places default copies of configuration files in the configuration directory should they are missing. +The WebApp plugins S/MIME and MDM has recently been added to the `mlan/kopano` image. Old deployments might not have the related configuration files in place, preventing these plugins from running. This fix places default copies of configuration files in the configuration directory should they be missing. # Knowledge base diff --git a/src/docker/entry.d/20-docker-print-versions b/src/docker/entry.d/20-docker-print-versions index 60ce3e4..8a99c98 100755 --- a/src/docker/entry.d/20-docker-print-versions +++ b/src/docker/entry.d/20-docker-print-versions @@ -1,5 +1,5 @@ #!/bin/sh # -# 10-docker-print-versions +# 20-docker-print-versions # dc_pkg_versions kopano-common kopano-webapp z-push-kopano diff --git a/src/kopano/entry.d/30-kopano-migrate b/src/kopano/entry.d/30-kopano-migrate index 82864a5..48a34f5 100755 --- a/src/kopano/entry.d/30-kopano-migrate +++ b/src/kopano/entry.d/30-kopano-migrate @@ -1,6 +1,6 @@ #!/bin/sh # -# 20-kopano-migrate +# 30-kopano-migrate # # Try to make configs compatible with new version if MIGRATE_CONFIG is defined. # Set MIGRATE_CONFIG=1 2 3 to list of fixes or MIGRATE_CONFIG=all to attempt all fixes. @@ -8,13 +8,13 @@ kopano_apply_migrate_fixes() { local applied if [ -n "$MIGRATE_CONFIG" ]; then - for fix in ${MIGRATE_CONFIG/all/1}; do # list all fixes here + for fix in ${MIGRATE_CONFIG/all/1 2}; do # list all fixes here case $fix in 1) dc_replace /etc/kopano/webapp/config.php 'define("INSECURE_COOKIES", true);' 'define("SECURE_COOKIES", false);' ;; 2) for plugin in smime mdm; do - local cfg_file=/etc/kopano/webapp/config-$plugin.php - local src_file=/usr/share/kopano-webapp/plugins/$plugin/config.php + local cfg_file=$DOCKER_CONF_DIR1/webapp/config-$plugin.php + local src_file=$DOCKER_SMPL_DIR1/webapp/config-$plugin.php [ ! -f "$cfg_file" ] && cp "$src_file" "$cfg_file" done ;;