From 3b44ca9122aad5dafa1035c465daf311a7991e3f Mon Sep 17 00:00:00 2001 From: mlan Date: Fri, 18 Dec 2020 23:36:32 +0100 Subject: [PATCH] - [kopano](src/kopano) `MIGRATE_CONFIG=2` make sure WebApp plugins have configuration files in place. --- CHANGELOG.md | 2 +- README.md | 8 ++++++-- src/kopano/entry.d/30-kopano-migrate | 7 +++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d973122..be99d95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ - [kopano](src/kopano/entry.d/10-kopano-common) Allow module based parameter names. - [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. # 1.2.4 - [kopano](src/kopano) Now, use man pages and sample config files to find valid keys to match envvar. diff --git a/README.md b/README.md index 3143b9e..48e0510 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,7 @@ make app-parms_server Some services use the same parameter names. When such a parameter is set using en environment variable all configuration files of the related services will be updated. This is not always desired. To address this you can prefix the parameter name with the name of the service you which to target by using the following syntax: `_`. -For example when using the [Kopano-archiver](https://documentation.kopano.io/kopano_archiver_manual/) service, you often want to use one SQL database for the server and one separate one for the archiver. In this situation you can have two separate SQL database containers, one at `db-srv` and the other at `db-arc`. To set the [`MYSQL_HOST`](#mysql_host) parameter in the two relevant configuration files use `SERVER_MYSQL_HOST=db-srv` and `ARCHIVER_MYSQL_HOST=db-arc`. If for some reason you want both services to call the same container, instead use: `MYSQL_HOST=db`. +For example when using the [Kopano-archiver](https://documentation.kopano.io/kopano_archiver_manual/) service, you often want to use one SQL database for the server and one separate one for the archiver. In this situation you can have two separate SQL database containers, one at `db-srv` and the other at `db-arc`. To set the [`MYSQL_HOST`](#mysql_host) parameter in the two relevant configuration files use `SERVER_MYSQL_HOST=db-srv` and `ARCHIVER_MYSQL_HOST=db-arc`. If for some reason you want both services to call the same container, instead use: `MYSQL_HOST=db`. ## SQL database configuration @@ -408,7 +408,7 @@ Separately, `LOG_LEVEL` controls the logging level of the Kopano services. `LOG_ The [Kopano Archiver](https://documentation.kopano.io/kopano_archiver_manual/) provides a Hierarchical Storage Management (HSM) solution for Kopano. With the Kopano Archiver older messages will be automatically moved to slower and thus cheaper storage. The slow storage consists of one or more additional Kopano Archive servers which sole task it is to store archived messages. -Typically the archiver needs its own SQL database. You can configure it using environment variables. When you do, pay attention to [overlapping parameter names](#overlapping-parameter-names). Also the archiver does not run as a daemon but instead you can set up [cron](#cron) jobs. For example, to run the archiver daily with weakly clean-up you can use; `CRONTAB_ENTRY1=0 1 * * * root kopano-archiver -A` and `CRONTAB_ENTRY2=0 3 * * 0 root kopano-archiver -C`. +Typically the archiver needs its own SQL database. You can configure it using environment variables. When you do, pay attention to [overlapping parameter names](#overlapping-parameter-names). Also the archiver does not run as a daemon but instead you can set up [cron](#cron) jobs. For example, to run the archiver daily with weakly clean-up you can use; `CRONTAB_ENTRY1=0 1 * * * root kopano-archiver -A` and `CRONTAB_ENTRY2=0 3 * * 0 root kopano-archiver -C`. ## WebApp custom themes @@ -485,6 +485,10 @@ Sometimes a new version of Kopano breaks compatibility with old configurations. Prior to Kopano WebApp version 5.0.0 the parameter was `define("INSECURE_COOKIES", true);` was used to allow HTTP access. Now [`define("SECURE_COOKIES", false);`](https://documentation.kopano.io/webapp_admin_manual/config.html#secure-cookies) is used instead. This fix tries to update the configuration accordingly. +### `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. + # Knowledge base Here some topics relevant for arranging a mail server are presented. diff --git a/src/kopano/entry.d/30-kopano-migrate b/src/kopano/entry.d/30-kopano-migrate index a7493ef..82864a5 100755 --- a/src/kopano/entry.d/30-kopano-migrate +++ b/src/kopano/entry.d/30-kopano-migrate @@ -11,6 +11,13 @@ kopano_apply_migrate_fixes() { for fix in ${MIGRATE_CONFIG/all/1}; 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 + [ ! -f "$cfg_file" ] && cp "$src_file" "$cfg_file" + done + ;; *) fix= ;; esac if [ -n "$fix" ]; then