Skip to content

Detect update ownership and unify update states (#413) - #487

Merged
github-actions[bot] merged 4 commits into
developerfrom
feat/413-update-ownership
Nov 11, 2026
Merged

github-actions[bot] merged 4 commits into
developerfrom
feat/413-update-ownership

Conversation

@endercodezz

Copy link
Copy Markdown
Owner

Closes #413

Что сделано

  • Тип установки: AppInstallLocator определяет его по маркерам пакетов, а не по тому, доступен ли каталог на запись:
    • Velopack — sq.version или Update.exe уровнем выше;
    • portable или старый ZIP — portable.txt или комплект релиза с engines/ и ENGINES-SHA256SUMS.txt;
    • deb — /opt/bydlo и запись dpkg;
    • Arch — /opt/bydlo и база pacman;
    • Nix — /nix/store/;
    • иначе — неизвестная установка.
  • Владелец обновлений: встроенный updater работает только для Velopack и после явного opt-in.
    • Состояния едины: доступна версия, загрузка, готово при выходе, ошибка или отложено.
    • Проверка уведомления о релизе не затирает уже скачанный пакет.
  • Установки через менеджер пакетов (apt, pacman, Nix): переключатель и кнопка «Скачать» скрыты. Показывается инструкция для конкретного менеджера, а файлы, которыми он управляет, приложение не трогает. Отдельно скачанный .deb не выдаётся за настроенный apt-репозиторий.
  • Portable: инструкция «закрыть BYDLO, заменить комплект целиком, данные сохраняются».
  • Обучение и документация: строки ru/en; README и docs (BUILD, LINUX, TESTING) описывают варианты установки и обновления.

Исправлено при ревью

  • deb определялся слишком широко. Он определялся по одной записи dpkg, и portable-копия на машине с установленным .deb считалась управляемой. Теперь нужен ещё каталог /opt/bydlo; добавлен регрессионный тест.
  • Инструкция не переводилась. При смене языка она оставалась на прежнем языке; это поймала headless-проверка --verify-auto-updates.

Проверка

  • scripts/check.ps1 с BYDLO_SAFE_DEV=1: 1688 пройдено, 0 упало.
  • Все 20 headless-проверок --verify-* в --mock зелёные.
  • Регистрация в ОС и реальные обновления не выполнялись.

Пересекается с #483 (#411) и #485 (#438) в AutomaticAppUpdater и SettingsViewModel.Updates. После мержа первого из них конфликт разрешу отдельно.

AppInstallLocator classifies the copy from package markers (Velopack,
portable/old ZIP, deb, Arch, Nix, unknown) instead of a writable path.
Only Velopack installs get the built-in updater, behind the existing
opt-in, with one state model: available, downloading, ready on exit,
failed/deferred. Package-manager installs get manager-specific manual
guidance and never write managed files; portable copies get replace-
the-folder instructions.
@github-actions
github-actions Bot enabled auto-merge November 11, 2026 18:51
Resolves conflicts with the signed catalog (#411) and first-run
consents (#438): the update state model keeps the consent gate and
shows the catalog's refusal reason in the Failed state, and the merged
tests grant consent and the Velopack install kind explicitly.

sign-update-catalog.ps1 now signs as UpdateTrustRoots.CurrentKeyId by
default and refuses a secret that does not match CurrentPublicKeySpki,
so a missed secret swap after rotation stops the release instead of
publishing a catalog clients reject. The update-key-rotation skill
documents planned rotation, compromise and a lost secret.
@endercodezz

Copy link
Copy Markdown
Owner Author

В PR влит developer с #483 (#411) и #485 (#438), конфликты разрешены. Модель состояний сохраняет проверку согласия. В состоянии Failed показывается причина отказа подписанного каталога. Тесты обоих PR дополнены согласием и InstallKind = Velopack.

Добавлен навык .claude/skills/update-key-rotation. sign-update-catalog.ps1 теперь по умолчанию подписывает как UpdateTrustRoots.CurrentKeyId и не подписывает, если секрет не совпадает с CurrentPublicKeySpki. Шаг CI «Update catalog interop» проверяет этот отказ.

Локально: 1780 тестов пройдено, 0 упало; все 20 headless-проверок --verify-* в --mock зелёные.

The signing script now defaults to UpdateTrustRoots.CurrentKeyId and
refuses keys that do not match it, so the staging regression's
throwaway key must name its own key id.
@github-actions
github-actions Bot merged commit 6f273c3 into developer Nov 11, 2026
22 checks passed
@github-actions
github-actions Bot deleted the feat/413-update-ownership branch November 11, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant