From 82eaa56db7f168fed3d8431ca489897b8ba9fd62 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Sun, 1 Jun 2025 15:22:05 -0400 Subject: [PATCH] fix ovpn --- systems/palatine-hill/docker/torr.nix | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/systems/palatine-hill/docker/torr.nix b/systems/palatine-hill/docker/torr.nix index 9af58ab..a2bf27c 100644 --- a/systems/palatine-hill/docker/torr.nix +++ b/systems/palatine-hill/docker/torr.nix @@ -34,7 +34,7 @@ let "${file}" = { format = "binary"; sopsFile = ./openvpn/${file}; - path = "${delugevpn_path}/config/openvpn/${file}"; + path = "${delugevpn_path}/config/openvpn/configs/${file}"; owner = "docker-service"; group = "users"; restartUnits = [ "docker-delugeVPN.service" ]; @@ -89,21 +89,21 @@ in }; }; - # systemd.services.docker-delugeVPN = { - # serviceConfig = { - # ExecStartPre = [ - # ( - # "${pkgs.bash}/bin/bash -c \"${pkgs.findutils}/bin/find ${delugevpn_path}/config/wireguard/configs " - # + "-type l -not -name wg0.conf " - # + "| ${pkgs.coreutils}/bin/shuf -n 1 " - # + "| ${pkgs.findutils}/bin/xargs -I {} cp -L {} ${delugevpn_path}/config/wireguard/wg0.conf &&" - # + "${pkgs.coreutils}/bin/chown docker-service:users ${delugevpn_path}/config/wireguard/wg0.conf &&" - # + "${pkgs.coreutils}/bin/chmod 440 ${delugevpn_path}/config/wireguard/wg0.conf\"" - # ) - # ]; - # ExecStopPost = [ "${pkgs.coreutils}/bin/rm ${delugevpn_path}/config/wireguard/wg0.conf" ]; - # }; - # }; + systemd.services.docker-delugeVPN = { + serviceConfig = { + ExecStartPre = [ + ( + "${pkgs.bash}/bin/bash -c \"${pkgs.findutils}/bin/find ${delugevpn_path}/config/openvpn/configs " + + "-type l -not -name network.ovpn " + + "| ${pkgs.coreutils}/bin/shuf -n 1 " + + "| ${pkgs.findutils}/bin/xargs -I {} cp -L {} ${delugevpn_path}/config/openvpn/network.ovpn &&" + + "${pkgs.coreutils}/bin/chown docker-service:users ${delugevpn_path}/config/openvpn/network.ovpn &&" + + "${pkgs.coreutils}/bin/chmod 440 ${delugevpn_path}/config/openvpn/network.ovpn\"" + ) + ]; + ExecStopPost = [ "${pkgs.coreutils}/bin/rm ${delugevpn_path}/config/openvpn/network.ovpn" ]; + }; + }; sops.secrets = (genSopsConfOvpn "se.protonvpn.udp.ovpn") // { "docker/delugevpn".owner = "docker-service";