From 2485f544fb928f17e548a3cdac33db4e27409c29 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Fri, 27 Sep 2024 23:59:42 -0600 Subject: [PATCH] removed proxy for torrent, nzb, multi-scrobbler --- hosts/miniserver/temp-nginx.nix | 6 ++--- modules/servers.nix | 38 +++++++++------------------ modules/servers/homepage/services.nix | 10 +++---- modules/servers/maloja.nix | 14 +++++----- modules/servers/multi-scrobbler.nix | 13 +++------ modules/servers/qbittorrent.nix | 2 -- modules/servers/sabnzbd.nix | 18 ++++--------- 7 files changed, 35 insertions(+), 66 deletions(-) diff --git a/hosts/miniserver/temp-nginx.nix b/hosts/miniserver/temp-nginx.nix index 00f5707..b4bbc18 100644 --- a/hosts/miniserver/temp-nginx.nix +++ b/hosts/miniserver/temp-nginx.nix @@ -51,9 +51,9 @@ in "music.${config.my.domain}" = proxyReverseArr 8686 // { }; "subs.${config.my.domain}" = proxyReverse config.services.bazarr.listenPort // { }; "library.${config.my.domain}" = proxyReverse config.services.kavita.port // { }; - "vnfx2cojmt7dwzcfmi73.${config.my.domain}" = proxyReverse 9091 // { }; - "HSoeJdGRd2Orj0n31UGI.${config.my.domain}" = proxyReverse 3399 // { }; - "hjL9GS7edDQVranqV5V4.${config.my.domain}" = proxyReverse 9999 // { }; + # "vnfx2cojmt7dwzcfmi73.${config.my.domain}" = proxyReverse 9091 // { }; + # "HSoeJdGRd2Orj0n31UGI.${config.my.domain}" = proxyReverse 3399 // { }; + # "hjL9GS7edDQVranqV5V4.${config.my.domain}" = proxyReverse 9999 // { }; "flix.${config.my.domain}" = { forceSSL = true; enableACME = true; diff --git a/modules/servers.nix b/modules/servers.nix index 206b79d..0fd8b1a 100644 --- a/modules/servers.nix +++ b/modules/servers.nix @@ -80,29 +80,22 @@ in ; }) (import ./servers/lidarr.nix { inherit lib config proxyReverseArr; }) - (import ./servers/maloja.nix { inherit lib config proxyReverse; }) + (import ./servers/maloja.nix { + inherit + lib + config + proxyReverse + setup + ; + }) (import ./servers/mealie.nix { inherit lib config proxyReverse; }) (import ./servers/metube.nix { inherit lib config proxyReverse; }) (import ./servers/microbin.nix { inherit lib config proxyReverse; }) - (import ./servers/multi-scrobbler.nix { inherit lib config proxyReverse; }) + (import ./servers/multi-scrobbler.nix { inherit lib config; }) (import ./servers/nextcloud.nix { inherit lib config pkgs; }) (import ./servers/prowlarr.nix { inherit lib config proxyReverseArr; }) - (import ./servers/qbittorrent.nix { - inherit - lib - config - pkgs - proxyReverse - ; - }) - (import ./servers/sabnzbd.nix { - inherit - lib - config - pkgs - proxyReverse - ; - }) + (import ./servers/qbittorrent.nix { inherit lib config pkgs; }) + (import ./servers/sabnzbd.nix { inherit lib config pkgs; }) (import ./servers/radarr.nix { inherit lib config proxyReverseArr; }) (import ./servers/ryot.nix { inherit lib config proxyReverse; }) (import ./servers/shiori.nix { @@ -122,14 +115,7 @@ in proxyReverse ; }) - (import ./servers/firefly-iii.nix { - inherit - lib - config - pkgs - proxyReverse - ; - }) + (import ./servers/firefly-iii.nix { inherit lib config; }) ]; options.my = { localhost = lib.mkOption { diff --git a/modules/servers/homepage/services.nix b/modules/servers/homepage/services.nix index 586ee6a..5b1eefa 100644 --- a/modules/servers/homepage/services.nix +++ b/modules/servers/homepage/services.nix @@ -135,14 +135,14 @@ "qbittorrent server" = let name = "qbittorrent"; - url = "https://vnfx2cojmt7dwzcfmi73.servidos.lat"; + url = "http://192.168.1.69:9091"; in { icon = "${name}.png"; href = url; widget = { type = name; - url = "http://192.168.1.69:9091"; + url = url; username = "{{HOMEPAGE_VAR_QBIT_USERNAME}}"; password = "{{HOMEPAGE_VAR_QBIT_PASSWORD}}"; }; @@ -150,14 +150,14 @@ "qbittorrent miniserver" = let name = "qbittorrent"; - url = "https://xfwmrle6h6skqujbeizw.servidos.lat"; + url = "http://192.168.1.100:9091"; in { icon = "${name}.png"; href = url; widget = { type = name; - url = "http://192.168.1.100:9091"; + url = url; username = "{{HOMEPAGE_VAR_QBIT_USERNAME}}"; password = "{{HOMEPAGE_VAR_QBIT_PASSWORD}}"; }; @@ -165,7 +165,7 @@ sabnzbd = let name = "sabnzbd"; - url = "https://HSoeJdGRd2Orj0n31UGI.servidos.lat"; + url = "http://192.168.1.69:3399"; in { icon = "${name}.png"; diff --git a/modules/servers/maloja.nix b/modules/servers/maloja.nix index a450a3e..3b513bf 100644 --- a/modules/servers/maloja.nix +++ b/modules/servers/maloja.nix @@ -2,19 +2,19 @@ lib, config, proxyReverse, + setup, ... }: let - port = 42010; - url = "maloja.${config.my.domain}"; + cfg = config.my.servers.maloja; in { - options.my.servers.maloja.enable = lib.mkEnableOption "enable"; - config = lib.mkIf config.my.servers.maloja.enable { + options.my.servers.maloja = setup.mkOptions "maloja" "maloja" 42010; + config = lib.mkIf cfg.enable { sops.secrets.maloja.sopsFile = ../../secrets/env.yaml; virtualisation.oci-containers.containers.maloja = { image = "krateng/maloja"; - ports = [ "${toString port}:${toString port}" ]; + ports = [ "${toString cfg.port}:${toString cfg.port}" ]; environmentFiles = [ config.sops.secrets.maloja.path ]; environment = { TZ = "America/Mexico_City"; @@ -28,10 +28,10 @@ in labels = { "flame.type" = "application"; "flame.name" = "Maloja"; - "flame.url" = url; + "flame.url" = cfg.url; "flame.icon" = "bookmark-music"; }; }; - services.nginx.virtualHosts."${url}" = proxyReverse port // { }; + services.nginx.virtualHosts."${cfg.host}" = proxyReverse cfg.port // { }; }; } diff --git a/modules/servers/multi-scrobbler.nix b/modules/servers/multi-scrobbler.nix index ed882ca..2cb3459 100644 --- a/modules/servers/multi-scrobbler.nix +++ b/modules/servers/multi-scrobbler.nix @@ -1,13 +1,7 @@ -{ - lib, - config, - proxyReverse, - ... -}: +{ lib, config, ... }: let port = 9078; - domain = "scrobble.${config.my.domain}"; - url = "https://${domain}"; + url = "http://${config.my.miniserver-ip}:${toString port}"; in { options.my.servers.multi-scrobbler.enable = lib.mkEnableOption "enable"; @@ -23,7 +17,7 @@ in PGID = "100"; BASE_URL = url; DEEZER_REDIRECT_URI = "http://${config.my.miniserver-ip}:${toString port}/deezer/callback"; - MALOJA_URL = "http://maloja:42010"; + MALOJA_URL = config.my.servers.maloja.url; WS_ENABLE = "true"; }; volumes = [ "${config.my.containerData}/multi-scrobbler:/config" ]; @@ -34,6 +28,5 @@ in "flame.icon" = "broadcast"; }; }; - services.nginx.virtualHosts."${domain}" = proxyReverse port // { }; }; } diff --git a/modules/servers/qbittorrent.nix b/modules/servers/qbittorrent.nix index 20b214b..8013b98 100644 --- a/modules/servers/qbittorrent.nix +++ b/modules/servers/qbittorrent.nix @@ -2,7 +2,6 @@ lib, config, pkgs, - proxyReverse, ... }: let @@ -98,7 +97,6 @@ in }; }; }; - services.nginx.virtualHosts."xfwmrle6h6skqujbeizw.${config.my.domain}" = proxyReverse port // { }; networking.firewall = { allowedTCPPorts = ports; allowedUDPPorts = ports; diff --git a/modules/servers/sabnzbd.nix b/modules/servers/sabnzbd.nix index 3f91f14..0d3861c 100644 --- a/modules/servers/sabnzbd.nix +++ b/modules/servers/sabnzbd.nix @@ -1,19 +1,11 @@ -{ - lib, - config, - proxyReverse, - ... -}: +{ lib, config, ... }: { options.my.servers.sabnzbd.enable = lib.mkEnableOption "enable"; config = lib.mkIf config.my.servers.sabnzbd.enable { - services = { - sabnzbd = { - enable = true; - group = "piracy"; - openFirewall = true; - }; - nginx.virtualHosts."HSoeJdGRd2Orj0n31UGI.${config.my.domain}" = proxyReverse 3399 // { }; + services.sabnzbd = { + enable = true; + group = "piracy"; + openFirewall = true; }; }; }