diff --git a/.woodpecker.yml b/.woodpecker.yml index 67ce884..584712c 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -15,8 +15,8 @@ pipeline: when: branch: antifascista event: push - matrix: ALPINE_VERSION: - - 3.13.6 - - 3.14.2 + - 3.13.7 + - 3.14.3 + - 3.15.0 diff --git a/Dockerfile b/Dockerfile index fbd60ee..21a425f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG BASE_IMAGE=sutty/monit FROM ${BASE_IMAGE}:${ALPINE_VERSION} MAINTAINER "f " -COPY ./syncthing_start.sh /usr/local/bin/syncthing_start +COPY ./syncthingd.sh /usr/local/bin/syncthingd # Syncthing runs with Sutty's uid and gid so ownership is kept, because # they are not synced. diff --git a/monit.conf b/monit.conf index 9f58108..f8bccc2 100644 --- a/monit.conf +++ b/monit.conf @@ -1,3 +1,6 @@ check process syncthing with pidfile /tmp/syncthing.pid - start program = "/usr/local/bin/syncthing_start" - stop program = "/bin/sh -c 'cat /tmp/syncthing.pid | xargs kill'" + start program = "/usr/local/bin/syncthingd start" + stop program = "/usr/local/bin/syncthingd stop" + +check filesystem root with path / + if space usage < 2% then alert diff --git a/syncthing_start.sh b/syncthing_start.sh deleted file mode 100755 index 90a869f..0000000 --- a/syncthing_start.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -pid=/tmp/syncthing.pid -dir=/home/syncthing -log=${dir}/syncthing.log - -rm -f ${pid} - -install -dm 2750 -o syncthing -g syncthing ${dir}/Sync/.stfolder - -daemonize -p ${pid} -l ${pid} -u syncthing -c ${dir} \ - -o ${log} -a -e ${log} \ - /usr/bin/syncthing -no-browser -gui-address='http://0.0.0.0:8443' diff --git a/syncthingd.sh b/syncthingd.sh new file mode 100755 index 0000000..3fe25a9 --- /dev/null +++ b/syncthingd.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +pid=/tmp/syncthing.pid +dir=/home/syncthing + +case $1 in + start) + rm -f ${pid} + + install -dm 2750 -o syncthing -g syncthing ${dir}/Sync/.stfolder + + daemonize -p ${pid} -l ${pid} -u syncthing -c ${dir} \ + /usr/bin/syncthing serve \ + --skip-port-probing \ + --no-browser \ + --no-restart \ + --no-upgrade \ + --unpaused + ;; + stop) cat ${pid} | xargs -r kill ;; +esac