mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-18 05:34:20 +01:00
@@ -5,7 +5,7 @@ ENV VERSION %%VERSION%%
|
|||||||
ENV LANG C.UTF-8
|
ENV LANG C.UTF-8
|
||||||
|
|
||||||
# Setup base
|
# Setup base
|
||||||
RUN apk add --no-cache jq git python curl
|
RUN apk add --no-cache jq certbot
|
||||||
|
|
||||||
# Copy data
|
# Copy data
|
||||||
COPY run.sh /
|
COPY run.sh /
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Let's Encrypt",
|
"name": "Let's Encrypt",
|
||||||
"version": "0.4",
|
"version": "0.5",
|
||||||
"slug": "letsencrypt",
|
"slug": "letsencrypt",
|
||||||
"description": "Manage Let's Encrypt certificate",
|
"description": "Manage Let's Encrypt certificate",
|
||||||
"url": "https://home-assistant.io/addons/lets_encrypt/",
|
"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)
|
KEYFILE=$(jq --raw-output ".keyfile" $CONFIG_PATH)
|
||||||
CERTFILE=$(jq --raw-output ".certfile" $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
|
# Generate new certs
|
||||||
if [ ! -d "$CERT_DIR" ]; then
|
if [ ! -d "$CERT_DIR" ]; then
|
||||||
for line in $DOMAINS; do
|
for line in $DOMAINS; do
|
||||||
@@ -28,11 +21,11 @@ if [ ! -d "$CERT_DIR" ]; then
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo "$DOMAINS" > /data/domains.gen
|
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
|
# Renew certs
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
# copy certs to store
|
# copy certs to store
|
||||||
|
|||||||
Reference in New Issue
Block a user