This commit is contained in:
soraefir
2026-05-20 20:05:52 +02:00
parent f24102d752
commit 6f8c8c92f1

View File

@@ -131,14 +131,15 @@ in
${lib.optionalString (builtins.elem "prowlarr" (containerCfg.extra.modules or defaultModules)) '' ${lib.optionalString (builtins.elem "prowlarr" (containerCfg.extra.modules or defaultModules)) ''
echo "Prowlarr Setup - START"
PROWLARR_URL="https://${containerCfg.subdomain}.${serverCfg.domain}/prowlarr" PROWLARR_URL="https://${containerCfg.subdomain}.${serverCfg.domain}/prowlarr"
${lib.optionalString (builtins.elem "flaresolverr" (containerCfg.extra.modules or defaultModules)) '' ${lib.optionalString (builtins.elem "flaresolverr" (containerCfg.extra.modules or defaultModules)) ''
PROWL_PROXY=$(${pkgs.curl}/bin/curl -s -X GET "$PROWLARR_URL/api/v1/indexerProxy" \ PROWL_PROXY=$(${pkgs.curl}/bin/curl -s -X GET "$PROWLARR_URL/api/v1/indexerProxy" \
-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')
${pkgs.curl}/bin/curl -s -X POST '$PROWLARR_URL/api/v1/indexerProxy' \ echo "Prowlarr Setup - FlareSolverr"
${pkgs.curl}/bin/curl -s -X POST "$PROWLARR_URL/api/v1/indexerProxy" \
-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 '{"onHealthIssue":false,"supportsOnHealthIssue":false,"includeHealthWarnings":false,"name":"FlareSolverr","fields":[{"name":"host","value":"http://servarr-flaresolverr:8191/"},{"name":"requestTimeout","value":60}],"implementationName":"FlareSolverr","implementation":"FlareSolverr","configContract":"FlareSolverrSettings","infoLink":"https://wiki.servarr.com/prowlarr/supported#flaresolverr","tags":[]}' -d '{"onHealthIssue":false,"supportsOnHealthIssue":false,"includeHealthWarnings":false,"name":"FlareSolverr","fields":[{"name":"host","value":"http://servarr-flaresolverr:8191/"},{"name":"requestTimeout","value":60}],"implementationName":"FlareSolverr","implementation":"FlareSolverr","configContract":"FlareSolverrSettings","infoLink":"https://wiki.servarr.com/prowlarr/supported#flaresolverr","tags":[]}'
@@ -150,6 +151,7 @@ in
${lib.optionalString (builtins.elem "sonarr" (containerCfg.extra.modules or defaultModules)) '' ${lib.optionalString (builtins.elem "sonarr" (containerCfg.extra.modules or defaultModules)) ''
if ! echo "$PROWL_APPS" | ${pkgs.jq}/bin/jq -e 'any(.[]? ; .name == "Sonarr")' > /dev/null; then if ! echo "$PROWL_APPS" | ${pkgs.jq}/bin/jq -e 'any(.[]? ; .name == "Sonarr")' > /dev/null; then
echo "Prowlarr Setup - Sonarr"
${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' \
@@ -159,6 +161,7 @@ in
${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"
${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' \
@@ -168,6 +171,7 @@ in
${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"
${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' \
@@ -181,6 +185,7 @@ in
-H 'Accept: application/json' -H 'Content-Type: application/json') -H 'Accept: application/json' -H 'Content-Type: application/json')
if ! echo "$PROWL_DL" | ${pkgs.jq}/bin/jq -e 'any(.[]? ; .name == "Transmission")' > /dev/null; then if ! echo "$PROWL_DL" | ${pkgs.jq}/bin/jq -e 'any(.[]? ; .name == "Transmission")' > /dev/null; then
echo "Prowlarr Setup - Transmission"
${pkgs.curl}/bin/curl -s -X POST "$PROWLARR_URL/api/v1/downloadclient" \ ${pkgs.curl}/bin/curl -s -X POST "$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' \
-H 'Accept: application/json' -H 'Content-Type: application/json' \ -H 'Accept: application/json' -H 'Content-Type: application/json' \
@@ -188,6 +193,7 @@ in
fi fi
''} ''}
echo "Prowlarr Setup - Indexers"
PROWL_IDX=$(${pkgs.curl}/bin/curl -s -X GET "$PROWLARR_URL/api/v1/indexer" \ PROWL_IDX=$(${pkgs.curl}/bin/curl -s -X GET "$PROWLARR_URL/api/v1/indexer" \
-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')