Skip to content

Commit

Permalink
Don't try auto-renew, rely on automations
Browse files Browse the repository at this point in the history
  • Loading branch information
offbyone committed Feb 21, 2023
1 parent 5e13b02 commit 038be35
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
4 changes: 4 additions & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
## How to use

Before enabling this addon, you need to copy two device key files to `config/device-certs/`: a device certificate stored in `config/device-certs/device.pem.crt` and a device key stored in `config/device-certs/device.pem.key`. These files need to be retrieved from the AWS IoT service.

## Automating this

https://community.home-assistant.io/t/lets-encrypt-add-on-how-to-get-automatic-renewal/171236 has a thread on this. Use the cert expiry entity, and a sensor that triggers this when the certificate is close to expired
2 changes: 0 additions & 2 deletions iot-certbot/rootfs/etc/periodic/15min/update_iot_creds

This file was deleted.

9 changes: 0 additions & 9 deletions iot-certbot/rootfs/etc/periodic/daily/renew-certs

This file was deleted.

8 changes: 2 additions & 6 deletions iot-certbot/rootfs/etc/services.d/lets-encrypt/finish
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@
# s6-overlay docs: https://github.com/just-containers/s6-overlay
# ==============================================================================

if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
bashio::log.warning "Halt add-on"
/run/s6/basedir/bin/halt
fi

bashio::log.info "Service restart after closing"
bashio::log.warning "Halt add-on"
/run/s6/basedir/bin/halt
3 changes: 0 additions & 3 deletions iot-certbot/rootfs/etc/services.d/lets-encrypt/run
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,3 @@ certbot certonly --non-interactive --keep-until-expiring --expand \
CERT_DIR_LATEST="$(ls -td $CERT_DIR/live/*/ | head -1)"
cp "${CERT_DIR_LATEST}privkey.pem" "/ssl/$KEYFILE"
cp "${CERT_DIR_LATEST}fullchain.pem" "/ssl/$CERTFILE"

# wait forever; we have periodic services running
exec tail -f /dev/null

0 comments on commit 038be35

Please sign in to comment.