Compare commits

..

50 commits

Author SHA1 Message Date
f
325ebd3941
feat: alpine upgrade
All checks were successful
ci/woodpecker/push/woodpecker/1 Pipeline was successful
ci/woodpecker/push/woodpecker/2 Pipeline was successful
2024-09-04 12:09:58 -03:00
f
2c098a03a4
Merge branch 'antifascista' of ssh://gitea.nulo.in:420/Sutty/containers-certbot into antifascista 2024-09-04 12:09:46 -03:00
f
ac86ff8b4b
Merge branch 'antifascista' of ssh://gitea.nulo.in:420/Sutty/containers-skel into antifascista 2024-06-21 13:10:22 -03:00
f
41354bbc95
fix: deprecate MAINTAINER 2024-06-21 12:21:51 -03:00
f
c0e6b8150b
refactor: use matrix so it's easier to merge downstream containers 2024-06-19 10:15:44 -03:00
f
f7da597784
feat: upgrade 2024-06-19 10:14:59 -03:00
f
ffed22b2df
fix: tap 2024-06-14 18:47:42 -03:00
f
919706b80e
fix: some renewal files where missing (??) 2024-06-14 18:41:59 -03:00
f
67ca76f7f1
fix: use set -E to trip the traps...
but it doesn't work on while loops, so we ensure there too
2024-06-14 18:23:45 -03:00
f
af1549c142
fix: set -e skips trap! 2024-06-14 18:05:11 -03:00
f
e3bd62e6bd
fix: exit with the error code 2024-06-14 18:00:13 -03:00
f
d39cd11605
fix: remove lock after synchronization 2024-06-14 18:00:00 -03:00
f
fb40860f31
fix: check for file 2024-06-14 17:18:43 -03:00
f
e428837559
fix: syntax error 2024-06-14 17:18:34 -03:00
f
f1b7533218
fix: ignore synchronization errors 2024-06-14 16:46:24 -03:00
f
cfa66e1387
feat: tap format 2024-06-14 16:46:14 -03:00
f
91f4d3b3c2
Merge branch 'antifascista' of ssh://gitea.nulo.in:420/Sutty/containers-skel into antifascista 2024-05-23 15:52:38 -03:00
f
b99a8111d8
feat: 3.20 released 2024-05-22 10:20:38 -03:00
f
aa086a76af
BREAKING CHANGE: deprecate 3.16 2024-05-22 10:20:27 -03:00
f
2a72840be0
fix: 3.15 eol 2024-02-13 13:22:59 -03:00
f
397dff920a
fix: upgrade alpine 2024-02-13 13:22:45 -03:00
f
c7e00ea604
BREAKING CHANGE: standalone dns server 2023-12-20 11:21:18 -03:00
f
92b8307217
Merge branch 'antifascista' of ssh://gitea.nulo.in:420/Sutty/containers-skel into antifascista 2023-12-12 15:23:59 -03:00
f
e66b364db7
ci: pipeline is deprecated 2023-12-12 13:36:48 -03:00
f
b921379aa0
feat: alpine 3.19 2023-12-07 10:22:26 -03:00
f
8dd7d4605a
fix: bad commit 2023-12-04 11:06:47 -03:00
f
d11e588f03
feat: alpine upgrades 2023-12-04 11:03:14 -03:00
f
9102e82187
Merge branch 'antifascista' of ssh://gitea.nulo.in:420/Sutty/containers-skel into antifascista 2023-10-02 15:05:16 -03:00
f
5085c7e8df
feat: alpine 3.18.4 2023-09-28 12:24:44 -03:00
f
1233c89aff fix: use proper namespaces 2023-08-24 11:50:53 -03:00
f
23862852a7 Merge branch 'antifascista' of ssh://gitea.nulo.in:420/Sutty/containers-skel into antifascista 2023-08-10 11:46:33 -03:00
f
3dde92d4de BREAKING CHANGE: deprecate alpine 3.14 2023-08-08 11:18:21 -03:00
f
3e098e8c24 fix: upgrade alpines 2023-08-08 11:18:00 -03:00
f
582b83d3fa fix: 3.18.2 2023-06-15 12:37:11 -03:00
f
5d35cad642 feat: upgrade alpine
https://alpinelinux.org/posts/Alpine-3.15.9-3.16.6-3.17.4-3.18.2-released.html
2023-06-14 13:10:38 -03:00
f
5a56ab0bf5 Merge branch 'antifascista' of ssh://gitea.nulo.in:420/Sutty/containers-skel into antifascista 2023-05-10 13:15:44 -03:00
f
fedf64f2b9 feat: alpine 3.18 2023-05-10 12:41:25 -03:00
f
29c0482f29 fix: look for ip everywhere 2023-04-24 13:35:07 -03:00
f
64b5f71b58 fix: log when domains are being ignored 2023-04-22 15:09:28 -03:00
f
9c1ac56386 BREAKING CHANGE: support several ip addresses 2023-04-22 15:07:11 -03:00
f
aa98a37b8b feat: add *.testing.sutty.nl to certificate 2023-04-22 15:01:59 -03:00
f
10f4e97722 BREAKING CHANGE: make nodes into full rsync urls 2023-04-22 14:53:33 -03:00
f
ea05dd03e9 Merge ../skel into antifascista 2023-04-20 15:21:13 -03:00
f
f545ef606f BREAKING CHANGE: get a wildcard for the main domain sutty/sutty#13159 2023-04-20 15:20:26 -03:00
f
4b783cb9f1 feat: support njalla sutty/sutty#13159 2023-04-20 15:15:22 -03:00
f
24c31e7eb8 fix: base registry 2023-04-04 18:03:51 -03:00
f
da19bd76f8 BREAKING CHANGE: use public gitea registry 2023-04-04 17:22:42 -03:00
f
1068b67884 feat: alpine upgrades 2023-03-29 16:32:41 -03:00
f
923d9f1d78 fix: don't fail if renewal fails
it leaves the lock in place
2023-03-15 18:46:01 -03:00
f
434501ef54 feat: alpine upgrade 2023-02-11 12:39:02 -03:00
3 changed files with 54 additions and 33 deletions

View file

@ -1,21 +1,22 @@
pipeline: steps:
publish: publish:
image: "plugins/docker" image: "docker.io/woodpeckerci/plugin-docker-buildx"
settings: settings:
registry: "registry.nulo.in" registry: "https://gitea.nulo.in"
username: "sutty" username: "sutty"
repo: "registry.nulo.in/sutty/certbot-simple" repo: "gitea.nulo.in/sutty/certbot-simple"
tags: tags:
- "${ALPINE_VERSION}" - "${ALPINE_VERSION}"
- "latest" - "latest"
build_args: build_args:
- "ALPINE_VERSION=${ALPINE_VERSION}" - "ALPINE_VERSION=${ALPINE_VERSION}"
- "BASE_IMAGE=registry.nulo.in/sutty/monit" - "BASE_IMAGE=gitea.nulo.in/sutty/monit"
secrets: secrets:
- "docker_password" - "DOCKER_PASSWORD"
when: when:
branch: "antifascista" branch: "antifascista"
event: "push" event: "push"
matrix: matrix:
ALPINE_VERSION: include:
- "3.17.1" - ALPINE_VERSION: "3.20.2"
- ALPINE_VERSION: "3.19.3"

View file

@ -1,10 +1,10 @@
ARG ALPINE_VERSION=3.13.6 ARG ALPINE_VERSION=3.18.3
ARG BASE_IMAGE=sutty/monit ARG BASE_IMAGE=gitea.nulo.in/sutty/monit
FROM ${BASE_IMAGE}:${ALPINE_VERSION} FROM ${BASE_IMAGE}:${ALPINE_VERSION}
MAINTAINER "f <f@sutty.nl>" LABEL org.opencontainers.image.authors="f@sutty.nl"
RUN addgroup -S -g 777 ssl RUN addgroup -S -g 777 ssl
RUN apk add --no-cache certbot RUN apk add --no-cache certbot certbot-dns-standalone
COPY ./monit.conf /etc/monit.d/certbot.conf COPY ./monit.conf /etc/monit.d/certbot.conf
COPY ./certbotd.sh /usr/local/bin/certbotd COPY ./certbotd.sh /usr/local/bin/certbotd

View file

@ -1,46 +1,66 @@
#!/bin/sh #!/bin/sh
ok() {
echo "ok - $@" >&2
}
not_ok() {
echo "not ok - $@" >&2
}
lock=/tmp/certbot.lck lock=/tmp/certbot.lck
updated=/tmp/certbot.updated updated=/tmp/certbot.updated
ensure() { ensure() {
test -n "$1" && echo "$1 received, exiting gracefully..." test -n "$1" && ok "$1 received, exiting gracefully..."
if test -f "${updated}" ; then
rm -f "${updated}"
# Fix permissions, users in group ssl have read access
find /etc/letsencrypt -type d | xargs -r chmod 2750
find /etc/letsencrypt -type f | xargs -r chmod 640
chgrp -R ssl /etc/letsencrypt
fi
# Remove the lock after synchronization
rm -f "${lock}" rm -f "${lock}"
test -f "${updated}" || exit 0 # Exit with the error code
exit $1
rm -f "${updated}"
# Fix permissions, users in group ssl have read access
find /etc/letsencrypt -type d | xargs -r chmod 2750
find /etc/letsencrypt -type f | xargs -r chmod 640
chgrp -R ssl /etc/letsencrypt
} }
for SIG in TERM QUIT INT HUP; do for SIG in 1 2 3 6 9 14 15; do
trap "ensure ${SIG}" ${SIG} trap "ensure ${SIG}" ${SIG}
done done
set -e set -E
case $1 in case $1 in
# Renew certificates, trust in certbot's algorithms # Renew certificates, trust in certbot's algorithms
renew) renew)
/usr/bin/certbot renew --quiet --agree-tos if /usr/bin/certbot renew --quiet --agree-tos ; then
touch "${updated}" ok "Renewed certificates"
touch "${updated}"
else
ret=$?
not_ok "Certificate renewal failed"
exit $ret
fi
;; ;;
bootstrap) bootstrap)
for site in ${SUTTY} ${DOMAINS}; do for site in ${SUTTY} ${DOMAINS}; do
test -d "/etc/letsencrypt/live/${site}" && exit 0 test -d "/etc/letsencrypt/live/${site}" && exit 0
# Get the certificate for the domain, the webserver will need /usr/bin/certbot \
# access to this directory certonly \
/usr/bin/certbot certonly --email "certbot@${SUTTY}" \ --non-interactive \
--webroot \ --authenticator "dns-standalone" \
--agree-tos \ --email "certbot@${SUTTY}" \
--webroot-path /var/lib/letsencrypt \ --agree-tos \
-d "${site}" -d "${SUTTY}" \
-d "*.${SUTTY}" \
&& touch "${updated}"
cd /etc/letsencrypt/live cd /etc/letsencrypt/live
ln -s ${SUTTY} default ln -s ${SUTTY} default
@ -55,4 +75,4 @@ case $1 in
;; ;;
esac esac
ensure ensure 0