Files
piik/.env.example
T
AAA 6cb0ca1a34 fix: repair media startup and retire shared session resources (#483)
Early video retransmissions could be rejected before an SFU publication admitted its primary stream. The shared RTP reader now restores the associated primary identity before admission. A repository audit also found ownership omissions in Viewer input retirement, queued route work, partially constructed connections and sender-evidence cleanup; each is corrected at its existing owner without changing routing or adaptation policy.

The same phase fixes bounded Linux diagnostic encoding, picker/tooltip keyboard and touch behavior, and stale-language notices. Documentation now reflects current App, room and media lifecycles. Theme-role consolidation remains deferred.

Validation: complete Web check (1,685 tests, type-check and build); Windows Go core tests/vet/cross-builds; Linux CI race/vulnerability checks and all seven package targets; native Linux diagnostic fixtures on both architectures; actual Chromium/Pion SFU decode, live settings, reload/recovery and resource-retirement gate; documentation and website builds. Confirmed defects were compared against their baseline and independently reviewed. No protocol, configuration or persistence migration is required. Physical device limits and unmatched field reports remain open.

## Release notes

### 中文

这是一次分享稳定性与交互细节维护更新,兼容现有 2.x 客户端和站点。

- 修复部分服务器中转开播失败:较早到达的视频重传包不再被误判,导致媒体发布提前结束。
- 修复停播后快速重新分享时,旧任务可能拖延新线路准备的问题。
- 撤销邀请或替换观众会话时,同步清理对应的远控输入身份,保留其他观众的正常使用。
- 改善连接失败、观众反复加入退出后的资源回收;避免 Linux 单路输出的错误信息意外中断整个分享。
- 修正选源、互动和线路提示的键盘/触屏操作;切换语言后,当前校验与错误提示会同步更新。

### English

This maintenance update improves sharing reliability and interaction details. It remains compatible with existing 2.x Apps and Sites.

- Fix an SFU startup failure caused by video retransmissions arriving before the primary stream was admitted.
- Prevent retired sharing tasks from delaying route preparation after a quick stop and restart.
- Retire remote-input identities when invitations are revoked or Viewer sessions are replaced, while preserving other participants.
- Release resources correctly after connection failures and repeated Viewer churn; prevent Linux output diagnostics from unexpectedly ending the whole share.
- Improve keyboard and touch behavior in source selection, interactions and route help. Active validation and error messages now follow language changes.
2026-10-19 04:00:40 +08:00

77 lines
3.8 KiB
Bash

# Application
# Use 127.0.0.1 instead when only a same-host reverse proxy should connect.
LISTEN_HOST=0.0.0.0
PORT=8787
# For LAN viewers, replace localhost with this computer's LAN address.
PUBLIC_BASE_URL=http://localhost:8787
# Leave empty to follow PUBLIC_BASE_URL. For multiple trusted browser addresses,
# list all exact origins (scheme, host and port), including PUBLIC_BASE_URL.
ALLOWED_ORIGINS=
# Optional site access password in every environment. Unset or empty allows
# entry without a site password; room ownership and invitations still apply.
# Non-empty values are matched exactly; spaces and Unicode are supported.
SITE_ACCESS_PASSWORD=
# Rooms persist in rooms.sqlite under the working directory by default (also
# when blank). Set :memory: explicitly for process-memory rooms. Deployments
# should use an access-restricted absolute path outside the release directory,
# preserving the existing database and its writable parent across updates.
ROOM_DATABASE_PATH=
# Optional empty-room recycling. 0 keeps rooms indefinitely (default).
# 3600 expires rooms after an hour with no authenticated participants; when
# all codes are used, the oldest empty room may be reclaimed earlier.
ROOM_EMPTY_TIMEOUT_SECONDS=0
# Viewers per room, excluding the Host. Valid range: 1..20; default: 20.
MAX_VIEWERS_PER_ROOM=20
# Bounded standard-WebRTC relay/SFU controller is active for every room.
# One steady outbound media-copy capacity for every non-server endpoint.
# A peer child or Host SFU publication consumes one copy. Valid values: 1, 2, 3.
ENDPOINT_MEDIA_COPY_CAPACITY=2
# During pre-release route canaries, this enables sanitized room/ordinal events.
# PIIK_DEBUG=route
# Optional in-process automatic SFU fallback. Set SFU_UDP_PORT=7882 to enable;
# unset or empty disables it and fixes Privacy mode on for every room.
# STUN/signaling/P2P remain available. Local App modes never create this listener.
# Ingress uses the 9000-room code capacity; egress uses that capacity times the
# configured per-room Viewer admission.
SFU_UDP_PORT=
# IPv4 bind address, independent of HTTP LISTEN_HOST and advertised media IP.
SFU_LISTEN_HOST=0.0.0.0
# Optional advertised IPv4 override when the listener's address is behind NAT.
SFU_PUBLIC_IP=
# Require server media for every room instead of P2P-first. Requires SFU_UDP_PORT.
SFU_ONLY=false
# Ordinary peer ICE discovery. Production requires at least one STUN URL.
# These are advertised addresses, not local listener addresses. They may use
# an unproxied DNS name distinct from PUBLIC_BASE_URL. Separate URLs with commas.
STUN_URLS=
# Hosted STUN is in-process. With STUN_URLS configured, bind this IPv4 address
# on UDP 3478 (also 3479/3480 below). It is independent of HTTP LISTEN_HOST.
# Local App modes never create these listeners, even with public discovery.
STUN_LISTEN_HOST=0.0.0.0
# Optional bounded NAT traversal support. Current pages use it automatically
# on P2P-first sites after all three local STUN listeners bind. Auxiliary
# discovery uses UDP 3479/3480 at the first STUN_URLS endpoint on UDP 3478.
# Cloud security-group and host firewall rules must also allow these UDP ports.
NAT_PREDICTION_ENABLED=false
# Development example (two processes): Vite serves the Browser on 8787 and
# proxies /api, /healthz and /signal to the Go server on 8788. Keep
# PUBLIC_BASE_URL and ALLOWED_ORIGINS on the Browser origin above.
# PIIK_ENV=development
# PORT=8788
# Production example (keep any chosen password in an untracked environment):
# PIIK_ENV=production
# PUBLIC_BASE_URL=https://share.example.com
# ALLOWED_ORIGINS=https://share.example.com
# SITE_ACCESS_PASSWORD=
# STUN_URLS=stun:stun.example.com:3478
# NAT_PREDICTION_ENABLED=true
# Automatic SFU fallback (does not replace STUN above):
# SFU_UDP_PORT=7882
# SFU_PUBLIC_IP=198.51.100.5
# ENDPOINT_MEDIA_COPY_CAPACITY=2