Files
piik/docs/operations/website.md
T
AAA 4bc0fd1e41 fix(app): stabilize sharing startup and align shared controls
## Problem and outcome / 问题与结果

Windows Auto selection could spend its remaining startup budget on a probe that could not finish, recreate hardware after a successful probe, and discard the prepared codec on first relay activation. Preserve the proven encoder through the existing capture owner and keep VP8 fallback unchanged. Correct custom-port STUN survey membership without changing the published Hosted base preference or introducing a second route/retry owner.

Reject queued minimize/resize frames that no longer match the current WGC target, replacing the one-shot restoration flag that could end an active H.264 share. Align shared controls, help and appearance across the product and website. macOS audio readiness follows successful platform startup rather than the arrival of non-silent samples. The optional editorial headline is shared with the website, with English-first bilingual release copy. Room voice and multiplayer input implementations remain outside this candidate.

Related reports: #437 and #486. Their affected devices still need retesting; this does not establish that all reported driver or macOS failures have been resolved.

## Release notes

**Play together. Your turn!**

**远程同乐,轮到你啦!**

### English

This maintenance update improves sharing startup and brings common controls and guidance into line. Existing 2.x App and Site compatibility is preserved.

- Windows Auto reuses the H.264 encoder that passed its frame-rate probe, preserves it on first relay activation, and skips probes that cannot fit the remaining startup budget. Discard stale minimize/resize frames before they can end an active share.
- Fix optional NAT survey selection with custom STUN ports while preserving existing Hosted selection. Include the upstream ICE candidate-priority correction.
- Make macOS audio readiness follow successful capture startup, so a silent source does not have to produce samples before becoming ready.
- Align shared buttons, selectors, keyboard labels and status colours, and refresh the README previews. Preserve explicit theme choices between the website and documentation.
- Find the Web version, troubleshooting and browser diagnostics in Help; closing a nested hint keeps the menu actions available.
- Put English first in update notes and simplify the website's release section around the same opening headline.

### 中文

这是一次分享启动与界面一致性的维护更新,保留现有 2.x App 和站点的兼容性。

- Windows 自动编码复用通过帧率探测的 H.264 编码器,在首次转发启用时保留该实例,并跳过剩余启动时间不足以完成的探测;丢弃最小化、恢复或缩放窗口时残留的旧尺寸帧,避免它们导致分享结束。
- 修复自定义 STUN 端口下的辅助打洞采样选择,保留已有自部署站点的选择行为,并同步上游 ICE 候选优先级修正。
- macOS 音频在平台确认启动成功后就绪,静默音源无需等待产生音频采样。
- 对齐共享按钮、选择控件、键盘说明与状态颜色,更新 README 界面预览;官网和文档中心之间保留用户明确选择的主题。
- 网页版本、问题排查和浏览器诊断统一收进「帮助」;内部提示关闭后,菜单操作仍然保留。
- 更新说明改为英文在前、中文在后;官网更新区以同一份开篇主题收敛呈现。

## Verification / 验证

- Local Web type-check, unit tests and production build: passed.
- Local Go tests, vet, Windows/Linux builds and Windows native compile/probe: passed.
- Website/documentation build, repository hygiene and diff checks: passed.
- Seven media-lifecycle cases passed: all Browser/App pairings, SFU-only, and Browser/Native fallback followed by direct recovery; restart, replacement and stale-signal retirement were included.
- The first candidate CI exposed an asynchronous allocation-test wait gap. Its correction waits for the committed deficit, retaining the capacity assertion; focused repetition passed locally.
- The native Host gate and benchmark now follow the current picture settings and stable codec name/value instead of removed UI structure or localized captions.
- Non-publishing CI passed on dd208e83, including Windows, both macOS architectures, both Linux architectures and Server packages. The later Windows frame-admission correction passed the focused native suite, physical Auto/H.264 and manual VP8 window gates, and the H.264 display gate. The window checks include minimized/resize/fullscreen recovery; the display check preserves the same media through profile and source changes.
- Final UI review covered narrow/desktop layouts, both themes, header/help, sharing controls, keyboard and interaction panels, packaged Local entry and website/docs preference handoff. The compact release entry passed 320/1280 px checks in both languages and themes, including metadata-request failure.
- Final candidate e88cb236: [all-platform packages and the full paired NAT/weak-network comparison](https://github.com/TNTcraftHIM/Piik/actions/runs/39284032227).

## Impact / 影响

No signaling, native-control, capture-envelope or storage version changes. Route authority, consent, capacity and retry lifetimes remain with their existing owners. The CI allocation correction changes the test only, not production media policy.

Physical macOS capture/permissions, the affected reporter GPUs and difficult external networks remain evidence limits. The owner authorized v2.2.2 after final acceptance; the non-publishing candidate checks must pass before the publishing squash merge. Room voice remains in its isolated experiment and is not a feature claim for this release.
2026-10-20 01:15:17 +08:00

11 KiB

Public website

The website source is site/. It explains Piik; it does not run rooms, signaling or media. The public introduction guide owns its content and design boundary.

Public Destinations

Entry Destination
Website piik.tv
P2P-only demo on the separate US server demo.piik.tv
App downloads and release notes GitHub Releases
Download mirror for domestic access Gitee Releases
Documentation source Reader guides, with a separate developer map

GitHub Pages serves piik.tv behind Cloudflare; both the GitHub origin and Cloudflare edge use HTTPS. Website and Demo HTTP traffic use proxied DNS with origin cache headers respected. The separate stun.piik.tv hostname stays DNS-only for direct UDP connectivity.

GitHub Pages can serve the complete website: it hosts static HTML, CSS and JavaScript. The demo also needs the Go service for room authority, WebSocket signaling and UDP STUN, so it runs on the separate US server rather than Pages.

Managed Hosting Assessment

Reviewed 2026-10-07. Keep the current deployment for this candidate. A managed container can reduce host administration, but must preserve public UDP, stable room authority and SQLite storage. Fly.io supports public UDP with a dedicated IPv4 address and a specific UDP bind address; external and internal UDP ports must match. Its dedicated IPv4 charge is $2/month before compute, storage and transfer. This is a possible deployment target, not an established cost saving over the current server.

Cloudflare Containers disks are ephemeral by default. Snapshots or object-backed storage are not a drop-in replacement for the current live SQLite contract. No provider migration is accepted; compare the complete cost and verify storage, UDP and restart behavior before changing the Demo.

Public Demo Configuration

The chosen demo allows entry without a site password and provides P2P sharing without SFU fallback. Use the self-hosting runbook with:

PIIK_ENV=production
LISTEN_HOST=127.0.0.1
PORT=8787
PUBLIC_BASE_URL=https://demo.piik.tv
ALLOWED_ORIGINS=https://demo.piik.tv
SITE_ACCESS_PASSWORD=
ROOM_DATABASE_PATH=/var/lib/piik/rooms.sqlite
ROOM_EMPTY_TIMEOUT_SECONDS=3600
MAX_VIEWERS_PER_ROOM=20
STUN_URLS=stun:stun.piik.tv:3478
NAT_PREDICTION_ENABLED=true
SFU_UDP_PORT=

Point both hostnames at the US server: proxy demo.piik.tv through Cloudflare, but leave stun.piik.tv DNS-only. Allow UDP 3478/3479/3480 directly to the server; Cloudflare's ordinary HTTP proxy does not carry STUN. Caddy terminates origin HTTPS/WSS. The demo uses the standard systemd service, with its release under /opt/piik/current and configuration at /etc/piik/piik.env. The service unit provides the SQLite state directory. Room ownership, invitations and private-room admission still apply. The configuration reference owns each setting and its bounds.

The Demo's Caddy proxy compresses /assets/* with zstd/gzip. Successful content-hashed JavaScript and CSS responses use Cache-Control: public, max-age=31536000, immutable; other responses default to no-store. Match both the hashed filename and a successful response status so a missing bundle cannot acquire the long cache lifetime. Keep HTML, room APIs, health responses and signaling outside static caching. New bundles have new filenames; do not publish different bytes under an existing hashed URL. Cloudflare caches those static bundles; HTML and API responses remain uncached, and WebSocket signaling passes through to the same room authority. Changing the HTTP delivery path does not enable SFU or proxy peer media.

For updates, follow the application release boundary and its artifact verification, health checks and recovery rules. Routine application rollback restores the previous executable while keeping current room data. This Caddy installation needs a scoped updater; the nginx-specific maintainer wrapper does not manage it.

Preview

With the repository's development dependencies installed:

npm ci --prefix site/docs
npm run build:website
npm run preview:website

Open http://127.0.0.1:18890. Rebuild after editing source. The build bundles the film's real product components into an isolated demonstration frame; publishing build/site/ needs no Node runtime or backend. Vite preview supplies HTTP byte ranges for seeking the soundtrack. Keep asset links relative so both a custom domain and GitHub's /Piik/ project path work. For a nested deployment, set PIIK_DOCS_BASE=/Piik/docs/ when building; ordinary custom-domain builds use /docs/.

The homepage, film and demonstration frames use content-hashed script/style bundles. Their HTML references come from the same build, including imported dependencies; fixed filenames must not mix a new page with cached old controls or styles. Publish the complete output together.

Favicons share the App artwork and exports. The website build copies the public SVG/PNG/ICO assets for the homepage, film and documentation, keeping their URLs stable.

Google's favicon guidance requires a crawlable homepage and icon, and supports one favicon per hostname. The PNG/ICO links make the brand available to search crawlers; indexing and display are not guaranteed. A repository under github.com cannot set its own search favicon independently of GitHub.

Documentation Build

site/docs/ configures VitePress; its isolated package and lockfile keep document tooling out of the App/Server dependency tree. The pinned Vite override follows the VitePress maintainer's guidance to use the security-maintained Vite 6 line with stable VitePress 1. Remove the override when a stable upstream release supplies a maintained version directly.

The explicit list in site/docs/pages.mjs maps original Markdown files to public routes and sidebar labels. build.mjs stages only those files under ignored build/docs-source/, then emits build/site/docs/ as part of build:website. Edit the original Markdown, never a staged copy. Relative links between published pages become local web links; references outside the list continue to GitHub. Heading IDs reuse the repository checker's GitHub-style slug rule, so section links work in both views without a second set of anchors. The page edit link targets its original source. Developer context, TODO, research and operational release records are not automatically published as reader pages.

The docs keep paired English/Chinese guides, shared site language preference, system/explicit appearance and the existing mascot. Search uses a local index and native word segmentation for Chinese and English, with no hosted search service. Technical configuration keeps its existing English owner on GitHub.

Both homepage and documentation are uploaded in the same Pages artifact. Do not run a second Pages deployment that would overwrite the homepage. Website/docs sources and the nested package remain outside product-release paths; shared product code and App/Server build inputs still follow the release boundary. Check links, language switching, search, keyboard/mobile use and the static HTML fallback when changing the public documentation.

Downloads

The Windows, macOS and Linux App cards use fixed filenames and each provider's native latest-attachment route:

Both links follow provider publication without a website rebuild. Supported App architecture choices stay visible; one selection updates both providers' links. An optional GitHub metadata request supplies the latest version/date and its authored editorial headline; failure does not disable architecture selection. Without JavaScript, the default links remain Windows x64, Apple silicon and Linux x64. Publish a newly listed App package before deploying its website option. ARM64 Server packages alone do not enable an ARM64 App choice. Platform buttons say “Download from GitHub” / “GitHub 下载”; the secondary link says “Download from Gitee” / “Gitee 国内镜像下载”. Keep versions and archive formats out of these labels. Versioning owns package verification and completion of mirror publication. GitHub remains the primary source; the Gitee download can temporarily lag while a mirror publication completes. Verify the latest redirects and package checksums after releases.

Publish

  1. Verify the public copy and destinations above, publish the release artifacts and open the source repository as part of the approved public launch.
  2. In repository Settings > Pages, choose GitHub Actions as the source. Use the dedicated Pages workflow, not publication of the repository root or all of docs/, which includes developer research and operational reference.
  3. Set the approved piik.tv custom domain in Pages settings and configure its DNS using GitHub's current domain instructions. Actions publishing does not need a CNAME file in the source tree.
  4. Accepted main pushes run CI first; success triggers Website, which checks out that CI run's exact commit. Manual dispatch uses its selected main commit. Before publishing, both paths skip a build that is no longer current main; dispatch again for the latest commit when needed. The separate Gitee mirror workflow does not gate Website deployment. Download links resolve through each provider, so publishing a package or retrying its mirror needs no link refresh. Only build/site/ is uploaded; website work does not package App/Server. Verify HTTPS, both languages, relative assets and per-platform download links.

Branch/PR pushes do not deploy. The workflow does not change DNS; the private production site and the US P2P-only demo remain separate deployments.

For rollback, dispatch the previously accepted site revision from a reviewed revert on main; runtime App/Server binaries and databases are unaffected.