Compare commits

..
31 changed files with 319 additions and 468 deletions

No files matched your search

+2 -2
View File
@@ -52,9 +52,9 @@ on your own server.
**Got an invitation?** Open the full link in a browser on your computer or phone. If the picture does not start automatically, select **Play**.
1. **Choose how to share.** On a computer, open [Piik online](https://demo.piik.tv) to share a screen, window or browser tab. A phone browser with camera access can share its camera. To share with Piik App, [download the App](https://piik.tv/#download), then extract and open it on desktop or install and open it on Android. To invite friends on another network, choose **Public invite**, then **Open Piik**.
1. **Choose how to share.** On a computer, open [Piik online](https://demo.piik.tv) to share a screen, window or browser tab. A phone browser with camera access can share its camera. To share with Piik App, [download the App](https://piik.tv/#download), then extract and open it on desktop or install and open it on mobile. To invite friends on another network, choose **Public invite**, then **Open Piik**.
2. Select **Start sharing** and choose what your friend will see. If you want to share sound, enable audio when the source picker offers it.
3. Once you see the preview, select **Copy** under **Admission** and send the full link to your friend. Keep the sharing tab open. If you use the App, keep it running too.
3. Once you see the preview, select **Copy invite link** and send the full link to your friend. Keep the sharing tab open. If you use the App, keep it running too.
<p align="center"><img src="./docs/assets/quickstart.svg" width="640" alt="Choose a screen, send an invitation, watch together."></p>
+2 -2
View File
@@ -50,9 +50,9 @@ Piik 是一个免费开源的私密屏幕共享工具,适合游戏直播、一
**收到邀请?** 在电脑或手机浏览器打开朋友发来的完整链接即可观看。画面没有自动播放时,点 **播放**。
1. **选择分享方式。** 在电脑上分享屏幕、窗口或浏览器标签页,可以直接打开[在线版](https://demo.piik.tv)。手机浏览器支持摄像头时,也能分享摄像头画面。要用 Piik App 分享,请[下载 App](https://piik.tv/?lang=zh-CN#download),电脑上解压后打开,安卓设备上安装后打开。邀请异地朋友时,选 **公网邀请**,再点 **进入 Piik**。
1. **选择分享方式。** 在电脑上分享屏幕、窗口或浏览器标签页,可以直接打开[在线版](https://demo.piik.tv)。手机浏览器支持摄像头时,也能分享摄像头画面。要用 Piik App 分享,请[下载 App](https://piik.tv/?lang=zh-CN#download),电脑上解压后打开,手机上安装后打开。邀请异地朋友时,选 **公网邀请**,再点 **进入 Piik**。
2. 点 **开始分享**,选要给朋友看的画面。如果选源窗口提供声音选项,需要分享声音时将它打开。
3. 看到预览后,在 **准入方式** 下点 **复制**,把完整链接发给朋友。分享期间保持这个标签页打开;使用 App 时也要保持 App 运行。
3. 看到预览后,点 **复制邀请链接**,把完整链接发给朋友。分享期间保持这个标签页打开;使用 App 时也要保持 App 运行。
<p align="center"><img src="./docs/assets/quickstart.svg" width="640" alt="选择画面,发送邀请,一起观看。"></p>
+5 -13
View File
@@ -2,16 +2,8 @@
set -Eeuo pipefail
umask 022
proxy_service=nginx
old_asset_origin="${PIIK_PUBLIC_ORIGIN:-}"
if [ "${1:-}" = '--demo-caddy' ]; then
proxy_service=caddy
old_asset_origin=http://127.0.0.1:8787
shift
fi
if [ "$#" -ne 1 ]; then
printf 'usage: PIIK_PUBLIC_ORIGIN=https://share.example.com %s [--demo-caddy] /opt/piik/uploads/<release>.release.json\n' "$0" >&2
printf 'usage: PIIK_PUBLIC_ORIGIN=https://share.example.com %s /opt/piik/uploads/<release>.release.json\n' "$0" >&2
exit 2
fi
@@ -169,7 +161,7 @@ test -f "$artifact"
test -f "$manifest"
test "$(sha256sum "$artifact" | awk '{print $1}')" = "$artifact_sha"
test "$(sha256sum "$manifest" | awk '{print $1}')" = "$manifest_sha"
for service in piik "$proxy_service"; do
for service in piik nginx; do
test "$(systemctl show "${service}.service" -p ActiveState --value)" = 'active'
test "$(systemctl show "${service}.service" -p NRestarts --value)" = '0'
done
@@ -253,7 +245,7 @@ test "$(stat -c '%U:%G %a' "$release")" = 'root:root 755'
# Compare rules without traffic counters; no operator-specific table name.
firewall_before="$(nft --stateless list ruleset | sha256sum | awk '{print $1}')"
proxy_restarts="$(systemctl show "${proxy_service}.service" -p NRestarts --value)"
nginx_restarts="$(systemctl show nginx.service -p NRestarts --value)"
cutover_since="$(date '+%Y-%m-%d %H:%M:%S')"
cutover_start="$(date +%s%3N)"
cutover_started=1
@@ -268,7 +260,7 @@ health_ready="$(date +%s%3N)"
test "$(systemctl show piik.service -p ActiveState --value)" = 'active'
test "$(systemctl show piik.service -p NRestarts --value)" = '0'
test "$(systemctl show "${proxy_service}.service" -p NRestarts --value)" = "$proxy_restarts"
test "$(systemctl show nginx.service -p NRestarts --value)" = "$nginx_restarts"
test "$(nft --stateless list ruleset | sha256sum | awk '{print $1}')" = "$firewall_before"
test "$(readlink -f -- "$current")" = "$release"
pid="$(systemctl show piik.service -p MainPID --value)"
@@ -280,7 +272,7 @@ curl -fsS --max-time 5 http://127.0.0.1:8787/ | grep -Fq "$main_asset"
curl -fsS --max-time 8 "$public_origin/" | grep -Fq "$main_asset"
test "$(curl -sS -o /dev/null -w '%{http_code}' --max-time 8 "$public_origin/$main_asset")" = '200'
if [ "$old_asset" != "$main_asset" ]; then
test "$(curl -sS -o /dev/null -w '%{http_code}' --max-time 8 "$old_asset_origin/$old_asset")" = '404'
test "$(curl -sS -o /dev/null -w '%{http_code}' --max-time 8 "$public_origin/$old_asset")" = '404'
fi
test -z "$(journalctl -u piik.service --since "$cutover_since" -p warning --no-pager --output=cat)"
-90
View File
@@ -1,90 +0,0 @@
# 在 Linux 服务器上构建 Piik(实测记录)
本仓库是 [TNTcraftHIM/Piik](https://github.com/TNTcraftHIM/Piik) 的镜像(GPL/MIT 见各自文件,Piik 本体 MIT)。
以下命令在 **OpenCloudOS 9 x86_64 / 4 核 / 3 GB 内存** 上跑通,时间为 2026-11-30,代码版本 `v2.8.0`(commit `81b4f27`)。
## 0. 版本要求(`package.json` / `.node-version` / `go.mod` 已写明)
| 组件 | 要求 | 说明 |
|---|---|---|
| Node | `>=24 <27`,`.node-version` 是 `24.22.3` | Node 20 会被 `engines` 拒绝 |
| npm | `11.x` | 项目声明 `packageManager: npm@11.17.0` |
| Go | `go 1.27.4` | 低于此版本 `go build` 直接报 `go.mod requires go >= 1.27.4` |
服务器原先只有 Node 20 且没有 Go,因此先装工具链(二者都是解压即用,不影响系统包):
```bash
mkdir -p /opt/toolchains && cd /opt/toolchains
curl -sSL -o node24.tar.xz https://npmmirror.com/mirrors/node/v24.22.3/node-v24.22.3-linux-x64.tar.xz
tar xf node24.tar.xz && mv node-v24.22.3-linux-x64 node
curl -sSL -o go.tgz https://mirrors.aliyun.com/golang/go1.27.4.linux-amd64.tar.gz
tar xf go.tgz
export PATH=/opt/toolchains/node/bin:/opt/toolchains/go/bin:$PATH
export GOPROXY=https://goproxy.cn,https://mirrors.aliyun.com/goproxy/,direct
node -v && go version
```
## 1. 依赖
```bash
npm config set registry https://registry.npmmirror.com
npm ci --no-audit --no-fund # 约 30 秒
go mod download # 约 2 分钟(含 livekit 等大依赖)
```
## 2. 构建
**只想跑起来**(最快,出两个可执行文件):
```bash
npm run build:web # Vite 产物写入 internal/server/webassets/dist(被 Go 二进制 embed)
go build -trimpath -p 2 -o dist/piik-server ./cmd/piik-server
go build -trimpath -p 2 -o dist/piik-app ./cmd/piik-app
```
**要出官方同款发布包**(推荐,带 `-s -w` 与版本号、附 manifest 与校验和):
```bash
node scripts/package-server-release.mjs /tmp/piik-release --os linux --arch amd64
# → piik-<rev>-runtime.tar.gz / .manifest.tsv / .release.json
```
脚本要求工作区干净、输出目录不存在;版本号取自 `git tag --points-at HEAD`,不在 tag 上会得到 `development`,
所以要么 `git checkout v2.8.0` 再打包,要么显式指定 `PIIK_BUILD_VERSION=v2.8.0`。
**桌面 App 包**(需要 cloudflared,用于临时公网邀请):
```bash
curl -sSL -o /tmp/cloudflared https://github.com/cloudflare/cloudflared/releases/download/2026.10.3/cloudflared-linux-amd64
sha256sum /tmp/cloudflared # 053b80b0…(脚本内置校验值)
node scripts/assemble-app.mjs /tmp/piik-release/piik-<rev>.release.json /tmp/piik-app \
--target linux-amd64 --tunnel /tmp/cloudflared
```
## 3. 运行与自检
```bash
mkdir -p /opt/piik && tar xzf piik-<rev>-runtime.tar.gz -C /opt/piik
cd /opt/piik && ./piik-server # 默认 0.0.0.0:8787
```
实测结果:
- `GET /` → **200**,返回内嵌的 Web UI(`<title>Piik</title>`);
- `GET /assets/index-*.js`(`index.html` 里引用的主包)→ **200**;
- 日志:`Piik server is listening … version=v2.8.0 revision=81b4f27e… port=8787 sqlite=true`;
- `./piik-server --check-config` 可用于校验环境变量;`--check-release` 会联网比对上游最新 release(实测返回上游 `v2.8.0`);
- 房间数据在 SQLite(默认随进程工作目录生成),站点默认不开启访问保护与 SFU,生产使用请按
[`docs/operations/self-hosting.md`](./operations/self-hosting.md) 配 HTTPS 反代、域名与 STUN。
## 4. 这套环境做不了什么
- **Android APK**:`scripts/build-android.mjs` 需要 Android SDK/NDK 与 Gradle 环境(本机只有 android.jar,缺 NDK)。
- **Windows / macOS 包**:`assemble-app.mjs` 的目标平台与 Node 平台必须一致(`--target windows-amd64` 在 Linux 上会被拒绝)。
- **原生采集运行时 `piik-capture`**:需要 `go run ./cmd/piik-capture` 对应的 cgo/libwebrtc 依赖链,本轮未构建,
因此 App 包里 `nativeCapture: null`(浏览器采集不受影响)。
## 5. 已经产出的成品
见本仓库 Releases:`piik-81b4f27-runtime.tar.gz`(Linux x64 服务端运行时,15 MB)、
`piik-app-linux-amd64-v2.8.0.tar.gz`(桌面 App,36 MB)、manifest 与 release 描述文件。
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

+3 -3
View File
@@ -8,7 +8,7 @@ deployment record. [Status](./status.md) owns only the compact current product
and operational snapshot; it is not a per-release ledger.
The tracked `release-server.sh` updates an existing Go deployment with embedded
media, bare-metal nginx (or the [managed Caddy Demo](./operations/website.md)), nftables, and application port 8787. It requires an
media, bare-metal nginx, nftables, and application port 8787. It requires an
existing running Go release. Another proxy, firewall owner, application port,
first installation, or initial embedded-media cutover needs its own scoped
bootstrap/updater; do not call this wrapper generic.
@@ -195,7 +195,7 @@ sudo env PIIK_PUBLIC_ORIGIN=https://share.example.com \
The wrapper:
1. takes a deployment lock and validates the descriptor, revision, archive,
manifest, current Go process, Piik and proxy service state, and public origin;
manifest, current Go process, Piik/nginx service state, and public origin;
2. rejects unexpected archive paths, links, file types, or duplicate inodes;
3. extracts to a new release directory and verifies every file hash and size;
4. validates production configuration by running the packaged binary's
@@ -248,7 +248,7 @@ Verify only the surfaces relevant to the release:
- local and public `/healthz` return `{"status":"ok"}`;
- the public HTML references the new immutable main asset;
- Piik and the selected proxy have expected active/restart state;
- Piik and nginx have expected active/restart state;
- Piik owns each configured STUN/SFU UDP listener and public reachability
matches the configuration;
- the current symlink and served revision match the descriptor;
+8 -18
View File
@@ -11,9 +11,7 @@ description: Join a room, share your screen, and fix common problems with Piik.
# Piik Documentation
English · [简体中文](./README.zh-CN.md)
Try searching for “can’t join”, “no sound”, or “remote control”.
Try searching for “can’t join”, “no sound”, or “joystick”.
<HelpSearch />
@@ -31,27 +29,22 @@ Try searching for “can’t join”, “no sound”, or “remote control”.
Open the online site and send friends an invitation link.
- [Share with Piik App](./getting-started.md#share-with-piik-app)<br>
Install Piik App and choose a local or public invitation.
- [Play on your phone with the on-screen joystick](./remote-control.md#play-on-your-phone-with-the-on-screen-joystick)<br>
Request control and move with the on-screen joystick.
</section>
<section class="help-issues">
<header class="help-issues-heading">
## Fix a problem
[All troubleshooting →](./troubleshooting.md)
</header>
- [No picture after joining a room](./no-media-route.md)
- [I can’t join my friend’s room](./troubleshooting.md#i-cant-join-my-friends-room)
- [The picture is blurry or keeps freezing](./troubleshooting.md#the-picture-is-blurry-or-keeps-freezing)
- [I can see the picture but cannot hear the game](./sound-help.md#i-can-see-the-picture-but-cannot-hear-the-game)
- [My friends cannot hear me](./sound-help.md#my-friends-cannot-hear-me)
If the problem persists, [report it](./troubleshooting.md#reporting-a-problem).
[Troubleshooting](./troubleshooting.md) · [Reporting a problem](./troubleshooting.md#reporting-a-problem)
</section>
@@ -66,17 +59,14 @@ If the problem persists, [report it](./troubleshooting.md#reporting-a-problem).
</section>
<section class="help-actions">
<section class="help-hosting">
## Run your own site
- [Deploy Piik Server](../operations/self-hosting.md)<br>
Try it locally or deploy to a LAN or the internet.
- [Service Management](../operations/service-management.md)<br>
Run Piik in the background, update it, and back up room data.
- [Use frp for a fixed Piik invitation address](./frp.md)<br>
Forward your site through an existing frp server.
[Deploy Piik Server](../operations/self-hosting.md) · [Service Management](../operations/service-management.md) · [Use frp for a fixed Piik invitation address](./frp.md) · [Advanced network checks](./network.md) · [Piik App](../../cmd/piik-app/README.md)
</section>
</div>
[简体中文](./README.zh-CN.md) · [Help translate Piik](./translating.md) · [Piik website](https://piik.tv/?lang=en)
+8 -18
View File
@@ -11,9 +11,7 @@ description: 了解如何加入房间、分享屏幕,以及解决 Piik 的常
# Piik 文档中心
[English](./README.md) · 简体中文
试试搜索「进不去」「没声音」或「远程控制」。
试试搜索「进不去」「没声音」或「摇杆」。
<HelpSearch />
@@ -31,27 +29,22 @@ description: 了解如何加入房间、分享屏幕,以及解决 Piik 的常
打开在线版,把邀请链接发给朋友。
- [用 Piik App 分享](./getting-started.zh-CN.md#用-piik-app-分享)<br>
安装 App,选择本地房间或公网邀请。
- [用手机玩电脑游戏(屏幕摇杆)](./remote-control.zh-CN.md#用手机玩电脑游戏屏幕摇杆)<br>
请求控制,用屏幕上的摇杆操作朋友的游戏。
</section>
<section class="help-issues">
<header class="help-issues-heading">
## 遇到问题
[全部疑难解答 →](./troubleshooting.zh-CN.md)
</header>
- [进房后没画面](./no-media-route.zh-CN.md)
- [进不去朋友的房间](./troubleshooting.zh-CN.md#进不去朋友的房间)
- [画面模糊、卡顿或中断](./troubleshooting.zh-CN.md#画面模糊卡顿或中断)
- [有画面但听不到游戏声音](./sound-help.zh-CN.md#有画面但听不到游戏声音)
- [朋友听不到我说话](./sound-help.zh-CN.md#朋友听不到我说话)
仍未解决时,请[反馈问题](./troubleshooting.zh-CN.md#反馈问题)。
[疑难解答](./troubleshooting.zh-CN.md) · [反馈问题](./troubleshooting.zh-CN.md#反馈问题)
</section>
@@ -66,17 +59,14 @@ description: 了解如何加入房间、分享屏幕,以及解决 Piik 的常
</section>
<section class="help-actions">
<section class="help-hosting">
## 自建和管理站点
- [部署 Piik Server](../operations/self-hosting.zh-CN.md)<br>
在本机试用,或部署到局域网和公网。
- [服务管理](../operations/service-management.zh-CN.md)<br>
设置后台运行,更新和备份站点。
- [用 frp 给 Piik 设置固定公网邀请](./frp.zh-CN.md)<br>
通过已有的 frp 节点转发站点。
[部署 Piik Server](../operations/self-hosting.zh-CN.md) · [服务管理](../operations/service-management.zh-CN.md) · [用 frp 给 Piik 设置固定公网邀请](./frp.zh-CN.md) · [进阶网络排查](./network.zh-CN.md) · [Piik App](../../cmd/piik-app/README.zh-CN.md)
</section>
</div>
[English](./README.md) · [参与 Piik 翻译](./translating.zh-CN.md) · [Piik 官网](https://piik.tv/?lang=zh-CN)
+1 -1
View File
@@ -22,7 +22,7 @@ This example uses **SakuraFrp (樱花映射)**. If you run frps or use another p
### Desktop App
- **3.0 beta.** In the launcher choose **Public invite → Existing address** and enter your public HTTPS address. In the SakuraFrp TCP tunnel settings, set the local IP and port to the **Local forwarding target** shown in Piik, then enter Piik from the launcher. The host uses the page the App opens.
- **2.8 and later 2.x releases.** Open PowerShell in the extracted App directory and run the command below. Replace the example HTTPS address with the public address from the tunnel log and replace the example port with the local port in the TCP tunnel settings. With v2.7.0, use the Server option below for a fixed address.
- **2.x maintenance build.** Open PowerShell in the extracted App directory. Run `.\piik-app.exe --help` and check for `public-origin` before using the command below. Replace the example HTTPS address with the public address from the tunnel log and replace the example port with the local port in the TCP tunnel settings. With the published v2.7.0, use the Server option below for a fixed address.
```powershell
.\piik-app.exe --link --public-origin https://piik.example.nyat.app:21080 --port 8787
+1 -1
View File
@@ -22,7 +22,7 @@
### 桌面 App
- 使用 **3.0 内测版**时,在 Piik 启动页选择 **公网邀请 → 使用已有地址**,填入隧道的公网 HTTPS 地址。在樱花映射的 TCP 隧道设置里,把 **本机转发目标** 显示的 IP 和端口分别填入对应字段。回到 Piik,点 **进入 Piik**。
- 使用 **2.8 或之后的 2.x 版本**时,在解压后的 App 目录打开 PowerShell,运行下面的命令。把示例 HTTPS 地址替换为隧道日志里的公网地址,把 `8787` 换成 TCP 隧道设置里的本地端口。v2.7.0 如需使用固定地址,可采用下方的 Server 方式。
- 使用 **2.x 维护版**时,在解压后的 App 目录打开 PowerShell。先用 `.\piik-app.exe --help` 确认帮助中有 `public-origin`,再运行下面的命令,把示例 HTTPS 地址替换为隧道日志里的公网地址,把 `8787` 换成 TCP 隧道设置里的本地端口。正式版 v2.7.0 如需使用固定地址,可采用下方的 Server 方式。
```powershell
.\piik-app.exe --link --public-origin https://piik.example.nyat.app:21080 --port 8787
+15 -2
View File
@@ -88,6 +88,21 @@ If the gamepad does not respond, check the Host's driver and App support, then
turn **Remote control** off and on. Keyboard/mouse co-play and ordinary remote control
remain available without the gamepad driver.
<a id="use-the-on-screen-joystick"></a>
## Play on your phone with the on-screen joystick
On a touchscreen, tap **Request control** in the playback bar. If the host approves requests individually, wait for them to select **Allow**. Once you have control, **L** and **R** appear on the playing picture. Touchscreen laptops work too.
Tap **L** or **R** to open or close one stick. Drag the lettered handle to put that stick within easy reach. Your browser remembers the position. Press the pad to steer and lift to center it. When idle, the handles tuck against the picture edges and each open pad stays in place.
In **Remote keyboard → Local controls**, turn off **Virtual joysticks** to remove both pads and handles and use ordinary touch across the picture. To keep the sticks available with less on screen, turn on **Show on touch**. A thin ring briefly marks a pad when you open it. Press there to show the thumb.
Open **Remote keyboard → Local controls → Stick mode** to set both sticks. In **Keys + mouse**, the left stick holds W, A, S or D and the right stick moves the mouse. When the Host supports gamepad input and the Viewer has no physical gamepad connected, choose **Gamepad** to send left and right stick input. Closing a stick, leaving the page or disconnecting releases the affected inputs. After reconnecting, select **Request control** again.
![The Viewer has opened both touch sticks over the shared picture.](../assets/guide/touch-joystick.en.png#gh-light-mode-only)
![The Viewer has opened both touch sticks over the shared picture.](../assets/guide/touch-joystick.en.dark.png#gh-dark-mode-only)
## End control
Either person can choose **End control**. The Host can stop all remote input with
@@ -105,8 +120,6 @@ choice needs **Allow Viewers** before it applies again. Passwords are not saved.
For desktop tasks on a phone, tap a visible target or use the trackpad to position the cursor precisely. Both touch modes send positions within the shared picture. For continuous mouse look, use **Game mouse** in a supported desktop browser.
After you get control on a touchscreen, tap **L** or **R** to open or close a stick, or drag its handle to move it. Press the pad to steer and lift to center it. In **Remote keyboard → Local controls**, change **Stick mode**, turn on **Show on touch**, or turn off **Virtual joysticks**.
On a phone, touch the picture directly to click and hold to drag, without a
cursor. Two-finger tap is right-click; two-finger swipe scrolls. Pinch to zoom in
or out, then use two fingers to pan, including into the blank space around the
+15 -2
View File
@@ -67,6 +67,21 @@ Piik 不指定游戏中的玩家编号,请使用游戏自己的加入和分配
手柄没有响应时,请检查房主的驱动和 App 是否支持该功能,再关闭并重新开启 **远程控制**。
不装手柄驱动仍可共用键鼠、使用普通远控。
<a id="使用屏幕摇杆"></a>
## 用手机玩电脑游戏(屏幕摇杆)
在触摸屏上观看可远控的画面时,点播放栏里的 **请求控制**。如果房主设置了每次询问,等房主点 **允许控制**。取得控制权后,正在播放的画面下方会出现 **L** 和 **R**。带触摸屏的电脑也可以使用。
点 **L** 或 **R** 展开或收起一侧摇杆。拖动带字母的拉手,可以把这根摇杆放在拇指舒服的位置,浏览器会记住。按住杆盘控制方向,松手回中。闲置时只有拉手贴边,杆盘留在原位。
打开 **远程键盘 → 本机控制**。关掉 **虚拟摇杆**,左右拉手和杆盘都会消失,画面可照常触控。想保留摇杆又少遮画面,可以开启 **仅触摸时显示**。展开时,细圈会短暂标出触控位置,按住才显示杆头。
打开 **远程键盘 → 本机控制 → 摇杆模式** 可同时设置两根摇杆。**键鼠** 模式用左杆控制 W、A、S、D,右杆移动鼠标。房主支持手柄输入且观众没有连接实体手柄时,可以选 **手柄**,直接发送左右摇杆输入。收起摇杆、切出页面或连接中断都会释放相应输入。重新连接后,请再次点击 **请求控制**。
![观众在画面上同时展开左、右摇杆。](../assets/guide/touch-joystick.zh-CN.png#gh-light-mode-only)
![观众在画面上同时展开左、右摇杆。](../assets/guide/touch-joystick.zh-CN.dark.png#gh-dark-mode-only)
## 结束控制
双方都可以点击 **结束控制**。房主在本机按 **Ctrl+Alt+F10**(Windows)或
@@ -82,8 +97,6 @@ Piik 不指定游戏中的玩家编号,请使用游戏自己的加入和分配
用手机操作桌面时,可以轻点画面中的目标,或者用光标触控板微调。两种触摸方式都发送共享画面范围内的光标坐标。需要连续转动鼠标视角时,可在支持的桌面浏览器里开启 **游戏鼠标**。
在触摸屏上取得控制权后,点击 **L** 或 **R** 展开或收起一侧摇杆,也可以拖动拉手调整位置。按住杆盘控制方向,松手回中。在 **远程键盘 → 本机控制** 中,可以更改 **摇杆模式**、开启 **仅触摸时显示** 或关闭 **虚拟摇杆**。
手机上默认直接触摸画面操作,不显示光标;轻点点击、长按拖动,双指轻点右击、滑动滚动。
捏合可放大或缩小画面,缩放后双指移动用于平移画面,周围允许留黑。在 **播放设置 → 默认触摸方式** 中,也可选择 **光标触控板**。
+57 -72
View File
@@ -2,20 +2,14 @@
English · [简体中文](./self-hosting.zh-CN.md) · [Documentation](../guide/README.md)
Run Piik on your own server and give friends an address they can open in their browser.
Use Piik Server to provide a Piik site at an address you manage. You can try it on the server itself, share it on a private LAN, or publish it at an HTTPS domain. The server includes the web interface and stores room data in SQLite.
<div class="guide-task-index">
- [Try it locally](#try-it-locally)<br>
Download the server and open Piik on the same machine.
- [Docker Compose](#docker-compose)<br>
Run Piik in a container on Linux.
- [Put it online](#put-it-online)<br>
Set up your domain, HTTPS and firewall.
- [Private LAN without a domain](#private-lan-without-a-domain)<br>
Use a private IP to share on a LAN or virtual LAN.
</div>
The default P2P configuration handles room management, signaling and STUN; shared
video and audio travel between participants. Enabling SFU adds media-forwarding
bandwidth and processing on the server. For a small server, start with the default
and measure CPU, memory and network use with your intended number of rooms and
viewers before enabling SFU. Lowering picture resolution primarily reduces
participants' capture and encoding work.
## Try it locally
@@ -61,7 +55,50 @@ docker compose run --rm piik --check-config
docker compose up -d
```
Next, [enable HTTPS](#2-enable-https) and [open the ports](#3-open-the-ports-and-verify). Keep the `piik-data` volume, which stores your rooms. For backups and upgrades, see [container maintenance](./service-management.md#container).
The `ghcr.io/tntcrafthim/piik:latest` image includes the Web UI, signaling, STUN
and optional SFU. Docker selects the matching architecture automatically. Complete [HTTPS](#2-enable-https) and
[firewall configuration](#3-open-the-ports-and-verify) below. The default is P2P;
the sample `.env` also shows how to enable SFU fallback. Keep the `piik-data`
volume, which stores room data and optional diagnostics. See
[container maintenance](./service-management.md#container) for updates and backups.
## Private LAN without a domain
For a NAS, home server or virtual LAN, Piik can serve HTTPS directly. Save the
following as `.env` beside the server binary, replacing every `192.168.1.10`
with the server's address on that network:
```dotenv
PIIK_ENV=production
LISTEN_HOST=0.0.0.0
PORT=8787
PUBLIC_BASE_URL=https://192.168.1.10:8787
TLS_SELF_SIGNED=true
STUN_URLS=stun:192.168.1.10:3478
```
From that directory, run `./piik-server --check-config`, then `./piik-server`
(use `.exe` on Windows).
Allow TCP 8787 and UDP 3478 on that network. Open the **HTTPS** address on each
device; no public IP, domain or reverse proxy is needed. With Docker Compose,
also change the web port mapping from `127.0.0.1:8787:8787/tcp` to
`8787:8787/tcp` so LAN devices can reach it.
The browser will warn about the self-signed certificate. Compare its SHA-256
fingerprint with the server's **HTTPS certificate** startup message before
continuing; see [local certificate confirmation](../guide/troubleshooting.md#local-https-certificate-warning).
The certificate stays in memory and changes when Piik restarts, so confirm the
new one after a restart. Browser microphone, camera and remote control still
require their ordinary permissions and supported APIs.
To keep your own certificate, turn off `TLS_SELF_SIGNED` and set both
`TLS_CERT_FILE` and `TLS_KEY_FILE` to its PEM files. With Docker, mount those
files read-only and use their paths inside the container. The certificate must cover
the host in `PUBLIC_BASE_URL`. `--check-config` checks the pair and validity;
restart Piik after replacing the files. Piik does not obtain or renew these
certificates. For a long-running public site, use the automatic HTTPS proxy below.
If the web port is occupied, stop the conflicting service or change both `PORT`
and the port in `PUBLIC_BASE_URL`, then send new invitations.
## Put it online
@@ -101,9 +138,6 @@ and any non-default port. Leave `ALLOWED_ORIGINS` unset or empty for this single
address. An existing non-empty value overrides that default; a stale value can
cause [403 when creating a room](../guide/troubleshooting.md#room-creation-returns-403).
<details>
<summary>Set viewer capacity and empty-room retention</summary>
`MAX_VIEWERS_PER_ROOM` sets the room's Viewer limit, excluding the Host. Choose
`1..20` and restart to apply it. More Viewers can require more network and relay
resources. See [room capacity](../standards/configuration.md#room-capacity)
@@ -115,8 +149,6 @@ used, the oldest empty room can be reclaimed earlier. Occupied rooms keep workin
Reclaimed rooms need new invitations. Unset or `0` keeps the default indefinite
retention; see [room retention](../standards/configuration.md#room-retention).
</details>
### 2. Enable HTTPS
Use your existing HTTPS reverse proxy to forward to `127.0.0.1:8787` with
@@ -151,57 +183,17 @@ Open your public HTTPS address with `/healthz` appended. The response should be
Then open the site, share a screen and join from another device. This initial
configuration uses P2P media, so participants need a usable UDP path.
## Private LAN without a domain
For a NAS, home server or virtual LAN, Piik can serve HTTPS directly. Save the
following as `.env` beside the server binary, replacing every `192.168.1.10`
with the server's address on that network:
```dotenv
PIIK_ENV=production
LISTEN_HOST=0.0.0.0
PORT=8787
PUBLIC_BASE_URL=https://192.168.1.10:8787
TLS_SELF_SIGNED=true
STUN_URLS=stun:192.168.1.10:3478
```
From that directory, run `./piik-server --check-config`, then `./piik-server`
(use `.exe` on Windows).
Allow TCP 8787 and UDP 3478 on that network. Open the **HTTPS** address on each
device; no public IP, domain or reverse proxy is needed. With Docker Compose,
also change the web port mapping from `127.0.0.1:8787:8787/tcp` to
`8787:8787/tcp` so LAN devices can reach it.
The browser will warn about the self-signed certificate. Compare its SHA-256
fingerprint with the server's **HTTPS certificate** startup message before
continuing; see [local certificate confirmation](../guide/troubleshooting.md#local-https-certificate-warning).
The certificate stays in memory and changes when Piik restarts, so confirm the
new one after a restart. Browser microphone, camera and remote control still
require their ordinary permissions and supported APIs.
<details>
<summary>Use your own certificate</summary>
To keep your own certificate, turn off `TLS_SELF_SIGNED` and set both
`TLS_CERT_FILE` and `TLS_KEY_FILE` to its PEM files. With Docker, mount those
files read-only and use their paths inside the container. The certificate must cover
the host in `PUBLIC_BASE_URL`. `--check-config` checks the pair and validity;
restart Piik after replacing the files. Piik does not obtain or renew these
certificates.
</details>
If the web port is occupied, stop the conflicting service or change both `PORT`
and the port in `PUBLIC_BASE_URL`, then send new invitations.
## Optional: media fallback
Add `SFU_UDP_PORT=7882` to `.env`, allow UDP 7882, and restart Piik to enable
automatic SFU fallback. When the server is behind NAT, also set `SFU_PUBLIC_IP`
to its reachable public IPv4 address or DDNS hostname and forward the same external
and internal UDP port as `SFU_UDP_PORT`. Use a hostname pointing directly to that
IPv4, with the CDN proxy disabled.
IPv4, with the CDN proxy disabled. Piik resolves it at startup and every minute.
After DDNS updates, new media connections use the updated address without a
service restart. If the address change interrupted an ongoing share, the Host
can restart sharing and Viewers can rejoin the room.
The same binary provides the fallback.
Allow server forwarding capacity and outbound bandwidth for Viewers actually
using the SFU.
The Host must turn off **Privacy mode** before sharing to allow this route.
@@ -213,11 +205,6 @@ Viewer; this mode does not fall back to P2P if the server route fails.
## Optional: forward an existing server with frp
For a fixed public address, follow the [frp invitation guide](../guide/frp.md).
<details>
<summary>Configure your own frps and frpc</summary>
If Piik runs behind NAT and you control a public frps host, frp can forward its
existing web and SFU endpoints. P2P ICE discovery remains unchanged.
@@ -258,11 +245,9 @@ equal `SFU_UDP_PORT`. Do not forward Piik's STUN ports through frp: its UDP prox
STUN would report. Restart Piik and check HTTPS health, room access and
**Server media** from another network.
</details>
### Forward a Piik App invitation
On the App computer, use Piik App 2.8 or a later 2.x release and run `piik-app --link --public-origin https://share.example.com --port 8787`. For v2.7.0, use the Server setup above for a fixed address. Use the public HTTPS reverse proxy described above and only the `piik-web` TCP proxy in frpc, targeting `127.0.0.1:8787`. Start frps and frpc yourself. The Host opens its loopback entry. Viewer invitations and QR codes use the fixed HTTPS domain. Room access settings still apply. App media uses WebRTC P2P. Use `--local` for LAN invitations.
First run `piik-app --help` and check for `public-origin`. The published v2.7.0 App lacks this option. With that version, use the Server setup above for a fixed address. In a 2.x App that lists the option, run `piik-app --link --public-origin https://share.example.com --port 8787` on the App computer. Use the public HTTPS reverse proxy described above and only the `piik-web` TCP proxy in frpc, targeting `127.0.0.1:8787`. Start frps and frpc yourself. The Host opens its loopback entry. Viewer invitations and QR codes use the fixed HTTPS domain. Room access settings still apply. App media uses WebRTC P2P. Use `--local` for LAN invitations.
### Using a managed frp provider
+47 -65
View File
@@ -2,20 +2,12 @@
[English](./self-hosting.md) · 简体中文 · [文档导航](../guide/README.zh-CN.md)
在自己的服务器上部署 Piik,让朋友用浏览器打开你管理的网址。
用 Piik Server 可以在自己管理的地址上提供 Piik 站点。你可以先在服务器本机试用,也可以开放给局域网,或使用公网 HTTPS 域名。服务端自带网页,房间数据保存在 SQLite 中。
<div class="guide-task-index">
- [先在本机试用](#先在本机试用)<br>
下载程序,打开本机网页。
- [使用 Docker Compose](#使用-docker-compose)<br>
在 Linux 上部署容器。
- [对外提供服务](#对外提供服务)<br>
配置域名、HTTPS 和防火墙。
- [无域名的内网部署](#无域名的内网部署)<br>
用内网 IP 在家里或虚拟局域网分享。
</div>
默认的 P2P 配置由服务器负责房间管理、信令和 STUN,画面与声音在参与者之间传输。
启用 SFU 后,服务器还会承担媒体转发的带宽和处理开销。配置较低的服务器可以先用默认设置,
按预计的房间数和观众数观察 CPU、内存与网络占用,再决定是否开启 SFU。
降低画面分辨率主要减轻参与者设备的采集和编码负担。
## 先在本机试用
@@ -58,7 +50,44 @@ docker compose run --rm piik --check-config
docker compose up -d
```
接着[配置 HTTPS](#2-配置-https)并[放行端口](#3-放行端口并检查)。保留 `piik-data` 数据卷,其中保存房间数据。需要备份或升级时,见[容器维护](./service-management.zh-CN.md#容器)。
`ghcr.io/tntcrafthim/piik:latest` 镜像包含网页、信令、STUN 和可选 SFU。
Docker 会自动选择对应架构的镜像。
接着完成下方的 [HTTPS 配置](#2-配置-https)和[端口放行](#3-放行端口并检查)。
默认使用 P2P;如需 SFU 兜底,按 `.env` 中的说明启用即可。
请保留 `piik-data` 数据卷,房间数据和可选诊断文件都保存在其中。
更新与备份见[容器维护说明](./service-management.zh-CN.md#容器)。
## 无域名的内网部署
NAS、家用服务器或虚拟局域网可以直接使用 Piik 提供的 HTTPS,无需另装反向代理。
在服务端程序旁创建 `.env`,填写以下配置,将所有 `192.168.1.10` 换成服务器在该网络中的 IP:
```dotenv
PIIK_ENV=production
LISTEN_HOST=0.0.0.0
PORT=8787
PUBLIC_BASE_URL=https://192.168.1.10:8787
TLS_SELF_SIGNED=true
STUN_URLS=stun:192.168.1.10:3478
```
在该目录先运行 `./piik-server --check-config`,检查通过后运行 `./piik-server`;Windows 加上 `.exe`。
在该网络放行 TCP 8787 和 UDP 3478,然后用各台设备打开上述 **HTTPS** 地址。
不需要公网 IP 或域名。如果使用 Docker Compose,还需把网页端口映射
`127.0.0.1:8787:8787/tcp` 改为 `8787:8787/tcp`,让内网设备可以访问。
浏览器会提示证书不受信任。请先核对证书的 SHA-256 指纹,与服务端启动时的
**HTTPS certificate** 信息一致后再继续,见[本地证书确认说明](../guide/troubleshooting.zh-CN.md#本地-https-证书提示)。
临时证书只保存在内存中,重启 Piik 后会更换,需要重新确认。
开麦、摄像头和远控仍需浏览器支持相关接口,并完成各自的正常授权。
如果已有自己的证书,关闭 `TLS_SELF_SIGNED`,同时设置 `TLS_CERT_FILE` 和 `TLS_KEY_FILE`,
指向 PEM 格式的证书和私钥文件。Docker 中需将文件只读挂载,并使用容器内的路径。
证书需覆盖 `PUBLIC_BASE_URL` 中的域名或 IP;
`--check-config` 会检查文件配对、地址与有效期,替换文件后需重启 Piik。
Piik 不负责申请或续期证书。长期对外服务的站点建议使用下方自动管理证书的 HTTPS 代理。
网页端口被占用时,先停止占用服务,或同时修改 `PORT` 与 `PUBLIC_BASE_URL` 中的端口,
再重新发送邀请。
## 对外提供服务
@@ -96,9 +125,6 @@ Windows 请在 PowerShell 中改用 `./piik-server.exe --check-config` 和
只使用这个地址时,`ALLOWED_ORIGINS` 不设置或留空即可;已有的非空值会覆盖此默认值,
旧地址未更新可能导致[创建房间返回 403](../guide/troubleshooting.zh-CN.md#创建房间返回-403)。
<details>
<summary>调整观众上限和空房间保留时间</summary>
`MAX_VIEWERS_PER_ROOM` 可设置每房观众上限,不含房主,支持 `1..20`,修改后重启生效。
人数越多,对网络和转发资源的需求也可能增加。默认值及 App 房间的区别见
[人数限制](../standards/configuration.md#room-capacity)。
@@ -108,8 +134,6 @@ Windows 请在 PowerShell 中改用 `./piik-server.exe --check-config` 和
被回收的房间需要重新创建并发送邀请。不设置或设为 `0` 则保持默认的长期保留行为,
详见[房间保留策略](../standards/configuration.md#room-retention)。
</details>
### 2. 配置 HTTPS
如果已有 HTTPS 反向代理,将请求转发到 `127.0.0.1:8787`,并启用 WebSocket 支持。
@@ -139,49 +163,14 @@ TCP 8787 仅供本机反向代理访问。STUN 域名需要直接解析到服务
随后打开站点,分享一个画面,并用另一台设备加入验证。
上述基础配置使用 P2P 传输,参与者之间需要可用的 UDP 通路。
## 无域名的内网部署
NAS、家用服务器或虚拟局域网可以直接使用 Piik 提供的 HTTPS,无需另装反向代理。
在服务端程序旁创建 `.env`,填写以下配置,将所有 `192.168.1.10` 换成服务器在该网络中的 IP:
```dotenv
PIIK_ENV=production
LISTEN_HOST=0.0.0.0
PORT=8787
PUBLIC_BASE_URL=https://192.168.1.10:8787
TLS_SELF_SIGNED=true
STUN_URLS=stun:192.168.1.10:3478
```
在该目录先运行 `./piik-server --check-config`,检查通过后运行 `./piik-server`;Windows 加上 `.exe`。
在该网络放行 TCP 8787 和 UDP 3478,然后用各台设备打开上述 **HTTPS** 地址。
不需要公网 IP 或域名。如果使用 Docker Compose,还需把网页端口映射
`127.0.0.1:8787:8787/tcp` 改为 `8787:8787/tcp`,让内网设备可以访问。
浏览器会提示证书不受信任。请先核对证书的 SHA-256 指纹,与服务端启动时的
**HTTPS certificate** 信息一致后再继续,见[本地证书确认说明](../guide/troubleshooting.zh-CN.md#本地-https-证书提示)。
临时证书只保存在内存中,重启 Piik 后会更换,需要重新确认。
开麦、摄像头和远控仍需浏览器支持相关接口,并完成各自的正常授权。
<details>
<summary>使用自己的证书</summary>
如果已有自己的证书,关闭 `TLS_SELF_SIGNED`,同时设置 `TLS_CERT_FILE` 和 `TLS_KEY_FILE`,
指向 PEM 格式的证书和私钥文件。Docker 中需将文件只读挂载,并使用容器内的路径。
证书需覆盖 `PUBLIC_BASE_URL` 中的域名或 IP;
`--check-config` 会检查文件配对、地址与有效期,替换文件后需重启 Piik。
</details>
网页端口被占用时,先停止占用服务,或同时修改 `PORT` 与 `PUBLIC_BASE_URL` 中的端口,
再重新发送邀请。
## 可选:启用媒体兜底
在 `.env` 中添加 `SFU_UDP_PORT=7882`,放行 UDP 7882,再重启 Piik,即可启用自动 SFU 兜底。
如果服务器处于 NAT 后方,还需将 `SFU_PUBLIC_IP` 设置为外部可达的公网 IPv4 地址或 DDNS 域名。
域名应直接指向该 IPv4,关闭 CDN 代理。
域名应直接指向该 IPv4,关闭 CDN 代理。Piik 启动时解析域名,之后每分钟更新一次。
DDNS 更新后,新媒体连接使用最新地址,无需重启服务。若地址变化打断了当前分享,房主重新开播,观众重新进入房间。
公网和内部映射的 UDP 端口都应与 `SFU_UDP_PORT` 一致。
这项功能由同一个服务端程序提供。
服务器需要为实际经由 SFU 观看的观众承担转发负载和出口带宽。
房主需要在开始分享前关闭 **隐私模式**,才会允许使用这条线路。
直连和 SFU 媒体都需要可用的 UDP 通路。
@@ -192,11 +181,6 @@ STUN_URLS=stun:192.168.1.10:3478
## 可选:通过 frp 转发已有服务
需要固定公网地址时,可以使用[公网邀请 frp 指南](../guide/frp.zh-CN.md)。
<details>
<summary>自行配置 frps 和 frpc</summary>
如果 Piik 位于 NAT 后方,且你有一台公网 frps 主机,可用 frp 转发已有的网页和 SFU 端口。
P2P 的 ICE 探测方式保持不变。
@@ -236,11 +220,9 @@ frpc 的本地与公网 UDP 端口必须都等于 `SFU_UDP_PORT`。
[改变 STUN 所观察到的源地址映射](../research/nat-traversal.md#external-forwarding-and-participant-relays)。
重启 Piik,从另一网络验证 HTTPS 健康检查、房间访问及**服务器转发**。
</details>
### 转发 Piik App 的公网邀请
使用 Piik App 2.8 或之后的 2.x 版本时,在电脑上运行 `piik-app --link --public-origin https://share.example.com --port 8787`。v2.7.0 如需固定地址,请用上文的 Server 方式。公网主机使用上文的 HTTPS 反向代理,frpc 仅配置 `piik-web` TCP 代理并转发至 `127.0.0.1:8787`。自行启动 frps 和 frpc。主持人打开本机回环入口,观众邀请和二维码使用固定的 HTTPS 域名。房间访问设置继续生效,音视频使用 WebRTC P2P。仅在局域网分享时使用 `--local`。
先运行 `piik-app --help`,查看是否有 `public-origin`。已发布的 v2.7.0 App 没有这个选项,需要固定地址时请用上文的 Server 方式。使用包含该选项的 2.x App 时,在电脑上运行 `piik-app --link --public-origin https://share.example.com --port 8787`。公网主机使用上文的 HTTPS 反向代理,frpc 仅配置 `piik-web` TCP 代理并转发至 `127.0.0.1:8787`。自行启动 frps 和 frpc。主持人打开本机回环入口,观众邀请和二维码使用固定的 HTTPS 域名。房间访问设置继续生效,音视频使用 WebRTC P2P。仅在局域网分享时使用 `--local`。
### 使用托管 frp 服务
+61 -60
View File
@@ -2,66 +2,7 @@
English · [简体中文](./service-management.zh-CN.md) · [Documentation](../guide/README.md)
Update or back up Piik Server, set it to start at boot, or check that your site is working. For a first installation, see the [deployment guide](./self-hosting.md).
- [Start Piik automatically with systemd](#systemd)
- [Back up and update the container](#back-up-and-update-the-container)
- [Check that Piik is running](#operational-verification)
## Container
For a first installation, see the [Docker Compose setup](./self-hosting.md#docker-compose).
### Back up and update the container
1. Back up `.env` separately and record the current image tag or digest. Set `PIIK_IMAGE` in `.env` to the 2.x image tag or digest you want to install.
2. Run the commands below from your existing deployment directory. Use a new backup directory each time. Stop Piik before copying SQLite so the database and journal are consistent.
```sh
docker compose pull
docker compose stop
docker compose cp piik:/home/nonroot ./piik-data-backup
docker compose up -d
docker compose logs --tail=50 piik
```
Protect both backups as room credentials. Keep the same Compose project and directory to retain the named volume. The command `docker compose down --volumes` deletes that volume.
After startup, check the health response and test a share. [Operational verification](#operational-verification)
### Roll back the container
Restore the previous `PIIK_IMAGE` setting and its compatible configuration, then run `docker compose up -d` in the deployment directory. Check the release notes before crossing a storage-format boundary. Repeat [operational verification](#operational-verification).
<details>
<summary>Change container ports, volumes or diagnostics</summary>
Use the existing [production configuration](../standards/configuration.md).
Keep `LISTEN_HOST=0.0.0.0` inside the container and retain the host's existing
HTTPS/WebSocket proxy. With Docker port mapping, set `SFU_PUBLIC_IP` to the
reachable server IPv4 address when SFU is enabled; container-private candidates
are not Internet-reachable. Advertised STUN names must resolve to the server's
public address, and UDP must reach the container directly.
The [Compose file](../../deploy/container/compose.yaml) keeps HTTP on host
loopback, publishes the standard UDP ports and enables automatic restart.
Publishing a port does not enable its service; `.env` controls optional listeners.
Edit both the application setting and port mapping if changing a listener port.
Run a host proxy, or adapt the proxy's container networking deliberately: its
own `127.0.0.1` does not reach Piik in another container.
The image's `/home/nonroot` is owned by UID/GID `65532:65532` with mode `0700`.
A new named volume inherits that directory; an existing volume or bind mount
must already be writable by that identity. Keep this volume when replacing the
container. Set `ROOM_DATABASE_PATH=:memory:` for memory-only room authority. Diagnostics
remain opt-in and use `/home/nonroot/logs`; [export and retention](../standards/configuration.md#diagnostics)
remain the operator's responsibility. Do not mount application files writable.
With diagnostics enabled, `docker compose kill --signal=SIGUSR1 piik` requests a local
export without stopping the container; the ZIP remains in the mounted log directory.
</details>
[Image versions and distribution](../standards/versioning.md#container-distribution)
Use systemd to run Piik Server in the background on Linux. If you deployed with Docker Compose, use the container section for updates and backups. For a first installation, follow the [deployment guide](./self-hosting.md).
## systemd
@@ -88,6 +29,66 @@ STUN and optional SFU use their own public UDP listeners. An existing nginx
installation can use the [proxy example](../../deploy/nginx/piik.conf.example)
after adapting the domain and certificate paths.
## Container
Use the [Docker Compose setup](./self-hosting.md#docker-compose) for installation.
The image is `ghcr.io/tntcrafthim/piik`, with `latest` and matching product version
tags (`vMAJOR.MINOR.PATCH`). Docker selects **linux/amd64** or **linux/arm64**
to match the host. Set `PIIK_IMAGE` in `.env`
to pin a version or image digest. Updates are explicit; pulling an image does not
replace a running container.
The [runtime Dockerfile](../../deploy/container/Dockerfile) wraps the verified
Server archive, including its Web UI, license notices and `REVISION`.
Its pinned [Distroless non-root base](https://github.com/GoogleContainerTools/distroless)
includes CA certificates and has no shell or package manager. The
[release workflow](../standards/versioning.md#container-distribution) owns
building, checking and publishing the image.
Use the existing [production configuration](../standards/configuration.md).
Keep `LISTEN_HOST=0.0.0.0` inside the container and retain the host's existing
HTTPS/WebSocket proxy. With Docker port mapping, set `SFU_PUBLIC_IP` to the
reachable server IPv4 address when SFU is enabled; container-private candidates
are not Internet-reachable. Advertised STUN names must resolve to the server's
public address, and UDP must reach the container directly.
The [Compose file](../../deploy/container/compose.yaml) keeps HTTP on host
loopback, publishes the standard UDP ports and enables automatic restart.
Publishing a port does not enable its service; `.env` controls optional listeners.
Edit both the application setting and port mapping if changing a listener port.
Run a host proxy, or adapt the proxy's container networking deliberately: its
own `127.0.0.1` does not reach Piik in another container.
The image's `/home/nonroot` is owned by UID/GID `65532:65532` with mode `0700`.
A new named volume inherits that directory; an existing volume or bind mount
must already be writable by that identity. Keep this volume when replacing the
container. Set `ROOM_DATABASE_PATH=:memory:` for memory-only room authority. Diagnostics
remain opt-in and use `/home/nonroot/logs`; [export and retention](../standards/configuration.md#diagnostics)
remain the operator's responsibility. Do not mount application files writable.
With diagnostics enabled, `docker compose kill --signal=SIGUSR1 piik` requests a local
export without stopping the container; the ZIP remains in the mounted log directory.
Check `/healthz` from the host and public proxy, then verify configured STUN/SFU
UDP and room/media behavior using [operational verification](#operational-verification).
There is no shell-based healthcheck in the image. Retain the previous image,
environment and volume backup before replacement. Record the previous image tag or digest for rollback, then set `PIIK_IMAGE` in `.env` to the 2.x release you intend to install. From the deployment directory:
```sh
docker compose pull
docker compose stop
docker compose cp piik:/home/nonroot ./piik-data-backup
docker compose up -d
docker compose logs --tail=50 piik
```
Use a new backup directory each time. Stop Piik before copying SQLite so its
database and journal are consistent. Preserve `.env` separately and protect both
backups as room credentials. Keep the same Compose project/directory so the named
volume is reused; `docker compose down --volumes` deletes that data. To roll back,
restore the previous image setting and compatible configuration, then recreate
the service. Read release notes before crossing a storage-format boundary.
The bare-metal `release-server.sh` wrapper does not manage containers.
## Operational Verification
1. Open `/healthz` on the server and through the public HTTPS address. Both should return `{"status":"ok"}`.
+53 -56
View File
@@ -2,62 +2,7 @@
[English](./service-management.md) · 简体中文 · [文档导航](../guide/README.zh-CN.md)
更新或备份 Piik Server,设置 Linux 开机启动,或检查站点是否正常。首次安装请看[部署指南](./self-hosting.zh-CN.md)。
- [使用 systemd 启用后台服务](#systemd)
- [备份并更新容器](#备份并更新容器)
- [检查运行状态](#运行验证)
## 容器
首次安装见 [Docker Compose 配置](./self-hosting.zh-CN.md#使用-docker-compose)。
### 备份并更新容器
1. 单独备份 `.env`,记下当前镜像标签或摘要。将 `.env` 中的 `PIIK_IMAGE` 设为要安装的 2.x 镜像标签或摘要。
2. 在原部署目录执行下方命令。请使用新的备份目录。复制 SQLite 前先停止 Piik,确保数据库和日志文件一致。
```sh
docker compose pull
docker compose stop
docker compose cp piik:/home/nonroot ./piik-data-backup
docker compose up -d
docker compose logs --tail=50 piik
```
配置和数据备份包含房间凭据,请妥善保存。继续使用原 Compose 项目与目录,保留命名数据卷。`docker compose down --volumes` 会删除该卷。
启动后检查 [运行验证](#运行验证) 中的健康状态和分享步骤。
### 回滚容器
将 `PIIK_IMAGE` 和配置恢复到之前的兼容版本,然后在部署目录运行 `docker compose up -d`。涉及存储格式变化时,先查看发布说明。重新执行[运行验证](#运行验证)。
<details>
<summary>修改容器的端口、数据卷或诊断设置</summary>
使用既有的[生产配置](../standards/configuration.md)。容器内保留 `LISTEN_HOST=0.0.0.0`,
并继续使用主机已有的 HTTPS/WebSocket 代理。使用 Docker 端口映射且启用 SFU 时,
将 `SFU_PUBLIC_IP` 设为外部可达的服务器 IPv4 地址;容器私网候选无法从互联网访问。
公布的 STUN 域名必须解析到服务器公网地址,UDP 必须能直接到达容器。
[Compose 文件](../../deploy/container/compose.yaml)将 HTTP 绑定到主机回环地址,
公布标准 UDP 端口,并启用自动重启。公布端口不会开启对应服务,可选监听器由 `.env` 控制。
修改监听端口时,同时修改应用配置和端口映射。
请使用主机上的代理,或明确调整代理容器的网络配置;代理容器自己的 `127.0.0.1`
无法访问另一个容器内的 Piik。
镜像中的 `/home/nonroot` 属于 UID/GID `65532:65532`,权限为 `0700`。
新的命名数据卷继承该目录;已有数据卷或绑定挂载需要事先允许该身份写入。
替换容器时保留这个数据卷。设置 `ROOM_DATABASE_PATH=:memory:` 可让房间权威状态只保存在内存中。
诊断保持手动开启,使用 `/home/nonroot/logs`;[导出与保留](../standards/configuration.md#diagnostics)
由运维人员负责。不要将应用文件挂载为可写。
启用诊断后,`docker compose kill --signal=SIGUSR1 piik` 会请求本地导出,不会停止容器;
ZIP 保存在挂载的日志目录中。
</details>
[镜像版本与发布](../standards/versioning.md#container-distribution)
在 Linux 上使用 systemd 可让 Piik Server 在后台常驻。如果已通过 Docker Compose 部署,请到容器一节查看更新与备份。首次安装请先阅读[部署指南](./self-hosting.zh-CN.md)。
## systemd
@@ -81,6 +26,58 @@ HTTPS 代理与 Piik 在同一主机时,让 HTTP 继续绑定回环地址。
STUN 和可选的 SFU 使用各自的公网 UDP 监听器。已有 nginx 时,可修改
[代理示例](../../deploy/nginx/piik.conf.example)中的域名与证书路径后使用。
## 容器
安装步骤见 [Docker Compose 配置](./self-hosting.zh-CN.md#使用-docker-compose)。
镜像为 `ghcr.io/tntcrafthim/piik`,提供 `latest` 和对应产品版本标签(`vMAJOR.MINOR.PATCH`),
Docker 会按主机架构选择 **linux/amd64** 或 **linux/arm64**。
在 `.env` 中设置 `PIIK_IMAGE` 可固定版本或镜像摘要。
更新需要手动执行;仅拉取镜像不会替换正在运行的容器。
[运行时 Dockerfile](../../deploy/container/Dockerfile)封装已验证的 Server 压缩包,
包括网页界面、许可证声明和 `REVISION`。固定版本的
[Distroless 非 root 基础镜像](https://github.com/GoogleContainerTools/distroless)
包含 CA 证书,没有 shell 或包管理器。镜像的构建、检查和发布由
[发布流程](../standards/versioning.md#container-distribution)管理。
使用既有的[生产配置](../standards/configuration.md)。容器内保留 `LISTEN_HOST=0.0.0.0`,
并继续使用主机已有的 HTTPS/WebSocket 代理。使用 Docker 端口映射且启用 SFU 时,
将 `SFU_PUBLIC_IP` 设为外部可达的服务器 IPv4 地址;容器私网候选无法从互联网访问。
公布的 STUN 域名必须解析到服务器公网地址,UDP 必须能直接到达容器。
[Compose 文件](../../deploy/container/compose.yaml)将 HTTP 绑定到主机回环地址,
公布标准 UDP 端口,并启用自动重启。公布端口不会开启对应服务,可选监听器由 `.env` 控制。
修改监听端口时,同时修改应用配置和端口映射。
请使用主机上的代理,或明确调整代理容器的网络配置;代理容器自己的 `127.0.0.1`
无法访问另一个容器内的 Piik。
镜像中的 `/home/nonroot` 属于 UID/GID `65532:65532`,权限为 `0700`。
新的命名数据卷继承该目录;已有数据卷或绑定挂载需要事先允许该身份写入。
替换容器时保留这个数据卷。设置 `ROOM_DATABASE_PATH=:memory:` 可让房间权威状态只保存在内存中。
诊断保持手动开启,使用 `/home/nonroot/logs`;[导出与保留](../standards/configuration.md#diagnostics)
由运维人员负责。不要将应用文件挂载为可写。
启用诊断后,`docker compose kill --signal=SIGUSR1 piik` 会请求本地导出,不会停止容器;
ZIP 保存在挂载的日志目录中。
从主机与公网代理检查 `/healthz`,再按[运行验证](#运行验证)检查已配置的 STUN/SFU UDP,
以及房间和媒体行为。镜像内没有基于 shell 的健康检查。
替换前保留旧镜像、环境配置与数据卷备份。记下旧镜像的标签或摘要以便回滚,然后在 `.env` 中将 `PIIK_IMAGE` 设为要安装的 2.x 版本。在部署目录执行:
```sh
docker compose pull
docker compose stop
docker compose cp piik:/home/nonroot ./piik-data-backup
docker compose up -d
docker compose logs --tail=50 piik
```
每次使用新的备份目录。复制 SQLite 前先停止 Piik,确保数据库和日志文件一致。
单独保存 `.env`,并将配置和数据备份视为房间凭据加以保护。
保留同一个 Compose 项目与目录,以便继续使用原命名数据卷;
`docker compose down --volumes` 会删除这些数据。
回滚时,恢复之前的镜像设置与兼容配置,再重新创建服务。
跨越存储格式边界前,先阅读发布说明。裸机部署脚本 `release-server.sh` 不管理容器。
## 运行验证
1. 在服务器本机和公网 HTTPS 地址分别打开 `/healthz`,两处都应返回 `{"status":"ok"}`。
+3 -7
View File
@@ -78,13 +78,9 @@ and WebSocket signaling passes through to the room service. Media remains P2P.
For updates, follow the [application release boundary](../deployment.md#release-boundary)
and its artifact verification, health checks and recovery rules. Routine application
rollback restores the previous executable while keeping current room data. On the Demo host, set `RELEASE_DESCRIPTOR` to the uploaded descriptor's absolute path and run from the release checkout:
```sh
sudo env PIIK_PUBLIC_ORIGIN=https://demo.piik.tv bash deploy/release-server.sh --demo-caddy "$RELEASE_DESCRIPTOR"
```
The updater checks Caddy and verifies removal of the previous bundle directly at the origin.
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.
## Maintenance
+4 -4
View File
@@ -56,10 +56,10 @@ the task or destination. The documentation home and the sidebar use the
destination's page or section title. In the product, place the relevant help
beside the symptom and link directly to its solution. Lead with
the answer or the first action, then say what success looks like. If it fails,
use an observable difference to choose the next check. Verify affected languages'
links, search terms and headings against realistic questions; check phone and
desktop layouts when navigation or presentation changes. Use the on-screen
wording for common errors. Place an annotated image or a crop from the real interface beside
use an observable difference to choose the next check. Verify each language's
links, search terms and headings against realistic questions on a phone and desktop.
For a common error, use its on-screen wording and link each observable symptom
to an action. Place an annotated image or a crop from the real interface beside
a step when readers need to find a control or recognize a result.
[Diátaxis how-to guides](https://diataxis.fr/how-to-guides/) ·
[Microsoft procedure style](https://learn.microsoft.com/en-us/style-guide/procedures-instructions/writing-step-by-step-instructions) ·
+6 -3
View File
@@ -334,9 +334,12 @@ English first. Use `###` for language sections and `####` for categories when
both are needed.
Choose public highlights that help someone decide to update or try a changed
feature. Use concise text and link to the relevant guide for instructions.
Keep candidate previews, screenshots and internal evidence in the private
review checklist unless the owner requests them in the public notes.
feature. When a control is hard to locate, show a screenshot of the released
interface. When timing or movement matters, link a short recording of the
actual interaction and describe the result in text. Reuse public guide media
where available, with a version-pinned public URL that also opens from the
AtomGit description. Verify public links as a signed-out reader. Keep candidate
previews, local paths and internal evidence in the private review checklist.
The approved final description must read as one release when several unpublished
commits are included. Preview the rendered aggregate with at most one bilingual
+5 -4
View File
@@ -1,6 +1,6 @@
# Current TODO Ledger
Last reviewed: 2026-11-21
Last reviewed: 2026-11-09
This ledger contains unfinished work and explicit owner holds. Product modules
own behavior; research and Git/PRs own evidence and completed history.
@@ -17,9 +17,8 @@ own behavior; research and Git/PRs own evidence and completed history.
to identify the failing transition before changing capture or service lifetime.
- [ ] **Release mirror platform integration.** Verify a supported way to create
the platform's Release tag or trigger its immediate synchronization during
publication. The v2.8.0 mirror is waiting for its tag. Resume from the
[original build](https://github.com/TNTcraftHIM/Piik/actions/runs/44881655913)
once the tag arrives. [Mirror operations](./operations/github.md#atomgit-download-mirror) owns setup.
publication. Do not assume disabling Pull synchronization makes the repository
writable. [Mirror operations](./operations/github.md#atomgit-download-mirror) owns setup.
- [ ] **Windows sound only works with exclusion (#534).** Compare the affected
application's playback endpoint with Piik's default-endpoint capture. The
[audio scope control](./research/native-client-media.md#windows-audio-exclusion)
@@ -96,6 +95,8 @@ own behavior; research and Git/PRs own evidence and completed history.
## Held By Owner
- [ ] **2.x maintenance release approval.** The owner reviews the tested candidate
and the complete change set since `v2.7.0` before publication.
- [ ] **iOS native App.** Paused in favor of Browser use. Preserve the isolated
implementation on `feat/ios-client`; native development and publication stay
outside the current phase.
-1
View File
@@ -30,7 +30,6 @@ const nonProductPaths = [
"scripts/*-gate.*", "scripts/*-probe.*", "scripts/browser-*", "scripts/encoded-*",
"scripts/*-gate-endpoint.ts", "scripts/embedded-sfu-page.ts", "scripts/peer-assisted-benchmark.ts",
"scripts/network-lab.ts", "scripts/network-lab/**",
"deploy/release-server.sh",
"cmd/piik-peer-gate/**",
].map((path) => `:(top,glob,exclude)${path}`);
+1
View File
@@ -26,6 +26,7 @@ const sceneControls = {
'share-source-confirm': ['.lr-source-picker-panel', '.lr-source-option'],
'sharing-settings': ['.lr-sharing-panel'],
'room-voice': ['.lr-interaction-panel:has([id$="-voice-tab"][aria-selected=true])', '.lr-scene button[popovertarget]', '.lr-interaction-panel [role="tab"][id$="-voice-tab"]'],
'touch-joystick': ['.lr-tv:has([data-docked=left] > .lr-remote-stick):has([data-docked=right] > .lr-remote-stick)', '.lr-remote-direction[data-side=left] > button', '.lr-remote-direction[data-side=right] > button'],
'share-failure': ['dialog.lr-share-help[open]', 'button.lr-status-indicator'],
'viewer-route-failure': ['.lr-tv-screen'],
};
+1 -1
View File
@@ -51,7 +51,7 @@ export default {
class: 'article-home',
href: withBase(lang.value === 'zh-CN' ? '/zh/' : '/'),
}, [h('span', { 'aria-hidden': 'true' }, '←'), lang.value === 'zh-CN' ? 'Piik 文档中心' : 'Piik Documentation']),
'doc-after': () => h('p', { class: 'docs-license' }, [
'doc-bottom': () => h('p', { class: 'docs-license' }, [
h('a', { href: withBase('/third-party-licenses.txt') },
lang.value === 'zh-CN' ? '第三方软件许可' : 'Third-party licenses'),
]),
+10 -14
View File
@@ -51,10 +51,7 @@ html[data-reduced-motion] .identity * { animation: none !important; }
}
.help-hero::after {
content: ""; position: absolute; z-index: -1; inset: 8% 3% 5% 59%;
background: url("../../../assets/living-room.svg") center / contain no-repeat;
}
@media (prefers-reduced-motion: reduce) {
.help-hero::after { background-image: url("../../../assets/living-room.svg#still"); }
background: url("../../../assets/living-room.svg#still") center / contain no-repeat;
}
.help-hero h1 { max-width: 60%; font-size: clamp(34px, 4.6vw, 62px); line-height: 1.08; font-weight: 740; letter-spacing: -.045em; text-wrap: balance; }
.help-hero p { max-width: 55%; margin: 10px 0 20px; color: var(--muted); line-height: 1.6; }
@@ -69,7 +66,7 @@ html[data-reduced-motion] .identity * { animation: none !important; }
.help-search kbd { display: none; }
}
.help-sections { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 4vw, 48px) clamp(24px, 6vw, 80px); margin-top: 32px; }
.help-actions { grid-column: 1 / -1; }
.help-actions, .help-hosting { grid-column: 1 / -1; }
.help-sections h2 { margin-bottom: 12px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; letter-spacing: -.025em; font-weight: 700; }
.help-actions ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.help-sections li { position: relative; color: var(--muted); }
@@ -78,19 +75,20 @@ html[data-reduced-motion] .identity * { animation: none !important; }
.help-actions li a { display: block; margin-bottom: 4px; font-size: 19px; color: var(--ink); }
.help-sections li a:only-of-type::before { content: ""; position: absolute; inset: 0; }
.help-sections li:has(a:hover) { background: var(--control-hover); }
.help-sections li:has(a:focus-visible), .help-sections a:focus-visible, .help-search:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; }
.help-sections li a:focus-visible { outline: none; }
.help-sections li:has(a:focus-visible), .help-search:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; }
.help-actions li::after { content: "→"; position: absolute; inset-inline-end: 14px; top: 18px; pointer-events: none; color: var(--action-text); }
.help-issues li, .help-resources li { padding: 11px 4px; border-bottom: 1px solid var(--line); line-height: 1.5; }
.help-hosting { padding-block-start: 24px; border-top: 1px solid var(--line); }
.help-home .VPPage > div > p:last-child { margin-top: 24px; color: var(--muted); }
.help-home .header-anchor { display: none; }
.vp-doc h1 { font-size: clamp(32px, 4vw, 46px); line-height: 1.13; }
.vp-doc h1 + p { color: var(--muted); font-size: 1.1em; }
.vp-doc details { background: var(--wall); }
.vp-doc details summary { color: var(--action-text); }
@media (max-width: 700px) {
.help-hero { display: grid; border-radius: 18px; }
.help-hero::after { position: static; height: 100px; margin-top: 16px; }
.help-hero h1 { max-width: none; }
.help-hero { border-radius: 18px; }
.help-hero::after { inset: 6px 8px auto auto; width: 25%; height: 66px; }
.help-hero h1 { max-width: 78%; }
.help-hero p, .help-search { max-width: none; width: 100%; }
.help-sections, .help-actions ul { grid-template-columns: 1fr; }
.help-sections { gap: 28px; margin-top: 24px; }
@@ -102,8 +100,6 @@ html[data-reduced-motion] .identity * { animation: none !important; }
.help-actions li a { margin: 0; }
}
.help-issues-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 12px; }
.help-issues-heading h2 { margin-bottom: 0; }
.help-issues > p { margin-top: 12px; color: var(--muted); line-height: 1.5; }
.help-issues-heading a, .help-issues > p a { color: var(--action-text); text-decoration: underline; text-underline-offset: 3px; }
.help-sections > section > p { margin-top: 16px; }
.help-sections > section > p a { color: var(--action-text); text-decoration: underline; text-underline-offset: 3px; }
.help-actions li > a + br { display: none; }
+8 -8
View File
@@ -308,10 +308,10 @@
<span lang="en"
>Select <strong>Start sharing</strong>. On a computer, use <strong>Browser</strong> to choose a screen, window or tab.
You can also choose <strong>Camera</strong> on a supported computer or phone browser.
Once the preview appears, select <strong>Copy</strong> under <strong>Admission</strong>.</span
Once the preview appears, select <strong>Copy invite link</strong>.</span
><span lang="zh-CN"
>点击<strong>开始分享</strong>。电脑上可通过<strong>浏览器</strong>选择屏幕、窗口或标签页;
电脑和手机也可选择<strong>摄像头</strong>(需浏览器支持)。预览出现后,在<strong>准入方式</strong>下点击<strong>复制</strong>。</span
电脑和手机也可选择<strong>摄像头</strong>(需浏览器支持)。预览出现后,点击<strong>复制邀请链接</strong>。</span
>
</p>
</li>
@@ -434,10 +434,10 @@
>
<p>
<span lang="en"
>Check the preview and select <strong>Copy</strong> under <strong>Admission</strong>. Keep both the App and sharing tab
>Check the preview and select <strong>Copy invite link</strong>. Keep both the App and sharing tab
open until you finish.</span
><span lang="zh-CN"
>确认预览后在<strong>准入方式</strong>下点击<strong>复制</strong>。分享期间保持 App
>确认预览后点击<strong>复制邀请链接</strong>。分享期间保持 App
和分享标签页打开,结束时点击<strong>停止分享</strong>。</span
>
</p>
@@ -548,9 +548,9 @@
<p>
<span lang="en"
>Select <strong>Start sharing</strong> and choose a source. Check the preview, then
select <strong>Copy</strong> under <strong>Admission</strong> and send the link to your friends. Keep the App and sharing tab open.</span
<strong>Copy invite link</strong> and send it to your friends. Keep the App and sharing tab open.</span
><span lang="zh-CN"
>点击<strong>开始分享</strong>并选择来源,确认预览后,在<strong>准入方式</strong>下点击<strong>复制</strong>,再把链接发给朋友。
>点击<strong>开始分享</strong>并选择来源,确认预览后,<strong>复制邀请链接</strong>发给朋友。
分享期间保持 App 和分享标签页打开。</span
>
</p>
@@ -672,8 +672,8 @@
</details>
<details id="faq-coplay">
<summary><span lang="en">Can a friend play the game on my computer?</span><span lang="zh-CN">朋友能一起玩我电脑上的游戏吗?</span></summary>
<p lang="en">Yes. Share your game from the desktop App, enable <strong>Remote control</strong> and accept your friend’s request. Games with local multiplayer can have several players. <a href="./docs/remote-control.html?lang=en">Remote control and playing together</a></p>
<p lang="zh-CN">可以。用电脑上的 Piik App 分享游戏,打开<strong>远程控制</strong>,同意朋友的控制请求。游戏支持本地多人模式时,几位朋友可以一起玩。<a href="./docs/zh/remote-control.html">远程控制与多人同乐</a></p>
<p lang="en">Yes. Share your game from the desktop App, enable <strong>Remote control</strong> and accept your friend’s request. Games with local multiplayer can have several players. A friend on a phone can use the on-screen joystick. <a href="./docs/remote-control.html?lang=en">Remote control and playing together</a></p>
<p lang="zh-CN">可以。用电脑上的 Piik App 分享游戏,打开<strong>远程控制</strong>,同意朋友的控制请求。游戏支持本地多人模式时,几位朋友可以一起玩。用手机的朋友也可以打开屏幕摇杆。<a href="./docs/zh/remote-control.html">远程控制与多人同乐</a></p>
</details>
<details id="faq-hosting">
<summary><span lang="en">Do I need a server to share with friends elsewhere?</span><span lang="zh-CN">和异地的朋友分享,要自己搭服务器吗?</span></summary>
+2 -2
View File
@@ -17,14 +17,14 @@ describe("reader documentation publication", () => {
expect(documentBody(linkedNote, "docs/guide/joining.md")).toBe(linkedNote);
});
it("names homepage task entries after their published article or section", () => {
it("keeps both documentation homepages linked to published article and section titles", () => {
const read = (source: string) => readFileSync(new URL("../" + source, import.meta.url), "utf8");
expect(pages.filter(page => !page.path.startsWith("zh/"))).toHaveLength(14);
expect(pages.filter(page => page.path.startsWith("zh/"))).toHaveLength(14);
for (const homepage of pages.filter(page => page.path === "index.md" || page.path === "zh/index.md")) {
const entrances = read(homepage.source).match(/<div class="help-sections">([\s\S]*?)<\/div>/)?.[1];
expect(entrances, homepage.source).toBeTruthy();
const links = [...entrances!.matchAll(/^- \[([^\]]+)\]\((\.{1,2}\/[^)#]+\.md)(?:#([^)]*))?\)/gm)];
const links = [...entrances!.matchAll(/\[([^\]]+)\]\((\.{1,2}\/[^)#]+\.md)(?:#([^)]*))?\)/g)];
expect(links.length, homepage.source).toBeGreaterThan(0);
for (const [, label, path, fragment] of links) {
const source = posix.join(posix.dirname(homepage.source), path);
+1 -1
View File
@@ -176,7 +176,7 @@ describe("release automation", () => {
for (const path of ["site/film/art.js", "site/docs/package.json", "site/docs/package-lock.json",
"site/docs/.vitepress/config.mjs", "docs/guide/troubleshooting.md", "docs/deployment.md", "README.zh-CN.md",
"scripts/build-website.mjs", "scripts/check-docs.mjs", "scripts/check-container.mjs", "scripts/markdown-slug.mjs", "scripts/release-notes.mjs",
"scripts/publish-container.mjs", "deploy/release-server.sh",
"scripts/publish-container.mjs",
"scripts/app-gate-endpoint.ts", "scripts/client-gate-endpoint.ts",
"scripts/network-lab.ts", "scripts/network-lab/endpoint.ts", "scripts/network-lab/stun/main.go",
"tests/room.test.ts", ".agents/skills/ponytail/SKILL.md", ".github/workflows/website.yml",
-18
View File
@@ -4,24 +4,6 @@ set -euo pipefail
repo_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
release_script="$repo_root/deploy/release-server.sh"
# Run the updater's argument parsing before it accesses the deployment filesystem.
for mode in nginx caddy; do
(
export PIIK_PUBLIC_ORIGIN=https://release.example
if [ "$mode" = caddy ]; then
set -- --demo-caddy /descriptor
expected_origin=http://127.0.0.1:8787
else
set -- /descriptor
expected_origin=$PIIK_PUBLIC_ORIGIN
fi
source <(sed '/^upload_root=/,$d' "$release_script")
test "$1" = /descriptor
test "$proxy_service" = "$mode"
test "$old_asset_origin" = "$expected_origin"
)
done
extract_function() {
awk -v name="$1" '
$0 == name "() {" { capture = 1 }