diff --git a/hosts/lala/proxies.nix b/hosts/lala/proxies.nix index 2c4e55b..a4aac2a 100644 --- a/hosts/lala/proxies.nix +++ b/hosts/lala/proxies.nix @@ -5,7 +5,11 @@ lib, ... }: +let + socksPort = 1080; +in { + # Forwarded to netbird-proxy service networking.firewall = { allowedTCPPorts = [ 25565 # minecraft @@ -13,5 +17,41 @@ allowedUDPPorts = [ 8211 # palworld ]; + # trustedInterfaces = [ "nb-sidonia" ]; + }; + + # Accessible from netbird network + networking.firewall.interfaces.nb-sidonia = { + allowedTCPPorts = [ + socksPort + config.services.flaresolverr.port + ]; + allowedUDPPorts = [ socksPort ]; + }; + + services = { + flaresolverr = { + enable = true; + openFirewall = false; + port = 8191; + }; + _3proxy = { + enable = true; + denyPrivate = true; + services = [ + { + type = "socks"; + bindPort = socksPort; + auth = [ "iponly" ]; + acl = [ + { + # only allow netbird clients + rule = "allow"; + sources = [ "100.109.0.0/16" ]; + } + ]; + } + ]; + }; }; }