mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 21:24:20 +01:00
@@ -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 /
|
||||
|
||||
@@ -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/",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user