1
Fork 0

try to use wireguard instead of openvpn

This commit is contained in:
prescientmoon 2024-05-30 04:37:13 +02:00
parent 4657d6a4df
commit 6a442e2e4a
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4

View file

@ -6,7 +6,7 @@ let
port = 8417; port = 8417;
dataDir = "/persist/data/media"; dataDir = "/persist/data/media";
configDir = "/persist/state/var/lib/qbittorrent"; configDir = "/persist/state/var/lib/qbittorrent";
vpnConfigDir = "/persist/state/var/lib/openvpn"; vpnConfig = "/persist/state/var/lib/mullvad/wireguard/ch-zrh-wg-001.conf";
in in
{ {
imports = [ ../../common/optional/services/nginx.nix ]; imports = [ ../../common/optional/services/nginx.nix ];
@ -21,8 +21,8 @@ in
virtualisation.oci-containers.containers.qbittorrent = { virtualisation.oci-containers.containers.qbittorrent = {
image = "linuxserver/qbittorrent:latest"; image = "linuxserver/qbittorrent:latest";
extraOptions = [ "--network=container:openvpn-client" ]; extraOptions = [ "--network=container:wireguard-client" ];
dependsOn = [ "openvpn-client" ]; dependsOn = [ "wireguard-client" ];
volumes = [ "${dataDir}:/downloads" "${configDir}:/config" ]; volumes = [ "${dataDir}:/downloads" "${configDir}:/config" ];
environment = { environment = {
@ -30,16 +30,16 @@ in
}; };
}; };
# {{{ open-vpn # {{{ wireguard-client
virtualisation.oci-containers.containers.openvpn-client = { virtualisation.oci-containers.containers.wireguard-client = {
image = "ghcr.io/wfg/openvpn-client"; image = "ghcr.io/wfg/wireguard";
extraOptions = [ extraOptions = [
"--network=bridge" "--network=bridge"
"--cap-add=net_admin" "--cap-add=net_admin"
"--device=/dev/net/tun" "--device=/dev/net/tun"
]; ];
volumes = [ "${vpnConfigDir}:/data/vpn" ]; volumes = [ "${vpnConfig}:/etc/wireguard/wg0.conf" ];
ports = [ "${toString port}:${toString port}" ]; ports = [ "${toString port}:${toString port}" ];
environment = { environment = {