fix setup
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{ config, containerCfg, pkgs, lib, builder, name, ... }:
|
{ config, containerCfg, pkgs, lib, builder, name, ... }:
|
||||||
let
|
let
|
||||||
serverCfg = config.syscfg.server;
|
serverCfg = config.syscfg.server;
|
||||||
defaultModules = ["prowlarr" "sonarr" "radarr" "lidarr" "flaresolverr" ];
|
defaultModules = ["prowlarr" "sonarr" "radarr" "flaresolverr" ];
|
||||||
|
|
||||||
mkServarrImage = appName: appPkg: binaryPath: pkgs.dockerTools.streamLayeredImage {
|
mkServarrImage = appName: appPkg: binaryPath: pkgs.dockerTools.streamLayeredImage {
|
||||||
name = appPkg.name;
|
name = appPkg.name;
|
||||||
@@ -37,6 +37,7 @@ in
|
|||||||
{ path = "${serverCfg.configPath}/servarr/prowlarr"; mode = "0755"; }
|
{ path = "${serverCfg.configPath}/servarr/prowlarr"; mode = "0755"; }
|
||||||
{ path = "${serverCfg.configPath}/servarr/radarr"; mode = "0755"; }
|
{ path = "${serverCfg.configPath}/servarr/radarr"; mode = "0755"; }
|
||||||
{ path = "${serverCfg.configPath}/servarr/sonarr"; mode = "0755"; }
|
{ path = "${serverCfg.configPath}/servarr/sonarr"; mode = "0755"; }
|
||||||
|
{ path = "${serverCfg.configPath}/servarr/lidarr"; mode = "0755"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
containers = {
|
containers = {
|
||||||
@@ -106,6 +107,28 @@ in
|
|||||||
overrides.volumes = sharedVolumes ++ [ "${serverCfg.configPath}/servarr/sonarr:/config" ];
|
overrides.volumes = sharedVolumes ++ [ "${serverCfg.configPath}/servarr/sonarr:/config" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}// lib.optionalAttrs (builtins.elem "lidarr" (containerCfg.extra.modules or defaultModules)) {
|
||||||
|
lidarr = builder.mkContainer {
|
||||||
|
subdomain = containerCfg.subdomain;
|
||||||
|
subpath = "lidarr";
|
||||||
|
imageStream = images.lidarr;
|
||||||
|
port = 8989;
|
||||||
|
secret = name;
|
||||||
|
extraEnv = {
|
||||||
|
LIDARR__APP__INSTANCENAME = "Lidarr";
|
||||||
|
LIDARR__AUTH__METHOD = "External";
|
||||||
|
LIDARR__SERVER__PORT = "8989";
|
||||||
|
LIDARR__SERVER__URLBASE = "/lidarr";
|
||||||
|
LIDARR__LOG__ANALYTICSENABLED = "False";
|
||||||
|
};
|
||||||
|
extraOptions = [
|
||||||
|
"--user=0:0"
|
||||||
|
"--tmpfs=/tmp:rw,noexec,nosuid,size=512m"
|
||||||
|
"--passwd-entry=root:x:0:0:root:/root:/bin/sh"
|
||||||
|
];
|
||||||
|
overrides.volumes = sharedVolumes ++ [ "${serverCfg.configPath}/servarr/lidarr:/config" ];
|
||||||
|
};
|
||||||
|
|
||||||
}// lib.optionalAttrs (builtins.elem "readarr" (containerCfg.extra.modules or defaultModules)) {
|
}// lib.optionalAttrs (builtins.elem "readarr" (containerCfg.extra.modules or defaultModules)) {
|
||||||
readarr = throw "Not Implemented";
|
readarr = throw "Not Implemented";
|
||||||
}// lib.optionalAttrs (builtins.elem "mylarr" (containerCfg.extra.modules or defaultModules)) {
|
}// lib.optionalAttrs (builtins.elem "mylarr" (containerCfg.extra.modules or defaultModules)) {
|
||||||
@@ -160,27 +183,34 @@ in
|
|||||||
-d '{"syncLevel":"fullSync","enable":true,"fields":[{"name":"prowlarrUrl","value":"http://servarr-prowlarr:8989/prowlarr"},{"name":"baseUrl","value":"http://servarr-sonarr:8989/sonarr"},{"name":"apiKey","value":"'"$SONARR__AUTH__APIKEY"'"},{"name":"syncCategories","value":[5000,5010,5020,5030,5040,5045,5050,5090]},{"name":"animeSyncCategories","value":[5070]},{"name":"syncAnimeStandardFormatSearch","value":true},{"name":"syncRejectBlocklistedTorrentHashesWhileGrabbing","value":false}],"implementationName":"Sonarr","implementation":"Sonarr","configContract":"SonarrSettings","infoLink":"https://wiki.servarr.com/prowlarr/supported#sonarr","tags":[],"name":"Sonarr"}'
|
-d '{"syncLevel":"fullSync","enable":true,"fields":[{"name":"prowlarrUrl","value":"http://servarr-prowlarr:8989/prowlarr"},{"name":"baseUrl","value":"http://servarr-sonarr:8989/sonarr"},{"name":"apiKey","value":"'"$SONARR__AUTH__APIKEY"'"},{"name":"syncCategories","value":[5000,5010,5020,5030,5040,5045,5050,5090]},{"name":"animeSyncCategories","value":[5070]},{"name":"syncAnimeStandardFormatSearch","value":true},{"name":"syncRejectBlocklistedTorrentHashesWhileGrabbing","value":false}],"implementationName":"Sonarr","implementation":"Sonarr","configContract":"SonarrSettings","infoLink":"https://wiki.servarr.com/prowlarr/supported#sonarr","tags":[],"name":"Sonarr"}'
|
||||||
fi
|
fi
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${lib.optionalString (builtins.elem "lidarr" (containerCfg.extra.modules or defaultModules)) ''
|
${lib.optionalString (builtins.elem "lidarr" (containerCfg.extra.modules or defaultModules)) ''
|
||||||
if ! echo "$PROWL_APPS" | ${pkgs.jq}/bin/jq -e 'any(.[]? ; .name == "Lidarr")' > /dev/null; then
|
if ! echo "$PROWL_APPS" | ${pkgs.jq}/bin/jq -e 'any(.[]? ; .name == "Lidarr")' > /dev/null; then
|
||||||
echo "Prowlarr Setup - Lidarr"
|
echo "Prowlarr Setup - Lidarr"
|
||||||
${pkgs.curl}/bin/curl -s -X POST "$PROWLARR_URL/api/v1/applications" \
|
${pkgs.curl}/bin/curl -s -X POST "$PROWLARR_URL/api/v1/applications" \
|
||||||
-H "X-Api-Key: $PROWLARR__AUTH__APIKEY" -H 'X-Prowlarr-Client: true' \
|
-H "X-Api-Key: $PROWLARR__AUTH__APIKEY" -H 'X-Prowlarr-Client: true' \
|
||||||
-H 'Accept: application/json' -H 'Content-Type: application/json' \
|
-H 'Accept: application/json' -H 'Content-Type: application/json' \
|
||||||
-d '{"syncLevel":"fullSync","enable":true,"fields":[{"name":"prowlarrUrl","value":"http://servarr-prowlarr:8989/prowlarr"},{"name":"baseUrl","value":"http://servarr-lidarr:8989/lidarr"},{"name":"apiKey","value":"'"$LIDARR__AUTH__APIKEY"'"},{"name":"syncCategories","value":[5000,5010,5020,5030,5040,5045,5050,5090]},{"name":"animeSyncCategories","value":[5070]},{"name":"syncAnimeStandardFormatSearch","value":true},{"name":"syncRejectBlocklistedTorrentHashesWhileGrabbing","value":false}],"implementationName":"Lidarr","implementation":"Lidarr","configContract":"LidarrSettings","infoLink":"https://wiki.servarr.com/prowlarr/supported#lidarr","tags":[],"name":"Lidarr"}'
|
-d '{"syncLevel":"fullSync","enable":true,"fields":[{"name":"prowlarrUrl","value":"http://servarr-prowlarr:8989/prowlarr"},{"name":"baseUrl","value":"http://servarr-lidarr:8989/lidarr"},{"name":"apiKey","value":"'"$LIDARR__AUTH__APIKEY"'"},{"name":"syncCategories","value":[3000,3010,3030,3040,3050,3060]},{"name":"syncRejectBlocklistedTorrentHashesWhileGrabbing","value":false}],"implementationName":"Lidarr","implementation":"Lidarr","configContract":"LidarrSettings","infoLink":"https://wiki.servarr.com/prowlarr/supported#lidarr","tags":[],"name":"Lidarr"}'
|
||||||
fi
|
fi
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${lib.optionalString (builtins.elem "radarr" (containerCfg.extra.modules or defaultModules)) ''
|
${lib.optionalString (builtins.elem "radarr" (containerCfg.extra.modules or defaultModules)) ''
|
||||||
if ! echo "$PROWL_APPS" | ${pkgs.jq}/bin/jq -e 'any(.[]? ; .name == "Radarr")' > /dev/null; then
|
if ! echo "$PROWL_APPS" | ${pkgs.jq}/bin/jq -e 'any(.[]? ; .name == "Radarr")' > /dev/null; then
|
||||||
echo "Prowlarr Setup - Radarr"
|
echo "Prowlarr Setup - Radarr"
|
||||||
${pkgs.curl}/bin/curl -s -X POST "$PROWLARR_URL/api/v1/applications" \
|
${pkgs.curl}/bin/curl -s -X POST "$PROWLARR_URL/api/v1/applications" \
|
||||||
-H "X-Api-Key: $PROWLARR__AUTH__APIKEY" -H 'X-Prowlarr-Client: true' \
|
-H "X-Api-Key: $PROWLARR__AUTH__APIKEY" -H 'X-Prowlarr-Client: true' \
|
||||||
-H 'Accept: application/json' -H 'Content-Type: application/json' \
|
-H 'Accept: application/json' -H 'Content-Type: application/json' \
|
||||||
-d '{"syncLevel":"fullSync","enable":true,"fields":[{"name":"prowlarrUrl","value":"http://servarr-prowlarr:8989/prowlarr"},{"name":"baseUrl","value":"http://servarr-radarr:8989/radarr"},{"name":"apiKey","value":"'"$RADARR__AUTH__APIKEY"'"},{"name":"syncCategories","value":[5000,5010,5020,5030,5040,5045,5050,5090]},{"name":"animeSyncCategories","value":[5070]},{"name":"syncAnimeStandardFormatSearch","value":true},{"name":"syncRejectBlocklistedTorrentHashesWhileGrabbing","value":false}],"implementationName":"Radarr","implementation":"Radarr","configContract":"RadarrSettings","infoLink":"https://wiki.servarr.com/prowlarr/supported#lidarr","tags":[],"name":"Radarr"}'
|
-d '{"syncLevel":"fullSync","enable":true,"fields":[{"name":"prowlarrUrl","value":"http://servarr-prowlarr:8989/prowlarr"},{"name":"baseUrl","value":"http://servarr-radarr:8989/radarr"},{"name":"apiKey","value":"'"$RADARR__AUTH__APIKEY"'"},{"name":"syncCategories","value":[2000,2010,2020,2030,2040,2045,2050,2060,2070,2080,2090]},{"name":"syncRejectBlocklistedTorrentHashesWhileGrabbing","value":false}],"implementationName":"Radarr","implementation":"Radarr","configContract":"RadarrSettings","infoLink":"https://wiki.servarr.com/prowlarr/supported#radarr","tags":[],"name":"Radarr"}'
|
||||||
|
fi
|
||||||
|
''}
|
||||||
|
${lib.optionalString (builtins.elem "mylarr" (containerCfg.extra.modules or defaultModules)) ''
|
||||||
|
if ! echo "$PROWL_APPS" | ${pkgs.jq}/bin/jq -e 'any(.[]? ; .name == "Mylar")' > /dev/null; then
|
||||||
|
echo "Prowlarr Setup - Mylarr"
|
||||||
|
fi
|
||||||
|
''}
|
||||||
|
${lib.optionalString (builtins.elem "readarr" (containerCfg.extra.modules or defaultModules)) ''
|
||||||
|
if ! echo "$PROWL_APPS" | ${pkgs.jq}/bin/jq -e 'any(.[]? ; .name == "Readarr")' > /dev/null; then
|
||||||
|
echo "Prowlarr Setup - Readarr"
|
||||||
fi
|
fi
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${lib.optionalString (serverCfg.containers?transmission ) ''
|
${lib.optionalString (serverCfg.containers?transmission ) ''
|
||||||
PROWL_DL=$(${pkgs.curl}/bin/curl -s -X GET "$PROWLARR_URL/api/v1/downloadclient" \
|
PROWL_DL=$(${pkgs.curl}/bin/curl -s -X GET "$PROWLARR_URL/api/v1/downloadclient" \
|
||||||
-H "X-Api-Key: $PROWLARR__AUTH__APIKEY" -H 'X-Prowlarr-Client: true' \
|
-H "X-Api-Key: $PROWLARR__AUTH__APIKEY" -H 'X-Prowlarr-Client: true' \
|
||||||
|
|||||||
Reference in New Issue
Block a user