diff --git a/abaduh/adguard.nix b/abaduh/adguard.nix index 6048f4e..a3feda2 100644 --- a/abaduh/adguard.nix +++ b/abaduh/adguard.nix @@ -10,6 +10,13 @@ in { openFirewall = true; port = 8753; settings = { + http = {address = "127.0.0.1:${toString port}";}; + filtering = { + rewrites = mapAttrsToList (domain: answer: {inherit domain answer;}) { + "abaduh.local" = "100.86.139.22"; + "*.abaduh.local" = "100.86.139.22"; + }; + }; filters = imap (id: url: { enabled = true; @@ -36,6 +43,13 @@ in { }; }; + services.caddy.virtualHosts."adguard.abaduh.local" = { + extraConfig = '' + reverse_proxy http://localhost:${toString cfg.port} + tls internal + ''; + }; + # Ports needed to access the DNS resolver networking.firewall.allowedTCPPorts = [53]; networking.firewall.allowedUDPPorts = [53 51820];