Skip to content

Commit b5a7d32

Browse files
Remove letsencrypt from netlify-dns
1 parent 2306e6c commit b5a7d32

File tree

7 files changed

+4
-171
lines changed

7 files changed

+4
-171
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Luke Bonaccorsi
3+
Copyright (c) 2022 Luke Morrigan
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

netlify-dns/Dockerfile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
ARG BUILD_FROM
22
FROM $BUILD_FROM
33

4-
# Setup base
5-
ARG DEHYDRATED_VERSION
6-
RUN apk add --no-cache openssl bind-tools \
7-
&& curl -s -o /usr/bin/dehydrated \
8-
"https://raw.githubusercontent.com/lukas2511/dehydrated/v${DEHYDRATED_VERSION}/dehydrated" \
9-
&& chmod a+x /usr/bin/dehydrated
10-
114
# Copy data
125
COPY data/*.sh /
136

netlify-dns/build.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ build_from:
44
amd64: ghcr.io/home-assistant/amd64-base:3.14
55
armhf: ghcr.io/home-assistant/armhf-base:3.14
66
armv7: ghcr.io/home-assistant/armv7-base:3.14
7-
i386: ghcr.io/home-assistant/i386-base:3.14
8-
args:
9-
DEHYDRATED_VERSION: 0.7.0
7+
i386: ghcr.io/home-assistant/i386-base:3.14

netlify-dns/config.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
version: 0.0.6
2+
version: 0.0.7
33
slug: netlify-dns
44
name: Netlify DNS
55
description: >-
@@ -20,21 +20,11 @@ options:
2020
domain: null
2121
subdomain: null
2222
token: null
23-
lets_encrypt:
24-
accept_terms: false
25-
algo: secp384r1
26-
certfile: fullchain.pem
27-
keyfile: privkey.pem
2823
seconds: 300
2924
schema:
3025
domain: str
3126
subdomain: str
3227
token: str
33-
lets_encrypt:
34-
accept_terms: bool
35-
algo: list(rsa|prime256v1|secp384r1)
36-
certfile: str
37-
keyfile: str
3828
seconds: int
3929
ip: str?
4030
startup: services

netlify-dns/data/hooks.sh

Lines changed: 0 additions & 120 deletions
This file was deleted.

netlify-dns/data/run.sh

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
#!/usr/bin/with-contenv bashio
22

3-
CERT_DIR=/data/letsencrypt
4-
WORK_DIR=/data/workdir
53
NETLIFY_API="https://api.netlify.com/api/v1"
64

7-
LE_UPDATE=0
8-
95
TOKEN=$(bashio::config 'token')
106
DOMAIN=$(bashio::config 'domain')
117
SUBDOMAIN=$(bashio::config 'subdomain')
128
WAIT_TIME=$(bashio::config 'seconds')
13-
ALGO=$(bashio::config 'lets_encrypt.algo')
149
IPV4_PATTERN='^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'
1510
HOSTNAME="$SUBDOMAIN.$DOMAIN"
1611

@@ -105,26 +100,6 @@ function updateNetlify() {
105100
fi
106101
}
107102

108-
function renewLetsEncrypt() {
109-
dehydrated --cron --algo "${ALGO}" --hook ./hooks.sh --challenge dns-01 --domain "${HOSTNAME}" --out "${CERT_DIR}" --config "${WORK_DIR}/config" || true
110-
LE_UPDATE="$(date +%s)"
111-
}
112-
113-
if bashio::config.true 'lets_encrypt.accept_terms'; then
114-
mkdir -p "${CERT_DIR}"
115-
mkdir -p "${WORK_DIR}"
116-
117-
if [ -e "${WORK_DIR}/lock" ]; then
118-
rm -f "${WORK_DIR}/lock"
119-
bashio::log.warning "Reset dehydrated lock file"
120-
fi
121-
122-
if [ ! -d "${CERT_DIR}/live" ]; then
123-
touch "${WORK_DIR}/config"
124-
dehydrated --register --accept-terms --config "${WORK_DIR}/config"
125-
fi
126-
fi
127-
128103
while true; do
129104
if bashio::config.has_value "ip"; then
130105
EXTERNAL_IP=$(bashio::config 'ip')
@@ -139,9 +114,6 @@ while true; do
139114
updateNetlify
140115

141116
now="$(date +%s)"
142-
if bashio::config.true 'lets_encrypt.accept_terms' && [ $((now - LE_UPDATE)) -ge 43200 ]; then
143-
renewLetsEncrypt
144-
fi
145117

146118
sleep "${WAIT_TIME}"
147119
done

repository.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "CodeFoodPixels",
33
"url": "https://github.com/CodeFoodPixels/homeassistant-addons",
4-
"maintainer": "Luke Bonaccorsi"
4+
"maintainer": "Luke Morrigan"
55
}

0 commit comments

Comments
 (0)