From 1733cf5b1f630aafa127771a2c657f1e106e0d80 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Sun, 19 Jun 2022 22:09:13 +0200 Subject: oxaproxy: init --- hosts/cirrus/secrets.nix | 3 +++ hosts/cirrus/wireguard-server.nix | 25 ++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) (limited to 'hosts') diff --git a/hosts/cirrus/secrets.nix b/hosts/cirrus/secrets.nix index f6da490..df095a7 100644 --- a/hosts/cirrus/secrets.nix +++ b/hosts/cirrus/secrets.nix @@ -7,5 +7,8 @@ "wg/oxalab-seckey" = { owner = config.users.users.systemd-network.name; }; + "wg/oxaproxy-seckey" = { + owner = config.users.users.systemd-network.name; + }; }; } diff --git a/hosts/cirrus/wireguard-server.nix b/hosts/cirrus/wireguard-server.nix index 2d939c0..0f28114 100644 --- a/hosts/cirrus/wireguard-server.nix +++ b/hosts/cirrus/wireguard-server.nix @@ -1,8 +1,9 @@ { config, ... }: { - networking.firewall.allowedUDPPorts = [ 51820 ]; + networking.firewall.allowedUDPPorts = [ 51820 51821 ]; networking.wireguard.enable = true; systemd.network = { + # oxalab netdevs."oxalab" = { netdevConfig = { Kind = "wireguard"; @@ -42,5 +43,27 @@ IPForward = "ipv4"; }; }; + + + # oxaproxy + netdevs."oxaproxy" = { + netdevConfig = { + Kind = "wireguard"; + Name = "oxaproxy"; + Description = "oxa's enterprise reverse-proxy network"; + }; + wireguardConfig = { + PrivateKeyFile = config.sops.secrets."wg/oxaproxy-seckey".path; + #own pubkey 0KMtL2fQOrrCH6c2a2l4FKiM73G86sUuyaNj4FarzVM= + ListenPort = 51821; + }; + wireguardPeers = [ ]; + }; + networks."oxaproxy" = { + matchConfig.Name = "oxaproxy"; + networkConfig = { + Address = "10.34.45.1/24"; + }; + }; }; } -- cgit v1.3.1