diff --git a/examples/webapp.yml b/examples/webapp.yml index 1742f96..606f086 100644 --- a/examples/webapp.yml +++ b/examples/webapp.yml @@ -21,6 +21,8 @@ services: - SETGID - SETUID volumes: + - /etc/machine-id:/etc/machine-id + - /etc/machine-id:/var/lib/dbus/machine-id - web:/.kweb networks: web-net: @@ -33,6 +35,8 @@ services: container_name: kopano_webapp volumes: - /etc/kopano/ssl:/kopano/ssl + - /etc/machine-id:/etc/machine-id + - /etc/machine-id:/var/lib/dbus/machine-id - /run/kopano:/run/kopano environment: - TZ=${TZ} @@ -41,6 +45,9 @@ services: # https port of kopano system - KCCONF_SERVERPORT= - ADDITIONAL_KOPANO_WEBAPP_PLUGINS=${ADDITIONAL_KOPANO_WEBAPP_PLUGINS} + #- ADDITIONAL_KOPANO_WEBAPP_PLUGINS=kopano-webapp-plugin-mdm + - KCCONF_WEBAPPPLUGIN_MDM_PLUGIN_MDM_USER_DEFAULT_ENABLE_MDM=true + - KCCONF_WEBAPPPLUGIN_MDM_PLUGIN_MDM_SERVER=kopano_zpush:9080 networks: - web-net diff --git a/php/start-helper.sh b/php/start-helper.sh index 5176664..af55ee1 100755 --- a/php/start-helper.sh +++ b/php/start-helper.sh @@ -13,6 +13,7 @@ php_cfg_gen() { return fi case $cfg_value in + # TODO stop after the first match true|TRUE|false|FALSE) sed -ri "s#(\s*define).+${cfg_setting}.+#\tdefine(\x27${cfg_setting}\x27, ${cfg_value}\);#g" "$cfg_file" ;; diff --git a/webapp/start.sh b/webapp/start.sh index a087739..4550929 100755 --- a/webapp/start.sh +++ b/webapp/start.sh @@ -34,6 +34,14 @@ if [ "${AUTOCONFIGURE}" == true ]; then echo "- switch the container to 'read_only: false'" fi + phpversion=$(dpkg-query --showformat='${Version}' --show php7-mapi) + echo "Using PHP-Mapi: $phpversion" + webappversion=$(dpkg-query --showformat='${Version}' --show kopano-webapp) + echo "Using Kopano WebApp: $webappversion" + + # Ensure directories exist + mkdir -p /run/sessions /tmp/webapp /var/lib/kopano-webapp/tmp + # copy latest config template mkdir -p /tmp/webapp/ for i in /etc/kopano/webapp/*.dist /etc/kopano/webapp/.[^.]*.dist; do @@ -41,13 +49,15 @@ if [ "${AUTOCONFIGURE}" == true ]; then cp "$i" "/tmp/webapp/${filename%.*}" done - # Ensure directories exist - mkdir -p /run/sessions /tmp/webapp /var/lib/kopano-webapp/tmp - - phpversion=$(dpkg-query --showformat='${Version}' --show php7-mapi) - echo "Using PHP-Mapi: $phpversion" - webappversion=$(dpkg-query --showformat='${Version}' --show kopano-webapp) - echo "Using Kopano WebApp: $webappversion" + # fallback for plugins installed during runtime + for i in /etc/kopano/webapp/*.php; do + filename=$(basename -- "$i") + if [ "$filename" = config.php ]; then + continue + fi + mv -vn "$i" "/tmp/webapp/$filename" + ln -sfn "/tmp/webapp/$filename" "$i" + done if [ "$KCCONF_SERVERHOSTNAME" == "127.0.0.1" ]; then echo "Kopano WebApp is using the default: connection"