Files
Piik/docs/operations/self-hosting.zh-CN.md
T
AAA f92162b3bb feat: launch Piik with a unified interface and public website
Piik now has one public presentation and a coordinated App/Server release path. This phase unifies the room UI, rewrites the bilingual README and guides, adds a static website with an inline product film, and prepares matching GitHub/Gitee packages and update links.

The film uses the current homepage and shared product controls on one seekable timeline. Runtime fixes preserve presentation when the App opens a room, normalize Site origins, and keep capture and media-recovery status in the television indicator. New visits use Chinese for a Chinese system language and English otherwise; explicit language and visual-mode choices remain available. An optional site passphrase controls site entry, while room authorization remains enforced.

GitHub is the release authority. Gitee mirrors verified packages and provides update metadata when GitHub is unavailable. Reviewed PR release notes become the GitHub Release description. The separate public demo uses P2P only, with HTTPS and STUN verified.

Validation: 756 Web tests, TypeScript and production build; Go core tests, formatting, vet and available target builds; bounded Windows capture and App/Site interoperability; browser film checks, audible playback and narrow layouts; anonymous Gitee Windows-package download, checksum and launcher/update-link checks. Public demo acceptance covers authenticated WebSocket signaling, synthetic P2P video and room cleanup on one network. macOS/Linux physical capture and the wider device/network/endurance matrix remain explicitly deferred.

Publication builds every package from the merged source SHA. The repository is public, main protection is active, and Pages is configured for piik.tv. CI/publisher and Pages deployment records own publication results.

## Release notes

### 中文

Piik 是免费开源的屏幕共享工具。开个房间,发出邀请,最多 20 位朋友就能用浏览器加入观看。

- 使用浏览器或 Piik App 分享游戏、窗口和整个屏幕。
- 优先建立直连;自托管站点可开启媒体转发作为备用线路。
- Piik App 支持本地房间、临时公网邀请和已有站点。
- Piik Server 内置网页界面、房间管理和连接服务,方便自行部署。
- 提供中英文界面与使用指南,以及 GitHub、Gitee 两条下载线路。

[官网](https://piik.tv) · [在线体验](https://demo.piik.tv) · [使用指南](https://github.com/TNTcraftHIM/Piik/blob/main/docs/guide/getting-started.zh-CN.md) · [自行部署](https://github.com/TNTcraftHIM/Piik/blob/main/docs/operations/self-hosting.zh-CN.md) · [Gitee 下载](https://gitee.com/TNTcraftHIM/Piik/releases)

Windows App 和桌面浏览器是本次主要验证的平台。macOS 和 Linux 尚未经过实机测试,欢迎有设备的朋友测试并反馈。演示站和 App 公网邀请使用 P2P,受限网络下可能无法连接;自托管站点可开启媒体转发。

### English

Piik is free, open-source screen sharing for you and up to 20 viewers. Start a room, send an invitation, and your friends can join in a browser.

- Share games, windows or a whole screen from your browser or Piik App.
- Direct connections come first, with optional media forwarding on self-hosted sites.
- Piik App supports local rooms, temporary public invitations and existing sites.
- Piik Server includes the web interface, rooms and connection services for self-hosting.
- English and Chinese interfaces and guides are available, with GitHub and Gitee downloads.

[Website](https://piik.tv) · [Online demo](https://demo.piik.tv) · [User guide](https://github.com/TNTcraftHIM/Piik/blob/main/docs/guide/getting-started.md) · [Self-hosting](https://github.com/TNTcraftHIM/Piik/blob/main/docs/operations/self-hosting.md) · [Gitee downloads](https://gitee.com/TNTcraftHIM/Piik/releases)

Windows App and desktop browsers are the primary validated paths. macOS and Linux have not yet been tested on physical devices; testing and feedback are welcome. The demo and App public invitations rely on P2P and may not connect on restrictive networks. Self-hosted sites can enable media forwarding.
2026-09-12 22:09:12 +08:00

3.3 KiB
Raw Blame History

部署 Piik Server

English · 简体中文 · 文档导航

Piik Server 将网页、房间管理和可选的媒体转发打包在一个服务端程序中。 解压后即可运行,房间数据保存在 SQLite 中。

先在本机试用

以下服务端操作在 Linux x64 环境中执行。

从 GitHub Releases 或 Gitee 镜像下载 Linux x64 服务端程序包, 解压后,在该目录运行:

./piik-server

打开 http://localhost:8787 即可试用。需要让朋友通过互联网访问时, 继续完成下方配置。如果只想在自己的电脑上临时开房间,可直接使用 Piik App。

对外提供服务

准备一台 Linux x64 服务器,以及一个指向服务器公网 IP 的域名。 下文以 share.example.com 为例,请替换成自己的域名。

1. 配置并启动 Piik

在程序旁新建 .env 文件:

PIIK_ENV=production
LISTEN_HOST=127.0.0.1
PUBLIC_BASE_URL=https://share.example.com
STUN_URLS=stun:share.example.com:3478
MAX_VIEWERS_PER_ROOM=20
SITE_ACCESS_PASSWORD=

使用普通用户,在该目录执行:

./piik-server --check-config
./piik-server

程序会自动读取 .env,并将房间数据保存在工作目录的 rooms.sqlite 中。 SITE_ACCESS_PASSWORD 留空时,进入站点无须口令; 如需设置口令,可填写 8–128 个可见 ASCII 字符。房间邀请与加入权限仍由房主管理。

2. 配置 HTTPS

如果已有 HTTPS 反向代理,将请求转发到 127.0.0.1:8787,并启用 WebSocket 支持。 如果还没有,可以安装 Caddy,在 Caddyfile 中加入:

share.example.com {
    reverse_proxy 127.0.0.1:8787
}

重新加载 Caddy。域名解析正确且 TCP 80/443 可访问时,它会自动申请和续期证书。 具体操作见 Caddy 的 HTTPS 代理说明。

3. 放行端口并检查

在服务器防火墙和云平台安全组中放行 TCP 80/443(HTTPS)和 UDP 3478(STUN)。 TCP 8787 仅供本机反向代理访问。STUN 域名需要直接解析到服务器,不能只经过 CDN 的 HTTP 代理。

打开 https://share.example.com/healthz,应返回 {"status":"ok"}。 随后打开站点,分享一个画面,并用另一台设备加入验证。 上述基础配置使用 P2P 传输,参与者之间需要可用的 UDP 通路。

可选:启用媒体兜底

在 .env 中添加 SFU_UDP_PORT=7882,放行 UDP 7882,再重启 Piik,即可启用自动 SFU 兜底。 如果服务器处于 NAT 后方,还需将 SFU_PUBLIC_IP 设置为外部可达的公网 IPv4 地址。 这项功能由同一个服务端程序提供。

长期运行与更新

需要开机启动时,参阅 systemd 与容器配置。 更新时保留 .env 和 rooms.sqlite:停止服务、备份房间数据、替换新版程序,再启动并检查健康状态和房间访问。 涉及数据格式变化的版本,请先阅读发布说明。

全部配置与端口 · 维护者发版工具