feat: self-update from Gitea and JSON-RPC id type fix (1.5.0)
- Scheduled task "eMCPy: Nach Updates suchen" (daily + startup) reads releases/latest.json, downloads only newer versions from the same host, verifies SHA256, assembly name and version, backs up the old DLL outside the plugins folder, swaps atomically and reports a pending restart. HTTPS (or HTTP to private IPs) only, no redirects, size limits, Gitea token sent only to the feed host and never stored or returned. - Config page section for auto update; status in emby_plugins. - scripts/make-release.sh builds releases/<v> and the update feed. - JSON-RPC responses keep the request id's type (Emby's serializer turned numeric ids into strings). - 1.5.0 package rebuilt (not yet installed anywhere). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
60e4a66952
commit
7c7d384933
16 files changed
+603
-8
No files matched your search
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
# Baut ein Release und aktualisiert den Update-Feed für das eMCPy-Selbst-Update.
|
||||
# scripts/make-release.sh "Kurze Änderungsnotiz"
|
||||
# Version kommt aus src/eMCPy/eMCPy.csproj (<Version>). Vorher dort erhöhen.
|
||||
# Danach committen und pushen; Server mit eMCPy >= 1.5.0 holen die Version bei der nächsten Prüfung.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
notes="${1:-}"
|
||||
version="$(sed -n 's:.*<Version>\(.*\)</Version>.*:\1:p' src/eMCPy/eMCPy.csproj | head -1)"
|
||||
[ -n "$version" ] || { echo "Version nicht gefunden" >&2; exit 1; }
|
||||
if [ -e "releases/$version/eMCPy.dll" ]; then echo "releases/$version existiert bereits – Version erhöhen." >&2; exit 1; fi
|
||||
|
||||
dotnet run --project tests/eMCPy.Tests
|
||||
rm -rf dist
|
||||
dotnet publish src/eMCPy/eMCPy.csproj -c Release -o dist >/dev/null
|
||||
mkdir -p "releases/$version"
|
||||
cp dist/eMCPy.dll "releases/$version/eMCPy.dll"
|
||||
if command -v sha256sum >/dev/null; then sha="$(sha256sum "releases/$version/eMCPy.dll" | cut -d' ' -f1)"; else sha="$(shasum -a 256 "releases/$version/eMCPy.dll" | cut -d' ' -f1)"; fi
|
||||
echo "$sha eMCPy.dll" > "releases/$version/SHA256SUMS"
|
||||
|
||||
python3 - "$version" "$sha" "$notes" <<'PY'
|
||||
import json, sys
|
||||
version, sha, notes = sys.argv[1:4]
|
||||
feed = {"version": version, "url": f"{version}/eMCPy.dll", "sha256": sha, "minServerVersion": "4.9.0.0", "notes": notes}
|
||||
with open("releases/latest.json", "w", encoding="utf-8") as f:
|
||||
json.dump(feed, f, ensure_ascii=False, indent=2); f.write("\n")
|
||||
PY
|
||||
[ -e "releases/$version/INSTALL.md" ] || printf '# eMCPy %s\n\n%s\n\nInstallation automatisch über „eMCPy: Nach Updates suchen“ (danach Emby neu starten) oder manuell: DLL nach plugins/ kopieren, Emby neu starten.\n' "$version" "$notes" > "releases/$version/INSTALL.md"
|
||||
echo "Release $version gebaut, SHA256 $sha, releases/latest.json aktualisiert."
|
||||
Reference in new issue
Block a user