From 6d62a68387d4c51a48421cb655d012fb05be8785 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 12 May 2017 12:27:30 +0200 Subject: [PATCH] Bugfix let's encrypt (#49) Bugfix let's encrypt --- letsencrypt/Dockerfile | 2 +- letsencrypt/config.json | 2 +- letsencrypt/run.sh | 11 ++--------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/letsencrypt/Dockerfile b/letsencrypt/Dockerfile index 3665afa..090e48b 100644 --- a/letsencrypt/Dockerfile +++ b/letsencrypt/Dockerfile @@ -5,7 +5,7 @@ ENV VERSION %%VERSION%% ENV LANG C.UTF-8 # Setup base -RUN apk add --no-cache jq git python curl +RUN apk add --no-cache jq certbot # Copy data COPY run.sh / diff --git a/letsencrypt/config.json b/letsencrypt/config.json index d233fd4..cbf379d 100644 --- a/letsencrypt/config.json +++ b/letsencrypt/config.json @@ -1,6 +1,6 @@ { "name": "Let's Encrypt", - "version": "0.4", + "version": "0.5", "slug": "letsencrypt", "description": "Manage Let's Encrypt certificate", "url": "https://home-assistant.io/addons/lets_encrypt/", diff --git a/letsencrypt/run.sh b/letsencrypt/run.sh index feb6739..8c47388 100644 --- a/letsencrypt/run.sh +++ b/letsencrypt/run.sh @@ -10,13 +10,6 @@ DOMAINS=$(jq --raw-output ".domains[]" $CONFIG_PATH) KEYFILE=$(jq --raw-output ".keyfile" $CONFIG_PATH) CERTFILE=$(jq --raw-output ".certfile" $CONFIG_PATH) -# setup letsencrypt setup -if [ ! -f /data/certbot-auto ]; then - cd /data - curl -O https://dl.eff.org/certbot-auto - chmod a+x certbot-auto -fi - # Generate new certs if [ ! -d "$CERT_DIR" ]; then for line in $DOMAINS; do @@ -28,11 +21,11 @@ if [ ! -d "$CERT_DIR" ]; then done echo "$DOMAINS" > /data/domains.gen - /data/certbot-auto certonly --non-interactive --standalone --email "$EMAIL" --config-dir "$CERT_DIR" --work-dir "$DOMAIN_ARG" + certbot certonly --non-interactive --standalone --email "$EMAIL" --agree-tos --config-dir "$CERT_DIR" --work-dir "$WORK_DIR" "$DOMAIN_ARG" # Renew certs else - /data/certbot-auto renew --non-interactive --config-dir "$CERT_DIR" --work-dir "$WORK_DIR" + certbot renew --non-interactive --config-dir "$CERT_DIR" --work-dir "$WORK_DIR" fi # copy certs to store