Compare commits
43 Commits
1.1.0
...
5863d5b808
| Author | SHA1 | Date | |
|---|---|---|---|
| 5863d5b808 | |||
| c42462b4e1 | |||
| 3db15537e8 | |||
| 9465157295 | |||
| 8d36f0c117 | |||
| b574ae146e | |||
| 0eeb08f4d8 | |||
| 639120e46d | |||
| 75488a4009 | |||
| b962b65145 | |||
| 0614aa0565 | |||
| 83f8c39e48 | |||
| 961f218621 | |||
| 6134b05328 | |||
| ada326f2d8 | |||
| 5d14d166eb | |||
| 3a6466612b | |||
| 36b71a0ebb | |||
| e0da513893 | |||
| df56fcf997 | |||
| 3c3cc47d32 | |||
| 053cef4c31 | |||
| b6d93c1164 | |||
| a41c409f9d | |||
| e859aa7218 | |||
| a4b59c360e | |||
| e7bd87d5bd | |||
| 6ef0abfd6b | |||
| 868eb4eb59 | |||
| 578284bb10 | |||
| e10bdd741d | |||
| 0aa35c3ef6 | |||
| 90f5095eef | |||
| 3daee369ca | |||
| 6a27c9232c | |||
| e130fc041e | |||
| 591e35c91a | |||
| 375cf5da74 | |||
| 09eb18adda | |||
| d09988c241 | |||
| 6d696dd4b2 | |||
| c23657ce01 | |||
| 634f0cac4a |
@ -1,14 +1,21 @@
|
|||||||
|
|
||||||
dist: dist-gitea
|
dist: dist-gitea
|
||||||
|
|
||||||
build:
|
builds:
|
||||||
skip: true
|
- skip: true
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- format: binary
|
- format: binary
|
||||||
|
|
||||||
release:
|
release:
|
||||||
draft: true
|
draft: true
|
||||||
|
|
||||||
|
header: |
|
||||||
|
# Certbot Cron v{{ .Tag }}
|
||||||
|
|
||||||
|
## Docker Image:
|
||||||
|
`git.mrmeeb.stream/mrmeeb/certbot-cron:{{ .Tag }}`
|
||||||
|
|
||||||
gitea:
|
gitea:
|
||||||
owner: MrMeeb
|
owner: MrMeeb
|
||||||
name: certbot-cron-docker
|
name: certbot-cron-docker
|
||||||
|
|||||||
12
Dockerfile
12
Dockerfile
@ -1,4 +1,4 @@
|
|||||||
FROM alpine:latest as base
|
FROM alpine:3.19.1 as base
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
|
||||||
FROM base AS base-amd64
|
FROM base AS base-amd64
|
||||||
@ -9,7 +9,7 @@ ENV S6_OVERLAY_ARCH=aarch64
|
|||||||
|
|
||||||
FROM base-${TARGETARCH}${TARGETVARIANT}
|
FROM base-${TARGETARCH}${TARGETVARIANT}
|
||||||
|
|
||||||
ARG S6_OVERLAY_VERSION=3.1.5.0
|
ARG S6_OVERLAY_VERSION="3.1.6.2"
|
||||||
|
|
||||||
# Core variables
|
# Core variables
|
||||||
ENV PUID=1000
|
ENV PUID=1000
|
||||||
@ -17,6 +17,7 @@ ENV PGID=1000
|
|||||||
ENV TZ=UTC
|
ENV TZ=UTC
|
||||||
ENV GENERATE_DHPARAM=true
|
ENV GENERATE_DHPARAM=true
|
||||||
ENV INTERVAL="0 */6 * * *"
|
ENV INTERVAL="0 */6 * * *"
|
||||||
|
ENV ONE_SHOT=false
|
||||||
|
|
||||||
# Single domain
|
# Single domain
|
||||||
ENV DOMAINS=
|
ENV DOMAINS=
|
||||||
@ -55,8 +56,12 @@ ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 S6_VERBOSI
|
|||||||
RUN python3 -m venv /app/certbot/ && /app/certbot/bin/pip install --upgrade pip
|
RUN python3 -m venv /app/certbot/ && /app/certbot/bin/pip install --upgrade pip
|
||||||
|
|
||||||
#Get required packages for building, build, then cleanup
|
#Get required packages for building, build, then cleanup
|
||||||
|
#Added additional pip steps to fix cython 3.0.0 issue - https://github.com/yaml/pyyaml/issues/601
|
||||||
|
COPY requirements.txt /app/certbot/requirements.txt
|
||||||
RUN apk add --no-cache --virtual .deps gcc python3-dev libc-dev libffi-dev && \
|
RUN apk add --no-cache --virtual .deps gcc python3-dev libc-dev libffi-dev && \
|
||||||
/app/certbot/bin/pip install certbot certbot-dns-cloudflare && \
|
/app/certbot/bin/pip install wheel && \
|
||||||
|
/app/certbot/bin/pip install "Cython<3.0" pyyaml --no-build-isolation && \
|
||||||
|
/app/certbot/bin/pip install -r /app/certbot/requirements.txt && \
|
||||||
ln -s /app/certbot/bin/certbot /usr/bin/certbot &&\
|
ln -s /app/certbot/bin/certbot /usr/bin/certbot &&\
|
||||||
apk del .deps
|
apk del .deps
|
||||||
|
|
||||||
@ -65,6 +70,7 @@ COPY root /
|
|||||||
RUN chmod +x /container-init.sh && \
|
RUN chmod +x /container-init.sh && \
|
||||||
chmod +x /certbot-prepare.sh && \
|
chmod +x /certbot-prepare.sh && \
|
||||||
chmod +x /certbot-renew.sh && \
|
chmod +x /certbot-renew.sh && \
|
||||||
|
chmod +x /check-one-shot.sh && \
|
||||||
chown -R ${PUID}:${PGID} /app /config
|
chown -R ${PUID}:${PGID} /app /config
|
||||||
|
|
||||||
ENTRYPOINT [ "/init" ]
|
ENTRYPOINT [ "/init" ]
|
||||||
|
|||||||
@ -52,9 +52,10 @@ Core options to the container
|
|||||||
|PUID |int |1000 |Sets the UID of the user certbot runs under |
|
|PUID |int |1000 |Sets the UID of the user certbot runs under |
|
||||||
|PGID |int |1000 |Sets the GID of the user certbot runs under |
|
|PGID |int |1000 |Sets the GID of the user certbot runs under |
|
||||||
|TZ |[List of valid TZs](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) |UTC |Sets the timezone of the container |
|
|TZ |[List of valid TZs](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) |UTC |Sets the timezone of the container |
|
||||||
|
| ONE_SHOT | false | Whether container exits after first run of certbot, or starts cron-based auto-renewal |
|
||||||
| GENERATE_DHPARAM | true (case-sensitive) | Generate Diffie-Hellman keys in /config/letsencrypt/keys |
|
| GENERATE_DHPARAM | true (case-sensitive) | Generate Diffie-Hellman keys in /config/letsencrypt/keys |
|
||||||
| INTERVAL | 0 */6 * * * | How often certbot attempts to renew the certificate. Cron syntax |
|
| INTERVAL | 0 */6 * * * | How often certbot attempts to renew the certificate. Cron syntax |
|
||||||
| CERT_COUNT | 1 | How many certificates certbot will try to issue (more than 1 not yet implemented) |
|
| CERT_COUNT | 1 | How many certificates certbot will try to issue. [Details here](https://git.mrmeeb.stream/MrMeeb/certbot-cron-docker#multiple-certificates) |
|
||||||
|
|
||||||
### Certificate Options
|
### Certificate Options
|
||||||
|
|
||||||
|
|||||||
28
renovate.json
Normal file
28
renovate.json
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"extends": [":automergeMinor", ":automergePr", ":automergeRequireAllStatusChecks", ":dependencyDashboard", ":disableRateLimiting", ":rebaseStalePrs"],
|
||||||
|
"baseBranches": ["main"],
|
||||||
|
"major": {
|
||||||
|
"dependencyDashboardApproval": true
|
||||||
|
},
|
||||||
|
"customManagers": [
|
||||||
|
{
|
||||||
|
"customType": "regex",
|
||||||
|
"fileMatch": ["Dockerfile"],
|
||||||
|
"matchStrings": ["ARG S6_OVERLAY_VERSION=[\"](?<currentValue>.*)[\"]"],
|
||||||
|
"datasourceTemplate": "github-releases",
|
||||||
|
"depNameTemplate": "just-containers/s6-overlay"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"matchDatasources": ["github-releases"],
|
||||||
|
"matchDepNames": ["just-containers/s6-overlay"],
|
||||||
|
"extractVersion": "^v(?<version>.*)$",
|
||||||
|
"versioning": "loose"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matchPackagePatterns": ["certbot"],
|
||||||
|
"groupName": "certbot"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
4
requirements.txt
Normal file
4
requirements.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# For pinning Certbot packages to then be parsed by Renovate
|
||||||
|
|
||||||
|
certbot ==2.9.0
|
||||||
|
certbot-dns-cloudflare ==2.9.0
|
||||||
@ -756,13 +756,24 @@ fi
|
|||||||
|
|
||||||
if [ $GENERATE_DHPARAM = true ] && [ ! -s /config/letsencrypt/keys/ssl-dhparams.pem ]
|
if [ $GENERATE_DHPARAM = true ] && [ ! -s /config/letsencrypt/keys/ssl-dhparams.pem ]
|
||||||
then
|
then
|
||||||
|
echo ""
|
||||||
echo "Generating Diffie-Hellman keys, saved to /config/letsencrypt/keys. This can take a long time!"
|
echo "Generating Diffie-Hellman keys, saved to /config/letsencrypt/keys. This can take a long time!"
|
||||||
openssl dhparam -out /config/letsencrypt/keys/ssl-dhparams.pem 4096
|
openssl dhparam -out /config/letsencrypt/keys/ssl-dhparams.pem 4096
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $ONE_SHOT == "true" ]; then
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
echo "ONE_SHOT is true - exiting container"
|
||||||
|
|
||||||
|
elif [ $ONE_SHOT == "false" ]; then
|
||||||
|
|
||||||
echo "$INTERVAL /certbot-renew.sh >> /config/logs/renew.log" > /config/.crontab.txt
|
echo "$INTERVAL /certbot-renew.sh >> /config/logs/renew.log" > /config/.crontab.txt
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "Starting automatic renewal job. Schedule is $INTERVAL"
|
echo "Starting automatic renewal job. Schedule is $INTERVAL"
|
||||||
crontab /config/.crontab.txt
|
crontab /config/.crontab.txt
|
||||||
|
|
||||||
|
fi
|
||||||
9
root/check-one-shot.sh
Normal file
9
root/check-one-shot.sh
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
# shellcheck shell=bash
|
||||||
|
|
||||||
|
if [ $ONE_SHOT == "true" ]; then
|
||||||
|
|
||||||
|
# Cleanly kill container by sending kill signal to supervisor process
|
||||||
|
kill 1
|
||||||
|
|
||||||
|
fi
|
||||||
@ -28,6 +28,7 @@ echo \
|
|||||||
"PUID=${PUID}
|
"PUID=${PUID}
|
||||||
PGID=${PGID}
|
PGID=${PGID}
|
||||||
TZ=${TZ}
|
TZ=${TZ}
|
||||||
|
ONE_SHOT=${ONE_SHOT}
|
||||||
INTERVAL=${INTERVAL}
|
INTERVAL=${INTERVAL}
|
||||||
GENERATE_DHPARAM=${GENERATE_DHPARAM}
|
GENERATE_DHPARAM=${GENERATE_DHPARAM}
|
||||||
CERT_COUNT=${CERT_COUNT}"
|
CERT_COUNT=${CERT_COUNT}"
|
||||||
|
|||||||
1
root/etc/s6-overlay/s6-rc.d/check-one-shot/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/check-one-shot/type
Normal file
@ -0,0 +1 @@
|
|||||||
|
oneshot
|
||||||
1
root/etc/s6-overlay/s6-rc.d/check-one-shot/up
Normal file
1
root/etc/s6-overlay/s6-rc.d/check-one-shot/up
Normal file
@ -0,0 +1 @@
|
|||||||
|
exec /check-one-shot.sh
|
||||||
Reference in New Issue
Block a user