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