feat: dns fully modularised now
This commit is contained in:
parent
34de735720
commit
920f6ab86e
3 changed files with 11 additions and 15 deletions
|
@ -196,6 +196,11 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
../applications/firewall.nix
|
||||||
|
];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
skynet_dns = {
|
skynet_dns = {
|
||||||
enable = lib.mkEnableOption {
|
enable = lib.mkEnableOption {
|
||||||
|
@ -212,7 +217,6 @@ in {
|
||||||
|
|
||||||
own = {
|
own = {
|
||||||
ip = lib.mkOption {
|
ip = lib.mkOption {
|
||||||
default = "ns1";
|
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = ''
|
description = ''
|
||||||
ip of this server
|
ip of this server
|
||||||
|
@ -284,6 +288,12 @@ in {
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
# open the firewall for this
|
||||||
|
skynet_firewall.forward = [
|
||||||
|
"ip daddr ${cfg.own.ip} tcp dport 53 counter packets 0 bytes 0 accept"
|
||||||
|
"ip daddr ${cfg.own.ip} udp dport 53 counter packets 0 bytes 0 accept"
|
||||||
|
];
|
||||||
|
|
||||||
services.bind.zones =
|
services.bind.zones =
|
||||||
(create_entry_zone "csn.ul.ie" extraConfig.owned ) //
|
(create_entry_zone "csn.ul.ie" extraConfig.owned ) //
|
||||||
(create_entry_zone "skynet.ie" extraConfig.owned )//
|
(create_entry_zone "skynet.ie" extraConfig.owned )//
|
||||||
|
|
|
@ -52,12 +52,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# open the firewall for this
|
|
||||||
skynet_firewall.forward = [
|
|
||||||
"ip daddr ${ip_pub} tcp dport 53 counter packets 0 bytes 0 accept"
|
|
||||||
"ip daddr ${ip_pub} udp dport 53 counter packets 0 bytes 0 accept"
|
|
||||||
];
|
|
||||||
|
|
||||||
skynet_dns = {
|
skynet_dns = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,6 @@ let
|
||||||
ns = "ns2";
|
ns = "ns2";
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
# applications for this particular server
|
|
||||||
../applications/firewall.nix
|
|
||||||
../applications/dns.nix
|
../applications/dns.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -34,12 +32,6 @@ in {
|
||||||
tags = [ "active" "dns" ];
|
tags = [ "active" "dns" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# open the firewall for this
|
|
||||||
skynet_firewall.forward = [
|
|
||||||
"ip daddr ${ip_pub} tcp dport 53 counter packets 0 bytes 0 accept"
|
|
||||||
"ip daddr ${ip_pub} udp dport 53 counter packets 0 bytes 0 accept"
|
|
||||||
];
|
|
||||||
|
|
||||||
skynet_dns = {
|
skynet_dns = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue