many changes

This commit is contained in:
2024-06-03 13:49:35 +02:00
parent c9e4ab6af0
commit 5d0827848e
24 changed files with 844 additions and 163 deletions

View File

@@ -3,10 +3,7 @@ let
cids = import ../modules/staticids.nix;
domain = "ns.cloonar.com";
cfg = {
remote-control = {
control-enable = true;
control-use-cert = false;
};
remote-control.control-enable = true;
server = {
interface = [ "0.0.0.0" "::0" ];
interface-automatic = "yes";
@@ -19,7 +16,7 @@ let
"10.42.101.0/24 allow"
"0.0.0.0/0 allow"
];
tls-cert-bundle = "/var/lib/acme/ns.cloonar.com/fullchain.pem";
# tls-cert-bundle = "/var/lib/acme/ns.cloonar.com/fullchain.pem";
local-zone = "\"cloonar.com\" transparent";
local-data = [
"\"localhost A 127.0.0.1\""
@@ -73,19 +70,55 @@ let
"\"upgrade-staging.wienbautvor.at IN A 10.254.240.110\""
"\"upgrade-staging.wienwohntbesser.at IN A 10.254.240.110\""
"\"deconz.cloonar.multimedia IN A 10.42.97.22\""
"\"metz.cloonar.multimedia IN A 10.42.99.10\""
"\"ps5.cloonar.multimedia IN A 10.42.99.12\""
# "\"ps5.cloonar.multimedia IN A 10.42.99.12\""
"\"xbox.cloonar.multimedia IN A 10.42.99.13\""
"\"switch.cloonar.multimedia IN A 10.42.99.14\""
"\"shellycolorbulb-34945479bc57.cloonar.com IN A 10.42.100.130\""
"\"shellycolorbulb-485519d9a1b2.cloonar.com IN A 10.42.100.131\""
"\"shellycolorbulb-485519d9ae95.cloonar.com IN A 10.42.100.132\""
"\"shellycolorbulb-485519d94a28.cloonar.com IN A 10.42.100.133\""
"\"shellycolorbulb-485519da6b6a.cloonar.com IN A 10.42.100.134\""
"\"shellycolorbulb-485519d9e018.cloonar.com IN A 10.42.100.135\""
# "\"switch.cloonar.multimedia IN A 10.42.99.14\""
#living room
"\"shellycolorbulb-livingroom-1.cloonar.smart IN A 10.42.100.2\""
"\"shellycolorbulb-livingroom-2.cloonar.smart IN A 10.42.100.3\""
"\"shellycolorbulb-livingroom-3.cloonar.smart IN A 10.42.100.4\""
"\"shellycolorbulb-livingroom-4.cloonar.smart IN A 10.42.100.5\""
"\"shellycolorbulb-livingroom-5.cloonar.smart IN A 10.42.100.6\""
"\"shellycolorbulb-livingroom-6.cloonar.smart IN A 10.42.100.7\""
"\"shellyuni-livingroom-1.cloonar.smart IN A 10.42.100.8\""
"\"shellyswitch25-livingroom-1.cloonar.smart IN A 10.42.100.9\""
"\"shellyplug-s-living-1.cloonar.smart IN A 10.42.100.10\""
"\"shellyplug-s-living-2.cloonar.smart IN A 10.42.100.11\""
# kitchen
"\"shellyplug-s-kitchen-1.cloonar.smart IN A 10.42.100.17\""
"\"shellyrgbw2-kitchen-1.cloonar.smart IN A 10.42.100.18\""
#bedroom
"\"shelly1-bedroom-1.cloonar.smart IN A 10.42.100.33\""
"\"shellybutton1-bedroom-1.cloonar.smart IN A 10.42.100.34\""
"\"shellybutton1-bedroom-2.cloonar.smart IN A 10.42.100.35\"" # todo
"\"shellyrgbw2-bedroom-1.cloonar.smart IN A 10.42.100.36\""
"\"shellyrgbw2-bedroom-2.cloonar.smart IN A 10.42.100.37\""
"\"shellyrgbw2-bedroom-3.cloonar.smart IN A 10.42.100.38\""
# bath
"\"shellyswitch25-bath-1.cloonar.smart IN A 10.42.100.49\""
"\"shellybulbduo-bath-1.cloonar.smart IN A 10.42.100.50\""
"\"shellybulbduo-bath-2.cloonar.smart IN A 10.42.100.51\""
"\"shelly1pm-bath-1.cloonar.smart IN A 10.42.100.52\""
"\"shellyht-bath-1.cloonar.smart IN A 10.42.100.53\"" # todo
# hallway
"\"shelly1-hallway-1.cloonar.smart IN A 10.42.100.65\""
"\"shellycolorbulb-hallway-1.cloonar.smart IN A 10.42.100.66\""
"\"shellycolorbulb-hallway-2.cloonar.smart IN A 10.42.100.67\""
"\"shellycolorbulb-hallway-3.cloonar.smart IN A 10.42.100.68\""
"\"shellycolorbulb-hallway-4.cloonar.smart IN A 10.42.100.69\""
"\"shellyem3.cloonar.smart IN A 10.42.100.70\""
"\"shellypro-1.cloonar.smart IN A 10.42.100.71\""
"\"shellypro-2.cloonar.smart IN A 10.42.100.72\""
# toilet
"\"shelly1-toilet-1.cloonar.smart IN A 10.42.100.81\""
"\"shellybulbduo-toilet-1.cloonar.smart IN A 10.42.100.82\""
# storage
"\"shelly1-storage-1.cloonar.smart IN A 10.42.100.97\""
"\"ddl-warez.to IN A 172.67.184.30\""
"\"cdnjs.cloudflare.com IN A 104.17.24.14\""
];
local-data-ptr = [
"\"127.0.0.1 localhost\""
@@ -102,7 +135,9 @@ let
"\"10.254.240.110 a.stage.wohnservice-wien.at\""
"\"172.67.184.30 ddl-warez.to\""
"\"104.17.24.14 cdnjs.cloudflare.com\""
];
# ssl-upstream = "yes";
};
forward-zone = [
{
@@ -137,12 +172,14 @@ let
}
{
name = ".";
# forward-addr = "104.16.248.249@853#cloudflare-dns.com";
forward-addr = [
# "10.44.96.1"
# "9.9.9.9#dns11.quad9.net"
# "149.112.112.112#dns11.quad9.net"
# "9.9.9.9@853#dns9.quad9.net"
# "149.112.112.11@853#dns11.quad9.net"
# "9.9.9.9@853"
# "149.112.112.11@853"
"9.9.9.9"
"149.112.112.112"
"149.112.112.11"
];
}
];
@@ -204,19 +241,20 @@ in {
if [[ "''\$2" == "A" ]] ; then
echo ''\${address} | while IFS=. read -r ip0 ip1 ip2 ip3
do
if [[ "''\${hostname}" != "" ]] && [[ "''\${hostname}" != *. ]]; then
if [[ "''\${ip2}" == 96 ]]; then
unbound-control local_data ''\${hostname}.cloonar.com ''\$2 ''\${address}
fi
if [[ "''\${ip2}" == 97 ]]; then
unbound-control local_data ''\${hostname}.cloonar.com ''\$2 ''\${address}
fi
if [[ "''\${hostname}" != "" ]]; then
domain=cloonar.com
if [[ "''\${ip2}" == 99 ]]; then
unbound-control local_data ''\${hostname}.cloonar.multimedia ''\$2 ''\${address}
domain=cloonar.multimedia
fi
if [[ "''\${ip2}" == 100 ]]; then
unbound-control local_data ''\${hostname}.cloonar.smart ''\$2 ''\${address}
domain=cloonar.smart
fi
if [[ "''\${hostname}" != *. ]]; then
unbound-control local_data ''\${hostname}.''\${domain} ''\$2 ''\${address}
else
unbound-control local_data ''\${hostname}''\${domain} ''\$2 ''\${address}
fi
fi
unbound-control local_data ''\${ip3}.''\${ip2}.''\${ip1}.''\${ip0}.ip4.arpa. PTR ''\${hostname}
unbound-control local_data ''\${ip3}.''\${ip2}.''\${ip1}.''\${ip0}.in-addr.arpa. PTR ''\${hostname}