From c33cb99c06a487cea67ef2bac90a0bba4a48e90c Mon Sep 17 00:00:00 2001 From: Jonny McCullagh Date: Wed, 22 Jun 2022 13:57:46 +0100 Subject: [PATCH] add cron to renew cert --- hosting/single/Dockerfile | 2 +- hosting/single/runner.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hosting/single/Dockerfile b/hosting/single/Dockerfile index fe20eff0b7..24e90fc818 100644 --- a/hosting/single/Dockerfile +++ b/hosting/single/Dockerfile @@ -1,7 +1,7 @@ FROM node:14-slim as build # install node-gyp dependencies -RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils g++ make python +RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils cron g++ make python # add pin script WORKDIR / diff --git a/hosting/single/runner.sh b/hosting/single/runner.sh index fe71d4c915..81768f1bf4 100644 --- a/hosting/single/runner.sh +++ b/hosting/single/runner.sh @@ -4,6 +4,10 @@ redis-server --requirepass $REDIS_PASSWORD & /docker-entrypoint.sh /opt/couchdb/bin/couchdb & /etc/init.d/nginx restart if [[ ! -z "${CUSTOM_DOMAIN}" ]]; then + # Add monthly cron job to renew certbot certificate + echo -n "* * 2 * * root exec /app/letsencrypt/certificate-renew.sh ${CUSTOM_DOMAIN}" >> /etc/cron.d/certificate-renew + chmod +x /etc/cron.d/certificate-renew + # Request the certbot certificate /app/letsencrypt/certificate-request.sh ${CUSTOM_DOMAIN} fi