diff options
-rw-r--r-- | dnsconfig.js | 16 | ||||
-rwxr-xr-x | get_consumer_key.sh | 45 |
2 files changed, 51 insertions, 10 deletions
diff --git a/dnsconfig.js b/dnsconfig.js index c50c192..d910ed5 100644 --- a/dnsconfig.js +++ b/dnsconfig.js @@ -58,13 +58,6 @@ function bulkCNAME(sources, target) { }) } -/** - * @param {string} subdomain - */ -function acme(subdomain) { - return CNAME('_acme-challenge', subdomain + '.acme.alanpearce.eu.') -} - var nameserversHE = [ NAMESERVER('ns1.he.net.'), NAMESERVER('ns2.he.net.'), @@ -81,7 +74,7 @@ var acmeLetsEncrypt = [ }), ] -var websiteHosting = [fly('@'), fly('www'), acme('6b17e53d-6090-4820-a557-51ee3324f38c')] +var websiteHosting = [fly('@')] // Providers: @@ -102,6 +95,7 @@ D( acmeLetsEncrypt, websiteHosting, + fly('www'), // prettier-ignore bulkCNAME([ @@ -144,8 +138,7 @@ D( SSHFP('linde', 4, 2, '72f576b32b5c2d16312574182b028671fa39c8bab03d802fae04eb7f649d2570'), CNAME('*.linde', 'linde'), - AAAA('acme', '2a01:4f8:c012:23a4::715'), - NS('acme', 'acme'), + AAAA('redis', '2a01:4f8:c012:23a4::6379'), iCloudMail('alanpearce.eu', 'anzQe301nq7grixH', ['a:linde.alanpearce.eu']), DMARC_BUILDER({ @@ -164,6 +157,7 @@ D( acmeLetsEncrypt, websiteHosting, + fly('www'), iCloudMail('alanpearce.uk', 'BNdyqalwDX8kwF6k'), DMARC_BUILDER({ @@ -191,6 +185,8 @@ D( parts: ['v=spf1', '-all'], }), + ALIAS('_acme-challenge', 'linde.alanpearce.eu.'), + IGNORE('_acme-challenge', 'TXT'), CNAME('*', 'alanpearce.eu.'), nameserversHE diff --git a/get_consumer_key.sh b/get_consumer_key.sh new file mode 100755 index 0000000..12ca489 --- /dev/null +++ b/get_consumer_key.sh @@ -0,0 +1,45 @@ +#!/bin/sh +set -eu + +if [ -z "$OVH_APP_KEY" ]; then + echo 'Need $OVH_APP_KEY!' + echo "https://eu.api.ovh.com/createApp/" + exit 1 +fi + +BODY=' +{ + "accessRules": [ + { + "method": "DELETE", + "path": "/domain/zone/*" + }, + { + "method": "GET", + "path": "/domain/zone/*" + }, + { + "method": "POST", + "path": "/domain/zone/*" + }, + { + "method": "PUT", + "path": "/domain/zone/*" + }, + { + "method": "GET", + "path": "/domain/*" + }, + { + "method": "PUT", + "path": "/domain/*" + }, + { + "method": "POST", + "path": "/domain/*/nameServers/update" + } + ] +} +' + +echo $BODY | xh --json --print=b POST https://eu.api.ovh.com/1.0/auth/credential "X-Ovh-Application:$OVH_APP_KEY" |