2022-03-15 15:58:04 +00:00
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
domain = "htdel.giugl.io";
|
|
|
|
network = import ./network.nix;
|
2022-10-28 13:59:17 +01:00
|
|
|
auth_block = (import ./openid.nix).openresty_oidc_block;
|
2022-03-15 15:58:04 +00:00
|
|
|
in {
|
|
|
|
services = {
|
|
|
|
deluge = {
|
|
|
|
enable = true;
|
|
|
|
group = "media";
|
|
|
|
declarative = true;
|
|
|
|
config = {
|
|
|
|
download_location = "/media/deluge";
|
|
|
|
max_upload_speed = 20;
|
|
|
|
# full-stream
|
|
|
|
enc_level = 1;
|
|
|
|
# forced
|
|
|
|
enc_in_policy = 0;
|
|
|
|
# forced
|
|
|
|
enc_out_policy = 0;
|
|
|
|
max_active_seeding = 100;
|
|
|
|
max_connections_global = 1000;
|
|
|
|
max_active_limit = 100;
|
|
|
|
max_active_downloading = 100;
|
|
|
|
listen_ports = [ 51413 51414 ];
|
|
|
|
random_port = false;
|
|
|
|
enabled_plugins = [ "Label" "Extractor" ];
|
|
|
|
};
|
|
|
|
web.enable = true;
|
|
|
|
authFile = "/secrets/deluge/auth";
|
|
|
|
extraPackages = [ pkgs.unrar ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nginx.virtualHosts.${domain} = {
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://localhost:8112";
|
2022-10-28 13:59:17 +01:00
|
|
|
extraConfig = auth_block {
|
|
|
|
realm = "master";
|
|
|
|
client_id = "deluge";
|
|
|
|
client_secret = "AGa1U9S1zkaM3TJVxtyx4Er76DBk1APR";
|
|
|
|
redirect_uri = "https://${domain}";
|
|
|
|
};
|
2022-03-15 15:58:04 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
networking.extraHosts = ''
|
|
|
|
${network.architect-lan} ${domain}
|
|
|
|
${network.architect-wg} ${domain}
|
|
|
|
'';
|
|
|
|
|
|
|
|
users.groups.media.members = [ "deluge" ];
|
|
|
|
}
|