Loading deploy/.env +1 −0 Original line number Diff line number Diff line Loading @@ -4,3 +4,4 @@ CERTBOT_CONFIG_VOL_NAME=certbot-config-vol CERTBOT_WORK_VOL_NAME=certbot-work-vol CERTBOT_LOGS_VOL_NAME=certbot-logs-vol ACME_VOL_NAME=acme-vol PUSHGATEWAY_HOST=pushgateway:9091 deploy/docker-compose.tmpl.yml +3 −2 Original line number Diff line number Diff line Loading @@ -14,8 +14,9 @@ services: - CERTBOT_WORK_VOL_NAME - CERTBOT_LOGS_VOL_NAME - ACME_VOL_NAME - PUSHGATEWAY_HOST networks: - redmic-net - metric-net volumes: - config-vol:/certs - /var/run/docker.sock:/var/run/docker.sock Loading @@ -36,7 +37,7 @@ services: memory: 52M networks: redmic-net: metric-net: external: true volumes: Loading deploy/scripts/manage-certificates.sh +16 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ then fi md5After=$(md5sum "${fileToTestUpdate}") metricsJob="cert-update" dateInSeconds="$(date +%s)" if [ "${md5Before}" != "${md5After}" ] then Loading Loading @@ -66,7 +68,21 @@ then docker service update ${secretAddParams} ${SERVER_SERVICE} cat <<EOF | docker run -i --rm byrnedo/alpine-curl --data-binary @- \ ${PUSHGATEWAY_HOST}/metrics/job/${metricsJob} # HELP certificates_updated_date_seconds Certificates updated date in seconds. # TYPE certificates_updated_date_seconds gauge certificates_updated_date_seconds{label="${CERT_NAME}"} ${dateInSeconds} EOF echo "Certificates successfully updated!" else cat <<EOF | docker run -i --rm byrnedo/alpine-curl --data-binary @- \ ${PUSHGATEWAY_HOST}/metrics/job/${metricsJob} # HELP certificates_valid_date_seconds Certificates still valid verification date in seconds. # TYPE certificates_valid_date_seconds gauge certificates_valid_date_seconds{label="${CERT_NAME}"} ${dateInSeconds} EOF echo "Certificates are still valid!" fi Loading
deploy/.env +1 −0 Original line number Diff line number Diff line Loading @@ -4,3 +4,4 @@ CERTBOT_CONFIG_VOL_NAME=certbot-config-vol CERTBOT_WORK_VOL_NAME=certbot-work-vol CERTBOT_LOGS_VOL_NAME=certbot-logs-vol ACME_VOL_NAME=acme-vol PUSHGATEWAY_HOST=pushgateway:9091
deploy/docker-compose.tmpl.yml +3 −2 Original line number Diff line number Diff line Loading @@ -14,8 +14,9 @@ services: - CERTBOT_WORK_VOL_NAME - CERTBOT_LOGS_VOL_NAME - ACME_VOL_NAME - PUSHGATEWAY_HOST networks: - redmic-net - metric-net volumes: - config-vol:/certs - /var/run/docker.sock:/var/run/docker.sock Loading @@ -36,7 +37,7 @@ services: memory: 52M networks: redmic-net: metric-net: external: true volumes: Loading
deploy/scripts/manage-certificates.sh +16 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ then fi md5After=$(md5sum "${fileToTestUpdate}") metricsJob="cert-update" dateInSeconds="$(date +%s)" if [ "${md5Before}" != "${md5After}" ] then Loading Loading @@ -66,7 +68,21 @@ then docker service update ${secretAddParams} ${SERVER_SERVICE} cat <<EOF | docker run -i --rm byrnedo/alpine-curl --data-binary @- \ ${PUSHGATEWAY_HOST}/metrics/job/${metricsJob} # HELP certificates_updated_date_seconds Certificates updated date in seconds. # TYPE certificates_updated_date_seconds gauge certificates_updated_date_seconds{label="${CERT_NAME}"} ${dateInSeconds} EOF echo "Certificates successfully updated!" else cat <<EOF | docker run -i --rm byrnedo/alpine-curl --data-binary @- \ ${PUSHGATEWAY_HOST}/metrics/job/${metricsJob} # HELP certificates_valid_date_seconds Certificates still valid verification date in seconds. # TYPE certificates_valid_date_seconds gauge certificates_valid_date_seconds{label="${CERT_NAME}"} ${dateInSeconds} EOF echo "Certificates are still valid!" fi