1
Fork 0

Set up torrent

This commit is contained in:
prescientmoon 2024-04-28 01:14:19 +02:00
parent 8c749b584d
commit a3e919df3c
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
5 changed files with 53 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

View file

@ -20,3 +20,4 @@ The idea is to always use consecutive ports, but never go back and try to recycl
| 8414 | [invidious](../hosts/nixos/lapetus/services/invidious.nix) |
| 8415 | [radicale](../hosts/nixos/lapetus/services/radicale.nix) |
| 8416 | [redlib](../hosts/nixos/lapetus/services/redlib.nix) |
| 8417 | [qbittorrent](../hosts/nixos/lapetus/services/qbittorrent.nix) |

View file

@ -22,6 +22,7 @@
./services/ddclient.nix
./services/redlib.nix
./services/jellyfin.nix
./services/qbittorrent.nix
./filesystems
./hardware
];

View file

@ -144,10 +144,16 @@ in
logo = icon "commafeed.png";
url = "https://rss.moonythm.dev";
}
{
name = "Qbittorrent";
subtitle = "Torrent client";
logo = icon "jellyfin.png";
url = "https://qbit.moonythm.dev";
}
{
name = "Jellyfin";
subtitle = "Media server";
logo = icon "jellyfin.png";
logo = icon "qbittorrent.png";
url = "https://media.moonythm.dev";
}
];

View file

@ -0,0 +1,44 @@
{ config, pkgs, ... }:
let
port = 8417;
dataDir = "/persist/data/home/adrielus/media";
configDir = "/persist/state/var/lib/qbittorrent";
vpnConfigDir = "/persist/state/var/lib/openvpn";
in
{
imports = [ ../../common/optional/services/nginx.nix ];
services.nginx.virtualHosts."qbit.moonythm.dev" =
config.satellite.proxy port { };
systemd.tmpfiles.rules = [ "d ${dataDir}" "d ${configDir}" ];
virtualisation.oci-containers.qbittorrent = {
image = "linuxserver/qbittorrent:latest";
extraOptions = [ "--network=container:openvpn-client" ];
dependsOn = [ "openvpn-client" ];
volumes = [ "${dataDir}:/downloads" "${configDir}:/config" ];
environment = {
WEBUI_PORT = toString port;
};
};
# {{{ open-vpn
virtualisation.oci-containers.openvpn-client = {
image = "ghcr.io/wfg/openvpn-client";
extraOptions = [
"--network=bridge"
"--cap-add=net_admin"
"--devices=/dev/net/tun"
];
volumes = [ "${vpnConfigDir}:/data/vpn" ];
ports = [ "${port}:${port}" ];
environment = {
KILL_SWITCH = "on"; # Turns off internet access if the VPN connection drops
FORWARDED_PORTS = "nl-ams-59103";
};
};
# }}}
}