From ad6809fc5de1b34e43bf48e2ee26238b42b035ec Mon Sep 17 00:00:00 2001 From: ibizaman Date: Mon, 25 Sep 2023 22:56:00 -0700 Subject: [PATCH] export openvpn status for prometheus --- modules/vpn.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/vpn.nix b/modules/vpn.nix index 90ad379..be3c104 100644 --- a/modules/vpn.nix +++ b/modules/vpn.nix @@ -30,6 +30,8 @@ let reneg-sec 0 comp-lzo no + status /tmp/openvpn/${name}.status + remote-cert-tls server auth-user-pass ${authFile} @@ -232,6 +234,10 @@ in in lib.mkMerge (lib.mapAttrsToList instanceConfig cfg); + systemd.tmpfiles.rules = map (name: + "d /tmp/openvpn/${name}.status 0700 root root" + ) (lib.attrNames cfg); + networking.iproute2.enable = true; networking.iproute2.rttablesExtraConfig = lib.concatStringsSep "\n" (lib.mapAttrsToList (name: c: "10 ${name}") cfg);