From 0313c9365ae6049e14482577d6f9d010309e28d2 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Sat, 10 Dec 2022 22:09:05 +1000 Subject: [PATCH] add dns to helm config --- dns/creds.json | 7 +++++++ dns/dnsconfig.js | 35 +++++++++++++++++++++++++++++++++++ dns/draft.js | 29 +++++++++++++++++++++++++++++ dns/test_nullhex.sh | 26 ++++++++++++++++++++++++++ dns/zones/sealight.xyz.zone | 30 ++++++++++++++++++++++++++++++ shell.nix | 2 +- 6 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 dns/creds.json create mode 100644 dns/dnsconfig.js create mode 100644 dns/draft.js create mode 100755 dns/test_nullhex.sh create mode 100644 dns/zones/sealight.xyz.zone diff --git a/dns/creds.json b/dns/creds.json new file mode 100644 index 00000000..42f5d4b0 --- /dev/null +++ b/dns/creds.json @@ -0,0 +1,7 @@ +{ + "hedns": { + "TYPE": "HEDNS", + "username": "iamanish", + "password": "$HE_PASSWORD" + } +} diff --git a/dns/dnsconfig.js b/dns/dnsconfig.js new file mode 100644 index 00000000..e0db0d04 --- /dev/null +++ b/dns/dnsconfig.js @@ -0,0 +1,35 @@ +// Providers: + +var REG_NONE = NewRegistrar('none'); // No registrar. +var DNS_BIND = NewDnsProvider('bind'); // ISC BIND. +var DNS_HEDNS = NewDnsProvider('hedns'); + +D('sealight.xyz', REG_NONE, DnsProvider(DNS_HEDNS), + DefaultTTL(86400), + //SOA('@', 'ns1.he.net.', 'hostmaster.he.net.', 2022121008, 86400, 7200, 3600000, 172800, TTL(172800)), + //NAMESERVER('ns1.he.net.'), + //NAMESERVER('ns2.he.net.'), + //NAMESERVER('ns3.he.net.'), + //NAMESERVER('ns4.he.net.'), + //NAMESERVER('ns5.he.net.'), + // capsul + A('bridge', '69.61.38.225', TTL(300)), + A('rss', '69.61.38.225', TTL(300)), + A('git', '69.61.38.225', TTL(300)), + // vultr -> nulled + A('@', '45.77.48.108', TTL(300)), + A('jitsi', '45.77.48.108', TTL(300)), + A('chat', '45.77.48.108', TTL(300)), + A('element', '45.77.48.108', TTL(300)), + A('turn', '45.77.48.108', TTL(300)), + //nullhex free email real estate + CNAME('key1._domainkey', 'key1.nullhex.com.'), + CNAME('autoconfig', 'autoconfig.nullhex.com.'), + MX('@', 10, 'smtp-in-1.nullhex.com.'), + MX('@', 20, 'smtp-in-2.nullhex.com.'), + TXT('@', 'v=spf1 a mx ~all'), + SRV('_autodiscover._tcp', 0, 1, 443, 'autodiscover.nullhex.com.'), + TXT('_dmarc', 'v=DMARC1; p=quarantine;'), + SRV('_imaps._tcp', 0, 1, 993, 'imap.nullhex.com.'), + SRV('_submissions._tcp', 0, 1, 465, 'smtp.nullhex.com.') +); diff --git a/dns/draft.js b/dns/draft.js new file mode 100644 index 00000000..9129fd15 --- /dev/null +++ b/dns/draft.js @@ -0,0 +1,29 @@ +var DSP_BIND = NewDnsProvider("bind"); +var REG_CHANGEME = NewRegistrar("none"); +D("sealight.xyz", REG_CHANGEME, + DnsProvider(DSP_BIND), + DefaultTTL(86400), + //SOA('@', 'ns1.he.net.', 'hostmaster.he.net.', 2022121008, 86400, 7200, 3600000, 172800, TTL(172800)), + CNAME('autoconfig', 'autoconfig.nullhex.com.'), + A('bridge', '69.61.38.225', TTL(300)), + A('chat', '45.77.48.108', TTL(300)), + A('element', '45.77.48.108', TTL(300)), + A('git', '69.61.38.225', TTL(300)), + A('jitsi', '69.61.38.225', TTL(300)), + CNAME('key1._domainkey', 'key1.nullhex.com.'), + A('rss', '69.61.38.225', TTL(300)), + A('@', '45.77.48.108', TTL(300)), + MX('@', 10, 'smtp-in-1.nullhex.com.'), + MX('@', 20, 'smtp-in-2.nullhex.com.'), + //NAMESERVER('ns1.he.net.'), + //NAMESERVER('ns2.he.net.'), + //NAMESERVER('ns3.he.net.'), + //NAMESERVER('ns4.he.net.'), + //NAMESERVER('ns5.he.net.'), + TXT('@', 'v=spf1 a mx ~all'), + A('turn', '69.61.38.225', TTL(300)), + SRV('_autodiscover._tcp', 0, 1, 443, 'autodiscover.nullhex.com.'), + TXT('_dmarc', 'v=DMARC1; p=quarantine;'), + SRV('_imaps._tcp', 0, 1, 993, 'imap.nullhex.com.'), + SRV('_submissions._tcp', 0, 1, 465, 'smtp.nullhex.com.') +) diff --git a/dns/test_nullhex.sh b/dns/test_nullhex.sh new file mode 100755 index 00000000..6702f2c0 --- /dev/null +++ b/dns/test_nullhex.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +if [ -z "$1" ]; then +echo "error: domain missing (sealight.xyz)" + exit 1 +fi + +domain="$1" +errors="" + +dig +short MX "$domain" | grep -q 'smtp-in-1.nullhex.com' || errors="smtp-in-1.nullhex.com record not found" +dig +short MX "$domain" | grep -q 'smtp-in-2.nullhex.com' || errors="$errors\nsmtp-in-2.nullhex.com record not found" +dig +short TXT "$domain" | grep -q '^"v=spf1 a mx ~all"$' || errors="$errors\nspf record not found" +dig +short CNAME "key1._domainkey.$domain" | grep -q 'key1.nullhex.com' || errors="$errors\nkey1._domainkey.$domain record not found" +dig +short TXT "_dmarc.$domain" | grep -q '^"v=DMARC1; p=quarantine;"$' || errors="$errors\ndmarc TXT record is missing" +dig +short SRV "_autodiscover._tcp.$domain" | grep -q '443 autodiscover.nullhex.com.' || errors="$errors\nautodiscover SRV record is missing" +dig +short SRV "_imaps._tcp.$domain" | grep -q '993 imap.nullhex.com.' || errors="$errors\nimap SRV record is missing" +dig +short SRV "_submissions._tcp.$domain" | grep -q '465 smtp.nullhex.com.' || errors="$errors\nsmtp SRV record is missing" +dig +short CNAME "autoconfig.$domain" | grep -q 'autoconfig.nullhex.com.' || errors="$errors\nautoconfig CNAME record is missing" + +if [ ! -z "$errors" ]; then + echo "$errors" + exit 1 +else + echo "success! u are redy" +fi diff --git a/dns/zones/sealight.xyz.zone b/dns/zones/sealight.xyz.zone new file mode 100644 index 00000000..5bf92f95 --- /dev/null +++ b/dns/zones/sealight.xyz.zone @@ -0,0 +1,30 @@ +; sealight.xyz Dumped Sat Dec 10 03:57:51 2022 +; +sealight.xyz. 172800 IN SOA ns1.he.net. hostmaster.he.net. ( + 2022121008 ;serial + 86400 ;refresh + 7200 ;retry + 3600000 ;expire + 172800 ) ;minimum +autoconfig.sealight.xyz. 86400 IN CNAME autoconfig.nullhex.com. +bridge.sealight.xyz. 300 IN A 69.61.38.225 +chat.sealight.xyz. 300 IN A 45.77.48.108 +element.sealight.xyz. 300 IN A 45.77.48.108 +git.sealight.xyz. 300 IN A 69.61.38.225 +jitsi.sealight.xyz. 300 IN A 69.61.38.225 +key1._domainkey.sealight.xyz. 86400 IN CNAME key1.nullhex.com. +rss.sealight.xyz. 300 IN A 69.61.38.225 +sealight.xyz. 300 IN A 45.77.48.108 +sealight.xyz. 86400 IN MX 10 smtp-in-1.nullhex.com. +sealight.xyz. 86400 IN MX 20 smtp-in-2.nullhex.com. +sealight.xyz. 172800 IN NS ns1.he.net. +sealight.xyz. 172800 IN NS ns2.he.net. +sealight.xyz. 172800 IN NS ns3.he.net. +sealight.xyz. 172800 IN NS ns4.he.net. +sealight.xyz. 172800 IN NS ns5.he.net. +sealight.xyz. 86400 IN TXT "v=spf1 a mx ~all" +turn.sealight.xyz. 300 IN A 69.61.38.225 +_autodiscover._tcp.sealight.xyz. 86400 IN SRV 0 1 443 autodiscover.nullhex.com. +_dmarc.sealight.xyz. 86400 IN TXT "v=DMARC1; p=quarantine;" +_imaps._tcp.sealight.xyz. 86400 IN SRV 0 1 993 imap.nullhex.com. +_submissions._tcp.sealight.xyz. 86400 IN SRV 0 1 465 smtp.nullhex.com. diff --git a/shell.nix b/shell.nix index 8d0d78de..33bd22ca 100644 --- a/shell.nix +++ b/shell.nix @@ -5,6 +5,6 @@ default = pkgs.mkShell { # Enable experimental features without having to specify the argument NIX_CONFIG = "experimental-features = nix-command flakes"; - nativeBuildInputs = with pkgs; [ nix home-manager git agenix deploy-rs ]; + nativeBuildInputs = with pkgs; [ nix home-manager git agenix deploy-rs dnscontrol ]; }; }