Files
Piik/docs/operations/github.md
T
AAA 89a03e6470 fix(app): improve capture selection and media recovery (#433)
## Problem and outcome / 问题与结果

This maintenance phase fixes failures around native capture startup, room reconnection and media handoffs. Capture mutations stay cancellable, relayed-content failures remain request-scoped, and failed media connections return to the existing route controller. Windows Auto codec selection measures delivered cadence instead of timer-sensitive per-frame work estimates.

The phase preserves P2P-first routing, one committed graph and one route operation. It adds no signaling replay mechanism, changes no wire/schema version, and includes no interaction prototype or 4K feature work.

## Release notes

### 中文

Piik v1.6.8 是一次稳定性修复,重点改善 Windows 原生采集、断线恢复和分享过程中的控制响应。

#### 修复与改善

- **更准确地选择编码器。** Windows 的自动模式按实际出帧表现评估 H.264,并正确区分启动预热和持续性能不足,减少计时误差导致的不必要 VP8 回退。硬件编码事件改为异步等待。
- **改善断线与线路切换。** 房间信令短暂断开后保留观众成员身份 20 秒;修复线路切换、SFU 订阅恢复及声音重协商卡住的问题。失效连接及时交回现有路由控制器处理,原生 SFU 发送端不再把短暂断连直接判为终止。
- **保持 App 控制响应。** 开始分享和更换来源时仍可取消操作;合法消息突发不再直接关闭控制连接。中继信令的单条内容错误不会连带结束整场原生分享。
- **修正设备列表与配置保存。** 来源或麦克风数量达到上限时保留可用列表;配置替换失败时保留原有设置。
- **改善紧凑布局和辅助功能。** 调整手机横屏下的画面与播控布局、画质预设标签和长邀请链接显示,修正部分提示与辅助功能语义。
- **加强站点访问保护。** 站点登录 Cookie 使用独立随机签名密钥,应用自身阻止被其他页面嵌套。发布说明也会在合并前检查。

#### 升级说明

通信协议和持久化格式保持不变。设置了站点密码时,App 或 Server 重启后需要重新输入站点密码;持久化房间和邀请授权不受这项 Cookie 调整影响。Piik 操作页面不再支持嵌入 iframe。

### English

Piik v1.6.8 is a stability update focused on Windows native capture, connection recovery and responsive sharing controls.

#### Fixes and improvements

- **More accurate codec selection.** Windows Auto mode evaluates H.264 using delivered frames and distinguishes startup warmup from sustained performance limits, reducing unnecessary VP8 fallback caused by timing noise. Hardware encoder events now use asynchronous waiting.
- **Improved reconnection and route handoffs.** Viewer membership survives brief signaling outages for 20 seconds. Fixes cover route activation, SFU subscription recovery and stalled audio renegotiation. Failed connections return to the existing route controller, and the native SFU publisher no longer treats a transient disconnect as immediate termination.
- **Responsive App controls.** Starting a share and replacing its source remain cancellable. Valid message bursts no longer close the control connection, and an invalid relayed payload cannot terminate the entire native sharing session.
- **Device lists and saved settings.** Source and microphone enumeration retain a usable list at their limits. Failed configuration replacement preserves the previous settings.
- **Compact layouts and accessibility.** Improved picture and playback-control layout on landscape phones, quality preset labels and long invitation links, with corrected tooltip and accessibility semantics.
- **Stronger site-access protection.** Login cookies use an independent random signing key, and the application prevents embedding by other pages. Release notes are also checked before merge.

#### Upgrade notes

Wire protocols and persistent formats are unchanged. If a site password is configured, restarting the App or Server requires entering it again; this cookie change does not revoke persisted rooms or invitation grants. Piik operation pages can no longer be embedded in an iframe.

## Verification / 验证

- `npm run check`: passed, 76 test files / 1,171 tests, TypeScript and production Web build.
- `npm run check:go-core`: passed; full Go/native checks also passed during integration of the capture changes. macOS cgo builds remain native-runner checks.
- Windows native Host gates: Auto, H.264 and VP8 passed during the phase; final control changes rechecked with Auto, including live/paused quality, source replacement, failure retirement and subsequent sharing.
- Embedded SFU browser VP8 recovery: passed with production Host/Viewer route owners.
- Embedded SFU native H.264, two rooms: passed, including recovered decoded video/audio, independent room retirement and resource cleanup.
- Documentation, repository hygiene and diff checks: passed. Final follow-up changes only align operations documentation with the PR note check.
- Go race checks could not run locally because no cgo/GCC toolchain is available; the existing Linux CI race job remains required. AMD/Intel hardware, broader device combinations, public-NAT field reports and long endurance are not established by these local checks.

## Impact / 影响

Compatible patch release after v1.6.7. The cookie and frame-protection effects are disclosed in the public upgrade notes. No automatic retry budget, room-code admission policy, room lifetime or media topology is replaced. Reports without matched diagnostics and unmeasured native performance costs remain in the TODO ledger.
2026-09-29 08:44:17 +08:00

7.7 KiB

GitHub Repository And Releases

Versioning owns release meaning and compatibility; CONTRIBUTING owns review and local validation. This file owns the one-time GitHub settings. The source repository is public; automatic package publication has its own activation gate below.

Main And Pull Requests

Use squash merging only, with the PR title and body as the squash commit. These repository settings are applied. Keep automatic branch deletion off: the normal cleanup step checks local worktrees and remaining references first.

Protect main with PRs required, zero mandatory peer approvals for the solo maintainer, administrator enforcement, linear history, and no force pushes or deletions. PRs run the read-only release-note check; ordinary branch pushes stay quiet. Local validation and acceptance precede the squash merge, and required check settings remain a repository-owner decision. PR/issue templates live in .github/; naming is shared with automatic version selection.

These protections are active, including conversation resolution. GitHub Pages uses the GitHub Actions publishing source and the piik.tv custom domain; the repository homepage points to https://piik.tv. The dedicated Website workflow publishes the static site under website operations.

Enable Automatic Publication Once

Before enabling, accept the release packages, compatibility baseline, public copy and repository visibility; finish main protection. Then set repository Actions variable PIIK_RELEASES_ENABLED to true. This is a repository setting, not an environment variable for Piik App or Server.

Subsequent accepted PRs merged to main use the existing CI workflow. Product changes calculate one version, validate, package Server and all App targets, and publish the same artifacts. Standalone website/docs changes validate without packaging or releasing; versioning owns that boundary. Runs queue rather than overlap or cancel one another. PRs validate release notes without packaging or publication; manual app_checks dispatch remains available for candidates. Writing a new version back to main is unnecessary and prohibited.

For a complete publisher rehearsal, dispatch with app_checks: true and an explicit candidate_version such as v1.0.0. This builds genuine Server and native App artifacts under one revision and version without tagging or publishing. Prepare its release-note section and inspect the generated preview in the run summary. For a local preview, run node scripts/release-notes.mjs v1.0.0 FULL_SOURCE_SHA from the checkout with full history and tags. Download that run's artifacts and pass their directory, version and full revision to scripts/publish-release.mjs --dry-run (put the flag after the three positional arguments). An omitted candidate version keeps the usual development/exact-tag identity.

Enable GitHub's built-in release immutability for formal publication where available. Upload all assets to the draft before publishing. A failed upload can resume its same-source draft; a published version is never clobbered. If its files are wrong or incomplete, publish a corrected new version. An older retry must not replace a newer release's latest designation.

To stop future automatic publication, remove/set false the activation variable; this does not alter existing releases or a currently running workflow. Inspect the active run separately. No pipeline step changes visibility or installs an update into a running Piik deployment.

Container Registry

The Server image uses ghcr.io/tntcrafthim/piik. The publishing job authenticates with GITHUB_TOKEN and packages: write; no additional registry secret is needed. The image's source label links it to this repository. GitHub's Container registry guide owns the registry permission and visibility behavior.

At first publication, set the Piik container package's visibility to public in its GitHub package settings; repository visibility alone does not do this. Verify both its version tag and latest with an anonymous pull before announcing the Docker download. Keep repository Actions access enabled for later releases. Image checks, version identity and retries follow container distribution.

Gitee Download Mirror

TNTcraftHIM/Piik is a public README/Release mirror. Source, documentation and issues stay on GitHub. The publishing job uses the repository Actions secret GITEE_TOKEN, which is configured; rotate it there when needed. Never put it in source, a remote URL or a distributed package. GitHub publication continues to use the workflow's scoped token.

After GitHub publication, the same job runs scripts/mirror-release.mjs on the original artifacts. Upload failure leaves the Gitee release marked as a preview. Rerun the failed publishing job to verify existing files and upload only missing ones. GitHub's published release remains unchanged. Both publishers reject changing a published package; use a corrected new version if its bytes are wrong.

For a local retry, use the original complete build output retained outside the checkout. While the publishing run's artifacts are available, download all four into one directory (replace RUN_ID, FULL_SOURCE_SHA and VERSION):

for artifact in piik-server piik-app-windows-amd64 piik-app-linux-amd64 piik-app-darwin-arm64; do
  gh run download RUN_ID --repo TNTcraftHIM/Piik \
    --name "$artifact-FULL_SOURCE_SHA" --dir /tmp/piik-mirror
done
node scripts/mirror-release.mjs /tmp/piik-mirror VERSION FULL_SOURCE_SHA

Use a fresh directory. Public Release downloads contain only runtime archives; mirror verification also needs the original descriptors, manifest and checksum files. If CI artifacts have expired, recover that complete output from the operator's retained copy. Rebuilding a published version is not a metadata recovery procedure. See artifact retention.

Use the release's actual version and full target_commitish SHA, with GITEE_TOKEN supplied through the publisher environment. --dry-run after the three arguments checks local identity, checksums and attachment sizes without publishing. The release-source policy owns provenance, selection and quota limits. The first public release passed complete matching Server and three-platform App mirror download acceptance.

Release postflight applies the two-version mirror retention policy. After verifying the latest mirror and its fallback against GitHub, inventory older releases with /releases/{id}/attach_files, verify their GitHub originals, then remove only the reviewed attachments through DELETE /releases/{id}/attach_files/{attachment_id}. Recheck both retained versions and the anonymous download/latest links afterward. Keep deletion inventories and verification results with operator release records, not source history. The upload script does not itself delete older attachments.

Platform References