Bugfix let's encrypt (#49)

Bugfix let's encrypt
This commit is contained in:
Pascal Vizeli
2017-05-12 12:27:30 +02:00
committed by GitHub
parent 1722c1113e
commit 6d62a68387
3 changed files with 4 additions and 11 deletions

View File

@@ -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 /

View File

@@ -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/",

View File

@@ -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