From 8c839e2316eb61e48935241d80e7e008f3644f0a Mon Sep 17 00:00:00 2001 From: QQ Date: Sat, 14 Nov 2026 14:27:59 +0800 Subject: [PATCH] Import apps/server/.env.example --- apps/server/.env.example | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 apps/server/.env.example diff --git a/apps/server/.env.example b/apps/server/.env.example new file mode 100644 index 0000000..77473f7 --- /dev/null +++ b/apps/server/.env.example @@ -0,0 +1,57 @@ +DSH_SERVER_ACCOUNT=owner@example.com +DSH_SERVER_PASSWORD=replace-with-a-long-random-password +DSH_SERVER_HOST=127.0.0.1 +DSH_SERVER_PORT=8080 +# Must match the browser origin (scheme, hostname, port); use your HTTPS domain behind a proxy. +DSH_SERVER_PUBLIC_URL=http://localhost:8080 +DSH_SERVER_DATA_FILE=./data/state.json + +# Optional: comma-separated trusted reverse-proxy peer IPs. Leave empty (default) +# to disable, so X-Forwarded-For is always ignored and limits use the socket peer. +# Only bare IPv4/IPv6 literals are accepted: ports, CIDR ranges and hostnames +# make the Server fail at startup. In Docker use the proxy container/gateway IP +# as seen from the Server container, not 127.0.0.1 (which is the Server itself). +# The proxy must overwrite X-Forwarded-For with one IP, and the backend must not +# be reachable directly from the public internet. +DSH_SERVER_TRUSTED_PROXY_IPS= + +# Optional: WebSocket hello handshake timeout in milliseconds (1000-60000, default: 5000). +# Values outside the allowed range are ignored with a warning and replaced by the default. +# Increase this value (e.g. 10000-15000) if mobile clients on high-latency cellular networks +# experience frequent handshake timeout disconnects. +DSH_SERVER_HELLO_TIMEOUT_MS=5000 + +# Optional: WebSocket control channel heartbeat interval in milliseconds (5000-120000, default: 25000). +DSH_SERVER_HEARTBEAT_INTERVAL_MS=25000 + +# Optional: WebSocket heartbeat disconnection threshold in milliseconds (default: 75000, max: 600000). +# Must be at least twice the heartbeat interval (>= HEARTBEAT_INTERVAL_MS * 2). +DSH_SERVER_HEARTBEAT_DISCONNECT_MS=75000 + +# Optional: grace period in milliseconds before a half-closed WebSocket is force-terminated +# (100-10000, default: 1000). Only raise this if slow clients need longer to finish the close handshake. +DSH_SERVER_FORCE_TERMINATE_GRACE_MS=1000 + +# Optional: structured logging level ('debug' | 'info' | 'warn' | 'error' | 'silent', default: 'info'). +DSH_SERVER_LOG_LEVEL=info + +# Optional ICE configuration for WebRTC (LAN / P2P / TURN). Leave STUN/TURN empty +# to keep Relay-only behavior; Clients automatically fall back to Relay when a +# WebRTC path is unavailable. +# STUN and TURN URLs are comma-separated and must be reachable by Host/Client: +# DSH_SERVER_STUN_URLS=stun:coturn.example.com:3478 +# DSH_SERVER_TURN_URLS=turn:coturn.example.com:3478?transport=udp,turns:coturn.example.com:5349 +# TURN requires either a coturn deployment using the REST API shared secret +# (static-auth-secret) — the Server then issues short-lived credentials and +# never exposes the secret itself — or a static username/password pair for TURN +# deployments that cannot use a shared secret. Set SECRET or USERNAME+PASSWORD, +# never both; TURN_URLS is required with either. +# DSH_SERVER_TURN_USERNAME=remote +# DSH_SERVER_TURN_PASSWORD=replace-with-a-long-random-password +DSH_SERVER_STUN_URLS= +DSH_SERVER_TURN_URLS= +DSH_SERVER_TURN_SECRET= +DSH_SERVER_TURN_USERNAME= +DSH_SERVER_TURN_PASSWORD= +# TURN credential lifetime in seconds (60-3600, default 300; short-lived only). +DSH_SERVER_TURN_TTL_SECONDS=300