mirror of
https://github.com/zokradonh/kopano-docker.git
synced 2026-08-22 13:52:56 +00:00
Run all containers read-only (#314)
* switch containers in compose file to read-only related to https://github.com/zokradonh/kopano-docker/issues/310 * make scheduler container read-only * make meet container read-only * fix konnect for read-only * make core mostly read-only * add custom location for ldap.cfg to default config * sort config option for readability * update makefile pull workaround * make kdav read-only * remove locale generation code from core startup * fix commander tests * fix store language tests * add test for a dutch mailbox * make it possible to run webapp read-only * add locale hint to the compose file * finish read-only mode for z-push
This commit is contained in:
+12
-4
@@ -12,8 +12,9 @@ set -eu # unset variables are errors & non-zero return values exit the whole scr
|
||||
# shellcheck source=php/start-helper.sh
|
||||
source /kopano/start-helper.sh
|
||||
|
||||
# Hint: this is not compatible with a read-only container.
|
||||
# The general recommendation is to already build a container that has all required packages installed.
|
||||
ADDITIONAL_KOPANO_PACKAGES="$ADDITIONAL_KOPANO_PACKAGES $ADDITIONAL_KOPANO_WEBAPP_PLUGINS"
|
||||
|
||||
ADDITIONAL_KOPANO_PACKAGES=$(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"')
|
||||
[ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && apt update
|
||||
[ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && for installpkg in $ADDITIONAL_KOPANO_PACKAGES; do
|
||||
@@ -25,6 +26,13 @@ ADDITIONAL_KOPANO_PACKAGES=$(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"')
|
||||
fi
|
||||
done
|
||||
|
||||
# copy latest config template
|
||||
mkdir -p /tmp/webapp/
|
||||
for i in /etc/kopano/webapp/*.dist /etc/kopano/webapp/.[^.]*.dist; do
|
||||
filename=$(basename -- "$i")
|
||||
cp "$i" "/tmp/webapp/${filename%.*}"
|
||||
done
|
||||
|
||||
# Ensure directories exist
|
||||
mkdir -p /run/sessions /tmp/webapp
|
||||
|
||||
@@ -37,13 +45,13 @@ if [ "$KCCONF_SERVERHOSTNAME" == "127.0.0.1" ]; then
|
||||
echo "Kopano WebApp is using the default: connection"
|
||||
else
|
||||
echo "Kopano WebApp is using an ip connection"
|
||||
php_cfg_gen /etc/kopano/webapp/config.php DEFAULT_SERVER "https://${KCCONF_SERVERHOSTNAME}:${KCCONF_SERVERPORT}/kopano"
|
||||
php_cfg_gen /tmp/webapp/config.php DEFAULT_SERVER "https://${KCCONF_SERVERHOSTNAME}:${KCCONF_SERVERPORT}/kopano"
|
||||
fi
|
||||
|
||||
# configuring webapp from env
|
||||
for setting in $(compgen -A variable KCCONF_WEBAPP_); do
|
||||
setting2=${setting#KCCONF_WEBAPP_}
|
||||
php_cfg_gen /etc/kopano/webapp/config.php "${setting2}" "${!setting}"
|
||||
php_cfg_gen /tmp/webapp/config.php "${setting2}" "${!setting}"
|
||||
done
|
||||
|
||||
# configuring webapp plugins from env
|
||||
@@ -52,7 +60,7 @@ for setting in $(compgen -A variable KCCONF_WEBAPPPLUGIN_); do
|
||||
filename="${setting2%%_*}"
|
||||
setting3=${setting#KCCONF_WEBAPPPLUGIN_${filename}_}
|
||||
identifier="${filename,,}"
|
||||
php_cfg_gen /etc/kopano/webapp/config-"$identifier".php "${setting3}" "${!setting}"
|
||||
php_cfg_gen /tmp/webapp/config-"$identifier".php "${setting3}" "${!setting}"
|
||||
done
|
||||
|
||||
echo "Ensure config ownership"
|
||||
|
||||
Reference in New Issue
Block a user