streamd: optional keys, per-stream proxy, auto deps; agent module.yaml sync; RTE AutoPlay; Telegram release announces
- streamd: MPD-only start, proxy field, ffmpeg/NRE/mp4decrypt auto-install - GET/PUT /api/modules for module.yaml sync; agent sync_modules - RTE Live-tab AutoPlay fixes; modules zip named bbc/rte/tg4.zip - Telegram notify scripts wired into Forgejo release workflows
This commit is contained in:
parent
f9c28be3f1
commit
ac8701b5a6
36 changed files with 1460 additions and 143 deletions
95
scripts/notify-telegram.sh
Normal file
95
scripts/notify-telegram.sh
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
#!/usr/bin/env bash
|
||||
# Post a release announce to Telegram.
|
||||
#
|
||||
# Required env:
|
||||
# TELEGRAM_BOT_TOKEN BotFather token (Forgejo secret / local env — never commit)
|
||||
# TELEGRAM_CHAT_ID Channel chat id, e.g. -1003721978702
|
||||
#
|
||||
# Optional:
|
||||
# RELEASE_TAG / first arg tag name
|
||||
# RELEASE_URL release page URL
|
||||
# RELEASE_TITLE headline override
|
||||
# RELEASE_BODY full HTML body override
|
||||
# RELEASE_KIND host | modules | auto
|
||||
# RELEASE_REPO_URL default https://git.nulldrm.com/nulldrm/Null-DRM-Official
|
||||
# DRY_RUN=1 print, do not send
|
||||
#
|
||||
# Usage:
|
||||
# TELEGRAM_BOT_TOKEN=… TELEGRAM_CHAT_ID=… ./scripts/notify-telegram.sh v0.1.2
|
||||
# TELEGRAM_BOT_TOKEN=… TELEGRAM_CHAT_ID=… ./scripts/notify-telegram.sh modules-v0.1.2
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
TAG="${1:-${RELEASE_TAG:-}}"
|
||||
if [[ -z "$TAG" ]]; then
|
||||
TAG="$(git -C "$ROOT" describe --tags --exact-match 2>/dev/null || git -C "$ROOT" describe --tags --always 2>/dev/null || true)"
|
||||
fi
|
||||
if [[ -z "$TAG" ]]; then
|
||||
echo "usage: $0 <tag>" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
TOKEN="${TELEGRAM_BOT_TOKEN:-}"
|
||||
CHAT="${TELEGRAM_CHAT_ID:-}"
|
||||
if [[ -z "$TOKEN" || -z "$CHAT" ]]; then
|
||||
echo "TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID are required" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
KIND="${RELEASE_KIND:-auto}"
|
||||
if [[ "$KIND" == "auto" ]]; then
|
||||
case "$TAG" in
|
||||
modules-v*) KIND="modules" ;;
|
||||
*) KIND="host" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
REPO_URL="${RELEASE_REPO_URL:-https://git.nulldrm.com/nulldrm/Null-DRM-Official}"
|
||||
URL="${RELEASE_URL:-${REPO_URL}/releases/tag/${TAG}}"
|
||||
|
||||
if [[ -n "${RELEASE_TITLE:-}" ]]; then
|
||||
TITLE="$RELEASE_TITLE"
|
||||
else
|
||||
TITLE="Null DRM ${TAG}"
|
||||
fi
|
||||
|
||||
if [[ -n "${RELEASE_BODY:-}" ]]; then
|
||||
BODY="$RELEASE_BODY"
|
||||
elif [[ "$KIND" == "modules" ]]; then
|
||||
BODY="<b>${TITLE}</b>
|
||||
Provider module zips: <code>bbc.zip</code>, <code>rte.zip</code>, <code>tg4.zip</code>
|
||||
|
||||
Unpack each into <code>modules/<name>/</code> and edit <code>module.yaml</code> for secrets.
|
||||
|
||||
<a href=\"${URL}\">Download ${TAG}</a>"
|
||||
else
|
||||
BODY="<b>${TITLE}</b>
|
||||
Host CLI (<code>drm</code>) + on-device MITM (<code>proxy-android-arm64</code>).
|
||||
|
||||
<a href=\"${URL}\">Download ${TAG}</a>"
|
||||
fi
|
||||
|
||||
if [[ "${DRY_RUN:-}" == "1" ]]; then
|
||||
echo "DRY_RUN chat=$CHAT tag=$TAG kind=$KIND"
|
||||
echo "----"
|
||||
echo "$BODY"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "[*] Telegram notify → chat $CHAT ($TAG)"
|
||||
RESP=$(curl -sS -X POST "https://api.telegram.org/bot${TOKEN}/sendMessage" \
|
||||
--data-urlencode "chat_id=${CHAT}" \
|
||||
--data-urlencode "text=${BODY}" \
|
||||
--data-urlencode "parse_mode=HTML" \
|
||||
--data-urlencode "disable_web_page_preview=false")
|
||||
|
||||
case "$RESP" in
|
||||
*"\"ok\":true"*|*"\"ok\": true"*)
|
||||
echo "[+] Telegram announce sent for $TAG"
|
||||
;;
|
||||
*)
|
||||
echo "Telegram API error:" >&2
|
||||
echo "$RESP" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue