rtorrent downloads, but doesn't upload yet

This commit is contained in:
Haak Saxberg 2022-08-11 08:39:56 -07:00
parent 36f1b046bb
commit aed18e9a93
5 changed files with 86 additions and 5 deletions

View file

@ -81,6 +81,54 @@ in
/export/storage 192.168.1.0/24(insecure)
'';
networking.firewall.allowedTCPPorts = [ 2049 ];
networking.firewall = {
allowedTCPPorts = [ 2049 ]; # NFS port
allowedUDPPorts = [ 51820 ]; # Clients and peers can use the same port, see listenport
};
deployment.keys.wireguard.text = builtins.readFile ../../secrets/wireguard/svalbard;
# Enable WireGuard
networking.wg-quick.interfaces = {
# "wg0" is the network interface name. You can name the interface arbitrarily.
wg0 = {
# Determines the IP address and subnet of the client's end of the tunnel interface.
address = [ "10.64.168.213/32" "fc00:bbbb:bbbb:bb01::1:a8d4/128" ];
dns = [ "10.64.0.1" ];
listenPort = 51820; # to match firewall allowedUDPPorts (without this wg uses random port numbers)
# Note: The private key can also be included inline via the privateKey option,
# but this makes the private key world-readable; thus, using privateKeyFile is
# recommended.
privateKeyFile = "/run/keys/wireguard";
# For a client configuration, one peer entry for the server will suffice.
peers = [
# Sweden, Malmo, se15
{
# Public key of the server (not a file path).
publicKey = "5y66WShsFXqM5K7/4CPEGCWfk7PQyNhVBT2ILjbGm2I=";
# Forward all the traffic via VPN.
allowedIPs = [ "0.0.0.0/0" "::0/0" ];
# Set this to the server IP and port.
endpoint = "193.138.218.80:51820"; # ToDo: route to endpoint not automatically configured https://wiki.archlinux.org/index.php/WireGuard#Loop_routing https://discourse.nixos.org/t/solved-minimal-firewall-setup-for-wireguard-client/7577
# Send keepalives every 25 seconds. Important to keep NAT tables alive.
persistentKeepalive = 25;
}
];
};
};
systemd.services.my-service = {
after = [ "wireguard-key.service" ];
wants = [ "wireguard-key.service" ];
script = ''
export MY_SECRET=$(cat /run/keys/my-secret)
run-my-program
'';
};
};
}