Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d882dbee24 | ||
|
|
d789d505e3 |
@@ -0,0 +1,46 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
prowlarr_add_bulk_indexer.sh: |
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# install package with apk
|
||||||
|
apk add curl jq
|
||||||
|
# Base URL and API key
|
||||||
|
BASE_URL="https://prowlarr.tryton.geeraert.eu"
|
||||||
|
API_KEY="0cb77d794ab74f158daaae044ab850ee"
|
||||||
|
|
||||||
|
APP_PROFILE_ID=1 # Set this to a valid App Profile Id
|
||||||
|
|
||||||
|
# Get the list of all available indexers
|
||||||
|
available_indexers=$(curl -s -X GET "$BASE_URL/api/v1/indexer/schema" \
|
||||||
|
-H "accept: application/json" \
|
||||||
|
-H "X-Api-Key: $API_KEY")
|
||||||
|
|
||||||
|
# Loop through each indexer and add it to Prowlarr
|
||||||
|
echo "$available_indexers" | jq -c '.[]' | while read -r indexer; do
|
||||||
|
indexer_name=$(echo "$indexer" | jq -r '.name')
|
||||||
|
indexer_settings=$(echo "$indexer" | jq -c '.')
|
||||||
|
|
||||||
|
# Add the AppProfileId to the indexer settings
|
||||||
|
indexer_settings=$(echo "$indexer_settings" | jq --argjson appProfileId "$APP_PROFILE_ID" '. + {AppProfileId: $appProfileId}')
|
||||||
|
|
||||||
|
echo "Adding indexer: $indexer_name"
|
||||||
|
|
||||||
|
curl -s -X POST "$BASE_URL/api/v1/indexer" \
|
||||||
|
-H "accept: application/json" \
|
||||||
|
-H "X-Api-Key: $API_KEY" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "$indexer_settings"
|
||||||
|
|
||||||
|
echo "Indexer $indexer_name added."
|
||||||
|
done
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
kubectl.kubernetes.io/last-applied-configuration: |
|
||||||
|
{"apiVersion":"v1","data":{"prowlarr_add_bulk_indexer.sh":"#!/bin/bash\n\n# Base URL and API key\nBASE_URL=\"https://prowlarr.tryton.geeraert.eu\"\nAPI_KEY=\"0cb77d794ab74f158daaae044ab850ee\"\n\nAPP_PROFILE_ID=1 # Set this to a valid App Profile Id\n\n# Get the list of all available indexers\navailable_indexers=$(curl -s -X GET \"$BASE_URL/api/v1/indexer/schema\" \\\n -H \"accept: application/json\" \\\n -H \"X-Api-Key: $API_KEY\")\n\n# Loop through each indexer and add it to Prowlarr\necho \"$available_indexers\" | jq -c '.[]' | while read -r indexer; do\n indexer_name=$(echo \"$indexer\" | jq -r '.name')\n indexer_settings=$(echo \"$indexer\" | jq -c '.')\n\n # Add the AppProfileId to the indexer settings\n indexer_settings=$(echo \"$indexer_settings\" | jq --argjson appProfileId \"$APP_PROFILE_ID\" '. + {AppProfileId: $appProfileId}')\n\n echo \"Adding indexer: $indexer_name\"\n\n curl -s -X POST \"$BASE_URL/api/v1/indexer\" \\\n -H \"accept: application/json\" \\\n -H \"X-Api-Key: $API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d \"$indexer_settings\"\n\n echo \"Indexer $indexer_name added.\"\ndone\n"},"kind":"ConfigMap","metadata":{"annotations":{},"creationTimestamp":null,"name":"prowlarr-add-bulk-indexer","namespace":"servarr"}}
|
||||||
|
creationTimestamp: "2025-02-24T14:53:38Z"
|
||||||
|
name: prowlarr-add-bulk-indexer
|
||||||
|
namespace: servarr
|
||||||
|
resourceVersion: "101531049"
|
||||||
|
uid: daa8c869-779c-49f2-a2ca-bad2d6d77035
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: prowlarr-bulk-add-indexers
|
||||||
|
namespace: servarr
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: prowlarr-bulk-add-indexers
|
||||||
|
image: alpine
|
||||||
|
imagePullPolicy: Always
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /config
|
||||||
|
name: scripts
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- /config/prowlarr_add_bulk_indexer.sh
|
||||||
|
# command: ["chmod","+x","/config/prowlarr_add_bulk_indexer.sh",";","./config/prowlarr_add_bulk_indexer.sh"]
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
defaultMode: 365
|
||||||
|
name: prowlarr-add-bulk-indexer
|
||||||
|
name: scripts
|
||||||
|
backoffLimit: 4
|
||||||
|
|
||||||
Reference in New Issue
Block a user