From f24c92d37fafdbbcc9b52c099bae0cbf759d7ffe Mon Sep 17 00:00:00 2001 From: Martin Treide-Heuser Date: Mon, 18 Jun 2018 10:09:21 +0200 Subject: [PATCH] Adding switch to activate log to STDOUT --- README.md | 1 + rootfs/usr/local/bin/run.sh | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index c5f23f5..aeeaea0 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Rainloop is a simple, modern & fast web-based client. More details on the [offic | **UID** | rainloop user id | *optional* | 991 | **GID** | rainloop group id | *optional* | 991 | **UPLOAD_MAX_SIZE** | Attachment size limit | *optional* | 25M +| **LOG_TO_STDOUT** | set to "true" | *optional* | undef ### Docker-compose.yml diff --git a/rootfs/usr/local/bin/run.sh b/rootfs/usr/local/bin/run.sh index 443da40..65689fb 100644 --- a/rootfs/usr/local/bin/run.sh +++ b/rootfs/usr/local/bin/run.sh @@ -8,6 +8,13 @@ if [ -d "/rainloop/data/_data_/_default_/plugins/postfixadmin-change-password" ] rm -rf /rainloop/data/_data_/_default_/plugins/postfixadmin-change-password fi +# Set log output to STDOUT if wanted (NGINX_LOG_TO_STDOUT=true) +if [ "$LOG_TO_STDOUT" == "true" ]; then + chmod o+w /dev/stdout + sed -i "s/.*error_log.*$/error_log /dev/stdout warn;/" + echo "Logging to STDOUT activated" > /dev/stdout +fi + # Add postfixadmin-change-password plugin mkdir -p /rainloop/data/_data_/_default_/plugins/ cp -r /usr/local/include/postfixadmin-change-password /rainloop/data/_data_/_default_/plugins/