From c880649dfabab3e4489a40bcccc3e08e91d9aea8 Mon Sep 17 00:00:00 2001 From: ne20002 Date: Tue, 1 Jul 2025 19:30:28 +0000 Subject: [PATCH 1/2] Adding logfile at startup --- 2024.12/apache/Dockerfile | 1 + 2024.12/apache/entrypoint.sh | 8 ++++++++ 2024.12/fpm-alpine/entrypoint.sh | 8 ++++++++ 2024.12/fpm/Dockerfile | 1 + 2024.12/fpm/entrypoint.sh | 8 ++++++++ 2026.01/apache/Dockerfile | 1 + 2026.01/apache/entrypoint.sh | 8 ++++++++ 2026.01/fpm-alpine/entrypoint.sh | 8 ++++++++ 2026.01/fpm/Dockerfile | 1 + 2026.01/fpm/entrypoint.sh | 8 ++++++++ 2026.04-dev/apache/Dockerfile | 1 + 2026.04-dev/apache/entrypoint.sh | 8 ++++++++ 2026.04-dev/fpm-alpine/entrypoint.sh | 8 ++++++++ 2026.04-dev/fpm/Dockerfile | 1 + 2026.04-dev/fpm/entrypoint.sh | 8 ++++++++ Dockerfile-debian.template | 1 + docker-entrypoint.sh | 8 ++++++++ 17 files changed, 87 insertions(+) diff --git a/2024.12/apache/Dockerfile b/2024.12/apache/Dockerfile index b10c55aa..198593d2 100644 --- a/2024.12/apache/Dockerfile +++ b/2024.12/apache/Dockerfile @@ -6,6 +6,7 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ + sudo \ rsync \ bzip2 \ # For mail() support diff --git a/2024.12/apache/entrypoint.sh b/2024.12/apache/entrypoint.sh index b080cef0..b5f93c9a 100755 --- a/2024.12/apache/entrypoint.sh +++ b/2024.12/apache/entrypoint.sh @@ -39,8 +39,16 @@ file_env() { unset "$fileVar" } +# initialize the email configuration sh /setup_msmtp.sh +# ensure we have a logfile writeable by www-data +FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} +if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then + touch "$FRIENDICA_LOGFILE" + chown www-data:www-data "$FRIENDICA_LOGFILE" +fi + # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2024.12/fpm-alpine/entrypoint.sh b/2024.12/fpm-alpine/entrypoint.sh index b080cef0..b5f93c9a 100755 --- a/2024.12/fpm-alpine/entrypoint.sh +++ b/2024.12/fpm-alpine/entrypoint.sh @@ -39,8 +39,16 @@ file_env() { unset "$fileVar" } +# initialize the email configuration sh /setup_msmtp.sh +# ensure we have a logfile writeable by www-data +FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} +if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then + touch "$FRIENDICA_LOGFILE" + chown www-data:www-data "$FRIENDICA_LOGFILE" +fi + # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2024.12/fpm/Dockerfile b/2024.12/fpm/Dockerfile index cf2e8df4..a9d54b24 100644 --- a/2024.12/fpm/Dockerfile +++ b/2024.12/fpm/Dockerfile @@ -6,6 +6,7 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ + sudo \ rsync \ bzip2 \ # For mail() support diff --git a/2024.12/fpm/entrypoint.sh b/2024.12/fpm/entrypoint.sh index b080cef0..b5f93c9a 100755 --- a/2024.12/fpm/entrypoint.sh +++ b/2024.12/fpm/entrypoint.sh @@ -39,8 +39,16 @@ file_env() { unset "$fileVar" } +# initialize the email configuration sh /setup_msmtp.sh +# ensure we have a logfile writeable by www-data +FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} +if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then + touch "$FRIENDICA_LOGFILE" + chown www-data:www-data "$FRIENDICA_LOGFILE" +fi + # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.01/apache/Dockerfile b/2026.01/apache/Dockerfile index 61f0fe73..c01d2ef7 100644 --- a/2026.01/apache/Dockerfile +++ b/2026.01/apache/Dockerfile @@ -6,6 +6,7 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ + sudo \ rsync \ bzip2 \ # For mail() support diff --git a/2026.01/apache/entrypoint.sh b/2026.01/apache/entrypoint.sh index b080cef0..b5f93c9a 100755 --- a/2026.01/apache/entrypoint.sh +++ b/2026.01/apache/entrypoint.sh @@ -39,8 +39,16 @@ file_env() { unset "$fileVar" } +# initialize the email configuration sh /setup_msmtp.sh +# ensure we have a logfile writeable by www-data +FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} +if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then + touch "$FRIENDICA_LOGFILE" + chown www-data:www-data "$FRIENDICA_LOGFILE" +fi + # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.01/fpm-alpine/entrypoint.sh b/2026.01/fpm-alpine/entrypoint.sh index b080cef0..b5f93c9a 100755 --- a/2026.01/fpm-alpine/entrypoint.sh +++ b/2026.01/fpm-alpine/entrypoint.sh @@ -39,8 +39,16 @@ file_env() { unset "$fileVar" } +# initialize the email configuration sh /setup_msmtp.sh +# ensure we have a logfile writeable by www-data +FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} +if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then + touch "$FRIENDICA_LOGFILE" + chown www-data:www-data "$FRIENDICA_LOGFILE" +fi + # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.01/fpm/Dockerfile b/2026.01/fpm/Dockerfile index 105068ea..28ae5be3 100644 --- a/2026.01/fpm/Dockerfile +++ b/2026.01/fpm/Dockerfile @@ -6,6 +6,7 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ + sudo \ rsync \ bzip2 \ # For mail() support diff --git a/2026.01/fpm/entrypoint.sh b/2026.01/fpm/entrypoint.sh index b080cef0..b5f93c9a 100755 --- a/2026.01/fpm/entrypoint.sh +++ b/2026.01/fpm/entrypoint.sh @@ -39,8 +39,16 @@ file_env() { unset "$fileVar" } +# initialize the email configuration sh /setup_msmtp.sh +# ensure we have a logfile writeable by www-data +FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} +if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then + touch "$FRIENDICA_LOGFILE" + chown www-data:www-data "$FRIENDICA_LOGFILE" +fi + # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.04-dev/apache/Dockerfile b/2026.04-dev/apache/Dockerfile index d95ef679..038faef7 100644 --- a/2026.04-dev/apache/Dockerfile +++ b/2026.04-dev/apache/Dockerfile @@ -6,6 +6,7 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ + sudo \ rsync \ bzip2 \ # For mail() support diff --git a/2026.04-dev/apache/entrypoint.sh b/2026.04-dev/apache/entrypoint.sh index b080cef0..b5f93c9a 100755 --- a/2026.04-dev/apache/entrypoint.sh +++ b/2026.04-dev/apache/entrypoint.sh @@ -39,8 +39,16 @@ file_env() { unset "$fileVar" } +# initialize the email configuration sh /setup_msmtp.sh +# ensure we have a logfile writeable by www-data +FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} +if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then + touch "$FRIENDICA_LOGFILE" + chown www-data:www-data "$FRIENDICA_LOGFILE" +fi + # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.04-dev/fpm-alpine/entrypoint.sh b/2026.04-dev/fpm-alpine/entrypoint.sh index b080cef0..b5f93c9a 100755 --- a/2026.04-dev/fpm-alpine/entrypoint.sh +++ b/2026.04-dev/fpm-alpine/entrypoint.sh @@ -39,8 +39,16 @@ file_env() { unset "$fileVar" } +# initialize the email configuration sh /setup_msmtp.sh +# ensure we have a logfile writeable by www-data +FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} +if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then + touch "$FRIENDICA_LOGFILE" + chown www-data:www-data "$FRIENDICA_LOGFILE" +fi + # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.04-dev/fpm/Dockerfile b/2026.04-dev/fpm/Dockerfile index f7c22f27..9ae1e117 100644 --- a/2026.04-dev/fpm/Dockerfile +++ b/2026.04-dev/fpm/Dockerfile @@ -6,6 +6,7 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ + sudo \ rsync \ bzip2 \ # For mail() support diff --git a/2026.04-dev/fpm/entrypoint.sh b/2026.04-dev/fpm/entrypoint.sh index b080cef0..b5f93c9a 100755 --- a/2026.04-dev/fpm/entrypoint.sh +++ b/2026.04-dev/fpm/entrypoint.sh @@ -39,8 +39,16 @@ file_env() { unset "$fileVar" } +# initialize the email configuration sh /setup_msmtp.sh +# ensure we have a logfile writeable by www-data +FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} +if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then + touch "$FRIENDICA_LOGFILE" + chown www-data:www-data "$FRIENDICA_LOGFILE" +fi + # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 7b35be62..a04a1659 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -5,6 +5,7 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ + sudo \ rsync \ bzip2 \ # For mail() support diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b080cef0..b5f93c9a 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -39,8 +39,16 @@ file_env() { unset "$fileVar" } +# initialize the email configuration sh /setup_msmtp.sh +# ensure we have a logfile writeable by www-data +FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} +if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then + touch "$FRIENDICA_LOGFILE" + chown www-data:www-data "$FRIENDICA_LOGFILE" +fi + # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then From 0435c37e430f1c1f9ddf33aec0ed000f75fb153f Mon Sep 17 00:00:00 2001 From: ne20002 Date: Sat, 30 Aug 2025 14:31:41 +0000 Subject: [PATCH 2/2] Adding logfile at startup --- .config/zz-docker.config.php | 2 +- 2024.12/apache/Dockerfile | 4 +++- 2024.12/apache/config/zz-docker.config.php | 2 +- 2024.12/apache/entrypoint.sh | 8 -------- 2024.12/fpm-alpine/Dockerfile | 3 +++ 2024.12/fpm-alpine/config/zz-docker.config.php | 2 +- 2024.12/fpm-alpine/entrypoint.sh | 8 -------- 2024.12/fpm/Dockerfile | 4 +++- 2024.12/fpm/config/zz-docker.config.php | 2 +- 2024.12/fpm/entrypoint.sh | 8 -------- 2026.01/apache/Dockerfile | 4 +++- 2026.01/apache/config/zz-docker.config.php | 2 +- 2026.01/apache/entrypoint.sh | 8 -------- 2026.01/fpm-alpine/Dockerfile | 3 +++ 2026.01/fpm-alpine/config/zz-docker.config.php | 2 +- 2026.01/fpm-alpine/entrypoint.sh | 8 -------- 2026.01/fpm/Dockerfile | 4 +++- 2026.01/fpm/config/zz-docker.config.php | 2 +- 2026.01/fpm/entrypoint.sh | 8 -------- 2026.04-dev/apache/Dockerfile | 4 +++- 2026.04-dev/apache/config/zz-docker.config.php | 2 +- 2026.04-dev/apache/entrypoint.sh | 8 -------- 2026.04-dev/fpm-alpine/Dockerfile | 3 +++ 2026.04-dev/fpm-alpine/config/zz-docker.config.php | 2 +- 2026.04-dev/fpm-alpine/entrypoint.sh | 8 -------- 2026.04-dev/fpm/Dockerfile | 4 +++- 2026.04-dev/fpm/config/zz-docker.config.php | 2 +- 2026.04-dev/fpm/entrypoint.sh | 8 -------- Dockerfile-alpine.template | 3 +++ Dockerfile-debian.template | 4 +++- README.md | 11 ++++++----- docker-entrypoint.sh | 8 -------- 32 files changed, 49 insertions(+), 102 deletions(-) diff --git a/.config/zz-docker.config.php b/.config/zz-docker.config.php index 7a0d7985..08b29dc8 100644 --- a/.config/zz-docker.config.php +++ b/.config/zz-docker.config.php @@ -12,7 +12,7 @@ // Necessary because otherwise the daemon isn't working 'pidfile' => '/var/run/friendica.pid', - 'logfile' => '/var/www/html/friendica.log', + 'logfile' => '/var/log/friendica.log', 'loglevel' => 'notice', ], 'storage' => [ diff --git a/2024.12/apache/Dockerfile b/2024.12/apache/Dockerfile index 198593d2..182246dd 100644 --- a/2024.12/apache/Dockerfile +++ b/2024.12/apache/Dockerfile @@ -6,7 +6,6 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ - sudo \ rsync \ bzip2 \ # For mail() support @@ -170,6 +169,9 @@ RUN set -ex; \ mkdir -p -m 775 /var/www/data; \ chown -R www-data:www-data /var/www/data +RUN set -ex; \ + ln -sf /dev/stdout /var/log/friendica.log + VOLUME /var/www/html VOLUME /var/www/data diff --git a/2024.12/apache/config/zz-docker.config.php b/2024.12/apache/config/zz-docker.config.php index 7a0d7985..08b29dc8 100644 --- a/2024.12/apache/config/zz-docker.config.php +++ b/2024.12/apache/config/zz-docker.config.php @@ -12,7 +12,7 @@ // Necessary because otherwise the daemon isn't working 'pidfile' => '/var/run/friendica.pid', - 'logfile' => '/var/www/html/friendica.log', + 'logfile' => '/var/log/friendica.log', 'loglevel' => 'notice', ], 'storage' => [ diff --git a/2024.12/apache/entrypoint.sh b/2024.12/apache/entrypoint.sh index b5f93c9a..b080cef0 100755 --- a/2024.12/apache/entrypoint.sh +++ b/2024.12/apache/entrypoint.sh @@ -39,16 +39,8 @@ file_env() { unset "$fileVar" } -# initialize the email configuration sh /setup_msmtp.sh -# ensure we have a logfile writeable by www-data -FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} -if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then - touch "$FRIENDICA_LOGFILE" - chown www-data:www-data "$FRIENDICA_LOGFILE" -fi - # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2024.12/fpm-alpine/Dockerfile b/2024.12/fpm-alpine/Dockerfile index 6ae02e38..ab728663 100644 --- a/2024.12/fpm-alpine/Dockerfile +++ b/2024.12/fpm-alpine/Dockerfile @@ -139,6 +139,9 @@ RUN set -ex; \ mkdir -p -m 775 /var/www/data; \ chown -R www-data:www-data /var/www/data +RUN set -ex; \ + ln -sf /dev/stdout /var/log/friendica.log + VOLUME /var/www/html VOLUME /var/www/data diff --git a/2024.12/fpm-alpine/config/zz-docker.config.php b/2024.12/fpm-alpine/config/zz-docker.config.php index 7a0d7985..08b29dc8 100644 --- a/2024.12/fpm-alpine/config/zz-docker.config.php +++ b/2024.12/fpm-alpine/config/zz-docker.config.php @@ -12,7 +12,7 @@ // Necessary because otherwise the daemon isn't working 'pidfile' => '/var/run/friendica.pid', - 'logfile' => '/var/www/html/friendica.log', + 'logfile' => '/var/log/friendica.log', 'loglevel' => 'notice', ], 'storage' => [ diff --git a/2024.12/fpm-alpine/entrypoint.sh b/2024.12/fpm-alpine/entrypoint.sh index b5f93c9a..b080cef0 100755 --- a/2024.12/fpm-alpine/entrypoint.sh +++ b/2024.12/fpm-alpine/entrypoint.sh @@ -39,16 +39,8 @@ file_env() { unset "$fileVar" } -# initialize the email configuration sh /setup_msmtp.sh -# ensure we have a logfile writeable by www-data -FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} -if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then - touch "$FRIENDICA_LOGFILE" - chown www-data:www-data "$FRIENDICA_LOGFILE" -fi - # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2024.12/fpm/Dockerfile b/2024.12/fpm/Dockerfile index a9d54b24..672414b5 100644 --- a/2024.12/fpm/Dockerfile +++ b/2024.12/fpm/Dockerfile @@ -6,7 +6,6 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ - sudo \ rsync \ bzip2 \ # For mail() support @@ -162,6 +161,9 @@ RUN set -ex; \ mkdir -p -m 775 /var/www/data; \ chown -R www-data:www-data /var/www/data +RUN set -ex; \ + ln -sf /dev/stdout /var/log/friendica.log + VOLUME /var/www/html VOLUME /var/www/data diff --git a/2024.12/fpm/config/zz-docker.config.php b/2024.12/fpm/config/zz-docker.config.php index 7a0d7985..08b29dc8 100644 --- a/2024.12/fpm/config/zz-docker.config.php +++ b/2024.12/fpm/config/zz-docker.config.php @@ -12,7 +12,7 @@ // Necessary because otherwise the daemon isn't working 'pidfile' => '/var/run/friendica.pid', - 'logfile' => '/var/www/html/friendica.log', + 'logfile' => '/var/log/friendica.log', 'loglevel' => 'notice', ], 'storage' => [ diff --git a/2024.12/fpm/entrypoint.sh b/2024.12/fpm/entrypoint.sh index b5f93c9a..b080cef0 100755 --- a/2024.12/fpm/entrypoint.sh +++ b/2024.12/fpm/entrypoint.sh @@ -39,16 +39,8 @@ file_env() { unset "$fileVar" } -# initialize the email configuration sh /setup_msmtp.sh -# ensure we have a logfile writeable by www-data -FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} -if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then - touch "$FRIENDICA_LOGFILE" - chown www-data:www-data "$FRIENDICA_LOGFILE" -fi - # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.01/apache/Dockerfile b/2026.01/apache/Dockerfile index c01d2ef7..1f289a6a 100644 --- a/2026.01/apache/Dockerfile +++ b/2026.01/apache/Dockerfile @@ -6,7 +6,6 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ - sudo \ rsync \ bzip2 \ # For mail() support @@ -170,6 +169,9 @@ RUN set -ex; \ mkdir -p -m 775 /var/www/data; \ chown -R www-data:www-data /var/www/data +RUN set -ex; \ + ln -sf /dev/stdout /var/log/friendica.log + VOLUME /var/www/html VOLUME /var/www/data diff --git a/2026.01/apache/config/zz-docker.config.php b/2026.01/apache/config/zz-docker.config.php index 7a0d7985..08b29dc8 100644 --- a/2026.01/apache/config/zz-docker.config.php +++ b/2026.01/apache/config/zz-docker.config.php @@ -12,7 +12,7 @@ // Necessary because otherwise the daemon isn't working 'pidfile' => '/var/run/friendica.pid', - 'logfile' => '/var/www/html/friendica.log', + 'logfile' => '/var/log/friendica.log', 'loglevel' => 'notice', ], 'storage' => [ diff --git a/2026.01/apache/entrypoint.sh b/2026.01/apache/entrypoint.sh index b5f93c9a..b080cef0 100755 --- a/2026.01/apache/entrypoint.sh +++ b/2026.01/apache/entrypoint.sh @@ -39,16 +39,8 @@ file_env() { unset "$fileVar" } -# initialize the email configuration sh /setup_msmtp.sh -# ensure we have a logfile writeable by www-data -FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} -if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then - touch "$FRIENDICA_LOGFILE" - chown www-data:www-data "$FRIENDICA_LOGFILE" -fi - # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.01/fpm-alpine/Dockerfile b/2026.01/fpm-alpine/Dockerfile index 41188ac8..a243f790 100644 --- a/2026.01/fpm-alpine/Dockerfile +++ b/2026.01/fpm-alpine/Dockerfile @@ -139,6 +139,9 @@ RUN set -ex; \ mkdir -p -m 775 /var/www/data; \ chown -R www-data:www-data /var/www/data +RUN set -ex; \ + ln -sf /dev/stdout /var/log/friendica.log + VOLUME /var/www/html VOLUME /var/www/data diff --git a/2026.01/fpm-alpine/config/zz-docker.config.php b/2026.01/fpm-alpine/config/zz-docker.config.php index 7a0d7985..08b29dc8 100644 --- a/2026.01/fpm-alpine/config/zz-docker.config.php +++ b/2026.01/fpm-alpine/config/zz-docker.config.php @@ -12,7 +12,7 @@ // Necessary because otherwise the daemon isn't working 'pidfile' => '/var/run/friendica.pid', - 'logfile' => '/var/www/html/friendica.log', + 'logfile' => '/var/log/friendica.log', 'loglevel' => 'notice', ], 'storage' => [ diff --git a/2026.01/fpm-alpine/entrypoint.sh b/2026.01/fpm-alpine/entrypoint.sh index b5f93c9a..b080cef0 100755 --- a/2026.01/fpm-alpine/entrypoint.sh +++ b/2026.01/fpm-alpine/entrypoint.sh @@ -39,16 +39,8 @@ file_env() { unset "$fileVar" } -# initialize the email configuration sh /setup_msmtp.sh -# ensure we have a logfile writeable by www-data -FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} -if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then - touch "$FRIENDICA_LOGFILE" - chown www-data:www-data "$FRIENDICA_LOGFILE" -fi - # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.01/fpm/Dockerfile b/2026.01/fpm/Dockerfile index 28ae5be3..ef1e58dc 100644 --- a/2026.01/fpm/Dockerfile +++ b/2026.01/fpm/Dockerfile @@ -6,7 +6,6 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ - sudo \ rsync \ bzip2 \ # For mail() support @@ -162,6 +161,9 @@ RUN set -ex; \ mkdir -p -m 775 /var/www/data; \ chown -R www-data:www-data /var/www/data +RUN set -ex; \ + ln -sf /dev/stdout /var/log/friendica.log + VOLUME /var/www/html VOLUME /var/www/data diff --git a/2026.01/fpm/config/zz-docker.config.php b/2026.01/fpm/config/zz-docker.config.php index 7a0d7985..08b29dc8 100644 --- a/2026.01/fpm/config/zz-docker.config.php +++ b/2026.01/fpm/config/zz-docker.config.php @@ -12,7 +12,7 @@ // Necessary because otherwise the daemon isn't working 'pidfile' => '/var/run/friendica.pid', - 'logfile' => '/var/www/html/friendica.log', + 'logfile' => '/var/log/friendica.log', 'loglevel' => 'notice', ], 'storage' => [ diff --git a/2026.01/fpm/entrypoint.sh b/2026.01/fpm/entrypoint.sh index b5f93c9a..b080cef0 100755 --- a/2026.01/fpm/entrypoint.sh +++ b/2026.01/fpm/entrypoint.sh @@ -39,16 +39,8 @@ file_env() { unset "$fileVar" } -# initialize the email configuration sh /setup_msmtp.sh -# ensure we have a logfile writeable by www-data -FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} -if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then - touch "$FRIENDICA_LOGFILE" - chown www-data:www-data "$FRIENDICA_LOGFILE" -fi - # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.04-dev/apache/Dockerfile b/2026.04-dev/apache/Dockerfile index 038faef7..ef880551 100644 --- a/2026.04-dev/apache/Dockerfile +++ b/2026.04-dev/apache/Dockerfile @@ -6,7 +6,6 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ - sudo \ rsync \ bzip2 \ # For mail() support @@ -170,6 +169,9 @@ RUN set -ex; \ mkdir -p -m 775 /var/www/data; \ chown -R www-data:www-data /var/www/data +RUN set -ex; \ + ln -sf /dev/stdout /var/log/friendica.log + VOLUME /var/www/html VOLUME /var/www/data diff --git a/2026.04-dev/apache/config/zz-docker.config.php b/2026.04-dev/apache/config/zz-docker.config.php index 7a0d7985..08b29dc8 100644 --- a/2026.04-dev/apache/config/zz-docker.config.php +++ b/2026.04-dev/apache/config/zz-docker.config.php @@ -12,7 +12,7 @@ // Necessary because otherwise the daemon isn't working 'pidfile' => '/var/run/friendica.pid', - 'logfile' => '/var/www/html/friendica.log', + 'logfile' => '/var/log/friendica.log', 'loglevel' => 'notice', ], 'storage' => [ diff --git a/2026.04-dev/apache/entrypoint.sh b/2026.04-dev/apache/entrypoint.sh index b5f93c9a..b080cef0 100755 --- a/2026.04-dev/apache/entrypoint.sh +++ b/2026.04-dev/apache/entrypoint.sh @@ -39,16 +39,8 @@ file_env() { unset "$fileVar" } -# initialize the email configuration sh /setup_msmtp.sh -# ensure we have a logfile writeable by www-data -FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} -if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then - touch "$FRIENDICA_LOGFILE" - chown www-data:www-data "$FRIENDICA_LOGFILE" -fi - # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.04-dev/fpm-alpine/Dockerfile b/2026.04-dev/fpm-alpine/Dockerfile index fa60e58f..0c084e07 100644 --- a/2026.04-dev/fpm-alpine/Dockerfile +++ b/2026.04-dev/fpm-alpine/Dockerfile @@ -139,6 +139,9 @@ RUN set -ex; \ mkdir -p -m 775 /var/www/data; \ chown -R www-data:www-data /var/www/data +RUN set -ex; \ + ln -sf /dev/stdout /var/log/friendica.log + VOLUME /var/www/html VOLUME /var/www/data diff --git a/2026.04-dev/fpm-alpine/config/zz-docker.config.php b/2026.04-dev/fpm-alpine/config/zz-docker.config.php index 7a0d7985..08b29dc8 100644 --- a/2026.04-dev/fpm-alpine/config/zz-docker.config.php +++ b/2026.04-dev/fpm-alpine/config/zz-docker.config.php @@ -12,7 +12,7 @@ // Necessary because otherwise the daemon isn't working 'pidfile' => '/var/run/friendica.pid', - 'logfile' => '/var/www/html/friendica.log', + 'logfile' => '/var/log/friendica.log', 'loglevel' => 'notice', ], 'storage' => [ diff --git a/2026.04-dev/fpm-alpine/entrypoint.sh b/2026.04-dev/fpm-alpine/entrypoint.sh index b5f93c9a..b080cef0 100755 --- a/2026.04-dev/fpm-alpine/entrypoint.sh +++ b/2026.04-dev/fpm-alpine/entrypoint.sh @@ -39,16 +39,8 @@ file_env() { unset "$fileVar" } -# initialize the email configuration sh /setup_msmtp.sh -# ensure we have a logfile writeable by www-data -FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} -if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then - touch "$FRIENDICA_LOGFILE" - chown www-data:www-data "$FRIENDICA_LOGFILE" -fi - # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/2026.04-dev/fpm/Dockerfile b/2026.04-dev/fpm/Dockerfile index 9ae1e117..b495973e 100644 --- a/2026.04-dev/fpm/Dockerfile +++ b/2026.04-dev/fpm/Dockerfile @@ -6,7 +6,6 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ - sudo \ rsync \ bzip2 \ # For mail() support @@ -162,6 +161,9 @@ RUN set -ex; \ mkdir -p -m 775 /var/www/data; \ chown -R www-data:www-data /var/www/data +RUN set -ex; \ + ln -sf /dev/stdout /var/log/friendica.log + VOLUME /var/www/html VOLUME /var/www/data diff --git a/2026.04-dev/fpm/config/zz-docker.config.php b/2026.04-dev/fpm/config/zz-docker.config.php index 7a0d7985..08b29dc8 100644 --- a/2026.04-dev/fpm/config/zz-docker.config.php +++ b/2026.04-dev/fpm/config/zz-docker.config.php @@ -12,7 +12,7 @@ // Necessary because otherwise the daemon isn't working 'pidfile' => '/var/run/friendica.pid', - 'logfile' => '/var/www/html/friendica.log', + 'logfile' => '/var/log/friendica.log', 'loglevel' => 'notice', ], 'storage' => [ diff --git a/2026.04-dev/fpm/entrypoint.sh b/2026.04-dev/fpm/entrypoint.sh index b5f93c9a..b080cef0 100755 --- a/2026.04-dev/fpm/entrypoint.sh +++ b/2026.04-dev/fpm/entrypoint.sh @@ -39,16 +39,8 @@ file_env() { unset "$fileVar" } -# initialize the email configuration sh /setup_msmtp.sh -# ensure we have a logfile writeable by www-data -FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} -if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then - touch "$FRIENDICA_LOGFILE" - chown www-data:www-data "$FRIENDICA_LOGFILE" -fi - # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 10723cf4..75020633 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -137,6 +137,9 @@ RUN set -ex; \ mkdir -p -m 775 /var/www/data; \ chown -R www-data:www-data /var/www/data +RUN set -ex; \ + ln -sf /dev/stdout /var/log/friendica.log + VOLUME /var/www/html VOLUME /var/www/data diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index a04a1659..f36610d4 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -5,7 +5,6 @@ RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ - sudo \ rsync \ bzip2 \ # For mail() support @@ -160,6 +159,9 @@ RUN set -ex; \ mkdir -p -m 775 /var/www/data; \ chown -R www-data:www-data /var/www/data +RUN set -ex; \ + ln -sf /dev/stdout /var/log/friendica.log + VOLUME /var/www/html VOLUME /var/www/data diff --git a/README.md b/README.md index 98f89223..a6477069 100644 --- a/README.md +++ b/README.md @@ -75,11 +75,6 @@ There are two options to enable background tasks for Friendica: **Friendica Logging** - `FRIENDICA_DEBUGGING` If set to `true`, the logging of Friendica is enabled. -- `FRIENDICA_LOGFILE` (optional) The path to the logfile (Default: /var/www/friendica.log). -- `FRIENDICA_LOGLEVEL` (optional) The loglevel to log (Default: notice). -- `FRIENDICA_LOGGER` (optional) Set the type - stream, syslog, monolog (Default: stream). -- `FRIENDICA_SYSLOG_FLAGS` (optional) In case syslog is used, set the corresponding flags (Default: `LOG_PID | LOG_ODELAY | LOG_CONS | LOG_PERROR`). -- `FRIENDICA_SYSLOG_FACTORY` (optional) In case syslog is used, set the corresponding factory (Default: `LOG_USER`). **Database** (**required at installation**) @@ -107,6 +102,12 @@ Note that you may have to change other limits depending on your client, webserve Because Friendica links the administrator account to a specific mail address, you **have** to set a valid address for `MAILNAME`. +## Logging settings + +Friendica logs to /var/log/friendica.log by default. This location inside the container should not be changed (and the corresponding setting +in Friendica is disabled). The output of /var/log/friendica.log is available in the Docker log of the container (see Docker logging for +details). If you prefer you can still mount a file to /var/log/friendica.log into the container. + ## Mail settings The binary `msmtp` is used for the mail support of Friendica. diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b5f93c9a..b080cef0 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -39,16 +39,8 @@ file_env() { unset "$fileVar" } -# initialize the email configuration sh /setup_msmtp.sh -# ensure we have a logfile writeable by www-data -FRIENDICA_LOGFILE=${FRIENDICA_LOGFILE:-/var/www/html/friendica.log} -if sudo -u www-data test -w "$(dirname "$FRIENDICA_LOGFILE")"; then - touch "$FRIENDICA_LOGFILE" - chown www-data:www-data "$FRIENDICA_LOGFILE" -fi - # just check if we execute apache or php-fpm if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${REDIS_HOST+x}" ]; then