feat: add pyload
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
|
||||
./modules/firefox-sync.nix
|
||||
./modules/fivefilters.nix
|
||||
./modules/pyload.nix
|
||||
|
||||
# home assistant
|
||||
./modules/home-assistant
|
||||
|
||||
@@ -133,6 +133,9 @@
|
||||
"/foundry-vtt.cloonar.com/${config.networkPrefix}.97.5"
|
||||
"/sync.cloonar.com/${config.networkPrefix}.97.5"
|
||||
|
||||
# multimedia
|
||||
"/dl.cloonar.com/${config.networkPrefix}.97.5"
|
||||
|
||||
"/deconz.cloonar.multimedia/${config.networkPrefix}.97.22"
|
||||
|
||||
"/ddl-warez.to/172.67.184.30"
|
||||
|
||||
73
hosts/fw/modules/pyload.nix
Normal file
73
hosts/fw/modules/pyload.nix
Normal file
@@ -0,0 +1,73 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
cids = import ./staticids.nix;
|
||||
networkPrefix = config.networkPrefix;
|
||||
|
||||
user = {
|
||||
isSystemUser = true;
|
||||
uid = cids.uids.pyload;
|
||||
group = "pyload";
|
||||
home = "/var/lib/pyload";
|
||||
createHome = true;
|
||||
};
|
||||
group = {
|
||||
gid = cids.gids.pyload;
|
||||
};
|
||||
in
|
||||
{
|
||||
users.users.pyload = user;
|
||||
users.groups.pyload = group;
|
||||
|
||||
# Create the multimedia directory structure on the host
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /var/lib/multimedia 0755 root root - -"
|
||||
"d /var/lib/multimedia/downloads 0755 pyload pyload - -"
|
||||
"d /var/lib/multimedia/movies 0755 pyload pyload - -"
|
||||
"d /var/lib/multimedia/tv-shows 0755 pyload pyload - -"
|
||||
];
|
||||
|
||||
containers.pyload = {
|
||||
autoStart = true;
|
||||
ephemeral = false;
|
||||
privateNetwork = true;
|
||||
hostBridge = "server";
|
||||
hostAddress = "${networkPrefix}.97.1";
|
||||
localAddress = "${networkPrefix}.97.11/24";
|
||||
|
||||
bindMounts = {
|
||||
"/var/lib/pyload" = {
|
||||
hostPath = "/var/lib/pyload";
|
||||
isReadOnly = false;
|
||||
};
|
||||
"/multimedia" = {
|
||||
hostPath = "/var/lib/multimedia";
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = { lib, config, pkgs, ... }: {
|
||||
networking = {
|
||||
hostName = "pyload";
|
||||
useHostResolvConf = false;
|
||||
defaultGateway = {
|
||||
address = "${networkPrefix}.97.1";
|
||||
interface = "eth0";
|
||||
};
|
||||
nameservers = [ "${networkPrefix}.97.1" ];
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
services.pyload = {
|
||||
enable = true;
|
||||
downloadDirectory = "/multimedia/downloads";
|
||||
listenAddress = "0.0.0.0";
|
||||
port = 8000;
|
||||
};
|
||||
|
||||
users.users.pyload = user;
|
||||
users.groups.pyload = group;
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
gitea-runner = 10003;
|
||||
podman = 10004;
|
||||
foundry-vtt = 10005;
|
||||
pyload = 10006;
|
||||
};
|
||||
gids = {
|
||||
unbound = 10001;
|
||||
@@ -12,5 +13,6 @@
|
||||
gitea-runner = 10003;
|
||||
podman = 10004;
|
||||
foundry-vtt = 10005;
|
||||
pyload = 10006;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -33,4 +33,21 @@
|
||||
proxyPass = "http://${config.networkPrefix}.97.10";
|
||||
};
|
||||
};
|
||||
services.nginx.virtualHosts."dl.cloonar.com" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
|
||||
# Restrict to internal LAN only
|
||||
extraConfig = ''
|
||||
allow ${config.networkPrefix}.96.0/24;
|
||||
allow ${config.networkPrefix}.98.0/24;
|
||||
deny all;
|
||||
'';
|
||||
|
||||
locations."/" = {
|
||||
proxyPass = "http://${config.networkPrefix}.97.11:8000";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -228,6 +228,21 @@ in
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
pyload-tunnel = {
|
||||
Unit = {
|
||||
Description = "SSH tunnel for pyLoad Click'n'Load";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.openssh}/bin/ssh -N -L 9666:10.42.97.11:9666 -o ServerAliveInterval=60 -o ServerAliveCountMax=3 root@fw.cloonar.com";
|
||||
Restart = "always";
|
||||
RestartSec = "10s";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.chromium = {
|
||||
|
||||
Reference in New Issue
Block a user