From e994542de5c3bbda2a6d636fc4148e403693d2eb Mon Sep 17 00:00:00 2001 From: f Date: Wed, 2 Mar 2022 12:53:39 -0300 Subject: [PATCH] general upgrade --- .woodpecker.yml | 6 +++--- Dockerfile | 2 +- monit.conf | 7 +++++-- syncthing_start.sh | 13 ------------- syncthingd.sh | 21 +++++++++++++++++++++ 5 files changed, 30 insertions(+), 19 deletions(-) delete mode 100755 syncthing_start.sh create mode 100755 syncthingd.sh 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