From f00a5adbed31809765afa2adf1de0033c083f78f Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Fri, 23 Sep 2022 10:18:27 +0200 Subject: [PATCH] renew certs with token handled by gopass --- acme_renew/Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/acme_renew/Makefile b/acme_renew/Makefile index cdbfb6b..b8e76c6 100644 --- a/acme_renew/Makefile +++ b/acme_renew/Makefile @@ -22,14 +22,20 @@ KEY=$(CERT_PATH)/$(DOMAIN).key $(CERT): renew_certs $(KEY): renew_certs -ACMESH_COMPOSE_FILE=/srv/services/acmesh/docker-compose.yml +GOPASS=doas -u gopass gopass +LINODE_TOKEN = $(shell $(GOPASS) linode.com/token) + +DOCKER_IMAGE=neilpang/acme.sh +ACME_DATA_DIR=/mnt/docker_volumes/acmesh/data RENEW_CMD="/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" --config-home "/acme.sh" renew_certs: - docker-compose \ - --file $(ACMESH_COMPOSE_FILE) \ - run --rm acmesh \ + docker run --rm -it \ + -v $(ACME_DATA_DIR):/acme.sh \ + -v $(CERT_PATH):/acme.sh/$(DOMAIN) \ + -e "LINODE_V4_API_KEY=$(LINODE_TOKEN)" \ + $(DOCKER_IMAGE) \ $(RENEW_CMD) ###############################################################################