From 6ec2a0a97d51aa12ad1b9a339d78e8be864a53d0 Mon Sep 17 00:00:00 2001 From: Kristian Feldsam Date: Wed, 28 Jul 2021 21:41:44 +0200 Subject: [PATCH] [SOGo] Added hooks support for SOGo image (#4181) Signed-off-by: Kristian Feldsam --- .gitignore | 12 +++++++----- data/Dockerfiles/sogo/docker-entrypoint.sh | 8 ++++++++ data/hooks/sogo/.gitkeep | 0 docker-compose.yml | 1 + 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 data/hooks/sogo/.gitkeep diff --git a/.gitignore b/.gitignore index 76f889b4..06328b85 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ !data/conf/nginx/dynmaps.conf !data/conf/nginx/meta_exporter.conf !data/conf/nginx/site.conf +!/**/.gitkeep *.iml .idea .vscode/* @@ -44,11 +45,12 @@ data/conf/sogo/sieve.creds data/conf/sogo/sogo-full.svg data/gitea/ data/gogs/ -data/hooks/dovecot -data/hooks/phpfpm -data/hooks/postfix -data/hooks/rspamd -data/hooks/unbound +data/hooks/dovecot/* +data/hooks/phpfpm/* +data/hooks/postfix/* +data/hooks/rspamd/* +data/hooks/sogo/* +data/hooks/unbound/* data/web/.well-known/acme-challenge data/web/css/build/0081-custom-mailcow.css data/web/inc/vars.local.inc.php diff --git a/data/Dockerfiles/sogo/docker-entrypoint.sh b/data/Dockerfiles/sogo/docker-entrypoint.sh index ce28c34f..2ff602a3 100755 --- a/data/Dockerfiles/sogo/docker-entrypoint.sh +++ b/data/Dockerfiles/sogo/docker-entrypoint.sh @@ -10,4 +10,12 @@ if [[ ! -z ${REDIS_SLAVEOF_IP} ]]; then cp /etc/syslog-ng/syslog-ng-redis_slave.conf /etc/syslog-ng/syslog-ng.conf fi +# Run hooks +for file in /hooks/*; do + if [ -x "${file}" ]; then + echo "Running hook ${file}" + "${file}" + fi +done + exec "$@" diff --git a/data/hooks/sogo/.gitkeep b/data/hooks/sogo/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docker-compose.yml b/docker-compose.yml index dc74324b..a00687df 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -181,6 +181,7 @@ services: dns: - ${IPV4_NETWORK:-172.22.1}.254 volumes: + - ./data/hooks/sogo:/hooks:Z - ./data/conf/sogo/:/etc/sogo/:z - ./data/web/inc/init_db.inc.php:/init_db.inc.php:Z - ./data/conf/sogo/custom-favicon.ico:/usr/lib/GNUstep/SOGo/WebServerResources/img/sogo.ico:z