Luigit
repositories / bugabinga.net

bugabinga.net

personal infrastructure for bugabinga!

owned by admin

modules/klops/templates/ddns.container.tftpl

Raw
[Unit]
Description=Reconcile wildcard DNS records for the public relay
After=network-online.target
Wants=network-online.target

[Container]
ContainerName=ddns
Image=docker.io/curlimages/curl:latest
Pull=always
Secret=dns_email
Secret=dns_pass
Exec=/bin/sh -eu -c '\
EMAIL=$(cat /run/secrets/dns_email); \
PASS=$(cat /run/secrets/dns_pass); \
curl --silent --show-error --fail-with-body --retry 3 --user "$EMAIL:$PASS" --request PUT --data "${relay_ipv4}" "https://box.bugabinga.net/admin/dns/custom/*.bugabinga.net/a"; \
curl --silent --show-error --fail-with-body --retry 3 --user "$EMAIL:$PASS" --request PUT --data "${relay_ipv6}" "https://box.bugabinga.net/admin/dns/custom/*.bugabinga.net/aaaa"'

[Service]
Restart=on-failure
TimeoutStartSec=300

[Install]
WantedBy=default.target