From f24c92d37fafdbbcc9b52c099bae0cbf759d7ffe Mon Sep 17 00:00:00 2001 From: Martin Treide-Heuser Date: Mon, 18 Jun 2018 10:09:21 +0200 Subject: [PATCH 1/4] 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/ From af76ff6e115e938163ae68f6c48d46c7bf04aa07 Mon Sep 17 00:00:00 2001 From: Martin Treide-Heuser Date: Mon, 18 Jun 2018 10:11:04 +0200 Subject: [PATCH 2/4] typo correction --- rootfs/usr/local/bin/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/usr/local/bin/run.sh b/rootfs/usr/local/bin/run.sh index 65689fb..978a204 100644 --- a/rootfs/usr/local/bin/run.sh +++ b/rootfs/usr/local/bin/run.sh @@ -8,7 +8,7 @@ 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) +# Set log output to STDOUT if wanted (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;/" From 273437d0345d9c016fb99727c726a910db46be73 Mon Sep 17 00:00:00 2001 From: Martin Treide-Heuser Date: Mon, 18 Jun 2018 10:38:24 +0200 Subject: [PATCH 3/4] forgot to escape slashes --- rootfs/usr/local/bin/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/usr/local/bin/run.sh b/rootfs/usr/local/bin/run.sh index 978a204..f3308a4 100644 --- a/rootfs/usr/local/bin/run.sh +++ b/rootfs/usr/local/bin/run.sh @@ -11,7 +11,7 @@ fi # Set log output to STDOUT if wanted (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;/" + sed -i "s/.*error_log.*$/error_log \/dev\/stdout warn;/" echo "Logging to STDOUT activated" > /dev/stdout fi From fee526faa8a6946225034e16bb4284d04016ed60 Mon Sep 17 00:00:00 2001 From: Martin Treide-Heuser Date: Mon, 18 Jun 2018 10:40:03 +0200 Subject: [PATCH 4/4] and forgot to add nginx.conf --- rootfs/usr/local/bin/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/usr/local/bin/run.sh b/rootfs/usr/local/bin/run.sh index f3308a4..19af137 100644 --- a/rootfs/usr/local/bin/run.sh +++ b/rootfs/usr/local/bin/run.sh @@ -11,7 +11,7 @@ fi # Set log output to STDOUT if wanted (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;/" + sed -i "s/.*error_log.*$/error_log \/dev\/stdout warn;/" /etc/nginx/nginx.conf echo "Logging to STDOUT activated" > /dev/stdout fi