all repos — dns @ eadb1f08a87660ac69ea720bea4a6d47c714c5c9

DNS records for my domains, managed via dnscontrol

script all missing HTTPS records

Alan Pearce
commit

eadb1f08a87660ac69ea720bea4a6d47c714c5c9

parent

b902a97925252d6b918c9e134061df2b39dd1e7f

2 files changed, 16 insertions(+), 15 deletions(-)

changed files
M add_https.shadd_https.sh
@@ -1,29 +1,22 @@
#!/usr/bin/env bash -for dom in alanpearce.{eu,uk} aln.pe; do - xh PATCH $POWERDNS_API_URL/api/v1/servers/localhost/zones/${dom}. \ +add_https() { + zone="$1" + domain="$2" + alpn="${3:-h2}" + echo "zone: ${zone} adding HTTPS record for ${domain} with alpn=${alpn}" + xh --print=b PATCH $POWERDNS_API_URL/api/v1/servers/localhost/zones/${zone}. \ X-API-KEY:$POWERDNS_API_KEY <<JSON { "rrsets": [ { - "name": "${dom}.", - "type": "HTTPS", - "ttl": 86400, - "changetype": "REPLACE", - "records": [ - { - "content": "1 . alpn=h2" - } - ] - }, - { - "name": "www.${dom}.", + "name": "${domain}.", "type": "HTTPS", "ttl": 86400, "changetype": "REPLACE", "records": [ { - "content": "1 . alpn=h2" + "content": "1 . alpn=${alpn}" } ] }
@@ -31,4 +24,11 @@ ]
} JSON +} + +for domain in alanpearce.{eu,uk}; do + add_https $domain $domain + add_https $domain www.$domain done + +add_https alanpearce.eu linde.alanpearce.eu "h3,h2"
M justfilejustfile
@@ -6,6 +6,7 @@ dnscontrol preview
push: dnscontrol push + ./add_https.sh ci: dnscontrol check