Compare commits
8 commits
5fbfb39075
...
ea05dd03e9
Author | SHA1 | Date | |
---|---|---|---|
|
ea05dd03e9 | ||
|
f545ef606f | ||
|
4b783cb9f1 | ||
|
24c31e7eb8 | ||
|
da19bd76f8 | ||
|
1068b67884 | ||
|
923d9f1d78 | ||
|
434501ef54 |
3 changed files with 18 additions and 22 deletions
|
@ -1,21 +1,21 @@
|
||||||
pipeline:
|
pipeline:
|
||||||
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"
|
repo: "gitea.nulo.in/sutty/certbot"
|
||||||
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:
|
ALPINE_VERSION:
|
||||||
- "3.17.1"
|
- "3.17.3"
|
||||||
|
|
|
@ -5,7 +5,7 @@ MAINTAINER "f <f@sutty.nl>"
|
||||||
|
|
||||||
RUN addgroup -S -g 777 ssl
|
RUN addgroup -S -g 777 ssl
|
||||||
RUN install -dm 2700 -o root -g root /root/.ssh
|
RUN install -dm 2700 -o root -g root /root/.ssh
|
||||||
RUN apk add --no-cache certbot jq wget openssh-client rsync
|
RUN apk add --no-cache certbot jq wget openssh-client rsync certbot-dns-njalla
|
||||||
|
|
||||||
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
|
||||||
|
|
26
certbotd.sh
26
certbotd.sh
|
@ -42,26 +42,22 @@ 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
|
/usr/bin/certbot renew --quiet --agree-tos || true
|
||||||
touch "${updated}"
|
touch "${updated}"
|
||||||
;;
|
;;
|
||||||
bootstrap)
|
bootstrap)
|
||||||
for site in ${SUTTY} api.${SUTTY}; do
|
test -d "/etc/letsencrypt/live/${SUTTY}" && exit 0
|
||||||
test -d "/etc/letsencrypt/live/${site}" && exit 0
|
|
||||||
|
|
||||||
# Get the certificate for the domain, the webserver will need
|
# Get a single certificate for the whole domain
|
||||||
# access to this directory
|
/usr/bin/certbot \
|
||||||
/usr/bin/certbot certonly --email "certbot@${SUTTY}" \
|
-a dns-njalla \
|
||||||
--webroot \
|
--dns-njalla-credentials /etc/letsencrypt/njalla.ini \
|
||||||
--agree-tos \
|
--email "certbot@${SUTTY}" \
|
||||||
--webroot-path /var/lib/letsencrypt \
|
--agree-tos \
|
||||||
-d "${site}"
|
-d "${SUTTY}" \
|
||||||
|
-d "*.${SUTTY}"
|
||||||
|
|
||||||
cd /etc/letsencrypt/live
|
touch "${updated}"
|
||||||
ln -s ${SUTTY} default
|
|
||||||
|
|
||||||
touch "${updated}"
|
|
||||||
done
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
prune)
|
prune)
|
||||||
|
|
Loading…
Reference in a new issue