From 577fdbcd68d9684d919567ba7eb4d0c581457bb7 Mon Sep 17 00:00:00 2001 From: Ravinou Date: Fri, 9 Jan 2026 14:14:57 +0100 Subject: [PATCH] =?UTF-8?q?docker:=20=F0=9F=90=B3=20improve=20logs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.sample | 2 -- Dockerfile | 3 +-- docker-compose.yml | 2 -- docker/rsyslog.conf | 40 ---------------------------------------- docker/supervisord.conf | 27 ++++++++++++--------------- 5 files changed, 13 insertions(+), 61 deletions(-) delete mode 100644 docker/rsyslog.conf diff --git a/.env.sample b/.env.sample index 68d3bf0..a2e1c7c 100644 --- a/.env.sample +++ b/.env.sample @@ -23,8 +23,6 @@ CONFIG_PATH=./config SSH_PATH=./ssh SSH_HOST=./ssh_host BORG_REPOSITORY_PATH=./repos -TMP_PATH=./tmp -LOGS_PATH=./logs ## Optional variables section ## diff --git a/Dockerfile b/Dockerfile index 74bfe84..3621e8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ ENV HOSTNAME= RUN echo 'deb http://deb.debian.org/debian bookworm-backports main' >> /etc/apt/sources.list RUN apt-get update && apt-get install -y \ - supervisor curl jq jc borgbackup/bookworm-backports openssh-server rsyslog && \ + supervisor curl jq jc borgbackup/bookworm-backports openssh-server && \ apt-get clean && rm -rf /var/lib/apt/lists/* RUN groupadd -g ${GID} borgwarehouse && useradd -m -u ${UID} -g ${GID} borgwarehouse @@ -56,7 +56,6 @@ COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/.next/standalone ./ COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/public ./public COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/.next/static ./.next/static COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/docker/supervisord.conf ./ -COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/docker/rsyslog.conf /etc/rsyslog.conf COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/docker/sshd_config ./ USER borgwarehouse diff --git a/docker-compose.yml b/docker-compose.yml index d89ec77..f5c051b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,8 +20,6 @@ services: - ${SSH_PATH:?SSH_PATH variable missing}:/home/borgwarehouse/.ssh - ${SSH_HOST:?SSH_HOST variable missing}:/etc/ssh - ${BORG_REPOSITORY_PATH:?BORG_REPOSITORY_PATH variable missing}:/home/borgwarehouse/repos - - ${TMP_PATH:?TMP_PATH variable missing}:/home/borgwarehouse/tmp - - ${LOGS_PATH:?LOGS_PATH variable missing}:/home/borgwarehouse/logs # Apprise is used to send notifications, it's optional. http://apprise:8000 is the URL to use in BorgWarehouse. apprise: container_name: apprise diff --git a/docker/rsyslog.conf b/docker/rsyslog.conf deleted file mode 100644 index 7ece884..0000000 --- a/docker/rsyslog.conf +++ /dev/null @@ -1,40 +0,0 @@ -# rsyslog configuration file - -$WorkDirectory /home/borgwarehouse/tmp -$FileOwner borgwarehouse -$FileGroup borgwarehouse -$FileCreateMode 0640 -$DirCreateMode 0755 -$Umask 0022 - -$RepeatedMsgReduction on - -module(load="imfile" PollingInterval="10") - -input(type="imfile" - File="/home/borgwarehouse/tmp/borgwarehouse.log" - Tag="BorgWarehouse" - Severity="info" - Facility="local7" - ruleset="bwLogs") - -input(type="imfile" - File="/home/borgwarehouse/tmp/sshd.log" - Tag="sshd" - Severity="info" - Facility="local7" - ruleset="sshdLogs") - -$template myFormat,"%timegenerated:::date-rfc3339% %syslogtag% %msg%\n" - -ruleset(name="bwLogs") { - action(type="omfile" - File="/home/borgwarehouse/logs/borgwarehouse.log" - Template="myFormat") -} - -ruleset(name="sshdLogs") { - action(type="omfile" - File="/home/borgwarehouse/logs/sshd.log" - Template="myFormat") -} diff --git a/docker/supervisord.conf b/docker/supervisord.conf index 0930b95..ba283f0 100644 --- a/docker/supervisord.conf +++ b/docker/supervisord.conf @@ -1,24 +1,21 @@ [supervisord] nodaemon=true -logfile=/home/borgwarehouse/logs/supervisord.log +logfile=/dev/stdout +logfile_maxbytes=0 loglevel=error -pidfile=/home/borgwarehouse/tmp/supervisord.pid -logfile_maxbytes=10MB -logfile_backups=5 [program:sshd] command=/usr/sbin/sshd -D -e -f /etc/ssh/sshd_config -stdout_logfile=/home/borgwarehouse/tmp/sshd.log -stdout_logfile_maxbytes=10MB -stdout_logfile_backups=5 -redirect_stderr=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +redirect_stderr=false [program:borgwarehouse] command=/usr/local/bin/node server.js -stdout_logfile=/home/borgwarehouse/tmp/borgwarehouse.log -stdout_logfile_maxbytes=10MB -stdout_logfile_backups=5 -redirect_stderr=true - -[program:rsyslogd] -command=rsyslogd -n -i /home/borgwarehouse/tmp/rsyslogd.pid -f /etc/rsyslog.conf \ No newline at end of file +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +redirect_stderr=false \ No newline at end of file