feat: 3-channel model (stable open / beta + dev key-gated)

Channels:
  stable -> branch main  (open, no key)
  beta   -> branch beta  (release candidate, key-gated)
  dev    -> branch dev    (active development, key-gated)

beta and dev require PHOBOS_KEY (subscriber key distributed via Boosty);
only the sha256 hash is embedded in install.sh / update.sh. stable stays
open. install.sh honours CHANNEL=stable|beta|dev; phobos-update accepts
stable|beta|dev|<tag> and gates the closed channels. --check now lists all
three channels with a [закрыт ключом] marker.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Андрей Бобырев
2026-05-31 00:58:06 +03:00
parent dc83d90a35
commit 8c1654ecaa
2 changed files with 35 additions and 4 deletions

View File

@@ -67,7 +67,9 @@ case "${1:-}" in
echo "Установлено: $CUR"
echo "Стабильная: $(latest_version)"
beta=$(curl -fsSL -m8 "$RAW/beta/VERSION" 2>/dev/null | tr -d ' \r\n')
[ -n "$beta" ] && echo "Бета (beta): $beta"
[ -n "$beta" ] && echo "Бета (beta): $beta [закрыт ключом]"
dev=$(curl -fsSL -m8 "$RAW/dev/VERSION" 2>/dev/null | tr -d ' \r\n')
[ -n "$dev" ] && echo "Разработка(dev):$dev [закрыт ключом]"
;;
--versions|--tags)
echo "Доступные версии (git tags):"
@@ -91,7 +93,20 @@ case "${1:-}" in
echo "Откат выполнен -> $fromver"
;;
*)
ref="${1:-main}"; [ "$ref" = "latest" ] && ref="main"
ref="${1:-main}"
case "$ref" in latest|stable) ref="main";; esac
# Каналы beta/dev закрыты ключом подписчика PHOBOS_KEY (Boosty)
case "$ref" in
beta|dev|*-beta|*-dev)
_got=$(printf %s "${PHOBOS_KEY:-}" | { sha256sum 2>/dev/null || shasum -a 256; } | cut -d' ' -f1)
if [ "$_got" != "cb3ce498b8d2c67ec7b57a9b08ed2fb410c881bcb9bc9cf50d09be1d9727333a" ]; then
echo "Канал '$ref' закрыт (бета/разработка). Нужен ключ подписчика:"
echo " PHOBOS_KEY=ваш_ключ phobos-update $ref"
echo "Ключ — по подписке: https://boosty.to/andrey27 . Стабильная: phobos-update stable"
exit 1
fi
;;
esac
if ! ref_exists "$ref"; then
echo "Версия/ветка '$ref' не найдена на GitHub. Обновление отменено (текущая $CUR не тронута)."
echo "Доступные: phobos-update --versions · стабильная: $(latest_version)"