Add standalone Unraid ARR MCP package
This commit is contained in:
1 parent
588f24894d
commit
d570a06911
10 files changed
+472
-12
No files matched your search
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
# Installation innerhalb eines bereits laufenden Debian-Slim-Containers.
|
||||
# Der empfohlene, reproduzierbare Weg bleibt der Dockerfile-Build.
|
||||
set -Eeuo pipefail
|
||||
|
||||
[[ $EUID -eq 0 ]] || { echo "Bitte im Container als root ausführen." >&2; exit 1; }
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
SONARR_PATCH="$REPO_ROOT/platform/mcp/patches/mcp_sonarr.py"
|
||||
RADARR_PATCH="$REPO_ROOT/platform/mcp/patches/mcp_radarr.py"
|
||||
|
||||
[[ -f $SONARR_PATCH && -f $RADARR_PATCH ]] || {
|
||||
echo "Die Installation muss aus einem vollständigen Checkout dieses Repositories laufen." >&2
|
||||
exit 2
|
||||
}
|
||||
|
||||
need_python_packages=0
|
||||
venv_check_dir="$(mktemp -d)"
|
||||
if ! command -v python3 >/dev/null 2>&1 \
|
||||
|| ! python3 -m venv "$venv_check_dir/check" >/dev/null 2>&1; then
|
||||
need_python_packages=1
|
||||
fi
|
||||
rm -rf "$venv_check_dir"
|
||||
|
||||
if (( need_python_packages )); then
|
||||
command -v apt-get >/dev/null 2>&1 || {
|
||||
echo "Dieser Installer erwartet Debian/Ubuntu mit apt-get." >&2
|
||||
exit 3
|
||||
}
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
ca-certificates python3 python3-pip python3-venv
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
fi
|
||||
|
||||
python3 -m venv /opt/arr-mcp/venv
|
||||
/opt/arr-mcp/venv/bin/pip install --no-cache-dir --upgrade pip
|
||||
/opt/arr-mcp/venv/bin/pip install --no-cache-dir "arr-mcp[mcp]==1.0.1"
|
||||
|
||||
site_packages="$(/opt/arr-mcp/venv/bin/python -c 'import site; print(site.getsitepackages()[0])')"
|
||||
install -m 0644 "$SONARR_PATCH" "$site_packages/arr_mcp/mcp/mcp_sonarr.py"
|
||||
install -m 0644 "$RADARR_PATCH" "$site_packages/arr_mcp/mcp/mcp_radarr.py"
|
||||
install -m 0755 "$SCRIPT_DIR/run.sh" /usr/local/bin/run-arr-mcp
|
||||
|
||||
/opt/arr-mcp/venv/bin/python -m compileall -q "$site_packages/arr_mcp/mcp"
|
||||
echo "ARR-MCP ist installiert. Start: /usr/local/bin/run-arr-mcp"
|
||||
Reference in new issue
Block a user