use TS Record type to store host data
1 file changed, 31 insertions(+), 6 deletions(-)
changed files
M dnsconfig.js → dnsconfig.js
@@ -7,6 +7,36 @@ /// <reference path="helpers.js" /> require_glob("./helpers.js") /** + * @typedef {Object} SSHFPConfig + * @property {0 | 1 | 2 | 3 | 4} algo + * @property {0 | 1 | 2} type + * @property {string} fingerprint + */ + +/** + * @typedef {Object} HostConfig + * @property {string} v4 - IPv4 address for the host + * @property {string} v6 - IPv6 address for the host + * @property {SSHFPConfig[]} [sshfp] - SSH fingerprints (use `just get-ssh-host-key $hostname`) + */ + +/** + * @type {Record<string, HostConfig>} + */ +var hosts = { + hasel: { + v4: '185.55.243.110', + v6: '2a00:1913:682b::', + sshfp: [ + { algo: 1, type: 1, fingerprint: "4ab581a1f0d115678e6724e2d865208ab195ccd6" }, + { algo: 1, type: 2, fingerprint: "f50a2082a18b4bcf96c3f94c9554312468e67c65ef44a936c8d12933dc2416a8" }, + { algo: 4, type: 1, fingerprint: "664e7f23544b9c758ee66d5f8164db7a6d5970e8" }, + { algo: 4, type: 2, fingerprint: "27a1dbd525c0efe21f56dba96dfcd7c7bdb07756e510ca15e2626e23ef2483b6" }, + ] + }, +} + +/** * @param {string} name * @param {RecordModifier[]} [modifiers] */@@ -168,12 +198,7 @@ IGNORE('home', 'A,AAAA'), IGNORE('_acme-challenge', 'TXT'), IGNORE('_acme-challenge.**', 'TXT'), - A('hasel', '185.55.243.110'), - AAAA('hasel', '2a00:1913:682b::'), - SSHFP('hasel', 1, 1, '4ab581a1f0d115678e6724e2d865208ab195ccd6'), - SSHFP('hasel', 1, 2, 'f50a2082a18b4bcf96c3f94c9554312468e67c65ef44a936c8d12933dc2416a8'), - SSHFP('hasel', 4, 1, '664e7f23544b9c758ee66d5f8164db7a6d5970e8'), - SSHFP('hasel', 4, 2, '27a1dbd525c0efe21f56dba96dfcd7c7bdb07756e510ca15e2626e23ef2483b6'), + mkHostRecords('hasel', hosts.hasel), iCloudMail('alin.ovh', 'VgiTkEni66SwcRxU', ['a:hasel.alin.ovh']), DMARC_BUILDER({