diff --git a/core/start-service.sh b/core/start-service.sh index 17ccff9..22d35ec 100755 --- a/core/start-service.sh +++ b/core/start-service.sh @@ -1,5 +1,7 @@ #!/bin/bash +ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""} + set -eu # unset variables are errors & non-zero return values exit the whole script if [ ! -e /kopano/$SERVICE_TO_START.py ] @@ -8,6 +10,13 @@ then exit 1 fi +[ ! -z "$ADDITIONAL_KOPANO_PACKAGES" ] && apt update +[ ! -z "$ADDITIONAL_KOPANO_PACKAGES" ] && for installpkg in "$ADDITIONAL_KOPANO_PACKAGES"; do + if [ $(dpkg-query -W -f='${Status}' $installpkg 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + apt --assume-yes install $installpkg; + fi +done + mkdir -p /kopano/data/attachments /tmp/$SERVICE_TO_START /var/run/kopano echo "Configure core service '$SERVICE_TO_START'" | ts diff --git a/docker-compose.yml-example b/docker-compose.yml-example index 07fc89d..8fba278 100644 --- a/docker-compose.yml-example +++ b/docker-compose.yml-example @@ -99,6 +99,7 @@ services: - ./data/socket/:/run/kopano environment: - TZ=Europe/Berlin + #- ADDITIONAL_KOPANO_PACKAGES=kopano-webapp-plugin-mattermost networks: - web - kopanonet @@ -140,6 +141,7 @@ services: - KCCONF_LDAP_LDAP_SEARCH_BASE=OU=MyUsers,dc=domain,dc=tld #change here - KCCOMMENT_LDAP_1=!include /usr/share/kopano/ldap.openldap.cfg #delete if you want openldap - KCUNCOMMENT_LDAP_1=!include /usr/share/kopano/ldap.active-directory.cfg #delete if you want openldap + #- ADDITIONAL_KOPANO_PACKAGES=kopano-migration-imap networks: - kopanonet volumes: diff --git a/webapp/start.sh b/webapp/start.sh index 6e4ab94..dcbbb83 100755 --- a/webapp/start.sh +++ b/webapp/start.sh @@ -1,11 +1,19 @@ #!/bin/bash -# define default value for serverhostname and serverport of not passed into container +# define default value for serverhostname and serverport if not passed into container KCCONF_SERVERHOSTNAME=${KCCONF_SERVERHOSTNAME:-127.0.0.1} KCCONF_SERVERPORT=${KCCONF_SERVERPORT:-237} +ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""} set -eu # unset variables are errors & non-zero return values exit the whole script +[ ! -z "$ADDITIONAL_KOPANO_PACKAGES" ] && apt update +[ ! -z "$ADDITIONAL_KOPANO_PACKAGES" ] && for installpkg in "$ADDITIONAL_KOPANO_PACKAGES"; do + if [ $(dpkg-query -W -f='${Status}' $installpkg 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + apt --assume-yes install $installpkg; + fi +done + echo "Ensure directories" mkdir -p /run/sessions /tmp/webapp