Compare commits

...
Author SHA1 Message Date
illusia 001457d004 fix: validate merged voice fallback and host toolbar features 2026-11-27 08:53:26 +08:00
illusia 02509ea551 Merge PR #64: dock trusted recovery controls in skin toolbars
# Conflicts:
#	package.json
2026-11-27 08:42:18 +08:00
illusia b3104e1411 Merge PR #63: Cloudflare Tunnel voice and WebRTC fallback 2026-11-27 08:41:47 +08:00
OddTurtleHead b6e7b1e4da feat(voice): support Cloudflare Tunnel deployments and WebRTC fallback
Route page and signaling traffic through Cloudflare Tunnel while sending
WebRTC media over direct UDP, with optional TURN REST as a fallback.
When WebRTC was already offered and then fails, stay in the current
session, automatically resume compatibility audio, and keep a Reconnect
WebRTC control. A reconnect retries WebRTC only, leaves compatibility
running until it succeeds, and stays on compatibility if it fails again.

Database schema 14 adds nullable voice override columns and is a one-way
boundary: older binaries reject this database. This change is for review,
not a production rollout.
2026-11-26 23:47:50 +08:00
OddTurtleHead 4e8ea3081c fix(skin): repair host recovery compatibility and placement
Align the toolbar example with its first compatible runtime, restore recovery after shortcut focus leaves, and harden observer scheduling, contrast, floating avoidance, and private selector validation.
2026-11-26 23:06:43 +08:00
OddTurtleHead df826f575e feat(skin): match Classic toolbar icon buttons for host recovery
Add slot appearance "icon" and "icon-and-label", allow an explicit 22px
toolbar height, preserve transparent backgrounds, and introduce hover,
surface, gap, and icon-size tokens so host-owned recovery and library
buttons can match the Classic microphone control. Shortcut and failed-
anchor fallbacks stay full label capsules. Update the example skin, docs,
and tests, including a Classic toolbar fixture.
2026-11-26 23:06:43 +08:00
OddTurtleHead 4131d9c319 fix(skin): keep split fallback capsule clear of docked toolbars at 320px
The library toolbar falls back to the floating capsule when its docked footprint would cover the built-in toolbar in split mode. The fallback was positioned by light-DOM floating avoidance, which cannot see toolbars inside the closed shadow root, so it could land on the still-docked built-in button and hide/cover the library action (GUI retest at 318/320px). Exclude docked toolbar footprints from floating positions, give the slotted capsule the same sibling guard, and assert real elementFromPoint hit testing plus rect disjointness in the 320px iframe fixture.
2026-11-26 23:06:43 +08:00
OddTurtleHead e5c891fc94 fix(skin): verify real launcher dedup and keep split recovery tappable at 320px
- Fall back an overlapping docked recovery toolbar to the visible capsule so
  split built-in/library buttons never cover each other on narrow screens.
- Add browser fixtures mounting real HostChrome + real PluginPanel for group,
  split and legacy capsule modes, including a genuine 320px iframe viewport.
- Assert the real launcher is suppressed by toolbar slots and never duplicated
  after a bad-anchor fallback, with both split toolbars observable and clickable.
2026-11-26 23:06:43 +08:00
OddTurtleHead cfbf488f75 fix(skin): match macOS recovery shortcut by physical key code and forbid toolbar hook attribute 2026-11-26 23:06:43 +08:00
OddTurtleHead 881354e283 feat(skin): dock recovery as host-owned toolbar buttons
Add chrome.json slot mode "toolbar" with grouped and per-action recovery buttons, page-specific anchor candidates and sanitized toolbar style tokens. Keep the floating capsule as the bad-anchor fallback, hide the duplicate plugin launcher, and preserve legacy capsule slots. Document the full contract, add a minimal toolbar example package, and cover the new behavior in unit and browser tests.
2026-11-26 23:06:43 +08:00
illusia 9a12e2ee7b fix(release): package native files for console updates 2026-11-26 16:39:11 +08:00
illusia 3e4be94ae7 release: prepare v0.3.3 2026-11-26 16:30:40 +08:00
illusia 3339d09936 test(updater): stop recovery processes before removing fixtures 2026-11-26 16:20:55 +08:00
illusia 462bab57d2 fix(updater): honor launcher recovery locks during initialization 2026-11-26 16:20:03 +08:00
illusia 6bbc292056 fix(updater): lock launcher recovery and cancel failed downloads 2026-11-26 16:17:08 +08:00
ILLUSIA e3c71f07b1 Merge pull request #62 from OddTurtleHead/fix/updater-recovery-consistency
fix(updater): preserve recovery consistency across interrupted updates
2026-11-26 16:05:42 +08:00
OddTurtleHead cf1cc9fb94 fix(updater): preserve recovery consistency across interrupted updates
Keep health checks, rollback reporting, launcher recovery, and download failure handling consistent so verified updates cannot report false success or crash during recoverable I/O failures.
2026-11-25 23:51:16 +08:00
illusia 6273185afa fix(updater): guard supervised installs and recover interrupted updates 2026-11-25 13:22:39 +08:00
ILLUSIA 0bc2e6cec8 Merge pull request #61 from OddTurtleHead/feat/console-self-update
feat: add verified console self-update for release packages
2026-11-25 13:16:51 +08:00
OddTurtleHead 82b58dbd61 fix(updater): recover interrupted swaps reliably across deployments
- Ship one POSIX launcher that repairs an interrupted code swap before Node
  starts, install it atomically before the swap, and keep it out of
  CODE_ENTRIES so it always survives at the install root.
- Restore from the in-progress task backup (state.json task.id ->
  backups/<id>) first, then the newest complete backup, so a leftover older
  backup never resurrects an obsolete build.
- Add exact-window SIGKILL recovery tests, including the stale-backup case.
- Gate Linux arm64 apply behind a capability check; add five-language copy
  and i18n labels for arm64, lock and unavailable errors.
- Harden the L2 runner handshake and recheck runner health before exit.
2026-11-24 03:13:32 +08:00
OddTurtleHead 699e606da5 fix: harden console self-update for real release packages
- Copy the restart runner with every runtime import (restart-runner.js,
  code-swap.js, version.js, update-state.js) and fail the apply when the
  runner exits during the startup grace window instead of reporting a task
  that never restarted.
- Accept official tar/zip relative symlinks that stay inside the extraction
  root while still refusing absolute, drive-qualified, escaping and hard-link
  entries.
- Have the restart runner take over the update lock for the same task, keep
  live or unreadable locks, and copy EXDEV entries into a temporary name
  before renaming so a partial copy cannot replace the previous tree.
- Disable console apply for Windows release packages with
  WINDOWS_APPLY_UNVERIFIED while still reporting available versions.
- Clarify in zh/en docs and five-language console copy that SHA256SUMS.txt is
  an integrity checksum, not a signature, and that verification targets the
  official Linux x64 build-release.yml package.
- Add tests for the failing EXDEV copy, live/unreadable/dead locks, same-task
  lock takeover, a real spawned runner compiled from source, and
  initialization leaving another live process's task untouched.
2026-11-24 02:40:08 +08:00
OddTurtleHead eb6c4ba857 fix: harden console self-update rollback and deployment checks
Recovered after the original 04bd82e object was lost from the worktree history; the working tree still contained the same ten-file fix (249 insertions).
2026-11-24 02:06:26 +08:00
OddTurtleHead 2de2e23fd3 feat: add verified console self-update for release packages
Check official GitHub Releases, require SHA256SUMS, safely extract and swap release-package code, roll back on failed health checks, and persist task state across restarts. Docker and source deployments stay check-only. Add updater tests, route security tests and five-language admin copy.
2026-11-24 01:44:24 +08:00
illusia ae6788a796 fix: correct recovery placement and quoted skin animations 2026-11-22 17:16:36 +08:00
ILLUSIA 9812a28e5f Merge pull request #60 from OddTurtleHead/fix/skin-css-hardening
feat: integrate host recovery controls with skins and improve compatibility
2026-11-22 17:12:32 +08:00
OddTurtleHead cc36bc4c64 fix: return floating host controls home only after a screen change
Live re-test of a1c8329 on open-voice-surface desktop: toasts no longer pull
the application-library launcher back, but opening the audio-settings modal
did. Its backdrop hid "Share accompaniment", the default bottom-right corner
looked free, the launcher went home, and right after Esc it still covered the
button.

854a488's return-home rule is meant for a stale spot picked for the previous
screen, so apply it only within the screen-change window (home <-> voice page,
skin switch); on the same screen a free-looking default corner may just be
hidden for a moment. The ts3-classic home-return case still passes (it goes
through screenChanged()).

Browser fixture: modal dialog over the corner (fails on a1c8329 and 854a488).
2026-11-16 00:37:46 +08:00
OddTurtleHead 8ca33fd77d fix: look through toasts when placing floating host controls
A toast passing over a skin control hid it from the hit test, so its corner
looked free: with 854a488's return-home rule the application-library launcher
jumped back to its default bottom-right corner on open-voice-surface desktop,
flapped as toasts came and went, and the flap freeze then parked it on
"Share accompaniment" for 10 s.

- Obstacle hit tests look through transient overlays (app.toast) and the other
  host floating control (elementsFromPoint); a modal backdrop or skin layer
  still hides a control.
- While frozen by the anti-flap guard, a control parked on a skin control may
  step off it once per freeze (confirm delay and 1 s interval still apply),
  then holds still.
- Tests: reachableThrough unit test; browser fixture replaying the toast
  sequence and the freeze escape (both fail on 854a488).
2026-11-16 00:24:20 +08:00
OddTurtleHead 99d7b86d09 fix: re-place floating host controls promptly on screen changes
Return to the default corner once it and the current spot are free, and
skip the move confirmation/minimum interval for ~1.5 s after the home <->
voice page switch or a skin switch, so a spot picked for the previous
screen no longer covers controls on the next one (e.g. Export identity).
2026-11-15 23:04:31 +08:00
OddTurtleHead 2b019d82ff fix: harden floating host-control avoidance after review
Independent review of 16e25ea (DeepSeek v4.1 Flash, Qwen4 Max) found the
runtime avoidance could flap, park on protected controls and drift from the
CSS on notched phones. Runtime only; still no skin.css restriction.

- Anti-flap: a move needs the collision to persist ~250 ms, moves are at least
  1 s apart, and more than 6 moves in 10 s park the control at its default
  corner for 10 s (an animated/hostile skin can no longer keep it moving).
- Protected parts now outweigh dialogs and the other host control; ordinary
  buttons inside the protected `app` root (or `home.footer`) are no longer
  weighted as protected.
- Never move onto the last pointer position or the focused control.
- Fold to the compact mark only when that frees at least one control (a
  full-screen click-away layer no longer hides the recovery buttons).
- Score with the live expanded size (language switch) and reset on resize;
  model margins include env(safe-area-inset-*) like the CSS.
- Skip invisible (opacity 0) controls; also count [tabindex], option/switch/
  checkbox/radio roles, iframes and media controls; count the other host
  control once; prefilter by candidate rects (cheap on 3 000-control skins);
  re-check after scrolls; ignore sticky :hover on touch; bind idempotently.
- Tests: weights, fold threshold, pointer, safe area, protected-vs-dialog,
  stability over repeated ticks, two host controls, anti-flap.
2026-11-15 21:38:39 +08:00
OddTurtleHead e46d7a0eb7 fix: move floating host controls off skin controls at runtime
The recovery capsule and the fallback application-library launcher float in
fixed viewport corners. In v0.3.2 that already covered the microphone in the
Persona/host-chrome skins, the whole Harbor audio dock, the Cancel/Create
buttons of mobile bottom sheets and a Send button behind the launcher.

Add host-floating-placement: every 400 ms (and shortly after each click) the
host samples the skin's visible, topmost interactive controls and moves the
floating control to the least-covering corner/edge position, weighting
protected parts and open dialogs higher, avoiding the other host floating
control, and folding the capsule to its mark when every position collides.
It never moves under the pointer or focus and leaves a docked (slotted)
capsule to the slot binding. Runtime only: no new skin.css restriction.
2026-11-15 20:59:48 +08:00
OddTurtleHead 0df25e4892 fix: close review gaps in host-control fonts, on-accent contrast and protected filter values
- Host-owned controls refuse font tokens naming the compiler's scoped skin
  font prefix (ws-), so a skin @font-face gated behind a non-matching @media
  (absent from document.fonts) cannot blank labels after a resize; the theme
  binding also re-reads tokens on viewport resize for @media-scoped tokens.
- A token palette is accepted only if black or white text reaches 4.5:1 on its
  accent; mid-tone accents (~4.23:1) now fall back as a group.
- Protected app-DOM controls reject var()/attr() for filter, clip and
  content-visibility, which could smuggle opacity(0)/rect(0,0,0,0)/hidden past
  the literal hide checks; literal filters and other parts are unchanged.
- Docs and tests updated (unit + headless-Chrome fixture).
2026-11-15 18:04:25 +08:00
OddTurtleHead a353c32892 fix: refresh host-control tokens on late skin CSS, resolve modern colours and refuse skin fonts
- bindHostControlTheme re-applies when <head> stylesheets or root attributes
  change, so a stored skin id themes the floating recovery capsule, skin-load
  banner and authorization dialog once its CSS actually arrives; the recovery
  root pass stands down while a slot binding owns the capsule tokens.
- The shadow-root probe converts oklch()/color-mix() results to sRGB via a
  1x1 canvas instead of silently dropping them to the default palette.
- Host-owned controls ignore font tokens naming a document @font-face, which
  could ship blank glyphs and erase the recovery/consent labels.
- Authorization body text uses the full sanitized foreground (the 76% mix
  could fall under the 4.5 contrast floor); theme refreshes before showModal.
- Browser fixture covers late CSS, oklch and font refusal; docs updated.
2026-11-15 17:14:42 +08:00
OddTurtleHead c1187d12d2 feat: let skins theme every protected control through skin.css and shared host tokens
App-DOM protected parts keep only hide/off-screen/disable guards; host-owned recovery capsule, skin-load banner and authorization dialog read one sanitized --skin-host-* token set with per-part overrides (--skin-recovery-*, --skin-load-recovery-*, --skin-permission-*) via the new host-control-tokens module.
2026-11-15 17:03:07 +08:00
OddTurtleHead 93d221c3ef fix: keep docked recovery capsule off protected controls and address slot review
- Fall back to the default corner when the docked capsule's footprint
  (largest observed size) overlaps a visible protected control; runtime
  check only, no new chrome.json or skin.css restriction.
- Demo skin docks at align:start, away from the audio dock buttons.
- Compact mode: tap/click pins it open (touch), shortcut expansion clears
  when focus leaves; the 5 s full-display hold starts on first dock.
- Built-in button border uses the skin accent only when visible on #fff7ed.
- probeColor no longer misreads a token equal to its sentinel.
- Periodic re-check survives an exception and fails safe to floating.
- Browser fixture exercises bindHostSlot: dock, fallback, anti-flap,
  protected cover, offscreen, unreadable tokens, dispose.
2026-11-15 15:43:08 +08:00
OddTurtleHead aefa0bc163 feat: let skins dock the recovery capsule into their layout with runtime fallback
- chrome.json#slots names an existing skin data-ws-part as anchor for host.recovery
  (align start/center/end, optional compact); host/trusted parts rejected as anchors
- reusable host-slot-placement module: positions the closed-shadow top-layer
  capsule over the anchor, re-checks visibility/size/on-screen/elementFromPoint,
  snaps back to the default corner on any failure with anti-flap re-slotting
- --skin-recovery-* tokens (accent/background/foreground/radius/font/size tier)
  sanitized with 28px minimum hit target and WCAG contrast fallback
- compact mode only after 5s full display post-activation; shortcut always full
- no new skin CSS compile-time restrictions; docs and host-chrome-demo updated
2026-11-15 15:00:24 +08:00
OddTurtleHead fa720bf260 fix: allow protected-part entrance animations and close remaining hide bypasses
Only inspect keyframe frames an animation can rest on, parse animation names correctly, and close remaining hide-selector and value bypasses while still allowing large layout restyles.
2026-11-15 12:13:18 +08:00
OddTurtleHead a4ae4de82f fix: close keyframe bypasses on protected controls without policing skin layout
Hold @keyframes to the same hide/yeet checks as regular declarations,
including escaped and namespaced animation names. Loosen decorative
host-chrome layout locks so open skins can restyle layout freely.
Listen for the recovery shortcut in the capture phase, move the
load-failure banner into the host-owned layer, and fix recovery
aria-labels.
2026-11-15 01:09:42 +08:00
illusia a84f66b47d release: prepare v0.3.2 2026-11-14 23:49:15 +08:00
ILLUSIA af1d1f8a88 Merge pull request #58 from EchoSixHIYA/dev
Merge WebSpeak 0.3.2 updates into master
2026-11-14 23:43:43 +08:00
illusia 2cb8b8d161 Match KAAK plugin launcher icon sizing to rail controls 2026-11-14 23:33:01 +08:00
illusia 12a37fc26f Place KAAK application launcher in the server rail 2026-11-14 23:26:06 +08:00
illusia f20a372f4b docs: update WebSpeak development skills for 0.3.2 2026-11-14 21:48:25 +08:00
illusia 15ca32b7a8 Dock plugin launchers in skins and expose example app settings 2026-11-14 21:35:22 +08:00
illusia 274bd81dc3 Fix workshop installs and make plugin configuration editable 2026-11-14 19:53:26 +08:00
illusia 6a35d9be3d Merge PR #57: integrate host chrome theming and skin recovery 2026-11-14 18:59:15 +08:00
illusia ed752a5a6f docs: show skins in a live TeamSpeak room [skip ci] 2026-11-13 20:31:59 +08:00
illusia 9012448544 release: prepare v0.3.1 2026-11-13 19:52:40 +08:00
illusia a5cf3eeb0c docs: publish November 13 demo notes and skin screenshots 2026-11-13 19:49:31 +08:00
illusia e82116239a fix: improve voice playback, diagnostics and workspace controls 2026-11-13 19:49:31 +08:00
OddTurtleHead f8d61d22ef feat: add host chrome theming and a skin-proof recovery layer
Allow skins to theme host chrome through a second scope and explicit
visibleParts. Official and built-in skins stay decoration-free by
default.

Harden the CSS compiler so skins cannot hide the document root, push
protected controls off-screen, or target the host layer with sibling
selectors. Move recovery and authorization UI into a closed Shadow DOM
on the top layer, so a third-party skin cannot block the built-in
skin reset.
2026-11-11 18:06:20 +08:00
illusia 72d7e6e013 feat: add private expiring workspace invites and restore KAAK home 2026-11-04 17:42:34 +08:00
illusia 33ba062686 docs: automate ecosystem catalog pull requests [skip ci] 2026-11-03 20:42:24 +08:00
illusia 7cc43bb336 fix(mobile): align standalone version fallback with v0.3.0 2026-11-03 20:30:52 +08:00
illusia 42d15c6d32 release: prepare v0.3.0 2026-11-03 20:19:28 +08:00
illusia 360126b14f merge: retain master release and skin startup fixes 2026-11-03 20:13:42 +08:00
illusia 047a40ac4b merge: retain dev security fixes for the 0.3.0 release 2026-11-03 20:13:15 +08:00
illusia 3430a8a753 feat: add plugin application runtime and unified instance authorization 2026-11-03 20:13:01 +08:00
illusia 275e27c4ac fix(security): address PR 48 findings with bounded concurrent authentication
Classify IPv6 subnets numerically, reserve login capacity before hashing, bind authentication to credential revisions, revoke other sessions on password rotation, reuse trusted proxy client keys and bound PCM encoding by monotonic time. Credit ph1gros for the findings and proposed regression cases.
2026-10-26 10:28:45 +08:00
illusia 37f5b86b52 fix(skins): use build version during initial activation 2026-10-25 18:49:21 +08:00
illusia 8bca848c21 docs: refresh multilingual READMEs and organize project assets 2026-10-25 11:26:53 +08:00
illusia ce681f749d feat(plugins): add GitHub store and scoped collaborative panels 2026-10-25 01:42:41 +08:00
illusia dacc4a143f release: prepare v0.2.9 2026-10-24 18:28:03 +08:00
illusia d91e811ede Merge dev into master for v0.2.9 2026-10-24 18:24:04 +08:00
illusia b9fccb8757 feat(channels): render TeamSpeak spacers across skins 2026-10-24 18:16:01 +08:00
illusia 4bff2133b6 fix(admin): correct TeamSpeak member counts and action feedback 2026-10-24 18:16:00 +08:00
illusia 88439181ae fix(skins): sync Discord Voice 1.0.11 layout and controls 2026-10-24 18:16:00 +08:00
illusia 941cff30d7 docs: credit upstream SDK author and skin contributors 2026-10-24 18:15:59 +08:00
illusia 9c4a2c4a51 fix(kaak): identify project links in icon tooltips 2026-10-24 14:11:32 +08:00
illusia bb5905eb39 feat(kaak): add admin and community shortcuts to server rail 2026-10-24 14:03:27 +08:00
illusia 452e6f09ca feat(skins): add persistent voice workspace API and align KAAK 2026-10-24 13:30:50 +08:00
illusia 0af3236c30 feat: add GitHub skin store and organize instance administration
Adopt the pinned published TeamSpeak SDK and direct relay routing.
Add optional TeamSpeak Query administration with encrypted credentials
and separate WebSpeak access, site, operations and skin management.
Distribute Discord Voice through the GitHub skin index, preserve skin
state during updates, and correct KAAK scaling and screen fullscreen.

Validation: 831 tests; backend and frontend builds; five-language UI
checks from narrow screens through 4K and local Query fixture actions.
2026-10-24 12:52:59 +08:00
ILLUSIA c917692b61 Merge pull request #51 from yichen11818/codex/kook-connection-flow
fix(kook): KAAK首次连接后保留语音工作区
2026-10-21 16:39:05 +08:00
yumi bcecf4fed4 fix(kook): keep returning users in the voice workspace 2026-10-21 15:31:19 +08:00
illusia 32d84435ce fix(screen-share): correct fullscreen dimensions 2026-10-18 11:10:54 +08:00
illusia 180bfeb52f fix: harden TeamSpeak detection and clean up departed speakers 2026-10-17 14:55:25 +08:00
illusia 84bdf63514 fix: persist member volume preferences 2026-10-17 12:34:57 +08:00
illusia 54e154be1a release: prepare v0.2.8 2026-10-17 09:53:27 +08:00
illusia 4375f01d05 docs: add Shanghai and Hong Kong demo links 2026-10-16 22:55:29 +08:00
ILLUSIA 6f5f4c9f4d Merge pull request #38 from LainHE/fix/audio-frame-error-reporting-upstream
fix(audio): report discarded frames as route drops, not bad frames
2026-10-16 19:33:23 +08:00
ILLUSIA a9f5a47163 Merge pull request #35 from LainHE/fix/voice-session-connect-window-upstream
fix(voice): never swallow a TeamSpeak drop while the session is settling
2026-10-16 19:33:15 +08:00
ILLUSIA 6bf6544fd6 Merge pull request #37 from LainHE/fix/client-ip-trust-boundary-upstream
fix(voice): only believe forwarding headers from declared proxies
2026-10-16 19:33:07 +08:00
ILLUSIA 9c3b86dc7a Merge pull request #40 from LainHE/fix/webrtc-peer-rollback-upstream
fix(webrtc): roll back the peer when the mixer codec is unavailable
2026-10-16 19:31:00 +08:00
ILLUSIA 411ab57b63 Merge pull request #34 from LainHE/fix/screen-share-viewer-roster-upstream
fix(screen-share): resolve viewer avatars from client ids instead of the roster
2026-10-16 19:30:01 +08:00
ILLUSIA 4de532e56b Merge pull request #31 from LainHE/fix/acceleration-relay-ssrf-upstream
fix(acceleration-relay): 在 DNS 解析后校验目标地址,阻断 SSRF
2026-10-16 19:29:43 +08:00
LainHE e9cec18345 fix(voice): only believe forwarding headers from declared proxies
resolveClientIp() read X-Forwarded-For, then X-Real-IP, then the socket
address, taking whichever parsed first, with no notion of who wrote them.
Every visitor can set those headers on the WebSocket upgrade, so the address
recorded for a connection was chosen by the client rather than observed. It is
logged when the client starts connecting, when it reaches TeamSpeak and when
its session ends, and readConnectionHistory() turns those lines into the source
column of the admin connection log, so a visitor could put any address into the
audit trail.

Nothing else was affected: join, mobile and admin-login rate limiting key on
request.socket.remoteAddress, and the admin audit records no address at all, so
no admission or authentication decision depended on the forwarded value.

Forwarding headers are now read only when the peer that sent them is a declared
proxy. A trusted chain is walked from the hop nearest to us towards the client,
and the first address that is not a trusted proxy is reported, so a value a
client injects to the left of the entry its proxy appended is never recorded.
X-Real-IP is used only for a trusted peer that sent no chain, and never in
preference to one: a proxy appends its peer to X-Forwarded-For, whereas
X-Real-IP is only as good as the proxy configuration and can still carry a
client value if it is forwarded rather than overwritten.

Whoever we believe can choose what we record, so the default trusts loopback
alone. That keeps a reverse proxy on the same host working, including the
published host-network container. WEBSPEAK_TRUSTED_PROXIES takes IPs and CIDRs
for anything else; an invalid entry stops startup instead of silently narrowing
what is trusted.

Tests cover the direct-client case including the mapped IPv4 peer form, the
chain walk over IPv4 and IPv6, chains that are trusted end to end, X-Real-IP
gating, default loopback, CIDR and ::ffff: entries, and rejected
misconfiguration.
2026-10-16 17:48:09 +08:00
LainHE 82957832a5 fix(audio): report discarded frames as route drops, not bad frames
The browser uplink judged an incoming PCM frame before it resolved the audio
route, so a frame that arrived while the route was down was reported as
malformed. Every frame is discarded in that state whatever its size, which made
the error a misattribution and, worse, a spurious client-side failure: the
browser renders `error.code` as a session error, and that code can abort an
in-flight quick connect, because WebClient.vue fails the pending favorite
connection whenever a new error code appears.

Resolve the route first and only then judge the frame. The flow counters are
unchanged: a discarded frame increments `ingressDroppedFrames` exactly once
either way, so the teardown log and the client's `audioStatsProbe` still report
the same numbers, and a malformed frame still never reaches the encoder.

Repeated faults of one kind also produced one JSON error per frame. A client
streaming malformed frames made the server build and send a ~110 byte error for
every frame it received, for a payload that can be as small as a single byte,
while the browser only ever shows the first one: it writes the same error string
into the same state, and Vue does not re-render for an unchanged value.
Rate-limit the reports per fault code so that two different faults cannot hide
each other, and keep counting every discarded frame.

Route those faults to the logger as well. The outbound error is not logged
anywhere, so an operator had no way to notice a client that kept sending
malformed audio until the session was torn down and the full flow stats were
written at once. The warning is raised under the same rate limit, so a broken
client cannot turn it into a new log flood.

Tests: the route-first ordering and the per-code window each have a case that
fails without the change.
2026-10-16 16:42:28 +08:00
LainHE 5cf7331223 fix(webrtc): roll back the peer when the mixer codec is unavailable
`WebRtcAudioSession` builds its `RTCPeerConnection`, attaches the outgoing
track and adds the audio transceiver before it creates the mixer encoder. When
that encoder cannot be created the constructor stops the track and throws, but
it never closed the peer it had already built.

The caller cannot cover for it. `handleWebRtcOffer` assigns the factory result
to a local that starts as `null`:

    let peer: WebRtcAudioSession | null = null;
    ...
    peer = this.createWebRtcSession({ ... });

so a throwing constructor leaves `peer` at `null`, and the catch block's
`if (entry.webrtc === peer) entry.webrtc = null;` and `await peer?.close()` are
both no-ops. The peer was created, never closed, and no handle to it survived
the unwind.

The impact today is bounded, and the defect is the broken invariant rather than
a measured leak: the throw lands before ICE gathering starts, before
`scheduleAudioTick()` and `activityTimer` are installed, and werift's
constructor binds no socket or timer of its own, so the unreachable instance is
reclaimed by garbage collection. But an exception during construction must not
strand a half-built resource, and any acquisition added above that point would
turn this into a real leak.

Close the peer before propagating the failure:

  * `this.peer.close()` now runs before the throw, so the peer is released even
    though the caller never receives the session;
  * `createEncoder` becomes an injectable option on `WebRtcAudioSessionOptions`,
    mirroring `VoiceBridgeDependencies.createEncoder` and `createWebRtcSession`.
    Production still resolves to `new OpusEncoder(AUDIO_SAMPLE_RATE, 1)`, so
    behaviour is unchanged; the seam exists so the failure branch is reachable
    without a machine that happens to lack the native codec.

Covered by a regression test that injects a failing encoder and instruments
`RTCPeerConnection.prototype.close` to count the distinct peers closed during
construction. It reports 0 on the old code and 1 with the fix, in any
environment and with no dependency on native Opus.
2026-10-16 14:55:13 +08:00
LainHE 9873d27222 fix(voice): never swallow a TeamSpeak drop while the session is settling
The gateway only publishes `connected` once the directory snapshot lands in
`sendInitialState()`. Between authenticating and that point the session is in
`syncing` while `hasConnectedOnce` is still false. `onDisconnect` required both
`hasConnectedOnce` and `state === "connected"`, so a transport drop inside that
gap returned early and did nothing:

  * no `disconnected` frame for the browser,
  * no `scheduleReconnect`,
  * no peer/WeRTC rollback, no teardown.

The session stayed in `syncing` with the browser socket still open, the client
kept showing the connecting state forever, and nothing could recover it short
of the user closing the tab. `onKick` had the same gap via its own
`if (!hasConnectedOnce) return;` guard, so a kick or ban during the same window
was silently ignored while the gateway kept the dead session alive.

The window is not momentary. `tsClient.connect()` resolves even when the
directory reconciliation fails (the failure is logged and the explicit snapshot
emit is skipped), and `resetDirectoryForReconnect()` clears the snapshot on
every recovery, so each reconnect attempt opens the window again.

Treat the settling states (`authenticating`, `syncing`) as an explicit concept
and handle transport loss there:

  * a drop during the first connect is a connect failure, not an interruption:
    report `connectionFailed`, close with 4003 and tear the session down;
  * the same reporting is now shared by the rejected-`connect()` path through a
    single `failConnect` helper, so a transport that reports itself twice (a
    `disconnected` event plus a rejected connect) still fails exactly once;
  * a drop during a *reconnect* handshake returns the session to `reconnecting`
    and schedules another attempt instead of stalling in `syncing`;
  * a kick that lands before the session settles is reported and terminal.

A drop on an established session keeps the previous behaviour: `disconnected`
plus a scheduled reconnect.

Covered by three regression tests over the real WebSocket wiring with only the
external SDK stubbed: a drop before the directory sync, a kick in the same
window, and a drop during a reconnect handshake. All three hang on the old code.
2026-10-16 12:23:55 +08:00
LainHE 0ef9b84237 Merge remote-tracking branch 'upstream/master' into tmp-merge-check
# Conflicts:
#	package.json
#	src/server/acceleration-relay.test.ts
#	src/server/acceleration-relay.ts
2026-10-16 10:32:06 +08:00
LainHE bcc78177c2 fix(screen-share): keep the announced viewer count in step with the roster
Two smaller gaps left over from removing the inline avatars.

The announced viewerCount summed the viewer entry ids and the native viewer
ids, while the roster silently dropped ids whose participant had vanished
from the entry map. A client that disappears without passing through the
leave path therefore inflated the count for as long as the stream lived.
Prune those ids, and derive the count in the same call that builds the
roster so the two can no longer disagree.

The legacy inline-avatar path capped each entry at 128 KiB but placed no
bound on the roster total, which still allowed 64 x 128 KiB in a single
broadcast. Bound the total as well; entries past the budget fall back to
the client-side member lookup like any other viewer without an avatar.

Both behaviours are covered by new tests: a dropped entry no longer
inflates the count, and eight 128 KiB avatars are trimmed to the budget
(measured at 1048576 bytes without the bound).
2026-10-16 09:50:26 +08:00
LainHE bfa26da9eb fix(screen-share): resolve viewer avatars from client ids instead of the roster
The screen-share viewer roster embedded every viewer's avatar as a base64
data URL, and the gateway rebroadcast the whole roster to the channel on
every viewer join and leave. With the 64-viewer cap and the 128 KiB avatar
cap that is up to ~8 MB of JSON per event, multiplied by every member of
the channel -- even though the player renders at most five avatars and
every client already holds member avatars from the directory it received
through the connected and memberAvatar messages.

Send the TeamSpeak client id instead and resolve the avatar locally,
mirroring how a stream's ownerClientId already maps to a member card. This
removes the payload entirely rather than trimming it: the roster no longer
scales with avatar size at all.

The legacy inline avatar is still parsed so a newer client keeps working
against an older gateway, and a viewer missing from the local directory
degrades to the existing initial-based avatar fallback.

Verified by a regression test that gives every viewer a 128 KiB avatar and
asserts the roster stays under 16 KiB. Restoring the previous behaviour
makes that assertion fail at 1049182 bytes for eight viewers.
2026-10-16 09:47:01 +08:00
ILLUSIA 7715214f43 Merge pull request #33 from LainHE/fix/acceleration-relay-reconnect-upstream
fix(acceleration-relay): rebuild a self-closed tunnel on reconnect
2026-10-15 22:31:50 +08:00
ILLUSIA 69c2f4776e Merge pull request #32 from LainHE/fix/acceleration-relay-error-handling-upstream
fix(acceleration-relay): 修复 socket 错误监听器内 throw 导致进程崩溃
2026-10-15 22:31:22 +08:00
LainHE 7977572362 fix(acceleration-relay): rebuild a self-closed tunnel on reconnect
An acceleration tunnel can tear itself down on its own: a socket error, a relay
OPEN_ERR/CLOSE frame, or an open timeout runs closeSockets(), which closes both
UDP sockets and leaves every later sendFrame() a silent no-op.

TSClient kept the adapter bound to that tunnel's now-dead local port and only
rebuilt the transport when adapter or client were null. An auto-reconnect
therefore dialed a port nobody reads, and because a closed tunnel reports
nothing, the session could never recover and never surfaced an error either.

- expose isClosed() on AccelerationRelayClient so callers can distinguish a live
  tunnel from one that tore itself down
- drop a stale tunnel together with its adapter and SDK client before connect()
  decides whether to rebuild the transport, detaching first so a late
  "disconnected" from the retired client cannot re-enter the reconnect path
- cover the reconnect guard with regression tests in ts-client.test.ts

Verified: tsc clean; ts-client.test.ts 35/35 pass (incl. the two new guards).
2026-10-15 21:36:31 +08:00
LainHE 96f7fd6783 fix(acceleration-poc): align the relay's target guard with the gateway policy
The PoC relay carried its own copy of the restricted-address check and had
drifted well behind src/security/open-target-policy.ts: it missed multicast,
192.0.0.0/24 and the other special-use ranges, 198.18.0.0/15, the TEST-NET
blocks, fec0::/10, ff00::/8 and 2001:db8::/32. A relay started without
allowPrivate would therefore forward to addresses the gateway refuses, and
nothing exercised the guard, so the gap could not be noticed.

The relay must stay a plain .mjs file that the README documents copying to a
remote host without a build step, so it cannot import the TypeScript policy. The
predicate is mirrored instead and pinned by a parity test that fails the moment
the two classifications disagree.

The parity test lives beside the PoC rather than under src/: .dockerignore
excludes scripts/acceleration-poc from the Docker build context while the
Dockerfile runs `tsc` over src/**, so a copy in src/ would resolve locally and
still break the image build with TS2307.

- mirror isRestrictedAddress() exactly, including fail-closed handling of any
  input that is not a literal public address
- add scripts/acceleration-poc/target-guard-parity.test.mjs comparing both
  implementations across private, loopback, link-local, carrier-grade NAT,
  special-use, IPv6 and IPv4-mapped cases
- assert the guard in the PoC smoke run: a relay without allowPrivate must
  reject loopback, private and IPv4-mapped targets while still serving a public
  one, and the run now fails with the offending target instead of passing
  silently

Verified: tsc clean; `npm run build` and `npm run web:build` succeed with
scripts/acceleration-poc moved aside to reproduce the Docker build context; the
parity test fails when either side drifts; the smoke run reports ssrf_guard_ok
and ACCELERATION_POC_OK after the fix, and fails with a LEAK line per unblocked
target once the guard is weakened; the IPv6 smoke run still reports
IPV6_ACCELERATION_POC_OK.
2026-10-15 21:26:22 +08:00
LainHE 4816c7ea62 fix(acceleration-relay): validate resolved targets to close SSRF
The relay's private-target guard ran on the caller-supplied hostname while the
connection was made to the DNS-resolved address, so any hostname could reach
loopback or an internal host even with allowPrivate=false. IPv4-mapped IPv6
literals such as ::ffff:127.0.0.1 slipped through the IPv6 branch as well.

- reuse isRestrictedAddress() instead of the weaker local isPrivateAddress()
- resolve first, then reject when any resolved address is restricted, so a
  mixed public/private DNS answer cannot be used to reach an internal host
- release the freshly created session before rejecting a blocked target
- add an injectable lookupAddresses option for deterministic tests
- mirror the same resolve-then-validate ordering in the acceleration PoC relay
- add src/server/acceleration-relay.test.ts (6 tests) to the test script

Verified: tsc clean; the 6 new tests fail 4/6 before the fix and pass 6/6 after;
the acceleration PoC still reports ACCELERATION_POC_OK.
2026-10-15 16:34:07 +08:00
LainHE feb50d29c1 fix(acceleration-relay): report socket errors instead of throwing into the void
The relay's socket error listener ended with `throw error`. A listener that throws
escapes EventEmitter.emit, so it became an uncaught exception that terminated the
whole process. Because the throw also aborts the remaining listeners, it prevented
the startup promise from ever settling when the socket failed to bind.

- extract an idempotent shutdown() used by both close() and error handling
- reject the startup promise when the failure happens before listening, so a failed
  bind behaves like any other rejected startup rather than a process crash
- tear the relay down and report via a new onError callback once it is running
- release the socket and sweep interval on a synchronous bind failure, which never
  emits error at all
- add 3 regression tests covering bind failure, a surviving relay after a failed
  sibling startup, and idempotent close
- register the new test file in the npm test list so CI actually runs it

Verified: tsc --noEmit is clean and the 3 new tests pass. Before the fix the same
bind failure terminated the process with an uncaught EADDRINUSE instead of
rejecting the startup promise.
2026-10-15 16:20:19 +08:00
illusia 62af82f253 fix(kaak): keep voice dock controls inside panel 2026-10-14 17:06:44 +08:00
illusia 42a0755ad0 feat(skin): expose visitor count widget for skins 2026-10-14 00:43:43 +08:00
illusia 26c638c2a2 docs: fix public demo links 2026-10-13 11:19:12 +08:00
illusia c19dad513a docs: format changelogs by release version 2026-10-13 10:18:58 +08:00
illusia 21ee7c322d docs: consolidate localized release and skin guides 2026-10-13 10:08:41 +08:00
illusia 4910458408 fix(admin): allow KAAK as default skin 2026-10-13 08:15:24 +08:00
illusia 292b4073b3 release: prepare v0.2.7 2026-10-13 07:35:19 +08:00
illusia 48c2fb3948 Merge dev into master 2026-10-12 23:39:18 +08:00
ILLUSIA 224a641372 fix: repair KAAK controls and add invite link action 2026-10-12 23:38:35 +08:00
illusia 19274cf0ee Merge dev into master
# Conflicts:
#	web/src/voice/screen-share.ts
2026-10-12 23:12:27 +08:00
illusia 45bec91daa fix: correct identity provider test callback 2026-10-12 23:09:24 +08:00
illusia 7fd1ea96fe feat: complete runtime and KAAK skin updates 2026-10-12 23:06:55 +08:00
illusia c994722016 fix(screen-share): preserve AV1 fallback priority 2026-10-12 13:53:52 +08:00
LainHE 7a6e054fe9 fix(screen-share): use sender capabilities for codec preference
setCodecPreferences requires codecs from RTCRtpSender.getCapabilities;
feeding it RTCRtpReceiver.getCapabilities throws InvalidModificationError
in Chrome and the swallowed exception left VP8 as the negotiated codec.
Switch the capability source so H264/AV1 preferences actually apply.
2026-10-12 13:51:49 +08:00
LainHE d919dbd82a feat(web-client): allow users to pick screen share bitrate limit
Add a bitrate select to the screen share settings dialog (auto by
resolution, or a fixed 1.5/3/5/8/12 Mbps cap), persist the choice in
localStorage, and pass it through ScreenShareOutputSettings.maxBitrate
so configureScreenShareVideoSender applies the user-chosen budget
instead of only the height-scaled default.
2026-10-12 13:51:49 +08:00
illusia f74e211d0f Merge pull request #28 from LainHE/pr/screen-share-quality 2026-10-12 13:50:02 +08:00
illusia 458f95c2dc feat: refine KAAK navigation and join experience 2026-10-12 13:49:35 +08:00
illusia 319a16f384 Add server navigation controls across modes 2026-10-12 12:01:51 +08:00
illusia c6eeb49f44 fix: unify KAAK password dialog confirm labels 2026-10-12 11:37:53 +08:00
illusia 05220b7a6e style: include KAAK connection password field 2026-10-12 11:25:49 +08:00
illusia 53324ef02b style: match KAAK password dialogs to reference 2026-10-12 11:23:31 +08:00
illusia 2f5cdcba90 feat: remember server and channel passwords locally 2026-10-12 11:08:35 +08:00
illusia 9c8647df50 fix: pass channel password flags from TeamSpeak SDK 2026-10-12 10:51:34 +08:00
illusia cec2a81549 fix: show password protected channels 2026-10-12 10:34:06 +08:00
illusia ff508a8eb9 Fix collapsed KAAK share stage 2026-10-12 10:03:42 +08:00
illusia 8a46691dbb Fix KAAK screen share layout bounds 2026-10-12 09:58:08 +08:00
illusia 64b24d0452 Expand screen-share player to content width 2026-10-12 09:43:33 +08:00
illusia 833357e278 Fix screen-share letterboxing across skins 2026-10-12 09:38:26 +08:00
illusia acdc7a2330 Fix missing screen share player 2026-10-12 08:25:57 +08:00
illusia 42190909e3 Fix screen share player fallback width 2026-10-12 08:10:17 +08:00
illusia a4e54d6341 Fix screen share player sizing 2026-10-11 23:36:58 +08:00
illusia 13499541e0 fix(voice): enable screen share in built-in member cards 2026-10-11 23:30:09 +08:00
illusia df2ff79e15 fix(skins): show active screen sharing across bundled themes 2026-10-11 23:17:11 +08:00
illusia d9749ac12f docs: record screen-share skin fix verification 2026-10-11 23:06:57 +08:00
illusia 8b5db8af1f fix(skins): expose screen-share status to custom members 2026-10-11 23:06:06 +08:00
illusia 7fe8719812 style: show noise suppression disabled state 2026-10-11 22:20:12 +08:00
illusia 0a77bdcaca docs: record channel tree drag drop work 2026-10-11 22:12:32 +08:00
illusia e800d75b7b feat: restore channel-tree member drag and drop 2026-10-11 22:12:05 +08:00
illusia 3476d4716a feat: add KAAK context menu to channel tree members 2026-10-11 21:40:14 +08:00
illusia 3459c8410c record KAAK menu update status 2026-10-11 21:14:17 +08:00
illusia 10739a7c7e style KAAK member context menu 2026-10-11 21:13:56 +08:00
illusia fb39aabbe2 docs(kaak): record banner handshake fix 2026-10-11 20:41:07 +08:00
illusia 6c57868903 fix(voice): read server banner from client handshake 2026-10-11 20:40:01 +08:00
illusia 398a4d6c7f feat(kaak): render TeamSpeak server banner 2026-10-11 19:50:35 +08:00
illusia 766a9b9b5a feat(kaak): refine compact voice dock controls 2026-10-11 19:30:42 +08:00
illusia 96d2ebae01 feat(kaak): match channel sidebar and audio dock reference 2026-10-11 19:20:57 +08:00
illusia b13bdf1eb2 feat(kaak): add trusted server switcher and channel tree 2026-10-11 18:37:13 +08:00
illusia 17fb27b89a fix: expose server identity and refine KAAK client 2026-10-11 17:14:56 +08:00
illusia e8164abafe docs(kaak): record popover stacking fix 2026-10-11 15:23:16 +08:00
illusia a1051b989e fix(kaak): layer audio popovers above metrics 2026-10-11 15:22:55 +08:00
illusia a84a12ced4 docs(kaak): record control dock fix 2026-10-11 13:02:43 +08:00
illusia 938bb0646d fix(kaak): restore dock controls and feedback 2026-10-11 13:01:47 +08:00
illusia 2f32d47036 docs(kaak): record control dock push 2026-10-11 12:51:02 +08:00
illusia 25148dd343 fix(kaak): move noise control into lower row 2026-10-11 12:49:28 +08:00
Corrupted ILLUSIA cf692174da docs(kaak): record rebuilt skin package 2026-10-11 12:39:11 +08:00
Corrupted ILLUSIA a43e6750ef docs(kaak): record corrected dock layout 2026-10-11 12:37:43 +08:00
Corrupted ILLUSIA 729e413196 fix(kaak): keep noise control in lower row 2026-10-11 12:36:56 +08:00
Corrupted ILLUSIA 93c9c2532a docs(kaak): record dock update pushed 2026-10-11 12:31:59 +08:00
Corrupted ILLUSIA 74ee82a927 feat(kaak): match provided voice dock layout 2026-10-11 12:31:02 +08:00
Corrupted ILLUSIA b9f3272210 docs(kaak): record compact dock push 2026-10-11 10:44:19 +08:00
Corrupted ILLUSIA 0ad7386fcd style(kaak): match supplied compact dock layout 2026-10-11 10:43:31 +08:00
Corrupted ILLUSIA 4adc712562 style(kaak): compact voice control dock 2026-10-11 10:25:33 +08:00
Corrupted ILLUSIA f5c0d66c10 docs(kaak): record 3.1.54 push 2026-10-11 10:13:47 +08:00
Corrupted ILLUSIA 13f4ddac4d feat(kaak): refine voice dock visuals 2026-10-11 10:12:16 +08:00
Corrupted ILLUSIA 16df12e4b2 fix(skin-editor): hide dev controls from visitors 2026-10-11 08:48:36 +08:00
Corrupted ILLUSIA 8cde1eae5a docs(kaak): sync latest checkpoint 2026-10-11 08:37:39 +08:00
Corrupted ILLUSIA 1391e02dd5 feat(kaak): add member card context actions 2026-10-11 08:36:34 +08:00
Corrupted ILLUSIA f3325458f4 docs(kaak): record local acceptance blocker 2026-10-11 08:19:55 +08:00
Corrupted ILLUSIA 72297c79b4 docs(kaak): record member actions checkpoint 2026-10-11 08:14:25 +08:00
Corrupted ILLUSIA bdd8e39a35 feat(kaak): expose member volume actions 2026-10-11 08:12:55 +08:00
Corrupted ILLUSIA 1e4fa08220 docs(kaak): record channel state checkpoint 2026-10-11 07:54:05 +08:00
Corrupted ILLUSIA 9f11d11b55 feat(kaak): isolate chat visibility per channel 2026-10-11 07:53:04 +08:00
Corrupted ILLUSIA fe578bcb60 docs(kaak): record pushed preview checkpoint 2026-10-11 07:43:23 +08:00
Corrupted ILLUSIA 650c1e0a6a style(kaak): animate performance sampling feedback 2026-10-11 07:41:32 +08:00
Corrupted ILLUSIA 5596735d4a style(kaak): unify active speaker feedback 2026-10-11 07:25:32 +08:00
Corrupted ILLUSIA 2ef21a7da5 docs(kaak): clarify branch checkpoint 2026-10-11 07:20:35 +08:00
Corrupted ILLUSIA c5146a5734 docs(kaak): update clone checkpoint 2026-10-11 07:19:23 +08:00
Corrupted ILLUSIA b01127c461 docs(kaak): preserve complete clone worklog 2026-10-11 07:11:10 +08:00
Corrupted ILLUSIA 2e67eaaa54 docs(kaak): record noise controls checkpoint 2026-10-11 07:10:16 +08:00
Corrupted ILLUSIA cb504c95bc feat(kaak): surface noise controls in audio settings 2026-10-11 07:06:49 +08:00
illusia 7c3e32d671 docs(kaak): record audio settings checkpoint 2026-10-11 06:50:19 +08:00
illusia 2a80ade08b feat(kaak): match audio settings layout 2026-10-11 06:49:53 +08:00
Corrupted ILLUSIA 2fcea5622b feat(kaak): unify audio accent feedback 2026-10-11 06:25:33 +08:00
Corrupted ILLUSIA 62a358796f feat(kaak): match KOOK channel typography 2026-10-11 06:14:17 +08:00
illusia 3f68050c81 feat(kaak): refine participant stage feedback 2026-10-11 06:00:05 +08:00
illusia 01ad967e30 feat(kaak): align KOOK brand accents 2026-10-11 05:50:00 +08:00
illusia a73a6b1a1e feat(kaak): refine volume slider states 2026-10-11 05:46:01 +08:00
illusia 0453bc6d4a feat(kaak): match device picker geometry 2026-10-11 05:41:07 +08:00
illusia c29109e898 docs(kaak): clarify voice chat defaults 2026-10-11 05:27:20 +08:00
Corrupted ILLUSIA 794b3f0ae0 docs(kaak): refresh clone checkpoint 2026-10-11 05:22:52 +08:00
Corrupted ILLUSIA 9cc6e7b765 fix(kaak): match audio label typography 2026-10-11 05:20:24 +08:00
illusia fbcbe994f0 fix(audio): keep device menus within viewport 2026-10-11 05:13:13 +08:00
Corrupted ILLUSIA 1951884d12 fix(skin): register public audio controls 2026-10-11 05:06:39 +08:00
Corrupted ILLUSIA 463f803881 fix(kaak): match audio title weight 2026-10-11 04:55:33 +08:00
illusia 61332ed846 fix(audio): show desktop volume controls 2026-10-11 04:45:06 +08:00
Corrupted ILLUSIA f3565f9859 docs(kaak): record successful dev sync 2026-10-11 04:26:20 +08:00
Corrupted ILLUSIA a3bdee9063 fix(kaak): apply skin typography to home surface 2026-10-11 04:24:25 +08:00
Corrupted ILLUSIA 2d92ca82f4 fix(kaak): match audio settings typography 2026-10-11 04:21:12 +08:00
illusia 10379829d8 fix(audio): keep volume hover panels reachable 2026-10-11 04:02:44 +08:00
illusia 5da11b41f9 fix(kaak): smooth member speaking glow 2026-10-11 04:00:04 +08:00
illusia deb5ca4e43 fix(voice): improve performance panel dismissal 2026-10-11 03:53:14 +08:00
illusia 3ff6507943 feat(kaak): animate voice channel group collapse 2026-10-11 03:38:37 +08:00
illusia e02ce7c546 feat(kaak): animate member name hover labels 2026-10-11 03:30:56 +08:00
illusia 8e580e7e18 feat(kaak): match KOOK audio device picker 2026-10-11 03:20:34 +08:00
illusia 70cc6c3bbf docs(kaak): record interaction fidelity audit 2026-10-11 02:47:39 +08:00
illusia ed6bf3a6ec docs(kaak): describe hidden chat panel 2026-10-11 02:20:24 +08:00
illusia 17a76fc1fd docs(kaak): record collapsed chat node 2026-10-11 02:06:33 +08:00
illusia ff207df20d feat(kaak): hide collapsed voice chat panel 2026-10-11 02:05:51 +08:00
illusia 5ca90c0914 docs(kaak): record channel selection feedback 2026-10-11 01:39:45 +08:00
illusia 19e693c270 feat(kaak): show channel join confirmation 2026-10-11 01:39:12 +08:00
illusia 2b6903f00a docs(kaak): record interaction polish progress 2026-10-11 01:32:43 +08:00
illusia 83902e0fb5 feat(kaak): refine interaction feedback and permissions 2026-10-11 01:31:44 +08:00
illusia bdd0c3473c feat(kaak): refine audio controls and diagnostics 2026-10-11 00:47:06 +08:00
illusia afa1e89136 fix(kaak): keep voice heading visible with chat open 2026-10-10 23:53:53 +08:00
illusia 5d27b9e4a8 fix(kaak): match KOOK member name visibility 2026-10-10 23:35:26 +08:00
illusia 7ea19e14eb docs: clarify KOOK channel entry checkpoint 2026-10-10 23:06:18 +08:00
illusia efa8f76787 docs: record KAAK reference checkpoint 2026-10-10 23:04:23 +08:00
illusia 8105a07171 fix(kaak): keep participant names visible 2026-10-10 22:53:56 +08:00
illusia 42cf4fbb8a docs: track KAAK clone progress 2026-10-10 22:40:22 +08:00
Corrupted ILLUSIA a3bf476db6 feat(kaak): show channel occupancy limits 2026-10-10 22:25:01 +08:00
Corrupted ILLUSIA 387462d89a feat(kaak): animate participant membership changes 2026-10-10 22:02:46 +08:00
Corrupted ILLUSIA 498a728d04 feat(kaak): match KOOK muted participant badge 2026-10-10 21:48:28 +08:00
Corrupted ILLUSIA 9c0fa35d38 feat(skin): improve KAAK collapsed voice stage 2026-10-10 21:28:19 +08:00
Corrupted ILLUSIA afc58799d9 feat(kaak): match KOOK voice participant tiles 2026-10-10 21:03:54 +08:00
Corrupted ILLUSIA 212bd9db2c feat(kaak): match KOOK voice dock actions 2026-10-10 20:37:23 +08:00
Corrupted ILLUSIA 5824754912 feat(kaak): match open KOOK voice stage 2026-10-10 20:13:24 +08:00
Corrupted ILLUSIA a1f92cedb2 feat(kaak): keep server rail colors stable 2026-10-10 19:51:00 +08:00
Corrupted ILLUSIA 8aefed83d1 feat(kaak): match KOOK voice chat presentation 2026-10-10 19:40:41 +08:00
Corrupted ILLUSIA 19c85ce1f5 feat(kaak): align voice room with KOOK layout 2026-10-10 19:33:48 +08:00
Corrupted ILLUSIA 7fb5e1d6ea feat(kaak): add collapsible voice channel group 2026-10-10 19:18:52 +08:00
Corrupted ILLUSIA b9c017f9aa feat(kaak): match KOOK server rail icons 2026-10-10 19:11:12 +08:00
Corrupted ILLUSIA d9b83f12cc feat(kaak): enrich channel chat message rows 2026-10-10 18:52:11 +08:00
Corrupted ILLUSIA 36ece5e582 feat(kaak): center voice participant rows 2026-10-10 18:41:05 +08:00
illusia f1f50d393a fix(kaak): keep full voice roster visible 2026-10-10 18:30:29 +08:00
illusia f6ef471960 feat(skins): refine KAAK voice channel chat 2026-10-10 18:25:22 +08:00
LainHE 20bde72c8b fix(screen-share): use sender capabilities for codec preference
setCodecPreferences requires codecs from RTCRtpSender.getCapabilities;
feeding it RTCRtpReceiver.getCapabilities throws InvalidModificationError
in Chrome and the swallowed exception left VP8 as the negotiated codec.
Switch the capability source so H264/AV1 preferences actually apply.
2026-10-10 18:02:36 +08:00
LainHE 1c328995aa feat(web-client): allow users to pick screen share bitrate limit
Add a bitrate select to the screen share settings dialog (auto by
resolution, or a fixed 1.5/3/5/8/12 Mbps cap), persist the choice in
localStorage, and pass it through ScreenShareOutputSettings.maxBitrate
so configureScreenShareVideoSender applies the user-chosen budget
instead of only the height-scaled default.
2026-10-10 18:01:04 +08:00
illusia 7b31c9106a feat(skins): refine KAAK voice room fidelity 2026-10-10 17:15:02 +08:00
illusia 7f5d3e1b3c feat(skins): refine KAAK voice workspace fidelity 2026-10-10 16:27:46 +08:00
illusia ad0aa5c120 fix(skins): correct full-surface layout and KAAK audio dock 2026-10-10 15:53:51 +08:00
illusia 54805f8928 feat(skins): add complete KAAK voice workspace skin 2026-10-10 15:53:51 +08:00
illusia f2e5695bb6 feat(skins): complete visual component CRUD authoring 2026-10-10 15:53:51 +08:00
illusia 3fd8e76a98 test(skins): verify surface deletion recovery 2026-10-10 15:53:51 +08:00
illusia da0472383d fix(skins): preserve screen capture user activation 2026-10-10 15:53:51 +08:00
illusia fd4b0c6da2 test(skins): verify live component CRUD preview 2026-10-10 15:53:51 +08:00
illusia 100a8f49ee test(skins): verify editor focus restoration 2026-10-10 15:53:51 +08:00
illusia 16f28ca348 fix(skins): refresh plugin assets when switching skins 2026-10-10 15:53:51 +08:00
illusia 0c4cc344ef feat(skins): add component authoring workflow 2026-10-10 15:53:51 +08:00
illusia 96c29394f3 feat(skin): add bounded plugin runtime and Harbor voice sample 2026-10-10 15:53:50 +08:00
illusia 8f097ec597 feat(skin): broaden runtime UI output 2026-10-10 15:53:50 +08:00
illusia b0b4a02a21 feat(skin): preserve screen share user gesture 2026-10-10 15:53:50 +08:00
illusia e20219b010 feat(skin): make runtime plugins locally reorderable 2026-10-10 15:53:50 +08:00
illusia 1499d60bc0 feat(skin): add local sibling ordering 2026-10-10 15:53:50 +08:00
illusia 11a07eae0f fix(skin): register runtime plugin layout parts 2026-10-10 15:53:50 +08:00
illusia 35cb6ad6df feat(skin): bridge trusted plugin actions 2026-10-10 15:53:50 +08:00
illusia 1aa29158ef feat(skin): project bounded read data into Wasm plugins 2026-10-10 15:53:50 +08:00
illusia 7650bd650b feat(skin): connect v4 runtime prototype to WebClient 2026-10-10 15:53:50 +08:00
illusia 7993b38eee feat(skin): support approved Wasm plugin prototype 2026-10-10 15:53:50 +08:00
illusia 26b74c5be4 feat(skin): prototype bounded wasm UI event loop 2026-10-10 15:53:50 +08:00
illusia dd0d779e49 feat(skin): render voice members under channels 2026-10-10 15:53:49 +08:00
illusia 54c77bcb27 feat(skin): prototype bounded UI callback inputs 2026-10-10 15:53:49 +08:00
illusia c3810a177a feat(skin): widen bounded wasm ui output 2026-10-10 15:53:49 +08:00
illusia ab36825a56 docs(skin): reject iframe as plugin network boundary 2026-10-10 15:53:49 +08:00
illusia 067f0c4403 feat(skin): expose custom nodes to layout editor 2026-10-10 15:53:49 +08:00
illusia c243f272fe feat(skin): bind plugin approval to package digest 2026-10-10 15:53:49 +08:00
illusia 81c35356b4 feat(skin): validate v4 plugin packages 2026-10-10 15:53:49 +08:00
illusia 17e4d78e52 feat(skin): define full plugin runtime target 2026-10-10 15:53:49 +08:00
illusia d137b41b5c feat(skin): add validated runtime UI output bridge 2026-10-10 15:53:49 +08:00
illusia 7047d71678 feat(skin): add bounded UI output bridge 2026-10-10 15:53:49 +08:00
illusia 849eb1a6d9 feat(skin): expand schema v3 voice interactions 2026-10-10 15:53:49 +08:00
illusia d505815f28 feat(skin): add approved full-page surface composition 2026-10-10 15:53:48 +08:00
illusia eabc78f36a feat(skin): add v3 declarative plugin components 2026-10-10 15:53:48 +08:00
illusia 02441410a0 feat(web): implement open skin layouts and migrate Illusia 2026-10-10 15:53:38 +08:00
illusia 58559cf839 fix(web): unify quick server history and favorites 2026-10-09 13:42:56 +08:00
illusia b6e4d349a2 feat(web): add skinnable favorite server switching 2026-10-09 10:35:01 +08:00
illusia ae1cd707be docs: credit contributor for PR #25 2026-10-09 00:26:27 +08:00
illusia efa0b85a0e fix: preserve invites on nickname lookup failure 2026-10-09 00:26:21 +08:00
Corrupted ILLUSIA 75893339c5 Merge pull request #25 from yichen11818/codex/teamspeak-server-aliases
feat: support TeamSpeak server nickname connections
2026-10-08 23:51:02 +08:00
yumi 60d3cfd569 feat: support TeamSpeak server nickname connections 2026-10-08 23:48:47 +08:00
illusia 35dde81cc2 docs: keep release notes out of project home page 2026-10-08 12:19:19 +08:00
illusia ebca754ca5 docs: refresh v0.2.6 project documentation 2026-10-08 12:07:06 +08:00
illusia 69f8d66ca9 docs: align v0.2.6 packages with supported architectures 2026-10-08 11:29:18 +08:00
illusia 7789758024 fix: provide Opus config for Windows ARM64 2026-10-08 11:17:44 +08:00
illusia c211deeb98 fix: set Android Gradle wrapper executable in CI 2026-10-08 11:13:57 +08:00
illusia aad7833509 fix: build Windows ARM64 Opus with supported toolchain 2026-10-08 11:05:13 +08:00
illusia 39413cf840 fix: update Android release setup action 2026-10-08 10:56:41 +08:00
illusia 50d9d58ad0 release: prepare v0.2.6 multi-architecture packages 2026-10-08 10:50:42 +08:00
illusia 0a552f7ee8 fix: consolidate audited dev updates 2026-10-08 10:32:59 +08:00
illusia 568b8fd8be Prepare 0.2.6-preview and remove private deployment references 2026-10-03 23:25:58 +08:00
illusia d919df1273 docs: close refactor scope with requested acceptance exclusions 2026-10-03 15:54:02 +08:00
illusia 921e83dfb3 fix: acknowledge TS6 screen cleanup and include removal reason 2026-10-03 14:31:45 +08:00
illusia 77fef3bed9 fix: restore input mute after TeamSpeak flood rejection 2026-10-03 14:06:07 +08:00
illusia 2c49ee2599 docs: record Edge dialog blocker and remaining acceptance requirements 2026-10-03 09:50:45 +08:00
illusia 81a860c3df docs: record live multi-speaker mixing and member volume checks 2026-10-03 09:45:16 +08:00
illusia d327c6f179 fix: negotiate only supported Opus audio before WebRTC activation 2026-10-03 09:38:59 +08:00
illusia 7baeff00ba fix: preserve continuous Opus state in WebRTC downlink 2026-10-03 09:28:11 +08:00
illusia 777c779d79 fix: keep accompaniment audible while microphone is muted 2026-10-03 09:18:49 +08:00
illusia 051cb402e5 docs: scope out Android and record requested TeamSpeak connectivity checks 2026-10-02 17:11:28 +08:00
illusia 1791d5946d docs: record clean Android APK installation and cold startup 2026-10-02 01:00:00 +08:00
illusia 39eba1b121 fix: describe administrative audit events in all languages 2026-10-01 20:15:24 +08:00
illusia a195681e78 build: exclude local env files and record clean release validation 2026-10-01 20:03:31 +08:00
illusia 172347aaa7 refactor: remove redundant client style declarations 2026-10-01 19:47:59 +08:00
illusia 8e28bca634 refactor: remove redundant admin style declarations 2026-10-01 19:36:43 +08:00
illusia 4ef7ec5ee3 style: expand client templates and preserve CSS rule order 2026-10-01 19:30:07 +08:00
illusia f18fa63001 refactor: extract voice member cards with page-owned sharing 2026-10-01 19:20:31 +08:00
illusia 6ed8abfb15 refactor: extract sharing views and repair player ownership 2026-10-01 19:11:29 +08:00
illusia 8b6c998c43 refactor: extract audio controls and scope whisper input 2026-10-01 18:58:19 +08:00
illusia d2caaa8f3c refactor: extract settings dialogs and guard pending feedback 2026-10-01 18:45:56 +08:00
illusia 83b2430d18 refactor: extract member panels and constrain action menus 2026-10-01 18:19:24 +08:00
illusia a416e36bd1 refactor: extract client join and chat panels and fit narrow forms 2026-10-01 18:00:31 +08:00
illusia a2f91e606f refactor: separate admin sections and fit narrow navigation 2026-10-01 17:36:54 +08:00
illusia 9dfded0fb7 fix: bind skin loading to the current page and choice 2026-10-01 17:00:05 +08:00
illusia 15e22d3099 fix: scope identity operations to the active dialog 2026-10-01 16:18:20 +08:00
illusia db08fbda6b fix: scope session state and confirm chat destinations 2026-10-01 15:46:52 +08:00
illusia c16d1d4cfb fix: keep voice diagnostics scoped to current media 2026-10-01 15:03:58 +08:00
illusia 5855d0ba67 refactor: scope browser transports and command lifecycles 2026-10-01 14:48:44 +08:00
illusia f11fe26bfe fix: isolate microphone metering resources and stale ticks 2026-10-01 14:16:10 +08:00
illusia 1a46ab83a3 fix: preserve live voice during accompaniment changes 2026-10-01 14:09:32 +08:00
illusia 878e94a93a refactor: scope SDK events and directory state to their session 2026-10-01 13:42:57 +08:00
illusia 2047e30984 fix: keep avatar transfers on their original SDK connection 2026-10-01 13:30:18 +08:00
illusia 3dfd25dab7 fix: bind member avatar downloads to connection lifecycles 2026-10-01 13:25:55 +08:00
illusia c8417edd7d refactor: isolate session audio and harden gateway teardown 2026-10-01 13:16:59 +08:00
illusia 49481145ef fix: prepare microphone graphs before replacing live capture 2026-10-01 12:49:44 +08:00
illusia 3b5c0dfc7d refactor: complete admin translations and responsive toolbar 2026-10-01 12:36:55 +08:00
illusia 525f512f4a fix: bind admin state to request and page lifecycles 2026-10-01 12:11:47 +08:00
illusia 0785f82386 fix: preserve audio capture across device reconfiguration 2026-10-01 11:30:40 +08:00
illusia 797fc135a9 fix: isolate remote playback and microphone recording lifecycles 2026-10-01 11:16:05 +08:00
illusia f0712fa3fc refactor: share admin contracts and isolate page styles 2026-10-01 10:55:36 +08:00
illusia e2f0a43762 fix: cancel stale voice operations and isolate Android startup 2026-10-01 10:08:18 +08:00
illusia 8960189bc7 refactor: isolate gateway commands and screen-sharing coordination 2026-10-01 09:20:11 +08:00
illusia f4cbd61cff refactor: share wire contracts and isolate screen-sharing lifecycle 2026-10-01 09:06:15 +08:00
illusia 541a216c4d test: establish gateway refactoring checks and prevent stale directory entries 2026-10-01 08:34:04 +08:00
illusia aeaeb15965 feat: add Android gateway preview and refactoring plan 2026-10-01 08:13:46 +08:00
illusia 9e2b9bf564 feat: import and export TeamSpeak identities 2026-09-29 11:09:18 +08:00
illusia 0a4fff6f6f feat: report live voice status and harden target handling 2026-09-28 22:28:16 +08:00
575 changed files with 111067 additions and 10820 deletions

No files matched your search

@@ -0,0 +1,54 @@
---
name: webspeak-plugin-development
description: Build, review and package WebSpeak API v2 applications with standard browser code and optional Node services, and automatically submit completed releases to the official catalog by pull request. Use for .wplugin applications rather than .wskin skins.
---
# WebSpeak Application Development
Read the current [application runtime guide](../../../docs/PLUGIN_DEVELOPMENT.md). In a standalone checkout, use `https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/blob/master/docs/PLUGIN_DEVELOPMENT.md`. Require WebSpeak v0.3.0 or later for API v2. API v1 and its shared-room examples are removed.
Develop an independent application, not a list of host business RPC calls. Use ordinary HTML/CSS/JavaScript, browser APIs and optional Node services with author-defined routes, dependencies and state. The host provides authenticated context, configuration, package/lifecycle management and a separate origin. It supplies no room API or feature permission list. Keep application business logic in its package; a host defect or missing general runtime primitive is a separate host change.
Start with `docs/templates/plugin-app/` or the distribution repository's `template/`. Put frontend output under `client/` with relative assets and optional `.mjs/.cjs` activation code under `server/`. Include audited dependencies or bundle them; the host does not run package installers. Native dependencies must match target OS and Node ABI. Build with `node scripts/build-plugin.mjs SOURCE_DIR OUTPUT.wplugin`, or the standalone distribution builder, then import the actual output.
Use `webspeak.ready`, `getContext()`, `onContextChange()` and `signal` for generic context; implement functionality through native browser/Node code. Scope provides admission and a grouping key, not synchronization. Server logic must enforce scope and business access. Prefer host-verified `req.webspeak` over browser-supplied identities or channels. Temporary runtime URLs are credentials: do not persist, broadcast or log them. Backend private configuration is encrypted at rest and omitted from admin reads; public configuration is user-visible.
Treat applications as trusted code. Node services have the WebSpeak OS account's privileges; process separation and heap limits are not a hostile-code sandbox. Frontends use a separate origin with standard browser capabilities. Browser permission, secure-context, user-gesture, CORS and network requirements apply. The shared application origin does not isolate mutually hostile plugins. Explain these boundaries accurately and review dependencies rather than inventing host feature permissions.
Provide responsive light/dark styles and suitable language handling using context. Keep UI in the application panel without relying on skin DOM. Clean timers, subscriptions, media and sockets on exit/revocation. Persist backend state in `dataDir`, never extracted code directories. Implement concurrency and atomic writes appropriate to the application.
Verify import, trust, enable, update, failure/restart, custom routes, persistence and revocation. Collaborative apps need two real browser participants and late-join/concurrent-change/channel-boundary/disconnect tests. Distinguish mocked HTTP, actual processes, browser interactions and independent networks. Claim only demonstrated capabilities. Keep credentials and diagnostics out of artifacts.
After completing development and verification, automatically finish the distribution workflow below; do not stop at a local archive or ask the user to submit it later. Honor explicit local-only/no-push instructions. Review-only, inspection and planning tasks do not trigger publishing. This workflow does not authorize deployment or automatic merging.
## Administrator configuration
- Document each supported field in the plugin repository with its key, input type, required status, default and accepted range or choices. Provide a copyable `config.example.json` with separate `config` (public) and `serverConfig` (private) objects. Mark placeholder credentials and explain where administrators obtain them. Use defaults for optional keys and validate the actual values in the plugin.
- The 0.3.2 admin console has a generic typed editor for objects, lists and primitive values. P2P File Transfer, Watch Together and TSMusicBot have dedicated forms in the admin frontend. A repository example is documentation and does not register a custom form automatically. Keep app-specific form behavior out of the runtime, registry and package validation.
- Verify setting, saving and reloading a configuration in `/admin/plugins`. Test that secret values are masked in inputs and omitted from admin reads, and that keeping a saved secret does not require re-entry. P2P File Transfer exposes `maxFileMiB` and optional `iceServers`. TURN credentials sent to authorized browsers must be client credentials. Watch Together exposes `control` (`everyone` or `host`) and has no private settings.
## Public runtime deployment
A public gateway needs a separate HTTPS origin for apps. Set it in **Plugins → Application runtime** (persisted setting takes precedence) or with `WEBSPEAK_PLUGIN_PUBLIC_ORIGIN`. Proxy that origin to the plugin listener (port `3042` by default), preserving WebSocket upgrades and unbuffered SSE. Loopback development can use the built-in alternate host. If every app reports `PLUGIN_PUBLIC_ORIGIN_REQUIRED`, check the gateway origin setting, DNS, certificate and proxy before rebuilding packages. Verify by opening a real app in a connected voice room and checking that the iframe loads from the configured origin. A bare GET to the origin can return `PLUGIN_NOT_OPEN`; opening an app creates the scoped URL.
## Automatic distribution PR
1. Read the current [application catalog](https://github.com/Huddle-Up-Forge/webspeak-plugin), its default branch, contribution rules, `index.json`, JSON schema, validators and any PR template. Follow the actual repository contract.
2. Maintain source, license, dependencies, build instructions, tests and `.wplugin` in an independent public application repository. Use the task's selected destination; ask only for a genuinely missing owner/name when it cannot be discovered. Commit and push the final package first, then generate and publish default-branch `plugin.json` with the complete API v2 `manifest` and `package.ref/path/sha256`. The catalog requires a full 40-character package commit SHA, not a branch, mutable label, future commit or self-reference. Hash the raw package bytes and follow the catalog's manifest checks. WebSpeak 0.3.2 compares the ID, version, scope set and entry points after API v2 and package validation. Display name, description, author and license may differ at install time. Keep that information accurate and run the catalog's own checks before submission.
3. Fetch the public metadata and pinned package, check identity/manifest/hash and real import, then run the catalog's current checks (currently `npm run verify` and `npm run verify:remote`). Fix failures before marking the submission ready. Bundle audited dependencies in the application package. Never copy business code, archives, secrets or diagnostics into the catalog.
4. For a new listing, add one `{ "id": "<plugin-id>", "repository": "https://github.com/<owner>/<repo>", "metadataPath": "plugin.json" }` under `plugins` in schema 2 `index.json`. Update an existing ID when catalog fields change; never duplicate it or edit unrelated entries. Version-only releases already discoverable through the listed metadata need no empty index PR; report their published metadata and existing listing instead.
5. Open the PR automatically from a focused branch against the actual default branch, or from a fork if needed. Reuse an existing open PR for this contribution. Titles: `feat(plugins): add <plugin-id> v<version>` or `chore(plugins): update <plugin-id> v<version>`. Apply any existing PR template.
Use the catalog's PR template, or `Summary`, `Package`, `Validation` and `Preview` sections when none exists. Include purpose and ID/version; source, author/license, required WebSpeak/API version and scopes; a published UI preview; immutable package commit/path/raw URL and SHA-256; backend presence/dependencies and external configuration; and validation commands with actual results. Cover import/trust/enable/update, persistence, minimize/resume, disconnect/revocation and relevant two-participant tests. Distinguish real independent-network P2P/collaboration testing from same-host browser tests. Confirm that no credentials or temporary runtime URLs are included.
Return and attach the real PR URL when supported, with validation results. Do not auto-merge. If authentication or repository policy blocks submission, retain the reviewable branch/diff, identify the precise blocker and request only what is missing; do not substitute a generic permission question or claim success without a submitted PR.
## Host launcher and application window
WebSpeak owns the launcher, library, pinning and non-modal app window. In 0.3.2 a skin can place the host launcher in a toolbar or sidebar with `voice.plugin-launcher`. The host falls back to its library entry for layouts without a usable slot. The app uses the same iframe and lifecycle contract in all layouts. Apps render their responsive light/dark UI inside the supplied iframe; the host supplies dragging, minimize/maximize/restore and close controls. The host window uses the standard `color-scheme` for its light/dark fallback without inheriting skin component styles. Do not duplicate host window chrome or block the workspace with a page-wide modal backdrop.
Minimizing or switching to the library retains the same iframe and app session. Transfers and playback must survive those actions. Closing the window, replacing the active app or host context revocation ends that session; only one frontend app is currently hosted at a time. Do not equate a hidden iframe with app exit. Verify resize, narrow screens, theme changes, minimize/resume without reload and close/revocation cleanup. Keep the user-facing window focused on functionality and actionable status; omit repeated runtime/permission disclaimers. Administrator trust and security review remain part of enablement.
## Instance authorization
The public host asks once per browser origin for third-party skins and functional applications together. No decision or refusal allows only Day, Night and ILLUSIA; KAAK also requires consent. The last item in the skin menu reopens this setting. Revocation must close/revoke the active frontend application while preserving independently enabled backend services. Do not add per-app copies of the same host authorization prompt, bypass the host gate or confuse this user decision with administrator package trust or browser-native permission prompts.
@@ -0,0 +1,4 @@
interface:
display_name: "WebSpeak Plugin Development"
short_description: "Build portable WebSpeak functional plugins"
default_prompt: "Use $webspeak-plugin-development to build and verify a portable WebSpeak plugin."
@@ -1,32 +1,60 @@
---
name: webspeak-skin-development
description: Create, refine, package, and verify WebSpeak visual skins while preserving the product's translated content, fixed component geometry, and interactions.
description: Develop, review, package, or validate portable WebSpeak .wskin skins, and automatically submit completed releases to the official catalog by pull request. Keep implementation inside the package and use released runtime APIs.
metadata:
short-description: Develop portable WebSpeak skins
---
# WebSpeak skin development
# WebSpeak Skin Development
Use this skill when editing or authoring a WebSpeak `.wskin` package, the ILLUSIA built-in skin, or skin-facing UI hooks. A skin changes artwork and visual treatment; WebSpeak owns page structure, text, and behavior. The administrator console is deliberately outside the skin scope.
Develop the skin as a portable `.wskin` package. A skin task should not require a skin-specific edit to WebSpeak's client, server, shared protocol, or host-widget implementation. The package owns its page/component markup, styling, copy, layout, assets, and supported plugin logic. The host owns TeamSpeak transport, credentials, trusted actions, and the versioned public data/API contract.
## Before editing
## Workflow
- Read [`docs/SKIN_DEVELOPMENT.md`](../../../docs/SKIN_DEVELOPMENT.md) for the current package validator and public hooks.
- Use [`docs/examples/illusia-voice/`](../../../docs/examples/illusia-voice/) and [`docs/examples/ILLUSIA-VOICE.md`](../../../docs/examples/ILLUSIA-VOICE.md) as the reference implementation. Do not restore the removed Aurora Voice sample.
- Inspect the actual component markup for `data-ws-page`, `data-ws-part`, and `data-ws-state` hooks. Treat Vue classes and incidental DOM structure as private.
When a WebSpeak checkout is unavailable, read the [published skin guide](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/blob/master/docs/SKIN_DEVELOPMENT.md) and its examples.
## Preserve the interface
1. Locate the `webspeak-webclient` repository root, then read the single current contract and workflow in `docs/SKIN_DEVELOPMENT.md`. It covers package schemas, runtime data, permissions, actions, security boundaries, and validation. If a request needs an undocumented capability, identify the missing public contract before editing and treat that work as a separate platform change. Inspect the closest example under `docs/examples/`; do not copy unrelated product-specific content.
2. Choose the least complex supported package format that can express the request: CSS/assets for appearance, `content.json` for localized copy, `layout.json` for author defaults, `components.json` for declarative structure and supported interactions, and the documented v4 Wasm plugin path only when local logic is required. JavaScript files in a package are not executed by the current runtime.
3. Keep all skin-authored implementation in the package. Use stable public skin parts, component schema, published context fields, existing host widgets, and permission-gated actions. Do not add a widget, data field, action, CSS hook, or branch to core code for one skin. If a reusable platform capability is missing, identify the exact contract gap and treat it as separate platform work: define a generic, versioned API and compatibility behavior first; only then use that released API from the package.
4. Set a unique skin ID, increment its package version for changed output, and set `minAppVersion` to the lowest compatible WebSpeak runtime. Keep component schema and plugin `apiVersion` aligned with the APIs actually used. Package every referenced image, font, stylesheet, component, and plugin asset. Use only safe package-relative paths; do not depend on local machine files, remote assets, private endpoints, or instance-specific frontend code.
5. Build the `.wskin` from its source directory while including only files declared by the manifest. Validate the finished archive with the repository importer and keep any distributable built-in archive synchronized with its example source. An example README or other undeclared file belongs beside the package, not inside it.
6. Verify the package at the scope of the change: run the skin package and component-schema tests; run the relevant type/build checks; import the exact archive in a compatible WebSpeak runtime. Check desktop and narrow layouts, all supported interface languages, long text, keyboard focus, reduced motion, contrast, and every interaction the skin replaces. For a portability claim, install the same archive (compare its SHA-256) in two instances with the same compatible runtime/API version; do not treat a successful build alone as proof.
- Keep WebSpeak's translations and semantic content as the baseline. Add `content.json` only when a text override is an explicit part of the request; never use it to implement visual artwork.
- Skin only with supported visual CSS and package-local images/fonts. The upload validator rejects layout, positioning, sizing, spacing, clipping, text-flow, and interaction-geometry changes. Do not work around it with selectors, pseudo-elements, or animation.
- Never hide or obstruct critical controls, make a card or player move/resize, change a floating menu into a modal, or make artwork intercept pointer input. Keep `/admin/**` unskinned.
- Use the host's reserved artwork hooks for layered character art and the headphone scene. Prefer transparent assets and `background-size: contain` where the reference requires the full character or chibi to remain visible; arrange the artwork around the fixed hook rather than changing its geometry.
- Build visual depth with separate background, surface, and foreground artwork already exposed by the hooks. Avoid duplicate static decorations when an animated replacement exists. For motion, keep waveforms/sonar smooth and restrained, honor reduced-motion preferences, and retain readable focus, error, mute, and speaking states.
- Keep skin-specific CSS variables under `--skin-*`. Use only package-local assets and confirm their redistribution rights.
## WebSpeak 0.3.2 host controls
## Verify and package
- Use component schema v3 and set `minAppVersion` to at least `0.3.2` when using `voice.plugin-launcher`. Place it once in the voice surface, inside a visible slot. Set `options.pluginPresentation` to `drawer-side` for a sidebar, `drawer-below` for a header button, or `dialog` for the default library. The built-in Day, Night and ILLUSIA skins use the header drawer. The KAAK and Discord examples use the sidebar drawer.
- Style `voice.plugin-launcher`, `voice.plugin-drawer` and `voice.plugin-drawer.app` through the published parts. WebSpeak owns app availability, pinning, authorization and the app window. Layouts without a usable mount can fall back to the host library. In a connected, authorized voice session verify that the launcher mounts in the intended slot, that the drawer stays within desktop and narrow viewports, and that both pinned and unpinned apps open. For KAAK, verify the rail itself and check the package version served by the instance if the launcher still floats.
- For a compact rail, `home.social-links` accepts `options.communityLinks: false` to keep the admin entry and hide community links. The admin console uses host styling. Use `chrome.json#visibleParts` only for documented host decorations. Confirm that the host-owned recovery action remains usable after applying the skin.
- To fold recovery into a skin top bar, declare `chrome.json#slots` with `"mode": "toolbar"` (one grouped entry) or the independent `host.recovery.built-in` / `host.recovery.library` keys. Supply page-specific anchor candidates and `--skin-recovery-toolbar-*` / `--skin-host-toolbar-*` tokens; never target the host toolbar DOM. The host keeps the button labels, click handlers, minimum hit target and floating-capsule fallback, and hides the ordinary plugin launcher so the library has one entry. See [Host chrome toolbar example](../../../docs/examples/HOST-CHROME-TOOLBAR.md).
- Test changes to the public home and voice surfaces with the same released archive. Check cold load for a theme flash, long translations for clipping, and live/shared media for artwork layering. Use a real voice session for interaction claims.
1. Compare the implementation with its visual reference at desktop and narrow widths. Check the homepage, voice workspace, empty chat, member list, screen-share player, selectors, and `/demo`; verify no crop, overflow, text collision, or control overlap.
2. Check all five interface languages, day/night modes, keyboard focus, and reduced-motion behavior. Confirm the admin console is unchanged.
3. Run `npm test` and `npm --prefix web run build`. Fix validator or build failures rather than weakening the layout guardrails.
4. Package the contents of the skin directory so `manifest.json` is at the archive root, then import it through `/admin/skins` and retest the installed `.wskin` in a visitor session.
## Automatic distribution PR
The three shipped skins—default day, default night, and ILLUSIA—are protected built-ins. Do not change their IDs or introduce upload/update flows that can disable, replace, or remove them.
After completing a skin development or update task and its verification, automatically finish the contribution workflow below; do not wait for another instruction to submit the validated contribution. Honor explicit local-only/no-push instructions. Review-only, inspection and planning tasks do not trigger publishing. This workflow does not authorize deployment or automatic merging.
1. Read the current [skin catalog](https://github.com/Huddle-Up-Forge/webspeak-skins), its default branch, `index.json`, contribution rules, and any PR template or checks that exist. Follow the actual catalog contract rather than inventing fields.
2. Keep source, license, build instructions and the validated `.wskin` in an independent public skin repository. Use the destination selected for the task; ask only for a genuinely missing owner/name when it cannot be discovered. Commit and push the package first. Then publish default-branch `skin.json` pointing to its existing full package commit SHA/path with the SHA-256 of the exact archive bytes. Match the package ID, version and `minAppVersion` to the catalog. Keep names, author credits and licenses accurate in both places. WebSpeak 0.3.2 permits display metadata to differ, and catalog publication checks may impose additional requirements. Do not move a published package tag or make metadata reference its own not-yet-created commit.
3. Fetch public metadata and the pinned package as the store would; verify hash, identity, version, compatibility and actual import, and run catalog checks when supplied. The catalog contains an index, not skin source or archives. Exclude credentials, captures, diagnostic reports and unrelated development documents.
4. For a new listing, add exactly one `{ "id": "<skin-id>", "repository": "https://github.com/<owner>/<repo>" }` under `skins` in schema 1 `index.json`. Update an existing ID rather than duplicating it. Under the catalog's current policy, a version-only update is discovered through the skin repository's metadata; if there is no real catalog diff, report the published update and existing listing instead of creating an empty PR.
5. Create a focused branch against the catalog's actual default branch, using a fork if necessary, and open the PR automatically. Reuse an existing open PR for the same contribution. Titles: `feat(skins): add <skin-id> v<version>` or `chore(skins): update <skin-id> v<version>`. Follow the repository's PR template when present.
Use the catalog's PR template, or `Summary`, `Package`, `Validation` and `Preview` sections when none exists. Include purpose and skin ID/version; source, author/license and minimum WebSpeak version; a published screenshot/preview; immutable package commit/path/raw URL and SHA-256; validation commands and actual results, including runtime/browser, desktop/narrow layouts and languages checked. Confirm independent installation and no duplicate ID. State material gaps without claiming unperformed tests.
Return the actual PR URL and validation outcome, and attach the PR to the chat when supported. If authentication or repository policy blocks submission, preserve the reviewable branch/diff, identify the concrete blocker and request only the missing destination or access. Do not claim a PR was submitted when it exists only locally, and do not auto-merge.
## Compatibility and truthfulness
- `minAppVersion` is a lower compatibility bound, not a guarantee that an older or unrelated runtime implements every API. Read the current schema and runtime documentation before using a capability.
- Dynamic values such as public connection state or administrator-configured copy are runtime inputs. The package contains how those values are rendered; it must not bundle secrets or assume a particular server's private configuration.
- An existing host widget is a stable capability the package may declare. Its presence does not authorize changing that widget's implementation for a skin-specific design; use package CSS/components around it where supported.
- Do not describe an unimplemented API as portable, mark a feature complete from schema validation alone, or claim that different runtime versions render identically. Report the tested package hash, compatible runtime/API versions, and any platform gap.
## References
- `docs/SKIN_DEVELOPMENT.md` — the single current reference for skin formats, runtime APIs, permissions, data, actions, CSS hooks, security, and QA.
- `docs/examples/ILLUSIA-VOICE.md` and `docs/examples/OPEN-VOICE-SURFACE.md` — full skin and surface examples.
- `docs/examples/KAAK-VOICE.md` and `docs/examples/DISCORD-VOICE.md` — complete layouts with a sidebar app library.
## Instance authorization
WebSpeak v0.3.0 replaces per-skin consent dialogs with one origin-scoped user decision covering third-party skins and functional apps. Without consent only the fixed official Day, Night and ILLUSIA skins are available; bundled KAAK also requires consent. The host skin switcher owns the final authorization item. Packages must not duplicate or bypass it. Revocation must cancel pending activation, remove third-party CSS/components and stop workers. Continue enforcing manifest permissions, credential redaction, trusted action validation and package digests internally; one-time consent does not extend the public API. See the current guide for release compatibility.
+6
View File
@@ -3,6 +3,10 @@
.claude
node_modules
web/node_modules
mobile/node_modules
web/android
.local-opus-hook.cjs
界面参考
dist
web/dist
data
@@ -13,4 +17,6 @@ scripts/acceleration-poc
*.tar.xz
claude.pem
config.json
.env
.env.*
*.log
+158 -30
View File
@@ -9,20 +9,31 @@ on:
version:
description: Release version without the v prefix
required: true
default: 0.1.3
default: 0.3.3
type: string
permissions:
contents: read
jobs:
windows-x64:
runs-on: windows-latest
verify:
uses: ./.github/workflows/ci.yml
windows:
needs: verify
strategy:
fail-fast: false
matrix:
include:
- arch: x64
runner: windows-latest
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.22.2
architecture: x64
cache: npm
cache-dependency-path: |
package-lock.json
@@ -36,8 +47,6 @@ jobs:
$releaseVersion = $env:RELEASE_REF -replace '^v', ''
npm ci --ignore-scripts --no-audit --no-fund
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
npm run prepare:sdk
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
npm rebuild @discordjs/opus --foreground-scripts --no-audit --no-fund
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
npm --prefix web ci --no-audit --no-fund
@@ -47,20 +56,21 @@ jobs:
npm version --no-git-tag-version $releaseVersion
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
npm --prefix web run build
npm run web:build
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
npm run build
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
npm prune --omit=dev --no-audit --no-fund
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Package and smoke-test Windows x64
- name: Package and smoke-test Windows ${{ matrix.arch }}
shell: pwsh
env:
RELEASE_REF: ${{ inputs.version || github.ref_name }}
PACKAGE_ARCH: ${{ matrix.arch }}
run: |
$ErrorActionPreference = "Stop"
$releaseVersion = $env:RELEASE_REF -replace '^v', ''
$packageName = "webspeak-webclient-v$releaseVersion-windows-x64"
$packageName = "webspeak-webclient-v$releaseVersion-windows-$env:PACKAGE_ARCH"
$packageRoot = Join-Path $env:RUNNER_TEMP $packageName
$runtimeRoot = Split-Path -Parent (Get-Command node).Source
New-Item -ItemType Directory -Path $packageRoot | Out-Null
@@ -88,7 +98,7 @@ jobs:
Copy-Item -Recurse -LiteralPath $packageRoot -Destination $smokeRoot
@{
port = 3040
tsHost = "203.0.113.10"
tsHost = "127.0.0.1"
tsPort = 9987
tsServerPassword = ""
tsServerProtocol = "ts6"
@@ -112,18 +122,28 @@ jobs:
Compress-Archive -LiteralPath $packageRoot -DestinationPath (Join-Path $env:GITHUB_WORKSPACE ($packageName + ".zip")) -CompressionLevel Optimal
- uses: actions/upload-artifact@v4
with:
name: windows-x64
path: webspeak-webclient-v*-windows-x64.zip
name: windows-${{ matrix.arch }}
path: webspeak-webclient-v*-windows-${{ matrix.arch }}.zip
if-no-files-found: error
compression-level: 0
linux-x64:
runs-on: ubuntu-latest
linux:
needs: verify
strategy:
fail-fast: false
matrix:
include:
- arch: x64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.22.2
architecture: ${{ matrix.arch == 'arm64' && 'arm64' || 'x64' }}
cache: npm
cache-dependency-path: |
package-lock.json
@@ -135,23 +155,23 @@ jobs:
set -euo pipefail
release_version="${RELEASE_REF#v}"
npm ci --ignore-scripts --no-audit --no-fund
npm run prepare:sdk
npm rebuild @discordjs/opus --foreground-scripts --no-audit --no-fund
npm --prefix web ci --no-audit --no-fund
current_version="$(node -p "require('./package.json').version")"
if [ "$current_version" != "$release_version" ]; then
npm version --no-git-tag-version "$release_version"
fi
npm --prefix web run build
npm run web:build
npm run build
npm prune --omit=dev --no-audit --no-fund
- name: Package and smoke-test Linux x64
- name: Package and smoke-test Linux ${{ matrix.arch }}
env:
RELEASE_REF: ${{ inputs.version || github.ref_name }}
PACKAGE_ARCH: ${{ matrix.arch }}
run: |
set -euo pipefail
release_version="${RELEASE_REF#v}"
package_name="webspeak-webclient-v${release_version}-linux-x64"
package_name="webspeak-webclient-v${release_version}-linux-${PACKAGE_ARCH}"
package_root="$RUNNER_TEMP/$package_name"
runtime_root="$(dirname "$(dirname "$(command -v node)")")"
mkdir -p "$package_root/web" "$package_root/runtime"
@@ -162,12 +182,9 @@ jobs:
cp "$runtime_root/bin/node" "$package_root/runtime/node"
cp "$runtime_root/LICENSE" "$package_root/runtime/NODE-LICENSE"
chmod 0755 "$package_root/runtime/node"
cat > "$package_root/start-webspeak.sh" <<'LAUNCHER'
#!/usr/bin/env sh
set -eu
cd -- "$(dirname -- "$0")"
exec "$PWD/runtime/node" "$PWD/dist/index.js"
LAUNCHER
# Ship the exact launcher the self-update installer and recovery
# tests use; never maintain a second launcher body in the workflow.
cp "$GITHUB_WORKSPACE/scripts/start-webspeak.sh" "$package_root/start-webspeak.sh"
chmod 0755 "$package_root/start-webspeak.sh"
smoke_root="$RUNNER_TEMP/${package_name}-smoke"
@@ -175,7 +192,7 @@ jobs:
cat > "$smoke_root/config.json" <<'CONFIG'
{
"port": 3040,
"tsHost": "203.0.113.10",
"tsHost": "127.0.0.1",
"tsPort": 9987,
"tsServerPassword": "",
"tsServerProtocol": "ts6",
@@ -197,31 +214,142 @@ jobs:
grep -q '"status":"ok"' <<<"$health"
grep -q "\"version\":\"$release_version\"" <<<"$health"
)
tar -czf "$GITHUB_WORKSPACE/${package_name}.tar.gz" -C "$RUNNER_TEMP" "$package_name"
# Native rebuilds can leave hard-linked objects and Python/toolchain
# symlinks in scratch directories. Ship independent files and keep
# build-only scratch paths out of the portable runtime archive.
tar --hard-dereference \
--exclude='*/@discordjs/opus/build-tmp-*' \
--exclude='*/node_gyp_bins' \
-czf "$GITHUB_WORKSPACE/${package_name}.tar.gz" -C "$RUNNER_TEMP" "$package_name"
# Verify the shipped tarball is accepted by the same extractor and
# package validator used by console updates, including .bin links.
node --input-type=module - "$GITHUB_WORKSPACE/${package_name}.tar.gz" "$RUNNER_TEMP/${package_name}-updater-check" "$release_version" <<'NODE'
import path from 'node:path';
import { rm } from 'node:fs/promises';
import { spawnSync } from 'node:child_process';
import { extractReleaseArchive } from './dist/updater/archive.js';
import { locatePackageRoot } from './dist/updater/code-swap.js';
const [archive, destination, version] = process.argv.slice(2);
try {
await extractReleaseArchive(archive, destination, path.basename(archive));
const root = locatePackageRoot(destination, version, 'linux');
const nativeSmoke = spawnSync(path.join(root, 'runtime', 'node'), ['--input-type=commonjs', '-e', `
const { OpusEncoder } = require('@discordjs/opus');
const encoder = new OpusEncoder(48000, 2);
const packet = encoder.encode(Buffer.alloc(3840));
if (encoder.decode(packet).length !== 3840) throw new Error('Packaged Opus codec failed');
`], { cwd: root, encoding: 'utf8', timeout: 15000 });
if (nativeSmoke.error) throw nativeSmoke.error;
if (nativeSmoke.status !== 0) throw new Error(nativeSmoke.stderr || 'Packaged Opus runtime failed');
console.log(`Console updater accepts ${path.basename(archive)}`);
} finally {
await rm(destination, { recursive: true, force: true });
}
NODE
- uses: actions/upload-artifact@v4
with:
name: linux-x64
path: webspeak-webclient-v*-linux-x64.tar.gz
name: linux-${{ matrix.arch }}
path: webspeak-webclient-v*-linux-${{ matrix.arch }}.tar.gz
if-no-files-found: error
compression-level: 0
android:
needs: verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.22.2
cache: npm
cache-dependency-path: |
package-lock.json
web/package-lock.json
mobile/package-lock.json
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
- uses: android-actions/setup-android@v4
with:
packages: platform-tools
- name: Build Android APKs
env:
RELEASE_REF: ${{ inputs.version || github.ref_name }}
run: |
set -euo pipefail
release_version="${RELEASE_REF#v}"
version_code="$(node -e 'const [major, minor, patch] = process.argv[1].split(".").map(Number); process.stdout.write(String(major * 10000 + minor * 100 + patch))' "$release_version")"
sdkmanager "platform-tools" "platforms;android-36" "build-tools;36.0.0"
npm ci --ignore-scripts --no-audit --no-fund
current_version="$(node -p "require('./package.json').version")"
if [ "$current_version" != "$release_version" ]; then
npm version --no-git-tag-version "$release_version"
fi
npm --prefix web ci --no-audit --no-fund
npm --prefix mobile ci --no-audit --no-fund
npm run android:sync
cd web/android
chmod +x gradlew
./gradlew --no-daemon assembleDebug -PappVersion="$release_version" -PappVersionCode="$version_code"
cd "$GITHUB_WORKSPACE"
mkdir -p release-apks
for apk in web/android/app/build/outputs/apk/debug/app-*-debug.apk; do
abi="${apk##*/app-}"
abi="${abi%-debug.apk}"
cp "$apk" "release-apks/webspeak-android-v${release_version}-${abi}-debug.apk"
done
test "$(find release-apks -maxdepth 1 -name '*.apk' | wc -l)" -eq 3
- uses: actions/upload-artifact@v4
with:
name: android-apks
path: release-apks/*.apk
if-no-files-found: error
compression-level: 0
publish-release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [windows-x64, linux-x64]
needs: [windows, linux, android]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download deployment packages
uses: actions/download-artifact@v4
with:
pattern: '*-x64'
pattern: '*'
path: release-assets
merge-multiple: true
- name: Create checksums
run: |
set -euo pipefail
cd release-assets
sha256sum * > SHA256SUMS.txt
- name: Publish GitHub release
env:
RELEASE_REF: ${{ github.ref_name }}
run: |
node --input-type=module <<'NODE'
import { readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
const tag = process.env.RELEASE_REF;
const languages = [['简体中文', 'zh-CN'], ['English', 'en'], ['Deutsch', 'de'], ['Русский', 'ru'], ['日本語', 'ja']];
const sections = languages.map(([label, locale]) => {
const source = readFileSync(`docs/README.${locale}.md`, 'utf8');
const start = source.indexOf(`### [${tag}](`);
if (start < 0) throw new Error(`Missing ${tag} release notes for ${locale}`);
const remaining = source.slice(start);
const next = remaining.indexOf('\n### [v', 1);
const notes = (next < 0 ? remaining : remaining.slice(0, next)).trim();
return `## ${label}\n\n${notes}\n\n[Project documentation](https://github.com/${process.env.GITHUB_REPOSITORY}/blob/${tag}/docs/README.${locale}.md)`;
});
writeFileSync(join(process.env.RUNNER_TEMP, 'webspeak-release-notes.md'), sections.join('\n\n---\n\n') + '\n');
NODE
- name: Upload GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: WebSpeak ${{ github.ref_name }}
generate_release_notes: true
body_path: ${{ runner.temp }}/webspeak-release-notes.md
files: release-assets/*
+5 -6
View File
@@ -2,8 +2,10 @@ name: Continuous integration
on:
push:
branches: [main]
branches: [dev, master]
pull_request:
workflow_call:
workflow_dispatch:
permissions:
contents: read
@@ -23,13 +25,10 @@ jobs:
- name: Install dependencies
run: |
npm ci --ignore-scripts --no-audit --no-fund
npm run prepare:sdk
npm rebuild @discordjs/opus --foreground-scripts --no-audit --no-fund
npm --prefix web ci --no-audit --no-fund
- name: Build application
run: |
npm run build
npm --prefix web run build
- name: Test and build application
run: npm run verify
docker-smoke:
needs: verify
+6
View File
@@ -14,10 +14,15 @@ env:
IMAGE_NAME: ghcr.io/echosixhiya/webspeak
jobs:
verify:
uses: ./.github/workflows/ci.yml
publish:
needs: verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
@@ -39,6 +44,7 @@ jobs:
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
+24 -1
View File
@@ -1,9 +1,32 @@
node_modules/
dist/
web/dist/
web/skin-wasm-interpreter/target/
mobile/node_modules/
web/android/.gradle/
web/android/build/
web/android/app/build/
web/android/local.properties
web/android/app/src/main/assets/public/
web/android/app/src/main/assets/capacitor.config.json
data/
config.json
*.log
.env
webspeak-update.tar.gz
# Local deployment notes and downloaded artifacts.
/release-artifacts/
/webspeak-deploy*.tar.gz
/webspeak-update*.tar.gz
/teamspeak6-server-linux-amd64.tar.xz
/.local-opus-hook.cjs
/界面参考/stitch_teamspeak_web_interface.zip
claude.pem
# Private credentials and deployment notes stay local.
.env.*
!.env.example
*.pem
*.key
/.claude/
/LOCAL-RELEASE-RUNBOOK.md
/DEPLOYMENT-*.md
-413
View File
@@ -1,413 +0,0 @@
# Changelog
## [0.2.5-preview] — 2026-09-27(相对 0.2.4)
### 中文
- 新增 `.wskin` 视觉皮肤系统:用户可在首页、语音工作区和 `/demo` 选择外观;皮肤可更换背景、美术素材与组件视觉,但页面结构、排版空间、控件位置和交互仍由 WebSpeak 固定提供,管理后台不受皮肤影响。
- 管理员可在皮肤库启用/停用自定义皮肤并指定实例默认皮肤;访客手动选择会保留,未手动选择的访客采用实例默认。默认日间、默认夜间和 ILLUSIA 风是受保护内置皮肤,不能删除、停用或替换。
- 将完成度不足的 Aurora Voice 示例移除,以 ILLUSIA 风作为完整皮肤开发样例;细化首页装饰、语音区跨层级立绘、耳机场景、聊天空状态和屏幕播放器表现,并修复深色模式控件可读性、组件溢出和皮肤加载闪烁。
- 新增官方仓库皮肤开发 Agent Skill,配套更新开发规范与多语言功能说明;访客总数在统计暂不可用时也不会低于当前访客序号。
### English
- Added the `.wskin` visual skin system. Visitors can choose appearances on the home page, voice workspace, and `/demo`; skins may customize artwork and component visuals while WebSpeak retains page structure, layout, control placement, and behavior. The administration console remains unskinned.
- Administrators can enable/disable custom skins and set an instance default. Deliberate visitor choices are preserved; visitors without an explicit choice receive the instance default. Default Day, Default Night, and ILLUSIA are protected built-ins that cannot be removed, disabled, or replaced.
- Removed the unfinished Aurora Voice sample and made ILLUSIA the complete reference skin. Refined homepage artwork, layered voice-room character art and headphone scene, the empty-chat backdrop, and the screen-share player; fixed dark-mode control contrast, overflow, and skin-load flashes.
- Added the repository's official skin-development Agent Skill and synchronized the guide and localized feature notes. The displayed visitor total also remains at least as high as the current visitor ordinal when the counter is unavailable.
### Deutsch
- Das visuelle `.wskin`-System wurde ergänzt. Besucher können das Design auf der Startseite, im Sprachbereich und unter `/demo` wählen. Skins dürfen Grafiken und die visuelle Darstellung anpassen; Seitenstruktur, Layout, Positionen der Bedienelemente und Verhalten bleiben von WebSpeak vorgegeben. Die Administrationskonsole bleibt ungestaltet.
- Administratoren können eigene Skins aktivieren/deaktivieren und ein Standarddesign für die Instanz festlegen. Eine bewusst getroffene Besucherauswahl bleibt erhalten; ohne eigene Auswahl gilt der Instanzstandard. Tagesmodus, Nachtmodus und ILLUSIA sind geschützte integrierte Skins und können weder gelöscht noch deaktiviert oder ersetzt werden.
- Das unfertige Aurora-Voice-Beispiel wurde entfernt; ILLUSIA ist nun das vollständige Referenzdesign. Startseitenkunst, Ebenenillustration und Kopfhörerszene im Sprachbereich, leerer Chat-Hintergrund und Bildschirmfreigabe-Player wurden verfeinert. Außerdem wurden dunkle Bedienelemente, Überläufe und Skin-Ladeblitze korrigiert.
- Der offizielle Skin-Entwicklungs-Agent-Skill des Repositorys wurde ergänzt; Anleitung und lokalisierte Funktionsübersichten wurden aktualisiert. Die Besucher-Gesamtzahl fällt bei nicht verfügbarem Zähler nicht unter die aktuelle Besuchernummer.
### Русский
- Добавлена визуальная система скинов `.wskin`: посетители могут выбирать оформление на главной странице, в голосовом пространстве и в `/demo`. Скины меняют иллюстрации и внешний вид компонентов, а структуру, компоновку, расположение элементов управления и поведение задаёт WebSpeak. Панель администратора не оформляется скинами.
- Администраторы могут включать и отключать пользовательские скины и задавать оформление по умолчанию для экземпляра. Явный выбор посетителя сохраняется; без него используется настройка экземпляра. Дневная тема, ночная тема и ILLUSIA — защищённые встроенные скины, которые нельзя удалить, отключить или заменить.
- Удалён незавершённый пример Aurora Voice; полной эталонной темой стала ILLUSIA. Улучшены иллюстрации главной страницы, многослойный персонаж и сцена с наушниками в голосовой комнате, фон пустого чата и проигрыватель трансляции экрана. Исправлены контраст элементов в тёмном режиме, переполнение и вспышки при загрузке скина.
- В официальный репозиторий добавлен Agent Skill для разработки скинов, обновлены руководство и локализованные описания функций. При недоступности счётчика общее число посетителей не опускается ниже текущего номера посетителя.
### 日本語
- `.wskin` ビジュアルスキン機能を追加しました。ホーム、音声ワークスペース、`/demo` で外観を選択できます。背景や素材、コンポーネントの見た目を変更できますが、ページ構造、レイアウト、操作部品の位置と動作は WebSpeak が管理します。管理コンソールには適用されません。
- 管理者はカスタムスキンの有効/無効と、インスタンスのデフォルトスキンを設定できます。訪問者が明示的に選んだスキンは維持され、未選択の場合はインスタンスのデフォルトを使用します。昼、夜、ILLUSIA の3種類は保護された内蔵スキンで、削除・無効化・置換できません。
- 未完成の Aurora Voice サンプルを削除し、ILLUSIA を完成版のリファレンスにしました。ホームのアート、音声画面の重ね合わせ立ち絵とヘッドホン背景、空のチャット背景、画面共有プレーヤーを調整し、ダークモードの視認性、はみ出し、読み込み時のちらつきを修正しました。
- 公式リポジトリにスキン開発 Agent Skill を追加し、ガイドと各言語の機能説明を更新しました。カウンターを取得できない場合も、訪問者総数が現在の訪問者番号を下回らないようにしました。
## [0.2.4] — 2026-09-22
### 中文
- 新增跨端 P2P 屏幕共享:浏览器用户可以与 TeamSpeak 6 原生客户端互相发现、发起和观看屏幕共享;浏览器之间以及浏览器与原生客户端之间的媒体流优先通过 WebRTC/ICE 直连,WebSpeak 仅负责会话鉴权、共享状态和 SDP/ICE 信令转发,不承载屏幕媒体流量。
- 默认使用 TeamSpeak 官方 STUN 服务发现直连候选,并支持管理员显式配置外部 TURN;即使使用 TURN,媒体也经过外部服务而不是 WebSpeak 网关。
- 新增屏幕共享直播状态、观众人数、播放器音量、全屏和退出控制,并提供发送端/接收端 WebRTC 实时统计。
- 提供浏览器屏幕采集分辨率和帧率设置,最高支持 1080p、60 FPS;设置改为独立弹窗,避免成员卡片被撑高。
- 新增首页访客编号,并优化屏幕共享成员卡片和观看交互。
- 修正输出限制的应用方式:保持所选桌面或窗口的原始采集尺寸,由发送端编码器按设置缩放和限帧;首页同时显示当前访客序号和累计访客数。
- 修复 TeamSpeak 握手期间服务器拒绝错误被误报为连接超时的问题;昵称长度不符合要求时会显示明确的修改提示。
### English
- Added cross-platform P2P screen sharing: browser users can discover, start, and watch screen shares with native TeamSpeak 6 clients. Media between browsers, and between a browser and a native client, prefers a direct WebRTC/ICE path; WebSpeak handles session authorization, share state, and SDP/ICE signaling only and does not carry screen media.
- Added TeamSpeak's public STUN services for direct-candidate discovery by default, with optional administrator-configured external TURN. Even with TURN, media uses the external service rather than the WebSpeak gateway.
- Added live screen-share status, viewer counts, player volume, fullscreen, and exit controls, plus live sender/receiver WebRTC statistics.
- Added browser capture-resolution and frame-rate controls up to 1080p and 60 FPS; moved the controls into a standalone modal so member cards no longer stretch.
- Added homepage visitor numbering and refined screen-share member-card and viewing interactions.
- Fixed output-limit handling so the selected desktop or window keeps its native capture size while the sender encoder applies the requested scale and frame-rate cap; the homepage now also shows the total visitor count.
- Fixed handshake refusals being reported as connection timeouts; invalid nickname lengths now show a clear prompt to change the nickname.
### Deutsch
- Plattformübergreifendes P2P-Bildschirmteilen ergänzt: Browsernutzer können Bildschirmfreigaben mit nativen TeamSpeak-6-Clients erkennen, starten und ansehen. Die Medienübertragung zwischen Browsern sowie zwischen Browser und nativem Client nutzt möglichst direkte WebRTC-/ICE-Verbindungen; WebSpeak übernimmt nur Sitzungsberechtigung, Freigabestatus und SDP-/ICE-Signalisierung und transportiert keine Bildschirmmedien.
- Öffentliche TeamSpeak-STUN-Dienste werden standardmäßig zur Ermittlung direkter Kandidaten verwendet; ein externes TURN kann ausdrücklich durch den Administrator konfiguriert werden. Auch mit TURN läuft die Medienübertragung über den externen Dienst und nicht über das WebSpeak-Gateway.
- Live-Status, Zuschauerzahl, Lautstärke, Vollbild- und Beenden-Steuerung für Bildschirmfreigaben sowie laufende WebRTC-Statistiken für Sender und Empfänger ergänzt.
- Aufnahmeauflösung und Bildrate im Browser bis 1080p und 60 FPS konfigurierbar; die Einstellungen wurden in ein eigenes Modal verschoben, damit Mitgliederkarten nicht mehr in die Höhe wachsen.
- Besucherzählung auf der Startseite ergänzt und die Interaktion von Bildschirmfreigabe-Karten und Player verbessert.
- Die Ausgabelimits werden nun am Sender-Encoder angewendet, während die native Aufnahmegröße des ausgewählten Desktops oder Fensters erhalten bleibt; auf der Startseite wird zusätzlich die Gesamtzahl der Besucher angezeigt.
- Behoben, dass Ablehnungen während des TeamSpeak-Handshakes als Zeitüberschreitung angezeigt wurden; bei ungültiger Nicknamenslänge erscheint nun ein klarer Änderungshinweis.
### Русский
- Добавлена кроссплатформенная P2P-трансляция экрана: пользователи браузера могут обнаруживать, запускать и смотреть трансляции вместе с нативными клиентами TeamSpeak 6. Медиа между браузерами, а также между браузером и нативным клиентом по возможности передаётся напрямую через WebRTC/ICE; WebSpeak отвечает только за авторизацию сессии, состояние трансляции и SDP/ICE-сигналы и не переносит медиаданные экрана.
- По умолчанию добавлено обнаружение прямых кандидатов через публичные STUN-сервисы TeamSpeak; администратор может явно настроить внешний TURN. Даже при использовании TURN медиа идёт через внешний сервис, а не через шлюз WebSpeak.
- Добавлены статус трансляции, число зрителей, громкость проигрывателя, полноэкранный режим и выход, а также текущая статистика WebRTC для отправителя и получателя.
- Добавлены настройки разрешения и частоты кадров захвата в браузере до 1080p и 60 FPS; настройки вынесены в отдельное окно, чтобы карточки участников не растягивались.
- Добавлен номер посетителя на главной странице и улучшено управление карточками и просмотром трансляций.
- Исправлено применение ограничений вывода: выбранный рабочий стол или окно сохраняет исходный размер захвата, а запрошенное масштабирование и ограничение частоты кадров применяются кодировщиком отправителя; на главной странице также показывается общее число посетителей.
- Исправлено ошибочное отображение отказов TeamSpeak во время рукопожатия как тайм-аута; при недопустимой длине имени показывается понятная просьба изменить его.
### 日本語
- クロスプラットフォーム P2P 画面共有を追加しました。ブラウザユーザーは TeamSpeak 6 ネイティブクライアントと互いに画面共有を検出・開始・視聴できます。ブラウザ間、およびブラウザとネイティブクライアント間のメディアは可能な限り WebRTC/ICE で直接送信され、WebSpeak はセッション認証、共有状態、SDP/ICE シグナリングだけを担当し、画面メディアは運びません。
- 初期設定で TeamSpeak 公開 STUN サービスによる直接候補の検出に対応し、管理者が外部 TURN を明示的に設定できるようにしました。TURN 使用時もメディアは外部サービスを経由し、WebSpeak ゲートウェイは経由しません。
- 配信状態、視聴者数、プレーヤー音量、全画面、終了操作と、送信側・受信側の WebRTC 統計を追加しました。
- ブラウザの画面取得設定で最大 1080p / 60 FPS を選択できます。設定を独立したモーダルに移し、メンバーカードが縦に伸びないようにしました。
- ホームページの訪問者番号を追加し、画面共有カードと視聴操作を改善しました。
- 出力制限を送信側エンコーダーで適用するよう修正し、選択したデスクトップやウィンドウの元の取得サイズを維持します。ホームページには訪問者番号に加えて累計訪問者数も表示します。
- TeamSpeak の接続ハンドシェイク中の拒否がタイムアウトとして表示される問題を修正しました。ニックネームの長さが不適切な場合は、変更を促すメッセージを表示します。
## [0.2.3] — 2026-09-19
### 中文
- 新增频道成员调度入口:保留拖放移动,并在右键菜单提供“调度到”二级菜单和“我所在的频道”快捷项。
- 支持按 TeamSpeak 权限直接移动成员;具备权限时无需重复输入频道密码,无权限时不提供该操作。
- 支持成员头像显示、麦克风静音状态同步和保存身份恢复,并增强指针拖动兼容性。
- 更新中文、English、Deutsch、Русский、日本語五种语言的功能截图和文档页面。
- 修复高分辨率桌面端管理员设置页面底部内容被裁切的问题,并收紧中继卡片的宽度约束。
### English
- Added member-management entry points: drag-and-drop remains available, while the context menu now provides a “Move to” submenu with a “My channel” shortcut.
- Added permission-aware direct member moves: authorized users can move clients without redundant channel-password prompts, while the action is unavailable without the required TeamSpeak permission.
- Added client-avatar display, microphone mute-state synchronization, and remembered-identity recovery, with improved pointer-drag compatibility.
- Refreshed feature screenshots and documentation pages for all five supported languages.
- Fixed clipped lower content in the high-resolution desktop admin settings page and tightened relay-card width constraints.
### Deutsch
- Neue Einstiege für die Mitgliederverwaltung: Ziehen und Ablegen bleibt verfügbar, zusätzlich bietet das Kontextmenü ein Untermenü „Verschieben nach“ mit dem Eintrag „Mein Kanal“.
- Direkte, berechtigungsabhängige Mitgliederverschiebung ergänzt: Benutzer mit den erforderlichen TeamSpeak-Rechten benötigen keine erneute Kanalpasswortabfrage; ohne diese Rechte steht die Aktion nicht zur Verfügung.
- Anzeige von Client-Avataren, Synchronisierung des Mikrofon-Stummschaltstatus und Wiederherstellung gespeicherter Identitäten ergänzt; Zeigerbedienung verbessert.
- Funktionsscreenshots und Dokumentationsseiten für alle fünf unterstützten Sprachen aktualisiert.
- Das Abschneiden unterer Inhalte in den Admin-Einstellungen bei hoher Desktop-Auflösung behoben und die Breitenbegrenzung der Relay-Karten verbessert.
### Русский
- Добавлены способы управления участниками: перетаскивание сохранено, а в контекстном меню появился пункт «Переместить в» с быстрым вариантом «Мой канал».
- Добавлено прямое перемещение с учётом прав TeamSpeak: пользователям с нужными правами не нужно повторно вводить пароль канала, а без этих прав действие недоступно.
- Добавлены отображение аватаров клиентов, синхронизация состояния микрофона и восстановление сохранённой идентичности; улучшено перетаскивание указателем.
- Обновлены функциональные скриншоты и страницы документации для всех пяти поддерживаемых языков.
- Исправлено обрезание нижнего содержимого настроек администратора на десктопах с высоким разрешением и ограничена ширина карточек ретрансляторов.
### 日本語
- メンバー操作を追加しました。ドラッグ&ドロップに加えて、コンテキストメニューに「移動先」サブメニューと「自分のチャンネル」ショートカットを用意しました。
- TeamSpeak 権限に応じた直接移動を追加しました。必要な権限があればチャンネルパスワードを再入力せずに移動でき、権限がなければ操作は表示されません。
- クライアントアバターの表示、マイクミュート状態の同期、保存した ID の復元に対応し、ポインター操作も改善しました。
- 対応する 5 言語すべての機能スクリーンショットとドキュメントページを更新しました。
- 高解像度デスクトップで管理設定の下部が切れる問題を修正し、中継カードの幅制約を改善しました。
## [0.2.2] — 2026-09-17
### 中文
- 提供可开关的浏览器端麦克风降噪功能。
- 优化前端音量交互逻辑:桌面端悬停麦克风和整体音量按钮即可调整,降噪开关收纳在麦克风菜单中。
- 在 PR #2 基础上优化错误提示和错误代码显示。
- 提供俄语和日语界面支持,并支持按语言单独调整欢迎文字。
### English
- Added optional browser-side microphone noise suppression.
- Refined volume interaction: desktop microphone and master-volume controls open on hover, with noise suppression in the microphone menu.
- Improved error messages and error-code display on top of PR #2.
- Added Russian and Japanese UI support and per-language welcome text configuration.
### Deutsch
- Optionale browserseitige Mikrofon-Geräuschunterdrückung hinzugefügt.
- Lautstärkeinteraktion verbessert: Desktop-Mikrofon- und Gesamtlautstärkeregler öffnen sich beim Überfahren; die Geräuschunterdrückung befindet sich im Mikrofonmenü.
- Fehlertexte und Fehlercodes auf Basis von PR #2 verbessert.
- Russische und japanische Oberfläche sowie sprachabhängige Begrüßungstexte ergänzt.
### Русский
- Добавлено опциональное шумоподавление микрофона в браузере.
- Улучшено управление громкостью: на компьютере регуляторы открываются при наведении, а шумоподавление находится в меню микрофона.
- Улучшены сообщения и коды ошибок на основе PR #2.
- Добавлены русский и японский интерфейсы и отдельная настройка приветствия для каждого языка.
### 日本語
- ブラウザ側で任意に使えるマイクノイズ抑制を追加しました。
- 音量操作を改善し、デスクトップではマイクと全体音量のボタンにカーソルを合わせると調整画面を表示し、ノイズ抑制をマイクメニューにまとめました。
- PR #2 を基にエラー表示とエラーコードを改善しました。
- ロシア語・日本語 UI と言語別ウェルカム文の設定を追加しました。
## [0.2.1] — 2026-09-13
### 中文
- 统一首页连接错误显示:保留错误代码,未知错误安全截断,并显示可追溯的服务端原因。
- 默认支持 IPv6 TeamSpeak 目标,并补充主机、运行时和网络条件说明。
### English
- Unified connection-error display on the welcome page: preserve error codes, safely truncate unknown codes, and show traceable server reasons.
- Added default IPv6 TeamSpeak target support and documented the required host, runtime, and network conditions.
### Deutsch
- Verbindungsfehler auf der Willkommensseite vereinheitlicht: Fehlercodes bleiben erhalten, unbekannte Codes werden sicher gekürzt und nachvollziehbare Serverursachen angezeigt.
- IPv6-Ziele für TeamSpeak standardmäßig unterstützt und erforderliche Host-, Laufzeit- und Netzwerkbedingungen dokumentiert.
## [0.2.0] — 2026-09-10
### 中文
- 新增 README“高级功能”章节,补充 WebRTC 与中继服务器的配置和使用步骤。
- 明确 WebRTC 的 UDP 端口、安全组与防火墙要求,以及中继令牌和管理员控制台配置方式。
- 标注中继服务为 WebSpeak 自带实现;同时注明 WebRTC 使用 MIT 许可的 `werift` 依赖,TeamSpeak 连接使用项目维护的 SDK fork。
- 细分 TeamSpeak 连接失败原因,服务器需要密码时提示用户输入密码并重试。
- 优化管理员历史连接日志:能够追溯时显示具体原因,无法追溯时使用通用失败提示,不猜测历史原因。
- 新增正式中继部署模式:中继实例不提供前台和管理员后台,只接受带令牌的网关转发会话。
- 管理员可配置多个中继节点,访客可在欢迎页为当前连接选择直连或指定中继。
- 修复用户正常断开后被管理员运维日志误显示为“请求失败”的问题。
### English
- Added an “Advanced features” section to the README with WebRTC and relay configuration and usage steps.
- Documented WebRTC UDP, security-group, and firewall requirements, plus relay-token and administration-console setup.
- Clarified that the relay is built into WebSpeak, while WebRTC uses the MIT-licensed `werift` dependency and TeamSpeak connectivity uses the project-maintained SDK fork.
- Classified TeamSpeak connection failures and prompt users for a server password with a retry when authentication requires one.
- Improved administrator connection history: show a specific reason when available and use a generic failure message when older records cannot be traced, without guessing.
- Added a formal relay deployment mode: relay instances expose no visitor or admin UI and accept only token-authenticated gateway sessions.
- Administrators can configure multiple relay nodes, and visitors can choose direct access or a specific relay for each connection.
- Fixed normal user disconnects being shown as “request failed” in administrator connection history.
### Deutsch
- Einen Abschnitt „Erweiterte Funktionen“ mit Anleitungen für WebRTC und Relay-Server zur README hinzugefügt.
- UDP-, Sicherheitsgruppen- und Firewall-Anforderungen für WebRTC sowie Relay-Token und Administrationskonfiguration dokumentiert.
- Klargestellt, dass das Relay Bestandteil von WebSpeak ist; WebRTC verwendet die MIT-lizenzierte Abhängigkeit `werift`, die TeamSpeak-Verbindung den projektgepflegten SDK-Fork.
- TeamSpeak-Verbindungsfehler genauer klassifiziert und bei erforderlichem Serverpasswort eine Eingabe mit Wiederholung angeboten.
- Den Verlauf der Administrator-Verbindungen verbessert: verfügbare Ursachen werden angezeigt, ältere nicht nachvollziehbare Einträge erhalten eine allgemeine Fehlermeldung statt einer Vermutung.
- Einen dedizierten Relay-Bereitstellungsmodus ergänzt: Relay-Instanzen stellen keine Besucher- oder Admin-Oberfläche bereit und akzeptieren nur Gateway-Sitzungen mit Token.
- Administratoren können mehrere Relay-Knoten konfigurieren; Besucher wählen pro Verbindung Direktzugriff oder ein bestimmtes Relay.
- Behoben, dass normale Benutzertrennungen im Administrationsverlauf als „Anfrage fehlgeschlagen“ erschienen.
## [0.1.8] — 2026-09-08
### 中文
- Docker 默认使用 host 网络,支持网关访问同机 TeamSpeak 并直接暴露 WebRTC UDP 端口。
- 开放模式统一校验用户提交的目标地址,包括管理员默认目标,修复本机与内网目标绕过限制的问题。
- TeamSpeak SDK 连接握手增加 15 秒超时,失败连接会及时清理。
- 网络性能面板改为持续监测,打开后每 3 秒更新一次延迟与丢包率。
### English
- Docker now uses host networking by default, allowing the gateway to reach a local TeamSpeak server and expose the WebRTC UDP range directly.
- Open access now validates every submitted target, including the administrator default, closing loopback and private-network bypasses.
- Added a 15-second TeamSpeak SDK handshake timeout with prompt cleanup after failed connections.
- The network performance panel now measures continuously and refreshes latency and packet loss every 3 seconds while open.
### Deutsch
- Docker verwendet standardmäßig das Host-Netzwerk, damit das Gateway einen lokalen TeamSpeak-Server erreicht und den WebRTC-UDP-Bereich direkt bereitstellt.
- Der offene Zugriffsmodus prüft nun jedes Ziel einschließlich des Administrator-Standards und schließt Umgehungen für Loopback- und private Netze.
- Für den TeamSpeak-SDK-Handshake gilt jetzt ein Timeout von 15 Sekunden; fehlgeschlagene Verbindungen werden zeitnah bereinigt.
- Das Netzwerkleistungsfeld misst bei geöffneter Ansicht fortlaufend und aktualisiert Latenz und Paketverlust alle 3 Sekunden.
## [0.1.7] — 2026-09-06
### 中文
- 增加 Deutsch 界面支持和 Telegram 群组入口。
- 增加桌面端整体音量滑块,默认收起并在悬停时展开。
- 修复伴奏音量忽大忽小的问题。
- 增加可展开的网络性能面板,显示浏览器、WebSpeak 与 TeamSpeak 之间的延迟和丢包率。
- 管理员连接测试改用服务端多次主机 Ping 并显示丢包率,不再创建临时 TeamSpeak 客户端。
- 统一中文、English、Deutsch 的旗帜代码语言菜单。
- 修复 TeamSpeak 使用 TCP 探测导致的误报丢包,并修正语言菜单异常留白。
- 移除 WebRTC 桥接中的 RMS 静音帧过滤,安静帧仅用于发言状态指示,不再丢弃。
- 修复 Docker 运行环境缺少 ICMP Ping 工具导致管理员测试误报 100% 丢包。
### English
- Added German UI support and a Telegram community link.
- Added a compact desktop master-volume slider that expands on hover.
- Fixed accompaniment volume fluctuations.
- Added an expandable network performance panel with latency and packet loss across the browser, WebSpeak, and TeamSpeak path.
- Updated the administrator connection test to use repeated host pings, report packet loss, and avoid creating temporary TeamSpeak clients.
- Unified the Chinese, English, and German flag/code language menu.
- Fixed false packet-loss reports caused by probing the TeamSpeak UDP service with TCP, and corrected excess space in the language menu.
- Removed RMS-based silence filtering from the WebRTC bridge; quiet frames are now retained for the codec timeline.
- Fixed Docker admin diagnostics falsely reporting 100% packet loss when the runtime lacked the ICMP ping tool.
### Deutsch
- Deutsche Benutzeroberfläche und Telegram-Community-Link hinzugefügt.
- Kompakten Gesamtlautstärkeregler für den Desktop ergänzt, der sich beim Überfahren öffnet.
- Schwankende Lautstärke bei der Begleittonfreigabe behoben.
- Aufklappbares Netzwerkleistungsfeld mit Latenz und Paketverlust zwischen Browser, WebSpeak und TeamSpeak ergänzt.
- Verbindungstest in der Administration auf wiederholte Host-Pings mit Paketverlustanzeige umgestellt, ohne temporäre TeamSpeak-Clients zu erzeugen.
- Einheitliches Sprachmenü mit Flaggen und Sprachcodes für Chinesisch, Englisch und Deutsch ergänzt.
- Falsche Paketverlustmeldungen durch TCP-Prüfung des UDP-Dienstes behoben und übermäßigen Leerraum im Sprachmenü korrigiert.
- RMS-basierte Stillefilterung aus der WebRTC-Brücke entfernt; leise Frames bleiben nun im Codec-Zeitverlauf erhalten.
- Falsche 100-%-Paketverlustmeldungen behoben, wenn dem Docker-Laufzeitimage das ICMP-Ping-Tool fehlte.
## [0.1.6] — 2026-09-04
### 中文
- 新增保持身份并发连接提醒,避免同一浏览器复用身份造成连接卡住。
- 新增桌面端伴奏共享功能。
- 新增网站 favicon,并更新仓库 README 主视觉。
### English
- Added a warning for concurrent remembered-identity connections in the same browser.
- Added desktop accompaniment sharing.
- Added a site favicon and refreshed the repository README branding.
## [0.1.5] — 2026-09-04
### 中文
- 修复并优化主题切换按钮,首次点击即可切换,并使用太阳/月亮图标。
- 修复浏览器身份保存与退出后的保持逻辑。
### English
- Fixed and refined the theme toggle so the first click switches themes, with sun/moon icons.
- Fixed browser identity persistence across exit and return.
All notable changes to WebSpeak are documented here. Versions follow SemVer.
## [0.1.4] — 2026-09-03
### 中文
- 修复 WebRTC 语音收发与发言状态同步。
- 修复频道文字消息在 WebSpeak 客户端之间无法互收。
- 优化管理员页面、运行日志换行和移动端顶部布局。
- 首页新增 Bilibili 入口,管理员登录页新增返回首页。
### English
- Fixed WebRTC voice transport and speaking-state synchronization.
- Fixed channel text messages between WebSpeak clients.
- Refined admin pages, log wrapping, and narrow-screen header layout.
- Added the Bilibili profile link and the admin-login home link.
## [0.1.3] — 2026-09-03
### Added
- Optional WebRTC audio transport for deployments that need lower and more stable realtime voice latency.
- A self-contained WebRTC media service controlled by one administrator switch; the gateway derives the media host from the current WebSpeak address and owns a fixed UDP range.
- Migrated the TeamSpeak integration to the maintained `EchoSixHIYA/teamspeak-js` fork, including live directory snapshots and member/channel synchronization.
### Changed
- WebRTC audio uses negotiated Opus parameters and a bounded newest-frame mixer instead of allowing stale audio to accumulate.
- The browser keeps the WebSocket path available for signaling, control, and compatibility fallback; Docker Compose publishes the built-in `40000–40099/UDP` media range alongside the web port.
### Fixed
- Prevented duplicate playback when WebRTC and the WebSocket audio path overlap during negotiation or fallback.
- Made WebRTC teardown and fallback explicit so a failed negotiation does not leave a server-side media session behind.
- Corrected native Opus decoder usage and cleaned up negotiated payload handling for TeamSpeak-to-browser audio.
### Verification
- After allowing inbound `40000–40099/UDP` on the public WebSpeak host, two browser sessions were tested against the same TeamSpeak target with WebRTC enabled: audio frames flowed in both directions, packet drops remained at `0`, ingress frame gaps peaked at about `27 ms`, and egress gaps peaked at about `81–83 ms`.
- The measured WebRTC path stayed below the previous WebSocket jitter peaks of about `268–376 ms` in the same browser test setup; these figures describe the observed test path, not a universal latency guarantee.
## [0.1.2] — 2026-09-02
### Added
- Current-version badge and a direct changelog link on the welcome page, next to the prominent GitHub repository button.
- Mobile member actions through a three-dot menu, while desktop member actions remain available through the context menu.
### Changed
- Mobile and narrow-screen header controls now collapse longer labels into icons to preserve usable spacing.
- The welcome page and connected workspace now present the GitHub, version, changelog, admin, theme, language, exit, and microphone controls as a consistent responsive control group.
- The version shown on the welcome page is read from the gateway's public configuration so it stays aligned with the running backend.
- Consolidated the post-0.1.1 mobile voice controls, microphone mute replacement for focus-dependent PTT, automatic protocol detection, simplified Docker Compose startup, and live-demo documentation.
### Fixed
- Replaced the visually off-center settings glyph and normalized icon alignment for settings-related controls across the client.
- Fixed narrow-screen exit and microphone controls so their text-collapse rules apply correctly.
- Bounded browser and gateway voice buffering, reset stale browser playback queues, and exposed low-overhead in-memory audio counters for diagnosing jitter without per-frame log writes.
- Moved microphone frame assembly to an `AudioWorklet` with a compatibility fallback to `ScriptProcessorNode`; both paths emit fixed 960-sample frames.
## [0.1.1] — 2026-09-02
### Added
- M009 admin operations dashboard for managed invites, active-session inspection, per-session termination, diagnostics, logs, audit access, diagnostic report download, and SQLite backup export.
- Persistent managed invites with expiry, optional maximum uses, revocation, hashed opaque tokens, and encrypted TeamSpeak credentials at rest.
- Mobile-aware invite joining through the `invite` URL parameter without placing a TeamSpeak password in the URL.
- M010 hardening for per-peer join-ticket rate limiting and bounded rotating runtime logs.
- Bilingual README documentation with parallel Chinese and English feature, deployment, security, and operations sections.
### Changed
- Database schema is now version 2 and migrates existing version 1 installations transactionally with a migration copy.
- Admin overview and diagnostics use the application package version instead of a hard-coded display value.
- The README architecture section now uses GitHub-native Markdown instead of a Mermaid rich-display block.
- The README badge set now uses stable static Shields badges without a repository-metadata 404 dependency.
- Version tags publish Windows/Linux deployment packages to GitHub Releases and publish the matching Docker image.
- Removed the focus-dependent normal browser Space-key PTT mode and replaced it with a one-click microphone mute/unmute control on desktop and mobile.
- Persisted the microphone mute state in browser preferences and suppresses upstream audio before it is sent to TeamSpeak while muted.
### Fixed
- Late WebSpeak browser sessions now reconcile and merge the complete TeamSpeak directory, so members who joined earlier remain visible.
- Private-message delivery no longer disconnects the browser session.
- Member actions are presented through the right-click context menu with hover feedback.
- Docker release builds copy the root `postinstall` patch script before running `npm ci`.
- Release builds skip `npm version` when the project version already matches the requested version, preventing false `Version not changed` failures.
### Verification
- `npm test` — 51 tests passed.
- `npm run build` — backend TypeScript build passed.
- `npm run web:build` — frontend production build passed.
- `npm audit --omit=dev --audit-level=high` — no high or critical vulnerabilities reported.
- Local `/demo` browser checks passed at the documented narrow and desktop widths; `/demo` does not connect to TeamSpeak.
Real TS3/TS6 interoperability, Android microphone behavior, multi-client smoke, and the 24-hour long-run gate require their respective test environments and are not claimed by this local release check.
## [0.1.0] — 2026-08-31
- First normalized release with the browser client, TeamSpeak 3 / 6 gateway, browser audio controls, access modes, administrator operations, and AGPL-3.0-only licensing.
+194 -72
View File
@@ -1,90 +1,212 @@
# WebSpeak — TeamSpeak Browser Gateway
# WebSpeak TeamSpeak Browser Gateway
Server-side bridge that lets users join TeamSpeak voice channels from a browser. No TS client install needed.
WebSpeak connects browser users to TeamSpeak 3 and TeamSpeak 6 through a self-hosted Node.js gateway. Each connected browser session owns an independent TeamSpeak client. The repository also contains a standalone UDP acceleration relay and an Android preview with an embedded local gateway.
## Architecture
## Application boundaries
```
Browser (PCM capture) → WebSocket → Node.js server (PCM→Opus) → TeamSpeak server
Browser (playback) ← WebSocket ← Node.js server (Opus relay) ← TeamSpeak server
| Location | Responsibility |
| --- | --- |
| `src/index.ts` | Gateway startup, SQLite, master secret, admin service and shutdown; also supports relay mode |
| `src/server/server.ts` | HTTP or HTTPS, public configuration, skins, join tickets, admin routes and static frontend |
| `src/server/voice-bridge.ts` | `/ws/voice`, admission, connection/reconnection orchestration and voice transport assembly |
| `src/server/voice-commands.ts`, `directory-view.ts`, `audio-stats.ts` | Command execution, public directory projection and diagnostic snapshots |
| `src/server/member-avatars.ts` | Generation-bound optional avatar downloads, bounded sequential batches, cached images and timer cleanup |
| `src/server/session-events.ts` | Session-owned SDK subscriptions, directory projection, self/channel state, chat mapping and avatar coordination |
| `src/server/screen-share-coordinator.ts` | Server/channel-scoped sharing membership and browser/native signaling |
| `src/shared/` | Browser-safe wire types and runtime parsers shared by both endpoints |
| `src/shared/admin-inputs.ts`, `admin-responses.ts` | Shared admin request types and runtime-checked response projections |
| `src/server/ts-client.ts` and `teamspeak-adapter.ts` | SDK integration, TS3/TS6 negotiation, identity, chat, voice and client events |
| `src/server/session-manager.ts` and `directory-sync.ts` | Connection state, teardown, admission limits and directory reconciliation |
| `src/server/webrtc-audio.ts` and `opus-codec.ts` | WebRTC audio mixing and platform-specific Opus codecs |
| `src/server/session-audio.ts` | Per-session PCM encoding, exclusive WebRTC/WebSocket routing, whisper dispatch, bounded egress and audio counters |
| `src/admin/`, `src/security/`, `src/persistence/` | Administration, access policies, credentials and persistent settings |
| `src/relay.ts` and `src/server/acceleration-relay.ts` | Standalone relay and gateway-side relay transport |
| `web/src/views/` and `web/src/composables/` | Vue pages, connection state, audio controls, chat and screen sharing |
| `web/src/voice/screen-share.ts` | Per-session screen capture, peer negotiation, cleanup and diagnostics |
| `web/src/voice/remote-playback.ts` | Per-speaker compatibility decoding, bounded scheduling, volume and resource cleanup |
| `web/src/voice/microphone-test.ts` | Cancellable recording tests, recorder deadline and playback URL ownership |
| `web/src/voice/microphone-capture.ts` | Prepared microphone processing graphs, per-context worklet loading, optional RNNoise and independent PCM activation/cleanup |
| `web/src/voice/audio-sink.ts` | Serialized device routing per audio endpoint, with stale-operation guards |
| `web/src/voice/accompaniment.ts` | Generation-bound display-audio capture, immediate pending-capture cancellation, ended listeners and committed activity |
| `web/src/voice/webrtc-input.ts` | Stable WebRTC sender output, microphone gain and transactional accompaniment-source attachment |
| `web/src/voice/microphone-meter.ts` | Optional per-peer level sampling, owned analysis nodes and timer, partial-failure cleanup and stale-tick rejection |
| `web/src/voice/webrtc-transport.ts`, `webrtc-playback.ts` | Per-attempt peer negotiation, input/meter ownership, compatibility fallback and independently owned playback elements and retries |
| `web/src/voice/connection.ts`, `commands.ts` | Cancellable ticket acquisition, socket and connection generations, plus per-command acknowledgement deadlines and cleanup |
| `web/src/voice/session-state.ts` | Reactive directory, chat history, events and notifications; complete versus omitted directory data, session resets and private-conversation identity scopes |
| `web/src/composables/useWebClientChat.ts`, `useWebClientChannels.ts` | Destination-owned drafts and pending sends, identity-bound private history, and iterative channel-tree projection |
| `web/src/composables/useWebClientIdentity.ts`, `web/src/components/web-client/IdentityImportDialog.vue` | Page-owned identity reads, parsing, restoration and exports; a presentation dialog with explicit input and action events |
| `web/src/voice/audio-diagnostics.ts`, `web/src/composables/useWebClientPerformance.ts` | Session-owned diagnostic probes and compatibility counters, browser statistics, comparable sample scopes and cancellable UI polling |
| `web/src/platform/` | Browser mounting and cancellable Android gateway readiness handshake |
| `web/src/services/`, `web/src/i18n/`, `web/src/skins/` | Browser persistence, identity import, skin packages and translations |
| `web/src/composables/usePublicSkin.ts`, `web/src/services/skin-operation.ts` | Shared public-page skin initialization and selection, page ownership, cancellation and bounded loading |
| `web/src/services/admin-api.ts`, `admin-requests.ts` | Admin HTTP validation and cancellation, session-bound CSRF and per-feature request ownership, including skin uploads and backup downloads |
| `web/src/composables/useAdminServerSettings.ts`, `useAdminOperations.ts`, `useAdminSkins.ts` | Admin form merging, probes, operational actions and skin state; the page owns authentication, routing and overview |
| `web/src/components/admin/` | Server settings, operations and skin presentation; the parent page retains the feature controller instances across subroute changes |
| `web/src/composables/useAdminI18n.ts`, `web/src/i18n/admin.ts` | Admin formatting and error/status mappings; all five languages explicitly implement the same translation keys |
| `src/mobile/`, `mobile/`, `web/android/` | Android loopback gateway, asset packaging and Capacitor container |
## Connection and control protocol
1. The browser requests `/api/join-ticket`. The gateway validates the request against its access policy and issues a short-lived, single-use ticket.
2. The browser presents the ticket to `/ws/voice`. The bridge admits a session, acquires any required identity lease and creates its TeamSpeak client.
3. WebSocket text messages carry JSON commands, events, WebRTC negotiation and screen-sharing signaling. The server uses the WebSocket `isBinary` flag to distinguish audio from control messages.
4. Register TeamSpeak event listeners before connecting: directory and membership events may arrive during the handshake.
Channel and member data come from SDK directory snapshots and client-protocol commands, followed by realtime notifications. WebQuery and its API key are not required. `DirectorySynchronizer` reconciles snapshots with membership events.
`SessionEventCoordinator` subscribes before SDK connection and closes before waiting for peer shutdown. Remove only its own listeners and guard captured callbacks as well as registered ones. Directory events are accepted during authentication, synchronization and the live connection, but not reconnect backoff. SDK adapter listeners must reject events from a replaced client before mutating state or forwarding them. A kick remains terminal if the disconnect notification already started recovery.
Avatar downloads belong to the connected directory generation. Reset them on SDK interruption and close them before awaiting session teardown. Old success or failure results cannot refill caches, publish images, start another download, or unlock newer work. `isAlive` is only the WebSocket heartbeat acknowledgement flag; it is not a lifecycle predicate. Keep avatar failure optional, the 50-member batch limit and 250 ms continuation delay.
The SDK avatar method captures its client and connection generation across metadata, transfer initialization and download. Recheck both after each await, including reconnects that reuse the same SDK object; never continue an old transfer through a replacement `this.client`. A retired SDK client's disconnect event must not clear the current connection.
Session teardown must remain safe when requested more than once or when sockets and codec resources are already closed. Reconnection is governed by `reconnect-policy.ts`; preserve terminal error handling, bounded retries and the previous-channel fallback.
Invalidate session audio before awaiting peer closure. Each codec and track must be released independently so one disposal failure cannot abandon the remaining resources. WebRTC close callers share one completion promise, including a peer-close rejection. Preserve WebSocketServer's close listener: it owns removal from the server's client set and allows shutdown to finish.
Late socket messages and media permission/negotiation results must not mutate a replacement session. Screen-sharing ownership is scoped to both the TeamSpeak target and channel; another member moving channels must not stop the current user's share. Preserve these invariants when extracting the remaining audio responsibilities.
WebRTC offers, answers, playback callbacks and accompaniment capture belong to the session and peer that started them. Invalidate pending negotiation on stop, reconnect or teardown before awaiting resource closure. A stale peer must not publish errors, counters or audio into its successor. Negotiation and track setup failures must restore compatibility capture without misreporting a microphone failure.
The WebRTC transport owns its peer, input mixer, meter, ICE wait and answer deadline. The capture layer retains ownership of the original microphone and PCM graph; releasing input during microphone preparation must not invalidate the preparing transport. Failed stop signaling cannot prevent local cleanup or compatibility fallback. A fallback permission failure must still belong to the connection and transport generation that initiated it.
Each remote WebRTC audio element owns its in-flight play attempt and retry listeners. Coalesce overlapping gestures, guard captured callbacks against replacement and release partial element setup. Pause, listener removal, source clearing or peer closure failures must not interrupt release of other resources.
Ticket acquisition has a 15-second browser deadline covering preference readiness, fetch and response-body reading. Disconnect and replacement abort the owning request immediately; stale success, rejection and deadline callbacks cannot open a socket or update a newer connection. This is separate from the gateway's TeamSpeak handshake policy. Browser cancellation does not undo a server-side invite consumption or ticket issuance. Preserve the gateway close code over generic WebSocket errors, detach retired handlers, and tolerate socket-close failures.
Every acknowledged command owns its original socket, connection generation and deadline. Success, server rejection, synchronous send failure, timeout and disconnect all use one idempotent completion path; release the registration and timer immediately. Fire-and-forget commands keep the existing shared wire contract.
Chat sends require a connected TeamSpeak session and append local history only after acknowledgement. A queued acknowledgement cannot append after session resource release. Recovery rejections retain the command request ID. Optional channelId and clientUid command fields let the gateway verify the actual channel and recipient before invoking the SDK; legacy payloads remain accepted without those additional guards. Confirmation is not a read receipt, and a timeout does not prove non-delivery.
Directory, chat, events and poke lists retain their reactive array identities. Complete channel snapshots replace the member directory, while omitted members remain unknown rather than empty. Channel projections share canonical members. Departure and UID replacement release the old member's playback, speaking state, temporary volume and whisper selection; persisted UID-based preferences remain. A recovered TeamSpeak connection replaces its directory even when the connected message omits members.
Explicit disconnect, target replacement and ordinary socket closure reset message state and advance the page's session epoch. Same-socket recovery may preserve chat history, but cannot send until connected; recovered directories and events replace old snapshots and clear old pokes. Failed recovery may retain its history for the failure panel until retry or exit.
Private history uses UID scopes when available and member-lifetime scopes for legacy clients without UIDs. Unknown senders must not become later members merely because a numeric ID matches. Preserve the recipient name in outgoing history. Drafts, pending submissions and errors belong to a destination within a session; switching tabs cannot duplicate an in-flight send. Confirmation clears only the unchanged submitted draft, including when its tab is inactive. Reset or disposal retires late feedback.
Channel projection uses iterative parent and sibling traversal, emits each ID at most once, keeps the first duplicate, promotes missing-parent channels to roots and starts isolated cycles at their first source entry. Do not reintroduce recursive traversal or silently discard the entire directory on a malformed topology.
Audio diagnostic probes retain their cancellation entry and deadline until both gateway and browser statistics finish. Bind the result to the original socket, connection generation and peer; disconnect settles pending consumers immediately, and a late browser getStats result cannot mix with a replacement peer. A probe send failure returns no sample.
Diagnostic samples also include the WebRTC transport generation, so a probe cannot survive a failed attempt that starts and ends without a peer. A browser-local scope ID changes with the source and session resets; compatibility counters reset at session teardown and snapshots stay independent. The scope ID is internal metadata, not part of the gateway protocol. Keep the exported diagnostic types available from the voice composable for existing callers.
The performance panel only subtracts counters from matching scopes, transports and downlink sources (PCM, RTP or gateway frames). Null or rejected probes clear stale activity and restart the baseline. Check the polling generation before starting work as well as after awaiting results; unmount retires callbacks and manual refresh. Preserve the 2-second polling interval. For loss estimates, packetsSent already includes all sent packets, while packetsReceived requires adding lost packets to form the denominator; keep percentages bounded and treat RTCP/local snapshots as estimates.
Accompaniment changes keep the WebRTC sender output alive. Prepare and connect the new source before replacing the old one; a failure preserves the current microphone and accompaniment. The input mixer owns its nodes and output track, never the externally owned capture streams. Release partial allocations and continue cleanup if an individual node fails. Application audio bypasses microphone gain/denoising and retains its source level.
The accompaniment controller owns both active and pending captures. Stop, disconnect and replacement immediately release candidates already returned by the browser, even while optional constraints are pending. Late permissions are stopped on arrival; ended or stale candidates cannot be published. Register ended listeners during preparation and publish activity only after attachment succeeds. Optional content hints and processing constraints may fail without losing capture; distinguish audio attachment errors from permission errors in all five languages.
Microphone metering is optional and must not interrupt voice. Its nodes and timer belong to one meter instance; a queued old tick cannot read the next session's analyser or publish a level. Allocation, connection and read failures release all meter resources and clear level/speaking presentation, while preserving the capture stream and peer. Keep the 512-sample analyser and 50 ms cadence unless audio validation justifies changing them.
## Audio and screen sharing
The compatibility voice path captures 48 kHz mono PCM using an AudioWorklet, with a ScriptProcessor fallback. The browser assembles 960-sample, 20 ms frames and sends 1,920-byte Int16 payloads over WebSocket. The gateway encodes them as Opus for TeamSpeak. Incoming Opus uses a three-byte header containing codec and client ID, then browser WebCodecs decoding and playback.
When enabled by the administrator, WebRTC provides a separate voice transport between the browser and gateway. The gateway uses `werift` and mixes incoming TeamSpeak speakers for WebRTC playback. Negotiation failures can fall back to the compatibility path. Keep microphone mute, per-member volume and playback behavior consistent across both transports.
Screen sharing has its own peer connections. The gateway coordinates stream membership and SDP/ICE signaling between browsers and supported TeamSpeak 6 clients. Screen media travels directly or through an externally configured TURN server; the WebSpeak gateway does not carry screen media.
Preserve bounded audio buffering and stale-playback recovery. Audio counters stay in memory and are exposed in session diagnostics. Do not add per-frame persistent logging to the voice path.
Remote playback owns each speaker's decoder, gain and source nodes as one resource set. Member departure, decoder failure and session teardown release that set; queued callbacks must not touch its replacement. Preserve the 80 ms playback window and three-frame decoder queue threshold unless audio validation justifies changing them.
Microphone recording tests own their recorder, timeout and object URL, while the capture layer owns the microphone stream. A normal stop may publish its final recording; replacement and session teardown discard late results and revoke the old URL. Stopping a test while connected must preserve room capture. Test cancellation and stale permission failures must not change a newer test's state.
Device and noise-suppression changes share one configuration operation. Persist only the last successful settings; stale failures cannot roll back a newer choice. Acquiring a replacement microphone must preserve the current WebRTC peer and compatibility PCM capture until the replacement is ready. Capture callbacks are invalidated when their graph stops, separately from permission-request generations. Closing settings also releases standalone device-preview capture when no recording was started.
Prepare microphone nodes and streams before replacing the live graph. A failed allocation or delayed worklet load must leave the old capture usable. Aborting preparation releases its candidate resources immediately; only activation enables PCM callbacks. Worklet module caches belong to their AudioContext. Device removal uses the normal input/output configuration transactions, including WebRTC restart and rollback on failed default-device selection. A committed graph becomes the fallback preference before subsequent device enumeration completes.
Serialize `setSinkId` on each audio context or media element, since an in-flight browser sink change cannot be cancelled. Bind subsequent work to the original endpoint and current operation; session teardown invalidates queued changes and device enumeration results. If one output endpoint rejects after another changed, attempt to restore the last committed output.
`src/server/opus-codec.ts` loads the native `@discordjs/opus` implementation for server deployments and `opusscript` for the Android bundle. Dispose codec and media resources at the end of their owning session.
## Configuration and persistence
Identity file reads belong to the current selection, text revision and dialog lifetime. New files (including invalid selections), manual edits, closing, entering the room, clearing local data and page disposal retire old results. Parsing owns its submitted draft; only a current result may replace the identity or notify. Preserve the 128 KiB limit, UTF-8/UTF-16 BOM decoding and existing busy-close behavior. The dialog disables submission while a selected file is being read and disables edits while parsing.
Startup identity restoration must not overwrite a newer import or remember preference. Exports belong to the identity and page that started them; coalesce pending clicks, discard late serialization and release download anchors, URLs and timers independently. Keep codec parsing in the existing identity service and persistence in the page/storage layer.
Admin requests belong to the login session and feature that started them. Invalidate pending work on authentication changes and page disposal; cancel feature work on management subroute exit. A late 401 must not expire a newer session, and late login or backup results must not navigate or download after disposal. Aborted work is not a user-facing failure. Failed logout preserves the authenticated draft; successful logout or session expiry resets private page state.
Settings responses merge against the submitted snapshot instead of replacing newer edits. Password and action, and relay token and action, are atomic draft groups. Clear acknowledged secret inputs, retain edits made during the request, merge relay nodes by ID, and do not restore obsolete probe metadata. Serialize skin mutations and prevent duplicate invite actions; cancelling browser work does not undo a server mutation already executed.
| Source | Purpose |
| --- | --- |
| SQLite `webspeak.db` | Admin credentials, target and access settings, relay nodes, invitations, audit records and visitor metadata |
| `master.key` beside the database | Encryption key for persisted secrets; retain it with database backups |
| `/admin` | Normal configuration and operational controls |
| Legacy `config.json` | One-time import of `tsHost`, `tsPort` and `tsServerPassword`; later changes do not replace database settings |
| `WEBSPEAK_DATA_DIR` | Persistent data directory; defaults to project `data/`, while Docker uses `/data` |
| `WEBSPEAK_SCREEN_SHARE_ICE_SERVERS` | Screen-sharing ICE configuration read at startup |
| `WEBSPEAK_TRUSTED_PROXIES` | Comma-separated IPs/CIDRs whose `X-Forwarded-For` may be believed; defaults to loopback so a same-host reverse proxy keeps working |
| Relay environment variables | Standalone relay mode; public gateway relay choices come from saved admin settings |
| Browser IndexedDB and localStorage | Local identities, preferences, server history and skin state |
The current SQLite schema version is defined in `src/persistence/database.ts`. Keep schema migrations separate from structural refactors. Legacy fields such as `voiceToken`, `tsApiKey`, `tsQueryPort`, `port` and `maxClients` do not configure the current gateway.
Optional TS administration lives in `src/admin/ts-admin-service.ts` and `/admin/ts-admin`. It uses the published SDK's typed commands through `QueryClient` over WebQuery, SSH or TCP, separately from guest voice and WebSpeak administration. Never require these credentials for a voice connection. WebQuery has no notifications: omit `events` entirely; `events: false` is also rejected by this SDK. Bind queued mutations to the reviewed configuration, recheck a member's live UID before acting, and never ban the shared gateway IP. Keep credentials encrypted with distinct purpose strings and return only presence flags. Management writes are not automatically retried; a failed refresh cannot imply an acknowledged write failed.
The gateway HTTP port is `3040`. Its admission ceiling is `100` sessions, defined in `src/constants.ts`; this is an application limit, not a TeamSpeak license allowance or a measured performance guarantee. Target server capacity and permissions still apply.
The server uses HTTPS when `certs/cert.pem` and `certs/key.pem` are supplied; otherwise it starts HTTP. It does not generate certificates. Use an appropriate secure browser origin for microphone and screen capture, typically HTTPS in public deployments. Feature support depends on the browser and selected transport; do not infer a universal minimum browser version from WebCodecs alone.
## Development and verification
Server deployments require Node.js 22.12 or newer. CI uses Node.js 22.22.2. Root and frontend dependencies are installed separately. The SDK is installed from the npm registry; only native Opus needs a rebuild after installing with scripts disabled:
```sh
npm ci --ignore-scripts --no-audit --no-fund
npm rebuild @discordjs/opus --foreground-scripts --no-audit --no-fund
npm --prefix web ci --no-audit --no-fund
npm run verify
```
- Each browser user = one independent TS3 virtual client via `@echosixhiya/teamspeak-client`
- Frontend captures PCM in an `AudioWorklet` when available (with a `ScriptProcessorNode` fallback), assembles fixed 960-sample frames, and sends Int16 binary over WebSocket
- Server encodes PCM → Opus using `@discordjs/opus` (CJS, loaded via `createRequire`)
- Server sends Opus to TS via `client.sendVoice(data, codec=4)`
- Incoming TS voice → Opus frames → binary WebSocket → browser `AudioDecoder` → playback
- Channel/member list fetched via TS6 WebQuery HTTP API (port 10080, requires API key)
- WebSocket text frames = JSON commands, binary frames = PCM audio / Opus relay
`npm run verify` runs unit tests, the backend build and `npm run web:build`. The latter delegates to the frontend build, including `vue-tsc --noEmit`. Use `npm run dev` and `npm run web:dev` for development, or `npm start` after building both applications.
## Project Structure
Headless Vue tests use Vite middleware mode with both HMR and the WebSocket listener disabled (`hmr: false`, `ws: false`). Disabling HMR alone still reserves Vite's default socket port and causes parallel test processes to conflict.
```
web/ # Vue 3 + Vite frontend (SPA)
src/composables/useVoiceWebSocket.ts # Mic capture, VOX/PTT, playback, WS client
src/views/WebClient.vue # Connect form + channel/member tree
src/
index.ts # Entry point, config loading, server startup
config.ts # AppConfig interface + load/save
logger.ts # Pino wrapper
server/
server.ts # Express + HTTPS + WS setup
voice-bridge.ts # /ws/voice endpoint, PCM→Opus encoding, WebQuery API
ts-client.ts # TS3Client wrapper around @echosixhiya/teamspeak-client
```
CI verifies pushes to `dev` and `master`, pull requests and manual runs. Docker publication on `master` or release tags, and release packaging on tags or manual runs, call the same verification workflow before publishing or packaging. Verification includes the application checks and a Docker HTTP health smoke test; that smoke test does not prove voice or screen-sharing functionality.
## Key Technical Details
Tests requiring a real TeamSpeak server, browser media devices or Android hardware must document their environment and outcome separately. Never substitute a mock codec or an HTTP health response for a successful audio test.
### Audio Pipeline
1. Browser mic → `getUserMedia` (48kHz mono) → `AudioWorklet` frame assembler (960 samples); older browsers use `ScriptProcessorNode` (1024-sample chunks) before the same assembler
2. Float32 → Int16 conversion → PTT/VOX gate → WebSocket binary send
3. Server encodes each 1920-byte (960-sample, 20ms) PCM frame → `OpusEncoder.encode()` → `tsClient.sendVoice(opus, 4)`
4. Incoming: TS → `voiceData` event → 3-byte header `[codec][clientId BE]` → WS binary → browser `AudioDecoder` → playback
5. Browser uplink is capped at 10 PCM frames (about 200ms); gateway egress applies a bounded WebSocket byte guard; browser playback resets stale decoder/source queues above 120ms.
## Android preview
Audio flow counters are kept in memory and exposed in admin session summaries. Do not add per-frame persistent logging to the voice path.
The Android app starts an embedded Node.js gateway on `127.0.0.1:3040` and opens it in the WebView. This preview disables gateway WebRTC voice and the admin console, while reusing the compatibility voice path. Its dependencies and runtime differ from server deployments.
### CJS Interop
`@discordjs/opus` is CommonJS, loaded via:
```ts
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
const { OpusEncoder } = require("@discordjs/opus");
```
See `mobile/README.md` for build steps and recorded limitations. The embedded Node.js version, SDK compatibility, real-device connections, background audio and native screen sharing require their own validation. Do not present these capabilities as production-ready based on desktop tests.
### WebSocket Message Routing
- Text frames → JSON commands (`listChannels`, `switchChannel`)
- Binary frames → PCM audio (browser→server) or Opus frames (server→browser)
- JSON detection: `typeof data === "string"` first, then fallback `data[0] === 0x7b` with try/catch
Platform startup owns its message listener, polling interval and deadline, including slow listener registration. Release them on success, failure, timeout and page exit. The retry button repeats the readiness handshake; it does not restart the embedded Node.js runtime.
### Event Handlers
Must be registered BEFORE `tsClient.connect()` because `clientEnter`/`clientLeave` fire during handshake.
## Repository maintenance
### Channel List
Uses TS6 WebQuery HTTP API (`http://tsHost:tsQueryPort/1/channellist`) with `x-api-key` header. Falls back empty if `tsApiKey` not configured. Regular TS3 voice clients lack permission for `listChannels`/`listClients`.
Routes load their page modules on demand. Document-level page styles must be gated by `html[data-ws-route]` because loaded CSS remains after navigation. The admin stylesheet is independent of public skins. Component extraction must retain `data-ws-part` hooks and account for Vue scoped styles across component boundaries.
### Config (config.json)
```json
{
"port": 3040, "tsHost": "127.0.0.1", "tsPort": 9987,
"tsQueryPort": 10080, "tsServerProtocol": "ts6",
"tsApiKey": "", "voiceToken": "change-me", "maxClients": 10
}
```
The identity dialog retains page-owned CSS with narrowly targeted `:deep` selectors so the existing declaration order and specificity remain intact. Shared button rules target its dedicated classes across the component boundary. Its close button is positioned within the modal. Public skin-contract tests include Vue files recursively under `components/web-client`; keep new public parts documented.
## Build & Deploy
```bash
npm install && cd web && npm install && npx vite build && cd .. && npx tsc
node dist/index.js
```
The public join form uses explicit named field models and emits page actions. The chat panel receives a presentation subset of the single page-owned chat controller; keep its list ref bound to the rendered scroller so tab changes and new messages retain automatic scrolling. Form grid columns must allow shrinking, and narrow identity/relay controls must wrap without clipping translated text.
## Git
- Remote: `https://github.com/EchoSixHIYA/web-client-for-TeamSpeak`
- `webspeak-update.tar.gz` is in .gitignore (deployment artifact)
- No secrets in source; config.json is gitignored
The member panel and actions menu also share one page-owned member controller. The panel exposes an audio-dock slot; menu placement uses measured viewport bounds, converts through the page CSS zoom, and releases its resize observer/listener on unmount. Only desktop may open the move submenu on hover: mobile bottom-anchored menus change position when expanded and must open on click to avoid moving a member accidentally. Constrain short-window menus and allow scrolling.
## Known Limitations
- Browser must be Chrome/Edge 94+ (WebCodecs AudioDecoder)
- HTTPS required (self-signed cert OK, generated in `certs/`)
- Max 32 concurrent users (TS3 license limit)
- `tsApiKey` required for channel list; voice works without it
Voice member cards receive the current channel projection, speaking/avatar helpers and a narrow sharing interface. Keep the sharing refs stable; member menus and stop-sharing actions return to the page through events. Empty, self, speaking, starting, sharing and viewing states must retain their skin hooks and mobile behavior.
Voice diagnostics and screen-sharing presentation also reuse page-owned controllers. Bind the player and video with explicit element callbacks. Rebind an existing stream when its video element changes, clear the previous element, and never stop the media owner's tracks during presentation cleanup. Fullscreen requires a non-null owned player; removing it exits only its own fullscreen. Known screen owner IDs take precedence over nickname fallback, including duplicate nicknames. Sharing settings use the common dialog focus handling.
The audio dock and whisper strip share the page-owned audio controller. Push-to-talk belongs to one primary pointer or one Space/Enter press; unrelated releases and key repeats must not change it. Failed pointer capture must not enable whispering. Clear ownership before releasing capture, and stop on blur, hidden controls/pages and disposal. The whisper component owns and releases its window/document listeners; keep media state in the voice layer.
Audio settings and password dialogs retain one page-owned media/connection state. Dialog focus supports initial focus, Tab cycling, Escape and return to the opener, with a connect-button fallback after pending connections disable that opener. Settings error feedback belongs to the current opening and latest request; closing synchronously stops recording tests, and scope disposal retires pending feedback and stops tests too. A non-password channel error must release the password dialog's pending state and preserve its draft for retry; reject duplicate submissions while pending.
Admin presentation components receive stable feature controllers; do not instantiate duplicate controllers in children. The welcome-language model remains page-owned and the skin file input belongs to its presentation component. Feature CSS crosses these boundaries with `:deep`, while shell and language-control selectors retain their existing scope. On narrow screens the brand and logout occupy the first row and all four navigation links share a separate row with at least 44 px high targets.
Keep each repair batch tied to its current plan item. Combine related fixes before running the full verification command; use focused checks during diagnosis and repeat the full suite only when subsequent changes or failures warrant it.
Keep template/CSS formatting separate from behavior changes. Preserve inline whitespace text nodes when wrapping Vue tags; compare compiled render output when needed. CSS formatting must retain selector meaning, values and declaration/rule order. Layout assertions should tolerate formatting whitespace while still checking the intended rules and values.
Public skin activation is last-choice-owned across both public pages. Retire previous runtime work before preparing a replacement, and reject results after page disposal, a newer choice or local-data reset. Check ownership before modifying document styles, selected content, asset URLs or stored preferences. An already aborted caller must not cancel a newer page's activation. Release compiled candidate URLs on failed installation.
Skin initialization has an 8-second total deadline covering preference reads, directory fetch and body, package loading and activation. Network stages also have bounded standalone operations. A timeout reveals a usable built-in palette and retires late work; retain the explicit skin choice for a later retry. Normal initialization still respects the enabled instance default unless the visitor made a deliberate choice. Home and demo use the same controller; do not restore duplicate unguarded refresh paths.
Skin cache writes and preference persistence accept the owning AbortSignal, including while waiting for IndexedDB to open and during its write transaction. Report storage success at transaction completion. Merge preferences within one transaction so concurrent unrelated settings are preserved. Cancellation of optional persistence must never block page use.
Validate admin responses before applying them to page state. Network and protocol failures must preserve unsaved input; a failed logout must not be presented as a successful logout. Keep secret keep/replace/remove actions intact and do not persist credentials in UI error messages or diagnostic logs.
The repository remote is `https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak`. Preserve existing local work and keep private configuration, runtime data, local deployment archives, and machine-specific notes out of source commits. Preserve documented skin hooks and browser persistence formats during component refactors.
+5 -6
View File
@@ -2,19 +2,17 @@ FROM node:22-bookworm-slim AS build
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates git python3 make g++ \
&& apt-get install -y --no-install-recommends ca-certificates python3 make g++ \
&& rm -rf /var/lib/apt/lists/*
COPY package.json package-lock.json ./
COPY web/package.json web/package-lock.json ./web/
RUN npm ci --ignore-scripts --no-audit --no-fund
COPY scripts/prepare-sdk.mjs ./scripts/prepare-sdk.mjs
RUN npm run prepare:sdk
RUN npm rebuild @discordjs/opus --foreground-scripts --no-audit --no-fund
RUN npm --prefix web ci
COPY . .
RUN npm --prefix web run build \
RUN npm run web:build \
&& npm run build \
&& npm prune --omit=dev \
&& rm -rf web/node_modules
@@ -35,11 +33,12 @@ COPY --from=build --chown=node:node /app/package.json /app/package-lock.json ./
COPY --from=build --chown=node:node /app/node_modules ./node_modules
COPY --from=build --chown=node:node /app/dist ./dist
COPY --from=build --chown=node:node /app/web/dist ./web/dist
COPY --from=build --chown=node:node /app/scripts/docker-healthcheck.mjs ./scripts/docker-healthcheck.mjs
USER node
VOLUME ["/data"]
EXPOSE 3040/tcp 39087/udp 40000-40099/udp
EXPOSE 3040/tcp 3041/tcp 3042/tcp 39087/udp 40000-40099/udp
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD ["sh", "-c", "if [ \"$WEBSPEAK_MODE\" = \"relay\" ]; then node -e \"process.exit(0)\"; else node -e \"fetch('http://127.0.0.1:3040/health').then(r => { if (!r.ok) process.exit(1) }).catch(() => process.exit(1))\"; fi"]
CMD ["node", "scripts/docker-healthcheck.mjs"]
CMD ["node", "dist/index.js"]
+137 -61
View File
@@ -1,40 +1,94 @@
<a id="readme-top"></a>
<div align="center">
<a id="readme-top"></a>
<img src="./image.png" alt="WebSpeak 项目横幅" width="100%" />
<a href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak"><img src="./docs/assets/webspeak-banner.png" alt="WebSpeak — TeamSpeak in your browser" width="100%" /></a>
<h1>WebSpeak</h1>
<p><strong>让 TeamSpeak 自然地进入浏览器。</strong></p>
<p>A self-hosted browser voice client for TeamSpeak 3 and TeamSpeak 6.</p>
[![Latest Release](https://img.shields.io/github/v/release/EchoSixHIYA/WebSpeak-client-for-TeamSpeak?sort=semver&display_name=tag&style=flat-square&color=0f766e)](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest)
[![Docker Image](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/actions/workflows/docker-publish.yml/badge.svg?branch=master)](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/actions/workflows/docker-publish.yml)
[![License](https://img.shields.io/badge/license-AGPL--3.0--only-0f766e?style=flat-square)](./LICENSE)
[![GitHub Stars](https://img.shields.io/github/stars/EchoSixHIYA/WebSpeak-client-for-TeamSpeak?style=flat-square&logo=github&color=0f766e)](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/stargazers)
<br />
[![TeamSpeak](https://img.shields.io/badge/TeamSpeak-3%20%7C%206-2580C3?style=flat-square)](https://www.teamspeak.com/)
[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D22.5-339933?style=flat-square&logo=nodedotjs&logoColor=white)](https://nodejs.org/)
[![Vue](https://img.shields.io/badge/Vue-3-42B883?style=flat-square&logo=vuedotjs&logoColor=white)](https://vuejs.org/)
[![TypeScript](https://img.shields.io/badge/TypeScript-6-3178C6?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![Docker](https://img.shields.io/badge/Docker-GHCR-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/EchoSixHIYA/packages/container/package/webspeak)
<p><strong>打开浏览器,就能加入你的 TeamSpeak。</strong></p>
<p>A self-hosted browser voice client for TeamSpeak 3 &amp; TeamSpeak 6.</p>
<p>
<a href="./docs/README.zh-CN.md">简体中文文档</a> ·
<a href="./docs/README.en.md">English documentation</a> ·
<a href="./docs/README.de.md">Deutsche Dokumentation</a> ·
<a href="./docs/README.ru.md">Русская документация</a> ·
<a href="./docs/README.ja.md">日本語ドキュメント</a>
<a href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest"><img src="https://img.shields.io/github/v/release/EchoSixHIYA/WebSpeak-client-for-TeamSpeak?sort=semver&amp;display_name=tag&amp;style=flat-square&amp;color=0f766e" alt="Latest release" /></a>
<a href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/actions/workflows/ci.yml"><img src="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/actions/workflows/ci.yml/badge.svg?branch=master" alt="CI — master" /></a>
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--only-0f766e?style=flat-square" alt="AGPL-3.0-only" /></a>
<a href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/stargazers"><img src="https://img.shields.io/github/stars/EchoSixHIYA/WebSpeak-client-for-TeamSpeak?style=flat-square&amp;logo=github&amp;color=0f766e" alt="GitHub stars" /></a>
</p>
<p>
<a href="./docs/README.zh-CN.md">简体中文</a> · <a href="./docs/README.en.md">English</a> · <a href="./docs/README.de.md">Deutsch</a> · <a href="./docs/README.ru.md">Русский</a> · <a href="./docs/README.ja.md">日本語</a>
</p>
<p>
<a href="#live-demo">在线演示 · Live demo</a> · <a href="#quick-start">快速部署 · Quick start</a> · <a href="#documentation">文档 · Docs</a> · <a href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/issues">反馈 · Issues</a>
</p>
</div>
## 项目简介 · Overview
当前版本 / Current version: **[v0.3.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.3)** · [更新内容 / Release notes](./docs/README.zh-CN.md#latest-release-notes)
| 逻辑 | 中文 | English |
| --- | --- | --- |
| **WHAT** | WebSpeak 是一个可自行部署的 TeamSpeak 3 / TeamSpeak 6 网页客户端与语音网关。 | WebSpeak is a self-hosted browser client and voice gateway for TeamSpeak 3 and TeamSpeak 6. |
| **WHY** | 无需安装桌面客户端,用户打开网页即可加入频道;部署者仍然掌控目标服务器、访问策略和数据。 | Users can join a voice channel from a browser without installing a desktop client, while the operator keeps control of servers, access, and data. |
| **HOW** | 部署后在管理员控制台配置 TeamSpeak 目标和访问方式,浏览器负责交互与音频,WebSpeak 负责网关连接。 | Configure the TeamSpeak target and access policy in the administration console. The browser handles interaction and audio; WebSpeak provides the gateway connection. |
## 关于 WebSpeak · Overview
WebSpeak 将 TeamSpeak 3 / TeamSpeak 6 带到浏览器:无需安装桌面客户端,即可加入语音频道、发送消息和分享屏幕。你可以自行部署网关,并通过网页后台管理服务器、访问策略、皮肤和运行数据。
Join voice channels, chat and share your screen from a browser. Deploy your own gateway and keep control of your TeamSpeak targets, access policy, skins and data through the web administration console.
| 能力 · Capability | 说明 · Highlights |
| --- | --- |
| 🎙️ 语音 · Voice | Opus、可选 WebRTC、WebSocket 回退、降噪与成员音量 / Opus, optional WebRTC, fallback, noise suppression and per-member volume |
| 💬 频道与聊天 · Channels & chat | 实时频道树、成员状态、私聊与本地历史 / Live channel tree, member state, private chat and local history |
| 🖥️ 屏幕共享 · Screen sharing | 浏览器之间及与受支持的 TS6 客户端互通 / Between browsers and supported native TS6 clients |
| 🎨 皮肤 · Skins | `.wskin` 外观、布局和小组件,支持 GitHub 分发 / Portable appearance, layouts and widgets, distributed through GitHub |
| 🛠️ 管理 · Administration | 目标、邀请、中继、备份和可选 TS 管理 / Targets, invites, relays, backups and optional TS management |
| 🌍 自托管 · Self-hosting | 五种语言、响应式界面、多架构部署 / Five languages, responsive layouts and multi-architecture deployment |
<a id="live-demo"></a>
## 在线演示 · Live demo
| 节点 · Region | 地址 · Address |
| --- | --- |
| 上海 · Shanghai | [shanghai.webspeak.online](https://shanghai.webspeak.online) |
| 香港 · Hong Kong | [webspeak.online](https://webspeak.online) |
![WebSpeak 语音工作区 · Voice workspace](./docs/screenshots/webspeak-zh.png)
<details>
<summary>更多界面与语言 · More screenshots & languages</summary>
- [简体中文](./docs/README.zh-CN.md#screenshots) · [English](./docs/README.en.md#screenshots) · [Deutsch](./docs/README.de.md#screenshots) · [Русский](./docs/README.ru.md#screenshots) · [日本語](./docs/README.ja.md#screenshots)
以下皮肤截图拍摄于已连接的 TeamSpeak 语音房间。 / The skin screenshots below were captured in a connected TeamSpeak voice room.
| 日间 · Day | 夜间 · Night |
| --- | --- |
| ![日间皮肤 · Day skin](./docs/screenshots/skin-day.png) | ![夜间皮肤 · Night skin](./docs/screenshots/skin-night.png) |
| ILLUSIA | KAAK |
| --- | --- |
| ![ILLUSIA 皮肤 · ILLUSIA skin](./docs/screenshots/skin-illusia.png) | ![KAAK 皮肤 · KAAK skin](./docs/screenshots/skin-kaak.png) |
![Discord Voice 社区皮肤 · Discord Voice community skin](./docs/screenshots/skin-discord.png)
</details>
<a id="quick-start"></a>
## 快速部署 · Quick start
在 Linux Docker 主机上运行 / On a Linux Docker host:
```bash
git clone --depth 1 https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
docker compose pull
docker compose up -d
```
1. 打开 `http://127.0.0.1:3040/admin`,使用 `admin` / `admin` 登录并设置至少 12 位新密码。Open the console, sign in and replace the default password.
2. 配置 TeamSpeak 目标和访问模式;公网使用 HTTPS。Set the TeamSpeak target and access mode; use HTTPS for public access.
3. 启用 WebRTC 时放行配置的 UDP 范围,默认 `40000–40099`。Allow the configured UDP range when enabling WebRTC.
4. Cloudflare Tunnel 或受限网络可在管理台“服务器 → 语音”配置 TURN 后备、语音模式和自适应音频,保存后对新的语音连接生效。Configure TURN fallback, voice mode, and adaptive audio under Admin → Voice; changes apply to new voice connections after saving.
数据保存在 `webspeak-data` volume,升级时保留它。Docker 控制台只能检查版本;升级请在宿主机执行 `docker compose pull && docker compose up -d`,且不要执行 `docker compose down -v`。以上 Compose 使用主机网络;Windows 服务端可选择[发布包](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest)。完整说明:[中文部署指南](./docs/README.zh-CN.md#deployment) · [English deployment guide](./docs/README.en.md#deployment)。
Data persists in the `webspeak-data` volume. On Docker, the console only checks versions; upgrade on the host with `docker compose pull && docker compose up -d` and never run `docker compose down -v`. The Compose file uses host networking. Windows x64 and Linux x64/ARM64 release packages include the runtime; Docker images support amd64/arm64.
<a id="documentation"></a>
## 文档 · Documentation
@@ -43,55 +97,77 @@
- [Deutsch](./docs/README.de.md)
- [Русский](./docs/README.ru.md)
- [日本語](./docs/README.ja.md)
- [皮肤开发规范](./docs/SKIN_DEVELOPMENT.md)
- [WebSpeak 皮肤开发 Agent Skill](./.agents/skills/webspeak-skin-development/SKILL.md)
- [Cloudflare Tunnel 语音部署与排障](./docs/CLOUDFLARE_TUNNEL_VOICE.md)
- [语音兼容性说明 / Voice compatibility notes](./docs/VOICE_FIX_REPORT.md)
- [皮肤开发指南 / Skin development guide](./docs/SKIN_DEVELOPMENT.md)
- [皮肤开发 Agent Skill / Skin Development Agent Skill](./.agents/skills/webspeak-skin-development/SKILL.md)
## 扩展生态 · Extensions
| 类型 · Type | 入口 · Resources |
| --- | --- |
| 皮肤包 · Skin packages | [皮肤索引 · Catalog](https://github.com/Huddle-Up-Forge/webspeak-skins) · [Discord Voice](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice) |
| 功能插件 · Functional plugins | [应用目录与开发起点 · Catalog & application starter](https://github.com/Huddle-Up-Forge/webspeak-plugin) · [开发指南 · Guide](./docs/PLUGIN_DEVELOPMENT.md) · [Agent Skill](./.agents/skills/webspeak-plugin-development/SKILL.md) |
皮肤包负责界面、布局及其附属小组件;功能插件使用标准浏览器环境和可选 Node 后端,自行实现业务功能。功能插件 API v2 已包含在 v0.3.1 中,从语音工作区的应用库启动,支持工具栏和皮肤侧栏入口。
Skins own appearance, layout and attached widgets. Functional plugin API v2 is included in v0.3.1 and opens applications from the voice workspace library, available in the toolbar or a skin sidebar.
### 开发与收录 · Develop & contribute
| 扩展 · Extension | 开发 Skill · Development skill | 收录 PR · Catalog PR |
| --- | --- | --- |
| 皮肤及附属小组件 · Skins & attached widgets | [Skin Development Skill](./.agents/skills/webspeak-skin-development/SKILL.md) | [webspeak-skins](https://github.com/Huddle-Up-Forge/webspeak-skins) |
| 独立功能应用 · Functional applications | [Plugin Development Skill](./.agents/skills/webspeak-plugin-development/SKILL.md) | [webspeak-plugin](https://github.com/Huddle-Up-Forge/webspeak-plugin) |
使用对应 Skill 开发时,Agent 会在完成构建与验证后,发布独立仓库中的源码、包及校验元数据,并自动向相应分发仓库提交规范的收录 PR。PR 包含用途、版本与兼容性、许可证、界面预览、不可变包地址、SHA-256 和实际验证结果;完成后返回 PR 链接,交由维护者审查。已收录包的纯版本更新遵循目录的元数据更新规则,不重复添加索引或制造空 PR。
The skills complete the contribution workflow automatically: publish validated source, packages and integrity metadata in an independent repository, then submit a focused catalog PR with compatibility, license, preview, immutable package reference, SHA-256 and test evidence. They return the PR for maintainer review. Version-only updates follow the catalog's metadata policy instead of duplicating entries or creating empty PRs.
## 社区 · Community
<div align="center">
[GitHub Issues](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/issues) · [QQ 群 · QQ group `869500475`](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=yhumUMDD9PmyYFWdXWUb_x7hM5trFQY8&authKey=Pw3HBGT7GwMinTQnuFGfnpf0aRSzXOJKcAiujVP1%2BXMpjheAKrncTRivicBJxpjV&noverify=0&group_code=869500475) · [Telegram](https://t.me/+8qShpTcuN9A3MWY9)
<a href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=yhumUMDD9PmyYFWdXWUb_x7hM5trFQY8&authKey=Pw3HBGT7GwMinTQnuFGfnpf0aRSzXOJKcAiujVP1%2BXMpjheAKrncTRivicBJxpjV&noverify=0&group_code=869500475">
<img src="./web/public/qq-group-qr.jpg" alt="WebSpeak QQ 群二维码" width="290" />
</a>
<details>
<summary>QQ群二维码 · QQ group QR code</summary>
**QQ群 / QQ group:`869500475`**
<p align="center"><a href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=yhumUMDD9PmyYFWdXWUb_x7hM5trFQY8&authKey=Pw3HBGT7GwMinTQnuFGfnpf0aRSzXOJKcAiujVP1%2BXMpjheAKrncTRivicBJxpjV&noverify=0&group_code=869500475"><img src="./web/public/qq-group-qr.jpg" alt="WebSpeak QQ group 869500475" width="260" /></a></p>
[通过群聊链接直接加入 / Join directly](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=yhumUMDD9PmyYFWdXWUb_x7hM5trFQY8&authKey=Pw3HBGT7GwMinTQnuFGfnpf0aRSzXOJKcAiujVP1%2BXMpjheAKrncTRivicBJxpjV&noverify=0&group_code=869500475)
</details>
[Telegram 群组 / Telegram group](https://t.me/+8qShpTcuN9A3MWY9)
### 相关项目 · Related projects
</div>
[NeteaseTSBot](https://github.com/yichen11818/NeteaseTSBot) — 面向 TeamSpeak 3/6 的音乐机器人,支持网易云音乐、QQ 音乐、Bilibili 和 Web 控制台。A TeamSpeak music bot with Netease Cloud Music, QQ Music, Bilibili and a web console.
## 友链项目 · Friend projects
## 贡献者 · Contributors
### [NeteaseTSBot](https://github.com/yichen11818/NeteaseTSBot)
感谢协议 SDK 作者、代码与文档贡献者,以及独立皮肤的原始作者。Thanks to the SDK author, code and documentation contributors, and original skin authors.
面向 TeamSpeak 3/6 的多平台音乐点播机器人,支持网易云音乐、QQ 音乐和 Bilibili 音频播放,并提供 Web 控制台。<br />
A multi-platform music bot for TeamSpeak 3/6 with Netease Cloud Music, QQ Music, and Bilibili playback, plus a web console.<br />
Ein plattformübergreifender Musikbot für TeamSpeak 3/6 mit Netease Cloud Music, QQ Music und Bilibili sowie Webkonsole.
<details>
<summary>查看贡献说明 · View contribution credits</summary>
## Contributors · 贡献者
- [HoneyBBQ](https://github.com/HoneyBBQ) — 上游 [teamspeak-js(`@honeybbq/teamspeak`)](https://github.com/HoneyBBQ/teamspeak-js) SDK 的作者,为 WebSpeak 提供底层 TeamSpeak 协议客户端能力。
- [ph1gros](https://github.com/ph1gros) — 在 [PR #48](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/48) 中报告并提供公开目标 IPv6 校验、管理员认证与会话、代理限流和 PCM 上行边界的安全审查、补丁及回归测试;相关问题由项目在 `dev` 分支重新实现并修复。[PR #46](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/46) 提供 TS3 版本识别修复及兼容性文档建议。Security findings, proposed fixes and regression tests; reimplemented on `dev`.
- [LainHE](https://github.com/LainHE) — [已合并 PR #2、#8、#28、#31–#35、#37、#38、#40](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ALainHE),涉及浏览器报错翻译、缩放与首页布局、屏幕共享码率与观看者头像、中继目标校验与异常重连、可信代理校验、连接失败传递、音频故障报告及 WebRTC 失败时的资源清理。
- [TimmySheep](https://github.com/TimmySheep) — [已合并 PR #13、#15–#24](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ATimmySheep),涉及 TS6 既有屏幕共享发现、屏幕比例、移动端语音/常亮/皮肤菜单、身份频道选项、PWA/主题、聊天历史、成员音频状态和麦克风权限等改进。
- [yichen11818](https://github.com/yichen11818) — [PR #25](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/25) 支持 TeamSpeak 注册昵称连接并保留昵称目标;[PR #51](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/51) 改进 KAAK 首次连接后的工作区保留与重连;[PR #27](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/27) 和 [PR #52](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/52) 提供 Discord 皮肤的原始设计与实现(提交署名 **yumi**),后由 WebSpeak 项目移植为[独立分发的 `.wskin` 皮肤](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice)。
感谢提交 PR 的贡献者:
- [Jh_Harry](https://github.com/JhHarry) — [Persona 3](https://github.com/JhHarry/webspeak-skin-persona3)、[Persona 4](https://github.com/JhHarry/webspeak-skin-persona4) 和 [Persona 5](https://github.com/JhHarry/webspeak-skin-persona5) 的皮肤样式、构建脚本与打包。Theme styles, build scripts, and packaging for the three Persona skins.
- [OddTurtleHead](https://github.com/OddTurtleHead) — [PR #57](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/57) 为皮肤开放宿主装饰的定制接口,完善独立皮肤恢复入口,并提供两套示例皮肤。Host chrome theming, a protected skin recovery control, and two example skins.
- [LainHE](https://github.com/LainHE) — [PR #2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/2):浏览器端报错翻译与提示改造。
</details>
## 许可证 · License · Lizenz · Лицензия · ライセンス
## 许可证 · License
WebSpeak 使用 [GNU Affero General Public License v3.0 only](./LICENSE) 发布。你可以使用、研究、修改和再分发本项目;如果修改后的版本通过网络向用户提供服务,需要按照 AGPL-3.0 向这些用户提供对应源代码。
WebSpeak 使用 [AGPL-3.0-only](./LICENSE) 发布。第三方依赖的许可与归属见各自项目。
WebSpeak is released under the [GNU Affero General Public License v3.0 only](./LICENSE). If a modified version is offered to users over a network, its corresponding source code must be offered under AGPL-3.0.
WebSpeak is distributed under [AGPL-3.0-only](./LICENSE). Third-party dependencies retain their respective licenses and attribution.
WebSpeak wird unter der [GNU Affero General Public License v3.0 only](./LICENSE) veröffentlicht. Bei Bereitstellung einer veränderten Version über ein Netzwerk muss der entsprechende Quellcode unter AGPL-3.0 angeboten werden.
<details>
<summary>Star History</summary>
WebSpeak распространяется по лицензии [GNU Affero General Public License v3.0 only](./LICENSE). Если изменённая версия предоставляется пользователям через сеть, соответствующий исходный код должен быть доступен этим пользователям на условиях AGPL-3.0.
<a href="https://star-history.com/#EchoSixHIYA/WebSpeak-client-for-TeamSpeak&amp;Date"><img src="https://api.star-history.com/svg?repos=EchoSixHIYA/WebSpeak-client-for-TeamSpeak&amp;type=Date" alt="WebSpeak star history" width="100%" /></a>
WebSpeak は [GNU Affero General Public License v3.0 only](./LICENSE) の下で公開されています。変更版をネットワーク経由でユーザーに提供する場合は、対応するソースコードを AGPL-3.0 に従ってユーザーに提供する必要があります。
</details>
## Star History
<a href="https://star-history.com/#EchoSixHIYA/WebSpeak-client-for-TeamSpeak&Date">
<img src="https://api.star-history.com/svg?repos=EchoSixHIYA/WebSpeak-client-for-TeamSpeak&type=Date" alt="WebSpeak Star History" width="100%" />
</a>
<div align="right"><a href="#readme-top">返回顶部 · Back to top ↑</a></div>
<p align="right"><a href="#readme-top">返回顶部 · Back to top ↑</a></p>
+65
View File
@@ -0,0 +1,65 @@
# Cloudflare Tunnel for WebSpeak
Cloudflare Tunnel publishes the WebSpeak **HTTPS/WSS** entry without opening a
public inbound port. It does **not** carry WebRTC media UDP, and it does not
make the gateway's `40000–40099/UDP` range reachable.
## Setup
1. Create a tunnel in the Cloudflare dashboard and copy its UUID and
credentials JSON.
2. Copy `config.yml.example` to `config.yml` and replace the UUID and
hostname. Rename the downloaded credentials file to
`REPLACE_WITH_TUNNEL_UUID.json`, or update the credentials path and Compose
mount to match its actual name. Point `service` at the WebSpeak HTTP listener
(`3040` by default).
3. Run cloudflared on the host (recommended on Windows/macOS):
```bash
cloudflared tunnel --config config.yml run
```
On Linux, `docker compose up -d` in this directory can run it in host mode.
4. In WebSpeak administration, set **Public media address** to the gateway's
public IP (for example `192.0.2.10`), not the Cloudflare hostname.
Allow `40000–40099/UDP` on the host firewall and security group.
5. Keep `WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY=all` so browsers try direct UDP
first. `WEBSPEAK_VOICE_PROFILE=auto` is the default: requests from a trusted
Cloudflare hop use the adaptive audio path, while other requests keep the
legacy path. The default trusted proxy list contains loopback only; if
cloudflared connects from another address, add that IP/CIDR to
`WEBSPEAK_TRUSTED_PROXIES`. Headers injected by a direct untrusted client are
ignored. Configure TURN only as the fallback for mobile networks or
UDP-blocked clients; see `deploy/coturn`.
6. Opus over WebSocket is opt-in. It requires an adaptive profile and either
the Admin → Voice setting or `WEBSPEAK_VOICE_OPUS_WS=1`; without it the
browser uses PCM.
## Why not use the Cloudflare hostname as the media address?
A Cloudflare-proxied hostname resolves to Cloudflare edge addresses. Those
edges do not forward the gateway's UDP media ports, so using them as ICE
candidates produces a path that looks configured but cannot carry audio.
WebSpeak therefore no longer infers the request `Host` as an ICE address when
the request arrives through a trusted Cloudflare hop and no media host was
configured. Without a public media address or TURN, the server reports
`NO_MEDIA_PATH` and, because WebRTC was not advertised, the browser uses the
compatibility transport. If an advertised WebRTC connection later fails, the
browser stays in the session with `WEBRTC_FAILED` and offers WebRTC reconnect;
it does not silently switch to compatibility transport.
## Verify
- `curl -I https://voice.example.com` succeeds through the tunnel.
- `chrome://webrtc-internals` shows host/srflx candidates to the public IP and,
when UDP is available, a direct selected pair.
- If the selected pair is `relay`, confirm TURN is reachable and that direct
UDP is actually blocked; do not switch the global policy to `relay` just
because the page is behind a Tunnel.
For the full voice rollout and rollback notes, see
[`docs/CLOUDFLARE_TUNNEL_VOICE.md`](../../docs/CLOUDFLARE_TUNNEL_VOICE.md).
This template has not been exercised end-to-end with a live coturn/Tunnel
deployment. Browser Opus fallback, especially on Safari and Firefox, also
requires device testing.
+10
View File
@@ -0,0 +1,10 @@
tunnel: REPLACE_WITH_TUNNEL_UUID
credentials-file: /etc/cloudflared/REPLACE_WITH_TUNNEL_UUID.json
ingress:
- hostname: voice.example.com
service: http://127.0.0.1:3040
originRequest:
connectTimeout: 30s
noTLSVerify: false
- service: http_status:404
+12
View File
@@ -0,0 +1,12 @@
services:
cloudflared:
image: cloudflare/cloudflared:latest
container_name: webspeak-cloudflared
restart: unless-stopped
# Linux only. On Docker Desktop for Windows/macOS, run cloudflared on the
# host and use http://127.0.0.1:3040 instead.
network_mode: host
command: tunnel --config /etc/cloudflared/config.yml run
volumes:
- ./config.yml:/etc/cloudflared/config.yml:ro
- ./REPLACE_WITH_TUNNEL_UUID.json:/etc/cloudflared/REPLACE_WITH_TUNNEL_UUID.json:ro
+8
View File
@@ -0,0 +1,8 @@
# Copy to .env and replace the secret. Keep this file out of git.
TURN_SECRET=replace-with-at-least-32-random-bytes
TURN_REALM=webspeak
# Public IPv4 of this host. Behind 1:1 NAT, use PUBLIC/PRIVATE, e.g.
# 192.0.2.10/10.0.0.5
TURN_EXTERNAL_IP=203.0.113.10
TURN_MIN_PORT=49160
TURN_MAX_PORT=49200
+82
View File
@@ -0,0 +1,82 @@
# WebSpeak TURN (coturn) deployment
TURN is a **fallback** for voice media when a browser cannot reach the WebSpeak
gateway over UDP, for example on mobile networks or networks that block UDP.
It is not required for the normal direct UDP path.
## 1. Configure
```bash
cp .env.example .env
# Generate a secret and put the same value in WEBSPEAK_TURN_REST_SECRET:
openssl rand -hex 32
```
Set `TURN_EXTERNAL_IP` to the host's public IPv4. If the host is behind 1:1
NAT, use `PUBLIC/PRIVATE` (for example `203.0.113.10/10.0.0.5`). The relay
range `49160–49200/UDP` is separate from WebSpeak's WebRTC range
`40000–40099/UDP`; do not reuse the WebRTC range.
## 2. Start and expose
```bash
docker compose --env-file .env up -d
docker compose logs -f coturn
```
Allow inbound:
- `3478/UDP` and `3478/TCP` for `turn:`
- `49160–49200/UDP` for relayed media
- `5349/TCP` only if you add TLS certificates for `turns:`
Do **not** put the TURN relay range behind Cloudflare Tunnel; Cloudflare Tunnel
does not carry this UDP traffic.
## 3. Connect WebSpeak
Use the same secret as coturn's `static-auth-secret`:
```bash
WEBSPEAK_TURN_REST_URLS='turn:turn.example.com:3478?transport=udp,turn:turn.example.com:3478?transport=tcp'
WEBSPEAK_TURN_REST_SECRET='<same value as TURN_SECRET>'
WEBSPEAK_TURN_REST_TTL_SECONDS=21600
# Keep direct UDP first. Use "relay" only where UDP is known to be blocked.
WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY=all
# Auto keeps direct and untrusted-proxy traffic on the legacy audio path.
WEBSPEAK_VOICE_PROFILE=auto
```
TURN does not require Opus; `WEBSPEAK_VOICE_OPUS_WS` remains off by default.
`WEBSPEAK_TURN_REST_URLS` accepts only `turn:`/`turns:` URL tokens. For static
ICE credentials, use `WEBSPEAK_VOICE_ICE_SERVERS` with a JSON array of ICE
server objects instead. WebSpeak generates short-lived `username`/`credential`
pairs with HMAC-SHA1, compatible with coturn's `use-auth-secret`.
## 4. Verify
From a network that blocks direct UDP, open the voice page and check:
- `chrome://webrtc-internals` (Chrome/Edge) or `about:webrtc` (Firefox)
- The selected candidate pair should become `relay` only when direct UDP fails.
- `WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY=all` must not be changed to `relay`
merely because a Tunnel is in front of HTTPS.
If TURN succeeds but audio still stutters, check whether the connection's
`voiceProfile` is `adaptive`; on a direct or legacy profile the old 80 ms
compatibility window is expected. TURN reachability alone does not enable the
adaptive jitter buffer.
## Security notes
- Keep the secret out of shell history, process listings where possible, and
git. Prefer an `.env` file with restrictive permissions.
- The compose file denies private, loopback and link-local peer ranges to
reduce abuse. If the WebSpeak gateway itself is on a private address, add a
narrowly scoped `--allowed-peer-ip` for that address and review the risk.
- This template has no TLS listener. Add certificates and a `turns:` URL only
when you need TURN over TLS on `5349/TCP`; test certificate renewal.
- This template has not been exercised end-to-end with a live Tunnel and
browser deployment; validate TURN reachability and credentials in the target
network before relying on it.
+40
View File
@@ -0,0 +1,40 @@
services:
coturn:
image: coturn/coturn:4.6.3
container_name: webspeak-coturn
restart: unless-stopped
# Host networking keeps the configured relay UDP range and external-ip
# mapping predictable. On Linux, replace it with explicit ports only if
# your platform does not support host mode.
network_mode: host
environment:
TURN_SECRET: ${TURN_SECRET:?set TURN_SECRET in .env}
TURN_REALM: ${TURN_REALM:-webspeak}
TURN_EXTERNAL_IP: ${TURN_EXTERNAL_IP:?set TURN_EXTERNAL_IP in .env}
TURN_MIN_PORT: ${TURN_MIN_PORT:-49160}
TURN_MAX_PORT: ${TURN_MAX_PORT:-49200}
command:
- -n
- --log-file=stdout
- --no-cli
- --fingerprint
- --lt-cred-mech
- --use-auth-secret
- --static-auth-secret=${TURN_SECRET}
- --realm=${TURN_REALM}
- --external-ip=${TURN_EXTERNAL_IP}
- --listening-port=3478
- --min-port=${TURN_MIN_PORT}
- --max-port=${TURN_MAX_PORT}
- --stale-nonce=600
- --no-multicast-peers
- --denied-peer-ip=0.0.0.0-0.255.255.255
- --denied-peer-ip=10.0.0.0-10.255.255.255
- --denied-peer-ip=127.0.0.0-127.255.255.255
- --denied-peer-ip=169.254.0.0-169.254.255.255
- --denied-peer-ip=172.16.0.0-172.31.255.255
- --denied-peer-ip=192.168.0.0-192.168.255.255
- --denied-peer-ip=::1
- --denied-peer-ip=fc00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
- --denied-peer-ip=fe80::-febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff
- --denied-peer-ip=ff00::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
+197
View File
@@ -0,0 +1,197 @@
# Cloudflare Tunnel 下的 WebSpeak 语音
本文说明“网页/信令走 Cloudflare Tunnel,媒体尽量直连 UDP”的部署方式。
核心原则:
- **WebRTC 优先直连**:浏览器直接向网关公网 IP 的 `40000–40099/UDP` 发包。
- **Tunnel 只承载 HTTPS/WSS**:Cloudflare Tunnel 不转发 UDP,不能把
Cloudflare 代理域名当作 ICE 媒体地址。
- **TURN 只做后备**:手机流量、公司网络或 UDP 被拦时,才让媒体走
`turn:`/`turns:`,不默认全程 `relay`。
- **CFT 是增量路径**:默认 `WEBSPEAK_VOICE_PROFILE=auto`,非可信 Cloudflare
请求继续使用原有的 80ms 固定窗口、裸 1920 字节 PCM 和旧混音参数;只有
经过可信 Cloudflare 代理的请求(或显式 `adaptive`)才启用自适应 buffer /
pacer / 修正后的 RTP marker。不配置 CFT、TURN 或新变量时,直连部署保持原行为。
## 兼容性矩阵
| 部署 | 媒体路径 | 音频 profile | 需要 TURN |
| --- | --- | --- | --- |
| 直连,无 CFT | 浏览器 → 网关 UDP `40000–40099` | `legacy`(默认) | 否 |
| 直连,显式 `PROFILE=adaptive` | 同上,直连优先 | `adaptive` | 否 |
| CFT + 显式公网 IP | 浏览器 → 网关 UDP,CF 只走信令 | `adaptive` | 否 |
| CFT + 无公网媒体地址 | 无直连;兼容模式或 TURN | `adaptive` | 是(若需要 WebRTC) |
| 手机/UDP 被拦 | TURN relay 后备 | `adaptive` | 是 |
`legacy` 不是“禁用 WebRTC”,它只锁定旧音频时序和旧帧路径;WebRTC、STUN、
UDP 端口仍按原配置工作。
## 1. 管理控制台与部署检查
### 1.1 管理控制台(推荐)
管理台“服务器 → 语音”提供与部署相关的全部开关,不再需要仅为 CFT/TURN
修改环境变量:
- **语音模式**:`自动`(推荐,直连走 `legacy`、可信 Cloudflare 代理走
`adaptive`)、`兼容模式`、`自适应`。
- **兼容模式 Opus**:仅 `adaptive` 生效,默认关闭;浏览器不支持时自动回退
PCM。
- **自适应 jitter 上限**:80–500 ms,配置自适应缓冲目标的上限;它不是严格的
播放前瞻上限,调低也不会恢复旧版超限 `clear()` 行为。
- **TURN 后备**:TURN REST URL、共享密钥和凭证有效期。TURN 只在直连 UDP
失败后使用,不作为默认路径。
保存后对**新的语音连接**生效,不需要重启网关。配置持久化在数据库中:控制台
非空值覆盖对应环境变量,未配置的字段继续继承环境变量;清空 TURN URL 或在
控制台移除密钥会显式停用 TURN。TURN 共享密钥使用网关主密钥加密存储,管理
API 只返回“是否已配置”,不会把明文回传浏览器。
静态 `WEBSPEAK_VOICE_ICE_SERVERS` 以及浏览器/网关的 `transportPolicy` 仍由
环境变量控制,控制台刻意不提供“全程 relay”开关,避免误把直连优先改成中继
优先;需要排障时再临时设置环境变量并重启。
Cloudflare 判定只接受来自 `WEBSPEAK_TRUSTED_PROXIES` 中直接相邻代理的
`cf-ray`、`cf-connecting-ip` 或包含 `cloudflare` 的 `cdn-loop`。默认只信任
本机回环地址;cloudflared 若从其他地址连接,应把其来源 IP/CIDR 加入该变量。
直连客户端自行注入这些头不会被当作 Cloudflare,也不会切换到 `adaptive`。
### 1.2 部署检查清单
1. 管理台“服务器 → 语音”先选 `自动`,再在“高级参数 → 公网媒体地址”填写网关的**公网 IP**,例如 `192.0.2.10`,不要填 Cloudflare 的代理域名。保存后重新连接。
2. 主机防火墙/安全组放行 `40000–40099/UDP`,并确认云厂商安全组也放行。
3. 如果网关本身在 NAT 后面,需要把 UDP 端口映射到网关,或给网关一个
可直连的公网地址;仅做 TCP 端口映射不够。
4. `webrtc_public_host` 为空时,直连部署仍可按请求入口推断;但通过
Cloudflare 的请求不会再拿 CF 边缘 `Host` 当 ICE 地址,避免“看起来
配置好了、实际没有媒体路径”。Cloudflare 场景请显式填写公网媒体地址。
## 2. 服务端环境变量
在启动 WebSpeak 的环境里设置;修改后重启进程,并对新连接生效。控制台已保存
的非空语音配置优先于这里的环境变量;控制台留空的字段才继承环境变量。日常
CFT/TURN 调整建议直接用控制台,避免同时维护两套配置。
| 变量 | 默认 | 作用 |
| --- | --- | --- |
| `WEBSPEAK_VOICE_PROFILE` | `auto` | `auto`:非可信 Cloudflare 请求用 `legacy`,可信 Cloudflare 代理请求用 `adaptive`;也可显式 `legacy`/`adaptive`。非 CFT 不配置时保持原行为。 |
| `WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY` | `all` | 浏览器 ICE 策略。直连优先保持 `all`;只有确认 UDP 完全不可用才设 `relay`。 |
| `WEBSPEAK_VOICE_GATEWAY_ICE_TRANSPORT_POLICY` | `all` | werift 网关侧策略。网关自身在 NAT 后才考虑 `relay`。 |
| `WEBSPEAK_VOICE_ICE_SERVERS` | 空 | 静态 ICE 列表,JSON 数组或逗号分隔的 STUN URL;最多 8 个。 |
| `WEBSPEAK_TURN_REST_URLS` | 空 | coturn REST 的 `turn:`/`turns:` URL,逗号分隔;最多 8 个。 |
| `WEBSPEAK_TURN_REST_SECRET` | 空 | 与 coturn `static-auth-secret` 相同的密钥,至少 16 字符才启用。 |
| `WEBSPEAK_TURN_REST_TTL_SECONDS` | `21600` | TURN 临时凭证有效期,范围 300–86400。 |
| `WEBSPEAK_VOICE_OPUS_WS` | `0` | 兼容模式是否允许浏览器用 WebCodecs 发 Opus;仅 `adaptive` 且环境变量或控制台显式启用时生效,不支持时自动回退 PCM。 |
| `WEBSPEAK_VOICE_JITTER_MAX_MS` | `300` | 自适应 jitter buffer 的上限,范围 80–500;仅 `adaptive` 生效。 |
示例(直连优先 + TURN 后备):
```bash
WEBSPEAK_VOICE_PROFILE=auto
WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY=all
WEBSPEAK_VOICE_GATEWAY_ICE_TRANSPORT_POLICY=all
WEBSPEAK_TURN_REST_URLS='turn:turn.example.com:3478?transport=udp,turn:turn.example.com:3478?transport=tcp'
WEBSPEAK_TURN_REST_SECRET='<与 coturn 相同的密钥>'
WEBSPEAK_TURN_REST_TTL_SECONDS=21600
```
直连部署若也想启用自适应 buffer / pacer,显式设置
`WEBSPEAK_VOICE_PROFILE=adaptive`;这会改变非 CFT 的音频时序,但不是开通
CFT 的必选项。
`turn:` 的 UDP/TCP 3478 适合大多数场景;如已给 coturn 配好证书,可再加
`turns:turn.example.com:5349?transport=tcp`。TURN 的 relay 端口默认
`49160–49200/UDP`,与 WebRTC 的 `40000–40099/UDP` 分开,见
`deploy/coturn/`。
### 关于 werift 与 `turns:`
已核对 `werift` 源码:`parseIceServers` 会把 `turns:` 解析为
`turnTransport: "tls"`,`createTurnClient` 走 `TlsTransport`;
`iceUseTcp: false` 只影响 ICE-TCP host candidate 的收集,不会阻止 TURN 的
TLS 控制连接。因此 `turns:` 在 `iceUseTcp: false` 下仍可用。该结论是源码
级核实,未在真实 coturn 上做端到端联调。
## 3. 兼容模式(PCM/Opus over WebSocket)
兼容模式不依赖 UDP,任何部署都可用。以下自适应/Opus/pacer 只在
`voiceProfile=adaptive` 时生效;`legacy` 直连保留原来的 80ms 固定窗口,
超过窗口会 `clear()` 解码器并重建,和旧版一致。
自适应分支:
- jitter buffer:目标超前量按到达 jitter 估算,初始 80ms,上限默认
300ms;溢出时只重排播放头、保留 `AudioDecoder`,不再每次超过 80ms
就销毁解码器。
- 解码队列硬上限 12;只有极深积压才丢最新帧。
- 上行 20ms pacer;新帧格式 `0x01 + PCM` 和 `0x02 + Opus`,旧 1920 字节
PCM 仍兼容。
- 仅当 `adaptive` 且环境变量或控制台显式启用 Opus,同时浏览器支持
WebCodecs 时才发 Opus,否则自动回退 PCM。
legacy 分支:
- 80ms 固定播放窗口;超限清空当前 speaker 的 source 和 decoder。
- 浏览器发送裸 1920 字节 PCM,不创建 Opus encoder。
- 服务端不启用 pacer;WebRTC 混音保持 4 帧队列和每包 marker。
验证:
1. 在 Chrome/Edge 打开 `chrome://webrtc-internals`:已下发 WebRTC offer 后
若建连或传输失败,页面应留在当前 TeamSpeak/WebSocket 会话,自动恢复
PCM/Opus over WebSocket 的上下行兼容音频(上行需要已有麦克风权限),
同时显示 `WEBRTC_FAILED` 和“重新连接 WebRTC”。
2. 点击“重新连接 WebRTC”只重试 WebRTC,不重新连接 TeamSpeak,也不新建
语音 WebSocket。重连协商期间保持兼容收发;只有 WebRTC 真正 ready 后才
停止兼容传输、清除失败横幅和按钮。再次失败则继续兼容保通话,横幅和
按钮保留。
3. 网关未 advertise WebRTC 的禁用、浏览器不支持或 `NO_MEDIA_PATH` 路径仍
直接使用兼容模式,不显示这块 WebRTC 失败按钮。
4. 在管理台或日志看 `audio.opus` trace:`active` 表示 Opus 已启用,
`pcm-fallback` 表示回退。
5. 连续说话 2–3 分钟,观察是否还有周期性“整段静音/重启”式卡顿;新
逻辑不应再因 80ms 硬窗口反复 `clear()`。
## 4. 验收与回滚
**验收顺序**
1. 同一网络下先用直连 UDP:`chrome://webrtc-internals` 选中 pair 应为
`host`/`srflx`,不是 `relay`。
2. 手机 4G/5G 或关 UDP 的 Wi-Fi 再测:没有直连时才会出现 `relay`,且
音频可通。
3. 对未下发 WebRTC 的路径(关闭 WebRTC、无媒体路径或浏览器不支持)测
2–3 分钟兼容模式。确认连接
`connected` 消息中的 `voiceProfile` 为 `adaptive` 后,`bufferResets`
不应持续增长、没有解码器反复重建;若为 `legacy`,看到旧 80ms 行为是
预期的。
**回滚**
- 恢复非 CFT 旧行为:在管理台“语音模式”选 `兼容模式`,或设置
`WEBSPEAK_VOICE_PROFILE=legacy`(没有控制台覆盖时)。legacy 会恢复
80ms/`clear()`、裸 PCM、旧 WebRTC mixer;不需要回退前端构建。
- 关闭兼容模式 Opus:在管理台取消“兼容模式使用 Opus”,或设置
`WEBSPEAK_VOICE_OPUS_WS=0`;注意只有 `adaptive` 会下发 Opus 能力。
- 限制 jitter 缓冲:管理台把“自适应 jitter 上限”调到 80,或设置
`WEBSPEAK_VOICE_JITTER_MAX_MS=80`;这只是把上限压回 80ms,**不会恢复
旧版“超过 80ms 就 `clear()` 解码器”的行为**。要完全回到旧行为,使用
`兼容模式` / `legacy`。
- 关闭 TURN:在管理台清空 TURN URL(或移除密钥,会同时清空 URL),或删除
`WEBSPEAK_TURN_REST_URLS` / `WEBSPEAK_TURN_REST_SECRET` 环境变量;浏览器
只保留直连/STUN;不要为了“排障”把
`WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY` 改成 `relay`,那会掩盖直连问题。
- 媒体地址配置错误时,先清空管理台“公网媒体地址”并确认非 Cloudflare
直连入口,再检查防火墙;Cloudflare 请求下留空会禁用直连,需要 TURN。
- 语音覆盖配置保存在现有 metadata 表,数据库保持 schema 13;TURN 密钥仍加密。
回退到 0.3.3 时旧程序会忽略新增元数据,不影响启动,也不会清除这些配置。
自动更新失败时可以继续使用现有代码回滚流程,无需降级数据库。
## 5. 已知限制
- 本文的 coturn/cloudflared 模板未做真实端到端联调;部署前必须在
目标网络验证 `3478/UDP`、`3478/TCP`、relay 端口和凭证一致性。
- Safari/Firefox 的 WebCodecs Opus 支持差异未在真实设备上逐一验证;
不支持时会回退 PCM,但兼容模式的 CPU/带宽开销会更高。
- Cloudflare Tunnel 不承载本文的 WebRTC UDP 媒体;即使 HTTPS/WSS 正常,
仍需要独立可达的公网媒体地址,或配置 TURN/使用兼容模式。
+154
View File
@@ -0,0 +1,154 @@
# WebSpeak 功能应用开发 / Functional application development
WebSpeak **v0.3.0** 使用应用运行时 **API v2**。`.wplugin` 与 `.wskin` 完全独立;旧 API v1、共享房间协议及其两个示例已移除,不兼容旧包。
插件是作者自己的应用:标准 HTML/CSS/JavaScript 前端,加上可选的 Node 后端。可以使用框架、浏览器原生 API、自己的 HTTP/WebSocket 协议、网络客户端和数据模型。宿主不提供按音乐、文件、视频等功能划分的业务 API,也不提供 `room.read/write` 或下载权限表。浏览器原有的安全上下文、用户手势、权限许可、跨域及网络可达性要求仍然适用。
## 管理与部署
管理员在 `/admin/plugins` 从 GitHub 安装或导入包,审核代码和依赖,配置作用域,勾选信任后启用。每次安装、更新均撤销信任并禁用,需要重新审核。审核是人工准入流程,校验包哈希不等于审核代码。写操作继续使用管理员认证、同源检查、CSRF 和审计。
**信任边界:** 前端运行在独立源,和工作台 DOM 分离,使用真实浏览器环境。Node 后端运行于独立子进程,拥有 WebSpeak 服务账户的操作系统权限,能够访问该账户可访问的网络和文件。独立进程、目录和 JS 堆上限用于生命周期与故障控制,不是恶意代码安全沙箱。仅安装审核且信任的应用。
运行时默认监听 `0.0.0.0:3042`:
| 环境变量 | 用途 |
| --- | --- |
| `WEBSPEAK_PLUGIN_PORT` | 应用端口,默认 3042 |
| `WEBSPEAK_PLUGIN_HOST` | 监听地址,默认 0.0.0.0 |
| `WEBSPEAK_PLUGIN_PUBLIC_ORIGIN` | 初始公开源,例如 `https://apps.example.com` |
本地工作台为 `127.0.0.1` 时自动使用 `localhost:3042`,反向亦然,以保持源分离。公网部署必须给应用配置独立 HTTPS 源,在管理页“应用运行时”保存;该设置优先于环境变量。代理应将该源的全部路径转发至应用端口,支持 WebSocket 升级和 SSE 长连接,关闭 SSE 缓冲。不要让代理记录 `/apps/…` 中的访问凭证,也不要与主站共用域 Cookie。
```caddyfile
apps.example.com {
reverse_proxy 127.0.0.1:3042
}
```
容器需映射应用端口,或让代理接入相同容器网络。端口/监听地址改变需重启;公开源可在后台更新,会撤销已有应用会话。主站直接使用 TLS 时,运行端口使用相同证书;TLS 在代理终止时,上游使用 HTTP。监听失败会保留主站和语音服务,后台显示不可用,修复后需重启。配置为主站自身源时拒绝打开应用。
## 作用域与身份
`server`:管理员配置允许的实际 TS `host:port`,用户按真实 TS 目标和频道获得作用域标识。`instance`:当前语音网关的已连接用户获得同一实例标识。作用域负责宿主准入和提供上下文,**不会替作者创建共享房间或自动同步数据**。应用后端应按 `request.webspeak.scope.key` 分组,并自行实现业务授权和同步。
TS 目标由实际语音连接解析,插件不能自报身份或频道。目标支持 `host:port`、`host#port`、`[IPv6]:port`,保存时规范化;SRV/Nickname 场景应核对实际目标。服务器范围切换频道后需重开;实例范围的频道变更通过上下文更新。断开、重连、更新、禁用、重启、配置修改或卸载会撤销旧凭证并关闭连接。服务端可以在没有打开面板时执行后台任务,直到禁用或停止。
入口属于实际语音网关;浏览器直连另一中继网关时,在那个网关安装配置。原生 TS 客户端不会执行网页应用,不同网关不会自动共享状态。作者可自行实现跨实例服务。
## 包格式与构建
复制 [通用起点](templates/plugin-app/manifest.json),修改 ID、元数据和业务代码。它只展示上下文及自定义计数路由,不是商店预装插件。
```text
my-app/
manifest.json
client/index.html
client/main.js
client/style.css
server/main.mjs # 可选
server/node_modules/ # 可选,已审核的运行依赖
```
```json
{
"apiVersion": 2,
"id": "community.my-app",
"name": "My application",
"version": "1.0.0",
"author": "Author",
"license": "MIT",
"description": "An independently implemented application",
"scopes": ["server", "instance"],
"client": { "entry": "client/index.html" },
"server": { "entry": "server/main.mjs" }
}
```
纯前端应用删除 `server` 声明。前端框架产物放入 `client/`,静态引用使用相对路径,不能假设根路径为 `/`。后端入口支持 `.mjs/.cjs`,依赖放在 `server/` 内或打包为自包含文件。宿主不会执行 `npm install`、安装脚本或原生编译;原生依赖需匹配目标 Node ABI/操作系统,不一定跨平台。运行环境为宿主 Node,当前项目要求 Node 22 或更高。
```sh
node scripts/build-plugin.mjs docs/templates/plugin-app /tmp/application.wplugin
```
构建器是独立 Node 脚本,可复制到插件仓库,无需导入 WebSpeak 源码。`.wplugin` 是 UTF-8 JSON:`{manifest,files}`;`files` 是路径到 `{encoding:"utf8"|"base64",data:string}` 的映射。支持普通 `client/`、`server/` 文件;禁止越界路径、符号链接、Windows 设备名、大小写冲突及文件/目录别名。入口必须是 UTF-8。封装上限 48 MiB、解码内容 32 MiB、单文件 16 MiB、4096 个文件,安装上限 50 个。宿主导入时完整校验。
## 浏览器上下文
宿主在入口 HTML 注入外部脚本,在应用模块运行前提供:
```js
const context = await window.webspeak.ready;
const unsubscribe = webspeak.onContextChange(next => render(next));
const latest = webspeak.getContext();
const response = await fetch(context.serverUrl + '/my-route', {
method: 'POST', body: JSON.stringify({anything: 'defined by the application'}),
signal: webspeak.signal
});
const socket = new WebSocket(context.socketUrl + '/my-socket');
```
| 上下文字段 | 内容 |
| --- | --- |
| `apiVersion` | 2 |
| `plugin` | manifest |
| `self` | 当前公开 `id/nickname/uid?` |
| `connection` | 真实 `target/channelId` 和当前频道公开 `members`(`id/nickname/uid?`) |
| `scope` | `{type:"server"|"instance",key:string}`;分组标识不能直接当文件路径 |
| `config` | 管理员公开 JSON,所有参与者可读 |
| `theme/language` | `light/dark` 和 `zh/en/de/ru/ja`,同步到 `<html data-theme>` 与 `lang` |
| `appId` | 本次打开的公开标识,不是长期身份或认证凭据 |
| `serverUrl/socketUrl` | 此会话的后端 HTTP/WS 根;纯前端为 `null` |
| `contextUrl` | 此会话最新上下文地址 |
运行时 URL 含临时凭证,不应持久化、广播或记录。`webspeak.signal` 在撤销或退出时中止,仍需清理自己的定时器、网络、媒体和订阅。应用应提供两种基础配色及适合的语言回退。
用原生 `fetch`、`WebSocket`、`RTCPeerConnection`、文件选择/下载、IndexedDB、Canvas 等编写功能。独立源存储遵循原生规则;同一运行源的应用共享该源存储,请按插件 ID 命名,不能把此设计当作互不信任插件间的隔离。服务端持久化使用 `dataDir`。
关闭面板会销毁 iframe 并取消未完成的打开操作。宿主每秒检查会话有效性,撤销后终止 HTTP、SSE、WS 和旧页面。控制平面只传上下文与生命周期;业务数据使用独立应用服务,不经过语音 WebSocket。
## 可选 Node 后端
```js
export default async function activate({ dataDir, config, publicConfig, events, signal, log }) {
return {
handle(req, res) {
// req.webspeak is verified by the host; req.url is your own route.
res.setHeader('content-type', 'application/json');
res.end(JSON.stringify({participant: req.webspeak.self.id}));
},
upgrade(req, socket, head) { /* your WebSocket protocol */ },
async stop() { /* flush data and release resources */ }
};
}
```
也可直接返回 `(req,res)=>…`。这是 Node 原生请求/响应,可适配 Express、WS 等库。`req.webspeak` 含 `apiVersion/appId/self/connection/scope`,不含临时 URL 或管理凭据;服务端 `connection` 只有目标和频道。代理剥离主站 Cookie、Authorization 和伪造的 `x-webspeak-*` 头;应用自行认证可使用自定义头或自己的外部服务。后端不会收到主站管理员/Query 密钥,除非管理员主动在插件配置中提供。
`dataDir` 为本插件持久目录,更新/重启/卸载保留。代码提取目录会清理,不可持久化。包文件没有可执行位;额外子程序需作者自行处理权限和平台。Node 网络、文件、子程序和第三方服务同样属于审核范围。
`config` 是后端私密 JSON,`publicConfig` 是公开 JSON。私密配置在管理页仅显示是否已保存,支持保留/替换/删除,用实例主密钥加密存储;启用的 Node 代码获得明文。它不是针对恶意插件的秘密保险箱。不要把私密配置写入响应或日志。
`events` 为 Node `EventEmitter`:`participantJoined/contextChanged` 提供服务端公开上下文,`participantLeft` 为 `{appId,selfId,scopeKey}`。加入指打开应用面板,不是全体 TS 成员。`signal` 在停止时中止;`log(level,message)` 提供限流日志,宿主当前以 debug 级别记录。
每个后端一个进程,默认最多 8 个;启动超时 10 秒、停止宽限 2 秒、JS 堆上限 256 MiB(不是总 RSS 限额)。失败显示错误、撤销会话,可手动重启,无无限重试。每个语音连接最多 8 个打开会话,全局 800 个,每会话最多 32 条代理连接及 4 条上下文 SSE。普通 HTTP 空闲超时 120 秒,无上下文 SSE 且 90 秒无活动的会话回收。作者负责消息大小、业务授权、并发、存储一致性和依赖资源用量。
## 分发与验证
[分发仓库](https://github.com/Huddle-Up-Forge/webspeak-plugin) 目录为 `{"schemaVersion":2,"plugins":[{"id":"community.my-app","repository":"https://github.com/OWNER/REPO","metadataPath":"plugin.json"}]}`。插件仓库 `plugin.json` 包含 `manifest` 和 `package:{ref,path,sha256}`。`ref` 使用固定提交/不可变标签,`path` 指向已提交包,SHA-256 为包原始字节哈希。实例安装时校验包哈希、API 版本、插件 ID、版本、作用域集合与前后端入口。商店展示 `plugin.json` 里的名称、描述、作者和许可证,实例安装后展示包内清单里的值。目录或安装修订改变时需重新加载。空目录不默认安装插件。
需要后台配置的插件应在仓库 README 写明公开与私密字段的用途、必填项、默认值、取值范围和凭据获取方式,并提供含占位符的 `config.example.json`。管理员可从已安装插件打开仓库,并使用后台的通用字段编辑器。P2P 文件传输、视频同看和 TSMusicBot 有专用表单,由管理前端提供。仓库示例文件供管理员参考,当前运行时没有自动注册表单的接口。
验证实际构建包的导入、审核、启用、自定义 HTTP/WS、依赖加载、持久化和关闭/断线/禁用/更新撤销;检查明暗、语言、窄屏。协作另测两位真实参与者及并发/离开/重连。区分模拟身份、真实 TS、浏览器交互与跨网络证据。宿主回归:`npm run verify`。
## 插件入口与应用窗口 / Plugin launcher and application window
插件入口由宿主管理。WebSpeak 0.3.2 起,完整语音皮肤可以把 `voice.plugin-launcher` 放到工具栏或侧栏,并选择抽屉或对话框。布局缺少可用插槽时会显示宿主的应用库入口。应用库和应用内容使用非模态窗口:打开后仍可操作工作台;标题栏可拖动,支持最小化、最大化、还原和关闭,小屏幕自动限制在可视区域内。宿主窗口优先读取标准 `color-scheme` 来选择日间/夜间配色,不继承皮肤组件样式。
最小化、切换到应用库、再返回当前应用均保留同一个 iframe 与会话,传输、播放等任务不会因收起窗口而重置。关闭窗口、切换至另一个应用或语音会话撤销时,宿主结束当前应用会话。当前同时承载一个前端应用;不要把窗口最小化当成退出事件。
应用只负责 iframe 内部内容,使用自身响应式日间/夜间样式和上下文中的主题、语言。不读取或改写皮肤 DOM,不绘制覆盖宿主的全屏遮罩,不自行重复宿主的标题栏、最小化和关闭按钮。需要自有导航时可在内容区实现。应用界面优先显示功能与实际状态,不重复运行环境、权限或免责说明;管理员启用时的信任与权限信息保留在管理流程中。
## 实例级用户授权
首次访问时,宿主统一征求第三方皮肤与功能应用的使用授权;决定按浏览器源保存,不迁移旧的逐皮肤授权。拒绝或未选择时,只显示日间、夜间、ILLUSIA 三款官方皮肤,KAAK 和功能应用入口均隐藏。皮肤菜单最后的“授权”可随时更改。撤回会关闭 iframe 并撤销当前打开操作/应用会话,不停止管理员启用的全实例后台服务。应用不得以入口以外的方式绕过宿主授权,也无需重复询问同一份宿主上下文授权;相机、麦克风等浏览器原生许可仍由浏览器处理。
+415 -109
View File
@@ -1,59 +1,182 @@
# WebSpeak · Deutsch
<a id="readme-top"></a>
[Projektstartseite](../README.md) · [简体中文](./README.zh-CN.md) · [English](./README.en.md) · [Русский](./README.ru.md) · [日本語](./README.ja.md)
<div align="center">
<img src="./assets/webspeak-logo.png" alt="WebSpeak" width="88" />
<h1>WebSpeak · Deutsch</h1>
<p><strong>Deiner TeamSpeak-Community im Browser beitreten.</strong></p>
<p><a href="../README.md">Projektstartseite</a> · <a href="./README.zh-CN.md">简体中文</a> · <a href="./README.en.md">English</a> · <a href="./README.ru.md">Русский</a> · <a href="./README.ja.md">日本語</a></p>
<p>
<a href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest"><img src="https://img.shields.io/github/v/release/EchoSixHIYA/WebSpeak-client-for-TeamSpeak?style=flat-square&amp;color=0f766e" alt="Release" /></a>
<a href="../LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--only-0f766e?style=flat-square" alt="AGPL-3.0-only" /></a>
</p>
</div>
WebSpeak ist ein selbst gehosteter Webclient und ein Sprach-Gateway für TeamSpeak 3 und TeamSpeak 6. Nutzer können ohne Desktop-Client im Browser Kanälen beitreten; Administratoren verwalten Zielserver, Zugriff und Laufzeitstatus über die Webkonsole.
WebSpeak ist ein selbst gehosteter Browserclient und ein Sprach-Gateway für TeamSpeak 3 und TeamSpeak 6. Nutzer verwenden Sprache, Chat und Bildschirmfreigabe im Browser; Betreiber verwalten Zielserver, Zugriff und Daten über die Webkonsole.
Stabile Version: [Hinweise zu v0.3.3](#latest-release-notes) · [Pakete herunterladen](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) · Konsolen-Updates, Wiederherstellung und bessere Skin-Kompatibilität.
[Live-Demo](#demo) · [Funktionen](#features) · [Screenshots](#screenshots) · [Bereitstellung](#deployment) · [Verwaltung](#administration) · [Erweiterte Einstellungen](#advanced) · [Skins & Plugins](#extensions) · [Problemlösung](#troubleshooting) · [Änderungsprotokoll](#changelog)
<a id="demo"></a>
## Live-Demo
Adresse: <https://webspeak.example.invalid>
- [Shanghai · shanghai.webspeak.online](https://shanghai.webspeak.online)
- [Hongkong · webspeak.online](https://webspeak.online)
Die öffentliche Demo läuft in Hongkong. Netzwerkbedingungen und Auslastung können instabil sein; Latenz, Verbindungsabbrüche oder kurze Ausfälle beschreiben nicht jede eigene Bereitstellung.
Willkommensseite und Sprachbereich direkt ausprobieren. Netzwerk, Auslastung und Verfügbarkeit der Demo-Knoten können schwanken.
## ✨ Funktionen
<a id="features"></a>
## Funktionen
| Funktion | Beschreibung |
| --- | --- |
| TeamSpeak-Kompatibilität | Unterstützt TeamSpeak 3 und TeamSpeak 6 und erkennt das Zielprotokoll automatisch. |
| Plattformübergreifendes P2P-Bildschirmteilen | Browsernutzer und native TeamSpeak-6-Clients können die Bildschirmfreigabe gegenseitig starten und ansehen; WebRTC/ICE überträgt Medien direkt, WebSpeak leitet nur die Signalisierung weiter. |
| IPv6-Ziele | IPv6-TeamSpeak-Ziele und über DNS aufgelöste IPv6-Adressen werden standardmäßig unterstützt. |
| Kanäle und Mitglieder | Kanalstruktur und aktuelle Mitglieder anzeigen und Kanäle wechseln. |
| Echtzeit-Sprache | Opus-Audio mit kompatiblem Transport und optional integriertem WebRTC für geringere Latenz. |
| Audiosteuerung | Mikrofon und Lautsprecher auswählen, Lautstärke regeln, testen, stummschalten, VOX und individuelle Mitgliedslautstärke. |
| Browserseitige Geräuschunterdrückung | Optionale Mikrofon-Geräuschunterdrückung in der Browseraufnahme, ohne zusätzliche serverseitige Audioverarbeitung. |
| Nachrichten und Aktionen | Kanal- und Serverchat, private Nachrichten, Anstupsen und Flüsterziele. |
| Desktop-Begleitton | Audio eines freigegebenen Fensters oder Browser-Tabs im aktuellen Kanal teilen. |
| Identität und Zugriff | Gespeicherte Identität, eigene Ziele und widerrufbare Einladungslinks mit Ablaufzeit. |
| Administration | Ziele, Zugriff, WebRTC, Relays, Einladungen, Sitzungen, Protokolle, Diagnosen und Backups verwalten. |
| Skins | Geschützte Tages-, Nacht- und ILLUSIA-Skins sowie instanzverwaltete `.wskin`-Designs mit Aktivierungs- und Standardauswahl im Adminbereich. |
| Oberfläche | Chinesische, englische, deutsche, russische und japanische Oberfläche sowie responsive Desktop-/Mobilansicht. |
| Selbsthosting | Daten bleiben beim Betreiber; Docker-, Windows-x64- und Linux-x64-Bereitstellung sind verfügbar. |
| Echtzeit-Sprache | Opus, optionales WebRTC und WebSocket-Fallback; Stummschaltung, VOX, Geräteauswahl, Browser-Geräuschunterdrückung und Lautstärke je Mitglied. |
| Kanäle & Nachrichten | Kanalbaum und TeamSpeak-Trenner, Mitgliedsstatus, Kanalwechsel, Kanal-/Server-/Privatchat, Anstupsen, Flüstern und lokaler Chatverlauf. |
| Bildschirm & Audio | Bildschirmfreigabe zwischen Browsern und unterstützten nativen TeamSpeak-6-Clients mit Qualitäts-, Bitraten- und Statistikoptionen; Fenster-/Tab-Audio auf dem Desktop. |
| Identität & Verbindungen | Gespeicherte Identitäten, TS3-Identitätsimport/-export, Favoriten und Verlauf, SRV-/Nickname-Auflösung, IPv4/IPv6 und Einladungen. |
| Instanzverwaltung | Feste oder offene Ziele, Zugriffsregeln, Einladungen, Sitzungen, Logs, Diagnosen, Backups und optionale TeamSpeak-Verwaltung. |
| Skins & Oberfläche | Tag, Nacht, ILLUSIA und KAAK, `.wskin`-Pakete über GitHub, fünf Sprachen und responsive Ansichten. |
| Verteilte Sprache | Der Browser verbindet sich direkt mit dem gewählten Relay-Sprach-Gateway; die URL der Eingangsinstanz bleibt erhalten. |
| Bereitstellung | Docker amd64/arm64, Serverpakete für Windows x64 und Linux x64/ARM64 sowie Android-Vorschau-APKs. |
## 🖼️ Screenshots
### TeamSpeak-Versionskompatibilität
Die Screenshots zeigen die deutsche Willkommensseite, den Sprachbereich, die Audiosteuerung und das Mitgliedermenü.
Sprachverbindungen verwenden das TeamSpeak-Clientprotokoll und benötigen keine Query-Zugangsdaten. Die optionale TS-Verwaltung verwendet eigene WebQuery-/ServerQuery-Zugangsdaten.
- **TeamSpeak 3**: Die Erkennung wertet die führende `3.x`-Versionsnummer aus. Ältere Serverversionen sollten in der jeweiligen Umgebung geprüft werden, da nicht jede historische Version separat getestet wurde.
- **TeamSpeak 6**: Unterstützt, einschließlich Bildschirmfreigabe mit nativen TeamSpeak-6-Clients.
- **Automatische Erkennung**: Das Gateway liest die `version`-Antwort des Servers und hält das erkannte Protokoll in der Verbindungsdiagnose fest.
- Das Gateway verwendet das Upstream-SDK `1.0.0-beta.23` [`@honeybbq/teamspeak`](https://github.com/HoneyBBQ/teamspeak-js); WebSpeak richtet sich an TeamSpeak 3 und 6.
<a id="screenshots"></a>
## Screenshots
![WebSpeak · Sprachbereich](./screenshots/webspeak-de.png)
<details>
<summary>Willkommensseite, Audiosteuerung und Mitgliedermenü anzeigen</summary>
### Willkommensseite
<p align="center"><img src="./screenshots/webspeak-de-home.png" alt="WebSpeak deutsche Willkommensseite" width="100%" /></p>
### Sprachbereich
<p align="center"><img src="./screenshots/webspeak-de.png" alt="WebSpeak deutscher Sprachbereich" width="100%" /></p>
![WebSpeak · Willkommensseite](./screenshots/webspeak-de-home.png)
### Audiosteuerung
<p align="center"><img src="./screenshots/webspeak-de-audio.png" alt="WebSpeak deutsche Audiosteuerung" width="100%" /></p>
![WebSpeak · Audiosteuerung](./screenshots/webspeak-de-audio.png)
### Mitgliedermenü
<p align="center"><img src="./screenshots/webspeak-de-menu.png" alt="WebSpeak deutsches Mitgliedermenü" width="100%" /></p>
![WebSpeak · Mitgliedermenü](./screenshots/webspeak-de-menu.png)
## 🧩 Erweiterte Funktionen
</details>
<a id="deployment"></a>
## Bereitstellung & erste Konfiguration
Die Compose-Konfiguration verwendet `network_mode: host` für Linux-Docker-Hosts. Für einen Windows-Server das Release-Paket verwenden.
| Methode | Geeignet für | Umgebung |
| --- | --- | --- |
| Docker Compose (empfohlen) | Dauerbetrieb, einfache Updates und persistente Daten | Docker Engine + Docker Compose |
| Release-Paket | Betrieb ohne Node.js und Build-Werkzeuge | Windows x64 oder Linux x64/ARM64 |
| Aus dem Quellcode | Entwicklung und Anpassungen | Node.js 22.12+, Git und native Build-Werkzeuge |
### Docker Compose (empfohlen)
```bash
git clone --depth 1 https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
docker compose pull
docker compose up -d
```
Nach dem Start ist WebSpeak unter `http://<dein-host>:3040` erreichbar. Bei einem Reverse Proxy auf diese Adresse zeigen; für WebRTC den im Adminbereich angezeigten UDP-Bereich freigeben. Die Daten liegen im Volume `webspeak-data`.
```bash
docker compose ps
docker compose logs -f webspeak
```
Upgrade:
```bash
git pull --ff-only
docker compose pull
docker compose up -d
```
`docker compose down -v` nicht ausführen, da dadurch Datenbank und Administratoreinstellungen gelöscht werden.
### Release-Paket
Das passende `windows-x64.zip`, `linux-x64.tar.gz` oder `linux-arm64.tar.gz` aus den [GitHub Releases](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) herunterladen und den enthaltenen Starter ausführen. Die Pakete enthalten Node.js und Produktionsabhängigkeiten. Docker unterstützt amd64/arm64.
Android-APKs für `arm64-v8a`, `armeabi-v7a` und `x86_64` sind ebenfalls verfügbar. Sie sind für Tests per Sideload debug-signiert, keine Google-Play-Pakete; echte TeamSpeak-Sprachtests auf Geräten stehen noch aus.
### Aus dem Quellcode
```bash
git clone https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
npm ci --ignore-scripts
npm rebuild @discordjs/opus --foreground-scripts
npm --prefix web ci
npm --prefix web run build
npm run build
npm start
```
Für den Bau von `@discordjs/opus` werden Python, Make und eine C/C++-Toolchain benötigt.
### Erste Konfiguration
1. `http://<dein-host>:3040/admin` öffnen.
2. Mit `admin` / `admin` anmelden und sofort ein neues Passwort mit mindestens 12 Zeichen setzen.
3. Unter **Server** TeamSpeak-Ziel und Zugriffsmethode konfigurieren, zum Beispiel `voice.example.com#9987`.
4. Für öffentliche Nutzung HTTPS einrichten; bei aktiviertem WebRTC den im Adminbereich angezeigten UDP-Bereich freigeben.
### HTTPS & persistente Daten
Öffentliche Webseite und WebSocket über HTTPS bereitstellen. Beispielsweise die eigene Domain auf den Host zeigen lassen und Caddy als Reverse Proxy einrichten:
```caddyfile
webspeak.example.com {
reverse_proxy 127.0.0.1:3040
}
```
Die Beispieldomain durch die eigene ersetzen. Ein erreichbarer Reverse Proxy oder Tunnel garantiert keine UDP-Medienverbindung; siehe [Erweiterte Einstellungen](#advanced). Release- und Quellcode-Installationen verwenden `data/`, Docker das Volume `webspeak-data`. Bei Backup und Umzug `webspeak.db` und den zugehörigen `master.key` gemeinsam aufbewahren.
<a id="administration"></a>
## Administration
Unter `/admin` werden Server, Zugriff, WebRTC, Relays, Einladungen, aktive Sitzungen, Logs und Backups verwaltet. Der Skin-Store liegt unter `/admin/skins`, der Store für funktionale Plugins unter `/admin/plugins`.
### Optionale TeamSpeak-Verwaltung
WebSpeak-Verwaltung und Sprachverbindungen sind davon unabhängig. Im Modus mit festem Server die TS-Verbindung unter `/admin/ts-admin` einrichten.
1. WebQuery auf dem TS-Server aktivieren und einen berechtigten TS-Administrator einen API-Schlüssel erstellen lassen. HTTP-/HTTPS-URL von WebQuery und Schlüssel eintragen. Gemeint ist der TS-Query-Dienst, nicht die WebSpeak-Webseite. Unterstützt werden TS3 ab 3.12 und TS6.
2. Virtuelle Server-ID `0` wählt anhand des festen Sprachports aus. Bei eingeschränkten Schlüsseln die freigegebene Server-ID eintragen. Änderungen erfordern einen schreibbaren Geltungsbereich und entsprechende TS-Rechte; Leseschlüssel dienen zur Anzeige.
3. Alternativ ServerQuery SSH oder bei TS3 ServerQuery TCP wählen. Query-Host (leer: festes Ziel), Query-Port, Benutzername und Passwort eintragen; SSH benötigt einen vertrauenswürdigen Hostschlüssel-Fingerabdruck. Dies ist kein SSH-Zugang zum Betriebssystem. TCP ist unverschlüsselt und nur für vertrauenswürdige Netze geeignet. HTTPS-Zertifikate müssen vom Gateway als vertrauenswürdig erkannt werden.
4. Speichern und verbinden oder aktualisieren. Verfügbar sind Servereinstellungen, Kanalverwaltung, Verschieben/Ausschließen/Sperren von Mitgliedern, Gruppenzuweisung und Entsperren. Aktionen benötigen Bestätigung und TS-Rechte; Listen werden manuell aktualisiert.
Zugangsdaten werden serverseitig verschlüsselt und nie von der API zurückgegeben. Datenbank und `master.key` gemeinsam sichern. Verbindungsfehler beeinflussen weder WebSpeak-Verwaltung noch Sprache. Sperren verwenden die Benutzer-UID, damit andere Nutzer derselben Gateway-IP nicht betroffen sind.
<a id="advanced"></a>
## Erweiterte Einstellungen
Diese Funktionen sind optional. Ohne sie arbeitet WebSpeak weiterhin mit dem kompatiblen Sprachtransport. Die Einstellungen befinden sich unter **Administration → Server** und gelten für neue Verbindungen.
### 1. WebRTC-Sprache mit niedriger Latenz
### WebRTC-Sprache mit niedriger Latenz
WebRTC verwendet für Browser-Sprache einen Echtzeit-Medienpfad und ermöglicht außerdem Desktop-Begleitton. Das aktuelle WebSpeak-Gateway stellt WebRTC selbst bereit; ein zusätzlicher Medienserver ist nicht erforderlich.
@@ -64,6 +187,18 @@ WebRTC verwendet für Browser-Sprache einen Echtzeit-Medienpfad und ermöglicht
Der Portbereich ist bei aktiviertem WebRTC gesperrt. Zum Ändern WebRTC zuerst deaktivieren und speichern, danach die Firewall-Regeln anpassen. Für öffentliche Bereitstellungen ist HTTPS erforderlich.
### Sprach-WebRTC hinter Reverse Proxy oder TCP-Tunnel
Unter **Server → Erweiterte Einstellungen** die **öffentliche Medienadresse** als per UDP erreichbare IP oder Domain des Sprach-Gateways eintragen, ohne Schema, Pfad oder Port. Sie ersetzt die aus dem Webseitenaufruf abgeleitete Adresse. Ein Proxy-Hostname ist nicht automatisch eine erreichbare Medienadresse.
**IPv6-Kandidaten** sind optional und behalten IPv4 bei; IPv6-Routing und Firewall müssen passen. Als **Sprach-STUN** kann `stun:turn.teamspeak.com:3478` eingetragen werden. Browser und Gateway verwenden dann denselben Dienst. Leer behält das bisherige Verhalten bei: STUN des Gateway-SDKs, kein Browser-STUN. Zulässig sind IPv4-erreichbare UDP-STUN-Domains oder IPv4-Adressen, keine IPv6-Literale oder TURN-Zugangsdaten.
Speichern und neu verbinden. Erreichbare Webseiten und WebSockets bedeuten nicht, dass UDP-Medien erreichbar sind. Den gesamten UDP-Portbereich öffnen und bei statischer Weiterleitung die Portnummern erhalten. STUN findet Adressabbildungen, leitet aber keine Audiodaten weiter und überwindet nicht jedes NAT.
Für Mobilfunk oder blockiertes UDP kann ein externer TURN-Dienst als optionales Fallback unter **Administration → Sprache** mit TURN-REST-URL, gemeinsamem Geheimnis und Gültigkeitsdauer eingerichtet werden; entsprechende Umgebungsvariablen sind `WEBSPEAK_TURN_REST_URLS` und `WEBSPEAK_TURN_REST_SECRET`. Konsolenwerte haben Vorrang und gelten ohne Neustart für neue Verbindungen. `WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY=all` versucht zuerst direktes UDP.
`WEBSPEAK_VOICE_PROFILE` ist standardmäßig `auto`: Nur Anfragen über einen vertrauenswürdigen Cloudflare-Proxy verwenden den adaptiven Puffer; direkte und andere Anfragen behalten das bisherige Verhalten mit 80 ms/Roh-PCM. Lokale Tunnel-Verbindungen sind standardmäßig vertrauenswürdig; wenn cloudflared von einer anderen Adresse verbindet, `WEBSPEAK_TRUSTED_PROXIES` konfigurieren. Für adaptive Nutzung auch bei direktem Zugriff explizit `adaptive` wählen oder unter Administration → Sprache festlegen. Opus über WebSocket ist standardmäßig aus und benötigt das adaptive Profil; es lässt sich unter Administration → Sprache oder mit `WEBSPEAK_VOICE_OPUS_WS=1` aktivieren. Ohne direktes UDP oder TURN meldet die Sitzung `NO_MEDIA_PATH` und verwendet den kompatiblen Transport. Details stehen in [`CLOUDFLARE_TUNNEL_VOICE.md`](CLOUDFLARE_TUNNEL_VOICE.md).
### ICE-Kandidaten für Bildschirmfreigabe
Die Medien der Bildschirmfreigabe versuchen weiterhin eine direkte Browser-zu-Browser-Verbindung; WebSpeak leitet nur die Signalisierung weiter. Standardmäßig werden die öffentlichen TeamSpeak-STUN-Dienste zur Ermittlung öffentlicher Kandidaten verwendet. STUN überträgt keine Medien. Ein autorisierter externer TURN-Dienst kann über `WEBSPEAK_SCREEN_SHARE_ICE_SERVERS` als JSON-Array konfiguriert werden, zum Beispiel:
@@ -78,11 +213,14 @@ Mit TURN kann die Medienübertragung diesen externen Dienst verwenden, aber niem
Browsernutzer und native TeamSpeak-6-Clients können Bildschirmfreigaben gegenseitig erkennen, starten und ansehen. Zwischen Browsern sowie zwischen Browser und nativem Client werden die Bildschirmmedien möglichst über eine direkte WebRTC/ICE-Peer-to-Peer-Verbindung übertragen; WebSpeak übernimmt Sitzungsberechtigung, Freigabestatus und SDP-/ICE-Signalisierung, transportiert aber keine Bildschirmmedien. Die Oberfläche zeigt Live-Status und Zuschauerzahl und bietet Lautstärke-, Vollbild- und Beenden-Steuerung. Für die Aufnahme stehen bis zu 1080p und 60 FPS sowie WebRTC-Statistiken zur Verfügung.
### 2. Relay-Modus
### Relay-Modus
Ein Relay hilft, wenn ein TeamSpeak-Server Verbindungen aus einer anderen Region ablehnt oder der direkte Weg instabil ist. Es ist kein VPN, sondern leitet nur den TeamSpeak-Verkehr der aktuellen WebSpeak-Sitzung weiter.
Eine Relay-Instanz ist ein dedizierter Weiterleitungsdienst ohne Besucher- oder Administrationsseite. Sie akzeptiert nur Gateway-Sitzungen mit passendem Token. Ein zufälliges Token mit mindestens 16 Zeichen verwenden.
Eine Relay-Instanz betreibt sowohl die ältere UDP-Kompatibilitätsweiterleitung als auch ein separates Sprach-Gateway, jedoch keine Besucher- oder Administrationsseite. Das Eingangs-Gateway signiert mit dem gemeinsamen Token ein einmaliges Sprach-Ticket und delegiert es; anschließend verbindet sich der Browser direkt mit dem Relay, das seinerseits TeamSpeak erreicht. Die Seite bleibt unter der URL des Eingangs-Gateways. Ein zufälliges Token mit mindestens 16 Zeichen verwenden.
<details>
<summary>Start- und Konfigurationsbeispiele für Relays anzeigen</summary>
#### Aus dem Quellcode starten
@@ -90,7 +228,7 @@ Eine Relay-Instanz ist ein dedizierter Weiterleitungsdienst ohne Besucher- oder
git clone --depth 1 https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
npm ci --ignore-scripts
npm run prepare:sdk
npm rebuild @discordjs/opus --foreground-scripts
npm run build
WEBSPEAK_MODE=relay \
WEBSPEAK_RELAY_TOKEN='replace-with-a-long-random-token' \
@@ -134,103 +272,60 @@ docker run -d --name webspeak-relay --restart unless-stopped --network host \
ghcr.io/echosixhiya/webspeak:latest
```
Den UDP-Listening-Port des Relay-Hosts freigeben, standardmäßig `39087`.
Das Sprach-Gateway lauscht standardmäßig auf `127.0.0.1:3041`. Eine HTTPS-Domain für das Relay einrichten und sie mit Caddy oder einem vergleichbaren Proxy an `127.0.0.1:3041` weiterleiten, zum Beispiel:
```caddyfile
relay.example.com {
reverse_proxy 127.0.0.1:3041
}
```
In den Relay-Einstellungen des Eingangs-Gateways als **Voice gateway address** diesen HTTPS-Ursprung eintragen, etwa `https://relay.example.com`. Die Seite bleibt auf ihrem ursprünglichen Gateway und öffnet danach eine WSS-Verbindung zum Relay. WebRTC ist auf dem Relay standardmäßig aktiviert. Zusätzlich UDP `40000-40099` freigeben und `WEBSPEAK_RELAY_WEBRTC_PUBLIC_HOST` auf eine öffentliche Relay-IP oder direkt erreichbare Domain setzen. Bei geänderter WebRTC-Portspanne auch die Firewall anpassen. UDP `39087` für ältere Kompatibilitätsweiterleitungen offen lassen.
#### Im Gateway aktivieren
1. **Administration → Server → Relay-Server** öffnen und einen oder mehrere Knoten hinzufügen.
2. Für jeden Knoten einen Anzeigenamen, einen Endpunkt wie `relay.example.com#39087` und das passende Token eintragen und speichern.
2. Anzeigename, UDP-Endpunkt wie `relay.example.com#39087`, HTTPS-Ursprung des Sprach-Gateways wie `https://relay.example.com` und das passende Token eintragen und speichern.
3. Besucher können auf der Willkommensseite Direktzugriff oder einen konfigurierten Relay-Knoten auswählen.
Relay deaktivieren und speichern, um die Option von der Willkommensseite zu entfernen.
### 3. Abhängigkeiten und Hinweise zur Herkunft
</details>
### Abhängigkeiten und Hinweise zur Herkunft
- Der Relay-Dienst ist Bestandteil von WebSpeak und verwendet Node.js-Standardbibliotheken; GOST, sing-box oder ein anderes Proxy-Framework werden nicht verwendet.
- WebRTC verwendet [werift](https://github.com/shinyoshiaki/werift-webrtc) `0.24.4`; das Upstream-Projekt steht unter MIT-Lizenz.
- Die TeamSpeak-Protokollverbindung verwendet den projektgepflegten [EchoSixHIYA/teamspeak-js](https://github.com/EchoSixHIYA/teamspeak-js)-SDK-Fork.
- TeamSpeak verwendet das Upstream-Paket [HoneyBBQ/teamspeak-js](https://github.com/HoneyBBQ/teamspeak-js) `@honeybbq/teamspeak@1.0.0-beta.23`; ein eigener SDK-Fork muss nicht gebaut werden.
## 🧾 Änderungsprotokoll
<a id="extensions"></a>
| Version | Datum | Zusammenfassung |
| --- | --- | --- |
| 0.2.5-preview | 2026-09-27 | `.wskin`-Skins, Aktivierungs-/Standardverwaltung und geschützte Tages-, Nacht- und ILLUSIA-Skins ergänzt; unfertiges Aurora-Voice-Beispiel entfernt, Skin-Ladeblitze, dunkle Bedienelemente und Artwork-Ebenen im Sprachbereich korrigiert sowie offiziellen Skin-Entwicklungs-Agent-Skill hinzugefügt. |
| [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) | 2026-09-22 | Plattformübergreifendes P2P-Bildschirmteilen zwischen Browsern und nativen TeamSpeak-6-Clients ergänzt; STUN-/externes-TURN-Konfiguration, Live-Player und Zuschauerstatus, Aufnahmeoptionen bis 1080p/60 FPS und WebRTC-Statistiken hinzugefügt; Bildschirmfreigabe-Interaktion verbessert und Besucherzählung ergänzt. |
| [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) | 2026-09-19 | Mitgliederplanung und direkte Verschiebung nach Berechtigung ergänzt; Avatar-, Stummschaltstatus- und Identitätsunterstützung hinzugefügt; Screenshots und Dokumentation für alle fünf Sprachen aktualisiert. |
| [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) | 2026-09-17 | Browserseitige Mikrofon-Geräuschunterdrückung, russische und japanische Oberfläche sowie sprachabhängige Begrüßungstexte ergänzt; Lautstärkeinteraktion und Fehlertexte/-codes auf Basis von PR #2 verbessert. |
| [v0.2.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.1) | 2026-09-13 | Verbindungsfehler auf der Willkommensseite verbessert, Fehlercodes erhalten und sicher gekürzt sowie IPv6-Ziele standardmäßig unterstützt. |
| [v0.2.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.0) | 2026-09-10 | Passwortabfrage, dedizierter Relay-Modus, Auswahl mehrerer Relays und Ursachendarstellung in der Administration ergänzt. |
| [v0.1.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.8) | 2026-09-08 | Docker-Bereitstellung vereinfacht, lokale TeamSpeak-Ziele unterstützt, 15-Sekunden-Timeout ergänzt und kontinuierliche Netzwerküberwachung eingeführt. |
| [v0.1.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.7) | 2026-09-06 | Deutsch, Telegram, Netzwerkleistung und Gesamtlautstärke ergänzt; Lautstärkeschwankungen beim Begleitton behoben. |
| [v0.1.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.6) | 2026-09-04 | Desktop-Begleitton, Hinweise zur gespeicherten Identität und Website-Symbol ergänzt; WebRTC-Mitgliederlautstärke korrigiert. |
| [v0.1.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.5) | 2026-09-04 | Identitätsspeicherung korrigiert und Designumschaltung verbessert. |
| [v0.1.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.4) | 2026-09-03 | WebRTC und Kanalchat korrigiert sowie Administration, Protokolle und Mobilansicht verbessert. |
| [v0.1.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.3) | 2026-09-03 | Integriertes WebRTC, aktualisiertes TeamSpeak-SDK und bessere Mitgliedersynchronisierung und Sprachpufferung. |
## Skins & funktionale Plugins
Vollständige Historie: [CHANGELOG.md](../CHANGELOG.md).
### Skin-Pakete `.wskin`
## 🚀 Bereitstellung
Skins gestalten Aussehen, Layout und zugehörige Widgets. Administratoren installieren, aktivieren und wählen den Standard-Skin. Autoren verwenden öffentliche Schnittstellen ohne Änderungen am WebSpeak-Quellcode.
| Methode | Geeignet für | Umgebung |
| --- | --- | --- |
| Docker Compose (empfohlen) | Dauerbetrieb, einfache Updates und persistente Daten | Docker Engine + Docker Compose |
| Release-Paket | Betrieb ohne Node.js und Build-Werkzeuge | Windows x64 oder Linux x64 |
| Aus dem Quellcode | Entwicklung und Anpassungen | Node.js 22.5+, Git und native Build-Werkzeuge |
[Entwicklungsleitfaden](./SKIN_DEVELOPMENT.md) · [Agent Skill](../.agents/skills/webspeak-skin-development/SKILL.md) · [Skin-Katalog](https://github.com/Huddle-Up-Forge/webspeak-skins) · [Discord-Voice-Beispiel](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice)
### Docker Compose (empfohlen)
### Funktionale Plugins `.wplugin`
```bash
git clone --depth 1 https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
docker compose pull
docker compose up -d
```
Funktionale Plugins sind unabhängige Anwendungen mit Browserfunktionen und optionalen Node-Backends, eigenen Routen, Daten und Zusammenarbeit. Administratoren prüfen Code und Abhängigkeiten vor der Aktivierung; Updates erfordern erneutes Vertrauen. Anwendungen unterstützen TS-Server- oder Instanz-Bereiche und eine separate Origin. API v2 ist ab v0.3.0 enthalten.
Nach dem Start ist WebSpeak unter `http://<dein-host>:3040` erreichbar. Bei einem Reverse Proxy auf diese Adresse zeigen; für WebRTC den im Adminbereich angezeigten UDP-Bereich freigeben. Die Daten liegen im Volume `webspeak-data`.
[Entwicklungsleitfaden](./PLUGIN_DEVELOPMENT.md) · [Agent Skill](../.agents/skills/webspeak-plugin-development/SKILL.md) · [Verteilungskatalog & Beispiel](https://github.com/Huddle-Up-Forge/webspeak-plugin)
```bash
docker compose ps
docker compose logs -f webspeak
```
<a id="troubleshooting"></a>
Upgrade:
## Problemlösung
```bash
git pull --ff-only
docker compose pull
docker compose up -d
```
| Symptom | Prüfen |
| --- | --- |
| WebRTC fällt trotz Aktivierung zurück | Fehlercode im Sprachstatus, HTTPS, vollständigen UDP-Portbereich und öffentliche Medienadresse prüfen. Ein TCP-Tunnel transportiert diese UDP-Medien nicht. |
| Ziel wird als lokale Adresse blockiert | Der offene Modus beschränkt Loopback-/Privatadressen. Für einen TS-Server auf demselben Host den administrativ konfigurierten festen Servermodus verwenden. |
| Bildschirmfreigabe läuft ab oder bleibt schwarz | Sie verwendet eine eigene WebRTC-Verbindung. Aushandlung, ICE und Codec-Statistik prüfen; verbundenes Sprach-WebRTC bestätigt nicht die Bildschirmverbindung. |
| Daten fehlen oder lassen sich nach dem Update nicht entschlüsseln | Dasselbe Datenverzeichnis bzw. Volume mit passendem `master.key` verwenden. Nicht mit `docker compose down -v` aktualisieren. |
`docker compose down -v` nicht ausführen, da dadurch Datenbank und Administratoreinstellungen gelöscht werden.
### Release-Paket
Das passende `windows-x64.zip` oder `linux-x64.tar.gz` aus den [GitHub Releases](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) herunterladen, in ein eigenes Verzeichnis entpacken und `start-webspeak.cmd` bzw. `./start-webspeak.sh` starten. Die Pakete enthalten Node.js und Produktionsabhängigkeiten.
### Aus dem Quellcode
```bash
git clone https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
npm ci --ignore-scripts
npm run prepare:sdk
npm rebuild @discordjs/opus --foreground-scripts
npm --prefix web ci
npm --prefix web run build
npm run build
npm start
```
Für den Bau von `@discordjs/opus` werden Python, Make und eine C/C++-Toolchain benötigt.
### Erste Konfiguration
1. `http://<dein-host>:3040/admin` öffnen.
2. Mit `admin` / `admin` anmelden und sofort ein neues Passwort mit mindestens 12 Zeichen setzen.
3. Unter **Server** TeamSpeak-Ziel und Zugriffsmethode konfigurieren, zum Beispiel `voice.example.com#9987`.
4. Für öffentliche Nutzung HTTPS einrichten; bei aktiviertem WebRTC den im Adminbereich angezeigten UDP-Bereich freigeben.
## ⚠️ Voraussetzungen und Hinweise
### ⚠️ Voraussetzungen und Hinweise
| Bereich | Hinweis |
| --- | --- |
@@ -242,4 +337,215 @@ Für den Bau von `@discordjs/opus` werden Python, Make und eine C/C++-Toolchain
| Gespeicherte Identität | Eine Browseridentität kann nur eine aktive gespeicherte Verbindung halten. Für parallele Verbindungen deaktivieren oder ein anderes Browserprofil verwenden. |
| Begleitton | Nur auf dem Desktop verfügbar und WebRTC erforderlich. Bei Fenster- oder Tab-Freigabe auch Audio freigeben. |
| Daten | Docker verwendet `webspeak-data`; Release-Pakete und Quellcode verwenden `data/`. Vor Updates sichern. |
| Sitzungslimit | Eine Instanz akzeptiert bis zu 100 aktive Browser-Sitzungen. |
| Sitzungslimit | Bis zu 100 aktive Browser-Sitzungen pro Instanz; dies ist ein Anwendungslimit, keine Leistungszusage oder TS-Lizenzgrenze. |
<a id="changelog"></a>
## Änderungsprotokoll
<a id="latest-release-notes"></a>
### [v0.3.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.3) · 2026-11-26
**Schwerpunkt: stabile Versionen prüfen und Updates direkt in der Verwaltung installieren.**
- Die Konsole prüft offizielle GitHub Releases; Administratoren wählen eine Version und bestätigen die Installation nach SHA-256-Prüfung. Die Installation unterstützt zunächst offizielle Linux-x64-Pakete im Vordergrund. Windows, Linux arm64, Docker, Quellinstallationen und von systemd, PM2 oder Supervisor verwaltete Instanzen können Versionen und Versionshinweise prüfen; die Installation bleibt manuell.
- Nur Programmdateien werden ersetzt. `data/`, `config.json`, `certs/`, installierte Skins und Plugins bleiben erhalten. Der Prozessneustart trennt Sprachsitzungen und Konsole kurzzeitig. SHA256SUMS.txt ist eine Integritätsprüfsumme, keine digitale Signatur.
- Gesundheitsprüfung, Rollback und Startwiederherstellung nach Unterbrechungen wurden gehärtet. Wiederherstellung und Update verwenden dieselbe Sperre. Größenlimits, Schreibfehler und Abbruch beenden Anfragen, geben Leser frei und bereinigen parallele Downloads.
- Skins können Wiederherstellungsbedienelemente über deklarierte Slots platzieren und Host-Bedienelemente über geschützte Variablen gestalten. Bei unbrauchbaren Werten greifen Standardlayout und -farben. Verbesserte Vermeidung verdeckter Elemente, Toast-Hit-Tests sowie Kompatibilität mit verzögertem Skin-Laden und Animationen; Wiederherstellungskürzel bleiben verfügbar.
- Enthält #60, #61, #62 und nachfolgende Korrekturen sowie aktualisierte Skin-Anleitungen und Beispiele. Danke an OddTurtleHead.
**Upgrade:** v0.3.2 und ältere Versionen zuerst manuell auf v0.3.3 aktualisieren. Danach sind Konsolen-Updates für künftige stabile Versionen auf unterstützten Installationen verfügbar. Daten vorher sichern. Docker: `docker compose pull && docker compose up -d` unter Beibehaltung des Datenvolumes. Verwaltete Dienste vor dem Dateiaustausch stoppen und anschließend neu starten.
Prüfung: 1102 automatisierte Tests, Frontend-/Backend-Builds und Docker-Startprüfung bestanden.
### [v0.3.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.2) · 2026-11-14
- Drittanbieter-Skins können Host-Dekorationen gestalten. Der Host verwaltet Wiederherstellung und Freigabe, damit Nutzer zu einem integrierten Skin zurückkehren können. Danke an ph1gros für die TS3-Erkennung und Kompatibilitätshinweise (#46) und an OddTurtleHead für Host-Design und Skin-Wiederherstellung (#57).
- Tag, Nacht und ILLUSIA öffnen die App-Bibliothek über die obere Leiste. KAAK 3.1.134 platziert den Button in der linken Symbolleiste und gleicht ihn den Nachbarbuttons an. Angeheftete Apps stehen oben.
- Die Plugin-Verwaltung bietet einen Feldeditor, Formulare für P2P-Dateitransfer, gemeinsames Ansehen und TSMusicBot sowie Links zu den Repositories.
- Die Stores tolerieren Unterschiede bei Anzeigedaten und prüfen SHA-256, Paketformat und für Installation oder Ausführung nötige Felder.
- Die Entwicklungsleitfäden und Agent Skills erklären die Platzierung des App-Buttons, die Konfigurationsfelder und den separaten HTTPS-Ursprung für öffentliche Plugins.
### [v0.3.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.1) · 2026-11-13
- Die WebSocket-Wiedergabe berücksichtigt jetzt die Opus-Kanalzahl und die tatsächliche Paketdauer. Der WebRTC-Downlink-Mix erhält Stereo. Siehe #54.
- Die Rauschunterdrückung bietet jetzt Aus, Standard und Stark. Stark kombiniert die Browserfunktion mit RNNoise. Siehe #53.
- Das Sprachstatusfenster exportiert die letzten zwei Minuten der Gateway-, Sprach- und Mikrofondiagnose. Die Aufnahme im Hintergrund hängt vom Browser und Betriebssystem ab. Siehe #49 und #55.
- Der Plugin-Einstieg befindet sich in der Werkzeugleiste des Sprachbereichs. Administratoren können Plugin-Kurzbefehle anheften. Siehe #56.
- Private Arbeitsbereichseinladungen können ablaufen. Die KAAK-Willkommensseite wurde wiederhergestellt, das überdeckte Skin-Menü in der Demo und zu kurze Wartezeiten bei großen Downloads wurden korrigiert. Die README zeigt fünf Skins.
### [v0.3.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.0) · 2026-11-03
#### Plugin-Anwendungen
- Plugin-API v2 für eigenständige Browser-Anwendungen und optionale Node-Backends mit eigenen Routen, Zuständen, Kommunikationswegen und Funktionen.
- Installation über den GitHub-Store oder lokale `.wplugin`-Pakete. Administratoren verwalten öffentliche/private Konfigurationen, prüfen und aktivieren Anwendungen; Updates erfordern erneutes Vertrauen.
- Ein vom Design unabhängiger schwebender Einstieg und eine Anwendungsbibliothek. Fenster lassen sich verschieben, skalieren, minimieren, maximieren und wiederherstellen; Minimieren oder der Wechsel zur Bibliothek lädt die Anwendung nicht neu.
- Anwendungsvorlage, Entwicklungsanleitung und Agent Skill; P2P-Dateiübertragung und gemeinsames Videoschauen werden in eigenen Repositories verteilt.
#### Designs und Berechtigung
- Beim ersten Besuch wird gemeinsam nach der Berechtigung für Designs und Plugins dieser Instanz gefragt; Verbindungszugangsdaten sind ausgeschlossen. Der letzte Eintrag im Designmenü öffnet diese Einstellung erneut.
- Ohne Zustimmung bleiben nur Tag, Nacht und ILLUSIA verfügbar. KAAK, andere Designs und der Plugin-Einstieg werden ausgeblendet. Ein Widerruf stellt ein integriertes Design wieder her, bricht laufende Ladevorgänge ab und beendet zugehörige Komponenten und Anwendungsseiten.
- Manifest-Berechtigungen, Datenprojektion, Paketprüfsummen und Prüfungen von Host-Aktionen bleiben erhalten. Die Prüfung durch den Administrator gilt weiterhin separat.
#### Korrekturen und Aktualisierungen
- Native TS-Clients beantworteten reine Videoangebote bei Fenster-, Bildschirm- oder Freigaben ohne Ton nicht. Die erforderliche Audiosektion wird jetzt ausgehandelt, ohne ein Mikrofon aufzunehmen oder Ton zu erzeugen. Fenster- und Bildschirmvideo wurden im Benutzertest bestätigt.
- SDK auf `@honeybbq/teamspeak@1.0.0-beta.23` aktualisiert; optionale Mitgliedsfelder werden berücksichtigt und leere Pakete am Sprachende übersprungen.
- Upstream-Korrekturen für TSDNS, Query-Wiederholungen nach Flooding, Dateiübertragungen und Verbindungsabbau übernommen.
- Korrekturen für IPv6-Zielprüfung, begrenzte parallele Anmeldungen, Sitzungswiderruf nach Passwortwechsel, vertrauenswürdige Proxys und PCM-Uplink-Schutz übernommen.
- Der Kaltstart von Designs verwendet weiterhin die tatsächliche Build-Version. Desktop, Web und Android verwenden eine einheitliche Anwendungsversion.
#### Aktualisierung
- Plugin-API v2 ist nicht mit v1-Paketen kompatibel. Ersatzanwendungen aktualisieren, prüfen und aktivieren.
- Öffentliche Plugins benötigen einen separaten HTTPS-Ursprung, der im Administrationsbereich konfiguriert und an den Laufzeitport (Standard `3042`) weitergeleitet wird. Hauptseite und Anwendungen dürfen keinen Ursprung teilen.
- Die Instanzberechtigung muss neu gewählt werden; frühere Einzelberechtigungen gelten nicht als Zustimmung.
### [v0.2.9](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.9) · 2026-10-24
#### Erweiterungen
- Umstellung auf das Upstream-SDK 1.0.0-beta.19. Normale Sprachverbindungen verwenden das Live-Clientverzeichnis ohne Query-Listenberechtigungen.
- Neuer GitHub-Skin-Store mit Installation, Updates und Freigabe pro Instanz. Discord Voice wird als eigenständiges standardkonformes `.wskin`-Beispiel verteilt.
- Optionale TS-Verwaltung im Modus mit festem Server: WebQuery-, TCP- oder SSH-Query-Zugangsdaten ermöglichen die Verwaltung von Server, Kanälen, Mitgliedern, Servergruppen und Sperren.
- Relays können einen direkten Sprachendpunkt für Browser bereitstellen und die Sprachsitzung übernehmen; eine zusätzliche Weiterleitung zwischen Gateways entfällt.
- Allgemeine Schnittstellen zum Beibehalten des Arbeitsbereichs und zur Wiederverbindung; KAAK nutzt diese und bietet Zugänge zur Administration, zum Projekt-GitHub und zur QQ-Gruppe.
- Unterstützung für TeamSpeak-Kanaltrenner mit Ausrichtung, Wiederholung, Leerzeilen und Standardlinien sowie öffentlichen Darstellungsdaten für Skins.
#### Fehlerbehebungen
- Vollbildgröße der Bildschirmfreigabe und Bereinigung von Status und Wiedergaberessourcen ausgeschiedener Mitglieder korrigiert.
- Erfolgreiche Sperren werden nicht mehr als Fehler gemeldet; Query-Verbindungen zählen nicht als Mitglieder, und das Kanalpasswort ist korrekt beschriftet.
- Berechtigungs-, Ratenlimit- und Zeitüberschreitungsfehler werden unterschieden. Schlägt nur die Aktualisierung nach einer erfolgreichen Aktion fehl, erscheint eine eigene Warnung gegen doppelte Ausführung.
- Verhindert, dass das SDK fehlgeschlagene HTTP-Antworten als erfolgreiche WebQuery-Ergebnisse behandelt; Layoutfehler auf der DC-Startseite, im Chat und bei schmalen Ansichten behoben.
#### Bekannte Probleme
- Die in [PR #48](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/48) beschriebene Sicherheitsabsicherung ist nicht enthalten; das Schließen des PRs bedeutet nicht, dass die gemeldeten Probleme behoben sind.
<details>
<summary>v0.2.8 und frühere Versionen anzeigen</summary>
### [v0.2.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.8) · 2026-10-17
#### Bildschirmfreigabe und Verbindungsstabilität
- Aushandlung und Verarbeitung der Videospur für Bildschirmfreigaben zwischen Browsern und nativen TeamSpeak-Clients korrigiert.
- Schnelle Kanalwechsel werden zuverlässiger verarbeitet, um inkonsistente Clientzustände zu vermeiden.
- Darstellungsfehler in einigen Skin-Komponenten und der KAAK-Übersetzung behoben.
#### Verbesserungen der Oberfläche
- Audiogerätenamen werden vollständig angezeigt und bei wenig Platz umgebrochen, damit lange Namen unterscheidbar bleiben.
- Unbeabsichtigte Textauswahl des Avatar-Platzhalters behoben.
### [v0.2.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.7) · 2026-10-13
#### Offeneres Skin-System
- Ein offenerer Skin-Editor und die zugehörige Laufzeit erlauben es nun, Stil und Position beliebiger Komponenten anzupassen und Widgets hinzuzufügen.
- Öffne nach dem Wechsel in den Sprachbereich im selben Browser ein neues Fenster mit der Administrationsoberfläche und melde dich an, um den Skin-Editor zu aktivieren.
- Der Skin „KAAK“ ist als Entwicklungsbeispiel enthalten.
- Der Agent Skill für die Skin-Entwicklung wurde aktualisiert.
#### Funktionserweiterungen
- Serveradressen können nun über SRV-Einträge und TeamSpeak-Nickname-Einträge aufgelöst werden.
- Im freien Modus lassen sich mehrere Server-Tabs verwalten; diese Schaltflächen sind im Modus „Fester Server“ nicht verfügbar.
- Eine Option für die Bitrate der Bildschirmfreigabe wurde hinzugefügt.
- WebSpeak speichert eingegebene Kanalpasswörter nun im Browser.
- Gesperrte Kanäle werden mit einem Schlosssymbol angezeigt.
- Der Chatverlauf wird nun dauerhaft gespeichert.
#### Fehlerbehebungen
- Fehler bei der Adressauflösung behoben.
- Fokuskonflikte zwischen Lautstärkeregelung und dem Ziehen von Mitgliedskarten behoben.
- Fehler behoben, durch den der Benutzerstatus fälschlich als unbekannt erkannt wurde.
### [v0.2.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.6) · 2026-10-08
Gegenüber 0.2.5 wurden Sprach-Gateway, gemeinsame Protokolle, Sprachoberfläche und Admin-Module umfassend umstrukturiert; #6/#7/#10 behoben, #9/#12 umgesetzt und der in PR #13 gemeldete Fall bereits aktiver TS6-Freigaben behoben. Opus- und Sitzungslebenszyklen sowie mobile Steuerung verbessert. Pakete: Windows x64, Linux x64/ARM64, Docker amd64/arm64 und Android arm64-v8a/armeabi-v7a/x86_64.
### [v0.2.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.5) · 2026-09-27
`.wskin`-Skins, Aktivierungs-/Standardverwaltung und geschützte Tages-, Nacht- und ILLUSIA-Skins ergänzt; unfertiges Aurora-Voice-Beispiel entfernt, Skin-Ladeblitze, dunkle Bedienelemente und Artwork-Ebenen im Sprachbereich korrigiert sowie offiziellen Skin-Entwicklungs-Agent-Skill hinzugefügt.
### [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) · 2026-09-22
Plattformübergreifendes P2P-Bildschirmteilen zwischen Browsern und nativen TeamSpeak-6-Clients ergänzt; STUN-/externes-TURN-Konfiguration, Live-Player und Zuschauerstatus, Aufnahmeoptionen bis 1080p/60 FPS und WebRTC-Statistiken hinzugefügt; Bildschirmfreigabe-Interaktion verbessert und Besucherzählung ergänzt.
### [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) · 2026-09-19
Mitgliederplanung und direkte Verschiebung nach Berechtigung ergänzt; Avatar-, Stummschaltstatus- und Identitätsunterstützung hinzugefügt; Screenshots und Dokumentation für alle fünf Sprachen aktualisiert.
### [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) · 2026-09-17
Browserseitige Mikrofon-Geräuschunterdrückung, russische und japanische Oberfläche sowie sprachabhängige Begrüßungstexte ergänzt; Lautstärkeinteraktion und Fehlertexte/-codes auf Basis von PR #2 verbessert.
### [v0.2.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.1) · 2026-09-13
Verbindungsfehler auf der Willkommensseite verbessert, Fehlercodes erhalten und sicher gekürzt sowie IPv6-Ziele standardmäßig unterstützt.
### [v0.2.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.0) · 2026-09-10
Passwortabfrage, dedizierter Relay-Modus, Auswahl mehrerer Relays und Ursachendarstellung in der Administration ergänzt.
### [v0.1.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.8) · 2026-09-08
Docker-Bereitstellung vereinfacht, lokale TeamSpeak-Ziele unterstützt, 15-Sekunden-Timeout ergänzt und kontinuierliche Netzwerküberwachung eingeführt.
### [v0.1.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.7) · 2026-09-06
Deutsch, Telegram, Netzwerkleistung und Gesamtlautstärke ergänzt; Lautstärkeschwankungen beim Begleitton behoben.
### [v0.1.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.6) · 2026-09-04
Desktop-Begleitton, Hinweise zur gespeicherten Identität und Website-Symbol ergänzt; WebRTC-Mitgliederlautstärke korrigiert.
### [v0.1.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.5) · 2026-09-04
Identitätsspeicherung korrigiert und Designumschaltung verbessert.
### [v0.1.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.4) · 2026-09-03
WebRTC und Kanalchat korrigiert sowie Administration, Protokolle und Mobilansicht verbessert.
### [v0.1.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.3) · 2026-09-03
Integriertes WebRTC, aktualisiertes TeamSpeak-SDK und bessere Mitgliedersynchronisierung und Sprachpufferung.
</details>
<a id="contributors"></a>
## Mitwirkende & Herkunft
<details>
<summary>Upstream-Autoren und PR-Beiträge anzeigen</summary>
Diese Liste würdigt den Autor des zugrunde liegenden SDKs, Beiträge aus zusammengeführten GitHub-PRs sowie ursprüngliche Arbeiten, die in eigenständig verteilte Skin-Pakete übernommen wurden.
- [HoneyBBQ](https://github.com/HoneyBBQ) — Autor des [teamspeak-js-SDKs (`@honeybbq/teamspeak`)](https://github.com/HoneyBBQ/teamspeak-js), das den von WebSpeak verwendeten TeamSpeak-Protokollclient bereitstellt.
- [ph1gros](https://github.com/ph1gros) — [PR #48](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/48) meldete Sicherheitsprobleme und lieferte Korrekturvorschläge sowie Regressionstests für IPv6-Zielprüfung, Admin-Anmeldung und Sitzungen, Proxy-Ratenlimits und PCM-Uplink. Der ursprüngliche Patch wurde nicht direkt übernommen; die Korrekturen wurden auf `dev` neu implementiert.
- [LainHE](https://github.com/LainHE) — [zusammengeführte PRs #2, #8, #28, #31–#35, #37, #38 und #40](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ALainHE): Browser-Fehlerübersetzungen, Skalierung und Startseitenlayout, Bildschirmfreigabe-Bitrate und Zuschaueravatare, Relay-Zielprüfung und Wiederverbindung, vertrauenswürdige Proxys, Weitergabe von Verbindungsfehlern, Audio-Fehlermeldungen und Ressourcenfreigabe bei WebRTC-Fehlern.
- [TimmySheep](https://github.com/TimmySheep) — [zusammengeführte PRs #13 und #15–#24](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ATimmySheep) zu vorhandenen TS6-Freigaben, Seitenverhältnis, mobiler Sprache/Bildschirm-Wachhalten/Skin-Menü, Kanaloptionen der Identität, PWA/Design, Chatverlauf, Mitglieder-Audiozuständen und Mikrofonberechtigungen.
- [yichen11818](https://github.com/yichen11818) — [PR #25](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/25) ermöglichte Verbindungen über registrierte TeamSpeak-Nicknames und bewahrte Nickname-Ziele; [PR #51](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/51) verbesserte das Beibehalten des KAAK-Arbeitsbereichs und die Wiederverbindung nach der ersten Verbindung. [PR #27](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/27) und [PR #52](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/52) lieferten das ursprüngliche Design und die Implementierung des Discord-Skins (Commit-Autor **yumi**), die das WebSpeak-Projekt in einen [eigenständig verteilten `.wskin`-Skin](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice) überführte.
</details>
## Community & verwandte Projekte
[GitHub Issues](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/issues) · [QQ-Gruppe 869500475](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=yhumUMDD9PmyYFWdXWUb_x7hM5trFQY8&authKey=Pw3HBGT7GwMinTQnuFGfnpf0aRSzXOJKcAiujVP1%2BXMpjheAKrncTRivicBJxpjV&noverify=0&group_code=869500475) · [Telegram](https://t.me/+8qShpTcuN9A3MWY9)
[NeteaseTSBot](https://github.com/yichen11818/NeteaseTSBot): TeamSpeak-Musikbot mit plattformübergreifender Wiedergabe und Webkonsole.
## Lizenz
WebSpeak wird unter [AGPL-3.0-only](../LICENSE) veröffentlicht. Lizenzen und Herkunft von Abhängigkeiten stehen in den jeweiligen Upstream-Projekten.
<p align="right"><a href="#readme-top">Nach oben ↑</a></p>
+420 -110
View File
@@ -1,59 +1,188 @@
# WebSpeak · English
<a id="readme-top"></a>
[Project home](../README.md) · [简体中文](./README.zh-CN.md) · [Deutsch](./README.de.md) · [Русский](./README.ru.md) · [日本語](./README.ja.md)
<div align="center">
<img src="./assets/webspeak-logo.png" alt="WebSpeak" width="88" />
<h1>WebSpeak · English</h1>
<p><strong>Join your TeamSpeak community from a browser.</strong></p>
<p><a href="../README.md">Project home</a> · <a href="./README.zh-CN.md">简体中文</a> · <a href="./README.de.md">Deutsch</a> · <a href="./README.ru.md">Русский</a> · <a href="./README.ja.md">日本語</a></p>
<p>
<a href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest"><img src="https://img.shields.io/github/v/release/EchoSixHIYA/WebSpeak-client-for-TeamSpeak?style=flat-square&amp;color=0f766e" alt="Release" /></a>
<a href="../LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--only-0f766e?style=flat-square" alt="AGPL-3.0-only" /></a>
</p>
</div>
WebSpeak is a self-hosted browser client and voice gateway for TeamSpeak 3 and TeamSpeak 6. Visitors can join channels without installing a desktop client, while administrators manage the target servers, access policy, and runtime state from the web console.
WebSpeak is a self-hosted browser client and voice gateway for TeamSpeak 3 and TeamSpeak 6. Visitors join voice, chat and screen sharing in a browser; operators manage target servers, access policy and data through the administration console.
Stable release: [v0.3.3 notes](#latest-release-notes) · [Download packages](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) · Console updates, reliable recovery, and skin compatibility improvements.
[Live demo](#demo) · [Features](#features) · [Screenshots](#screenshots) · [Deployment](#deployment) · [Administration](#administration) · [Advanced settings](#advanced) · [Skins & plugins](#extensions) · [Troubleshooting](#troubleshooting) · [Changelog](#changelog)
<a id="demo"></a>
## Live demo
URL: <https://webspeak.example.invalid>
- [Shanghai · shanghai.webspeak.online](https://shanghai.webspeak.online)
- [Hong Kong · webspeak.online](https://webspeak.online)
The public demo is hosted in Hong Kong and its network conditions and load may be unstable. Latency, disconnections, or temporary downtime do not represent every self-hosted deployment.
Try the welcome page and voice workspace. Network conditions, load and availability vary between demo nodes.
## ✨ Features
<a id="features"></a>
| Capability | Description |
## Features
| Capability | What it provides |
| --- | --- |
| TeamSpeak compatibility | Supports TeamSpeak 3 and TeamSpeak 6 and automatically detects the target protocol. |
| Cross-platform P2P screen sharing | Browser users and native TeamSpeak 6 clients can start and watch each other's screen shares; WebRTC/ICE carries media directly while WebSpeak relays negotiation signaling only. |
| IPv6 targets | IPv6 TeamSpeak targets and IPv6 addresses resolved from hostnames are supported by default. |
| Channels and members | Browse the channel tree, see live member states, and switch channels. |
| Realtime voice | Opus audio with a compatibility transport and optional bundled WebRTC low-latency transport. |
| Audio controls | Select microphones and speakers, adjust volume, test the microphone, mute, use VOX, and control member volume. |
| Browser-side noise suppression | Optional microphone noise suppression runs at the browser capture stage, without adding server-side audio processing. |
| Messaging and actions | Channel chat, server chat, private messages, poke actions, and whisper targets. |
| Desktop accompaniment | Select an audio-enabled window or browser tab and share its sound with the current channel. |
| Identity and access | Remembered identity, visitor-defined targets, and revocable expiring invite links. |
| Administration | Manage targets, access policy, WebRTC, relays, invites, sessions, logs, diagnostics, and backups. |
| Skins | Protected Day, Night, and ILLUSIA skins, plus instance-managed `.wskin` appearances with administrator enable/default controls. |
| User experience | Chinese, English, German, Russian, and Japanese UI with responsive desktop/mobile layouts. |
| Self-hosting | Data stays with the operator; Docker, Windows x64, and Linux x64 deployment options are provided. |
| Realtime voice | Opus, optional WebRTC and WebSocket fallback; mute, VOX, device selection, browser noise suppression and per-member volume. |
| Channels & messaging | Channel tree and TeamSpeak spacers, member state, channel switching, channel/server/private chat, pokes, whispers and local chat history. |
| Screen & audio sharing | Screen sharing between browsers and supported native TeamSpeak 6 clients, with quality, bitrate and statistics controls; desktop window or tab audio sharing. |
| Identity & connections | Remembered identities, TS3 identity import/export, favorites and history, SRV and Nickname resolution, IPv4/IPv6 and invitation links. |
| Instance administration | Fixed or open targets, access policy, invitations, sessions, logs, diagnostics, backups and optional TeamSpeak management connections. |
| Skins & interface | Day, Night, ILLUSIA and KAAK, plus GitHub distribution of `.wskin` packages, five interface languages and responsive layouts. |
| Distributed voice | Browsers connect directly to the selected relay voice gateway while the page stays on the ingress instance URL. |
| Deployment | Docker amd64/arm64, Windows x64 and Linux x64/ARM64 server packages, plus Android preview APKs. |
## 🖼️ Screenshots
### TeamSpeak version compatibility
The screenshots show the English welcome page, voice workspace, audio controls, and member menu.
Voice uses the standard TeamSpeak client protocol and needs no Query credentials. Optional TeamSpeak administration uses separate WebQuery / ServerQuery credentials.
- **TeamSpeak 3**: protocol detection recognizes the leading `3.x` version. Older server releases should be validated with the specific deployment because not every historical release has been independently tested.
- **TeamSpeak 6**: supported, including screen sharing with native TeamSpeak 6 clients.
- **Auto-detection**: the gateway reads the server's `version` response and records the detected protocol in connection diagnostics.
- The gateway uses the upstream [`@honeybbq/teamspeak`](https://github.com/HoneyBBQ/teamspeak-js) `1.0.0-beta.23` SDK; WebSpeak targets TeamSpeak 3 and TeamSpeak 6.
<a id="screenshots"></a>
## Screenshots
![WebSpeak · Voice workspace](./screenshots/webspeak-en.png)
<details>
<summary>Show the welcome page, audio controls and member menu</summary>
### Welcome page
<p align="center"><img src="./screenshots/webspeak-en-home.png" alt="WebSpeak English welcome page" width="100%" /></p>
### Voice workspace
<p align="center"><img src="./screenshots/webspeak-en.png" alt="WebSpeak English voice workspace" width="100%" /></p>
![WebSpeak · Welcome page](./screenshots/webspeak-en-home.png)
### Audio controls
<p align="center"><img src="./screenshots/webspeak-en-audio.png" alt="WebSpeak English audio controls" width="100%" /></p>
![WebSpeak · Audio controls](./screenshots/webspeak-en-audio.png)
### Member menu
<p align="center"><img src="./screenshots/webspeak-en-menu.png" alt="WebSpeak English member menu" width="100%" /></p>
![WebSpeak · Member menu](./screenshots/webspeak-en-menu.png)
## 🧩 Advanced features
</details>
<a id="deployment"></a>
## Deployment & first-time setup
The Compose configuration uses `network_mode: host` and targets Linux Docker hosts. Use the release package for a Windows server.
| Method | Best for | Environment |
| --- | --- | --- |
| Docker Compose (recommended) | Long-running servers, simple upgrades, and persistent data | Docker Engine + Docker Compose |
| Release package | Running without Node.js or build dependencies | Windows x64 or Linux x64/ARM64 |
| From source | Development, debugging, and customization | Node.js 22.12+, Git, and native build tools |
### Docker Compose (recommended)
```bash
git clone --depth 1 https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
docker compose pull
docker compose up -d
```
Open `http://<your-host>:3040` after startup. If using a reverse proxy, point it to that address. When WebRTC is enabled, allow the UDP range shown in the administration console. Data is stored in the `webspeak-data` volume.
```bash
docker compose ps
docker compose logs -f webspeak
```
Upgrade from the host. The administration console can check for newer stable releases on Docker, but it cannot replace the container image from inside the container:
```bash
git pull --ff-only
docker compose pull
docker compose up -d
```
Do not run `docker compose down -v`; it removes the `webspeak-data` volume, including the database and administrator settings.
### Release package
Download the matching `windows-x64.zip`, `linux-x64.tar.gz`, or `linux-arm64.tar.gz` from [GitHub Releases](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest). Extract it and run the included launcher. Packages include the Node.js runtime and production dependencies. Docker images support amd64/arm64.
Linux x64 release packages that match the official `build-release.yml` layout can be upgraded from the administration console. It checks the official GitHub Releases, refuses a package without a matching `SHA256SUMS.txt` entry, replaces only application code and restarts the process. `SHA256SUMS.txt` is an integrity checksum only, not a digital signature. `data/`, `config.json`, `certs/`, installed skins and plugins are preserved. Export a backup before starting. Windows release packages can check for versions, but console apply is disabled until it is verified on a real Windows install; download the new package and replace it manually. Linux arm64 packages can be checked, but console apply is disabled because the in-place swap has not been verified on real arm64 hardware; download the new package and replace it manually. Docker and source deployments cannot apply an update from the console.
Console installation is limited to foreground Linux x64 packages. Instances managed by systemd, PM2 or Supervisor can still check releases and open release notes, but cannot apply them in the console. Stop the service, replace application files from the new package, and start the service again; preserve `data/`, `config.json` and `certs/`. A detached updater is not independent of the service manager.
Android APKs for `arm64-v8a`, `armeabi-v7a`, and `x86_64` are also attached. They use debug signing for sideload testing; they are not Google Play packages, and real-device voice still needs validation.
### From source
```bash
git clone https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
npm ci --ignore-scripts
npm rebuild @discordjs/opus --foreground-scripts
npm --prefix web ci
npm --prefix web run build
npm run build
npm start
```
Building `@discordjs/opus` requires Python, Make, and a C/C++ toolchain.
The administration console can check for newer stable versions when running from source, but one-click apply is unavailable because the tree has no bundled Node.js runtime. Pull the source and rebuild after reviewing the release notes. The console never downloads or swaps source-tree files.
### First-time setup
1. Open `http://<your-host>:3040/admin`.
2. Sign in with `admin` / `admin` and immediately set a new password of at least 12 characters.
3. Configure the TeamSpeak target and access mode under **Servers**, for example `voice.example.com#9987`.
4. Configure HTTPS for public access; when WebRTC is enabled, allow the UDP range shown in the console.
### HTTPS & persistent data
Expose the public page and WebSocket over HTTPS. For example, point your hostname to the host and configure Caddy to reverse-proxy WebSpeak:
```caddyfile
webspeak.example.com {
reverse_proxy 127.0.0.1:3040
}
```
Replace the example hostname with your own. A working reverse proxy or Tunnel does not make WebRTC UDP media reachable; see [Advanced settings](#advanced). Release/source installs use `data/`, while Docker uses the `webspeak-data` volume. Keep `webspeak.db` and its matching `master.key` together when backing up or moving an instance.
<a id="administration"></a>
## Administration
Open `/admin` to manage servers and access, WebRTC and relays, invitations, active sessions, logs and backups. The skin store is at `/admin/skins`; the functional plugin store is at `/admin/plugins`.
### Optional TeamSpeak administration
WebSpeak administration and visitor voice do not depend on this feature. In fixed-server mode, open `/admin/ts-admin` to configure the TS management connection.
1. Enable WebQuery on the TS server and have an authorized TS administrator create an API key. Enter the WebQuery HTTP/HTTPS URL and key. This is the TS Query endpoint, not the WebSpeak website. TS3 (3.12+) and TS6 are supported.
2. Virtual server ID `0` selects the fixed target's voice port. For a restricted key, enter its authorized server ID. Read-only keys support viewing; changes require writable scope and the corresponding TS permissions.
3. Alternatively, choose ServerQuery SSH, or ServerQuery TCP for TS3. Enter the Query host (blank uses the fixed target), Query port, username and password; SSH also requires a trusted host-key fingerprint. This is the TS Query service, not an operating-system SSH login. TCP is unencrypted and suitable only for trusted networks. HTTPS certificates must be trusted by the gateway.
4. Save and connect or refresh to inspect the server, channels, members, server groups and bans. Actions include server settings, channel creation/renaming/deletion, moving/kicking/banning members by identity, group assignment and removing bans. Actions require confirmation and TS permission checks; lists refresh manually.
Credentials are encrypted on the server and never returned by the API. Back up both the database and `master.key`. A failed management connection does not affect WebSpeak administration or ordinary voice. UID bans avoid banning other users sharing the gateway IP.
<a id="advanced"></a>
## Advanced settings
These features are optional. WebSpeak continues to work with the compatibility voice transport when they are disabled. Configure them under **Administration → Servers**; saved changes apply to new connections.
### 1. WebRTC low-latency voice
### WebRTC low-latency voice
WebRTC moves browser voice to a realtime media path and also enables desktop accompaniment. The current WebSpeak gateway provides it directly; no separate media server is required.
@@ -64,6 +193,16 @@ WebRTC moves browser voice to a realtime media path and also enables desktop acc
The port range is locked while WebRTC is enabled. Disable and save WebRTC before changing it, then update the firewall rules. Public deployments also need HTTPS.
### Voice WebRTC behind a reverse proxy or TCP tunnel
The WebRTC advanced settings now include a **public media address**, **IPv6 candidates**, and a **voice STUN server**. The media address must be a gateway IP or hostname reachable directly over UDP, without a scheme, path or port. Prefer the host's public IP; do not use the Cloudflare-proxied hostname. It overrides the address inferred from `Origin`, `X-Forwarded-Host`, or `Host`; DNS names are resolved into IP candidates. IPv6 is opt-in and retains IPv4 candidates.
Set a UDP STUN URL such as `stun:turn.teamspeak.com:3478` to use the same discovery service in the browser and gateway. Empty preserves the previous behavior: the gateway library uses its built-in STUN service while the browser has none. The gateway requires an IPv4-reachable UDP STUN hostname or IPv4 address; IPv6 literals and TURN credentials are not accepted. IPv6 media candidates work independently of STUN. Save and reconnect to apply changes.
HTTP/WebSocket reachability does not imply media reachability. Allow the complete configured UDP range and preserve port numbers when using static port forwarding. STUN discovers mappings but cannot relay audio or traverse every NAT. For mobile or UDP-blocked clients, configure an external TURN service as an optional fallback directly under Admin → Voice with the TURN REST URL, shared secret, and credential lifetime; the equivalent environment variables are `WEBSPEAK_TURN_REST_URLS` and `WEBSPEAK_TURN_REST_SECRET`. Console values take precedence and apply to new connections without a gateway restart. Keep `WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY=all` so direct UDP is tried first. `WEBSPEAK_VOICE_PROFILE` defaults to `auto`: only requests received through a trusted Cloudflare proxy use the adaptive buffer; direct and other requests keep the legacy 80 ms/raw-PCM path. Loopback tunnel connections are trusted by default; configure `WEBSPEAK_TRUSTED_PROXIES` when cloudflared connects from another address. Set `adaptive` explicitly to use it on direct deployments too; Admin → Voice can override this mode. Opus over WebSocket is off by default; enable it under Admin → Voice or with `WEBSPEAK_VOICE_OPUS_WS=1`, and use the `adaptive` profile. If neither direct UDP nor TURN provides a media path, the session reports `NO_MEDIA_PATH` and uses the compatibility transport.
See [`CLOUDFLARE_TUNNEL_VOICE.md`](CLOUDFLARE_TUNNEL_VOICE.md) for the direct-UDP-first topology, coturn/cloudflared templates, verification and rollback notes.
### Screen-share ICE candidates
Screen-share media still prefers a direct browser-to-browser path; WebSpeak only relays negotiation signaling. By default it uses TeamSpeak's public STUN services to discover server-reflexive candidates; STUN does not carry media. If the deployment has an authorized external TURN service, set `WEBSPEAK_SCREEN_SHARE_ICE_SERVERS` before starting WebSpeak with a JSON array, for example:
@@ -78,11 +217,14 @@ With TURN configured, media may use that external TURN service but never the Web
Browser users and native TeamSpeak 6 clients can discover, start, and watch each other's screen shares. Screen media between browsers, and between a browser and a native client, is sent over a WebRTC/ICE peer-to-peer path whenever possible; WebSpeak handles session authorization, share state, and SDP/ICE signaling, but does not carry the screen media. The UI includes live status, viewer count, player volume, fullscreen, and exit controls. Share settings support up to 1080p and 60 FPS, with live WebRTC statistics for diagnosis.
### 2. Relay mode
### Relay mode
Use a relay when a TeamSpeak server rejects connections from another region or when the direct path is unstable. It is not a VPN: it forwards only the TeamSpeak traffic of the current WebSpeak session, while the visitor still chooses the target server in the web page.
A relay instance is a dedicated forwarding service with no visitor page or administration console. It accepts only gateway sessions with a matching token. Use a random token of at least 16 characters.
A relay instance runs both the legacy UDP compatibility forwarder and a separate voice gateway, with no visitor page or administration console. The ingress gateway signs and delegates a one-time voice ticket with the shared token; the browser then connects directly to the relay, and the relay connects to TeamSpeak. The page stays on the ingress gateway URL. Use a random token of at least 16 characters.
<details>
<summary>Show relay startup and configuration examples</summary>
#### Run from source
@@ -90,7 +232,7 @@ A relay instance is a dedicated forwarding service with no visitor page or admin
git clone --depth 1 https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
npm ci --ignore-scripts
npm run prepare:sdk
npm rebuild @discordjs/opus --foreground-scripts
npm run build
WEBSPEAK_MODE=relay \
WEBSPEAK_RELAY_TOKEN='replace-with-a-long-random-token' \
@@ -134,103 +276,60 @@ docker run -d --name webspeak-relay --restart unless-stopped --network host \
ghcr.io/echosixhiya/webspeak:latest
```
Allow the relay host's UDP listen port, `39087` by default.
The voice gateway listens on `127.0.0.1:3041` by default. Give the relay an HTTPS hostname and reverse-proxy it to `127.0.0.1:3041` with Caddy or an equivalent proxy, for example:
```caddyfile
relay.example.com {
reverse_proxy 127.0.0.1:3041
}
```
In the ingress gateway's relay settings, set **Voice gateway address** to that HTTPS origin (for example, `https://relay.example.com`). The page remains on its original gateway, then opens a WSS connection to this relay hostname. WebRTC is enabled by default on the relay; also allow UDP `40000-40099` and set `WEBSPEAK_RELAY_WEBRTC_PUBLIC_HOST` to a public relay IP or directly reachable hostname. Update firewall rules if you change the WebRTC UDP range. Keep UDP `39087` open for compatibility with older forwarding.
#### Enable it in the gateway
1. Open **Administration → Servers → Relay server** and add one or more nodes.
2. Set a custom display name, endpoint such as `relay.example.com#39087`, and matching token for each node, then save.
2. Set a display name, UDP endpoint such as `relay.example.com#39087`, HTTPS voice gateway origin such as `https://relay.example.com`, and matching token for each node, then save.
3. Visitors can choose direct access or one of the configured relays on the welcome page.
Disable and save the relay configuration to remove the relay option from the welcome page.
### 3. Dependencies and attribution
</details>
### Dependencies and attribution
- The relay service is built into WebSpeak with Node.js standard libraries; it does not use GOST, sing-box, or another proxy framework.
- WebRTC uses [werift](https://github.com/shinyoshiaki/werift-webrtc) `0.24.4`, whose upstream project is licensed under MIT.
- TeamSpeak protocol connectivity uses the project-maintained [EchoSixHIYA/teamspeak-js](https://github.com/EchoSixHIYA/teamspeak-js) SDK fork.
- TeamSpeak connectivity uses the upstream [HoneyBBQ/teamspeak-js](https://github.com/HoneyBBQ/teamspeak-js) package `@honeybbq/teamspeak@1.0.0-beta.23`; a project SDK fork build is not required.
## 🧾 Changelog
<a id="extensions"></a>
| Version | Date | Summary |
| --- | --- | --- |
| 0.2.5-preview | 2026-09-27 | Added `.wskin` skins, administrator enable/default controls, and protected Day/Night/ILLUSIA built-ins; removed the unfinished Aurora Voice sample, fixed skin-load flashes, dark-control contrast, and voice-room artwork layering, and added the official skin-development Agent Skill. |
| [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) | 2026-09-22 | Added cross-platform P2P screen sharing between browsers and native TeamSpeak 6 clients; added STUN/external-TURN configuration, live player and viewer state, 1080p/60 FPS capture settings, and WebRTC statistics; refined screen-share interactions and added visitor numbering. |
| [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) | 2026-09-19 | Added channel member scheduling and permission-aware direct moves; added avatar, mute-state, and remembered-identity support; refreshed feature screenshots and documentation for all five languages. |
| [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) | 2026-09-17 | Added browser-side microphone noise suppression, Russian and Japanese UI, and per-language welcome text; refined volume interaction and error messages/codes on top of PR #2. |
| [v0.2.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.1) | 2026-09-13 | Improved welcome-page connection errors, preserved and safely truncated error codes, and added default IPv6 target support. |
| [v0.2.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.0) | 2026-09-10 | Added server-password prompts, formal relay mode, multiple relay selection, and administrator connection-reason reporting. |
| [v0.1.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.8) | 2026-09-08 | Simplified Docker deployment, supported local TeamSpeak targets, added a 15-second connection timeout, and made network monitoring continuous. |
| [v0.1.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.7) | 2026-09-06 | Added German, Telegram, network performance, and master-volume features; fixed accompaniment volume fluctuation. |
| [v0.1.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.6) | 2026-09-04 | Added desktop accompaniment, remembered-identity guidance, and the site icon; fixed WebRTC member volume. |
| [v0.1.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.5) | 2026-09-04 | Fixed identity persistence and refined the theme toggle. |
| [v0.1.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.4) | 2026-09-03 | Fixed WebRTC and channel chat and refined administration, logs, and mobile layouts. |
| [v0.1.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.3) | 2026-09-03 | Added bundled WebRTC, migrated the TeamSpeak SDK, and improved member synchronization and voice buffering. |
## Skins & functional plugins
See the complete history in [CHANGELOG.md](../CHANGELOG.md).
### Skin packages `.wskin`
## 🚀 Deployment
Skins own appearance, layout and their attached widgets. Administrators install, enable and choose the default skin. Authors use the public contract without changing WebSpeak source code.
| Method | Best for | Environment |
| --- | --- | --- |
| Docker Compose (recommended) | Long-running servers, simple upgrades, and persistent data | Docker Engine + Docker Compose |
| Release package | Running without Node.js or build dependencies | Windows x64 or Linux x64 |
| From source | Development, debugging, and customization | Node.js 22.5+, Git, and native build tools |
[Development guide](./SKIN_DEVELOPMENT.md) · [Agent Skill](../.agents/skills/webspeak-skin-development/SKILL.md) · [Skin catalog](https://github.com/Huddle-Up-Forge/webspeak-skins) · [Discord Voice example](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice) · [Host chrome toolbar example](./examples/HOST-CHROME-TOOLBAR.md)
### Docker Compose (recommended)
### Functional plugins `.wplugin`
```bash
git clone --depth 1 https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
docker compose pull
docker compose up -d
```
Functional plugins are independent applications using standard browser capabilities and optional Node backends with their own routes, state and collaboration. Administrators review code and dependencies before enabling; updates require renewed trust. Applications support TS server or instance scope and run on a separate origin. API v2 is included starting with v0.3.0.
Open `http://<your-host>:3040` after startup. If using a reverse proxy, point it to that address. When WebRTC is enabled, allow the UDP range shown in the administration console. Data is stored in the `webspeak-data` volume.
[Development guide](./PLUGIN_DEVELOPMENT.md) · [Agent Skill](../.agents/skills/webspeak-plugin-development/SKILL.md) · [Distribution catalog & example](https://github.com/Huddle-Up-Forge/webspeak-plugin)
```bash
docker compose ps
docker compose logs -f webspeak
```
<a id="troubleshooting"></a>
Upgrade:
## Troubleshooting
```bash
git pull --ff-only
docker compose pull
docker compose up -d
```
| Symptom | What to check |
| --- | --- |
| WebRTC falls back after being enabled | Check the voice-status error code, HTTPS, the complete UDP firewall range and the public media address. A TCP Tunnel does not carry this UDP media path. |
| A target is blocked as a local address | Open mode restricts loopback/private targets. Use the administrator-configured fixed-server mode for a co-located TS server; visitor-defined targets need a reachable address. |
| Screen sharing times out or stays black | Screen sharing has a separate WebRTC connection. Inspect its negotiation, ICE and codec statistics; connected voice WebRTC does not prove screen-media reachability. |
| Data is missing or cannot be decrypted after upgrading | Reuse the data directory or volume and its matching `master.key`. Do not upgrade with `docker compose down -v`. |
Do not run `docker compose down -v`; it removes the database and administrator settings.
### Release package
Download the matching `windows-x64.zip` or `linux-x64.tar.gz` from [GitHub Releases](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest), extract it into a dedicated directory, and run `start-webspeak.cmd` on Windows or `./start-webspeak.sh` on Linux. Packages include the Node.js runtime and production dependencies.
### From source
```bash
git clone https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
npm ci --ignore-scripts
npm run prepare:sdk
npm rebuild @discordjs/opus --foreground-scripts
npm --prefix web ci
npm --prefix web run build
npm run build
npm start
```
Building `@discordjs/opus` requires Python, Make, and a C/C++ toolchain.
### First-time setup
1. Open `http://<your-host>:3040/admin`.
2. Sign in with `admin` / `admin` and immediately set a new password of at least 12 characters.
3. Configure the TeamSpeak target and access mode under **Servers**, for example `voice.example.com#9987`.
4. Configure HTTPS for public access; when WebRTC is enabled, allow the UDP range shown in the console.
## ⚠️ Requirements and notes
### ⚠️ Requirements and notes
| Area | Requirement or note |
| --- | --- |
@@ -242,4 +341,215 @@ Building `@discordjs/opus` requires Python, Make, and a C/C++ toolchain.
| Remembered identity | One browser identity can hold one active remembered connection. Disable it for parallel connections or use another browser profile. |
| Accompaniment | Desktop only and requires WebRTC. Enable audio sharing when selecting a window or tab. |
| Data | Docker data is in `webspeak-data`; release packages and source installs use `data/`. Back up before upgrades. |
| Session limit | One instance accepts up to 100 active browser sessions. |
| Session limit | One instance admits up to 100 active browser sessions; this is an application limit, not a performance guarantee or TS license allowance. |
<a id="changelog"></a>
## Changelog
<a id="latest-release-notes"></a>
### [v0.3.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.3) · 2026-11-26
**Highlight: stable-release checks and one-click updates in the administration console.**
- Administrators can check official GitHub Releases, select a version and confirm installation. Packages must pass SHA-256 verification. Installation initially supports official Linux x64 packages running in the foreground. Windows, Linux arm64, Docker, source installs and instances managed by systemd, PM2 or Supervisor retain version checks and release-note links; installation follows their manual deployment procedure.
- Updates replace application files while preserving `data/`, `config.json`, `certs/`, installed skins and plugins. Installation restarts the process and briefly disconnects voice sessions and the console. SHA256SUMS.txt is an integrity checksum, not a digital signature.
- Hardened health checks, rollback and startup recovery after interrupted updates. Recovery shares the update lock, preventing a duplicate launch from rolling back a live update. Size-limit errors, disk-write failures and cancellation abort requests, release response readers and clean up sibling downloads.
- Skins can place recovery controls in declared slots and style host controls through protected tokens, with default placement and colours when unusable. Improved floating-control avoidance, hit-testing through toasts, late skin loading and animation compatibility; recovery shortcuts remain available.
- Includes #60, #61, #62 and follow-up maintenance fixes, plus updated skin development documentation and examples. Thanks to OddTurtleHead.
**Upgrading:** manually upgrade v0.3.2 or earlier to v0.3.3 first. Supported installs can then use the console for future stable releases. Back up data before upgrading. Docker uses `docker compose pull && docker compose up -d` with the data volume preserved. Stop managed services before replacing application files, then start them again.
Validation: 1,102 automated tests, frontend/backend builds and the Docker startup health check passed.
### [v0.3.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.2) · 2026-11-14
- Third-party skins can style host decorations. The host manages recovery and authorization so users can switch back to a built-in skin. Thanks to ph1gros for the TS3 detection and compatibility work (#46), and OddTurtleHead for host theming and skin recovery (#57).
- Day, Night and ILLUSIA open the app library from the top toolbar. KAAK 3.1.134 puts it in the leftmost icon rail and aligns its button with neighboring controls. Pinned apps appear first.
- The plugin console adds a field editor, forms for P2P File Transfer, Watch Together and TSMusicBot, and links to plugin repositories.
- Skin and plugin stores accept differences in display metadata while checking SHA-256, package format, and fields required for installation or execution.
- Updated the skin and plugin development guides and Agent Skills for launcher layouts, configuration fields, and the separate HTTPS origin required for public plugin hosting.
### [v0.3.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.1) · 2026-11-13
- Fixed lost Opus channel information and fixed 20 ms packet durations in WebSocket playback. WebRTC downlink mixing now preserves stereo. See #54.
- Added Off, Standard and Strong noise suppression. Strong combines browser suppression with RNNoise. See #53.
- The voice performance panel can export two minutes of gateway, voice and microphone diagnostics for disconnects and interrupted background capture. Background capture still depends on browser and OS policies. See #49 and #55.
- Moved the plugin launcher into the voice workspace toolbar. Administrators can pin plugin shortcuts. See #56.
- Added expiring private workspace invites and restored the KAAK welcome page. Fixed an obscured skin menu in the demo and premature timeouts on large skin downloads. The README now shows five skins.
### [v0.3.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.0) · 2026-11-03
#### Plugin applications
- Release plugin API v2 for independent browser applications and optional Node backends, with author-defined routes, state, communication and business logic.
- Install applications from the GitHub store or local `.wplugin` packages. Administrators manage public/private configuration, review and enable applications; updates require renewed trust.
- Add a skin-independent floating launcher and application library. Windows support dragging, resizing, minimize, maximize and restore; minimizing or returning to the library keeps the active application loaded.
- Provide an application template, development guide and Agent Skill. P2P file transfer and Watch Together are distributed from separate repositories.
#### Skins and authorization
- Ask once on first entry for this instance’s third-party skins and plugins together, excluding connection credentials. The final Authorization item in the skin menu allows changes at any time.
- Without consent, offer only Day, Night and ILLUSIA; hide KAAK, other third-party skins and plugin access. Revocation restores a built-in skin, cancels pending loads and stops related components and application pages.
- Retain manifest permissions, data projection, package digests and host action checks. Administrator application review and trust remain independent.
#### Fixes and upgrades
- Fix native TS clients not answering video-only offers when sharing an application window, the entire screen or without shared audio. Negotiate the required audio section without capturing a microphone or fabricating shared sound. Window and full-screen video were confirmed by user retesting.
- Upgrade to `@honeybbq/teamspeak@1.0.0-beta.23`, handle optional member fields and skip empty audio packets that mark the end of speech.
- Include upstream TSDNS resolution, Query flooding retries, file transfer and disconnect cleanup fixes.
- Include IPv6 target validation, bounded concurrent login, password-change session revocation, trusted-proxy rate limiting and PCM uplink protection fixes.
- Retain and verify the skin cold-start fix that uses the real build version. Align application versions across desktop, web and Android.
#### Upgrading
- Plugin API v2 is incompatible with API v1 packages. Update, review and enable replacement applications.
- Public plugin deployment requires a separate HTTPS application origin configured in administration and proxied to the runtime port (default `3042`). The application and main site must not share an origin.
- Users must make a new instance authorization choice; old per-skin approvals do not imply consent.
### [v0.2.9](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.9) · 2026-10-24
#### Enhancements
- Migrated to upstream SDK 1.0.0-beta.19. Ordinary voice connections use the live client directory without Query list permissions.
- Added a GitHub skin store and instance-level installation, updates and availability controls. Discord Voice is distributed independently as a standard `.wskin` example.
- Added optional TS administration in fixed-instance mode, with WebQuery, TCP or SSH Query credentials for managing the server, channels, members, server groups and bans.
- Relays can advertise a direct browser voice endpoint and own the voice session, avoiding an extra gateway forwarding hop.
- Added generic persistent-workspace and reconnect APIs, adopted by KAAK alongside administrator, project GitHub and QQ group shortcuts.
- Added TeamSpeak channel spacers with alignment, repeated fill, blank rows and standard line patterns, including public presentation data for skins.
#### Fixes
- Fixed screen-share fullscreen sizing and cleanup of departed members' state and playback resources.
- Fixed successful bans being reported as failures, Query connections appearing in member counts and the channel-password label.
- Distinguished permission, rate-limit and timeout errors. A refresh failure after a successful action now has its own warning to prevent duplicate actions.
- Guarded against the SDK treating failed HTTP responses as successful WebQuery results, and fixed DC home, chat and narrow-screen control layouts.
#### Known issues
- The security hardening described in [PR #48](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/48) is not included in this release; closing that PR does not mean the reported issues are fixed.
<details>
<summary>Show v0.2.8 and earlier releases</summary>
### [v0.2.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.8) · 2026-10-17
#### Screen sharing and connection reliability
- Fixed negotiation and video-track handling for screen sharing between browsers and native TeamSpeak clients.
- Improved handling of rapid channel switches to reduce inconsistent client state.
- Fixed content rendering in some skin components and localization in the KAAK skin.
#### Interface improvements
- Audio device names now display in full and wrap when space is limited, making long names easier to distinguish.
- Fixed avatar fallback text being selected unintentionally.
### [v0.2.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.7) · 2026-10-13
#### A more open skin system
- A more open skin editor and runtime now let authors customize the style and position of any component and add widgets.
- After entering the voice panel, open a new administrator-console window in the same browser and sign in to activate the skin editor.
- The KAAK skin is included as a development example.
- Updated the skin development Agent Skill.
#### Enhancements
- Server addresses can now be resolved through SRV records and TeamSpeak Nickname entries.
- Free mode supports managing multiple server tabs; these controls are unavailable in fixed-server mode.
- Added a screen-share bitrate option.
- WebSpeak now saves entered channel passwords in the browser.
- Locked channels now show a lock icon.
- Chat history is now stored persistently.
#### Bug fixes
- Fixed address parsing.
- Fixed focus conflicts between volume controls and dragging member cards.
- Fixed user status being incorrectly parsed as unknown.
### [v0.2.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.6) · 2026-10-08
Relative to 0.2.5, broadly refactored gateway voice, shared protocol, frontend voice workspace, and admin modules; fixed #6/#7/#10, implemented #9/#12 settings, and fixed the existing-TS6-share discovery case reported in PR #13. Improved Opus/session lifecycles and mobile controls. Packages: Windows x64, Linux x64/ARM64, Docker amd64/arm64, and Android arm64-v8a/armeabi-v7a/x86_64.
### [v0.2.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.5) · 2026-09-27
Added `.wskin` skins, administrator enable/default controls, and protected Day/Night/ILLUSIA built-ins; removed the unfinished Aurora Voice sample, fixed skin-load flashes, dark-control contrast, and voice-room artwork layering, and added the official skin-development Agent Skill.
### [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) · 2026-09-22
Added cross-platform P2P screen sharing between browsers and native TeamSpeak 6 clients; added STUN/external-TURN configuration, live player and viewer state, 1080p/60 FPS capture settings, and WebRTC statistics; refined screen-share interactions and added visitor numbering.
### [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) · 2026-09-19
Added channel member scheduling and permission-aware direct moves; added avatar, mute-state, and remembered-identity support; refreshed feature screenshots and documentation for all five languages.
### [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) · 2026-09-17
Added browser-side microphone noise suppression, Russian and Japanese UI, and per-language welcome text; refined volume interaction and error messages/codes on top of PR #2.
### [v0.2.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.1) · 2026-09-13
Improved welcome-page connection errors, preserved and safely truncated error codes, and added default IPv6 target support.
### [v0.2.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.0) · 2026-09-10
Added server-password prompts, formal relay mode, multiple relay selection, and administrator connection-reason reporting.
### [v0.1.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.8) · 2026-09-08
Simplified Docker deployment, supported local TeamSpeak targets, added a 15-second connection timeout, and made network monitoring continuous.
### [v0.1.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.7) · 2026-09-06
Added German, Telegram, network performance, and master-volume features; fixed accompaniment volume fluctuation.
### [v0.1.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.6) · 2026-09-04
Added desktop accompaniment, remembered-identity guidance, and the site icon; fixed WebRTC member volume.
### [v0.1.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.5) · 2026-09-04
Fixed identity persistence and refined the theme toggle.
### [v0.1.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.4) · 2026-09-03
Fixed WebRTC and channel chat and refined administration, logs, and mobile layouts.
### [v0.1.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.3) · 2026-09-03
Added bundled WebRTC, migrated the TeamSpeak SDK, and improved member synchronization and voice buffering.
</details>
<a id="contributors"></a>
## Contributors & attribution
<details>
<summary>Show upstream authors and PR contributions</summary>
This list acknowledges the upstream SDK author, contributions through merged GitHub PRs, and original work adapted into independently distributed skin packages.
- [HoneyBBQ](https://github.com/HoneyBBQ) — Author of the upstream [teamspeak-js (`@honeybbq/teamspeak`)](https://github.com/HoneyBBQ/teamspeak-js) SDK, which provides the TeamSpeak protocol client used by WebSpeak.
- [ph1gros](https://github.com/ph1gros) — [PR #48](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/48) reported security issues and supplied proposed fixes and regression tests for open-target IPv6 validation, admin authentication/sessions, proxy-aware limits and PCM uplink boundaries. The original patch was not merged directly; the fixes were reimplemented on `dev`.
- [LainHE](https://github.com/LainHE) — [merged PRs #2, #8, #28, #31–#35, #37, #38 and #40](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ALainHE), covering browser error translations, scaling and home layout, screen-share bitrate and viewer avatars, relay target validation and recovery, trusted proxy handling, connection-failure propagation, audio fault reporting, and WebRTC failure cleanup.
- [TimmySheep](https://github.com/TimmySheep) — [merged PRs #13 and #15–#24](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ATimmySheep), covering existing TS6 share discovery, share aspect ratio, mobile voice/wake/skin-menu behavior, identity channel options, PWA/theme work, chat history, member audio states, and microphone permission.
- [yichen11818](https://github.com/yichen11818) — [PR #25](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/25) added registered TeamSpeak nickname connections and preserved nickname targets; [PR #51](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/51) improved KAAK workspace retention and reconnection after the first connection. [PR #27](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/27) and [PR #52](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/52) supplied the original Discord skin design and implementation (commit author **yumi**), later adapted by the WebSpeak project into an [independently distributed `.wskin` skin](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice).
</details>
## Community & related projects
[GitHub Issues](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/issues) · [QQ group 869500475](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=yhumUMDD9PmyYFWdXWUb_x7hM5trFQY8&authKey=Pw3HBGT7GwMinTQnuFGfnpf0aRSzXOJKcAiujVP1%2BXMpjheAKrncTRivicBJxpjV&noverify=0&group_code=869500475) · [Telegram](https://t.me/+8qShpTcuN9A3MWY9)
[NeteaseTSBot](https://github.com/yichen11818/NeteaseTSBot): a TeamSpeak music bot with multi-platform playback and a web console.
## License
WebSpeak is distributed under [AGPL-3.0-only](../LICENSE). See each upstream project for third-party licenses and attribution.
<p align="right"><a href="#readme-top">Back to top ↑</a></p>
+416 -80
View File
@@ -1,86 +1,85 @@
# WebSpeak · 日本語
<a id="readme-top"></a>
[プロジェクトトップ](../README.md) · [简体中文](./README.zh-CN.md) · [English](./README.en.md) · [Deutsch](./README.de.md) · [Русский](./README.ru.md)
<div align="center">
<img src="./assets/webspeak-logo.png" alt="WebSpeak" width="88" />
<h1>WebSpeak · 日本語</h1>
<p><strong>ブラウザーから、いつもの TeamSpeak へ。</strong></p>
<p><a href="../README.md">プロジェクトトップ</a> · <a href="./README.zh-CN.md">简体中文</a> · <a href="./README.en.md">English</a> · <a href="./README.de.md">Deutsch</a> · <a href="./README.ru.md">Русский</a></p>
<p>
<a href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest"><img src="https://img.shields.io/github/v/release/EchoSixHIYA/WebSpeak-client-for-TeamSpeak?style=flat-square&amp;color=0f766e" alt="Release" /></a>
<a href="../LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--only-0f766e?style=flat-square" alt="AGPL-3.0-only" /></a>
</p>
</div>
## プロジェクト概要
WebSpeak はセルフホスト型の TeamSpeak 3 / TeamSpeak 6 ブラウザークライアント兼音声ゲートウェイです。ユーザーはブラウザーで音声、チャット、画面共有に参加でき、運営者は管理コンソールで接続先、アクセス方針、データを管理できます。
| 観点 | 説明 |
| --- | --- |
| **WHAT** | WebSpeak は TeamSpeak 3 / TeamSpeak 6 向けのセルフホスト型ブラウザクライアント兼音声ゲートウェイです。 |
| **WHY** | デスクトップクライアントをインストールせず、ブラウザからチャンネルに参加できます。運用者はサーバーとデータを管理できます。 |
| **HOW** | 起動後、管理コンソールで TeamSpeak の接続先とアクセス方針を設定します。ブラウザが画面と音声を担当し、WebSpeak がゲートウェイとして接続します。 |
安定版:[v0.3.3 更新内容](#latest-release-notes) · [ダウンロード](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) · コンソール更新、復元処理、スキン互換性の改善。
[オンラインデモ](#demo) · [機能](#features) · [画面プレビュー](#screenshots) · [デプロイ](#deployment) · [管理](#administration) · [詳細設定](#advanced) · [スキンとプラグイン](#extensions) · [トラブル対処](#troubleshooting) · [更新履歴](#changelog)
<a id="demo"></a>
## オンラインデモ
アドレス: <https://webspeak.example.invalid>
- [上海 · shanghai.webspeak.online](https://shanghai.webspeak.online)
- [香港 · webspeak.online](https://webspeak.online)
デモは香港にあります。ネットワークと負荷が不安定な場合があるため、遅延、切断、一時的な利用不可は各自の環境での動作を示すものではありません。
ホームと音声ワークスペースを体験できます。デモのネットワーク、負荷、稼働状況は変動します。
## ✨ 機能
<a id="features"></a>
| 機能 | 説明 |
## 主な機能
| 機能 | 内容 |
| --- | --- |
| TeamSpeak | TeamSpeak 3 / 6 に対応し、対象プロトコルを自動検出します。 |
| クロスプラットフォーム P2P 画面共有 | ブラウザユーザーと TeamSpeak 6 ネイティブクライアントが互いに画面共有を開始・視聴できます。メディアは WebRTC/ICE で直接送信し、WebSpeak はシグナリングだけを中継します。 |
| IPv6 | IPv6 の接続先と DNS から解決された IPv6 アドレスに標準対応します。 |
| チャンネルとメンバー | チャンネルツリー、リアルタイムのメンバー状態、チャンネル移動。 |
| リアルタイム音声 | Opus、互換トランスポート、内蔵 WebRTC による低遅延音声。 |
| 音声操作 | マイク、スピーカー、音量、VOX、ミュート、メンバーごとの音量調整。 |
| ブラウザ側ノイズ抑制 | マイクのノイズ抑制をブラウザの音声取得段階で任意に使用でき、サーバー側の追加処理は不要です。 |
| チャットと操作 | チャンネル/サーバーチャット、個人メッセージ、つつく、ウィスパー対象。 |
| BGM共有 | デスクトップブラウザで音声付きウィンドウやタブの音をチャンネルに共有。 |
| ID とアクセス | ID の保存、接続先の指定、期限・回数付き招待リンク。 |
| 管理コンソール | 接続先、アクセス、WebRTC、中継、招待、セッション、ログ、診断、バックアップ。 |
| スキン | 保護された昼・夜・ILLUSIA スキンに加え、管理者が有効化とデフォルトを管理するインスタンス `.wskin` に対応。 |
| インターフェース | 中文、English、Deutsch、Русский、日本語、レスポンシブ表示。 |
| リアルタイム音声 | Opus、任意の WebRTC、WebSocket へのフォールバック。ミュート、VOX、デバイス選択、ブラウザー側ノイズ抑制、メンバー別音量に対応。 |
| チャンネルとメッセージ | チャンネルツリーと TeamSpeak 区切り、メンバー状態、移動、チャンネル・サーバー・個人チャット、Poke、ささやき、ローカル履歴。 |
| 画面と音声の共有 | ブラウザー間および対応する TeamSpeak 6 クライアントとの画面共有。品質、ビットレート、統計を設定でき、デスクトップではウィンドウやタブの音声も共有可能。 |
| ID と接続 | ID 保持、TS3 ID インポート・エクスポート、お気に入りと履歴、SRV・Nickname 名前解決、IPv4/IPv6、招待リンク。 |
| インスタンス管理 | 固定・公開接続先、アクセス方針、招待、セッション、ログ、診断、バックアップ、任意の TeamSpeak 管理接続。 |
| スキンと画面 | 昼・夜・ILLUSIA・KAAK、GitHub 経由の `.wskin` 配布、5 言語、レスポンシブ表示。 |
| 分散音声 | ブラウザーが選択した中継の音声ゲートウェイに直接接続し、ページの URL は入口インスタンスのまま維持。 |
| デプロイ方法 | Docker amd64/arm64、Windows x64・Linux x64/ARM64 サーバーパッケージ、Android プレビュー APK。 |
## 🖼️ インターフェースのスクリーンショット
### TeamSpeak のバージョン互換性
日本語のホーム、音声ワークスペース、オーディオ設定、メンバー操作メニューを掲載しています。
音声接続には標準の TeamSpeak クライアントプロトコルを使い、Query の認証情報は不要です。任意の TS 管理機能では、別途 WebQuery / ServerQuery の認証情報を使用します。
- **TeamSpeak 3**: 先頭の `3.x` バージョンを使ってプロトコルを判定します。すべての旧バージョンを個別に検証しているわけではないため、古いサーバーは実際の環境で確認してください。
- **TeamSpeak 6**: 対応しています。TeamSpeak 6 ネイティブクライアントとの画面共有も可能です。
- **自動検出**: ゲートウェイはサーバーの `version` 応答を読み取り、接続診断に判定結果を記録します。
- ゲートウェイは上流 SDK `1.0.0-beta.23` の [`@honeybbq/teamspeak`](https://github.com/HoneyBBQ/teamspeak-js) を使用し、WebSpeak は TeamSpeak 3 と 6 を対象とします。
<a id="screenshots"></a>
## 画面プレビュー
![WebSpeak · 音声ワークスペース](./screenshots/webspeak-ja.png)
<details>
<summary>ホーム、オーディオ設定、メンバーメニューを表示</summary>
### ホーム
<p align="center"><img src="./screenshots/webspeak-ja-home.png" alt="WebSpeak 日本語ホーム" width="100%" /></p>
### 音声ワークスペース
<p align="center"><img src="./screenshots/webspeak-ja.png" alt="WebSpeak 日本語音声ワークスペース" width="100%" /></p>
![WebSpeak · ホーム](./screenshots/webspeak-ja-home.png)
### オーディオ設定
<p align="center"><img src="./screenshots/webspeak-ja-audio.png" alt="WebSpeak 日本語オーディオ設定" width="100%" /></p>
![WebSpeak · オーディオ設定](./screenshots/webspeak-ja-audio.png)
### メンバーメニュー
<p align="center"><img src="./screenshots/webspeak-ja-menu.png" alt="WebSpeak 日本語メンバーメニュー" width="100%" /></p>
![WebSpeak · メンバーメニュー](./screenshots/webspeak-ja-menu.png)
## 🧩 高度な機能
</details>
### WebRTC
<a id="deployment"></a>
**管理コンソール → サーバー → 詳細設定** で有効にします。無効の状態で UDP ポート範囲(初期値 `40000–40099`)を設定し、ファイアウォールで許可して保存してください。有効中は範囲がロックされ、新しい接続で WebRTC を使用します。非対応のブラウザは互換トランスポートに戻ります。公開サイトでは HTTPS が必要です。
## デプロイと初期設定
### 画面共有の ICE 候補
画面共有のメディアは引き続きブラウザ間の直接接続を優先し、WebSpeak はシグナリングだけを中継します。初期状態では TeamSpeak の公開 STUN サービスで外部候補を検出します。STUN はメディアを運びません。認可済みの外部 TURN を使う場合は、起動前に `WEBSPEAK_SCREEN_SHARE_ICE_SERVERS` を JSON 配列で設定できます。
```json
[{"urls":"stun:turn.teamspeak.com:3478"},{"urls":"turns:turn.example.com:5349","username":"<username>","credential":"<credential>"}]
```
TURN を設定した場合、メディアは外部 TURN サービスを経由することがありますが、WebSpeak ゲートウェイは経由しません。未設定時は直接接続と STUN のみを使用します。
### クロスプラットフォーム P2P 画面共有
ブラウザユーザーと TeamSpeak 6 ネイティブクライアントは、互いの画面共有を検出・開始・視聴できます。ブラウザ間、およびブラウザとネイティブクライアント間の画面メディアは、可能な限り WebRTC/ICE の直接接続で送信されます。WebSpeak はセッション認証、共有状態、SDP/ICE シグナリングを担当しますが、画面メディア自体は転送しません。画面には配信中の状態と視聴者数が表示され、音量、全画面、終了を操作できます。取得設定は最大 1080p / 60 FPS に対応し、WebRTC 統計も確認できます。
### 中継サーバー
中継は現在の WebSpeak セッションの TeamSpeak 通信だけを転送し、VPN ではありません。管理コンソールで複数のノードに名前、アドレス、トークンを設定すると、ユーザーは直接接続または中継を選択できます。中継モードは専用の転送サービスとして動作し、ゲスト画面や管理コンソールを提供しません。
中継サービスは WebSpeak に組み込まれており、Node.js の標準ライブラリを使用します。GOST や sing-box などのプロキシフレームワークは不要です。WebRTC は [werift](https://github.com/shinyoshiaki/werift-webrtc)、TeamSpeak 接続はプロジェクトが保守する [EchoSixHIYA/teamspeak-js](https://github.com/EchoSixHIYA/teamspeak-js) SDK を使用します。
## 🚀 デプロイ
Compose は `network_mode: host` を使う Linux Docker ホスト向けの構成です。Windows サーバーには Release パッケージを使用してください。
| 方法 | 用途 |
| --- | --- |
@@ -99,25 +98,172 @@ docker compose up -d
起動後に `http://<your-host>:3040/admin` を開き、`admin` / `admin` でログインして直ちにパスワードを変更し、TeamSpeak を設定します。データは `webspeak-data` volume に保存されます。データベースを消さない場合は `docker compose down -v` を実行しないでください。
```bash
docker compose ps
docker compose logs -f webspeak
```
データを保持して更新:
```bash
git pull --ff-only
docker compose pull
docker compose up -d
```
### Release パッケージ
[Releases](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) から Windows x64 または Linux x64 のパッケージを取得し、専用フォルダーに展開して `start-webspeak.cmd` または `./start-webspeak.sh` を実行します。
[Releases](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) から `windows-x64.zip`、`linux-x64.tar.gz`、`linux-arm64.tar.gz` のいずれかを取得し、同梱ランチャーを実行します。Docker は amd64/arm64 に対応します。`arm64-v8a`、`armeabi-v7a`、`x86_64` の Android APK もあります。APK は手動インストールとテスト向けのデバッグ署名で、Google Play 用ではありません。実機 TeamSpeak 音声は未検証です。
### ソースから
```bash
git clone https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
npm ci --ignore-scripts
npm run prepare:sdk
npm rebuild @discordjs/opus --foreground-scripts
npm --prefix web ci
npm --prefix web run build
npm run web:build
npm run build
npm start
```
## ⚠️ 要件と注意
ビルドには Node.js `>=22.12`、Python、Make、C/C++ コンパイラーが必要です。
- ソースからのビルドには Node.js `>=22.5` が必要です。Docker と Release には必要な実行環境が含まれます。
### 初期設定
1. `http://<your-host>:3040/admin` を開きます。
2. `admin` / `admin` でログインし、直ちに 12 文字以上の新しいパスワードに変更します。
3. **サーバー**で `voice.example.com#9987` などの接続先とアクセスモードを設定します。
4. 公開時は HTTPS を設定し、WebRTC 有効時は指定した UDP 範囲全体を許可します。
### HTTPS とデータ保持
公開ページと WebSocket は HTTPS で提供してください。例えば、自分のドメインをホストに向け、Caddy から WebSpeak へ転送します。
```caddyfile
webspeak.example.com {
reverse_proxy 127.0.0.1:3040
}
```
例のドメインは自分のものに置き換えてください。リバースプロキシや Tunnel でページが開けても、WebRTC の UDP が到達可能とは限りません。[詳細設定](#advanced)を確認してください。パッケージとソースは `data/`、Docker は `webspeak-data` volume を使用します。移行・バックアップ時は `webspeak.db` と対応する `master.key` を一緒に保存します。
<a id="administration"></a>
## 管理コンソール
`/admin` で接続先、アクセス、WebRTC、中継、招待、アクティブセッション、ログ、バックアップを管理します。スキンストアは `/admin/skins`、機能プラグインストアは `/admin/plugins` です。
### 任意の TeamSpeak 管理
WebSpeak 管理画面と音声接続は、この機能に依存しません。固定サーバーモードで `/admin/ts-admin` を開き、TS 管理用の接続を設定します。
1. TS サーバーで WebQuery を有効にし、権限のある TS 管理者に API キーを作成してもらいます。WebQuery の HTTP/HTTPS URL とキーを入力します。WebSpeak のサイトではなく、TS Query サービスの URL です。TS3(3.12 以降)と TS6 に対応します。
2. 仮想サーバー ID `0` は固定接続先の音声ポートから選択します。制限付きキーでは許可された ID を入力してください。読み取りキーでは閲覧ができ、変更には書き込み可能なスコープと対応する TS 権限が必要です。
3. ServerQuery SSH、または TS3 の ServerQuery TCP も選べます。Query ホスト(空欄は固定接続先)、ポート、ユーザー名、パスワードを入力し、SSH では信頼できるホストキーのフィンガープリントも指定します。OS への SSH ログインではありません。TCP は暗号化されないため信頼できるネットワークで使用します。HTTPS 証明書はゲートウェイで信頼されている必要があります。
4. 保存して接続または更新します。サーバー設定、チャンネル管理、メンバーの移動・退出・ID による BAN、グループ割り当て、BAN 解除に対応します。操作には確認が必要で、TS が権限を検証します。リストは手動更新します。
認証情報はサーバーで暗号化され、API から返されません。データベースと `master.key` を一緒にバックアップしてください。管理接続の失敗は WebSpeak 管理画面や音声に影響しません。UID による BAN で同じゲートウェイ IP を使う他のユーザーへの影響を避けます。
<a id="advanced"></a>
## 詳細設定
### WebRTC
**管理コンソール → サーバー → 詳細設定** で有効にします。無効の状態で UDP ポート範囲(初期値 `40000–40099`)を設定し、ファイアウォールで許可して保存してください。有効中は範囲がロックされ、新しい接続で WebRTC を使用します。非対応のブラウザは互換トランスポートに戻ります。公開サイトでは HTTPS が必要です。
### リバースプロキシ・TCP Tunnel 経由の音声 WebRTC
**サーバー → 詳細設定** の**公開メディアアドレス**には、UDP で到達可能な音声ゲートウェイの IP またはドメインを入力します。スキーム、パス、ポートは含めません。ページのリクエストから推測する接続先より優先され、プロキシのドメインが音声にも到達可能とは限りません。
**IPv6 候補**は任意で、IPv4 も維持します。IPv6 の経路とファイアウォール許可が必要です。**音声 STUN** に `stun:turn.teamspeak.com:3478` を設定すると、ブラウザーとゲートウェイが同じサービスを使います。空欄では従来どおり、ゲートウェイのライブラリ内蔵 STUN を使い、ブラウザーには設定しません。IPv4 で到達可能な UDP STUN ドメイン・IPv4 アドレスに対応し、IPv6 リテラルや TURN 認証情報は指定できません。
保存後に再接続してください。ページと WebSocket に到達できても、UDP メディアが到達可能とは限りません。UDP 範囲全体を許可し、固定ポート転送では番号を維持します。STUN はアドレスを検出するだけで音声を中継せず、すべての NAT を通過できるわけでもありません。
モバイル回線や UDP が遮断される環境では、**管理コンソール → サーバー → 音声**で外部 TURN を任意のフォールバックとして設定できます。TURN REST URL、共有シークレット、認証情報の有効期限を入力してください。対応する環境変数は `WEBSPEAK_TURN_REST_URLS` と `WEBSPEAK_TURN_REST_SECRET` です。コンソールの値が優先され、ゲートウェイの再起動なしで新しい接続に適用されます。`WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY=all` ではまず直接 UDP を試します。
`WEBSPEAK_VOICE_PROFILE` の初期値は `auto` です。信頼できる Cloudflare プロキシを経由した要求だけが適応バッファを使い、直接接続などの要求は従来の 80 ms / 生 PCM の動作を維持します。ローカルの Tunnel 接続は初期状態で信頼されます。cloudflared が別のアドレスから接続する場合は `WEBSPEAK_TRUSTED_PROXIES` を設定してください。直接接続でも適応モードを使うには `adaptive` を明示的に選ぶか、「音声」で指定します。WebSocket 経由の Opus は初期状態で無効で、適応モードが必要です。「音声」または `WEBSPEAK_VOICE_OPUS_WS=1` で有効にできます。直接 UDP と TURN のどちらもメディア経路を提供できない場合、セッションは `NO_MEDIA_PATH` を報告して互換トランスポートを使います。詳細は [`CLOUDFLARE_TUNNEL_VOICE.md`](CLOUDFLARE_TUNNEL_VOICE.md) を参照してください。
### 画面共有の ICE 候補
画面共有のメディアは引き続きブラウザ間の直接接続を優先し、WebSpeak はシグナリングだけを中継します。初期状態では TeamSpeak の公開 STUN サービスで外部候補を検出します。STUN はメディアを運びません。認可済みの外部 TURN を使う場合は、起動前に `WEBSPEAK_SCREEN_SHARE_ICE_SERVERS` を JSON 配列で設定できます。
```json
[{"urls":"stun:turn.teamspeak.com:3478"},{"urls":"turns:turn.example.com:5349","username":"<username>","credential":"<credential>"}]
```
TURN を設定した場合、メディアは外部 TURN サービスを経由することがありますが、WebSpeak ゲートウェイは経由しません。未設定時は直接接続と STUN のみを使用します。
### クロスプラットフォーム P2P 画面共有
ブラウザユーザーと TeamSpeak 6 ネイティブクライアントは、互いの画面共有を検出・開始・視聴できます。ブラウザ間、およびブラウザとネイティブクライアント間の画面メディアは、可能な限り WebRTC/ICE の直接接続で送信されます。WebSpeak はセッション認証、共有状態、SDP/ICE シグナリングを担当しますが、画面メディア自体は転送しません。画面には配信中の状態と視聴者数が表示され、音量、全画面、終了を操作できます。取得設定は最大 1080p / 60 FPS に対応し、WebRTC 統計も確認できます。
### 中継サーバー
入口ゲートウェイが署名付きの一度限りのチケットを発行し、ブラウザーは中継の音声ゲートウェイに直接接続します。中継が TeamSpeak に接続し、ページの URL はそのままです。中継ノードはホームや管理コンソールを提供しません。
<details>
<summary>中継の起動と設定</summary>
```bash
docker run -d --name webspeak-relay --restart unless-stopped --network host \
-e WEBSPEAK_MODE=relay \
-e WEBSPEAK_RELAY_TOKEN='replace-with-a-long-random-token' \
-e WEBSPEAK_RELAY_PORT='39087' \
-e WEBSPEAK_RELAY_WEBRTC_PUBLIC_HOST='relay.example.com' \
ghcr.io/echosixhiya/webspeak:latest
```
共通トークンはランダムな 16 文字以上にします。音声ゲートウェイは `127.0.0.1:3041` で待ち受けるため、Caddy などで HTTPS/WSS ドメインから転送します。
```caddyfile
relay.example.com {
reverse_proxy 127.0.0.1:3041
}
```
入口側の**サーバー → 中継**で、名前、UDP 接続先 `relay.example.com#39087`、音声接続先 `https://relay.example.com`、同じトークンを設定して保存します。ユーザーは直接接続か中継を選べます。UDP `39087` と WebRTC の `40000–40099` を許可してください。公開メディアアドレスは HTTP プロキシではなく、中継に直接到達できる必要があります。
ソースや Release パッケージでも同じ環境変数を指定します。ビルド後は `node dist/index.js`、パッケージでは `./runtime/node ./dist/index.js`(Windows:`.\runtime\node.exe .\dist\index.js`)で起動します。
</details>
### 依存ライブラリ
中継は WebSpeak に組み込まれ、Node.js 標準ライブラリを使います。WebRTC は [werift](https://github.com/shinyoshiaki/werift-webrtc) `0.24.4`、TeamSpeak は上流 [HoneyBBQ/teamspeak-js](https://github.com/HoneyBBQ/teamspeak-js) の `@honeybbq/teamspeak@1.0.0-beta.23` を使用し、fork のビルドは不要です。
<a id="extensions"></a>
## スキンと機能プラグイン
### スキンパッケージ `.wskin`
スキンは外観、配置、付属ウィジェットを扱います。管理者がインストール、有効化、デフォルト選択を行い、開発者は WebSpeak のソースを変更せず公開 API で制作します。
[開発ガイド](./SKIN_DEVELOPMENT.md) · [Agent Skill](../.agents/skills/webspeak-skin-development/SKILL.md) · [スキン一覧](https://github.com/Huddle-Up-Forge/webspeak-skins) · [Discord Voice サンプル](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice)
### 機能プラグイン `.wplugin`
機能プラグインは標準ブラウザー機能と任意の Node バックエンドを使う独立アプリです。ルート、状態、共同作業は作者が実装します。管理者はコードと依存関係を審査して有効化し、更新後は再び信頼を確認します。TS サーバーまたはインスタンス範囲に対応し、別オリジンで動作します。API v2 は v0.3.0 から利用できます。
[開発ガイド](./PLUGIN_DEVELOPMENT.md) · [Agent Skill](../.agents/skills/webspeak-plugin-development/SKILL.md) · [配布一覧とサンプル](https://github.com/Huddle-Up-Forge/webspeak-plugin)
<a id="troubleshooting"></a>
## トラブル対処
| 症状 | 確認する内容 |
| --- | --- |
| WebRTC を有効にしてもフォールバックする | 音声状態のエラーコード、HTTPS、UDP 範囲全体、公開メディアアドレスを確認します。TCP Tunnel はこの UDP メディア経路を転送しません。 |
| ローカルアドレス保護で接続先が拒否される | 公開モードはループバック・プライベートアドレスを制限します。同じホストの TS には、管理者が設定する固定サーバーモードを使います。 |
| 画面共有がタイムアウトする・黒いまま | 画面共有は独立した WebRTC 接続です。共有統計のネゴシエーション、ICE、コーデックを確認します。音声の接続成功だけでは画面の到達性を確認できません。 |
| 更新後にデータがない・復号できない | 元のデータディレクトリまたは volume と対応する `master.key` を使います。`docker compose down -v` で更新しないでください。 |
### ⚠️ 要件と注意
- ソースからのビルドには Node.js `>=22.12` が必要です。Docker と Release には必要な実行環境が含まれます。
- WebRTC に対応した最新の Chrome、Edge などを使用してください。マイクとウィンドウ音声には通常 HTTPS が必要です。
- WebSpeak のホストから TeamSpeak に到達できる必要があります。標準音声ポートは `9987` です。
- Web サービスは `3040/TCP` を使用します。公開時は HTTPS と WebSocket をリバースプロキシ経由で公開してください。
@@ -125,26 +271,216 @@ npm start
- 保存したブラウザ ID は同じブラウザで同時に1接続だけ使用できます。
- BGM共有はデスクトップのみで、WebRTC が必要です。
- WebRTC の初期範囲は UDP `40000–40099` です。全体を許可し、変更前に WebRTC を無効化して保存します。
- アプリケーションの上限は 1 インスタンス 100 ブラウザーセッションです。性能保証や TS ライセンス上限を示すものではありません。
<a id="changelog"></a>
## 更新履歴
<a id="latest-release-notes"></a>
### [v0.3.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.3) · 2026-11-26
**主な変更:管理コンソールから安定版の確認とワンクリック更新が可能になりました。**
- 公式 GitHub Releases を確認し、管理者がバージョンを選んでインストールを承認します。パッケージは SHA-256 検証が必須です。自動インストールの対象は、フォアグラウンドで実行する公式 Linux x64 パッケージです。Windows、Linux arm64、Docker、ソース実行、systemd・PM2・Supervisor 管理の環境では、バージョン確認とリリースノートの閲覧ができ、インストールは手動です。
- 置き換えるのはプログラムファイルのみです。`data/`、`config.json`、`certs/`、インストール済みのスキンとプラグインは保持します。プロセスの再起動により、音声セッションと管理画面が一時的に切断されます。SHA256SUMS.txt は整合性のチェックサムであり、デジタル署名ではありません。
- ヘルスチェック、ロールバック、中断後の起動復元を強化しました。復元処理は更新処理とロックを共有し、重複起動による実行中の更新の巻き戻しを防ぎます。サイズ超過、書き込み失敗、キャンセル時にはリクエストと並列ダウンロードを中止し、読み取りストリームを解放します。
- 宣言したスロットと保護されたスタイル変数で、スキン内の復元入口とホスト操作部を調整できます。利用できない配置や色は標準に戻ります。浮動ボタンの重なり回避、通知の下にある要素の判定、スキンの遅延読み込みとアニメーションの互換性を改善し、復元ショートカットを維持しました。
- #60、#61、#62 と追加修正を収録し、スキン開発ガイドとサンプルを更新しました。OddTurtleHead の貢献に感謝します。
**更新方法:** v0.3.2 以前は、最初に v0.3.3 へ手動で更新してください。その後、対応する環境ではコンソールから今後の安定版をインストールできます。事前にデータをバックアップしてください。Docker はデータボリュームを保持して `docker compose pull && docker compose up -d` を実行します。サービス管理下では、停止してからプログラムファイルを置き換え、再起動してください。
検証:1102 件の自動テスト、フロントエンド・バックエンドのビルド、Docker 起動ヘルスチェックを通過。
### [v0.3.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.2) · 2026-11-14
- サードパーティースキンでホストの装飾を変更できます。復元と許可の操作は WebSpeak が管理し、組み込みスキンに戻せます。TS3 判定と互換性情報の ph1gros(#46)、ホスト装飾と復元機能の OddTurtleHead(#57)に感謝します。
- 日間、夜間、ILLUSIA では上部バーからアプリライブラリを開けます。KAAK 3.1.134 では左端のアイコン列に移動し、隣のボタンとサイズを揃えました。固定したアプリは先頭に表示されます。
- 管理画面にフィールドエディター、P2P ファイル転送・動画の同時視聴・TSMusicBot の設定フォーム、各リポジトリへのリンクを追加しました。
- ストアでは表示情報の差異を許容し、SHA-256、パッケージ形式、インストールや実行に必要な項目を検証します。
- 開発ガイドと Agent Skill に、アプリ入口の配置、設定項目、公開プラグインに必要な独立した HTTPS オリジンを記載しました。
### [v0.3.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.1) · 2026-11-13
- WebSocket 再生で Opus のチャンネル情報と実際のパケット長を扱うよう修正しました。WebRTC の下りミックスでもステレオを維持します。関連 #54。
- ノイズ抑制にオフ・標準・強の3段階を追加しました。強ではブラウザーのノイズ抑制と RNNoise を併用します。関連 #53。
- 音声パネルから直近2分間のゲートウェイ、音声、マイクの診断をエクスポートできます。バックグラウンドでの録音はブラウザーと OS の制約を受けます。関連 #49、#55。
- プラグインの入口を音声ワークスペースのツールバーに移動し、管理者がショートカットを固定できるようにしました。関連 #56。
- 有効期限付きの非公開招待を追加し、KAAK のウェルカム画面を復元しました。デモのスキンメニューが隠れる問題と、大きなスキンのダウンロードが早くタイムアウトする問題を修正しました。README に5種類のスキン画像を追加しました。
### [v0.3.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.0) · 2026-11-03
#### プラグインアプリ
- 独立したブラウザアプリと任意の Node バックエンドに対応するプラグイン API v2 を公開。作者がルート、状態、通信、機能を実装できます。
- GitHub ストアまたはローカルの `.wplugin` からインストール。管理者が公開・非公開設定を管理し、確認して有効化します。更新後は再度信頼の確認が必要です。
- スキンに依存しないフローティング起動ボタンとアプリライブラリを追加。ウィンドウの移動、サイズ変更、最小化、最大化、復元に対応し、最小化やライブラリへの移動でもアプリを再読み込みしません。
- アプリテンプレート、開発ガイド、Agent Skill を提供。P2P ファイル転送と動画の同時視聴は独立リポジトリで配布します。
#### スキンと許可
- 初回アクセス時に、インスタンスのサードパーティ製スキンとプラグインをまとめて確認します。接続用の認証情報は含みません。スキンメニュー末尾の「許可」から変更できます。
- 同意しない場合は昼・夜・ILLUSIA のみ利用でき、KAAK、その他のスキン、プラグイン入口は非表示になります。許可を取り消すと内蔵スキンに戻り、読み込み処理、関連コンポーネント、アプリページを停止します。
- マニフェストの権限、データ投影、ファイルハッシュ、ホスト操作の検証は維持します。管理者による確認と信頼は別途必要です。
#### 修正と更新
- ウィンドウ、画面全体、音声なしの共有で、映像のみの offer にネイティブ TS クライアントが応答しない問題を修正。必要な音声セクションを交渉しますが、マイクの収録や音声の生成は行いません。ウィンドウと画面全体での表示はユーザーの再テストで確認済みです。
- SDK を `@honeybbq/teamspeak@1.0.0-beta.23` に更新。省略可能なメンバーフィールドに対応し、発話終了を表す空の音声パケットを除外します。
- upstream の TSDNS、Query の制限時リトライ、ファイル転送、切断処理の修正を取り込みました。
- IPv6 の接続先検証、並列ログイン制限、パスワード変更時のセッション失効、信頼済みプロキシの制限、PCM 送信保護を修正しました。
- スキンの初回読み込みに実際のビルドバージョンを使用する修正を維持。デスクトップ、Web、Android のアプリバージョンを統一しました。
#### アップグレード
- API v2 は v1 のプラグインと互換性がありません。対応アプリへ更新し、確認後に有効化してください。
- 公開環境のプラグインには、管理画面で設定した独立 HTTPS オリジンと実行ポート(既定 `3042`)へのプロキシが必要です。メインサイトと同じオリジンは使用できません。
- インスタンス単位の許可を改めて選択してください。旧スキン単位の許可は同意として引き継がれません。
### [v0.2.9](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.9) · 2026-10-24
#### 機能追加
- 上流 SDK 1.0.0-beta.19 へ移行しました。通常の音声接続はクライアントのライブ一覧を使用し、Query の一覧取得権限を必要としません。
- GitHub スキンストアと、インスタンスごとのインストール、更新、有効化の管理を追加しました。Discord Voice は標準 `.wskin` の独立したサンプルとして配布します。
- 固定サーバーモードに任意の TS 管理パネルを追加しました。WebQuery、TCP または SSH Query の認証情報を設定し、サーバー、チャンネル、メンバー、サーバーグループ、BAN を管理できます。
- 中継ノードがブラウザー向けの音声接続先を公開し、音声セッションを担当できるようになりました。ゲートウェイ間の余分な転送を減らせます。
- ワークスペース保持と再接続の共通 API を追加し、KAAK に適用しました。管理画面、プロジェクトの GitHub、QQ グループへの入口も追加しました。
- TeamSpeak のチャンネル区切りに対応しました。配置、繰り返し、空白行、標準線種を扱い、表示データをスキンにも公開します。
#### 修正
- 画面共有の全画面サイズと、退出したメンバーの状態および再生リソースの解放を修正しました。
- BAN 成功時の誤った失敗表示、Query 接続の人数への混入、チャンネルパスワードのラベルを修正しました。
- 権限不足、レート制限、タイムアウトを区別します。操作成功後の更新だけが失敗した場合は別の警告を表示し、重複操作を防ぎます。
- SDK が失敗した HTTP 応答を WebQuery 成功とみなすことを防止し、DC のホーム、チャット、狭い画面の操作部品の配置を修正しました。
#### 既知の問題
- [PR #48](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/48) のセキュリティ強化は本リリースに含まれません。PR のクローズは、報告された問題の修正完了を意味しません。
<details>
<summary>v0.2.8 以前の履歴を表示</summary>
### [v0.2.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.8) · 2026-10-17
#### 画面共有と接続の安定性
- ブラウザーと TeamSpeak ネイティブクライアント間の画面共有で、接続ネゴシエーションと映像トラックの処理を修正しました。
- チャンネルをすばやく切り替えた際の処理を改善し、クライアント状態の不整合を減らしました。
- 一部スキンコンポーネントの内容表示と KAAK の多言語表示を修正しました。
#### インターフェースの改善
- 音声デバイス名を省略せず表示し、幅が足りない場合は折り返して、長い名前を判別しやすくしました。
- アバターの代替テキストが誤って選択される問題を修正しました。
### [v0.2.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.7) · 2026-10-13
#### より開かれたスキンシステム
- より開かれたスキン編集・実行環境を提供し、任意のコンポーネントのスタイルや配置を変更したり、ウィジェットを追加したりできるようになりました。
- 音声パネルに入った後、同じブラウザーで管理画面を新しいウィンドウに開いてログインすると、スキンエディターが有効になります。
- 開発例として「KAAK」スキンを同梱しました。
- スキン開発 Agent Skill を更新しました。
#### 機能強化
- SRV レコードと TeamSpeak Nickname 形式のサーバーアドレス解決に対応しました。
- 自由モードでは複数サーバーのタブを管理できます。このボタンは「固定サーバー」モードでは使用できません。
- 画面共有にビットレート設定を追加しました。
- 入力したチャンネルパスワードを WebSpeak がブラウザーに保存するようになりました。
- ロックされたチャンネルの前に鍵アイコンを表示します。
- チャット履歴を永続的に保存するようになりました。
#### バグ修正
- アドレス解析の不具合を修正しました。
- 音量操作とメンバーカードのドラッグでフォーカスが競合する問題を修正しました。
- ユーザーステータスが誤って「不明」と解析される問題を修正しました。
### [v0.2.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.6) · 2026-10-08
0.2.5 から音声ゲートウェイ、共有プロトコル、音声ワークスペース、管理モジュールを大規模に再構成。#6/#7/#10 を修正し、#9/#12 を実装。PR #13 が報告した既存 TS6 画面共有の検出漏れも修正しました。Opus、セッションのライフサイクル、モバイル操作を改善。Windows x64、Linux x64/ARM64、Docker amd64/arm64、Android arm64-v8a/armeabi-v7a/x86_64 APK を提供。
### [v0.2.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.5) · 2026-09-27
`.wskin` スキン、管理者向けの有効化/デフォルト設定、保護された昼・夜・ILLUSIA 内蔵スキンを追加。未完成の Aurora Voice サンプルを削除し、読み込み時のちらつき、ダークモードの視認性、音声画面のアートレイヤーを修正。公式スキン開発 Agent Skill も追加しました。
### [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) · 2026-09-22
ブラウザと TeamSpeak 6 ネイティブクライアント間のクロスプラットフォーム P2P 画面共有を追加しました。STUN/外部 TURN 設定、プレーヤーと視聴者状態、1080p/60 FPS 取得設定、WebRTC 統計に対応し、共有操作と訪問者番号も改善しました。
### [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) · 2026-09-19
チャンネルメンバーの移動操作と権限に応じた直接移動を追加し、アバター表示、ミュート状態の同期、保存 ID の復元に対応しました。5 言語のスクリーンショットとドキュメントも更新しました。
### [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) · 2026-09-17
ブラウザ側マイクノイズ抑制、ロシア語・日本語 UI、言語別ウェルカム文を追加。音量操作と PR #2 を基にしたエラー表示・エラーコードを改善しました。
### [v0.2.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.1) · 2026-09-13
接続エラー表示を改善し、IPv6 接続先を標準対応しました。
### [v0.2.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.0) · 2026-09-10
パスワード案内、正式な中継モード、複数中継選択、接続診断を追加しました。
### [v0.1.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.8) · 2026-09-08
Docker 起動を簡略化し、15秒の接続タイムアウトと継続的なネットワーク監視を追加しました。
### [v0.1.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.7) · 2026-09-06
ドイツ語、Telegram、ネットワーク統計、全体音量を追加し、BGM 音量の変動を修正しました。
### [v0.1.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.6) · 2026-09-04
ウィンドウ・タブ音声の共有、ID 保持の案内、サイトアイコンを追加し、WebRTC のメンバー別音量を修正しました。
### [v0.1.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.5) · 2026-09-04
ID 保存処理を修正し、テーマ切り替えを改善しました。
### [v0.1.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.4) · 2026-09-03
WebRTC とチャンネルチャットを修正し、管理画面、ログ、モバイル配置を改善しました。
### [v0.1.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.3) · 2026-09-03
内蔵 WebRTC を追加し、TeamSpeak SDK を移行しました。メンバー同期と音声バッファーを改善しました。
</details>
<a id="contributors"></a>
## 貢献者と主な貢献
<details>
<summary>上流作者と PR の貢献を表示</summary>
上流 SDK の作者、マージ済みの GitHub PR、および独立配布のスキンパッケージへ移植された原作の貢献を記載しています。
- [HoneyBBQ](https://github.com/HoneyBBQ) — 上流 SDK [teamspeak-js(`@honeybbq/teamspeak`)](https://github.com/HoneyBBQ/teamspeak-js) の作者。WebSpeak の TeamSpeak プロトコル通信を支えるクライアントライブラリを提供。
- [ph1gros](https://github.com/ph1gros) — [PR #48](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/48) で IPv6 接続先検証、管理者認証とセッション、プロキシ配下の制限、PCM 送信境界の問題を報告し、修正案と回帰テストを提供。元のパッチは直接マージせず、`dev` で改めて修正を実装しました。
- [LainHE](https://github.com/LainHE) — [マージ済み PR #2、#8、#28、#31–#35、#37、#38、#40](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ALainHE)。ブラウザのエラー翻訳、拡大縮小とホームのレイアウト、画面共有のビットレートと視聴者アバター、中継先の検証と再接続、信頼済みプロキシの扱い、接続失敗の通知、音声エラー報告、WebRTC 失敗時のリソース解放を改善。
- [TimmySheep](https://github.com/TimmySheep) — [マージ済み PR #13、#15–#24](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ATimmySheep)。既存 TS6 共有の検出、画面比率、モバイル音声・画面点灯・スキンメニュー、ID のチャンネル設定、PWA/テーマ、チャット履歴、メンバー音声状態、マイク権限などに貢献。
- [yichen11818](https://github.com/yichen11818) — [PR #25](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/25) で TeamSpeak の登録済みニックネーム接続と接続先の保持に対応し、[PR #51](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/51) で初回接続後の KAAK ワークスペース保持と再接続を改善。[PR #27](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/27) と [PR #52](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/52) では Discord スキンの原作デザインと実装を提供(コミット名義 **yumi**)。その後、WebSpeak プロジェクトが[独立配布の `.wskin` スキン](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice)へ移植。
</details>
## コミュニティと関連プロジェクト
- [QQ グループ](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=yhumUMDD9PmyYFWdXWUb_x7hM5trFQY8&authKey=Pw3HBGT7GwMinTQnuFGfnpf0aRSzXOJKcAiujVP1%2BXMpjheAKrncTRivicBJxpjV&noverify=0&group_code=869500475)
- [Telegram グループ](https://t.me/+8qShpTcuN9A3MWY9)
- [NeteaseTSBot](https://github.com/yichen11818/NeteaseTSBot) — Web コンソール付き TeamSpeak 音楽ボット。
[GitHub Issues](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/issues) · [QQ グループ 869500475](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=yhumUMDD9PmyYFWdXWUb_x7hM5trFQY8&authKey=Pw3HBGT7GwMinTQnuFGfnpf0aRSzXOJKcAiujVP1%2BXMpjheAKrncTRivicBJxpjV&noverify=0&group_code=869500475) · [Telegram](https://t.me/+8qShpTcuN9A3MWY9)
## 🧾 更新履歴
| バージョン | 内容 |
| --- | --- |
| 0.2.5-preview | 2026-09-27 | `.wskin` スキン、管理者向けの有効化/デフォルト設定、保護された昼・夜・ILLUSIA 内蔵スキンを追加。未完成の Aurora Voice サンプルを削除し、読み込み時のちらつき、ダークモードの視認性、音声画面のアートレイヤーを修正。公式スキン開発 Agent Skill も追加しました。 |
| [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) | ブラウザと TeamSpeak 6 ネイティブクライアント間のクロスプラットフォーム P2P 画面共有を追加しました。STUN/外部 TURN 設定、プレーヤーと視聴者状態、1080p/60 FPS 取得設定、WebRTC 統計に対応し、共有操作と訪問者番号も改善しました。 |
| [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) | チャンネルメンバーの移動操作と権限に応じた直接移動を追加し、アバター表示、ミュート状態の同期、保存 ID の復元に対応しました。5 言語のスクリーンショットとドキュメントも更新しました。 |
| [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) | ブラウザ側マイクノイズ抑制、ロシア語・日本語 UI、言語別ウェルカム文を追加。音量操作と PR #2 を基にしたエラー表示・エラーコードを改善しました。 |
| [v0.2.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.1) | 接続エラー表示を改善し、IPv6 接続先を標準対応しました。 |
| [v0.2.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.0) | パスワード案内、正式な中継モード、複数中継選択、接続診断を追加しました。 |
| [v0.1.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.8) | Docker 起動を簡略化し、15秒の接続タイムアウトと継続的なネットワーク監視を追加しました。 |
完全な履歴は [CHANGELOG.md](../CHANGELOG.md) を参照してください。
[NeteaseTSBot](https://github.com/yichen11818/NeteaseTSBot):複数サービスの再生と Web コンソールに対応した TeamSpeak 音楽ボット。
## ライセンス
WebSpeak は [GNU Affero General Public License v3.0 only](../LICENSE) の下で公開されています。
WebSpeak は [AGPL-3.0-only](../LICENSE) で公開しています。依存ライブラリのライセンスと帰属は各上流プロジェクトを参照してください。
<p align="right"><a href="#readme-top">先頭へ ↑</a></p>
+415 -79
View File
@@ -1,86 +1,85 @@
# WebSpeak · Русский
<a id="readme-top"></a>
[Главная проекта](../README.md) · [简体中文](./README.zh-CN.md) · [English](./README.en.md) · [Deutsch](./README.de.md) · [日本語](./README.ja.md)
<div align="center">
<img src="./assets/webspeak-logo.png" alt="WebSpeak" width="88" />
<h1>WebSpeak · Русский</h1>
<p><strong>Ваше сообщество TeamSpeak — прямо в браузере.</strong></p>
<p><a href="../README.md">Главная проекта</a> · <a href="./README.zh-CN.md">简体中文</a> · <a href="./README.en.md">English</a> · <a href="./README.de.md">Deutsch</a> · <a href="./README.ja.md">日本語</a></p>
<p>
<a href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest"><img src="https://img.shields.io/github/v/release/EchoSixHIYA/WebSpeak-client-for-TeamSpeak?style=flat-square&amp;color=0f766e" alt="Release" /></a>
<a href="../LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--only-0f766e?style=flat-square" alt="AGPL-3.0-only" /></a>
</p>
</div>
## О проекте
WebSpeak — самостоятельно размещаемый браузерный клиент и голосовой шлюз для TeamSpeak 3 и TeamSpeak 6. Пользователи подключаются к голосу, чату и демонстрации экрана через браузер, а оператор управляет серверами, доступом и данными в веб-консоли.
| Логика | Описание |
| --- | --- |
| **WHAT** | WebSpeak — самостоятельно размещаемый веб-клиент и голосовой шлюз для TeamSpeak 3 и TeamSpeak 6. |
| **WHY** | Пользователям не нужно устанавливать настольный клиент: достаточно открыть браузер, а оператор сохраняет контроль над сервером и данными. |
| **HOW** | После запуска настройте цель TeamSpeak и политику доступа в панели администратора. Браузер отвечает за интерфейс и аудио, WebSpeak — за шлюз. |
Стабильный выпуск: [изменения v0.3.3](#latest-release-notes) · [Скачать](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) · Обновление из консоли, восстановление и улучшенная совместимость скинов.
[Онлайн-демо](#demo) · [Возможности](#features) · [Скриншоты](#screenshots) · [Развёртывание](#deployment) · [Управление](#administration) · [Расширенные настройки](#advanced) · [Скины и плагины](#extensions) · [Решение проблем](#troubleshooting) · [История изменений](#changelog)
<a id="demo"></a>
## Онлайн-демо
Адрес: <https://webspeak.example.invalid>
- [Шанхай · shanghai.webspeak.online](https://shanghai.webspeak.online)
- [Гонконг · webspeak.online](https://webspeak.online)
Демо-сервер находится в Гонконге; сеть и нагрузка могут быть нестабильными. Задержки, разрывы или временная недоступность демо не характеризуют самостоятельное развертывание.
Попробуйте главную страницу и голосовое пространство. Сеть, нагрузка и доступность демонстрационных узлов могут меняться.
## ✨ Возможности
<a id="features"></a>
## Возможности
| Возможность | Описание |
| --- | --- |
| TeamSpeak | Поддержка TeamSpeak 3 и TeamSpeak 6 с автоматическим определением протокола. |
| Кроссплатформенная P2P-трансляция экрана | Пользователи браузера и нативные клиенты TeamSpeak 6 могут запускать и смотреть трансляции друг друга; медиаданные идут напрямую по WebRTC/ICE, а WebSpeak передаёт только сигнальные сообщения. |
| IPv6 | IPv6-цели и IPv6-адреса, полученные через DNS, поддерживаются по умолчанию. |
| Каналы и участники | Дерево каналов, состояние участников в реальном времени и переход между каналами. |
| Голос в реальном времени | Opus, совместимый транспорт и встроенный WebRTC с низкой задержкой. |
| Управление аудио | Микрофон, динамики, громкость, VOX, отключение микрофона и отдельная громкость участников. |
| Шумоподавление в браузере | Опциональное шумоподавление микрофона на этапе захвата в браузере без дополнительной обработки звука на сервере. |
| Чат и действия | Чат канала и сервера, личные сообщения, толчки и цели шёпота. |
| Фоновая музыка | На компьютере можно поделиться звуком окна или вкладки с текущим каналом. |
| Идентичность и доступ | Сохранение идентичности, собственные цели и приглашения с ограничением срока и числа использований. |
| Панель администратора | Цели, доступ, WebRTC, ретрансляторы, приглашения, сессии, логи, диагностика и резервные копии. |
| Скины | Защищённые дневная, ночная и ILLUSIA-темы, а также `.wskin` экземпляра с управлением включением и темой по умолчанию в панели администратора. |
| Интерфейс | 中文, English, Deutsch, Русский и 日本語, адаптивная верстка. |
| Голос | Opus, необязательный WebRTC и резервный WebSocket; отключение микрофона, VOX, выбор устройств, шумоподавление в браузере и громкость участников. |
| Каналы и сообщения | Дерево и разделители каналов TeamSpeak, состояние участников, переходы, чат канала/сервера/личный чат, толчки, шёпот и локальная история. |
| Экран и аудио | Обмен экраном между браузерами и поддерживаемыми нативными клиентами TeamSpeak 6, настройки качества, битрейта и статистика; звук окна или вкладки на компьютере. |
| Идентичность и подключения | Сохранение идентичности, импорт/экспорт TS3, избранное и история, разрешение SRV и Nickname, IPv4/IPv6 и приглашения. |
| Управление экземпляром | Фиксированные или открытые цели, доступ, приглашения, сессии, журналы, диагностика, резервные копии и необязательное управление TeamSpeak. |
| Скины и интерфейс | Дневная, ночная, ILLUSIA и KAAK, пакеты `.wskin` через GitHub, пять языков и адаптивная вёрстка. |
| Распределённый голос | Браузер подключается напрямую к выбранному голосовому ретранслятору, сохраняя URL входного экземпляра. |
| Развёртывание | Docker amd64/arm64, серверные пакеты Windows x64 и Linux x64/ARM64, а также предварительные Android APK. |
## 🖼️ Скриншоты интерфейса
### Совместимость версий TeamSpeak
Скриншоты показывают русскую главную страницу, голосовое пространство, настройки аудио и меню участника.
Голосовые соединения используют стандартный клиентский протокол TeamSpeak и не требуют учётных данных Query. Необязательное управление TS использует отдельные данные WebQuery / ServerQuery.
- **TeamSpeak 3**: определение распознаёт ведущую версию `3.x`. Старые версии сервера следует проверять отдельно в конкретной среде: не каждая историческая версия тестировалась независимо.
- **TeamSpeak 6**: поддерживается, включая демонстрацию экрана с нативными клиентами TeamSpeak 6.
- **Автоопределение**: шлюз читает ответ сервера `version` и записывает распознанный протокол в диагностику подключения.
- Шлюз использует upstream SDK `1.0.0-beta.23` [`@honeybbq/teamspeak`](https://github.com/HoneyBBQ/teamspeak-js); WebSpeak рассчитан на TeamSpeak 3 и 6.
<a id="screenshots"></a>
## Скриншоты
![WebSpeak · Голосовое пространство](./screenshots/webspeak-ru.png)
<details>
<summary>Показать главную страницу, настройки аудио и меню участника</summary>
### Главная страница
<p align="center"><img src="./screenshots/webspeak-ru-home.png" alt="Главная страница WebSpeak на русском" width="100%" /></p>
### Голосовое пространство
<p align="center"><img src="./screenshots/webspeak-ru.png" alt="Русское голосовое пространство WebSpeak" width="100%" /></p>
![WebSpeak · Главная страница](./screenshots/webspeak-ru-home.png)
### Настройки аудио
<p align="center"><img src="./screenshots/webspeak-ru-audio.png" alt="Настройки аудио WebSpeak на русском" width="100%" /></p>
![WebSpeak · Настройки аудио](./screenshots/webspeak-ru-audio.png)
### Меню участника
<p align="center"><img src="./screenshots/webspeak-ru-menu.png" alt="Меню участника WebSpeak на русском" width="100%" /></p>
![WebSpeak · Меню участника](./screenshots/webspeak-ru-menu.png)
## 🧩 Расширенные функции
</details>
### WebRTC
<a id="deployment"></a>
Включается в **Панель администратора → Сервер → Расширенные настройки**. До включения задайте диапазон UDP-портов (по умолчанию `40000–40099`), откройте его в firewall и сохраните. При включённом WebRTC диапазон заблокирован; новые подключения используют WebRTC, а неподдерживаемые браузеры переходят на совместимый транспорт. Для публичного доступа нужен HTTPS.
## Развёртывание и первый запуск
### ICE для демонстрации экрана
Медиа демонстрации экрана по-прежнему предпочитает прямое соединение между браузерами; WebSpeak только передаёт сигнальные сообщения. По умолчанию используются публичные STUN-серверы TeamSpeak для поиска внешних кандидатов, STUN не передаёт медиаданные. Авторизованный внешний TURN можно задать через `WEBSPEAK_SCREEN_SHARE_ICE_SERVERS` в виде JSON-массива, например:
```json
[{"urls":"stun:turn.teamspeak.com:3478"},{"urls":"turns:turn.example.com:5349","username":"<username>","credential":"<credential>"}]
```
При настроенном TURN медиа может идти через этот внешний сервис, но не через шлюз WebSpeak. Без TURN используются только прямые ICE-пути и STUN.
### Кроссплатформенная P2P-трансляция экрана
Пользователи браузера и нативные клиенты TeamSpeak 6 могут обнаруживать, запускать и смотреть трансляции друг друга. Между браузерами, а также между браузером и нативным клиентом, экран передаётся по прямому соединению WebRTC/ICE, когда это возможно; WebSpeak отвечает за авторизацию сессии, состояние трансляции и передачу SDP/ICE-сигналов, но не переносит медиаданные экрана. Интерфейс показывает статус трансляции и число зрителей и предоставляет регулировку громкости, полноэкранный режим и выход. Для захвата доступны настройки до 1080p и 60 FPS, а также статистика WebRTC.
### Ретрансляторы
Ретранслятор передаёт только TeamSpeak-трафик текущей сессии и не является VPN. В панели администратора добавьте один или несколько узлов, задайте имя, адрес и токен. Пользователь сможет выбрать прямое подключение или настроенный ретранслятор. Режим ретранслятора запускается отдельно и не предоставляет страницу посетителя или панель администратора.
Сервис ретрансляции встроен в WebSpeak и использует стандартные библиотеки Node.js; GOST, sing-box и другие прокси-фреймворки не требуются. WebRTC использует [werift](https://github.com/shinyoshiaki/werift-webrtc), а TeamSpeak — поддерживаемый проектом [SDK EchoSixHIYA/teamspeak-js](https://github.com/EchoSixHIYA/teamspeak-js).
## 🚀 Развертывание
Compose использует `network_mode: host` и рассчитан на Linux-хосты Docker. Для сервера Windows используйте пакет Release.
| Способ | Подходит для |
| --- | --- |
@@ -99,25 +98,172 @@ docker compose up -d
После запуска откройте `http://<ваш-хост>:3040/admin`, войдите с `admin` / `admin`, сразу смените пароль и настройте TeamSpeak. Данные хранятся в volume `webspeak-data`. Не используйте `docker compose down -v`, если не хотите удалить базу и настройки.
```bash
docker compose ps
docker compose logs -f webspeak
```
Обновление с сохранением данных:
```bash
git pull --ff-only
docker compose pull
docker compose up -d
```
### Пакет Release
Скачайте подходящий пакет Windows x64 или Linux x64 из [Releases](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest), распакуйте в отдельную папку и запустите `start-webspeak.cmd` или `./start-webspeak.sh`.
Скачайте подходящий пакет `windows-x64.zip`, `linux-x64.tar.gz` или `linux-arm64.tar.gz` из [Releases](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) и запустите приложенный скрипт. Docker поддерживает amd64/arm64. Также доступны Android APK для `arm64-v8a`, `armeabi-v7a` и `x86_64`; они подписаны отладочным ключом для ручной установки и тестирования, а не для Google Play. Голос TeamSpeak на реальных устройствах пока не проверен.
### Из исходников
```bash
git clone https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
npm ci --ignore-scripts
npm run prepare:sdk
npm rebuild @discordjs/opus --foreground-scripts
npm --prefix web ci
npm --prefix web run build
npm run web:build
npm run build
npm start
```
## ⚠️ Требования и замечания
Для сборки нужны Node.js `>=22.12`, Python, Make и компилятор C/C++.
- Node.js `>=22.5` нужен для сборки из исходников; Docker и Release уже содержат необходимые компоненты.
### Первый запуск
1. Откройте `http://<your-host>:3040/admin`.
2. Войдите с `admin` / `admin` и сразу задайте новый пароль длиной не менее 12 символов.
3. В разделе **Сервер** настройте цель, например `voice.example.com#9987`, и режим доступа.
4. Для публичного доступа настройте HTTPS; при включении WebRTC откройте весь указанный диапазон UDP.
### HTTPS и постоянные данные
Публичную страницу и WebSocket следует предоставлять по HTTPS. Например, направьте свой домен на хост и настройте Caddy как обратный прокси:
```caddyfile
webspeak.example.com {
reverse_proxy 127.0.0.1:3040
}
```
Замените домен примера своим. Рабочий обратный прокси или Tunnel не гарантирует доступность UDP-медиа; см. [расширенные настройки](#advanced). Пакеты и исходники используют `data/`, Docker — volume `webspeak-data`. При переносе и резервном копировании сохраняйте вместе `webspeak.db` и соответствующий `master.key`.
<a id="administration"></a>
## Панель администратора
Откройте `/admin` для управления серверами, доступом, WebRTC, ретрансляторами, приглашениями, активными сессиями, журналами и резервными копиями. Магазин скинов: `/admin/skins`; магазин функциональных плагинов: `/admin/plugins`.
### Необязательное управление TeamSpeak
Панель WebSpeak и голосовые соединения работают независимо от этой функции. В режиме фиксированного сервера откройте `/admin/ts-admin` для настройки управления TS.
1. Включите WebQuery на сервере TS и попросите уполномоченного администратора TS создать API-ключ. Укажите HTTP/HTTPS-адрес WebQuery и ключ. Это Query-служба TS, а не сайт WebSpeak. Поддерживаются TS3 начиная с 3.12 и TS6.
2. ID виртуального сервера `0` выбирает сервер по голосовому порту фиксированной цели. Для ограниченного ключа укажите разрешённый ID. Ключ чтения позволяет просматривать данные; изменения требуют области с правом записи и соответствующих прав TS.
3. Можно выбрать ServerQuery SSH или ServerQuery TCP для TS3. Укажите Query-хост (пустое поле использует фиксированную цель), порт, имя пользователя и пароль; SSH также требует доверенный отпечаток ключа хоста. Это не SSH-вход в операционную систему. TCP не шифруется и подходит только для доверенных сетей. HTTPS-сертификат должен быть доверенным для шлюза.
4. Сохраните и подключитесь или обновите данные. Доступны настройки сервера, управление каналами, перемещение/исключение/блокировка участников, назначение групп и снятие блокировок. Действия требуют подтверждения и проверяются TS; списки обновляются вручную.
Учётные данные хранятся на сервере в зашифрованном виде и не возвращаются API. Сохраняйте базу данных вместе с `master.key`. Ошибка управления не влияет на панель WebSpeak и голос. Блокировка по UID не затрагивает других пользователей с общим IP шлюза.
<a id="advanced"></a>
## Расширенные настройки
### WebRTC
Включается в **Панель администратора → Сервер → Расширенные настройки**. До включения задайте диапазон UDP-портов (по умолчанию `40000–40099`), откройте его в firewall и сохраните. При включённом WebRTC диапазон заблокирован; новые подключения используют WebRTC, а неподдерживаемые браузеры переходят на совместимый транспорт. Для публичного доступа нужен HTTPS.
### Голосовой WebRTC за обратным прокси или TCP Tunnel
В **Сервер → Расширенные настройки** задайте **публичный адрес медиа**: доступный по UDP IP или домен голосового шлюза без схемы, пути и порта. Он заменяет адрес, определяемый по запросу страницы. Домен прокси не обязательно доступен для медиатрафика.
**IPv6-кандидаты** включаются отдельно и сохраняют IPv4; необходимы маршрутизация IPv6 и правила firewall. В поле **голосовой STUN** можно указать `stun:turn.teamspeak.com:3478`: браузер и шлюз используют один сервис. Пустое поле сохраняет прежнее поведение: встроенный STUN библиотеки шлюза и отсутствие STUN в браузере. Поле принимает доступный по IPv4 UDP STUN с доменом или IPv4, но не IPv6-литералы и не учётные данные TURN.
Сохраните настройки и подключитесь заново. Доступность страницы и WebSocket не означает доступность UDP-медиа. Откройте весь диапазон UDP и сохраняйте номера портов при статическом пробросе. STUN обнаруживает отображения адресов, но не ретранслирует звук и не гарантирует прохождение любого NAT.
Для мобильных сетей или при блокировке UDP можно настроить внешний TURN как необязательный резерв в разделе **Панель администратора → Сервер → Голос**: укажите TURN REST URL, общий секрет и срок действия учётных данных. Эквивалентные переменные окружения — `WEBSPEAK_TURN_REST_URLS` и `WEBSPEAK_TURN_REST_SECRET`. Значения из консоли имеют приоритет и применяются к новым соединениям без перезапуска. `WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY=all` сначала пытается использовать прямой UDP.
`WEBSPEAK_VOICE_PROFILE` по умолчанию имеет значение `auto`: адаптивный буфер используется только для запросов через доверенный прокси Cloudflare; прямые и другие запросы сохраняют прежний путь с окном 80 мс и сырым PCM. Локальные подключения Tunnel доверены по умолчанию; если cloudflared подключается с другого адреса, задайте `WEBSPEAK_TRUSTED_PROXIES`. Чтобы использовать адаптивный режим и при прямом подключении, выберите `adaptive` явно или задайте его в разделе «Голос». Opus через WebSocket по умолчанию выключен и требует адаптивного профиля; включите его в разделе «Голос» или через `WEBSPEAK_VOICE_OPUS_WS=1`. Если ни прямой UDP, ни TURN не даёт медиапуть, сессия сообщает `NO_MEDIA_PATH` и использует совместимый транспорт. Подробности: [`CLOUDFLARE_TUNNEL_VOICE.md`](CLOUDFLARE_TUNNEL_VOICE.md).
### ICE для демонстрации экрана
Медиа демонстрации экрана по-прежнему предпочитает прямое соединение между браузерами; WebSpeak только передаёт сигнальные сообщения. По умолчанию используются публичные STUN-серверы TeamSpeak для поиска внешних кандидатов, STUN не передаёт медиаданные. Авторизованный внешний TURN можно задать через `WEBSPEAK_SCREEN_SHARE_ICE_SERVERS` в виде JSON-массива, например:
```json
[{"urls":"stun:turn.teamspeak.com:3478"},{"urls":"turns:turn.example.com:5349","username":"<username>","credential":"<credential>"}]
```
При настроенном TURN медиа может идти через этот внешний сервис, но не через шлюз WebSpeak. Без TURN используются только прямые ICE-пути и STUN.
### Кроссплатформенная P2P-трансляция экрана
Пользователи браузера и нативные клиенты TeamSpeak 6 могут обнаруживать, запускать и смотреть трансляции друг друга. Между браузерами, а также между браузером и нативным клиентом, экран передаётся по прямому соединению WebRTC/ICE, когда это возможно; WebSpeak отвечает за авторизацию сессии, состояние трансляции и передачу SDP/ICE-сигналов, но не переносит медиаданные экрана. Интерфейс показывает статус трансляции и число зрителей и предоставляет регулировку громкости, полноэкранный режим и выход. Для захвата доступны настройки до 1080p и 60 FPS, а также статистика WebRTC.
### Ретрансляторы
Входной шлюз выдаёт подписанный одноразовый билет, после чего браузер подключается прямо к голосовому шлюзу ретранслятора, а тот — к TeamSpeak. URL страницы остаётся прежним. Узел не предоставляет главную страницу и панель администратора.
<details>
<summary>Запуск и настройка ретранслятора</summary>
```bash
docker run -d --name webspeak-relay --restart unless-stopped --network host \
-e WEBSPEAK_MODE=relay \
-e WEBSPEAK_RELAY_TOKEN='replace-with-a-long-random-token' \
-e WEBSPEAK_RELAY_PORT='39087' \
-e WEBSPEAK_RELAY_WEBRTC_PUBLIC_HOST='relay.example.com' \
ghcr.io/echosixhiya/webspeak:latest
```
Используйте случайный общий токен длиной не менее 16 символов. Голосовой шлюз слушает `127.0.0.1:3041`; направьте на него HTTPS/WSS-домен через Caddy:
```caddyfile
relay.example.com {
reverse_proxy 127.0.0.1:3041
}
```
В **Сервер → Ретрансляторы** входного экземпляра задайте имя, UDP-адрес `relay.example.com#39087`, голосовой адрес `https://relay.example.com` и тот же токен. После сохранения посетитель выбирает прямое подключение или узел. Откройте UDP `39087` и WebRTC `40000–40099`; публичный адрес медиа должен разрешаться непосредственно в доступный ретранслятор, а не в HTTP-прокси.
Для запуска из исходников или пакета задайте те же переменные. После сборки выполните `node dist/index.js`, а в пакете — `./runtime/node ./dist/index.js` (Windows: `.\runtime\node.exe .\dist\index.js`).
</details>
### Зависимости
Ретранслятор встроен в WebSpeak и использует стандартные библиотеки Node.js. WebRTC использует [werift](https://github.com/shinyoshiaki/werift-webrtc) `0.24.4`. TeamSpeak использует upstream [HoneyBBQ/teamspeak-js](https://github.com/HoneyBBQ/teamspeak-js), пакет `@honeybbq/teamspeak@1.0.0-beta.23`; сборка форка не нужна.
<a id="extensions"></a>
## Скины и функциональные плагины
### Пакеты скинов `.wskin`
Скины задают оформление, компоновку и связанные виджеты. Администратор устанавливает, включает и выбирает скин по умолчанию. Авторы используют публичный интерфейс без изменения исходников WebSpeak.
[Руководство](./SKIN_DEVELOPMENT.md) · [Agent Skill](../.agents/skills/webspeak-skin-development/SKILL.md) · [Каталог скинов](https://github.com/Huddle-Up-Forge/webspeak-skins) · [Пример Discord Voice](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice)
### Функциональные плагины `.wplugin`
Функциональные плагины — самостоятельные приложения с API браузера, необязательными сервисами Node, своими маршрутами, данными и совместной работой. Администратор проверяет код и зависимости перед включением; обновления требуют повторного доверия. Приложения работают на отдельном источнике в области TS-сервера или экземпляра. API v2 доступен начиная с v0.3.0.
[Руководство](./PLUGIN_DEVELOPMENT.md) · [Agent Skill](../.agents/skills/webspeak-plugin-development/SKILL.md) · [Каталог распространения и пример](https://github.com/Huddle-Up-Forge/webspeak-plugin)
<a id="troubleshooting"></a>
## Решение проблем
| Проблема | Что проверить |
| --- | --- |
| WebRTC включён, но используется резервный транспорт | Код ошибки голосового статуса, HTTPS, весь диапазон UDP и публичный адрес медиа. TCP Tunnel не переносит этот UDP-трафик. |
| Цель заблокирована как локальный адрес | Открытый режим ограничивает loopback и частные адреса. Для TS на том же хосте используйте настроенный администратором режим фиксированного сервера. |
| Тайм-аут или чёрный экран трансляции | Экран использует отдельное WebRTC-соединение. Проверьте согласование, ICE и кодек в статистике трансляции; работающий голос не подтверждает доступность видео. |
| После обновления нет данных или они не расшифровываются | Используйте прежний каталог/volume и соответствующий `master.key`. Не обновляйте через `docker compose down -v`. |
### ⚠️ Требования и замечания
- Node.js `>=22.12` нужен для сборки из исходников; Docker и Release уже содержат необходимые компоненты.
- Нужен современный Chrome, Edge или другой браузер с WebRTC. Микрофон и звук окна обычно требуют HTTPS.
- WebSpeak должен иметь доступ к TeamSpeak; стандартный голосовой порт — `9987`.
- Веб-сервис использует `3040/TCP`; для публичного сайта направьте HTTPS и WebSocket через обратный прокси.
@@ -125,26 +271,216 @@ npm start
- Одна сохранённая браузерная идентичность может использоваться только одним активным подключением.
- Фоновая музыка доступна только на компьютере и требует WebRTC.
- WebRTC использует UDP `40000–40099` по умолчанию; откройте весь диапазон. Для смены диапазона сначала выключите WebRTC и сохраните.
- Лимит приложения — 100 активных браузерных сессий на экземпляр; это не гарантия производительности и не лимит лицензии TS.
<a id="changelog"></a>
## История изменений
<a id="latest-release-notes"></a>
### [v0.3.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.3) · 2026-11-26
**Главное: проверка стабильных версий и установка обновлений из консоли администратора.**
- Консоль проверяет официальные GitHub Releases; администратор выбирает версию и подтверждает установку после проверки SHA-256. Установка пока поддерживается для официальных пакетов Linux x64, запущенных в переднем плане. Windows, Linux arm64, Docker, исходники и экземпляры под управлением systemd, PM2 или Supervisor могут проверять версии и открывать примечания; установка остаётся ручной.
- Заменяются только файлы программы. `data/`, `config.json`, `certs/`, установленные скины и плагины сохраняются. Перезапуск ненадолго отключает голосовые сеансы и консоль. SHA256SUMS.txt — контрольная сумма целостности, а не цифровая подпись.
- Усилены проверка работоспособности, откат и восстановление запуска после прерванного обновления. Восстановление использует общую блокировку с обновлением, чтобы повторный запуск не откатывал активную установку. При превышении лимита, ошибке записи или отмене запросы прерываются, потоки освобождаются, параллельная загрузка отменяется.
- Скины могут размещать элементы восстановления в объявленных слотах и оформлять элементы хоста через защищённые переменные. При непригодном оформлении используются стандартные расположение и цвета. Улучшены обход перекрытий, проверка элементов под уведомлениями, поздняя загрузка скинов и совместимость анимаций; сочетания клавиш восстановления сохранены.
- Включены #60, #61, #62 и последующие исправления, обновлены руководство и примеры скинов. Спасибо OddTurtleHead.
**Переход:** v0.3.2 и более ранние версии сначала обновляются до v0.3.3 вручную. После этого поддерживаемые установки могут получать следующие стабильные версии через консоль. Сделайте резервную копию. Docker: `docker compose pull && docker compose up -d` с сохранением тома данных. Управляемую службу остановите перед заменой файлов, затем запустите снова.
Проверено: 1102 автоматических теста, сборки фронтенда и бэкенда, проверка запуска Docker.
### [v0.3.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.2) · 2026-11-14
- Сторонние темы могут оформлять декоративные элементы. WebSpeak управляет восстановлением и разрешениями, чтобы пользователи могли вернуться к встроенной теме. Спасибо ph1gros за определение TS3 и сведения о совместимости (#46), а OddTurtleHead за оформление интерфейса и восстановление темы (#57).
- Дневная, ночная и ILLUSIA открывают библиотеку из верхней панели. В KAAK 3.1.134 кнопка расположена на крайней левой панели и совпадает по размеру с соседними. Закреплённые приложения отображаются первыми.
- В управлении плагинами появились редактор полей, формы для передачи файлов P2P, совместного просмотра и TSMusicBot, а также ссылки на репозитории.
- Магазины допускают различия в отображаемых данных. SHA-256, формат пакета и поля, необходимые для установки или запуска, проверяются.
- Руководства и Agent Skills обновлены с учётом размещения кнопки, полей настройки и отдельного HTTPS-адреса для публичных плагинов.
### [v0.3.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.1) · 2026-11-13
- При воспроизведении через WebSocket учитываются каналы Opus и фактическая длительность пакета. Микшер WebRTC сохраняет стерео. См. #54.
- Доступны три уровня шумоподавления: выключено, стандартное и усиленное. Усиленный режим сочетает обработку браузера и RNNoise. См. #53.
- Панель состояния голоса экспортирует последние две минуты диагностики шлюза, голоса и микрофона. Запись в фоне зависит от браузера и ОС. См. #49 и #55.
- Кнопка плагинов перенесена на панель инструментов голосового пространства. Администраторы могут закреплять ярлыки плагинов. См. #56.
- Добавлены личные приглашения с ограниченным сроком действия и восстановлена страница приветствия KAAK. Исправлено перекрытие меню скинов в демо и преждевременное истечение времени загрузки больших скинов. В README добавлены снимки пяти скинов.
### [v0.3.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.0) · 2026-11-03
#### Приложения-плагины
- Выпущен API v2 для самостоятельных браузерных приложений и необязательных Node-бэкендов со своими маршрутами, состоянием, обменом данными и логикой.
- Установка через магазин GitHub или локальные `.wplugin`. Администратор проверяет приложения, задаёт публичные/закрытые настройки и включает их; обновление требует повторного подтверждения доверия.
- Добавлены независимые от темы плавающий вход и библиотека приложений. Окна можно перемещать, изменять в размере, сворачивать и разворачивать; сворачивание и возврат в библиотеку не перезагружают приложение.
- Добавлены шаблон, руководство и Agent Skill. P2P-передача файлов и совместный просмотр видео распространяются в отдельных репозиториях.
#### Темы и разрешение
- При первом входе запрашивается единое разрешение для сторонних тем и плагинов экземпляра, без учётных данных подключения. Последний пункт меню тем позволяет изменить решение.
- Без согласия доступны только дневная, ночная и ILLUSIA; KAAK, другие сторонние темы и вход в плагины скрыты. Отзыв разрешения возвращает встроенную тему, отменяет загрузки и останавливает связанные компоненты и страницы приложений.
- Сохраняются права манифеста, фильтрация данных, проверка хешей и действий хоста. Проверка и доверие администратора остаются отдельными.
#### Исправления и обновления
- Исправлено отсутствие ответа нативного TS-клиента на offer только с видео при показе окна, всего экрана или без звука. Добавляется необходимая аудиосекция без захвата микрофона и создания звука. Пользователь подтвердил изображение при показе окна и экрана.
- SDK обновлён до `@honeybbq/teamspeak@1.0.0-beta.23`; учтены необязательные поля участников и пустые пакеты конца речи.
- Включены исправления TSDNS, повторов Query при ограничении частоты, передачи файлов и завершения соединений из upstream.
- Включены исправления проверки IPv6-целей, параллельных входов, отзыва сеансов после смены пароля, ограничений через доверенные прокси и защиты PCM-входа.
- Сохранено исправление первой загрузки темы с фактической версией сборки. Версии приложения для настольных платформ, веба и Android согласованы.
#### Обновление
- API v2 несовместим с пакетами v1. Обновите приложения, проверьте и включите их заново.
- Для публичных плагинов нужен отдельный HTTPS-origin, настроенный в панели администратора и направленный на порт среды выполнения (по умолчанию `3042`). Основной сайт и приложения не должны использовать один origin.
- Пользователю нужно заново выбрать разрешение для экземпляра; старые разрешения отдельных тем не считаются согласием.
### [v0.2.9](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.9) · 2026-10-24
#### Новые возможности
- Переход на upstream SDK 1.0.0-beta.19. Обычные голосовые подключения используют актуальный каталог клиентов без разрешений Query на получение списков.
- Добавлен магазин скинов GitHub с установкой, обновлением и управлением доступностью для экземпляра. Discord Voice распространяется отдельно как стандартный пример `.wskin`.
- В режиме фиксированного сервера доступна необязательная панель TS: учётные данные WebQuery, TCP или SSH Query позволяют управлять сервером, каналами, участниками, серверными группами и блокировками.
- Ретрансляторы могут предоставлять браузеру прямую голосовую точку подключения и обслуживать голосовую сессию без лишнего перехода через основной шлюз.
- Добавлены общие интерфейсы сохранения рабочего пространства и переподключения; KAAK использует их и предлагает вход в администрирование, GitHub проекта и группу QQ.
- Поддержаны разделители каналов TeamSpeak: выравнивание, повторяемое заполнение, пустые строки и стандартные линии. Данные оформления доступны скинам.
#### Исправления
- Исправлены размер полноэкранного показа экрана и очистка состояния и ресурсов воспроизведения ушедших участников.
- Успешная блокировка больше не отображается как ошибка; Query-подключения исключены из числа участников, исправлена подпись пароля канала.
- Разделены ошибки разрешений, ограничения частоты и тайм-аута. Ошибка обновления после успешной операции показывается отдельно, чтобы избежать повторного выполнения.
- Добавлена защита от ошибочного распознавания SDK неуспешных HTTP-ответов как успешных результатов WebQuery; исправлена компоновка DC на главной странице, в чате и на узких экранах.
#### Известные проблемы
- Усиление безопасности из [PR #48](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/48) не вошло в выпуск; закрытие PR не означает исправления описанных проблем.
<details>
<summary>Показать v0.2.8 и более ранние версии</summary>
### [v0.2.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.8) · 2026-10-17
#### Демонстрация экрана и стабильность соединения
- Исправлены согласование соединения и обработка видеопотока при демонстрации экрана между браузерами и нативными клиентами TeamSpeak.
- Улучшена обработка быстрых переключений каналов, чтобы избежать несогласованного состояния клиента.
- Исправлено отображение содержимого некоторых компонентов скинов и локализации KAAK.
#### Улучшения интерфейса
- Названия аудиоустройств теперь отображаются полностью и переносятся при нехватке места, чтобы длинные названия было легче различать.
- Исправлено случайное выделение текста-заглушки аватара.
### [v0.2.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.7) · 2026-10-13
#### Более открытая система скинов
- Более открытый редактор и среда выполнения скинов позволяют настраивать стиль и расположение любых компонентов, а также добавлять виджеты.
- Откройте голосовую панель, затем в том же браузере откройте новое окно панели администратора и войдите в систему, чтобы активировать редактор скинов.
- Скин KAAK включён в комплект как пример для разработки.
- Обновлён Agent Skill по разработке скинов.
#### Улучшения функций
- Добавлено разрешение серверных адресов через записи SRV и записи TeamSpeak Nickname.
- В свободном режиме можно управлять вкладками нескольких серверов; эти кнопки недоступны в режиме фиксированного сервера.
- Добавлен выбор битрейта демонстрации экрана.
- WebSpeak теперь сохраняет введённые пароли каналов в браузере.
- Перед закрытыми паролем каналами отображается значок замка.
- История чата теперь хранится постоянно.
#### Исправления ошибок
- Исправлена ошибка разбора адресов.
- Устранён конфликт фокуса между регулировкой громкости и перетаскиванием карточек участников.
- Исправлена ошибочная классификация состояния пользователя как неизвестного.
### [v0.2.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.6) · 2026-10-08
Относительно 0.2.5 масштабно перестроены голосовой шлюз, общие протоколы, голосовая область и модули администратора; исправлены #6/#7/#10, реализованы #9/#12 и случай с обнаружением уже активной демонстрации TS6 из PR #13. Улучшены Opus, жизненные циклы сессий и мобильное управление. Пакеты: Windows x64, Linux x64/ARM64, Docker amd64/arm64, Android arm64-v8a/armeabi-v7a/x86_64.
### [v0.2.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.5) · 2026-09-27
Добавлены скины `.wskin`, управление включением и темой по умолчанию, а также защищённые темы «День», «Ночь» и ILLUSIA; удалён незавершённый пример Aurora Voice, исправлены мерцание при загрузке скина, контраст элементов в тёмном режиме и слои иллюстраций в голосовом пространстве; добавлен официальный Agent Skill для разработки скинов.
### [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) · 2026-09-22
Добавлена кроссплатформенная P2P-трансляция экрана между браузерами и нативными клиентами TeamSpeak 6; добавлены настройка STUN/внешнего TURN, проигрыватель и состояние зрителей, захват до 1080p/60 FPS и статистика WebRTC; улучшено управление трансляцией и добавлен номер посетителя.
### [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) · 2026-09-19
Добавлены управление перемещением участников и прямое перемещение с учётом прав; поддержаны аватары, синхронизация микрофона и восстановление идентичности; обновлены скриншоты и документация для пяти языков.
### [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) · 2026-09-17
Добавлены браузерное шумоподавление микрофона, русский и японский интерфейсы и отдельные тексты приветствия; улучшены управление громкостью и сообщения/коды ошибок на основе PR #2.
### [v0.2.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.1) · 2026-09-13
Улучшены ошибки на странице входа и добавлена поддержка IPv6-целей по умолчанию.
### [v0.2.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.0) · 2026-09-10
Добавлены подсказки пароля, режим ретранслятора, выбор нескольких узлов и диагностика подключений.
### [v0.1.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.8) · 2026-09-08
Упрощён Docker-запуск, добавлен тайм-аут подключения 15 секунд и непрерывный сетевой мониторинг.
### [v0.1.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.7) · 2026-09-06
Добавлены немецкий язык, Telegram, панель сетевой статистики и общая громкость; исправлены колебания громкости фоновой музыки.
### [v0.1.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.6) · 2026-09-04
Добавлены передача звука окна/вкладки, напоминание о сохранении идентичности и значок сайта; исправлена индивидуальная громкость в WebRTC.
### [v0.1.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.5) · 2026-09-04
Исправлено сохранение идентичности и улучшено переключение тем.
### [v0.1.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.4) · 2026-09-03
Исправлены WebRTC и чат канала, улучшены панель управления, журналы и мобильная компоновка.
### [v0.1.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.3) · 2026-09-03
Добавлен встроенный WebRTC, заменён TeamSpeak SDK, улучшены синхронизация участников и буферизация голоса.
</details>
<a id="contributors"></a>
## Участники и вклад в проект
<details>
<summary>Показать авторов SDK и вклад через PR</summary>
Список отмечает автора SDK, используемого в основе проекта, вклад через объединённые PR на GitHub и исходные работы, перенесённые в отдельно распространяемые пакеты скинов.
- [HoneyBBQ](https://github.com/HoneyBBQ) — Автор SDK [teamspeak-js (`@honeybbq/teamspeak`)](https://github.com/HoneyBBQ/teamspeak-js), который предоставляет используемый WebSpeak клиент протокола TeamSpeak.
- [ph1gros](https://github.com/ph1gros) — В [PR #48](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/48) сообщил о проблемах безопасности и предложил исправления с регрессионными тестами для проверки IPv6, входа и сессий администратора, лимитов за прокси и PCM-аудио. Исходный патч не объединён напрямую; исправления реализованы заново в `dev`.
- [LainHE](https://github.com/LainHE) — [объединённые PR #2, #8, #28, #31–#35, #37, #38 и #40](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ALainHE): переводы ошибок браузера, масштабирование и компоновка главной страницы, битрейт трансляции и аватары зрителей, проверка целей и восстановление ретранслятора, доверенные прокси, передача ошибок подключения, сообщения об ошибках аудио и освобождение ресурсов при сбоях WebRTC.
- [TimmySheep](https://github.com/TimmySheep) — [объединённые PR #13 и #15–#24](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ATimmySheep): обнаружение активных трансляций TS6, пропорции экрана, мобильное аудио/подсветка экрана/меню скинов, канал в настройках идентичности, PWA/темы, история чата, состояние аудио участников и разрешение микрофона.
- [yichen11818](https://github.com/yichen11818) — [PR #25](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/25) добавил подключение по зарегистрированным именам TeamSpeak с сохранением имени цели; [PR #51](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/51) улучшил сохранение рабочего пространства KAAK и повторное подключение после первого соединения. [PR #27](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/27) и [PR #52](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/52) содержали исходный дизайн и реализацию скина Discord (автор коммитов **yumi**), которые проект WebSpeak перенёс в [отдельно распространяемый скин `.wskin`](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice).
</details>
## Сообщество и проекты
- [QQ-группа](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=yhumUMDD9PmyYFWdXWUb_x7hM5trFQY8&authKey=Pw3HBGT7GwMinTQnuFGfnpf0aRSzXOJKcAiujVP1%2BXMpjheAKrncTRivicBJxpjV&noverify=0&group_code=869500475)
- [Telegram-группа](https://t.me/+8qShpTcuN9A3MWY9)
- [NeteaseTSBot](https://github.com/yichen11818/NeteaseTSBot) — музыкальный бот для TeamSpeak с веб-консолью.
[GitHub Issues](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/issues) · [QQ-группа 869500475](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=yhumUMDD9PmyYFWdXWUb_x7hM5trFQY8&authKey=Pw3HBGT7GwMinTQnuFGfnpf0aRSzXOJKcAiujVP1%2BXMpjheAKrncTRivicBJxpjV&noverify=0&group_code=869500475) · [Telegram](https://t.me/+8qShpTcuN9A3MWY9)
## 🧾 История изменений
| Версия | Изменения |
| --- | --- |
| 0.2.5-preview | 2026-09-27 | Добавлены скины `.wskin`, управление включением и темой по умолчанию, а также защищённые темы «День», «Ночь» и ILLUSIA; удалён незавершённый пример Aurora Voice, исправлены мерцание при загрузке скина, контраст элементов в тёмном режиме и слои иллюстраций в голосовом пространстве; добавлен официальный Agent Skill для разработки скинов. |
| [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) | Добавлена кроссплатформенная P2P-трансляция экрана между браузерами и нативными клиентами TeamSpeak 6; добавлены настройка STUN/внешнего TURN, проигрыватель и состояние зрителей, захват до 1080p/60 FPS и статистика WebRTC; улучшено управление трансляцией и добавлен номер посетителя. |
| [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) | Добавлены управление перемещением участников и прямое перемещение с учётом прав; поддержаны аватары, синхронизация микрофона и восстановление идентичности; обновлены скриншоты и документация для пяти языков. |
| [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) | Добавлены браузерное шумоподавление микрофона, русский и японский интерфейсы и отдельные тексты приветствия; улучшены управление громкостью и сообщения/коды ошибок на основе PR #2. |
| [v0.2.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.1) | Улучшены ошибки на странице входа и добавлена поддержка IPv6-целей по умолчанию. |
| [v0.2.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.0) | Добавлены подсказки пароля, режим ретранслятора, выбор нескольких узлов и диагностика подключений. |
| [v0.1.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.8) | Упрощён Docker-запуск, добавлен тайм-аут подключения 15 секунд и непрерывный сетевой мониторинг. |
Полная история находится в [CHANGELOG.md](../CHANGELOG.md).
[NeteaseTSBot](https://github.com/yichen11818/NeteaseTSBot) — музыкальный бот TeamSpeak с поддержкой разных платформ и веб-консолью.
## Лицензия
WebSpeak распространяется по [GNU Affero General Public License v3.0 only](../LICENSE).
WebSpeak распространяется по [AGPL-3.0-only](../LICENSE). Лицензии и авторство сторонних зависимостей указаны в соответствующих проектах.
<p align="right"><a href="#readme-top">Наверх ↑</a></p>
+443 -110
View File
@@ -1,59 +1,205 @@
# WebSpeak · 简体中文
<a id="readme-top"></a>
[返回项目首页](../README.md) · [English](./README.en.md) · [Deutsch](./README.de.md) · [Русский](./README.ru.md) · [日本語](./README.ja.md)
<div align="center">
<img src="./assets/webspeak-logo.png" alt="WebSpeak" width="88" />
<h1>WebSpeak · 简体中文</h1>
<p><strong>打开浏览器,就能加入你的 TeamSpeak。</strong></p>
<p><a href="../README.md">项目首页</a> · <a href="./README.en.md">English</a> · <a href="./README.de.md">Deutsch</a> · <a href="./README.ru.md">Русский</a> · <a href="./README.ja.md">日本語</a></p>
<p>
<a href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest"><img src="https://img.shields.io/github/v/release/EchoSixHIYA/WebSpeak-client-for-TeamSpeak?style=flat-square&amp;color=0f766e" alt="Release" /></a>
<a href="../LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--only-0f766e?style=flat-square" alt="AGPL-3.0-only" /></a>
</p>
</div>
WebSpeak 是一个可自行部署的 TeamSpeak 3 / TeamSpeak 6 网页客户端与语音网关。用户无需安装桌面客户端即可从浏览器加入频道,管理员可以在控制台管理目标服务器、访问方式和运行状态。
WebSpeak 是可自行部署的 TeamSpeak 3 / TeamSpeak 6 网页客户端与语音网关。用户通过浏览器加入语音、聊天和屏幕共享;部署者通过管理员控制台管理目标服务器、访问策略和数据。
## 在线 Demo
稳定版:[v0.3.3 更新日志](#latest-release-notes) · [下载发布包](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) · 控制台一键更新、升级恢复与皮肤兼容性改进。
地址:<https://webspeak.example.invalid>
公共 Demo 位于香港,网络和负载可能不稳定。延迟、断线或暂时不可用不代表自行部署后的实际表现。
## ✨ 特性
[在线演示](#demo) · [功能](#features) · [界面预览](#screenshots) · [部署](#deployment) · [管理](#administration) · [高级配置](#advanced) · [皮肤与插件](#extensions) · [常见问题](#troubleshooting) · [更新日志](#changelog)
<a id="demo"></a>
## 在线演示
- [上海 · shanghai.webspeak.online](https://shanghai.webspeak.online)
- [香港 · webspeak.online](https://webspeak.online)
可直接体验欢迎页与语音工作区。演示节点的网络、负载和可用性会变化。
<a id="features"></a>
## 主要功能
| 能力 | 说明 |
| --- | --- |
| TeamSpeak 兼容 | 支持 TeamSpeak 3 与 TeamSpeak 6,并自动探测目标服务器协议。 |
| 跨端 P2P 屏幕共享 | 支持浏览器用户与 TeamSpeak 6 原生客户端互相发起和观看屏幕共享;媒体优先通过 WebRTC/ICE 直连,WebSpeak 仅转发协商信令。 |
| IPv6 目标 | 默认支持 IPv6 TeamSpeak 目标和域名解析出的 IPv6 地址。 |
| 频道与成员 | 浏览频道树、查看实时成员状态并切换频道。 |
| 实时语音 | 使用 Opus,支持兼容传输和可选的内置 WebRTC 低延迟传输。 |
| 音频控制 | 选择麦克风与扬声器、调节音量、测试麦克风、闭麦、VOX 和成员独立音量。 |
| 浏览器端降噪 | 提供可开关的麦克风降噪,在浏览器采集端处理,不增加服务器端音频处理压力。 |
| 消息与互动 | 支持频道消息、服务器消息、私聊、戳一戳和耳语目标。 |
| 桌面端伴奏 | 在桌面浏览器选择带音频的窗口或标签页,将声音分享给当前频道。 |
| 身份与访问 | 支持身份保持、访客自定义目标和可撤销、可过期的邀请链接。 |
| 管理控制台 | 管理目标、访问策略、WebRTC、中继、邀请、会话、日志、诊断和备份。 |
| 皮肤 | 提供日间、夜间和 ILLUSIA 三款受保护皮肤,并支持实例自定义 `.wskin` 外观与管理员默认/启用管理。 |
| 界面体验 | 提供中文、English、Deutsch、Русский、日本語及响应式桌面/移动布局。 |
| 自托管 | 数据由部署者保存,提供 Docker、Windows x64 和 Linux x64 方案。 |
| 实时语音 | Opus 音频、可选 WebRTC、兼容 WebSocket 回退;支持闭麦、VOX、设备选择、浏览器降噪和成员独立音量。 |
| 频道与消息 | 频道树、TeamSpeak 频道分隔栏、成员状态、频道切换、频道/服务器/私聊消息、戳一戳、耳语及本地聊天历史。 |
| 屏幕与音频共享 | 浏览器之间及与受支持的 TeamSpeak 6 原生客户端共享屏幕;提供采集质量、码率和统计面板,桌面端还可分享窗口或标签页音频。 |
| 身份与连接 | 身份保持、TS3 身份导入/导出、收藏和历史连接、SRV 与 Nickname 地址解析、IPv4/IPv6 及邀请链接。 |
| 实例管理 | 固定或公开目标、访问策略、邀请、会话、日志、诊断、备份及可选的 TeamSpeak 管理连接。 |
| 皮肤与界面 | 日间、夜间、ILLUSIA 和 KAAK;可通过 GitHub 皮肤商店管理 `.wskin` 包,支持五种语言和响应式布局。 |
| 分布式语音 | 配置中继后,浏览器直接连接所选中继的语音网关,网页地址仍保留在入口实例。 |
| 部署方式 | Docker amd64/arm64、Windows x64 与 Linux x64/ARM64 发布包;另有 Android 预览 APK。 |
## 🖼️ 界面截图
### TeamSpeak 版本兼容性
以下截图展示中文界面的欢迎页、语音工作区、音量控制和成员操作菜单。
语音连接使用标准 TeamSpeak 客户端协议,无需 Query 凭据。可选的 TS 管理功能使用独立的 WebQuery / ServerQuery 凭据。
- **TeamSpeak 3**:协议识别会读取版本号开头的 `3.x`。并非所有历史服务器版本都经过独立验证,部署旧版本时请针对实际服务器进行测试。
- **TeamSpeak 6**:支持,也支持与 TeamSpeak 6 原生客户端进行屏幕共享。
- **自动探测**:网关读取服务器的 `version` 响应并在连接诊断中记录识别到的协议。
- 网关使用上游 [`@honeybbq/teamspeak`](https://github.com/HoneyBBQ/teamspeak-js) `1.0.0-beta.23` SDK;WebSpeak 面向 TeamSpeak 3 和 TeamSpeak 6。
<a id="screenshots"></a>
## 界面预览
![WebSpeak · 语音工作区](./screenshots/webspeak-zh.png)
<details>
<summary>展开欢迎页、音频设置与成员菜单</summary>
### 欢迎页
<p align="center"><img src="./screenshots/webspeak-zh-home.png" alt="WebSpeak 中文欢迎页" width="100%" /></p>
![WebSpeak · 欢迎页](./screenshots/webspeak-zh-home.png)
### 语音工作区
### 音频设置
<p align="center"><img src="./screenshots/webspeak-zh.png" alt="WebSpeak 中文语音工作区" width="100%" /></p>
### 音量控制
<p align="center"><img src="./screenshots/webspeak-zh-audio.png" alt="WebSpeak 中文音量控制" width="100%" /></p>
![WebSpeak · 音频设置](./screenshots/webspeak-zh-audio.png)
### 成员菜单
<p align="center"><img src="./screenshots/webspeak-zh-menu.png" alt="WebSpeak 中文成员菜单" width="100%" /></p>
![WebSpeak · 成员菜单](./screenshots/webspeak-zh-menu.png)
## 🧩 高级功能
</details>
<details>
<summary>展开日间、夜间、ILLUSIA、KAAK 与 Discord Voice 皮肤预览</summary>
以下截图拍摄于已连接的 TeamSpeak 语音房间。
| 日间 | 夜间 |
| --- | --- |
| ![日间皮肤](./screenshots/skin-day.png) | ![夜间皮肤](./screenshots/skin-night.png) |
| ILLUSIA | KAAK |
| --- | --- |
| ![ILLUSIA 皮肤](./screenshots/skin-illusia.png) | ![KAAK 皮肤](./screenshots/skin-kaak.png) |
![Discord Voice 社区皮肤](./screenshots/skin-discord.png)
</details>
<a id="deployment"></a>
## 部署与首次配置
以下 Compose 配置使用 `network_mode: host`,适用于 Linux Docker 主机。Windows 服务端可使用发布包。
| 方案 | 适用场景 | 环境 |
| --- | --- | --- |
| Docker Compose(推荐) | 长期运行、升级简单、数据持久化 | Docker Engine + Docker Compose |
| 发布包 | 不安装 Node.js 和构建依赖 | Windows x64 或 Linux x64/ARM64 |
| 源码运行 | 开发、调试和二次开发 | Node.js 22.12+、Git 和本地编译工具 |
### Docker Compose(推荐)
```bash
git clone --depth 1 https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
docker compose pull
docker compose up -d
```
启动后访问 `http://<你的主机>:3040`。使用反向代理时将上游指向该地址;启用 WebRTC 时放行控制台显示的 UDP 端口范围。数据保存在 `webspeak-data` volume 中。
```bash
docker compose ps
docker compose logs -f webspeak
```
升级在宿主机执行。管理控制台在 Docker 部署中只能检查新版本,不能从容器内部替换镜像:
```bash
git pull --ff-only
docker compose pull
docker compose up -d
```
不要执行 `docker compose down -v`,否则会删除 `webspeak-data` volume,包括数据库和管理员设置。
### 发布包
从 [GitHub Releases](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) 下载与系统和架构匹配的 `windows-x64.zip`、`linux-x64.tar.gz` 或 `linux-arm64.tar.gz`,解压后运行对应启动脚本。发布包自带 Node.js 运行时和生产依赖。Docker 镜像支持 amd64/arm64。
Linux x64 发布包(已按官方 `build-release.yml` 产物形态验证)可以在管理控制台直接升级:控制台只读取官方 GitHub Releases,缺少匹配的 `SHA256SUMS.txt` 条目时拒绝安装,校验通过后仅替换程序代码并重启进程。`SHA256SUMS.txt` 只是 SHA-256 校验和,不是数字签名。`data/`、`config.json`、`certs/`、已安装的皮肤和插件都会保留。开始前建议先导出备份。Windows 发布包可以检查版本,但控制台应用更新尚未经真实 Windows 环境验证,因此已禁用,请下载新包后手动替换。Linux arm64 发布包可以检查版本,但由于原地替换尚未在真实 arm64 硬件验证,控制台应用已禁用;请下载新版发布包后手动替换。Docker 和源码运行不能在控制台应用更新。
控制台安装仅限前台运行的 Linux x64 发布包。通过 systemd、PM2 或 Supervisor 托管的实例仍可检查版本和查看发行说明,但不能在控制台直接安装。请停止服务,替换新发布包中的程序文件后再启动,并保留 `data/`、`config.json` 和 `certs/`。升级助手即使以独立子进程启动,也仍受服务管理器控制。
Release 同时提供 Android `arm64-v8a`、`armeabi-v7a` 和 `x86_64` APK。它们使用 debug 签名,可手动侧载测试;不是 Google Play 发布包,Android 真机语音仍需验收。
### 源码运行
```bash
git clone https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
npm ci --ignore-scripts
npm rebuild @discordjs/opus --foreground-scripts
npm --prefix web ci
npm --prefix web run build
npm run build
npm start
```
构建 `@discordjs/opus` 需要 Python、Make 和 C/C++ 编译工具。
源码运行时,管理控制台可以检查新的正式版本,但目录中没有捆绑的 Node.js 运行时,因此不能一键应用更新。请查看发行说明后拉取源码并重新构建;控制台不会下载或替换源码目录中的文件。
### 首次配置
1. 打开 `http://<你的主机>:3040/admin`。
2. 使用默认账号 `admin` / `admin` 登录,并立即设置至少 12 位的新密码。
3. 在“服务器”页配置 TeamSpeak 目标和访问方式,例如 `voice.example.com#9987`。
4. 公网使用时配置 HTTPS;启用 WebRTC 时放行控制台显示的 UDP 范围。
### HTTPS 与持久化
公网部署应通过 HTTPS 提供网页和 WebSocket。例如,将已解析到主机的域名配置到 Caddy,反向代理到 WebSpeak:
```caddyfile
webspeak.example.com {
reverse_proxy 127.0.0.1:3040
}
```
以上域名仅为配置示例,请替换成自己的域名。网页能通过反向代理或 Tunnel 打开,并不表示 WebRTC 的 UDP 媒体可达;相关配置见[高级配置](#advanced)。发布包和源码的数据默认位于 `data/`,Docker 位于 `webspeak-data` volume;备份和迁移时同时保留 `webspeak.db` 与 `master.key`。
<a id="administration"></a>
## 管理员控制台
实例配置位于 `/admin`:管理服务器与访问策略、WebRTC 与中继、邀请、活动会话、运行日志和备份。皮肤商店位于 `/admin/skins`;功能插件商店位于 `/admin/plugins`。
### 可选的 TeamSpeak 管理
WebSpeak 后台和访客语音不依赖此功能。在固定服务器模式下,打开 `/admin/ts-admin`,可集中配置 TS 管理连接。
1. 在 TS 服务端启用 WebQuery,并由有权限的 TS 管理员创建 API Key。填写 WebQuery 的 HTTP/HTTPS 地址和 API Key;地址指向 TS Query 服务,而非 WebSpeak 网页。支持 TS3(3.12+)和 TS6。
2. 虚拟服务器 ID 填 `0` 时,按固定目标的语音端口选择;受限 Key 应填写其被授权的服务器 ID。只读 Key 可查看,修改需要可写作用域及相应的 TS 权限。
3. 也可选择 ServerQuery SSH 或 TS3 ServerQuery TCP,填写 Query 主机(留空沿用固定目标)、Query 端口、用户名和密码;SSH 还需要可信的主机密钥指纹。这是 TS 的 Query 服务,并非服务器操作系统的 SSH。TCP 不加密,仅适合可信网络;HTTPS 证书须受网关信任。
4. 保存后连接或刷新,可查看服务器、频道、成员、服务器组和封禁,执行服务器设置、频道创建/重命名/删除、成员移动/移出/身份封禁、服务器组分配和解封。操作需确认,由 TS 核验权限;列表手动刷新。
凭据仅加密保存在服务端,接口不返回密码或 API Key;备份时同时保留数据库和 `master.key`。管理连接失败不影响 WebSpeak 后台和普通语音。封禁按 UID 创建,避免误封共用网关 IP 的其他用户。
<a id="advanced"></a>
## 高级配置
高级功能均为可选项;关闭时仍可使用兼容语音传输。配置入口在管理员控制台的“服务器”页,保存后对新连接生效。
### 1. WebRTC 低延迟语音
### WebRTC 低延迟语音
WebRTC 将浏览器语音切换到实时媒体通道,也支持桌面端伴奏。媒体服务由当前 WebSpeak 网关直接提供,不需要另设媒体服务器。
@@ -64,6 +210,18 @@ WebRTC 将浏览器语音切换到实时媒体通道,也支持桌面端伴奏
WebRTC 启用后端口范围会锁定。要修改端口,先关闭 WebRTC 并保存,再修改端口并同步防火墙规则。公网使用还需要 HTTPS。
### 反向代理 / TCP 隧道下的语音 WebRTC
在管理后台的 WebRTC 高级参数中可设置:
- **公网媒体地址**:WebSpeak 网关可被 UDP 直达的 IP 或域名,不含协议、路径或端口。有公网 IP 时优先填它;Cloudflare Tunnel/纯 TCP 入口不要填 CF 代理域名。优先于网页入口推断;留空时按 `Origin`、`X-Forwarded-Host`、`Host` 推断,但 Cloudflare 请求不会再拿 CF 边缘 Host 当媒体地址。域名会解析为 IP 候选。
- **启用 IPv6 候选**:默认关闭;开启后保留 IPv4,同时收集 IPv6。需确保 IPv6 路由及 UDP 防火墙放行。
- **语音 STUN 服务**:可设置 `stun:turn.teamspeak.com:3478`,浏览器和网关使用同一服务发现公网映射。留空保留旧行为:werift 网关仍使用库内置 STUN,浏览器不配置 STUN。当前字段仅支持可通过 IPv4 访问的 UDP STUN 域名或 IPv4 地址,不接受 IPv6 字面量、TURN 或凭据;IPv6 媒体候选独立于 STUN 开关。
保存后重新连接。网页和 WebSocket 经反代可达,不代表媒体 UDP 可达;STUN 仅发现地址,不中继音频,也不保证穿透所有 NAT。应开放配置的整个 UDP 端口范围;静态端口转发需保持相同端口映射。
手机流量或 UDP 被拦时,可配置外部 TURN 作为可选后备:在管理台“服务器 → 语音”填写 TURN REST URL、共享密钥和有效期,或使用 `WEBSPEAK_TURN_REST_URLS`、`WEBSPEAK_TURN_REST_SECRET` 环境变量。控制台保存的配置优先,且不需要重启网关,对新连接生效。默认保持 `WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY=all`,先试直连;只有确认 UDP 完全不可用时才用 `relay`。`WEBSPEAK_VOICE_PROFILE` 默认 `auto`:只有经过可信 Cloudflare 代理的请求才启用自适应 buffer,直连及其他请求继续使用旧 80ms/裸 PCM 行为;本机 Tunnel 连接默认可信,cloudflared 从其他地址连接时需配置 `WEBSPEAK_TRUSTED_PROXIES`。需要直连也启用时显式设 `adaptive`,也可在控制台“语音模式”覆盖。WebSocket Opus 默认关闭,可在“服务器 → 语音”或通过 `WEBSPEAK_VOICE_OPUS_WS=1` 启用,并需使用 `adaptive`。直连 UDP 与 TURN 都无法提供媒体路径时,会话报告 `NO_MEDIA_PATH` 并使用兼容传输。完整部署、验收和回滚见 [`CLOUDFLARE_TUNNEL_VOICE.md`](CLOUDFLARE_TUNNEL_VOICE.md),模板见 `deploy/coturn/` 和 `deploy/cloudflared/`。
### 屏幕共享的 ICE 候选
屏幕共享媒体仍优先走浏览器之间的直连,WebSpeak 只转发协商信令。默认使用 TeamSpeak 官方 STUN 服务发现公网候选地址;STUN 不承载媒体。若部署者有合规的外部 TURN 服务,可在启动 WebSpeak 前设置 `WEBSPEAK_SCREEN_SHARE_ICE_SERVERS`,值为 JSON 数组,例如:
@@ -78,11 +236,14 @@ WebRTC 启用后端口范围会锁定。要修改端口,先关闭 WebRTC 并
浏览器用户与 TeamSpeak 6 原生客户端可以互相发现、发起和观看屏幕共享。浏览器之间以及浏览器与原生客户端之间的屏幕媒体优先通过 WebRTC/ICE 端到端传输;WebSpeak 负责会话鉴权、共享状态和 SDP/ICE 信令转发,不承载屏幕媒体流量。页面提供直播状态、观众人数、播放器音量、全屏和退出控制,也可在共享设置窗口中选择最高 1080p 与 60 FPS,并查看 WebRTC 统计。
### 2. 中继模式
### 中继模式
中继适用于 TeamSpeak 拒绝境外连接或直连不稳定的情况。它不是 VPN,只转发当前 WebSpeak 会话的 TeamSpeak 数据;目标服务器仍由用户在网页中选择。
中继实例是专用转发服务,不提供前台和管理员后台,只接受带匹配令牌的 WebSpeak 网关会话。令牌至少使用 16 个字符的随机值。
中继实例同时运行 UDP 兼容转发和独立语音网关,不提供访客首页或管理员后台。网关收到用户的入场请求后,会用共享令牌签名并转交一次性语音票据;浏览器随后直接连接中继节点,语音网关再从中继节点连接 TeamSpeak。网页地址仍保持在入口网关,不需要跳转。令牌至少使用 16 个字符的随机值。
<details>
<summary>展开中继启动与配置示例</summary>
#### 源码启动
@@ -90,7 +251,7 @@ WebRTC 启用后端口范围会锁定。要修改端口,先关闭 WebRTC 并
git clone --depth 1 https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
npm ci --ignore-scripts
npm run prepare:sdk
npm rebuild @discordjs/opus --foreground-scripts
npm run build
WEBSPEAK_MODE=relay \
WEBSPEAK_RELAY_TOKEN='replace-with-a-long-random-token' \
@@ -136,101 +297,60 @@ docker run -d --name webspeak-relay --restart unless-stopped --network host \
放行中继主机的 UDP 监听端口,默认是 `39087`。
语音网关默认监听 `127.0.0.1:3041`。为中继节点配置 HTTPS 域名,并让 Caddy 等反向代理把该域名转发到 `127.0.0.1:3041`,例如:
```caddyfile
relay.example.com {
reverse_proxy 127.0.0.1:3041
}
```
管理员后台的中继节点设置中,将“语音网关地址”填写为该 HTTPS 源站(例如 `https://relay.example.com`)。网页仍从原入口网关加载,之后会通过 WSS 连接这个中继域名。语音网关默认启用 WebRTC;还需放行 UDP `40000-40099`,并设置 `WEBSPEAK_RELAY_WEBRTC_PUBLIC_HOST` 为可从用户网络直接访问的中继公网 IP 或直连域名。若修改了 WebRTC UDP 范围,同时更新防火墙规则。UDP `39087` 保留给旧版兼容转发。
#### 在网关中启用
1. 管理员控制台 → “服务器” → “中继服务器”,添加一个或多个节点。
2. 为每个节点填写自定义名称、地址(例如 `relay.example.com#39087`)和匹配令牌并保存。
2. 为每个节点填写自定义名称、UDP 地址(例如 `relay.example.com#39087`)、HTTPS 语音网关源站(例如 `https://relay.example.com`)和匹配令牌并保存。
3. 访客欢迎页即可选择直连或其中一个中继。
关闭并保存中继配置后,访客页面不会显示中继选项。
### 3. 依赖与归属
</details>
### 依赖与归属
- 中继服务是 WebSpeak 自带实现,使用 Node.js 标准库,不依赖 GOST、sing-box 或其他代理框架。
- WebRTC 使用 [werift](https://github.com/shinyoshiaki/werift-webrtc) `0.24.4`,上游采用 MIT 许可证。
- TeamSpeak 协议使用项目维护的 [EchoSixHIYA/teamspeak-js](https://github.com/EchoSixHIYA/teamspeak-js) SDK fork。
- TeamSpeak 协议使用上游 [HoneyBBQ/teamspeak-js](https://github.com/HoneyBBQ/teamspeak-js) 发布的 `@honeybbq/teamspeak@1.0.0-beta.23`,无需构建项目 SDK fork。
## 🧾 更新日志
<a id="extensions"></a>
| 版本 | 日期 | 摘要 |
| --- | --- | --- |
| 0.2.5-preview | 2026-09-27 | 新增 `.wskin` 皮肤系统、管理员启用/默认管理和受保护的日间/夜间/ILLUSIA 内置皮肤;移除未完成 Aurora Voice 样例,修复皮肤加载闪烁、暗色控件可读性与语音界面美术层级,并加入官方皮肤开发 Agent Skill。 |
| [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) | 2026-09-22 | 新增浏览器与 TeamSpeak 6 原生客户端之间的跨端 P2P 屏幕共享;提供 STUN/外部 TURN 配置、直播播放器、观众状态、1080p/60 FPS 采集设置和 WebRTC 统计;优化屏幕共享交互并新增访客编号。 |
| [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) | 2026-09-19 | 新增频道成员调度与按权限直接移动;支持头像、静音状态同步和身份恢复;更新五种语言的功能截图与文档。 |
| [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) | 2026-09-17 | 提供浏览器端麦克风降噪、俄语和日语支持及按语言欢迎词配置;优化音量交互和 PR #2 基础上的错误提示与错误代码。 |
| [v0.2.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.1) | 2026-09-13 | 优化首页连接错误显示,保留并安全截断错误代码;默认支持 IPv6 TeamSpeak 目标。 |
| [v0.2.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.0) | 2026-09-10 | 增加服务器密码提示、正式中继部署模式、多中继选择和管理员日志原因显示。 |
| [v0.1.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.8) | 2026-09-08 | 简化 Docker 部署,支持同机 TeamSpeak,增加 15 秒连接超时和持续网络监测。 |
| [v0.1.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.7) | 2026-09-06 | 增加德语、Telegram、网络性能面板和整体音量;修复伴奏音量波动。 |
| [v0.1.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.6) | 2026-09-04 | 增加桌面端伴奏、身份保持提醒和网站图标;修复 WebRTC 成员独立音量。 |
| [v0.1.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.5) | 2026-09-04 | 修复身份保存逻辑并优化主题切换。 |
| [v0.1.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.4) | 2026-09-03 | 修复 WebRTC、频道聊天并优化管理页、日志和移动端布局。 |
| [v0.1.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.3) | 2026-09-03 | 引入内置 WebRTC、迁移 TeamSpeak SDK 并改善成员同步和语音缓冲。 |
## 皮肤与功能插件
完整记录见 [CHANGELOG.md](../CHANGELOG.md)。
### 皮肤包 `.wskin`
## 🚀 部署方案
皮肤包负责外观、布局及其附属小组件。管理员可安装、启用和设置默认皮肤;开发时遵循公开接口,无需修改 WebSpeak 源码。
| 方案 | 适用场景 | 环境 |
| --- | --- | --- |
| Docker Compose(推荐) | 长期运行、升级简单、数据持久化 | Docker Engine + Docker Compose |
| 发布包 | 不安装 Node.js 和构建依赖 | Windows x64 或 Linux x64 |
| 源码运行 | 开发、调试和二次开发 | Node.js 22.5+、Git 和本地编译工具 |
[开发指南](./SKIN_DEVELOPMENT.md) · [Agent Skill](../.agents/skills/webspeak-skin-development/SKILL.md) · [皮肤索引仓库](https://github.com/Huddle-Up-Forge/webspeak-skins) · [Discord Voice 示例](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice) · [宿主顶栏 toolbar 示例](./examples/HOST-CHROME-TOOLBAR.md)
### Docker Compose(推荐)
### 功能插件 `.wplugin`
```bash
git clone --depth 1 https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
docker compose pull
docker compose up -d
```
功能插件是独立应用,使用标准浏览器能力和可选 Node 后端,自行实现路由、状态与协作。管理员审核代码和依赖后启用;更新须重新信任。支持 TS 服务器或实例范围,运行于独立源。v0.3.0 起提供 API v2。
启动后访问 `http://<你的主机>:3040`。使用反向代理时将上游指向该地址;启用 WebRTC 时放行控制台显示的 UDP 端口范围。数据保存在 `webspeak-data` volume 中。
[开发指南](./PLUGIN_DEVELOPMENT.md) · [Agent Skill](../.agents/skills/webspeak-plugin-development/SKILL.md) · [分发索引与示例](https://github.com/Huddle-Up-Forge/webspeak-plugin)
```bash
docker compose ps
docker compose logs -f webspeak
```
<a id="troubleshooting"></a>
升级:
## 常见问题
```bash
git pull --ff-only
docker compose pull
docker compose up -d
```
| 现象 | 检查方向 |
| --- | --- |
| WebRTC 启用后仍回退 | 检查语音状态中的错误代码、HTTPS、整段 UDP 防火墙规则和公网媒体地址。TCP Tunnel 不能转发这条 UDP 媒体路径。 |
| 连接目标被本地地址保护拦截 | 公开模式限制回环和私网目标。连接同机 TS 时使用管理员配置的固定服务器模式;面向访客的目标应填实际可访问的地址。 |
| 屏幕共享超时或黑屏 | 屏幕共享使用独立的 WebRTC 连接;检查共享统计中的协商、ICE 和编码信息。语音 WebRTC 已连接不代表屏幕媒体可达。 |
| 升级后数据丢失或无法解密 | 复用原数据目录或 volume,并保留匹配的 `master.key`;不要用 `docker compose down -v` 升级。 |
不要执行 `docker compose down -v`,否则会删除数据库和管理员设置。
### 发布包
从 [GitHub Releases](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/latest) 下载对应的 `windows-x64.zip` 或 `linux-x64.tar.gz`,解压后运行 Windows 的 `start-webspeak.cmd` 或 Linux 的 `./start-webspeak.sh`。发布包自带 Node.js 运行时和生产依赖。
### 源码运行
```bash
git clone https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
cd WebSpeak-client-for-TeamSpeak
npm ci --ignore-scripts
npm run prepare:sdk
npm rebuild @discordjs/opus --foreground-scripts
npm --prefix web ci
npm --prefix web run build
npm run build
npm start
```
构建 `@discordjs/opus` 需要 Python、Make 和 C/C++ 编译工具。
### 首次配置
1. 打开 `http://<你的主机>:3040/admin`。
2. 使用默认账号 `admin` / `admin` 登录,并立即设置至少 12 位的新密码。
3. 在“服务器”页配置 TeamSpeak 目标和访问方式,例如 `voice.example.com#9987`。
4. 公网使用时配置 HTTPS;启用 WebRTC 时放行控制台显示的 UDP 范围。
## ⚠️ 要求和注意事项
### ⚠️ 要求和注意事项
| 项目 | 要求或注意事项 |
| --- | --- |
@@ -242,4 +362,217 @@ npm start
| 身份保持 | 同一浏览器身份同时只能保持一条活动连接;并行连接请关闭第二条的身份保持或使用其他浏览器配置文件。 |
| 伴奏 | 仅桌面端提供且要求 WebRTC;选择窗口或标签页时还要勾选共享音频。 |
| 数据 | Docker 数据在 `webspeak-data` volume;发布包和源码运行数据在 `data/`。升级前建议备份。 |
| 会话上限 | 单实例最多允许 100 个活动网页会话。 |
| 会话上限 | 单实例最多允许 100 个活动网页会话;这是应用准入上限,不是性能保证或 TS 许可证额度。 |
<a id="changelog"></a>
## 更新日志
<a id="latest-release-notes"></a>
### [v0.3.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.3) · 2026-11-26
**本次重点:管理员控制台新增正式版本检查与一键更新。**
- 管理员可检查官方 GitHub Releases,选择版本并确认安装;下载包必须通过 SHA-256 校验。首期自动安装支持前台运行的 Linux x64 官方发布包。Windows、Linux arm64、Docker、源码,以及 systemd、PM2、Supervisor 托管实例均保留版本检查和发行说明入口,安装仍按各部署方式手动完成。
- 更新仅替换程序文件,保留 `data/`、`config.json`、`certs/` 及已安装的皮肤和插件。安装会重启进程,语音会话和管理页面会短暂断开。SHA256SUMS.txt 是完整性校验和,不是数字签名。
- 加固升级健康检查、失败回滚和断电/进程中断后的启动恢复;恢复流程与更新进程共享锁,防止正常更新被重复启动误回滚。下载超限、写盘失败或取消时会中止请求、释放响应流,并清理并行下载。
- 皮肤可通过声明的布局槽位和受保护样式变量调整恢复入口与宿主控件的外观;不可读或不可用时回退到默认布局和样式。改进浮动入口的遮挡避让、提示消息穿透判断、皮肤延迟加载和动画兼容性,保留恢复快捷键。
- 纳入 #60、#61、#62 及后续维护修复,更新皮肤开发文档和示例。感谢 OddTurtleHead 的贡献。
**升级说明:** v0.3.2 及更早版本请先手动升级到 v0.3.3;之后可在支持的部署中使用控制台安装后续正式版。升级前请备份数据。Docker 使用 `docker compose pull && docker compose up -d` 并保留数据卷;服务托管实例请停止服务、替换程序文件后再启动。
验证:1102 项自动化测试通过,前后端构建及 Docker 启动健康检查通过。
### [v0.3.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.2) · 2026-11-14
<a id="live-update-2026-11-13"></a>
- 第三方皮肤可以为宿主装饰添加样式。恢复入口和授权弹窗由宿主管理,应用皮肤后仍能切回内置皮肤。感谢 ph1gros 对 TS3 版本识别及兼容性文档的贡献(#46),以及 OddTurtleHead 对宿主装饰和皮肤恢复的贡献(#57)。
- 日间、夜间和 ILLUSIA 的应用库在顶部工具栏展开。KAAK 3.1.134 将应用库放入最左侧图标栏,按钮与相邻控件对齐。固定应用排在列表前面。
- 插件后台提供字段编辑器,以及 P2P 文件传输、视频同看和 TSMusicBot 的配置表单。插件页面可以打开对应仓库。
- 皮肤和插件商店允许目录与包内的展示信息有所不同,继续校验 SHA-256、包格式和影响安装或运行的字段。
- 更新皮肤及插件开发指南和 Agent Skill,说明入口布局、配置字段和公网插件所需的独立 HTTPS 地址。
### [v0.3.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.1) · 2026-11-13
- 修复 WebSocket 播放丢失 Opus 声道信息、固定按 20 毫秒处理音频包的问题,并保留 WebRTC 下行混音的立体声。关联 #54。
- 新增关闭、标准和强三档降噪。强档在浏览器降噪基础上使用 RNNoise。关联 #53。
- 语音性能面板可导出最近两分钟的网关、语音和麦克风诊断,帮助定位掉线和后台采音中断。后台采音仍受浏览器和操作系统限制。关联 #49、#55。
- 将插件入口移至语音工作区顶部工具栏,管理员可固定插件快捷入口。关联 #56。
- 支持有有效期的私密工作区邀请,恢复 KAAK 欢迎页,并修复演示页皮肤菜单被遮挡及首次下载较大皮肤时容易超时的问题。README 补齐五款皮肤截图。
### [v0.3.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.3.0) · 2026-11-03
#### 插件系统
- 发布功能插件 API v2:支持独立浏览器应用和可选 Node 后端,作者可自行实现路由、状态、通信和业务逻辑。
- 管理员可通过 GitHub 插件商店或本地 `.wplugin` 包安装应用,配置公开/私密设置并审核启用;更新后需要重新信任。
- 新增独立于皮肤的悬浮入口和应用库。插件窗口支持拖动、调整大小、最小化、最大化与还原,最小化或返回应用库不会重载当前应用。
- 提供应用模板、插件开发指南与 Agent Skill;P2P 文件传输和视频同看通过独立仓库分发。
#### 皮肤与授权
- 首次进入时统一确认当前实例第三方皮肤与插件的授权,不包含连接凭据;皮肤菜单末尾增加“授权”,可随时更改。
- 未同意时仅显示日间、夜间、ILLUSIA 三款官方皮肤,隐藏 KAAK 等其他皮肤及插件入口。撤回后切回内置皮肤、取消待完成加载并停止相关组件和插件页面。
- 保留皮肤清单权限、数据投影、文件摘要及宿主动作校验,管理员的应用审核与信任设置仍独立生效。
#### 修复与升级
- 修复窗口、整个屏幕及关闭共享音频时,TS 原生客户端不应答纯视频 offer 的问题:补充必要的音频协商段,不采集麦克风,也不伪造共享声音。窗口与全屏已由用户复测出画面。
- SDK 升级至 `@honeybbq/teamspeak@1.0.0-beta.23`,适配可选成员字段,并跳过代表说话结束的空音频数据包。
- 纳入上游 TSDNS 解析、查询限流重试、文件传输及断开连接清理等修复。
- 纳入 IPv6 目标校验、并发登录限制、改密后的会话撤销、可信代理限流与 PCM 上行保护修复。
- 保留并验证皮肤首次加载使用真实构建版本的修复,统一桌面、网页及 Android 的应用版本号。
#### 升级说明
- 插件 API v2 不兼容旧 API v1 应用包,请更新插件后重新审核并启用。
- 公网使用功能插件时,需要在管理员面板配置独立的 HTTPS 应用源并代理运行端口(默认 `3042`);主站与应用不能使用同一个源。
- 本次统一授权需要用户重新选择,旧的逐皮肤授权记录不会自动视为同意。
### [v0.2.9](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.9) · 2026-10-24
#### 功能增强
- 接入上游 SDK 1.0.0-beta.19,普通语音连接使用客户端实时目录,不再依赖 Query 列表权限。
- 管理员控制台新增 GitHub 皮肤商店,以及按实例管理、更新和启停皮肤的入口;Discord Voice 作为标准 `.wskin` 示例独立分发。
- 指定实例模式支持可选 TS 管理面板,可配置 WebQuery、TCP 或 SSH Query 凭据,管理服务器、频道、成员、服务器组和封禁。
- 中继可配置浏览器直连的语音入口,将语音会话交给中继节点处理,减少网关间的额外转发。
- 提供通用工作区保留与重连接口,KAAK 同步接入,并新增管理员、项目 GitHub 和 QQ 群入口。
- 支持 TeamSpeak 频道分隔栏,包括左中右对齐、重复填充、空白及标准线型;向皮肤开放格式化数据。
#### 问题修复
- 修复屏幕共享播放器的全屏尺寸,以及断线成员的状态、播放资源清理。
- 修复 TS 管理中封禁成功却报错、Query 连接混入成员统计和频道密码标签错误的问题。
- 区分权限、限流和超时提示;操作完成后的刷新失败单独提示,避免用户重复执行操作。
- 防止 SDK 将 HTTP 失败响应误判为 WebQuery 成功;修复 DC 首页、聊天区与窄屏控件布局。
#### 已知问题
- [PR #48](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/48) 记录的安全加固尚未纳入本版本,关闭该 PR 不代表相关问题已修复。
<details>
<summary>展开 v0.2.8 及更早版本</summary>
### [v0.2.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.8) · 2026-10-17
#### 屏幕共享与连接稳定性
- 修复网页与 TeamSpeak 原生客户端之间屏幕共享的协商和视频轨道处理问题。
- 改善快速切换频道时的队列处理,减少客户端状态错乱。
- 修复部分皮肤组件内容和 KAAK 皮肤多语言显示问题。
#### 界面改进
- 音频设备名称会完整显示;空间不足时自动换行,便于区分名称较长的设备。
- 修复头像占位文字被意外选中的问题。
### [v0.2.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.7) · 2026-10-13
#### 更开放的皮肤系统
- 现在提供更开放的皮肤编辑系统与运行支持,可以自定义任意组件的样式与位置并可添加小组件。
- 进入语音面板后,在同一个浏览器中新开并登录一个管理员后台窗口即可激活皮肤编辑器。
- 随包提供一款“KAAK”皮肤作为开发示例。
- 更新了皮肤开发 Agent Skill。
#### 功能增强
- 现在支持 SRV 和 Nickname 形式的服务器地址解析。
- 自由模式下,允许用户进行多服务器标签管理(这些按钮在“固定服务器”的模式下不可用)。
- 屏幕共享新增码率选项。
- 现在 WebSpeak 会将输入过的频道密码保存到浏览器中。
- 现在会在上锁的频道前显示带锁的图标。
- 现在聊天记录能够持久化存储了。
#### Bug 修复列表
- 修复了解析 bug。
- 修复了音量和卡片拖动争抢焦点的问题。
- 修复了用户状态被错误地解析为未知的问题。
### [v0.2.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.6) · 2026-10-08
相对 0.2.5 大范围重构语音网关、共享协议、前端语音工作区与管理模块;修复 #6/#7/#10,完成 #9/#12 配置,并修复 PR #13 报告的既有 TS6 屏幕共享漏发现问题;改善 Opus/重连生命周期和移动端控制。提供 Windows x64、Linux x64/ARM64、Docker amd64/arm64,以及 Android arm64-v8a、armeabi-v7a、x86_64 APK。
### [v0.2.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.5) · 2026-09-27
新增 `.wskin` 皮肤系统、管理员启用/默认管理和受保护的日间/夜间/ILLUSIA 内置皮肤;移除未完成 Aurora Voice 样例,修复皮肤加载闪烁、暗色控件可读性与语音界面美术层级,并加入官方皮肤开发 Agent Skill。
### [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) · 2026-09-22
新增浏览器与 TeamSpeak 6 原生客户端之间的跨端 P2P 屏幕共享;提供 STUN/外部 TURN 配置、直播播放器、观众状态、1080p/60 FPS 采集设置和 WebRTC 统计;优化屏幕共享交互并新增访客编号。
### [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) · 2026-09-19
新增频道成员调度与按权限直接移动;支持头像、静音状态同步和身份恢复;更新五种语言的功能截图与文档。
### [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) · 2026-09-17
提供浏览器端麦克风降噪、俄语和日语支持及按语言欢迎词配置;优化音量交互和 PR #2 基础上的错误提示与错误代码。
### [v0.2.1](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.1) · 2026-09-13
优化首页连接错误显示,保留并安全截断错误代码;默认支持 IPv6 TeamSpeak 目标。
### [v0.2.0](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.0) · 2026-09-10
增加服务器密码提示、正式中继部署模式、多中继选择和管理员日志原因显示。
### [v0.1.8](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.8) · 2026-09-08
简化 Docker 部署,支持同机 TeamSpeak,增加 15 秒连接超时和持续网络监测。
### [v0.1.7](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.7) · 2026-09-06
增加德语、Telegram、网络性能面板和整体音量;修复伴奏音量波动。
### [v0.1.6](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.6) · 2026-09-04
增加桌面端伴奏、身份保持提醒和网站图标;修复 WebRTC 成员独立音量。
### [v0.1.5](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.5) · 2026-09-04
修复身份保存逻辑并优化主题切换。
### [v0.1.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.4) · 2026-09-03
修复 WebRTC、频道聊天并优化管理页、日志和移动端布局。
### [v0.1.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.1.3) · 2026-09-03
引入内置 WebRTC、迁移 TeamSpeak SDK 并改善成员同步和语音缓冲。
</details>
<a id="contributors"></a>
## 贡献者与贡献来源
<details>
<summary>查看上游作者与 PR 贡献说明</summary>
以下列出上游 SDK 作者、已合并的 GitHub PR,以及已移植为独立皮肤包的原始贡献。
- [HoneyBBQ](https://github.com/HoneyBBQ) — 上游 [teamspeak-js(`@honeybbq/teamspeak`)](https://github.com/HoneyBBQ/teamspeak-js) SDK 的作者,为 WebSpeak 提供底层 TeamSpeak 协议客户端能力。
- [ph1gros](https://github.com/ph1gros) — [PR #48](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/48) 提供公开目标 IPv6 校验、管理员认证与会话、代理限流及 PCM 上行边界的安全审查、补丁和回归测试;原补丁未直接合并,相关修复已在 `dev` 中重新实现。
- [LainHE](https://github.com/LainHE) — [已合并 PR #2、#8、#28、#31–#35、#37、#38、#40](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ALainHE),涉及浏览器报错翻译、缩放与首页布局、屏幕共享码率与观看者头像、中继目标校验与异常重连、可信代理校验、连接失败传递、音频故障报告及 WebRTC 失败时的资源清理。
- [TimmySheep](https://github.com/TimmySheep) — [已合并 PR #13、#15–#24](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pulls?q=is%3Apr+is%3Amerged+author%3ATimmySheep),涉及 TS6 既有屏幕共享发现、屏幕比例、移动端语音/常亮/皮肤菜单、身份频道选项、PWA/主题、聊天历史、成员音频状态和麦克风权限等改进。
- [yichen11818](https://github.com/yichen11818) — [PR #25](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/25) 支持 TeamSpeak 注册昵称连接并保留昵称目标;[PR #51](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/51) 改进 KAAK 首次连接后的工作区保留与重连;[PR #27](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/27) 和 [PR #52](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/pull/52) 提供 Discord 皮肤的原始设计与实现(提交署名 **yumi**),后由 WebSpeak 项目移植为[独立分发的 `.wskin` 皮肤](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice)。
</details>
## 社区与相关项目
[GitHub Issues](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/issues) · [QQ 群 869500475](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=yhumUMDD9PmyYFWdXWUb_x7hM5trFQY8&authKey=Pw3HBGT7GwMinTQnuFGfnpf0aRSzXOJKcAiujVP1%2BXMpjheAKrncTRivicBJxpjV&noverify=0&group_code=869500475) · [Telegram](https://t.me/+8qShpTcuN9A3MWY9)
[NeteaseTSBot](https://github.com/yichen11818/NeteaseTSBot):支持多平台点歌和 Web 控制台的 TeamSpeak 音乐机器人。
## 许可证
WebSpeak 按 [AGPL-3.0-only](../LICENSE) 发布。第三方依赖的许可与归属见各自项目。
<p align="right"><a href="#readme-top">返回顶部 ↑</a></p>
+680 -34
View File
@@ -1,17 +1,91 @@
# WebSpeak 皮肤开发规范
# WebSpeak 0.2.8 皮肤系统开发指南
本文说明如何制作、校验并发布 WebSpeak `.wskin` 皮肤包。皮肤可为公开页面逐个部件定制二次元美术表现:背景、素材、配色、轮廓、圆角、阴影、头像装饰、按钮质感、滚动条颜色和播放器外观都可以自定义;但组件的位置、尺寸、排列、文字排版空间及交互结构由 WebSpeak 固定提供,皮肤不得重排或覆盖。
本文是 WebSpeak 0.3.0 的唯一皮肤开发说明,整合原皮肤开发规范与开放皮肤系统规格。它覆盖仍受支持的 v1/v2 兼容皮肤、v3 声明式开放皮肤和 v4 插件包,以及当前公开数据、宿主动作、授权、校验与开发流程。v4 有界 Wasm 已在生产构建开放;皮肤 JavaScript 仍只校验和缓存,不会执行。本文件是当前包格式和运行时接口的唯一文档来源。
页面结构、必要控件和所有基础翻译均由 WebSpeak 提供。皮肤包不必携带文案;如果只包含样式与美术素材,所有界面文字仍由 WebSpeak 按当前语言显示。`content.json` 仅用于可选覆盖,缺少的语言或字段回退到 WebSpeak 的基础内容。皮肤不注入 HTML 或 JavaScript,也不改变语音、权限、连接、拖动和屏幕共享行为。**管理后台 `/admin/**` 不属于皮肤范围,始终使用 WebSpeak 自己的固定样式。**
## 目标:皮肤是可移植的外挂包
`.wskin` 是皮肤唯一的交付物。页面结构、样式、文案、布局、图片、字体和皮肤自己的组件/逻辑都应随包分发;导入皮肤不应要求为某款皮肤单独修改、部署或配置 WebSpeak 核心代码。宿主只提供稳定、通用且版本化的渲染和能力接口,皮肤包声明如何使用它们。
开发皮肤时,优先在包内完成工作:用 `skin.css` 和包内资源做视觉,用 `content.json` 提供皮肤文案,用 `layout.json` 提供默认排布,用 `components.json` 描述页面组件、数据绑定和已支持的交互;需要本地逻辑时,根据当前支持情况使用 v4 有界 Wasm。所有图片、字体、CSS 和插件文件都放进 `.wskin`,引用包内相对路径。不要为了单款皮肤给 `WebClient.vue`、宿主控件注册表、共享协议、服务端或其他核心运行时添加专用实现。
运行时数据和安全敏感的 TeamSpeak 行为仍由 WebSpeak 提供。皮肤只能读取当前协议明确公开的数据,并调用已支持、经用户授权和宿主复核的动作;包内 UI 消费这些输入并负责呈现。若多个皮肤确实缺少同一项通用数据或动作,应另立平台接口工作:先定义稳定字段/动作、权限和兼容版本,再由皮肤包使用。不要把平台接口改动伪装成某款皮肤的必要步骤,也不要为单个皮肤新增专用宿主控件。
可移植性由 WebSpeak 运行时与皮肤协议版本决定。清单的 `minAppVersion`、组件 schema、插件 `apiVersion` 必须对应实际使用的接口;兼容同一协议版本的 WebSpeak 实例应能导入并运行相同字节的 `.wskin`,无需单独部署该皮肤的前端代码。实例配置、公开服务器数据、屏幕尺寸和用户授权可以影响显示结果,但不改变包的实现。旧包继续遵循其声明的 schema 和宿主兼容规则。
开发者 Skill:[WebSpeak Skin Development](../.agents/skills/webspeak-skin-development/SKILL.md)。它给 Agent 提供皮肤任务的决策和交付步骤;本文件是格式、接口与安全边界的事实来源。
示例展示公开皮肤接口的用法,不代表未记录的运行时接口也可依赖;发现、活动、广告、商城和管理后台不属于语音皮肤范围。
完整的 KOOK 语音端体验测试皮肤见 [KAAK](./examples/KAAK-VOICE.md):它复用 WebSpeak 可信宿主控件和公开 TeamSpeak 会话数据,不包含站点素材、运营页面或后台。Harbor Voice 保留为通用 surface 格式验证样例。
v3 保留安全的标准元素和属性白名单;组件可通过完整页面 surface 自己构建界面,不需要把聊天、音频或成员 UI 锁在固定宿主面板里。条件可比较权限化公开数据、重复项和皮肤本地状态,也可判断已登记公开集合是否为空。表单输入先留在宿主渲染的本地状态;宿主动作不能在逐字输入时触发,可在已提交的 `change`、表单提交或显式点击上触发。作者自定义代码逻辑由 v4 有界 Wasm 路径提供。生产构建中的 v4 Wasm 运行时已接入本地摘要授权、页面生命周期、动态 HTML/SVG 节点渲染、插件 CSS、权限化只读数据投影、宿主动作桥、语义挂载槽位和全局 worker 资源治理;目前支持 `session.status.read`、频道/成员/聊天、收藏/最近列表和音频/共享状态读取权限,以及 `ui.surface.replace`、`ui.input.read`。每份公开数据投影最多 48 KiB,只传清单准许的字段;Wasm 可生成自定义节点树、有限本地状态并响应命名 UI 事件。宿主动作只接受可信 UI 事件触发的同一轮输出中的单个请求,并重新检查插件权限、参数和当前会话;`dblclick` 可绑定到加入频道等已授权宿主动作。JavaScript 仍只校验和缓存,不执行。每个 v4 插件有独立布局根,用户可调整插件整体、组件根和 DOM 节点的位置、尺寸、显隐、安全外观及 Flex/Grid 同级显示顺序;`plugins.json` 可将 widget 放到公开页面的注册槽位,也可通过 surface 重做整页。这个边界能承载完整自定义客户端界面,但不等于已完成插件商城和作者管理平台;跨浏览器测试与独立安全审查尚未完成。
`.wskin` 包可为公开页面定制艺术表现。v1 提供 CSS 与美术资源;v2 另外携带受校验的布局 JSON;v3 可自由安排公开组件,并用 components.json 声明由宿主渲染的安全组件。所有版本均由 WebSpeak 保留基础组件的业务逻辑和 TeamSpeak 行为。
页面结构、必要控件和所有基础翻译均由 WebSpeak 提供。皮肤包不必携带文案;如果只包含样式与美术素材,所有界面文字仍由 WebSpeak 按当前语言显示。`content.json` 仅用于可选覆盖,缺少的语言或字段回退到 WebSpeak 的基础内容。皮肤不注入 HTML 或 JavaScript;授权后的交互只调用 WebSpeak 登记并校验过的 TeamSpeak 功能。**管理后台 `/admin/**` 不属于皮肤范围,始终使用 WebSpeak 自己的固定样式。**
可直接查看 [ILLUSIA 风示例源码](examples/illusia-voice/) 与 [示例说明](examples/ILLUSIA-VOICE.md)。它使用本地美术素材和 CSS 完整定制首页、语音房间、成员区、聊天空状态及播放器,同时沿用 WebSpeak 提供的基础翻译;也是管理控制台内置且不可移除的示例皮肤。
宿主外壳与恢复入口的 toolbar 停靠见 [Host Chrome Toolbar 示例](examples/HOST-CHROME-TOOLBAR.md):它用最小包演示 `mode: "toolbar"`、按页候选锚点、工具栏令牌、应用库去重和坏锚点回退,不包含任何真实服务器或成员数据。
## 使用与发布
管理员在 `/admin/skins` 查看三款随 WebSpeak 提供的内置皮肤,并可导入、替换、启用/停用或删除实例自定义皮肤;还可指定访客首次访问时使用的默认皮肤。默认日间、默认夜间和 ILLUSIA 风为受保护内置项,不可替换、停用或移除。访客手动选择的皮肤保存在该浏览器,后续实例默认值变更不会覆盖该明确选择;仅自动套用过旧默认值的浏览器会采用最新实例默认值。皮肤包会缓存在浏览器本地;页面启动时会查询实例目录,目录可用且版本更新时拉取新包。若网络不可用,已缓存的版本仍可使用。
选择器提供默认日间、默认夜间、内置 ILLUSIA 风和已启用的实例皮肤;没有“跟随系统”选项。停用的实例皮肤不向访客展示,也不能从服务端下载;若它是当前默认皮肤,系统会安全回退到默认日间。管理员设置的默认值只影响未手动选择皮肤的访客。自定义皮肤是独立的外观选择,不继承之前的日间或夜间模式;皮肤未覆盖的部件回退到浅色基础外观,避免一套组件混入另一套模式。自定义皮肤可自行声明 `color-scheme` 并定义深色外观;切换为日间或夜间时,会停用当前自定义包。文档级 `data-theme` 仍由 WebSpeak 保留给管理后台使用。
### GitHub 皮肤商店分发
管理员在 `/admin/skins` 的“皮肤商店”页安装仓库分发的皮肤;“实例皮肤”页负责导入、启停、删除和设置默认值。安装和更新不改变默认皮肤,更新保留原启停状态。商店网络故障不会影响已安装皮肤。访客仍需自行批准皮肤组件权限,管理员安装不能替访客授权。
官方索引为 [Huddle-Up-Forge/webspeak-skins](https://github.com/Huddle-Up-Forge/webspeak-skins) 的 `master/index.json`。索引仅登记稳定的皮肤 ID 和公开 GitHub 仓库地址,不包含皮肤实现:
```json
{
"schemaVersion": 1,
"skins": [{
"id": "community.discord-voice",
"repository": "https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice"
}]
}
```
每个皮肤仓库的默认分支根目录提供 `skin.json`(位于 `.wskin` **之外**),例如:
```json
{
"schemaVersion": 1,
"id": "community.example-skin",
"name": "Example skin",
"version": "1.0.0",
"author": "Example author",
"license": "CC-BY-4.0",
"description": "A portable WebSpeak skin.",
"minAppVersion": "0.2.8",
"package": {
"ref": "v1.0.0",
"path": "example.wskin",
"sha256": "填写最终归档文件的 64 位小写 SHA-256"
}
}
```
`package.ref` 使用已发布 tag 或完整提交 SHA,`path` 指向该 ref 中的 `.wskin` 文件。推荐 tag 一经发布不再移动。`skin.json` 必须与归档清单的 ID、版本和最低应用版本一致。商店展示 `skin.json` 中的名称、作者和许可证,安装后的实例皮肤展示归档清单中的值。版本和最低应用版本使用语义化版本;`description` 必须是字符串,可以留空。仓库无需提供 GitHub 令牌,实例从 GitHub 的公开原始文件服务读取;不支持私有仓库、任意下载域名或重定向。
发布步骤:先构建并用客户端和服务端导入器验证最终归档;计算 SHA-256;提交源码、归档、许可证和 `skin.json`;为这个提交创建版本 tag;最后提交中央索引条目。后续更新只需在皮肤仓库发布新版本并更新默认分支的 `skin.json`,无需同步修改中央索引。安装时服务端重新检查索引及元数据,核对摘要并运行普通 `.wskin` 校验;校验失败不替换实例皮肤。同 ID 已安装且版本相同或更新时,不提供覆盖或降级操作。多个管理员同时修改实例皮肤时,过期的安装请求会被拒绝,需刷新后重试。
仓库地址限定为 `https://github.com/owner/repository`。索引最多 50 项;索引最大 128 KiB,单个 `skin.json` 最大 16 KiB,归档最大 20 MiB,下载有超时限制。商店不执行皮肤构建脚本,也不从仓库加载未打入归档的资源。
### 工作区接口 v1(WebSpeak 0.2.8 当前运行时)
v3/v4 开放皮肤可在 `manifest.json` 中声明 `"workspace": { "apiVersion": 1, "mode": "persistent" }`。未声明时保留原先的首页流程。该通用接口不识别皮肤 ID,也不授予额外网络或存储权限;皮肤包本身不能读写此偏好。旧运行时不认识该字段或权限时会拒绝导入,不能仅凭应用版本号认定支持;使用它的包需要 `minAppVersion: "0.2.8"` 及工作区接口 v1。
首次使用仍显示连接表单;只有成功连接才记录 `hasConnected`。旧的成功连接历史会迁移为已使用状态,只有昵称或失败尝试不算。启用此策略的皮肤在主动断开或刷新回访后仍进入工作区,但不会自动连接、采集麦克风或切换服务器。普通回访可由宿主恢复最近目标;显式邀请、目标或频道链接优先。切换到未声明策略的皮肤恢复其原有流程,清除本地数据会重置此记录。
可信控件 `voice.connection-status` 需要 `session.status.read` 与 `voice.connect`,显示本地化的连接/失败状态、可编辑昵称与重连按钮;忙碌时禁用重复提交,服务器密码和新增服务器对话框仍由宿主管理。公开部件为 `voice.connection-status`、`voice.connection-status.message`、`voice.connection-status.nickname`、`voice.connection-status.nickname.input`、`voice.connection-status.reconnect`。皮肤负责这些部件的位置、响应式布局和外观。
声明式动作 `voice.connect` 使用同名权限且不接受参数;它只在明确可信点击后连接宿主当前选定的目标,不能携带地址、密码、身份材料、邀请令牌或自动执行。服务器配置和身份未就绪、正在连接/重连、已经连接或对话框尚待处理时,宿主拒绝重复发起。它和既有的 `quickServers.switch`、服务器栏加号共用宿主连接流程;异步读取浏览器已保存密码不会被误判为连接失败。
## 包结构
`.wskin` 是标准 ZIP 容器,推荐把下列文件直接放在 ZIP 根目录:
@@ -23,24 +97,32 @@ content.json # 可选:首页内容与多语言界面文案
assets/preview.jpg # 可选:管理后台显示的预览图,也可在 CSS 中使用
assets/background.webp # 可选:页面艺术素材
assets/brand.woff2 # 可选:自带字体
components.json # v3 可选:声明式组件或完整页面 surface
chrome.json # v3/v4 可选:宿主装饰、图标位图与可信控件停靠(见「chrome.json」章节)
assets/icons/language.png # v3/v4 可选:工具栏图标位图覆盖素材
plugins.json # v4 必需:插件入口、页面、模式、权限与包内文件
plugins/<plugin-id>/index.js # v4 插件代码,目前只校验和缓存
plugins/<plugin-id>/index.wasm # v4 有界 Wasm 插件入口
plugins/<plugin-id>/style.css # v4 可选:插件样式,目前只校验和缓存
plugins/<plugin-id>/assets/ # v4 插件专属的本地图片或字体素材
```
所有资源路径使用 `/`,区分大小写,并相对于包根目录。CSS 的 `url()` 使用同样的包根相对路径,例如 `url("assets/background.webp")`。不得使用机器本地路径、站点绝对路径或远程 URL。
所有资源路径使用 `/`,区分大小写,并相对于包根目录。CSS 的 `url()` 使用同样的包根相对路径,例如 `url("assets/background.webp")`。不得使用机器本地路径、站点绝对路径或远程 URL。说明文档放在源码目录旁边,不能打进 `.wskin`;导入器会拒绝 `README.md` 等未声明文件。
### `manifest.json`
```json
{
"schemaVersion": 1,
"id": "community.illusia-voice",
"name": "ILLUSIA风",
"version": "1.0.25",
"author": "WebSpeak Project",
"license": "All rights reserved",
"id": "community.example-skin",
"name": "Example skin",
"version": "1.0.0",
"author": "Example author",
"license": "CC-BY-4.0",
"description": "A visual-only art skin using the WebSpeak interface translations.",
"entry": "skin.css",
"preview": "assets/background-composite.webp",
"minAppVersion": "0.2.5-preview"
"minAppVersion": "0.2.7"
}
```
@@ -52,15 +134,206 @@ assets/brand.woff2 # 可选:自带字体
| `version`、`minAppVersion` | 必需,使用语义化版本号,例如 `1.2.0`。 |
| `entry` | 必需,包内 CSS 文件路径,最多 120 个字符。 |
| `content` | 可选,包内 JSON 文件路径,最多 120 个字符。 |
| `chrome` | v3/v4 可选,包内 `chrome.json` 路径,最多 120 个字符;v1/v2 声明该字段会被拒绝。 |
| `preview` | 可选,包内 PNG、JPG/JPEG、WebP、AVIF 或 GIF 图片路径,最多 120 个字符。 |
| `description` | 可选,最多 400 个字符。 |
清单不得重复声明同一个文件为 CSS、内容或预览入口。
### schemaVersion 2:声明式布局皮肤
v2 为 v1 增加一个必需布局文件。清单和布局 JSON 会在导入端及服务端分别验证;未知清单字段、权限、组件、布局字段及越界数值都会导致包被拒绝。v2 不支持 HTML、JavaScript、WebAssembly、远程资源或扩展插件代码。皮肤 CSS 仍使用当前解析器规则,不能控制几何布局和交互区域。
```json
{
"schemaVersion": 2,
"packageType": "layout-skin",
"id": "community.example-layout",
"name": "Example layout",
"version": "1.0.0",
"author": "Example author",
"license": "CC-BY-4.0",
"entry": "skin.css",
"layout": "layout.json",
"permissions": [],
"minAppVersion": "0.2.7"
}
```
布局只引用 WebSpeak 登记的稳定组件 ID。当前支持 `home`、`voice`、`demo` 页面及 `desktop`、`tablet`、`mobile` 三种设备配置。组件位置使用有界的水平/垂直偏移,尺寸使用缩放、宽、高,外观字段只接受六位十六进制颜色和受限圆角;`visible` 控制显示状态;`order` 在 -100 到 100 之间,仅当父容器使用 Flex 或 Grid 时改变同级显示顺序,不改变 DOM 和键盘焦点顺序。`home.security-note`、身份安全提示、连接状态与屏幕共享错误属于可信宿主 UI,不允许布局隐藏或改写。
示例 `layout.json`:
```json
{
"schemaVersion": 1,
"pages": {
"home": {
"desktop": {
"home.feature": { "x": 12, "y": 8, "scale": 1.05, "order": -1 },
"home.features": { "visible": false }
},
"tablet": { "home.join-card": { "width": 680 } },
"mobile": { "home.header": { "x": 0, "y": 4 } }
}
}
}
```
作者包中的布局是初始默认值。用户编辑内容单独存放在本地浏览器,覆盖作者默认值;支持撤销/重做、单个组件重置、整套布局恢复、导入和导出。更换设备宽度会选择对应设备配置,不会删除其他设备的值。恢复入口由宿主在皮肤根节点之外绘制,即使用户隐藏了页面组件,也能再次打开编辑器并恢复默认值。
v1 和 v2 都只支持公开页面。`/admin/**` 不加载布局、用户覆盖和皮肤组件编辑器。布局包没有数据/API 权限;后续插件必须另行设计独立沙箱与授权协议,不能通过增加 v2 清单字段取得能力。
### schemaVersion 3:开放皮肤和完整声明式页面
v3 清单的 packageType 固定为 open-skin,entry 指向 CSS,components 可选指向 components.json;与 v2 不同,v3 不声明 permissions,但可以可选声明 layout 指向作者默认布局 `layout.json`。组件文件可以省略。仅 v3 开放公开页面的 CSS 排版能力,v1/v2 仍按旧 CSS 规则校验。客户端导入和服务端登记使用同一共享组件 schema 与权限白名单。
components.json 顶层接受 schemaVersion 1、2 或 3 和 components 数组。schema v1 维持旧兼容;schema v2 引入 `mode: "widget"`(默认)或 `mode: "surface"`,并提供可选宿主控件节点;schema v3 保持这些能力,扩大声明式 UI 的节点/状态/动作边界,并增加用户操作事件和语音功能动作。v3 仍使用固定元素/属性、公开数据集合和宿主动作白名单,不是任意 HTML 或任意脚本。每个组件需声明 id、name、page、accessibleName、permissions、actions 和 root,可选 state。page 接受 home、voice、demo;surface 仅可用于 home 和 voice,并且必须请求 `ui.surface.replace`。用户批准前不会显示 surface,撤销后宿主立即恢复普通页面。所有皮肤组件根节点及其中的每个可见元素都以动态布局项加入本地布局编辑器,可独立移动、缩放、改尺寸、改外观或隐藏。按钮、输入框及显式用户操作节点保留 44 px 最小触控区域。为让用户覆盖在树结构调整后仍能指向同一元素,请给重要节点设置稳定的 `part` 名称;未设置时按组件树位置生成标识。v4 插件格式与运行时见本指南的 v4 章节;Wasm 生产运行已开启,作者 JavaScript 仍关闭。
普通节点使用白名单 HTML/SVG 元素。节点可包含 text、part、className、受限 attributes、包内图片 asset、bindValue、本地 repeat/when、events 和 children。文本与属性支持简单的双大括号数据路径;不支持表达式、HTML 字符串或脚本。重复列表可使用注册的公开集合;频道重复项仅能再重复其 `channel.members`,并且需要额外批准 `session.members.read`。宿主每个组件的实际渲染节点最多 8192 个,防止嵌套集合放大界面。v3/v4 的作者默认布局使用与 v2 相同的有界 layout schema;可通过 `skin.<page>.<component-id>` 指定声明式自定义组件,通过 `skin.<page>.runtime_plugin_root_<plugin-id>` 指定 v4 插件根。用户的本地布局覆盖优先于包默认值。schema v2 另允许固定宿主控件节点,例如:
申请 `session.channels.read` 的 `session.channels` 列表还提供 `memberCount`、两位数显示用的 `memberCountLabel`、`maxClients` 和 `maxClientsLimited`。后两个字段仅在 TeamSpeak 返回有效上限数据时出现;`maxClientsLimited: false` 表示频道不限人数。它们与频道树一起属于公开只读数据,不会授予服务器写入能力。
频道显示接口增补(0.2.8):同一权限下新增 `displayName`、`isSpacer`、`spacerAlignment` 与 `spacerStyle`,声明式 v3 和 Wasm v4 均可读取。`name` 始终保留服务器原名,`displayName` 仅对永久、顶层且名称以 `[spacer…]`、`[lspacer…]`、`[cspacer…]`、`[rspacer…]` 或 `[*spacer…]` 开头的频道移除前缀(大小写不敏感,省略或自定义标识均可)。分隔栏的 `spacerAlignment` 为 `left`、`center`、`right` 或 `repeat`;`spacerStyle` 为 `text`、`solid`、`dashed`、`dotted`、`dash-dot` 或 `dash-dot-dot`,五种线型对应 `___`、`---`、`...`、`-.-`、`-..`。普通频道的 `displayName` 等于 `name`、`isSpacer: false`、两个格式字段为空字符串。旧运行时可能不含新增字段;兼容包应回退到 `name`,不能只凭相同的 0.2.8 版本号推断字段存在。分隔栏仍为真实 TS 频道,不增加加入限制,不隐藏其中的成员或子频道;管理编辑继续使用原名。
宿主 `voice.channel-tree` 与 `voice.channel-panel` 自动使用上述显示规则;分隔栏隐藏普通频道图标和人数,不显示空成员提示。新增稳定部件 `voice.channel-spacer`,提供 `data-alignment` 与 `data-spacer-style` 属性;频道树行 `voice.channel-tree.row` 和成员面板标题 `voice.channel-group.heading` 在分隔栏上提供 `data-spacer="true"`。颜色和字体继承皮肤,文字及重复填充在可用宽度内裁剪,空文本保留分隔间距。皮肤无需新增权限或修改传输逻辑。
```json
{
"schemaVersion": 2,
"components": [{
"id": "example-voice-surface",
"name": "Example voice surface",
"page": "voice",
"mode": "surface",
"accessibleName": "Example voice workspace",
"permissions": ["ui.surface.replace"],
"actions": {},
"root": {
"tag": "main",
"children": [
{ "widget": "voice.channel-panel" },
{ "widget": "voice.member-cards" },
{ "widget": "voice.chat-panel" },
{ "widget": "voice.audio-controls" },
{ "widget": "voice.disconnect-control" }
]
}
}]
}
```
当前可选宿主控件 ID:`home.connection-form`、`home.connection-status`、`home.visitor-count`、`home.server-announcement`、`home.social-links`、`home.identity-provider`、`app.skin-switcher`、`app.language-switcher`、`voice.channel-panel`、`voice.member-cards`、`voice.chat-panel`、`voice.audio-controls`、`voice.screen-share-player`、`voice.screen-share-start`、`voice.whisper-controls`、`voice.performance-panel`、`voice.connection-controls`、`voice.disconnect-control`、`voice.plugin-launcher`、`voice.server-header`、`voice.server-banner`、`voice.server-switcher`、`voice.channel-tree`。未知控件和同页重复控件会被拒绝;每个控件的状态和业务动作仍由 WebSpeak 内部处理。`home.identity-provider` 是通用身份提供方入口,需用 `options.identityProviderId` 和 `options.identityProviderLabel` 指定稳定提供方标识与显示名;宿主会把点击转交给应用代码的 `registerIdentityProviderAdapter` 分发接口,皮肤只能发起请求、不能注册适配器。当前没有 MyTS 适配器,所以 MyTS 入口仍提示开发中;这不代表已经实现登录认证。schema v3 会检查受保护控件所需权限:音频控件需 `audio.status.read`、`audio.microphone.control` 和 `audio.output.control`;聊天需 `chat.channel.read` 与 `chat.channel.send`;成员卡片始终需 `session.members.read` 和 `session.memberAvatars.read`;schema v3 可为成员卡片设置 `options.memberActions: true`,在非本人卡片上显示可信宿主成员操作入口(包含现有个人音量控件);也可为 `voice.channel-tree` 设置该选项,在非本人频道树成员行上启用右键菜单;菜单仍由 WebSpeak 宿主处理,皮肤不获得额外动作或数据接口。频道树还可单独设置 `options.memberDragDrop: true`,将非本人成员拖到另一频道行时复用 WebSpeak 现有移动成员操作;悬停和拖入高亮由皮肤样式控制,此选项默认关闭且只适用于频道树。成员卡片或性能卡片可设置 `options.screenShare: false`,同时隐藏共享 UI/指标并免除成员卡片所需的屏幕共享权限;默认成员共享操作仍需屏幕共享读取/控制权限;头像只在可信宿主控件内显示,不暴露给皮肤代码;屏幕共享播放器需 `voice.screenShare.read` 与 `voice.screenShare.control`;悄悄话控件需对应状态读取和控制权限;断开/连接控件需 `voice.disconnect`。既有 v2 包维持旧校验行为,`voice.screen-share-start` 仍像此前一样要求 `voice.screenShare.control`。该控件仅能放在语音页;宿主按钮在可信点击处理器内直接启动屏幕采集,避免异步 Wasm 回调丢失浏览器瞬时用户激活。自定义 UI 可以完全用普通声明式节点搭建,不需要采用这些控件。只显示收藏时可用 `favorites.items` 和 `favorites.switch`;若要将收藏与最近连接放在同一自定义栏,可用 `servers.quickList` 数据与 `quickServers.switch` 动作。服务器目标始终使用本机生成的不透明令牌,不把地址、密码或身份材料交给组件。频道行也可把 `voice.joinChannel` 绑定到双击事件,切房继续走 TeamSpeak 原有权限和密码流程。v3 还提供经独立权限保护的麦克风/扬声器、输出音量、噪声抑制、伴奏、离开状态、悄悄话、断开连接和屏幕共享动作;噪声抑制使用 `audio.toggleNoiseSuppression` 与 `audio.microphone.control`,伴奏使用 `audio.toggleAccompaniment` 与 `audio.output.control`。它们只调用 WebSpeak 已有操作,屏幕采集仍由浏览器或操作系统询问用户。
从 WebSpeak 0.3.2 起,完整语音布局可以放置宿主小组件 `voice.plugin-launcher`。组件 schema v3 支持 `options.pluginPresentation`,省略时使用 `dialog`。可选 `drawer-below` 在按钮下方展开,或用 `drawer-side` 在侧栏内展开。固定应用排在列表前面,未固定的可用应用仍可搜索。WebSpeak 管理插件授权、可用性与应用窗口,皮肤只声明入口的位置和呈现方式。
```json
{ "widget": "voice.plugin-launcher", "part": "plugin-launcher", "options": { "pluginPresentation": "drawer-side" } }
```
皮肤可用 `voice.plugin-launcher`、`voice.plugin-drawer` 和 `voice.plugin-drawer.app` 调整外观。没有放置此组件的完整语音布局会获得默认应用库入口。可为 `home.social-links` 设置 `options.communityLinks: false`,只保留管理控制台入口。
首页访客统计使用公开宿主控件 `home.visitor-count`:它展示当前访客序号与累计访客数,文本跟随当前界面语言,并在统计数据尚不可用时隐藏;不需声明权限。该控件复用 WebSpeak 日间首页的同一结构与基础样式,皮肤通过包内 CSS 定位,不需要自建统计逻辑。组件节点可用稳定的 `part` 名称(例如 `visitor-stats`)控制位置;内部 `home.visitors`、`home.visitors.orbit`、`home.visitors.icon`、`home.visitors.label`、`home.visitors.divider`、`home.visitors.total` 和 `home.visitors.spark` 是稳定样式部件。控件只能放在 `home` 页面。
可信语音导航控件包括 `voice.channel-tree`、`voice.server-switcher` 和 `voice.server-header`。频道树要求 `session.channels.read`、`session.members.read`、`session.memberAvatars.read` 与 `session.channel.join`;头像只由宿主读取并在频道树中绘制。它可选 `layout: "server-sidebar"` 展示频道成员并让频道行与成员行分别控制折叠;未指定时保留默认呈现。独立服务器切换器要求 `servers.quickList.read` 与 `servers.quickList.switch`。服务器头部还要求 `session.status.read`,并在同一可信部件中组合服务器身份、状态、频道搜索和快速切换。两种入口都只接收不透明本地标识,点击后复用 WebSpeak 当前连接流程。v3 还可用 `session.invite.copy` 授权 `session.copyInviteLink`,让宿主打开当前会话的邀请对话框,生成限时票据链接;皮肤不能读取票据或连接凭据。语音状态投影中的 `serverLabel` 会在看起来像 IP、域名或连接目标时省略,避免把地址显示为服务器名称。
示例包见 [KAAK voice 示例](./examples/KAAK-VOICE.md),其 components.json 使用完整首页与语音工作区 surface,展示收藏服务器、频道树、在线成员、聊天和可信语音控制的组合;[Open Voice Surface](./examples/OPEN-VOICE-SURFACE.md) 保留为通用格式验证脚手架。KAAK 的语音视觉参考来自用户授权进入的前两个语音房间;只记录布局,不保留服务器/房间标识、成员名或聊天内容。组件按本地用户授权后才渲染;权限对每个皮肤版本、页面和组件分别保存,可在宿主权限入口撤销。页面替换时,宿主会额外显示“返回标准界面”和“恢复内置皮肤”入口;拒绝授权或离开 surface 后,普通页面可立即恢复。
组件树有硬上限:components.json 256 KiB。schema v1/v2 上限为 32 个组件、每组件 256 个模板节点、16 层深度和 100 条重复记录;schema v3 上限为 128 个组件、每组件 2048 个模板节点、32 层深度和 250 个重复行,并允许 64 个本地标量状态与 64 个动作。Wasm 动态 UI 输出的 schema v4/v5/v6 有 256 KiB 总输出上限、最多 64 个组件、每个节点最多 64 个属性和 256 个子节点,并沿用每组件节点/深度限制;渲染器接受标准 HTML/SVG 元素及普通属性,而不是由元素/属性展示白名单限制。脚本、嵌入式浏览器、网络/导航属性、事件属性和行内 style 仍拒绝;样式通过经过隔离校验的插件 CSS 提供。包内图片通过专用资源字段引用,自定义元素映射为惰性 `div`。宿主只通过 `isTrusted` 用户事件发出剥离 DOM/Event 对象后的 `extension-event`,Wasm 侧只能经 `env.ui_input_read` 一次读取最多 64 KiB 的 JSON,包含插件本地状态、安全事件和宿主按插件读取权限投影的数据。每份数据投影最多 48 KiB,只含公开字段;地址、凭据、SDK 对象和未声明字段不会进入 guest。输入字段限长;生成界面中的 password/file/hidden 类型输入会拒绝。UI 循环已经接入 WebClient 授权生命周期,可把可信事件或最新数据快照作为下一次独立 Wasm 调用输入,最多串行排队 8 项并验证回调/状态归属;动作桥复核清单权限和会话状态。单个页面实例最多并发运行 2 个 Wasm worker,并限制最多排队 64 项。
图片资源只能从包内引用,CSS 不能读取外部 URL、脚本或浏览器存储。宿主动作需显式权限,并只能绑定可信的用户事件;输入或 change 事件不能触发宿主动作。focus/blur、hover 和 drag-start/over 等被动事件只可改动组件本地状态,不能触发语音操作。
注意:v3 CSS 和 surface 可以隐藏或遮挡普通语音控件。权限和返回标准界面提示由宿主在皮肤根之外绘制;其他界面控件仍受皮肤排版影响。测试时务必确保麦克风、设置、退出语音、屏幕共享操作和移动端导航仍有可达路径。组件演示页 /demo 使用合成数据,加入频道和聊天动作只更新演示状态;它不支持宿主控件或整页替换。
### 本地组件结构编辑器
公开客户端页可打开“组件结构”编辑器,直接管理当前皮肤版本的声明式组件树。它支持创建、复制、删除组件和节点、添加子节点或同级节点、调整顺序、编辑组件元数据与节点 JSON、撤销/重做,以及导入/导出 components.json。该编辑器不属于管理员面板,不加载到 /admin/**。
编辑器只保存本地 authoring 覆盖,键按皮肤 ID 和版本隔离;原始皮肤包不会被改写。导入及每次提交都会走 parseSkinPluginDocument 的同一 schema 和权限校验,运行时也再次验证从本地存储读出的文档。不能通过编辑器新增任意脚本、事件处理器属性、外部资源、未知数据路径、宿主保留的 data-ws-* 属性、未授权宿主动作或未登记的宿主控件。旧 v2 组件首次升级到 v3 时,编辑器会为受保护的内置宿主控件补齐对应权限声明;这不会自动批准权限,控件继续等待宿主授权 UI 明确确认。
旧 schema v1/v2 皮肤可以保持原样使用,第一次结构编辑时会把已验证的数据规范化为 schema v3;旧包自身不被升级或覆盖。schema v3 允许 components 为空:删除最后一个皮肤组件会恢复基础 WebSpeak 页面,宿主授权与恢复控件始终在皮肤内容之外。节点不能脱离组件根单独删除;重要节点应设置稳定 part 名称,避免树顺序变化后基于路径生成的布局覆盖指向其他节点。
### schemaVersion 4:插件包描述与有界 Wasm 运行时
v4 在 open-skin 包中增加必需的 `plugins` 路径,并允许沿用可选 `layout` 路径提供插件根和节点的作者默认布局。服务端登记和客户端导入共用 `plugins.json` schema v1 校验器;校验插件 ID、页面、模式、权限、文件归属、路径唯一性和包内文件大小,并将插件文件与普通皮肤素材分别缓存。客户端还会对 Wasm 入口执行固定导入/导出 ABI 预检。SHA-256 授权基础会绑定插件描述、入口、样式和全部素材;本机授权记录还会绑定皮肤/插件版本、API 版本和权限策略版本。摘要只能发现已授权内容被替换,不能证明发布者身份。WebClient 有本地授权对话框和 Wasm 运行生命周期;目前支持安全 UI 输出、可信 UI 事件回调、插件专属 CSS、按清单权限过滤的公开数据投影(单份最多 48 KiB)和首版单动作宿主桥。支持的数据读取权限包括 `session.status.read`、`session.channels.read`、`session.members.read`、`chat.channel.read`、`favorites.read`、`servers.quickList.read`、`audio.status.read`、`voice.whisper.status.read`、`voice.screenShare.status.read` 和 `voice.screenShare.read`,另支持 `ui.surface.replace`。`ui.input.read` 单独控制插件是否能收到用户在插件自有输入框中输入或被浏览器自动填入的值;未获授权时仍可收到事件类型,但不会收到文本或勾选值。密码、文件和隐藏输入始终拒绝。宿主动作仅可由可信 UI 事件触发,按清单权限、动作参数和会话状态再次校验;生产构建也有全局 worker 上限。跨浏览器验证和独立安全审查仍待完成。
```json
{
"schemaVersion": 4,
"packageType": "open-skin",
"id": "community.example-plugin-skin",
"name": "Example plugin skin",
"version": "1.0.0",
"author": "Example author",
"license": "MIT",
"entry": "skin.css",
"plugins": "plugins.json",
"minAppVersion": "0.2.7"
}
```
`plugins.json` 顶层 `schemaVersion` 当前为 `1`,并包含 1–64 个插件。每个插件声明 `id`、`name`、`version`、`apiVersion: 1`、`page`(`home` 或 `voice`)、`mode`(`widget` 或 `surface`)、必需的 `entry`、可选的 `mount`、`runtime`、`style`、素材路径数组 `assets` 和 `permissions`。入口扩展名 `.js` 默认对应 `javascript`,`.wasm` 默认对应 `wasm`;显式 `runtime` 必须与入口扩展名一致。入口及样式必须位于 `plugins/<id>/`;素材必须位于该插件自己的 `assets/` 子目录,只能是本地图片或 woff2 字体。插件不能共享文件;同一公开页面最多有一个 `surface`,且必须申请 `ui.surface.replace`。surface 不能声明 `mount`;widget 可选声明一个与 page 相符的宿主槽位。未指定时放在页面级插件宿主中。`ui.input.read` 是单独的输入值读取权限,授权提示会说明浏览器自动填入的值也可能被读取;不得让用户在皮肤输入框中输入密码或其他秘密。其余权限只能从 `src/shared/skin-plugin.ts` 的现有权限表中选择。
`plugins.json` 不超过 256 KiB;每个入口 JS 或 Wasm 不超过 256 KiB,每个样式 CSS 不超过 512 KiB;每个插件最多声明 32 个素材。客户端导入会拒绝不符合固定内存、导入、导出和 Wasm 模块结构限制的入口。皮肤包整体仍受通用 ZIP 文件数、展开大小、图像和字体限额约束。v1–v3 不接受插件代码。v4 JavaScript 仍只校验、缓存,不执行。生产 Wasm 仅在用户显式授权、摘要匹配时通过有界解释器启动一次性任务;它已支持上述权限化只读投影、安全 UI 更新和首版宿主动作桥。动作由可信 UI 事件引发、由宿主按插件权限和会话状态复核;浏览器瞬时手势不会跨越异步 Wasm 执行,因此屏幕采集必须通过可信宿主控件直接开始。数据变化会触发一轮新的有界执行。不要将有 DOM 的 iframe 当作网络沙箱:sandbox 不阻止 iframe 自己导航,`navigate-to` 也不能作为跨浏览器安全保证。
widget 的可选 `mount` 只接受这些公开锚点:`home.header.after`、`home.content.before`、`home.content.after`、`home.footer.before`、`voice.server-rail.before`、`voice.server-rail.after`、`voice.header.before`、`voice.header.after`、`voice.activity.before`、`voice.activity.after`、`voice.chat.before`、`voice.chat.after`、`voice.channel-panel.before`、`voice.channel-panel.after`、`voice.audio-dock.before`、`voice.audio-dock.after`、`voice.mobile-nav.before`、`voice.mobile-nav.after` 和 `voice.workspace.overlay`。它们提供初始语义位置;作者仍可用插件 CSS 和本地布局编辑器自由调整位置、尺寸、显隐、安全外观及同级顺序。surface 替换内置页面时,如果声明的槽位不存在,插件会回退到页面级宿主,避免 UI 丢失。专用的插件挂载管理界面仍未实现。布局权限只覆盖当前皮肤中实际渲染的插件节点,不能越过自身节点调整其他插件或宿主恢复控件。生产 v4 宿主已按 descriptor 管理当前页 widget/surface、授权、输出、事件循环、样式和清理。
## 当前运行时数据与权限
以下数据权限按组件或插件单独声明。授权按皮肤/插件版本、页面、组件和权限策略绑定;拒绝或撤销后,相应组件不再渲染或调用动作。服务端地址、密码、身份密钥、访问令牌、Cookie、私聊内容、原始音频和屏幕流不会传给皮肤。
| 权限 | 公开内容 |
| --- | --- |
| `session.status.read` | 当前连接状态、频道和显示名称。 |
| `session.channels.read` | 可见频道树、名称、层级、当前人数、服务器公布的人数上限和当前频道标记;不包含密码或服务器地址。 |
| `session.members.read` | 可见成员名称、频道、在线/说话状态及本人标记;不含头像图像。 |
| `session.memberAvatars.read` | 允许可信 `voice.member-cards` 控件在宿主内显示已缓存头像,图像字节和 URL 不进入皮肤数据。 |
| `chat.channel.read` | 当前公开文字频道中可见的消息,不含私聊。 |
| `favorites.read` | 收藏名称、类型、当前标记和不透明本地令牌,不含地址或凭据。 |
| `servers.quickList.read` | 收藏与最近服务器的名称、类型、当前标记和不透明本地令牌,不含地址或凭据。 |
| `audio.status.read` | 用户自己的麦克风/扬声器静音、降噪和伴奏状态,不含音频。 |
| `voice.whisper.status.read` | 悄悄话状态和已配置目标数量。 |
| `voice.screenShare.status.read` | 用户自己的屏幕共享状态。 |
| `voice.screenShare.read` | 当前可见共享的名称、来源、所有者名称、音频标记和观看人数,不含媒体流。 |
`ui.surface.replace` 授权公开首页或语音页的整页替换。`ui.input.read` 是独立的输入读取权限;用户同意后,插件可读取其输入框文本或浏览器自动填入值。密码、文件和隐藏输入始终不提供给插件。不要在插件输入框中要求用户输入密码或其他秘密。
宿主动作只允许从公开运行时 API 中选择,并在调用时重新核对权限、参数和当前会话:
- `session.copyInviteLink`(`session.invite.copy`)打开宿主邀请对话框,生成并复制当前服务器/频道的限时票据链接。有效期为 1–43200 分钟;服务器密码及已成功使用的频道密码仅由服务端加密保存和使用,不传给皮肤或受邀浏览器。若本次会话尚未提供所需服务器密码或当前上锁频道密码,由宿主对话框向创建者收集。邀请凭据失效时提示受邀者联系创建者,不要求受邀者补输服务器密码。受邀者只需输入昵称,不能用链接参数覆盖票据绑定的服务器和频道。
邀请对话框公开样式部件:`voice.invite.backdrop`、`voice.invite.dialog`、`voice.invite.form`、`voice.invite.create`、`voice.invite.copy`。这些钩子仅用于外观;输入值与票据不进入皮肤数据投影。
- `voice.joinChannel`(`session.channel.join`)仅请求加入当前公开可见的频道,继续使用宿主的频道密码和权限流程。
- `favorites.switch`(`favorites.switch`)与 `quickServers.switch`(`servers.quickList.switch`)使用不透明令牌选择本机已有目标,并复用宿主连接流程。
- `chat.sendMessage`(`chat.channel.send`)只向当前公开文字频道发送消息,不包括私聊。
- `ui.setState` 和 schema v3 的 `ui.toggleState` 只修改该组件隔离的本地状态。
- schema v3 还支持经相应权限验证的本人麦克风/扬声器静音、降噪、伴奏、输出音量、音频设置、断开连接、离开状态、悄悄话和屏幕共享操作。`voice.startScreenShare` 必须通过可信宿主控件触发,以保留浏览器的用户操作授权。
- 屏幕共享成员标记可读取 `session.members` 中的 `screenSharing` 和 `screenShareStreamId`;观看操作 `voice.joinScreenShare` 还需 `voice.screenShare.control`。
控件节点将 WebSpeak 原生控件放进皮肤布局,但不会暴露其内部状态或数据对象。事件可包含 click、dblclick、键盘、焦点、指针和拖放等受限类型;被动事件只能改动组件本地状态,敏感动作必须由可信的明确用户操作触发。宿主再次校验目标、令牌、共享 ID 和当前权限。
## v4 Wasm 运行限制与恢复
每个 v4 插件使用按皮肤、插件、版本、API、文件摘要和权限策略绑定的本地授权。安装不等于运行;内容或权限变化后须重新授权。运行时通过宿主过滤权限字段后提供结构化快照,不传递 DOM、原生 TeamSpeak 对象或网络/持久化 API。
| 资源 | 当前上限 |
| --- | ---: |
| 单份插件数据快照 | 48 KiB |
| 单次 UI 输入 | 64 KiB |
| 单次动态 UI 输出 | 256 KiB |
| Wasm 客体线性内存 | 4 MiB |
| Wasm 指令燃料 | 10,000,000 |
| 每个页面实例并发运行 | 2 个 worker |
| 等待队列 | 64 个任务;等待 120 秒后拒绝 |
Wasm 每轮最多读取一次输入并提交一个 UI 输出;首版宿主动作桥只接受可信 UI 事件同一轮执行提出的一个动作。共享屏幕采集不允许从异步动作启动,必须走可信宿主按钮。动态输出由宿主校验后创建安全 HTML/SVG 节点,不按 HTML 字符串执行;作者 CSS 限定在皮肤或插件容器中。切页、撤权、超时或插件错误会停止相应任务并恢复宿主界面。插件不能创建 DOM iframe、调用外部资源、导航页面或读写任意浏览器存储。
## 首页内容和文案
`content.json` 完全可选。WebSpeak 自带中文、英语、德语、俄语和日语的基础内容,因此纯美术皮肤无需复制翻译文件。若希望为皮肤定制部分文案,可按 locale 覆盖连接首页内容和公开界面文案;未定义的语言、字段或翻译键会回退到 WebSpeak 内容,不要求皮肤重复提供整套文字。当前允许 1–20 个 locale,locale 写作 `en`、`zh-CN`、`ja-JP` 等形式。`defaultLocale` 必须指向一个已定义的 locale。示例:
声明式 `components.json` 也可以显示皮肤自己的多语言文案。文本节点、字符串属性,以及组件 `name` / `accessibleName` 可使用 `{{skin.messages.<key>}}` 绑定。WebSpeak 会把皮肤 `content.json` 中 `defaultLocale`、当前语言代码和完整语言代码的 `messages` 合并到 `skin.messages`,当前语言内容覆盖默认文案;这个绑定适用于首页、语音页和 Demo 页的声明式组件。没有匹配的 key 会显示为空字符串,因此组件引用的 key 应在默认语言中提供。该本地化路径只提供皮肤包自身的文案,不会扩展 Wasm 插件的权限化运行时数据。
```json
{
"defaultLocale": "en",
@@ -121,16 +394,30 @@ assets/brand.woff2 # 可选:自带字体
下列名称来自当前前端模板。对新功能,作者可以先用通用 `control` 部件;后续新增稳定部件会更新本目录。
服务器和频道密码弹窗共用 `auth.password.backdrop`、`auth.password.dialog`、`auth.password.decoration`、`auth.password.eyebrow`、`auth.password.title`、`auth.password.lead`、`auth.password.form`、`auth.password.label`、`auth.password.field`、`auth.password.field-icon`、`auth.password.error` 和 `auth.password.actions`。
服务器和频道密码弹窗共用 `auth.password.backdrop`、`auth.password.dialog`、`auth.password.close`、`auth.password.close-icon`、`auth.password.decoration`、`auth.password.eyebrow`、`auth.password.title`、`auth.password.lead`、`auth.password.form`、`auth.password.label`、`auth.password.field`、`auth.password.field-icon`、`auth.password.input`、`auth.password.error`、`auth.password.actions`、`auth.password.cancel`、`auth.password.submit`、`auth.password.spinner` 和 `auth.password.submit-icon`。
| 页面区域 | `data-ws-part` |
| --- | --- |
| 通用 | `app`、`app.toast`、`control`、`skin.trigger`、`skin.menu`、`skin.option`、`language.trigger`、`language.menu`、`language.option` |
| 首页 | `home`、`home.header`、`home.brand`、`home.header-tools`、`home.gateway-status`、`home.content`、`home.hero`、`home.hero.eyebrow`、`home.hero.title`、`home.hero.description`、`home.features`、`home.feature`、`home.visitors`、`home.join-card`、`home.join-card.waveform`、`home.join-card.sonar`、`home.join-title`、`home.join-description`、`home.notice`、`home.form`、`home.server-target`、`home.field-label`、`home.field`、`home.relay-choice`、`home.relay-choice.copy`、`home.server-history`、`home.server-history.group`、`home.favorite-toggle`、`home.identity`、`home.connect`、`home.security-note`、`home.footer`、`home.community-dialog` |
| 语音工作区 | `voice.shell`、`voice.workspace`、`voice.header`、`voice.header-actions`、`voice.breadcrumbs`、`voice.performance`、`voice.performance.panel`、`voice.performance.route`、`voice.performance.metrics`、`voice.performance.status`、`voice.performance.webrtc-stats`、`voice.connection-status`、`voice.audio-status`、`voice.poke`、`voice.scroll`、`voice.content`、`voice.activity`、`voice.activity.artwork`、`voice.activity-heading`、`voice.screen-share-error`、`voice.members`、`voice.members.empty`、`voice.member`、`voice.member.avatar-wrap`、`voice.member.avatar`、`voice.member.name`、`voice.member.status`、`voice.member.live-indicator`、`voice.member.stop-share`、`voice.member.share-actions`、`voice.member-panel`、`voice.member-panel.heading`、`voice.member-panel.search`、`voice.member-panel.channels`、`voice.channel-group`、`voice.channel-group.heading`、`voice.channel-group.members`、`voice.member-row`、`voice.member-row.avatar`、`voice.member-row.copy`、`voice.member-row.flags`、`voice.member-row.volume`、`voice.whisper-strip`、`voice.audio-dock`、`voice.audio-dock.microphone`、`voice.audio-dock.microphone-panel`、`voice.audio-dock.output`、`voice.audio-dock.output-panel`、`voice.audio-settings`、`voice.mobile-more`、`voice.mobile-nav` |
| 聊天与菜单 | `voice.chat`、`voice.chat.tabs`、`voice.chat.tab`、`voice.chat.heading`、`voice.chat.messages`、`voice.chat.event`、`voice.chat.message`、`voice.chat.message-avatar`、`voice.chat.message-body`、`voice.chat.message-bubble`、`voice.chat.empty`、`voice.chat.composer`、`voice.context-menu-backdrop`、`voice.context-menu`、`voice.context-menu.header`、`voice.context-menu.move-submenu` |
| 首页 | `home`、`home.header`、`home.brand`、`home.header-tools`、`home.gateway-status`、`home.content`、`home.hero`、`home.hero.eyebrow`、`home.hero.title`、`home.hero.description`、`home.features`、`home.feature`、`home.visitors`、`home.visitors.orbit`、`home.visitors.icon`、`home.visitors.label`、`home.visitors.divider`、`home.visitors.total`、`home.visitors.spark`、`home.join-card`、`home.join-card.waveform`、`home.join-card.sonar`、`home.join-title`、`home.join-description`、`home.notice`、`home.form`、`home.server-target`、`home.field-label`、`home.field`、`home.relay-choice`、`home.relay-choice.copy`、`home.server-history`、`home.server-history.group`、`home.server-history.item`、`home.server-history.select`、`home.server-history.favorite-toggle`、`home.favorite-toggle`、`home.identity`、`home.identity-actions`、`home.identity-provider.button`、`home.identity-provider.label`、`home.identity-import.open`、`home.identity-export.button`、`home.identity-import-dialog`、`home.identity-import.header`、`home.identity-import.close`、`home.identity-import.textarea`、`home.identity-import.drop-zone`、`home.identity-import.file-button`、`home.identity-import.error`、`home.identity-import.security`、`home.identity-import.footer`、`home.identity-import.cancel`、`home.identity-import.submit`、`home.server-announcement`、`home.server-announcement.title`、`home.server-announcement.body`、`home.social-links`、`home.connection-status`、`home.connect`、`home.security-note`、`home.footer`、`home.community-dialog` |
| 语音工作区 | `voice.shell`、`voice.workspace`、`voice.header`、`voice.header-actions`、`voice.plugin-toolbar`、`voice.plugin-launcher`、`voice.plugin-drawer`、`voice.plugin-drawer.app`、`voice.breadcrumbs`、`voice.performance`、`voice.performance.panel`、`voice.performance.route`、`voice.performance.metrics`、`voice.performance.status`、`voice.performance.webrtc-stats`、`voice.connection-status`、`voice.audio-status`、`voice.poke`、`voice.scroll`、`voice.content`、`voice.activity`、`voice.activity.artwork`、`voice.activity-heading`、`voice.screen-share-error`、`voice.members`、`voice.members.empty`、`voice.member`、`voice.member.action-trigger`、`voice.member.avatar-wrap`、`voice.member.avatar`、`voice.member.mic-status`、`voice.member.name`、`voice.member.status`、`voice.member.live-indicator`、`voice.member.stop-share`、`voice.member.share-actions`、`voice.member-panel`、`voice.member-panel.heading`、`voice.member-panel.search`、`voice.member-panel.channels`、`voice.channel-group`、`voice.channel-group.heading`、`voice.channel-group.members`、`voice.member-row`、`voice.member-row.avatar`、`voice.member-row.copy`、`voice.member-row.flags`、`voice.member-row.volume`、`voice.whisper-strip`、`voice.audio-dock`、`voice.audio-dock.microphone`、`voice.audio-dock.microphone-panel`、`voice.audio-dock.output`、`voice.audio-dock.output-panel`、`voice.audio-settings`、`voice.audio-settings.device-select`、`voice.audio-settings.device-select-trigger`、`voice.audio-settings.device-select-chevron`、`voice.audio-settings.device-select-menu`、`voice.audio-settings.device-select-option`、`voice.mobile-more`、`voice.mobile-nav` |
| KOOK 频道树与服务器切换 | `voice.server-switcher`、`voice.server-switcher.trigger`、`voice.server-switcher.menu`、`voice.server-switcher.item`、`voice.server-switcher.icon`、`voice.server-switcher.label`、`voice.server-switcher.current`、`voice.server-switcher.empty`、`voice.channel-tree.list`、`voice.channel-tree.empty`、`voice.channel-tree.node`、`voice.channel-tree.line`、`voice.channel-tree.expander`、`voice.channel-tree.row`、`voice.channel-tree.icon`、`voice.channel-tree.join-hint`、`voice.channel-tree.name`、`voice.channel-tree.count`、`voice.channel-tree.branch`、`voice.channel-tree.member`、`voice.channel-tree.avatar`、`voice.channel-tree.member-name`、`voice.channel-tree.member-muted`、`voice.channel-tree.member-screen-share`、`voice.channel-tree.member-speaking`、`voice.channel-tree.member-away` |
| 快速服务器 | `voice.favorite-servers.rail`、`voice.favorite-servers.rail.list`、`voice.favorite-servers.rail.item`、`voice.favorite-servers.server`、`voice.favorite-servers.avatar`、`voice.favorite-servers.tooltip`、`voice.favorite-servers.favorite-toggle`、`voice.favorite-servers.add`、`voice.favorite-servers.strip`、`voice.favorite-servers.strip.item`、`voice.favorite-servers.strip.server`、`voice.favorite-servers.strip.favorite-toggle`、`voice.favorite-servers.strip.add`、`voice.favorite-servers.switch-status`、`voice.favorite-servers.current-toggle`、`voice.favorite-servers.dialog-backdrop`、`voice.favorite-servers.dialog`、`voice.favorite-servers.dialog.header`、`voice.favorite-servers.dialog.close`、`voice.favorite-servers.dialog.form`、`voice.favorite-servers.dialog.field`、`voice.favorite-servers.dialog.input`、`voice.favorite-servers.dialog.target`、`voice.favorite-servers.dialog.hint`、`voice.favorite-servers.dialog.actions`、`voice.favorite-servers.dialog.cancel`、`voice.favorite-servers.dialog.submit` |
| 聊天与菜单 | `voice.chat`、`voice.chat.tabs`、`voice.chat.tab`、`voice.chat.heading`、`voice.chat.messages`、`voice.chat.event`、`voice.chat.message`、`voice.chat.message-avatar`、`voice.chat.message-body`、`voice.chat.message-bubble`、`voice.chat.empty`、`voice.chat.composer`、`voice.chat.status`、`voice.context-menu-backdrop`、`voice.context-menu`、`voice.context-menu.header`、`voice.context-menu.move-submenu` |
| 屏幕共享 | `voice.screen-share-settings`、`voice.screen-share-settings.heading`、`voice.screen-share-settings.fields`、`voice.screen-share-settings.note`、`voice.screen-share-settings.actions`、`voice.screen-player`、`voice.screen-player.stage`、`voice.screen-player.video`、`voice.screen-player.placeholder`、`voice.screen-player.exit`、`voice.screen-player.viewers`、`voice.screen-player.viewer-avatar`、`voice.screen-player.live`、`voice.screen-player.source`、`voice.screen-player.controls`、`voice.screen-player.volume`、`voice.screen-player.fullscreen` |
| `/demo` 演示页 | `demo.header`、`demo.brand`、`demo.header-tools`、`demo.badge`、`demo.skin-switcher`、`demo.language-switcher`、`demo.home-link`、`demo.reconnect`、`demo.reconnect.restore`、`demo.layout`、`demo.channels`、`demo.channels.heading`、`demo.channel`、`demo.channel.select`、`demo.channel.members`、`demo.main`、`demo.hero`、`demo.live`、`demo.hero.title`、`demo.hero.description`、`demo.hero.online`、`demo.wave`、`demo.voice-heading`、`demo.voice-grid`、`demo.voice-card`、`demo.avatar`、`demo.member-name`、`demo.member-status`、`demo.chat.heading`、`demo.chat.tabs`、`demo.chat.tab`、`demo.chat.messages`、`demo.chat.message`、`demo.chat.empty`、`demo.chat.composer`、`demo.chat.input`、`demo.chat.send`、`demo.actions`、`demo.actions.heading`、`demo.action.speaking`、`demo.action.poke`、`demo.action.reconnect`、`demo.note`、`demo.user`、`demo.poke-notification`、`demo.poke.dismiss` |
| 宿主外壳(皮肤根之外 / 宿主固定绘制) | 可主题化:`host.plugins.launcher`、`host.plugins.overlay`、`host.watermark`、`host.hint`、`host.voice-status-decoration`;`host.recovery`(可经 `chrome.json#slots` 以胶囊或 `mode: "toolbar"` 的宿主按钮停靠,并可用 `--skin-recovery-*` / `--skin-host-*` 以及 `--skin-recovery-toolbar-*` / `--skin-host-toolbar-*` 令牌换肤)/ `host.permission` 与 `app.skin-load-recovery`(无 CSS 钩子;分别用 `--skin-permission-*` / `--skin-load-recovery-*` 令牌换肤,见下文);`skin.library` 是皮肤菜单里的应用库入口 |
| 首页页脚拆分 | `home.footer`(容器,不可隐藏)、`home.footer.decoration`(装饰文案,可隐藏)、`home.footer.clear`(必要链接,受保护) |
`voice.member.avatar` 是语音活动区头像;`voice.member-row.avatar` 是右侧成员树头像。状态属性还会使用 `current`、`drag-over`、`dragging`、`self`、`events-empty` 和 `messages-empty`。当前根节点以及屏幕共享播放器、弹窗、菜单都属于同一皮肤作用域。
`voice.member.avatar` 是语音活动区头像;`voice.member.mic-status` 在成员麦克风静音时显示,状态值为 `muted`;`voice.member.action-trigger` 是打开宿主成员操作菜单的按钮,由成员卡片小组件的 `options.memberActions` 控制;`voice.member-row.avatar` 是右侧成员树头像。语音成员列表的动态项提供 `.ws-voice-member-enter-active`、`.ws-voice-member-leave-active`、`.ws-voice-member-enter-from`、`.ws-voice-member-leave-to` 和 `.ws-voice-member-move` 动效钩子,可分别设置加入、离开和排序变化的过渡。状态属性还会使用 `current`、`drag-over`、`dragging`、`self`、`events-empty` 和 `messages-empty`。当前根节点以及屏幕共享播放器、弹窗、菜单都属于同一皮肤作用域。
`voice.channel-tree`、`voice.server-switcher`、`voice.server-header` 和 `voice.server-banner` 是 WebSpeak 可信宿主控件。频道树按 TeamSpeak 返回的层级展示语音频道与成员;展开按钮只改变本地显示,双击频道或聚焦后按 Enter 才加入频道。服务器栏布局让频道成员保持可见,折叠按钮只收起子频道。成员头像和语音状态只在宿主渲染的频道树中出现,不会传给皮肤插件。服务器头部在宿主中展示状态并按频道名筛选;切换入口只列出本机收藏和最近连接,可用不透明本地标识触发既有连接流程;地址、密码和身份材料不会传给皮肤组件。服务器欢迎区需 `session.status.read`,从 TeamSpeak `serverinfo` 读取横幅 URL 和欢迎语;没有可用内容时隐藏。欢迎语作为纯文本渲染;`voice.server-banner.image`、`voice.server-banner.welcome`、`voice.server-banner.icon`、`voice.server-banner.title` 与 `voice.server-banner.body` 可由布局编辑器调整。
首页快速连接和语音工作区的服务器栏共用同一列表:收藏项排在前面,最近连接补在后面;地址相同的收藏与历史只显示一项。每项的星标按钮可在两个位置收藏或取消收藏,取消收藏后若该服务器仍在最近连接中,它会留在列表的最近连接位置。皮肤可通过 `data-ws-state="favorite|recent"` 区分首页条目,通过 `data-ws-server-kind="favorite|recent"` 区分语音栏条目。
首页身份选项支持导入 TeamSpeak `.ini` 或身份字段,并可导出为 TeamSpeak `.ini`;导入弹窗解析身份的过程在浏览器本地完成。自定义皮肤可以分别调整身份操作按钮、粘贴区、拖放区域、安全提示和弹窗按钮,但不得隐藏或弱化权限继承与私钥安全提示。
`voice.activity.artwork` 是位于语音活动区内容上方的固定装饰平面。皮肤可以在其上绘制带透明背景的立绘,让角色压住成员卡片或直播画面的边缘;平面本身不占布局空间、不拦截点击,成员和播放器控件仍保持可交互。只通过背景图及背景定位/缩放来适配素材,不改变其定位和层级。
@@ -144,6 +431,336 @@ assets/brand.woff2 # 可选:自带字体
}
```
### 宿主外壳主题化(v3 / v4 开放皮肤)
应用库窗口、水印、非关键提示与空状态装饰绘制在皮肤根之外;插件入口保留在语音工作区顶部工具栏。宿主提供第二个文档级作用域来主题化这些部件:
- 皮肤激活时,宿主在 `documentElement` 上设置 `data-ws-host-skin="<皮肤 ID>"`;停用或回退到内置皮肤时立即移除。
- 编译 `skin.css` 时,**只**命中下列宿主部件的单个选择器会被限定到 `:root[data-ws-host-skin="<皮肤 ID>"] …`,其余规则仍限定到 `.ws-skin-root[data-ws-skin="…"]`。宿主部件的选择器必须**以可主题化的 `[data-ws-part="host.…"]` 开头**,不能把 `:root`、`html`、`body` 或 `*:has(…)` 作为规则主体;`:root:has([data-ws-part="host.watermark"])` 一类写法会被拒绝。皮肤作者不能自己写 `html`、`body`、`data-ws-host-skin`、`data-ws-route`、`data-theme` 或 `data-ws-skin` 选择器,也不能在同一选择器里混用宿主部件与页面部件;宿主部件只对 schema v3/v4 开放皮肤生效。
- 宿主外壳的布局与层级:应用库外壳 `host.plugins.overlay` 仍由 WebSpeak 拥有——皮肤可改颜色、边框、圆角、阴影和素材,但不能用 `position`、`inset`、`z-index`、`transform`、尺寸等把它或其子元素变成全屏遮罩。装饰性宿主部件(`host.watermark`、`host.hint`、`host.voice-status-decoration`、`host.plugins.launcher`)可以被重定位、改变尺寸和动画化;恢复路径不依赖它们。
- 自定义变量仍必须使用 `--skin-` 前缀(不能覆盖宿主内部令牌),`@import`、脚本、`expression()`、`javascript:` 等仍被拒绝。
- 皮肤根作用域只在根内部向下生效。编译器会拒绝任何以 `:root` 开头、紧跟兄弟组合符(`+` / `~`)的选择器,例如 `:root ~ *`、`:root ~ [data-ws-host-layer]` 或 `:root:hover + div`;这类规则会被改写为皮肤根的兄弟选择器,从而够到 body 上的宿主层。`:root [data-ws-part="home.header"]`、`:root > [data-ws-part=…]` 这类后代/子代写法仍然可用。
- 宿主自有层的属性 `data-ws-host-layer`、`data-ws-host-recovery`、`data-ws-host-recovery-toolbar`、`data-ws-host-layer-content` 与 `data-ws-recovery-action` **不是皮肤钩子**:它们不在公开部件表中,编译器会按名称拒绝引用它们的皮肤选择器(包括 `:root [data-ws-host-layer]`、`:root [data-ws-part="home.header"] [data-ws-host-recovery-toolbar]` 这类带公开钩子的混合写法)。
- 无 Popover API 或顶层提升被拒绝时,恢复胶囊会退回固定宿主层并使用 32 位最大 `z-index: 2147483647`。宿主层在 `#app` 之后追加到 `document.body`;与树内皮肤层同为最大层级时,后绘制的宿主层仍在上面。顶层(top layer)路径的 `showPopover()` / `showModal()` 仍高于两者。
可主题化的宿主部件:
| 部件 | 内容 |
| --- | --- |
| `host.plugins.launcher` | 语音工作区顶部的插件按钮(颜色、尺寸、圆角、背景图均可改;也可声明式隐藏) |
| `host.plugins.overlay` | 应用库浮层窗口外壳;**不含**权限对话框里的批准/拒绝(`host.permission`) |
| `host.watermark` | 页面大淡 WebSpeak 品牌水印 |
| `host.hint` | 非关键提示文案(「音频控制始终保留…」一类) |
| `host.voice-status-decoration` | 右栏空的 Voice status 装饰条;与必要状态 `voice.connection-status`、`voice.audio-status` 完全分开 |
### 恢复入口与授权对话框:结构上不可被皮肤触及
`host.recovery`(恢复入口)与 `host.permission`(授权对话框)是可信宿主控件。它们**不是**可供皮肤选择或直接改写的 CSS 钩子;当前客户端把两者渲染在 `Teleport` 到 `body` 的宿主层里,该层满足下面三条,编译后的皮肤 CSS 无法命中、遮挡或禁用它们。皮肤可以通过下文「受保护控件的主题化」中的受控令牌让它们融入外观,`host.recovery` 还可以通过 `chrome.json#slots` 停靠到皮肤布局,或声明 `mode: "toolbar"` 后以无胶囊壳的宿主按钮并入皮肤顶栏(见下文「工具栏模式」):
1. **闭合 Shadow DOM**:内容位于 `attachShadow({ mode: "closed" })` 的根内。作者 CSS(无论影子根开或闭)不能跨越 shadow 边界;宿主层元素本身也不带任何 `data-ws-part`,因此连文档级宿主作用域(`:root[data-ws-host-skin="…"] [data-ws-part="host.…"]`)也匹配不到。
2. **顶层(top layer)**:恢复入口是 `popover="manual"`,授权对话框是 `<dialog>` + `showModal()`。顶层绘制高于所有普通层叠上下文,包括皮肤把某个公开部件写成 `position: fixed; inset: 0; z-index: 2147483647` 的全屏层。
3. **不依赖可主题化浮层**:恢复面板的「使用内置皮肤」直接重置到内置 Day/Night 皮肤,不经过 `host.plugins.overlay`;即使皮肤把该浮层写成 `display: none !important` 或 `pointer-events: none`,重置仍然生效。「应用库」按钮只是一条便利路径,会走常规应用库浮层,因此不是兜底路径。
**显示规则**:只要当前是第三方(非内置/非官方)皮肤,恢复入口就作为小型常驻胶囊显示在左下角(皮肤可通过下文的 `chrome.json#slots` 申请停靠到自己的锚点,或用 `mode: "toolbar"` 改成宿主顶栏按钮);它不是水印或装饰条,官方 Day、Night、ILLUSIA 与 KAAK 皮肤不会自动出现它。对内置/官方皮肤,它只在 `host.plugins.launcher` 被实例配置或 `chrome.json` 声明隐藏、或宿主在已连接状态下检测到启动器被 CSS 隐藏/移出视口/不可点击时作为兜底出现。
**键盘快捷键**:第三方皮肤被允许时,`Ctrl+Alt+Shift+R`(macOS 为 `⌘+⌥+⇧+R`)随时把同一宿主层恢复入口召唤到顶层并聚焦第一个按钮;无论胶囊是停靠、浮动还是被 `mode: "toolbar"` 替换,快捷键都会临时隐藏工具栏并显示完整胶囊。macOS 上 ⌥ 会把字母键变成派生字符(美式为 `®`),宿主同时按物理键码 `KeyR` 判定,所以该组合键仍然生效。它不与 WebSpeak 现有快捷键或浏览器常用快捷键冲突。监听器运行在捕获阶段,皮肤或插件脚本提前调用 `preventDefault()` 不会吞掉该组合键。
`host.recovery` 与 `host.permission` 这两个名称仅保留为文档/布局元数据中的概念标识,**不对应可被皮肤命中的 DOM 钩子**。当前客户端没有渲染 `host.permission` 元素;授权界面由宿主自己的 `InstanceAuthorization` 对话框绘制,它和恢复胶囊一样位于闭合 Shadow DOM 的顶层。皮肤加载失败的横幅保留 `app.skin-load-recovery` 部件标识(「切换到内置皮肤」),它同样运行在闭合 Shadow DOM 宿主层中。三者都只能通过受保护控件令牌间接换肤,编译后的皮肤 CSS 无法命中或改写它们。`skin.library` 是皮肤菜单里的应用库快捷入口,可作辅助路径,但**不是**兜底。
恢复入口的宿主层与授权对话框的宿主层各自独立;两者都不与装饰同父,因此 `[data-ws-part="host.watermark"] ~ *` 一类兄弟选择器也碰不到它们。
#### 将恢复入口停靠到皮肤布局(`chrome.json#slots`)
第三方皮肤可以在 `chrome.json` 中用 `slots` 声明一个自己已经拥有的布局锚点,让恢复入口停靠在皮肤界面里,而不是固定盖在左下角。默认仍是带胶囊壳的恢复胶囊;显式写 `mode: "toolbar"` 时改为无胶囊壳的宿主按钮,可直接并入皮肤顶栏。两种形态都是宿主控件:皮肤只提供锚点部件名和视觉令牌,无法取得它们的 DOM、点击处理或 CSS 选择器;未知的 `data-ws-*` 属性仍由生成界面拒绝。内置/官方皮肤没有 `chrome.json`,行为完全不变。
```json
"slots": {
"host.recovery": { "anchor": "voice.audio-dock", "align": "start", "compact": true }
}
```
| 字段 | 规则 |
| --- | --- |
| 键名 | `host.recovery` 表示整组恢复入口(胶囊或 toolbar 组合);`host.recovery.built-in` 与 `host.recovery.library` 表示两个独立按钮,只接受 toolbar 形态。同一份 `chrome.json` 只能二选一:声明了 `host.recovery` 就不能再声明独立按钮键,反之亦然。未知键或未开放控件会被拒绝,错误码为 `SKIN_CHROME_SLOT_INVALID`。 |
| `anchor` | 必填,必须是 `.ws-skin-root` 内已存在的 `data-ws-part` 名称,或 1–8 个候选名称组成的数组(按页面/组件变体排列,重复项自动去重);宿主按顺序取第一个可见匹配,因此同一份声明可同时覆盖首页和语音页。每个候选名最长 240 字符,不能是 `host.*`,也不能是任何可信宿主部件(如 `app`、`voice.connection-status`、`auth.password.*`)。锚点不存在、`display:none`、`visibility:hidden`、完全透明、被裁剪、尺寸过小或大部分移出视口时都会回退。 |
| `align` | 可选,`start`、`center` 或 `end`,默认 `end`;控件在锚点矩形内按此水平对齐,并垂直居中。 |
| `compact` | 可选布尔值;为 `true` 时停靠后的胶囊折叠为 ◈ 标记,悬停或聚焦后展开。仅胶囊模式可用;`mode: "toolbar"` 与 `compact: true` 同时出现会被拒绝。 |
| `mode` | 可选,`"capsule"` 或 `"toolbar"`。`host.recovery` 省略时保持历史默认 `"capsule"`(旧皮肤无需改动);`host.recovery.built-in` / `host.recovery.library` 省略时为 `"toolbar"`,且显式写 `"capsule"` 会被拒绝。模式必须显式声明,宿主不会从 `compact` 或其他字段推断。 |
| `appearance` | 可选,`"label"`(默认)、`"icon"` 或 `"icon-and-label"`,只接受 toolbar 模式。`label` 保持旧文字按钮;`icon` 使用宿主 16px 图标、24px 宽按钮和零内边距;`icon-and-label` 同时显示图标和本地化文字。三种形态都保留 `aria-label` / `title`。胶囊只接受 `label`;未知值或胶囊中的图标形态会以 `SKIN_CHROME_SLOT_INVALID` 拒绝。 |
`anchor` 写的是宿主渲染后的完整部件名,而不是组件 id:
- v3 `components.json` 组件根:`skin.<page>.<componentId>`。
- v3 组件中带 `part` 的节点:`skin.<page>.<componentId>.part-<part>`;按钮、链接、输入、`role="button"` 或绑定了用户事件的可交互节点会渲染为 `skin.<page>.<componentId>.control-part-<part>`。推荐在 surface 里放一个专门的非交互空节点并设置稳定的 `part`(例如 `skin.voice.harbor-dock.part-anchor`),避免名称随交互语义变化。
- v4 运行时插件生成的节点:`skin.<page>.runtime_plugin_<pluginId>__<componentId>.part-<part>`(同样有 `control-` 变体)。插件 UI 与 `data-ws-skin-mount` 挂载点都位于 `.ws-skin-root` 内,因此也能作为锚点。
**这不是编译期限制。** `skin.css` 校验器不会因为是否声明 `slots` 而改变,也不会生成额外的隐藏或定位规则;停靠完全由宿主运行时完成。胶囊或 toolbar 按钮位于顶层,会挡住它下面的一切,因此宿主还会检查控件的占位(按观察到的最大尺寸计算,紧凑模式展开后的宽度也算在内)是否压到了可见的受保护控件(`PROTECTED_PART_IDS`,例如 `voice.audio-dock.microphone`、`voice.audio-dock.output`、`home.footer.clear`、`voice.connection-status.reconnect`);锚点的祖先容器(如包住专用锚点的 `voice.audio-dock`)不算,锚点自身只有在它是或包含可交互控件时才算。压到时同样回退。示例 `host-chrome-demo` 因此把胶囊靠 `start` 对齐在音频栏左侧的说明文字上,避开右侧的麦克风/输出按钮。锚点一旦不可用,胶囊立即回到默认左下角(仍在闭合 Shadow DOM 和顶层,皮肤无法遮挡或隐藏)。为避免闪烁,回退后需要连续 2 次检查都通过才会重新停靠;停靠期间约每 400 ms 复查一次,浮动态保持原来的 1 s 节奏。窗口缩放、滚动和锚点/胶囊尺寸变化都会触发复查。
**浮动位置的运行时避让。** 没有停靠(未声明 `slots`,或锚点回退)时,恢复胶囊默认在左下角;宿主约每 400 ms(以及每次点击后约 150 ms)检查一次它是否盖住了皮肤里可见、处于最上层的可交互控件(按钮、链接、输入框、`[tabindex]` 自定义按钮、iframe 等;禁用的“发送”按钮也算,透明度为 0 的不算;受保护部件权重最高,其次是打开的对话框/底部弹层里的控件;只因位于皮肤根 `app` 之内的普通按钮不算受保护)。盖住时,胶囊会换到左下、右下、左上、右上、左中、右中、底部居中、顶部居中里遮挡最少的位置,但不会换到鼠标最后所在的位置或当前聚焦的控件上;只有收起能至少让出一个控件时,才收成只显示 ◈ 的紧凑形态(悬停、聚焦或点按展开)。鼠标悬停(触屏上不算残留的悬停)或焦点在胶囊内时不会移动。为避免闪动:遮挡要持续约 250 ms 才移动,两次移动至少相隔 1 s,10 s 内移动超过 6 次就停在默认角落 10 s(期间若默认角落盖住了控件,最多再挪开一次,之后保持不动);判断某个控件是否被盖住时会“看穿”短暂出现的提示条(`app.toast`)和另一个宿主浮动控件,提示条暂时挡住的控件仍按存在计算,不会因此把那个角落误判为空闲;同一页面内,当前位置不遮挡时不会为了回到默认角落而移动(默认角落“看起来空”可能只是被模态对话框的遮罩或提示条暂时挡住);进入或离开语音页、切换皮肤时,宿主会在约 1.5 s 内跳过确认等待和最短间隔、连续复查几次,并在默认角落和当前位置都空闲(鼠标也不在那里)时回到默认角落,免得为上一屏选的位置盖住下一屏新出现的控件。位置计算和 CSS 一样计入 `env(safe-area-inset-*)`(刘海屏、底部手势条)。宿主自带的应用库悬浮按钮(皮肤没有提供 `voice.plugin-launcher` 挂载点时出现在右下角)使用同一套避让,两者也互相避开。这同样只是运行时行为,不新增任何 `skin.css` 编译期限制;皮肤作者无需为它做任何事,但如果希望胶囊固定在设计好的位置,仍建议用 `slots` 停靠。
**样式令牌**:皮肤可在皮肤根(`:root`)、锚点或锚点的祖先上设置下列普通 `--skin-*` 变量;宿主从锚点(存在时)或活动皮肤根的计算样式读取、校验,再写入闭合 Shadow DOM 内部的宿主变量。没有声明 `slots` 的皮肤也能用这些令牌给浮动态胶囊换肤;锚点仍在 DOM 中时,停靠态和浮动态都会继续使用这些令牌;锚点被移除或隐藏时,宿主读取皮肤根上可继承的值,否则使用默认值。每个 `--skin-recovery-*` 都有全局回退 `--skin-host-<同名>`,`--skin-recovery-*` 优先;只有颜色对比度不达标时整组颜色才回退到宿主默认值。声明了插槽但没写颜色令牌时,胶囊使用不透明的宿主默认色(白底),而不是无插槽时的半透明底。这些胶囊令牌也是 toolbar 颜色的最终回退;toolbar 的圆角、内边距、高度和阴影使用下一节自己的默认值,不会继承胶囊的 999px 圆角或浮动阴影。
| 令牌 | 规则 |
| --- | --- |
| `--skin-recovery-accent` | 强调色,用于紧凑模式焦点框和「使用内置皮肤」按钮的边框。与背景的对比度必须 ≥ 3,否则整组颜色回退。该按钮自身固定为浅色底 `#fff7ed`,如果强调色在这块浅底上对比度不足 3,只有这个按钮的边框改用宿主默认 `#b45309`,其余位置仍用皮肤强调色。 |
| `--skin-recovery-background` | 胶囊和按钮背景。宿主强制不透明(alpha 视为 1)。 |
| `--skin-recovery-foreground` | 文字色。与背景的对比度必须 ≥ 4.5。 |
| `--skin-recovery-border` | 胶囊和普通按钮的边框色。与背景的对比度必须 ≥ 3,否则使用宿主默认边框;不影响固定浅色底的「使用内置皮肤」按钮。 |
| `--skin-recovery-radius` | 圆角,只接受 px 长度并限制在 0–999;其他值使用宿主默认 999px。 |
| `--skin-recovery-font` | 字体族列表,只允许字母、数字、空格、逗号、引号和连字符,最长 120 字符;列表中只要出现皮肤用 `@font-face` 注册的字体就整项忽略(只认系统已安装字体和通用族名);其他值使用宿主默认字体。 |
| `--skin-recovery-size` | `small`(默认)、`medium` 或 `large`。宿主映射为固定指标:按钮最小命中高度 28 / 32 / 36 px,最小字号 11 / 12 / 13 px;皮肤不能把这些值降到宿主下限以下。 |
颜色建议使用 `#rgb`、`#rrggbb`、`rgb()` 或 `rgba()`;宿主通过影子根内的探针元素让浏览器解析颜色,再按 WCAG 相对亮度检查对比度。无效、缺失或无法解析的值使用宿主默认颜色(强调色 `#b45309`、背景 `#ffffff`、文字 `#31524f`)。
**紧凑模式**:`compact: true` 且成功停靠时,胶囊只显示 ◈ 标记;标记本身达到当前尺寸档位的最小命中区域,区域保留可访问名称,鼠标悬停、键盘聚焦或点按/轻触 ◈ 时展开为完整按钮;点按展开会保持到焦点离开胶囊、在胶囊外按下指针或按 Escape。新皮肤激活后、胶囊首次成功停靠起的约 5 秒内始终显示完整胶囊(从停靠时刻开始计时,皮肤加载慢也不会提前收起),避免用户找不到恢复入口;用快捷键召唤时也始终完整显示。展开/收起不使用动画,`prefers-reduced-motion` 下同样没有过渡。
**键盘快捷键**:`Ctrl+Alt+Shift+R`(macOS 为 `⌘+⌥+⇧+R`)在停靠、浮动态和紧凑模式下行为一致:显示完整胶囊并聚焦第一个按钮,焦点离开胶囊后紧凑模式重新生效;它仍在捕获阶段处理,皮肤或插件的 `preventDefault()` 无法吞掉。
#### 工具栏模式:把恢复按钮并进皮肤顶栏(`mode: "toolbar"`)
默认的恢复入口是带胶囊壳的浮动/停靠胶囊。若皮肤顶栏已有自己的按钮风格,可以在 `chrome.json` 中显式声明 `mode: "toolbar"`,让宿主在锚点位置绘制**无胶囊壳的真实宿主按钮**。按钮仍由宿主创建、标注、聚焦和点击,位于闭合 Shadow DOM 的顶层;皮肤只提供锚点、`appearance` 形态声明和 `--skin-recovery-toolbar-*` 令牌,不能替换宿主图标、文案、顺序、点击处理或取得 DOM。`.ws-host-toolbar`、`data-ws-host-recovery-toolbar` 与 `data-ws-recovery-action` 都不是公开钩子,皮肤选择器引用它们会被拒绝。
两种声明方式互斥,同一份 `chrome.json` 只能选一种:
**组合式**(两个动作共用一个锚点,并排成一组,顺序为先「使用内置皮肤」、后「应用库」):
```json
"slots": {
"host.recovery": {
"mode": "toolbar",
"appearance": "icon",
"anchor": ["home.header", "voice.header"],
"align": "end"
}
}
```
**独立式**(每个动作有自己的锚点,可放在顶栏两侧或不同部件上):
```json
"slots": {
"host.recovery.built-in": {
"mode": "toolbar",
"appearance": "icon-and-label",
"anchor": ["home.header-tools", "voice.header-actions"],
"align": "end"
},
"host.recovery.library": {
"mode": "toolbar",
"appearance": "icon",
"anchor": ["home.header-tools", "voice.header-actions"],
"align": "start"
}
}
```
上面只是示意:两个独立按钮若使用同一锚点,应选不同的 `align` 或不同锚点,否则会互相覆盖。
规则:
- `mode` 省略时,`host.recovery` 仍是 `capsule`,旧皮肤行为不变;独立按钮键省略时是 `toolbar`,显式写 `capsule` 会被拒绝。模式必须显式声明,宿主不会从 `compact` 或其他字段推断。
- `compact` 只适用于胶囊;toolbar 配 `compact` 会被拒绝。toolbar 不会折叠成 ◈;`appearance` 省略时仍显示完整文字按钮。
- `appearance: "icon"` 只改变 toolbar 的可见内容,不移除按钮的可访问名称。宿主图标为内联 SVG,`aria-hidden="true"`;按钮保留当前语言的 `aria-label`,`title` 仍说明动作/快捷键。`icon-and-label` 同时显示图标和文字。快捷键与失败回退始终使用完整文字胶囊,不受 toolbar 外观影响。
- 组合式下「应用库」按钮只在应用库可用(已连接且插件会话就绪)时渲染;「使用内置皮肤」始终渲染。
- 独立式下每个动作独立停靠:一个锚点失效只把该动作放回浮动胶囊,另一个仍留在工具栏;两个都失效时显示完整浮动胶囊。toolbar 模式下的胶囊永不折叠,因为它是兜底入口而不是设计目标。
- 回退、抗抖动和复查节奏与胶囊相同:锚点失效立即回退;恢复后需连续 2 次检查通过才重新停靠;停靠时约 400 ms 复查,浮动时约 1 s。
- 锚点候选数组按顺序取第一个可见项;页面切换、皮肤重载或锚点显隐后会重新解析,不要求重新绑定。
- 快捷键 `Ctrl+Alt+Shift+R` / `⌘+⌥+⇧+R` 会隐藏工具栏并召唤完整胶囊;关闭(Escape 或焦点离开)后,锚点仍有效的 toolbar 自动恢复。快捷键仍在捕获阶段处理。
- 按钮的最小命中高度、可见图标/文字、焦点环和指针/键盘操作都由宿主保证;皮肤不能通过选择器隐藏 toolbar、移除可访问名称或把按钮变成零尺寸。`appearance` 只能选择宿主提供的三种形态。
**应用库去重**:只要皮肤声明了 toolbar 形式的恢复入口(组合式的 `host.recovery`,或独立式的 `host.recovery.library`),并且应用库可用,宿主就把工具栏里的「应用库」按钮当作该页唯一的应用库入口,并隐藏普通的 `host.plugins.launcher`。即使锚点失效、入口退回浮动胶囊,启动器仍保持隐藏(胶囊继续提供应用库按钮),避免同一页出现两个入口;应用库不可用时启动器照常显示,工具栏也不渲染该按钮。这个去重只影响 toolbar 声明,不改变普通胶囊皮肤或内置皮肤。
**工具栏令牌**:皮肤在皮肤根、锚点或锚点祖先上声明下列普通变量;宿主从每个按钮当前锚点的计算样式读取、校验,再写入闭合 Shadow DOM。每个 `--skin-recovery-toolbar-*` 都有全局回退 `--skin-host-toolbar-*`,前者优先。组合式和独立式按钮共用同一组变量名;由于值按锚点继承,不同页面或不同锚点可以给同一变量不同的值。
| 令牌 | 默认与规则 |
| --- | --- |
| `--skin-recovery-toolbar-background` | 按钮背景。省略时沿用已解析的胶囊底色(`--skin-recovery-background` / `--skin-host-background` / 宿主白色)。完全透明(`transparent` 或 alpha 0)会保留;非零 alpha 仍按旧规则转为不透明 RGB。 |
| `--skin-recovery-toolbar-foreground` | 图标/文字色。与不透明按钮背景的对比度必须 ≥ 4.5;背景透明时改与 `surface` 令牌或宿主采样的锚点/祖先不透明底色比较。整组颜色不可读时,背景和文字一起回退到已解析的胶囊配色。 |
| `--skin-recovery-toolbar-border` | 边框色。完全不透明时与有效背景的对比度必须 ≥ 3,否则使用已解析的胶囊边框;完全透明边框有效。 |
| `--skin-recovery-toolbar-hover-background` | 悬停背景,默认使用正常背景;宿主独立检查悬停后的文字对比度,不合格时回退到正常背景。 |
| `--skin-recovery-toolbar-hover-border` | 悬停边框,默认使用正常边框;校验颜色语法,允许 Classic 的 subtle `#b8cfe8` 边缘,不强制 3:1。 |
| `--skin-recovery-toolbar-surface` | 可选的完全不透明底色,仅用于透明按钮/悬停背景的文字对比度检查,不绘制按钮本身。优先级为 per-part、global、锚点/祖先计算背景采样、宿主白色。渐变或图片顶栏应显式提供该令牌。 |
| `--skin-recovery-toolbar-radius` | 圆角,px 长度,限制 0–24,默认 6;胶囊的 999px 不会带入 toolbar。 |
| `--skin-recovery-toolbar-font` | 字体族列表,规则与胶囊相同:只接受已安装字体或通用族名,皮肤 `@font-face`(包括 `ws-` 前缀)整项忽略。 |
| `--skin-recovery-toolbar-font-size` | 字号,px,默认沿用当前尺寸档位的宿主字号(≥ 11/12/13 px),限制 11–20 px;不能低于宿主下限。 |
| `--skin-recovery-toolbar-padding` | 一个或两个长度值(`上下 左右`,或一个值表示四边相同),默认 `6px 12px`,每个方向限制 0–48 px;接受 px 和无单位 `0`。`appearance: "icon"` 时宿主强制零内边距。 |
| `--skin-recovery-toolbar-height` | 最小高度,px。省略时保持当前尺寸档位的 28/32/36 px;显式值限制 22–72 px,因此 Classic 22px 仅在 toolbar 生效。胶囊仍保持 28/32/36 px。 |
| `--skin-recovery-toolbar-shadow` | `none` 或单个简单 `box-shadow`(2–4 个 px 偏移/尺寸加一个颜色,最长 160 字符),默认 `none`。`url()`、`var()`、多个阴影和额外声明一律忽略为 `none`,胶囊阴影不会带入。 |
| `--skin-recovery-toolbar-gap` | 组合式两个宿主按钮之间的间距,px,默认 4,限制 0–16;Classic 可设 `1px`。独立式各自只有一个按钮。 |
| `--skin-recovery-toolbar-icon-size` | 宿主图标边长,px,默认 16,限制 12–24。`appearance: "icon"` 时按钮宽度为 `max(24px, icon-size + 8px)`,16px 图标对应 Classic 24px 按钮。 |
无效、不可读的颜色,越界的字号/高度/内边距/间距/图标尺寸,皮肤字体和非法阴影都只会回退到可见的宿主默认值,不会隐藏按钮。toolbar 文案由宿主按当前界面语言本地化,长文本换行而不是裁掉;`prefers-reduced-motion` 下同样没有过渡。
**Classic 麦克风按钮对齐示例**(22px 高、透明底、1px 边框、2px 圆角、11px 字号、16px 图标、1px 组间距):
```css
:root {
--skin-host-toolbar-background: transparent;
--skin-host-toolbar-foreground: #1a1a1a;
--skin-host-toolbar-border: transparent;
--skin-host-toolbar-hover-background: #eaf2fd;
--skin-host-toolbar-hover-border: #b8cfe8;
--skin-host-toolbar-radius: 2px;
--skin-host-toolbar-font-size: 11px;
--skin-host-toolbar-padding: 0 4px;
--skin-host-toolbar-height: 22px;
--skin-host-toolbar-gap: 1px;
--skin-host-toolbar-icon-size: 16px;
--skin-host-toolbar-surface: #ffffff;
}
```
配合 `"appearance": "icon"` 使用。`surface` 只参与可读性计算;顶栏实际不是白色时应改成真实不透明底色。图标按钮的零内边距由宿主强制执行,`padding` 令牌仍用于 `label` / `icon-and-label`。
**旧 slots 兼容**:旧包里的 `{ "anchor": ..., "align": ..., "compact": ... }` 没有 `mode`,仍按胶囊停靠,行为不变;`chrome.json` 的其它字段(`visibleParts`、`hiddenParts`、`icons`)不受影响。只有显式写 `mode: "toolbar"` 才会切换形态。
**不影响其它宿主控件**:工具栏令牌只作用于恢复按钮。授权对话框(`--skin-permission-*`)和皮肤加载失败横幅(`--skin-load-recovery-*`)继续使用各自令牌与默认外观;本节的变量不会改变它们。
#### 受保护控件的主题化
28 个受保护部件里,`host.recovery`、`app.skin-load-recovery` 和授权对话框由宿主在闭合 Shadow DOM 中绘制,`host.permission` 目前没有渲染点;其余 25 个都渲染在 `.ws-skin-root` 内(服务器/频道密码弹窗也在根内,不是 `Teleport`)。开放皮肤(schemaVersion 3/4)可以直接用 `skin.css` 给它们换肤;宿主只保留「不能隐藏 / 不能移出视口 / 不能禁用 / 使用内置皮肤的路径不能被切断」四条底线。
**应用 DOM 内的受保护控件。** 颜色、`var()` 颜色、纯色/渐变/包内位图背景、边框、圆角、`font-family`/`font-size`、内边距、宽高、`box-shadow`、`text-shadow`、`filter`(字面值)、`outline` 等纯视觉属性都可以写:
```css
[data-ws-part="voice.audio-dock.microphone"],
[data-ws-part="auth.password.dialog"],
[data-ws-part="home.footer.clear"] {
color: var(--skin-ink);
background: linear-gradient(135deg, #0f172a, #1e3a5f);
border: 2px solid var(--skin-accent);
border-radius: 16px;
font: 600 14px/1.4 Tahoma, "Segoe UI", sans-serif;
padding: 10px 16px;
min-width: 56px;
min-height: 56px;
box-shadow: 0 8px 24px #0006;
}
```
以下规则仍会被拒绝,因为它们会隐藏、禁用或把控件移出视口:`display:none`、`visibility:hidden/collapse`、`opacity:0`、`pointer-events:none`、使 `clip`/`clip-path`/`mask` 完全裁掉内容、`transform`/`scale` 缩到 0、`inset`/`top`/`left`/`margin` 等把控件推到视口外,以及在这些隐藏/移动属性上使用 `var()`/`attr()`。`margin` 仍算移动属性,所以 `margin: var(--skin-gap)` 会被拒绝;普通的小 `margin` 数值可以写。自定义变量仍然只能使用 `--skin-` 前缀。
个别受保护部件的子元素(例如音频面板和音频设置里的 `<input type="range">`)由 Vue 写入内联 `style`;要给滑轨本身换肤,用视觉属性的 `!important` 覆盖即可,受保护的外壳不受影响。
**宿主自有的受保护控件。** `host.recovery`、`app.skin-load-recovery` 横幅和授权对话框在闭合 Shadow DOM 内,皮肤 CSS 不能命中。宿主提供一组统一的令牌;皮肤把变量写在活动皮肤根(`:root`,编译后就是皮肤根)上即可,恢复胶囊也接受写在锚点或其祖先上的值:
| 控件 | 每部件前缀 | 说明 |
| --- | --- | --- |
| `host.recovery` | `--skin-recovery-*` | 兼容原有令牌;写到锚点、锚点祖先或皮肤根上都有效 |
| `app.skin-load-recovery` | `--skin-load-recovery-*` | 皮肤加载失败时出现的顶部横幅;只换肤,不参与停靠。令牌取自横幅出现时的**活动**皮肤:加载失败后宿主会退回内置皮肤(内置皮肤不声明令牌),所以失败皮肤自己的值通常不会作用在自己的横幅上,横幅保持默认琥珀色 |
| 授权对话框(`host.permission` 概念) | `--skin-permission-*` | `host.permission` 没有 DOM 渲染点;令牌作用于宿主自己的授权对话框 |
每个每部件令牌都有全局回退:`--skin-host-accent`、`--skin-host-background`、`--skin-host-foreground`、`--skin-host-border`、`--skin-host-radius`、`--skin-host-font`、`--skin-host-size`。每部件值优先于全局值。例如:
```css
:root {
--skin-host-accent: #47dcc4;
--skin-host-background: #0b1418;
--skin-host-foreground: #edf8f5;
--skin-host-border: #2a5a54;
--skin-host-radius: 10px;
--skin-host-font: Tahoma, "Segoe UI", sans-serif;
--skin-host-size: medium;
/* 只覆盖恢复胶囊,其他宿主控件继续使用全局值 */
--skin-recovery-background: #102030;
}
```
宿主从计算样式读取这些变量,通过影子根内的探针解析颜色(`oklch()`、`color-mix()` 等现代写法会先换算成 sRGB 再检查对比度),再写入控件自己的 `--ws-control-*` 变量;皮肤样式晚于皮肤 ID 加载、运行时插件追加样式、窗口尺寸变化让 `@media` 里的令牌生效时,宿主会自动重新读取,不需要刷新页面。皮肤不能写入 Shadow DOM 内部,也不能替换结构令牌。安全底线与其他受保护控件一致:
- 背景强制不透明(alpha 视为 1)。
- 文字与背景对比度必须 ≥ 4.5,强调色与背景 ≥ 3;任一不达标时整组颜色回退到宿主默认,而不是只改一项。
- 边框与背景对比度 ≥ 3,否则使用宿主默认边框。
- 圆角只接受 px 并限制上限(恢复胶囊 999px,横幅和授权对话框 64px)。
- 字体族只允许字母、数字、空格、逗号、引号和连字符,最长 120 字符;只认系统已安装字体和通用族名(`sans-serif` 等)。列表里只要有一个族名来自文档里的 `@font-face`,或带有编译器给皮肤字体加的 `ws-` 作用域前缀(包括放在暂未生效的 `@media` 里的字体),整项令牌就被忽略,因为自带字体可以把字形做成空白,让宿主控件的文字消失。应用 DOM 内的受保护控件不受此限制,照常可以在 `skin.css` 里用皮肤字体。
- `size` 只接受 `small`、`medium`、`large`,并且只能把命中区域/字号调大;恢复胶囊为 28/32/36px 命中区域、11/12/13px 字号,横幅和授权对话框以自身更大的内置尺寸为下限。
- 授权对话框的主按钮文字色由宿主根据强调色自动选择黑/白;如果黑白两种文字在强调色上都达不到 4.5,这组颜色同样整体回退到宿主默认。
- 恢复胶囊停靠后如果锚点消失、被遮挡或压到其他受保护控件,仍会回退到默认位置;横幅固定在顶部,授权对话框始终是顶层模态框,二者不参与停靠,因此不会因为皮肤布局而找不到。
`Ctrl+Alt+Shift+R`(macOS 为 `⌘+⌥+⇧+R`)和「使用内置皮肤」的重置路径完全不受令牌影响。旧皮肤继续写 `--skin-recovery-*` 也能工作;新皮肤建议优先使用全局 `--skin-host-*`,只在需要区分具体控件时写每部件覆盖。
`host.watermark`、`host.hint` 与 `host.voice-status-decoration` 属于默认隐藏的装饰:官方/内置皮肤(Day、Night、ILLUSIA、KAAK)不会渲染它们,外观与生产版一致。主题化宿主外壳的皮肤需在 `chrome.json` 中用 `visibleParts` 明确开启;`chrome.json` 的 `hiddenParts` 仍然优先。
示例(v3 `skin.css`):
```css
/* 只命中宿主部件,编译后进入文档级宿主作用域 */
[data-ws-part="host.plugins.launcher"] {
background: #1d4f9c;
color: #fff;
border-radius: 4px;
padding: 8px 12px;
font-size: 12px;
}
[data-ws-part="host.watermark"] { color: #dbe8f7; opacity: .08; }
[data-ws-part="host.hint"] { display: none; }
```
宿主图标槽用 `data-ws-icon-slot` 标记,槽名即部件名,可在 CSS 中直接换背景位图;也可用下面的 `chrome.json` 声明式覆盖。可用槽名:
| 槽名 | 位置 |
| --- | --- |
| `host.plugins.launcher` | 顶部工具栏插件按钮图标 |
| `language.trigger` | 语言下拉触发器图标 |
| `skin.trigger` | 皮肤下拉触发器图标 |
| `home.toolbar.settings` | 首页工具栏设置图标 |
| `voice.performance` | 语音页 Voice status / 性能触发器图标 |
### `chrome.json`:声明式显示 / 隐藏、图标位图覆盖与控件停靠
v3/v4 清单可增加可选字段 `"chrome": "chrome.json"`,文件位于包根目录,最多 32 KiB:
```json
{
"schemaVersion": 1,
"visibleParts": ["host.watermark", "host.hint", "host.voice-status-decoration"],
"hiddenParts": ["home.footer.decoration"],
"icons": {
"language.trigger": "assets/icons/language.png",
"skin.trigger": "assets/icons/skin.png",
"host.plugins.launcher": "assets/icons/apps.png"
},
"slots": {
"host.recovery": { "anchor": "voice.audio-dock", "align": "start", "compact": true }
}
}
```
| 字段 | 规则 |
| --- | --- |
| `visibleParts` | 可选,最多 32 项,只能是本文档「可隐藏的装饰部件」白名单中的宿主装饰名。`host.watermark`、`host.hint`、`host.voice-status-decoration` 默认隐藏;皮肤需在这里明确列出才会渲染。省略该字段时装饰保持隐藏,即使包内已有 `hiddenParts` 或 `icons`(宿主不再根据生成的 CSS 猜测旧包意图)。内置皮肤没有 `chrome.json`,因此始终不显示这些装饰。实例级 `hiddenParts` 与皮肤 `hiddenParts` 仍然优先。 |
| `hiddenParts` | 最多 32 项,只能是本文档「可隐藏的装饰部件」白名单中的名字;编译成 `display:none` 并写入皮肤 CSS。可信控件、恢复入口与必要音频路径(如 `voice.audio-dock`、`voice.connection-status`、`home.footer.clear`)永不允许出现,皮肤 CSS 直接隐藏它们也会被拒绝。 |
| `icons` | 最多 16 项;键必须是上表的图标槽名;值必须是包内 `assets/icons/<文件名>` 的位图相对路径。 |
| `slots` | 可选,最多 8 项;键名只能是 `host.recovery`(整组)或 `host.recovery.built-in` / `host.recovery.library`(独立 toolbar 按钮),两种写法互斥。值只能包含 `anchor`、`align`、`compact`、`mode`、`appearance`;`anchor` 可以是单个部件名或最多 8 个候选名的数组。详见上文「将恢复入口停靠到皮肤布局」与「工具栏模式」。未知键、指向 `host.*` 或可信宿主部件的锚点、`toolbar` 配 `compact`、非法 `appearance` 或胶囊中的图标形态都会被拒绝。 |
工具栏形态只需在 `host.recovery` 上写 `"mode": "toolbar"`(两个按钮共用一个锚点):
```json
"slots": {
"host.recovery": {
"mode": "toolbar",
"anchor": ["home.header", "voice.header"],
"align": "end"
}
}
```
也可以改用独立按钮键,让两个动作各自停靠:
```json
"slots": {
"host.recovery.built-in": { "anchor": ["home.header-tools", "voice.header-actions"], "align": "end" },
"host.recovery.library": { "anchor": ["home.header-tools", "voice.header-actions"], "align": "start" }
}
```
图标文件约定:仅 PNG / JPG / WebP / AVIF / GIF(**不接受 SVG**),路径必须位于 `assets/icons/` 下且只有一层文件名(不允许 `..`、绝对路径、`\`、`%`、空格或外部 URL)。导入端与服务端登记时都会校验路径、文件是否存在、MIME 是否为位图、单张不超过 64 KiB、总量不超过 512 KiB。宿主把位图编译进皮肤 CSS 的 `background-image`,并隐藏槽内的矢量图形;`url()` 仍走包内资源解析,无法引用外部地址。
实例级默认值:启动网关时设置环境变量 `WEBSPEAK_HOST_CHROME_HIDDEN_PARTS`(逗号或空格分隔,例如 `host.watermark,host.hint`)。`/api/public-config` 会返回校验后的 `hiddenHostParts`,宿主据此默认折叠这些非关键装饰;未知或受保护的名字会被忽略。宿主的三个装饰部件默认就是隐藏的;皮肤通过 `chrome.json` 的 `visibleParts` 开启,实例默认值与皮肤 `hiddenParts` 取并集并优先于 `visibleParts`。
`home.footer` 是容器,包含必要的「清除本地数据」链接 `home.footer.clear`,因此**不在**可隐藏列表;纯装饰文案被拆分为 `home.footer.decoration`,只隐藏它不会破坏恢复路径。
### 令牌、字体、动效和图片
皮肤只负责“画什么样”,不负责“放在哪里”。可用的视觉规则包括文字/背景颜色、背景图片及其裁切、圆角、轮廓、阴影、滤镜和动画;边框可用不占空间的内阴影绘制。推荐先定义皮肤变量,再为公开部件编写视觉规则:
@@ -180,11 +797,11 @@ assets/brand.woff2 # 可选:自带字体
### 固定布局与交互边界
皮肤校验器会拒绝改变布局、定位、尺寸、文字流向/换行或交互命中区域的 CSS 声明,包括 `display`、`position`、`inset`、`z-index`、宽高、内外边距、网格/弹性布局、间距、溢出裁切、变换、指针事件、字号、行高、字距、大小写转换和换行方式等。也不能通过 `all` 重置组件或用伪元素生成/替换文字。动画可以用于颜色、阴影、滤镜等装饰效果,但关键帧同样不能动画化布局属性。
以下 CSS 限制适用于 v1 和 v2:校验器会拒绝改变布局、定位、尺寸、文字流向/换行或交互命中区域的声明,包括 display、position、inset、z-index、宽高、内外边距、网格/弹性布局、间距、溢出裁切、变换、指针事件和字号等。v2 的位置和尺寸只从经过 schema 校验的 layout.json 生效。v3 为支持自由布局而允许这些声明,但仍限制皮肤根作用域、公开钩子、危险值和外部资源;只通过 CSS 隔离不能阻止皮肤作者遮挡控件。
因此,皮肤可以把成员头像绘制成角色徽章、给屏幕播放器加主题边框和背景、换首页美术素材,但不能移动播放器、压缩文字、扩大/缩小成员卡片、把锚定浮层改成模态弹窗,或挪动按钮的点击区域。用 `background-position` / `background-size` 只调整图片在既有区域中的裁切,不改变组件盒子。轮廓或内阴影可作为不参与排版的描边。
因此,v1/v2 CSS 可以更换艺术素材、颜色和表面风格,但不能重排组件。v3 可以用 CSS 重新安排界面和组件盒子,也能隐藏普通界面部分;基础组件由宿主继续创建,宿主的恢复和权限 UI 位于皮肤作用域外。所有版本都应确保焦点、文字、键盘和触屏操作可用。
外观可以因窄屏而更换图片裁切或装饰,但 `@media` 规则也受同一限制,不能用来重排组件。上线前仍需预览桌面与窄屏、所有五种语言、日夜基础主题、键盘焦点、减少动效偏好,并确认浮层和必要控件保持在原位、文字未被裁切。
v1/v2 外观可以因窄屏而更换图片裁切或装饰,但 @media 规则也受固定布局限制。v2 应在布局数据中分别设置桌面、平板和手机配置;v3 可用媒体查询构建响应式 CSS。上线前仍需预览各设备尺寸、所有五种语言、键盘焦点、减少动效偏好,并确认必要控件可用、文字未被裁切。
## 安全边界和限制
@@ -196,7 +813,7 @@ assets/brand.woff2 # 可选:自带字体
| 解压总大小 | 50 MiB |
| ZIP 条目数 | 128 |
| 单个 CSS 文件 | 512 KiB |
| `content.json` | 256 KiB |
| `content.json` / `components.json` | 256 KiB |
| 单张图片(包括预览) | 16 MiB |
| 单个 WOFF2 字体 | 4 MiB |
| 每实例皮肤数 | 50 |
@@ -204,46 +821,75 @@ assets/brand.woff2 # 可选:自带字体
压缩包路径穿越、重复/冲突路径、符号链接、异常 ZIP 元数据和本地文件头/目录不一致都会被拒绝。仅允许受支持的 CSS at-rule:`@media`、`@supports`、`@container`、具名 `@layer`、`@font-face` 和 keyframes。`@import`、脚本、HTML、外部网络资源会被拒绝;`!important` 可用于皮肤作用域内的样式。字体 `local()` 也会拒绝,避免绕过包内字体来源。
必要操作控件(加入/退出、麦克风、设置、菜单、屏幕共享退出、音量、全屏等)及其布局容器不能被隐藏或整体重置。只有下列明确标记为可选的装饰部件,才允许通过不改变排版盒子的透明度效果淡出:
v1/v2 校验器会阻止隐藏必要操作控件和其容器。v3 可改变显示状态,因此皮肤开发者必须保留语音操作路径;授权界面、皮肤选择和恢复入口由宿主在皮肤作用域之外提供。以下选择器是旧格式对可选装饰部件的透明度白名单:
下面这份清单是**唯一**的可隐藏装饰部件白名单,由 `src/shared/skin-visual-parts.ts` 的 `DECORATIVE_PART_IDS` 定义;CSS 校验器(`OPTIONAL_VISUAL_PARTS`)、布局编辑器(`DECORATIVE_PART_IDS`)与 `chrome.json` 的 `hiddenParts` 共用它,三者永远一致:
```css
[data-ws-part="demo.avatar"]
[data-ws-part="demo.badge"]
[data-ws-part="demo.note"]
[data-ws-part="demo.poke-notification"]
[data-ws-part="demo.wave"]
[data-ws-part="demo.member-status"]
[data-ws-part="home.feature"]
[data-ws-part="home.features"]
[data-ws-part="home.footer.decoration"]
[data-ws-part="home.hero.eyebrow"]
[data-ws-part="home.gateway-status"]
[data-ws-part="home.features"]
[data-ws-part="home.feature"]
[data-ws-part="home.join-card.sonar"]
[data-ws-part="home.join-card.waveform"]
[data-ws-part="home.visitors"]
[data-ws-part="voice.activity.artwork"]
[data-ws-part="voice.activity-heading"]
[data-ws-part="voice.member.avatar"]
[data-ws-part="voice.member.avatar-wrap"]
[data-ws-part="voice.member.live-indicator"]
[data-ws-part="voice.member-row.avatar"]
[data-ws-part="voice.performance.metrics"]
[data-ws-part="voice.performance.webrtc-stats"]
[data-ws-part="voice.screen-player.viewer-avatar"]
[data-ws-part="voice.screen-player.live"]
[data-ws-part="demo.badge"]
[data-ws-part="demo.wave"]
[data-ws-part="demo.avatar"]
[data-ws-part="demo.member-status"]
[data-ws-part="demo.note"]
[data-ws-part="host.watermark"]
[data-ws-part="host.hint"]
[data-ws-part="host.voice-status-decoration"]
[data-ws-part="host.plugins.launcher"]
```
上面必须使用单独的精确属性选择器;不能通过父容器、组合选择器或子元素间接隐藏/重置内容。关键帧只有在其动画仅被这些可选部件引用时,才可使用透明度归零;若关键帧也被必要控件引用或动画名通过变量指定,则会被拒绝。`clip`、`clip-path` 和 `mask` 一律不允许,避免视觉裁切误伤真实控件。校验器是防止布局回归的边界,不是视觉质量证明;自定义字体、复杂背景和高对比特效仍需人工检查文字可读性与控件辨识度。
上面必须使用单独的精确属性选择器;不能通过父容器、组合选择器或子元素间接隐藏/重置内容。`host.watermark`、`host.hint`、`host.voice-status-decoration` 默认不渲染,`chrome.json#visibleParts` 才是它们的开启开关。
皮肤可以重画控制外观,但不能重新布置或阻断加入/退出、麦克风状态、设置、菜单、屏幕共享退出、音量、全屏等必要操作。校验成功不代表设计质量合格;提交前要逐页实测窄屏和桌面尺寸、所有界面语言、日夜基础主题、键盘焦点与减少动效设置。
关键帧与普通声明遵循同一套受保护控件检查,但只检查动画能够**停留**的帧:`to` / `100%` 始终检查;`from` / `0%` 仅在引用它的声明(含同一主体上另一条规则的方向 / 填充 / 播放状态长属性)使用 `reverse`、`alternate`、`alternate-reverse` 方向、`backwards` / `both` 填充模式或 `paused` 播放状态时检查;转义的 `to` / `from` 与 `1e2%` 这类写法按停留帧识别;`50%` 等中间帧不会因为过渡状态被拒绝,缺少 `to` / `100%` 时结束状态回到元素自身样式(`paused` 配合负延迟、或超长动画停在中间帧属于已知残留,由闭合 Shadow DOM 的恢复胶囊兜底)。受保护控件上被拒绝的写法包括 `display: none`、`visibility: hidden|collapse`、`opacity` ≤ 0.01(含 `0`、`0%`、`0e0`、`calc(0)` 等)、`pointer-events: none`、`filter` / `-webkit-filter` 的 `opacity(≤0.01)` / `brightness(0)`、`transform` / `scale` 的零缩放、`content-visibility: hidden`、`clip-path` 的 `inset(...)`(任一边对合计 ≥ 100%)、`circle(0)` / `ellipse(0 …)`、`clip: rect(0,0,0,0)`,以及 `mask` / `mask-image` 的 `alpha(0)` / `luminance(0)` 或全透明渐变色标;`polygon()` 等装饰性裁切不受限制。受保护主体的判定会展开 `:is()` / `:where()` 参数、双重否定 `:not(:not(X))` 与 `:nth-child(An+B of S)` / `:nth-last-child(...)` 的 `S`,`[data-ws-part="…" i]` 按不区分大小写匹配。把控件移出视口只在明显越界时拒绝:负向 ≤ -1000px 或 ≤ -100%,正向 ≥ 2000px 或 ≥ 200%(`margin` / `inset` / `left` / `right` / `top` / `bottom` / `translate` / `transform`,含简单 `calc()` 与 `matrix()` 平移);`scale`、`rotate` 和小幅平移不受影响。`host.plugins.overlay` 的布局锁在关键帧中复用普通声明的属性锁:停留帧里的定位、变换等锁定属性只能取中性或单位变换(`none`、`auto`、`static`、`0`、`scale(1)`、`translateY(0)`、`rotate(0deg)` 或 CSS 全局关键字),尺寸属性仅在达到视口尺寸时拒绝(含 `calc(50vw * 2)`);入场动画停在这些值时通过。受保护控件和 `host.plugins.overlay` 上的 `animation` / `animation-name` 也不能用 `var()` / `attr()` 间接指定动画名;受保护控件上的 `filter` / `-webkit-filter`、`clip` 与 `content-visibility` 同样只接受字面值,不能用 `var()` / `attr()`(否则变量可以绕过上面的隐藏检查),其他部件不受影响。只被可选/装饰部件引用的关键帧仍可隐藏它们,v3 对非受保护部件的隐藏只给出警告。校验器是恢复路径的最后一道安全网,不是布局或视觉质量检查;自定义字体、复杂背景和高对比特效仍需人工检查文字可读性与控件辨识度。
皮肤可以重画控制外观。v1/v2 不能重新布置必要操作;v3 可以,因此须人工实测加入/退出、麦克风状态、设置、菜单、屏幕共享退出、音量、全屏等操作的可达性。v3 也不能用大的负 `margin*`、`inset`/`translate` 等把受保护控件移出视口,或把 `host.plugins.overlay` 及其后代改成定位全屏、放大到覆盖视口(`zoom` 等);这些写法会在导入时被拒绝。装饰性宿主外壳(`host.watermark`、`host.hint`、`host.voice-status-decoration`、`host.plugins.launcher`)和普通页面部件不受布局锁限制,可以自由使用 flex/grid、重定位、自定义尺寸、大背景和动画;固定定位或极端 `z-index` 只会给出提示。开放皮肤(v3/v4)的布局与视觉质量由官方库的人工审核保证,编译器不会阻止一般性的布局回归。校验成功不代表设计质量合格;提交前要逐页实测窄屏和桌面尺寸、所有界面语言、键盘焦点与减少动效设置。
CSS 被限定在 `.ws-skin-root` 内,管理员页面不会继承皮肤。删除实例里的包会停止从服务器提供该包;已经下载过的浏览器副本会保留在本地存储,因此仍可能在该浏览器的选择器中出现。清除该站点的浏览器数据可移除本地副本。
## 制作与验收
1. 复制 `docs/examples/illusia-voice/`,先修改 `manifest.json` 的唯一 `id`、名称、作者、版本和授权。ILLUSIA 是完整的美术参考,不是必须沿用的角色或配色。
2. 只使用本目录公开的 `data-ws-part`、`data-ws-page`、状态属性和包内静态资源。不要依赖 Vue 内部 class。
3. 使用本地资源编写 `skin.css`;需要改首页文字或公开翻译时补充 `content.json`。
4. 在包根目录生成 ZIP,再改扩展名为 `.wskin`。PowerShell 示例:
1. 选择最接近目标的 `docs/examples/` 示例,复制其皮肤源码目录,并修改 `manifest.json` 的唯一 `id`、名称、作者、版本和授权。ILLUSIA 是美术参考,不要求沿用它的角色或配色。
2. 先查本文件和系统规格中已经发布的公开钩子、数据、控件和动作。不要依赖 Vue 内部 class、未公开的数据路径或某个实例的本地文件。
3. 将皮肤的页面/组件结构、样式、文案、布局及所有资源放在包目录中:CSS/图片/字体写入 `skin.css` 和 `assets/`,可选多语言文案写入 `content.json`,声明式组件写入 `components.json`,作者默认布局写入 `layout.json`,当前支持的插件逻辑和资源放进 v4 `plugins/`。运行时动态数据使用公开上下文;TeamSpeak 行为使用已发布的宿主动作。
4. 皮肤任务中不要修改 WebSpeak 核心客户端、服务端、共享协议或宿主控件。若没有足够的通用公开接口,先写明需要的数据/动作、权限和兼容性,再将它作为独立的平台工作处理;不要给某款皮肤增加专用核心分支。
5. 在包根目录生成 ZIP,再改扩展名为 `.wskin`,只包含 manifest 声明的文件。PowerShell 示例:
```powershell
Compress-Archive -Path .\docs\examples\illusia-voice\* -DestinationPath .\illusia-voice.zip -Force
Rename-Item .\illusia-voice.zip illusia-voice.wskin
```
5. 在管理员后台 `/admin/skins` 上传。用访客浏览器分别检查连接首页、进入语音页和 `/demo`;测试自定义图片、所有交互控件、语音/静音状态、成员列表、聊天、屏幕共享播放器和设置,确认组件位置、尺寸、排列与未启用皮肤时一致。
6. 检查至少一个窄屏尺寸和桌面尺寸,并检查焦点可见、对比度、动效偏好;确认没有第三方素材授权问题。
6. 使用皮肤导入器验证生成的 `.wskin`,再在 `/admin/skins` 导入这个确切文件。用访客浏览器分别检查连接首页、语音页和 `/demo`;测试自定义图片、交互控件、会话状态、成员、聊天、屏幕共享及设置。v1/v2 检查固定布局;v2 检查作者默认布局和用户本地覆盖;v3/v4 检查授权拒绝/撤销、数据边界和失效恢复。
7. 检查窄屏与桌面、所有支持的语言、长文案、键盘焦点、对比度和减少动效偏好,并确认素材可再分发。若声称跨实例可移植,应在两个兼容版本的实例导入同一份 `.wskin`,记录并比较文件 SHA-256;不要为第二个实例复制核心代码改动。
当前自动化回归涵盖 ZIP/清单验证、资源路径、CSS 隔离与拒绝规则、文案结构和服务端皮肤目录读写。视觉排版、内容遮挡和浏览器间表现仍须人工预览。
自绘成员列表时,`session.members` 可读取 `screenSharing` 与 `screenShareStreamId`;这两个成员字段和 `screenShare.streams` 一样要求 `voice.screenShare.read`。用 `member.screenSharing` 显示共享标记,再将 `member.screenShareStreamId` 绑定到 `voice.joinScreenShare`(还需 `voice.screenShare.control`)即可让用户观看。未声明/未获共享读取权限的皮肤不会收到这两个字段;整页替换皮肤仍须在自己的成员列表中绘制标记或观看入口。
\n
## 实例级用户授权(v0.3.0)
用户首次访问公开页面时,由宿主统一询问是否允许当前实例的第三方皮肤和功能插件使用已公开的频道/成员/聊天等上下文;不包含连接凭据。不再逐个皮肤弹窗确认。选择按浏览器源(协议、域名、端口)保存,旧版本的逐包授权记录不会自动替代这次选择。管理员对应用的审核与信任仍单独保留。
未作选择或拒绝时,仅可使用固定三款官方皮肤:`builtin.light`、`builtin.dark`、`community.illusia-voice`;KAAK 即使随包分发也不在免授权名单中,其他第三方皮肤及功能插件入口隐藏。缓存、直接激活、进行中的加载也必须经过同一授权检查,不能仅过滤菜单。皮肤菜单末尾的“授权”可以随时修改选择。撤回时立即退回内置皮肤、停止第三方皮肤组件/worker,并关闭与撤销当前功能应用会话;服务端由管理员启用的后台应用不因此停机。
清单权限、数据投影、宿主动作校验和 Wasm 文件摘要校验继续保留,统一授权不是扩大皮肤 API 的理由。作者不应再自行增加重复授权弹窗。原文中的逐包授权记录与 SHA-256 绑定描述指内部校验记录,其创建必须在实例授权允许之后(或固定官方皮肤之内)。
+90
View File
@@ -0,0 +1,90 @@
# Cloudflare Tunnel 语音兼容性说明
## 范围
本文件说明网页/信令通过 Cloudflare Tunnel、WebRTC 媒体尽量直连 UDP 的兼容性
改动。默认行为是 `WEBSPEAK_VOICE_PROFILE=auto`:
- 非 Cloudflare 请求保持 `legacy`:80ms 固定窗口、超限 `clear()`、裸
1920-byte PCM、旧 WebRTC mixer。
- 只有来自受信任代理且带 Cloudflare 标记的请求才自动进入 `adaptive`。
- 显式 `legacy` 或 `adaptive` 覆盖自动判定。
- TURN 是可选后备,不默认强制 `relay`。
本文件是内部实现说明,不代表整体验收、发布或实际部署证明。
## 主要改动
### WebRTC、ICE 与回退
- `src/server/voice-ice-config.ts`:支持静态 ICE、TURN REST、浏览器/网关
transport policy、语音 profile、Opus WebSocket 和 jitter 上限。
- `src/server/turn-credentials.ts`:按 coturn `use-auth-secret` 生成短期凭证。
- `src/server/voice-bridge.ts`:仅当直接相邻代理位于
`WEBSPEAK_TRUSTED_PROXIES` 中时,才根据 `cf-ray`、`cf-connecting-ip` 或
`cdn-loop` 判定 Cloudflare。直连客户端注入这些头不会改变 profile。
- Cloudflare 请求不再把 Tunnel `Host` 当作 ICE 媒体地址。未配置公网媒体
地址且没有 TURN 时返回 `NO_MEDIA_PATH`,浏览器使用兼容传输。
- 已下发 WebRTC 后建连或传输失败会自动恢复 PCM/Opus over WebSocket 的
上下行兼容音频,页面留在当前 TeamSpeak/WebSocket 会话;上行需要已有
麦克风权限。横幅继续使用 `WEBRTC_FAILED`,并保留“重新连接 WebRTC”。
- “重新连接 WebRTC”只重试 WebRTC,不调用整段连接流程、不新建语音
WebSocket。重连期间保持兼容收发,等 `onReady` 后才停止兼容音频并清除
失败横幅和按钮,避免双路音频或切换静音。
- 重连再次失败时继续留在兼容模式保通话,横幅和按钮保留。网关未
advertise WebRTC 的既有兼容路径不变,也不显示这块失败按钮。
- `src/server/webrtc-audio.ts` 与 `web/src/voice/webrtc-transport.ts`:浏览器
和网关使用完整 ICE 列表;无 TURN 的 `relay` 策略快速失败。
- 已从 werift 源码确认 `turns:` 使用 TLS 控制连接;未做真实 coturn 端到端
联调。
### 兼容模式音频
- `legacy` 保留旧播放窗口、解码器重建、裸 PCM、4 帧 mixer 队列和每包
marker。
- `adaptive` 使用 `web/src/voice/jitter-buffer.ts`、可选服务端 pacer 和可选
Opus-over-WebSocket;Opus 默认关闭。
- `web/src/voice/opus-uplink.ts` 使用 WebCodecs Opus;不支持或失败时回退 PCM。
- Safari/Firefox 的 Opus 行为未逐台真机验证。
### 管理台与持久化
- 管理台“服务器 → 语音”提供 profile、Opus、jitter 上限和 TURN REST 配置。
- 非空控制台值覆盖环境变量;未修改字段保持数据库 `NULL`,继续继承环境变量。
- 清空 TURN URL 或移除密钥会显式停用环境变量中的 TURN REST。
- TURN 密钥使用网关主密钥加密存储,API 只返回是否已配置。
- 无关设置保存不会把未修改的语音字段写成控制台覆盖值。
## 示例配置
```bash
WEBSPEAK_VOICE_PROFILE=auto
WEBSPEAK_VOICE_ICE_TRANSPORT_POLICY=all
WEBSPEAK_VOICE_GATEWAY_ICE_TRANSPORT_POLICY=all
WEBSPEAK_VOICE_JITTER_MAX_MS=300
WEBSPEAK_VOICE_OPUS_WS=0
WEBSPEAK_TURN_REST_URLS='turn:turn.example.com:3478?transport=udp,turn:turn.example.com:3478?transport=tcp'
WEBSPEAK_TURN_REST_SECRET='<replace-with-demo-secret>'
WEBSPEAK_TURN_REST_TTL_SECONDS=21600
```
公网媒体地址示例使用 `192.0.2.10`;实际部署必须替换为可直接通过 UDP 到达的
地址。Cloudflare Tunnel 不转发 WebRTC UDP,也不能作为媒体地址。
## 数据库与回滚
- 语音覆盖配置写入现有 metadata 表,数据库保持 schema 13;未设置的值继承
环境变量,TURN 密钥继续加密保存。
- 0.3.3 会忽略并保留这些元数据,可以在自动更新健康检查失败后直接恢复旧代码。
- 恢复非 Cloudflare 旧音频行为:选择 `legacy`,或确保没有控制台覆盖后设置
`WEBSPEAK_VOICE_PROFILE=legacy`。
- 关闭 Opus:取消控制台选项或设置 `WEBSPEAK_VOICE_OPUS_WS=0`。
- 关闭 TURN:清空 TURN URL/移除密钥,或删除对应环境变量。
## 验证边界
- coturn/cloudflared 模板未在真实目标网络端到端联调。
- TURN 的 UDP/TCP/TLS、relay 端口和凭证一致性仍需在目标网络验证。
- Safari/Firefox WebCodecs Opus 与真实浏览器 jitter 表现仍需设备测试。
- 自动化测试和构建结果以本次审查的测试记录为准;历史报告中的通过数量
不应被视为本次独立复跑结果。
File renamed without changes.
File renamed without changes.
File renamed without changes.
+21
View File
@@ -0,0 +1,21 @@
# Discord Voice skin
This example turns the Discord-inspired voice interface into a portable WebSpeak `open-skin` v3 package. Its page structure is declared in `components.json`; its palette and layout are in `skin.css`; localized skin copy lives in `content.json`.
The independent distribution repository is [Huddle-Up-Forge/webspeak-skin-discord-voice](https://github.com/Huddle-Up-Forge/webspeak-skin-discord-voice). It is the first entry in the [WebSpeak skin store index](https://github.com/Huddle-Up-Forge/webspeak-skins). Administrators can install it from **Skins → Skin store**, then manage availability and the instance default under **Instance skins**. Version 1.0.12 requires WebSpeak 0.3.2 with the current public skin API.
The package uses WebSpeak's public TeamSpeak widgets for channel navigation, member cards, chat, audio controls, screen sharing, performance status, server switching and invite links. That keeps connection logic and trusted actions in WebSpeak while the skin controls the visible layout. The Discord visual language and color palette are retained, while host-owned controls keep their supported behavior and accessibility.
The skin requires explicit approval to replace the home and voice pages. It does not include JavaScript, depend on Vue internals, or change WebSpeak runtime code. It can be imported from `/admin/skins` as an ordinary `.wskin` package.
- Source: [discord-voice](./discord-voice/)
- Package: [discord-voice.wskin](./discord-voice.wskin)
- Format and runtime contract: [skin development guide](../SKIN_DEVELOPMENT.md)
Build the package from the repository root with:
```powershell
node web/scripts/build-discord-voice-skin.mjs
```
Native fullscreen and the bespoke screen-share settings shortcut from the built-in Vue version are not part of the current public skin API. The standard package keeps screen sharing reachable through WebSpeak's trusted screen-share controls and uses the standard audio settings panel.
+106
View File
@@ -0,0 +1,106 @@
# Host chrome toolbar example
A minimal schema v3 open skin that docks the trusted recovery entry into the page header as Classic-aligned, host-owned icon buttons instead of the floating capsule shell. It is the smallest reference for `chrome.json` `mode: "toolbar"`, `appearance`, page-specific anchor candidates, transparent toolbar tokens, application-library de-duplication and the floating-capsule fallback.
- Source: [host-chrome-toolbar](./host-chrome-toolbar/)
- Importable package: [host-chrome-toolbar.wskin](./host-chrome-toolbar.wskin)
- Author: WebSpeak Community
- Shared component and permission rules: [skin development guide](../SKIN_DEVELOPMENT.md)
- Host chrome and toolbar contract: [skin development guide](../SKIN_DEVELOPMENT.md) (see the `chrome.json#slots` and toolbar-mode sections)
## Package layout
```text
host-chrome-toolbar/
manifest.json # schema v3, version 1.1.2, minAppVersion 0.3.4-dev.0, author WebSpeak Community
chrome.json # one grouped toolbar slot with a home/voice anchor list
skin.css # light page theme, Classic toolbar tokens and header space
```
This package requires WebSpeak 0.3.4-dev.0 or later. Released WebSpeak 0.3.3 and earlier do not accept `mode`, `appearance`, or anchor candidate arrays, so importing it there cannot provide toolbar-mode behavior. Older slots without those fields remain valid and keep their capsule presentation.
`skin.css` uses only public `data-ws-part` hooks and sets `--skin-host-toolbar-*` / `--skin-recovery-toolbar-*` variables. It never targets the host toolbar DOM, the recovery capsule, the authorization dialog or the load-failure banner.
## Grouped declaration
```json
{
"schemaVersion": 1,
"slots": {
"host.recovery": {
"mode": "toolbar",
"appearance": "icon",
"anchor": ["home.header", "voice.header"],
"align": "end"
}
}
}
```
- `mode: "toolbar"` asks the host to render two real host buttons without the capsule shell.
- `appearance: "icon"` selects the host-owned 16px built-in-skin and application-library SVGs. Each button is 24px wide, has zero padding and keeps its localized `aria-label` and `title`.
- The anchor list covers both pages; the host picks the first visible one and re-resolves it after a page switch. A missing or hidden anchor returns the complete, visible floating capsule.
- While the library is available, the host hides the ordinary application-library launcher so the page keeps exactly one library entry. The fallback capsule keeps that entry when the anchor fails.
- The host owns the icons, labels, click handlers, focus behaviour, shortcut handling and fallback. The skin only supplies the anchor, appearance and token values.
- Old slots without `mode` keep the capsule presentation; this example opts in explicitly.
## Classic tokens
```css
:root {
--skin-host-toolbar-background: transparent;
--skin-host-toolbar-foreground: #1a1a1a;
--skin-host-toolbar-border: transparent;
--skin-host-toolbar-hover-background: #eaf2fd;
--skin-host-toolbar-hover-border: #b8cfe8;
--skin-host-toolbar-surface: #f4f7fb;
--skin-host-toolbar-radius: 2px;
--skin-host-toolbar-font-size: 11px;
--skin-host-toolbar-padding: 0 4px;
--skin-host-toolbar-height: 22px;
--skin-host-toolbar-gap: 1px;
--skin-host-toolbar-icon-size: 16px;
}
```
This produces 22px-high buttons, a transparent normal surface, a 1px transparent border, 2px corners, 11px type, 16px icons and a 1px gap. Hover uses `#eaf2fd` with a `#b8cfe8` edge. `surface` is not painted; it tells the host which opaque colour to use for contrast checks. Set it to the real header colour when adapting the example.
The package also declares an opaque `--skin-recovery-*` capsule palette. Capsule mode keeps its historical 28/32/36px size floors, full text labels and fixed `#fff7ed` built-in action; toolbar tokens never shrink or restyle that escape hatch.
## Independent declaration
Use the per-action keys when the two actions need different anchors or appearances. Do not declare them together with `host.recovery`.
```json
{
"schemaVersion": 1,
"slots": {
"host.recovery.built-in": {
"mode": "toolbar",
"appearance": "icon-and-label",
"anchor": ["home.header-tools", "voice.header-actions"],
"align": "end"
},
"host.recovery.library": {
"mode": "toolbar",
"appearance": "icon",
"anchor": ["home.header-tools", "voice.header-actions"],
"align": "start"
}
}
}
```
`appearance` defaults to `"label"` for backward compatibility. The accepted toolbar values are `"label"`, `"icon"` and `"icon-and-label"`; unknown values and icon appearances in capsule mode are rejected with `SKIN_CHROME_SLOT_INVALID`.
## Trying it
1. Build or import [host-chrome-toolbar.wskin](./host-chrome-toolbar.wskin) in a local WebSpeak instance.
2. Allow the third-party skin when the host asks.
3. Connect to **Demo Server**, join **Demo Lobby**, and check the header as **Demo User**.
4. Confirm the two 24px host icons appear at the end of the home and voice headers, remain transparent at rest, use the Classic hover colours, and open the built-in-skin and application-library actions.
5. Remove or hide the anchor in the page inspector; the complete floating capsule should appear at a free corner. Restore the anchor; the toolbar should re-dock after the anti-flap check.
6. Press `Ctrl+Alt+Shift+R` (`⌘+⌥+⇧+R` on macOS); the toolbar hides, the complete full-text capsule appears and focuses its first button. Press Escape to return to the toolbar.
7. Check a narrow viewport and all five interface languages. Icon-only names must remain available to assistive technology, and the fallback capsule must keep readable localized labels.
The example contains no server addresses, member names, chat contents or other real instance data. Public descriptions use only the Demo Server / Demo Lobby / Demo User placeholders.
+4 -7
View File
@@ -1,14 +1,11 @@
# ILLUSIA风
ILLUSIA风 is a visual-only `.wskin` example built from the local artwork in `illusia-voice/assets/`. It styles the WebSpeak home page, voice workspace, screen-share player, and `/demo` with bright glass surfaces and cyan accents. The homepage skin follows the supplied reference art for the translucent navigation, matching glass skin and language selectors, an illustrated animated ILLUSIA skin option, a floating mascot with a visibly pulsing cyan waveform and expanding halo in the join card, a softly animated cyan aurora inspired by the visitor badge, three feature tiles, character visitor badge, mascot-accented join action, and full-width curved footer. The ambient waveform and halo slow down when reduced motion is enabled instead of disappearing. The voice-room skin uses the resting chibi illustration as the message-empty backdrop and places the main character illustration on the dedicated non-interactive artwork layer so it can rest over the edge of member cards or a live screen-share player without moving or blocking their controls.
ILLUSIA 风格 is a schema v3 open-skin example built from the local artwork in [illusia-voice/assets](./illusia-voice/assets/). Version 2.0.2 keeps its existing light-glass CSS and current-channel card, adds matching visual treatment for the host member-card screen-share status and watch action, and uses a black letterbox background for the fixed WebSpeak screen-share player. The package still uses WebSpeak's base translations and contains no executable skin code.
This package intentionally omits `content.json`: the existing WebSpeak translations supply every label and message, including the current and total visitor counts. A skin may optionally add localized copy overrides, but missing locales and fields continue to use WebSpeak's base content. Its CSS is visual-only: WebSpeak retains its component positions, dimensions, text flow, and interactions. In the voice room, the main illustration and headset use separate, non-interactive foreground layers with restrained perspective and shadows; the chat's empty state includes a CSS-drawn speech-bubble ornament, while its translated copy remains visible. The footer wave is a pre-rendered transparent asset sampled from the example's original curve, so it decorates the existing footer instead of introducing another layout element.
The new voice-page component is defined in [components.json](./illusia-voice/components.json). It reads only the current public channel name through session.status.read and uses a local mascot image for a compact, non-interactive glass badge. The component needs the user's local approval before it renders; that approval is scoped to this skin version and can be revoked from the host access control. It cannot switch channels, read favorites, access a server address, or control audio.
The package source is in [`illusia-voice/`](illusia-voice/). To build it from the repository root:
The CSS continues to style the WebSpeak home page, voice workspace, screen-share player and /demo with cyan accents and original art. The homepage includes translucent navigation and selectors, animated mascot details, feature tiles, a visitor badge, a join action and a curved footer. The voice workspace includes the shared quick-server list, channel/member views, chat empty state, screen-share art and audio controls. The shared member cards detect active screen shares and show a themed live badge and watch button. The mobile view keeps WebSpeak's responsive host navigation while applying ILLUSIA colors and artwork.
```powershell
Compress-Archive -Path .\docs\examples\illusia-voice\* -DestinationPath .\docs\examples\illusia-voice.zip -Force
Rename-Item .\docs\examples\illusia-voice.zip illusia-voice.wskin -Force
```
The distributable package and the copy served from web/public/skins are built from the source folder. After changing source files, run `npm run skin:illusia:build` to recreate both copies. Run the package import test to confirm both copies stay byte-identical and valid.
Use only artwork you have permission to redistribute when publishing a skin to other WebSpeak instances.
+56
View File
@@ -0,0 +1,56 @@
# KAAK voice skin
The participant stage uses larger profile portraits (104px on desktop, reduced for narrow layouts). A live speaking state adds a pulsing accent ring and a visible waveform marker, including when participant names are hidden while chat is open. The ring and speaking status use KAAK's shared green accent.
The server sidebar can show the connected TeamSpeak virtual server's configured host-banner image and welcome message between the server header and channel tree. Both fields come from live server information; the card disappears when neither is configured, and a missing or failed banner image does not hide the welcome text. Welcome content is rendered as plain text.
The server sidebar can show the connected TeamSpeak virtual server's configured host-banner image and welcome message between the server header and channel tree. Both fields come from live server information; the card disappears when neither is configured, and a missing or failed banner image does not hide the welcome text. Welcome content is rendered as plain text.
The voice-channel sidebar follows KOOK's observed typography: 16px/700 server title, 12px/700 group title, 14px/700 channel title, and 12px/400 low-contrast member count.
Chat visibility is kept separately for each active TeamSpeak channel, so collapsing one room does not collapse the next room. TeamSpeak does not expose KOOK's music-channel category; a new channel therefore starts expanded until the user changes its chat visibility.
While the WebSpeak performance card is sampling, its refresh icon spins to show the busy state; the animation is disabled when reduced motion is requested.
KAAK is a schema v3 open-skin package with full connection and voice-workspace surfaces. Its desktop voice page follows KOOK's proportions: an 86px server rail with 58px icons and 18px vertical spacing, a 290px channel pane, a 40px top bar, a central participant stage, right-side chat attached to the current voice channel, and a lower-left voice dock. The server rail uses KOOK's rounded-square silhouette, a 2px green active outline and left-edge marker, with neutral fallback tiles and the muted purple active tile from the reference. The identity tile stays pinned at the bottom with a 54px circular monogram and connection-aware online dot; the server list scrolls when the window is short. The host provides a stable color-tone value derived only from the privacy-safe label, but the rail keeps the KOOK neutral tile treatment rather than exposing those tones. The KOOK voice room is the point-to-point visual reference: composition, member presentation, styling, and motion should be compared directly, rather than treating matching component types or approximate placement as sufficient. The left tree contains the TeamSpeak voice channels only; KOOK's separate text-channel group is outside this pass because TeamSpeak has no equivalent channel type. The current voice channel's text chat remains on the right. Closing it hides the entire panel, expands the participant stage, and leaves a reopen button in the stage heading; this happens without leaving the voice room. Its header uses the `#` channel mark and an unobtrusive close control; the composer sits at the bottom edge. Messages use author monograms, a separate identity/time line, and readable message text. The central stage uses WebSpeak's reusable member-card widget so available TeamSpeak profile avatars appear inside KAAK's participant tiles; the tiles use a wide 1.82:1 layout with a responsive grid to match KOOK's participant presentation. Member names stay hidden at rest while chat is open and fade upward into the lower-left label on hover; they remain visible while chat is collapsed. KAAK's CSS adds hover depth and a smoothly transitioning speaking ring driven by live voice state. Active screen shares appear on member cards with a live badge and a themed watch action; the share player remains a WebSpeak host component. The dock retains WebSpeak's trusted connection-quality, audio, and disconnect controls. Input/output volume buttons open hover or keyboard-focus panels with live numeric levels; sliders use a skin-colored progress track, a distinct thumb, and visible focus feedback. Audio input and output devices use a reusable keyboard-accessible picker with a scrollable option list, selected/highlighted states, and an animated chevron; KAAK styles the trigger and open list. The connection surface, voice workspace, and audio settings share KOOK's PingFang SC-first font stack; audio settings use 16px/600 section headings and observed 14px/400 field labels. Audio sliders use a 16px thumb with hover/focus feedback. The performance card opens with a short entrance motion and readable network/audio metrics. No real device, volume, or microphone state is changed during visual checks. The roster shows connected TeamSpeak clients only; it does not invent an offline list. Channel selection is single-click; joining is double-click. The narrow layout keeps the host's mobile controls available while retaining readable member tiles.
The single TeamSpeak voice-channel group in the left tree collapses and expands with a short two-way height and fade transition like KOOK's voice group; the separate KOOK text-channel group remains outside this pass. A first click selects a channel and reveals a brief “双击加入” hint; the hint disappears on the active room. The current voice-room heading keeps the channel name and live member count visible above the participant stage while the attached chat is expanded, matching KOOK's room view. Member cards expose WebSpeak's trusted member-actions menu from a small hover or keyboard-focus control; desktop cards also open it on right-click, and touch layouts keep the control visible. KAAK gives the host menu KOOK's compact dark panel, separated volume section, and highlighted action rows while keeping WebSpeak's own individual-volume slider and member actions; it does not add KOOK menu actions or skin-side audio logic. While a screen-share peer is active, the voice-status panel also displays its browser-side video codec and transport statistics.
The design target is the voice-client portion of KOOK, as requested by the project owner. It does not include discovery, companion/party, event, store, advertising, administrator, or other service-operator pages. It does not add a KOOK account flow, direct messages, server administration, or channels absent from the connected TeamSpeak server. The voice performance card also closes on outside click or Escape; Escape returns focus to its trigger, and its entrance/exit motion respects reduced-motion preferences.
The device picker now follows the public KOOK style geometry: a 40px trigger with 12px corners, a menu with 12px corners and 8px inset, and 32px rows with 2px gaps and 8px corners. Hover and selected rows use distinct low-contrast fills. The shared host measures the rendered menu before applying viewport limits, so skin-defined padding and row spacing stay visible without a KAAK-specific placement path. KAAK uses KOOK's dark-theme brand green (`#6cbf00`, `#7ac51a` hover) for speaker, slider, and control highlights. The performance trigger, metric values, volume readouts, audio settings icons, and sliders reuse the same accent tokens. Volume sliders use a 4px track, a 16px white thumb with a 2px brand-green border, and a 3px hover/focus halo without extra hover scaling.
The audio settings surface now follows the observed KOOK form proportions: a 660px dark card, 16px corners, 72px field rows, and a two-column label/control layout. Device and volume controls keep their WebSpeak behavior; only their shared form grouping and KAAK skin presentation changed. The layout stacks fields on narrow screens. KOOK's settings typography remains PingFang SC-first, with a 32px/600 title, 16px/600 section headings, and 14px/400 field labels.
The existing WebSpeak noise-suppression switch is available in the audio settings on desktop and mobile, matching its placement in KOOK's voice settings. It remains the browser's current noise-suppression control; KAAK does not claim to reproduce KOOK's branded processing modes.
## Reference access note
The owner authorized inspection of the first two voice rooms in the KOOK server. Both rooms were entered and viewed; the microphone remained off and no message was sent. The in-room view confirmed a single large participant tile in the center, a separate right-side panel for the active voice channel's text chat, a narrow server rail, grouped voice channels, and a compact voice-control dock near the lower left. The chat was empty, so no message contents were recorded. Server/room identifiers and member names were not recorded.
## Returning to the workspace
KAAK 3.1.132 uses the normal connection home on every visit. It no longer opts into persistent workspace entry. The connection-status and explicit reconnect controls remain available inside the voice workspace.
The permission-gated `voice.connection-status` host widget provides the connection state, nickname and explicit reconnect button beside server navigation at desktop and narrow widths. Open-mode server switching and adding servers reuse the host connection flow, including saved-password lookup and trusted password prompts; fixed mode retains its restrictions. All KAAK layout and styling remain in the package.
## Components and permissions
The connection page and voice workspace are full-page declarative surfaces in [components.json](./kaak-voice/components.json). The voice surface requests only the capabilities it uses: visible server shortcuts, channel and member data, cached profile-avatar display inside the trusted member-card widget, channel joining, channel chat, voice status, microphone/output controls, whisper controls, disconnect, and screen-share status/read/control. Its member-card widget explicitly enables share status and watch actions; the KAAK dock uses the host's screen-share control. When a screen-share peer is active, the performance panel shows browser-side video codec and transport metrics. The host renders trusted connection, language, skin, and audio controls. KAAK keeps the shared-screen player inside the central voice-stage column with an explicit responsive height, so the player cannot collapse when the host applies its inline video sizing; member cards scroll in the remaining area. The full source image remains visible with black letterboxing. Server and channel password prompts use the compact dark KAAK dialog style while retaining WebSpeak's trusted password, error, cancel, and retry behavior. It rechecks permissions and connection state when each action runs; approval is local to this skin version and can be revoked from the host access control.
The server header uses the live, privacy-filtered TeamSpeak server label and a trusted `voice.server-switcher` menu backed by favorites and recent connections. Its click handler reuses WebSpeak's existing connection flow with an opaque local ID; addresses and credentials never enter skin data. The left panel uses the trusted `voice.channel-tree` widget to retain TeamSpeak channel nesting, member counts and capacity, available avatars, and mute/speaking/away states. Expanding a branch is local UI state, a single click selects a channel, and double-click joins it. With `memberActions` enabled, right-clicking another member row opens WebSpeak's existing host-owned action menu. With `memberDragDrop` enabled, another member can be dragged onto a different channel row; the member row and target channel receive visual feedback, and the host reuses its existing move-client operation. Both options default off for other skins. The skin does not add KOOK's separate text-channel list.
On desktop, right-clicking another member row in the channel tree or member card opens WebSpeak's existing host-owned member actions menu. Member cards also retain their accessible action button; keyboard activation remains anchored to that button, and touch layouts keep it available. The menu's actions come from WebSpeak and are unchanged by the skin.
Member cards are rendered by WebSpeak's trusted `voice.member-cards` widget. It displays an already available TeamSpeak profile avatar, or the host-generated nickname initial when no avatar is available; image bytes stay in the host and are not exposed in the skin's data context or Wasm runtime. The skin does not receive server addresses, passwords, identity keys, raw audio, private messages, or arbitrary network/storage APIs. Its markup is data-only; it contains no executable JavaScript or Wasm. The `/demo` page uses synthetic data and does not connect to TeamSpeak.
## Files
- Source package: [kaak-voice](./kaak-voice/)
- Component schema: [components.json](./kaak-voice/components.json)
- Distributable archive: [kaak-voice.wskin](./kaak-voice.wskin)
- Shared format and safety rules: [SKIN_DEVELOPMENT.md](../SKIN_DEVELOPMENT.md)
KAAK is included in the public skin selector and its `.wskin` archive is also available as a standalone package. After changing the source, run `npm run skin:kaak:build` to rebuild both copies, then run the package tests and verify the connection page, approval, denial, revoke, desktop, and narrow-screen paths in the local browser. The connected voice surface can be verified when a TeamSpeak session is available.
KAAK 3.1.133 places the application library icon in the server rail, alongside the skin and language controls. It opens the drawer beside the rail.
+10
View File
@@ -0,0 +1,10 @@
# Open Voice Surface scaffold
This importable schema v3 surface package exercises complete public home and voice pages using only declarative nodes and WebSpeak-owned controls. It includes server switching, channel navigation, visible members, per-member screen-share status and a watch action, chat, audio, whisper, connection controls, and the built-in language and skin selectors. It contains no discovery, events, shop, companion, advertising, or administration pages.
This is an implementation scaffold for testing the open-skin format, not a pixel-matched KOOK skin. The visual reference was read in the in-app browser in the first two user-authorized voice rooms. The separate [KAAK voice sample](./KAAK-VOICE.md) records the voice-only layout findings and applies them to the channel and member sidebars. No server/room identifiers, member names, or chat contents were retained. Discovery, companion shop, events, ads, and operator/admin pages are outside the sample's scope.
- Source: [open-voice-surface](./open-voice-surface/)
- Importable package: [open-voice-surface.wskin](./open-voice-surface.wskin)
- Shared component and permission rules: [skin development guide](../SKIN_DEVELOPMENT.md)
- Current runtime contract and safety boundaries: [skin development guide](../SKIN_DEVELOPMENT.md)
Binary file not shown.
+452
View File
@@ -0,0 +1,452 @@
{
"schemaVersion": 3,
"components": [
{
"id": "discord-home",
"name": "{{skin.messages.homeComponentName}}",
"page": "home",
"mode": "surface",
"accessibleName": "{{skin.messages.homeAccessibleName}}",
"permissions": ["ui.surface.replace", "session.status.read"],
"actions": {},
"root": {
"tag": "main",
"part": "home",
"className": "join-page",
"children": [
{
"tag": "header",
"part": "home-header",
"className": "join-header",
"children": [
{
"tag": "div",
"className": "brand-lockup",
"children": [
{ "tag": "span", "className": "dc-brand-mark", "children": [{ "text": "W" }] },
{
"tag": "div",
"children": [
{ "tag": "strong", "children": [{ "text": "WebSpeak" }] },
{ "tag": "small", "children": [{ "text": "{{skin.messages.tagline}}" }] }
]
}
]
},
{
"tag": "div",
"part": "home-header-tools",
"className": "join-header-tools",
"children": [
{ "widget": "home.social-links", "part": "social-links" },
{ "tag": "div", "className": "workspace-skin-switcher", "children": [{ "widget": "app.skin-switcher", "part": "skin-switcher" }] },
{ "tag": "div", "className": "workspace-language", "children": [{ "widget": "app.language-switcher", "part": "language-switcher" }] }
]
}
]
},
{
"tag": "main",
"part": "home-content",
"className": "join-content",
"children": [
{
"tag": "section",
"part": "home-hero",
"className": "join-copy",
"children": [
{
"tag": "div",
"part": "home-hero-eyebrow",
"className": "eyebrow",
"children": [
{ "tag": "span", "className": "eyebrow-dot" },
{ "text": "{{skin.messages.eyebrow}}" }
]
},
{
"tag": "h1",
"part": "home-hero-title",
"children": [
{ "text": "{{skin.messages.heroTitle}}" },
{ "tag": "em", "children": [{ "text": "{{skin.messages.heroAccent}}" }] }
]
},
{
"tag": "p",
"part": "home-hero-description",
"className": "join-description",
"children": [{ "text": "{{skin.messages.heroDescription}}" }]
},
{
"tag": "div",
"part": "home-features",
"className": "promise-list",
"children": [
{
"tag": "div",
"part": "home-feature",
"className": "promise-item",
"children": [
{ "tag": "span", "className": "promise-icon mint", "children": [{ "text": "01" }] },
{ "tag": "span", "children": [
{ "tag": "b", "children": [{ "text": "{{skin.messages.featureOneTitle}}" }] },
{ "tag": "small", "children": [{ "text": "{{skin.messages.featureOneBody}}" }] }
] }
]
},
{
"tag": "div",
"part": "home-feature",
"className": "promise-item",
"children": [
{ "tag": "span", "className": "promise-icon sand", "children": [{ "text": "02" }] },
{ "tag": "span", "children": [
{ "tag": "b", "children": [{ "text": "{{skin.messages.featureTwoTitle}}" }] },
{ "tag": "small", "children": [{ "text": "{{skin.messages.featureTwoBody}}" }] }
] }
]
},
{
"tag": "div",
"part": "home-feature",
"className": "promise-item",
"children": [
{ "tag": "span", "className": "promise-icon mint", "children": [{ "text": "03" }] },
{ "tag": "span", "children": [
{ "tag": "b", "children": [{ "text": "{{skin.messages.featureThreeTitle}}" }] },
{ "tag": "small", "children": [{ "text": "{{skin.messages.featureThreeBody}}" }] }
] }
]
}
]
},
{ "tag": "div", "className": "dc-visitor-slot", "children": [{ "widget": "home.visitor-count", "part": "visitor-count" }] },
{ "tag": "div", "className": "announcement-wrap", "children": [{ "widget": "home.server-announcement", "part": "announcement" }] }
]
},
{
"tag": "section",
"part": "home-join-card",
"className": "join-card",
"children": [
{ "tag": "div", "className": "join-card-effects", "attributes": { "aria-hidden": "true" }, "children": [
{ "tag": "span", "className": "join-card-waveform", "children": [
{ "tag": "i" }, { "tag": "i" }, { "tag": "i" }, { "tag": "i" }, { "tag": "i" }, { "tag": "i" }, { "tag": "i" }, { "tag": "i" }, { "tag": "i" }
] },
{ "tag": "span", "className": "join-card-sonar", "children": [{ "tag": "i" }, { "tag": "i" }, { "tag": "i" }] }
] },
{ "tag": "h2", "part": "home-join-title", "children": [{ "text": "{{skin.messages.connectTitle}}" }] },
{ "tag": "p", "part": "home-join-description", "className": "card-lead", "children": [{ "text": "{{skin.messages.connectDescription}}" }] },
{ "widget": "home.connection-status", "part": "connection-status" },
{ "widget": "home.connection-form", "part": "connection-form" },
{ "tag": "p", "part": "home-security-note", "className": "join-meta", "children": [{ "text": "{{skin.messages.securityNote}}" }] }
]
}
]
},
{
"tag": "footer",
"part": "home-footer",
"className": "join-footer",
"children": [
{ "tag": "span", "children": [{ "text": "WebSpeak" }] },
{ "tag": "span", "className": "footer-separator", "children": [{ "text": "·" }] },
{ "tag": "span", "children": [{ "text": "TeamSpeak" }] },
{ "tag": "span", "className": "footer-spacer" },
{ "tag": "span", "children": [{ "text": "{{skin.messages.footerNote}}" }] }
]
}
]
}
},
{
"id": "discord-workspace",
"name": "{{skin.messages.voiceComponentName}}",
"page": "voice",
"mode": "surface",
"accessibleName": "{{skin.messages.voiceAccessibleName}}",
"stateScope": "session.status.channelId",
"permissions": [
"ui.surface.replace",
"session.status.read",
"session.invite.copy",
"session.channels.read",
"session.members.read",
"session.memberAvatars.read",
"session.channel.join",
"servers.quickList.read",
"servers.quickList.switch",
"chat.channel.read",
"chat.channel.send",
"audio.status.read",
"audio.microphone.control",
"audio.output.control",
"audio.settings.open",
"voice.disconnect",
"voice.screenShare.status.read",
"voice.screenShare.read",
"voice.screenShare.control",
"voice.whisper.status.read",
"voice.whisper.control"
],
"actions": {
"switch-server": { "type": "quickServers.switch", "args": { "quickServerId": "{{server.id}}" } },
"copy-invite-link": { "type": "session.copyInviteLink", "args": {} },
"stop-screen-share": { "type": "voice.stopScreenShare", "args": {} },
"toggle-accompaniment": { "type": "audio.toggleAccompaniment", "args": {} },
"open-audio-settings": { "type": "audio.openSettings", "args": {} },
"toggle-chat": { "type": "ui.toggleState", "args": { "key": "chatopen" } }
},
"state": { "chatopen": true },
"root": {
"tag": "main",
"part": "voice-shell",
"className": "app-shell discord-app-shell",
"children": [
{
"tag": "nav",
"part": "server-rail",
"className": "dc-rail",
"attributes": { "aria-label": "{{skin.messages.serverRailLabel}}" },
"children": [
{
"tag": "div",
"className": "dc-rail-list",
"children": [
{
"tag": "div",
"part": "quick-server-item",
"className": "dc-rail-item",
"repeat": { "path": "servers.quickList", "as": "server" },
"children": [
{ "tag": "span", "className": "dc-rail-pill", "attributes": { "aria-hidden": "true" } },
{
"tag": "button",
"part": "quick-server",
"className": "dc-rail-icon dc-rail-server",
"attributes": {
"type": "button",
"aria-label": "{{skin.messages.switchServer}} {{server.label}}",
"aria-pressed": "{{server.current}}",
"aria-disabled": "{{server.switchRestricted}}",
"title": "{{server.switchTitle}}"
},
"events": { "click": "switch-server" },
"children": [{ "tag": "span", "className": "dc-rail-avatar", "children": [{ "text": "{{server.monogram}}" }] }]
},
{ "tag": "span", "className": "dc-rail-tooltip", "attributes": { "role": "tooltip" }, "children": [{ "tag": "strong", "children": [{ "text": "{{server.label}}" }] }] },
{ "tag": "span", "className": "dc-rail-fav", "when": { "path": "server.favorite", "equals": true }, "attributes": { "aria-label": "{{skin.messages.favoriteServer}}" }, "children": [{ "text": "★" }] }
]
}
]
}
]
},
{
"tag": "aside",
"part": "member-panel",
"className": "dc-sidebar",
"children": [
{
"tag": "header",
"className": "dc-server-header",
"children": [
{ "tag": "strong", "children": [{ "text": "{{session.status.serverLabel}}" }] },
{
"tag": "button",
"part": "invite-copy",
"className": "dc-header-icon",
"attributes": { "type": "button", "aria-label": "{{skin.messages.copyInvite}}", "title": "{{skin.messages.copyInvite}}" },
"events": { "click": "copy-invite-link" },
"children": [{ "text": "↗" }]
}
]
},
{"widget":"voice.plugin-launcher","part":"plugin-launcher","options":{"pluginPresentation":"drawer-side"}},
{
"tag": "div",
"className": "dc-sidebar-scroll",
"children": [
{ "tag": "div", "className": "dc-category", "children": [{ "text": "{{skin.messages.voiceChannels}}" }] },
{ "tag": "div", "className": "dc-channel-list", "children": [{ "widget": "voice.channel-tree", "part": "channel-tree", "options": { "layout": "server-sidebar", "memberActions": true, "memberDragDrop": true } }] }
]
},
{
"tag": "section",
"part": "connected-status",
"className": "dc-connected",
"when": { "path": "session.status.connected", "equals": true },
"children": [
{
"tag": "div",
"className": "dc-connected-row",
"children": [
{ "tag": "div", "className": "dc-connected-copy", "children": [
{ "tag": "strong", "children": [{ "text": "{{skin.messages.voiceConnected}}" }] },
{ "tag": "small", "children": [{ "text": "{{session.status.channelName}}" }] }
] },
{ "tag": "div", "className": "dc-performance", "children": [{ "widget": "voice.performance-panel", "part": "performance-panel" }] }
]
},
{ "tag": "div", "className": "dc-connected-actions", "children": [{ "widget": "voice.connection-controls", "part": "connection-controls" }] }
]
},
{
"tag": "div",
"part": "audio-dock",
"className": "dc-user-bar",
"children": [
{ "tag": "div", "className": "dc-user-info", "children": [
{ "tag": "span", "className": "dc-user-avatar", "children": [{ "tag": "i", "children": [{ "text": "{{session.status.userName}}" }] }] },
{ "tag": "span", "className": "dc-user-text", "children": [{ "tag": "strong", "children": [{ "text": "{{session.status.userName}}" }] }, { "tag": "small", "children": [{ "text": "{{skin.messages.online}}" }] }] }
] },
{ "tag": "div", "className": "dc-user-actions", "children": [
{ "widget": "voice.audio-controls", "part": "audio-controls" },
{
"tag": "button",
"part": "mobile-audio-settings",
"className": "dc-mobile-audio-settings",
"attributes": { "type": "button", "aria-label": "{{skin.messages.audioSettings}}", "title": "{{skin.messages.audioSettings}}" },
"events": { "click": "open-audio-settings" },
"children": [{
"tag": "svg",
"attributes": { "width": 20, "height": 20, "viewbox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "stroke-width": 1.8, "stroke-linecap": "round", "aria-hidden": "true" },
"children": [
{ "tag": "path", "attributes": { "d": "M4 6h4m4 0h8M4 12h8m4 0h4M4 18h2m4 0h10" } },
{ "tag": "circle", "attributes": { "cx": 10, "cy": 6, "r": 2 } },
{ "tag": "circle", "attributes": { "cx": 14, "cy": 12, "r": 2 } },
{ "tag": "circle", "attributes": { "cx": 8, "cy": 18, "r": 2 } }
]
}]
}
] }
]
}
]
},
{
"tag": "section",
"part": "workspace",
"className": "dc-stage",
"children": [
{
"tag": "header",
"part": "voice-header",
"className": "dc-stage-header",
"children": [
{ "tag": "div", "className": "dc-stage-title", "children": [{ "tag": "h2", "children": [{ "text": "{{session.status.channelName}}" }] }] },
{
"tag": "div",
"part": "header-actions",
"className": "dc-stage-header-actions",
"children": [
{ "tag": "div", "className": "workspace-skin-switcher", "children": [{ "widget": "app.skin-switcher", "part": "skin-switcher" }] },
{ "tag": "div", "className": "workspace-language", "children": [{ "widget": "app.language-switcher", "part": "language-switcher" }] },
{
"tag": "button",
"part": "chat-toggle",
"className": "dc-stage-icon",
"attributes": { "type": "button", "aria-expanded": "{{state.chatopen}}", "aria-label": "{{skin.messages.toggleChat}}", "title": "{{skin.messages.toggleChat}}" },
"events": { "click": "toggle-chat" },
"children": [{ "text": "#" }]
}
]
}
]
},
{ "tag": "div", "className": "dc-stage-notices" },
{
"tag": "div",
"part": "voice-activity",
"className": "dc-stage-canvas",
"children": [
{
"tag": "div",
"className": "dc-stage-grid",
"children": [
{ "widget": "voice.screen-share-player", "part": "screen-share-player" },
{ "widget": "voice.member-cards", "part": "member-cards", "options": { "screenShare": true, "memberActions": true } },
{
"tag": "button",
"part": "invite-tile",
"className": "dc-invite-tile",
"attributes": { "type": "button", "aria-label": "{{skin.messages.invitePeople}}" },
"events": { "click": "copy-invite-link" },
"children": [{ "tag": "strong", "children": [{ "text": "{{skin.messages.invitePeople}}" }] }]
}
]
},
{ "widget": "voice.whisper-controls", "part": "whisper-controls" }
]
},
{
"tag": "footer",
"className": "dc-stage-controls",
"attributes": { "aria-label": "{{skin.messages.voiceControls}}" },
"children": [
{ "tag": "div", "className": "dc-stage-controls-side" },
{
"tag": "div",
"className": "dc-stage-controls-main",
"children": [
{
"tag": "div",
"className": "dc-stage-pill",
"children": [
{ "widget": "voice.screen-share-start", "part": "screen-share-start", "when": { "path": "screenShare.status.active", "equals": false } },
{
"tag": "button",
"part": "screen-share-stop",
"className": "dc-stage-btn",
"when": { "path": "screenShare.status.active", "equals": true },
"attributes": { "type": "button", "aria-pressed": "true", "aria-label": "{{skin.messages.stopScreenShare}}", "title": "{{skin.messages.stopScreenShare}}" },
"events": { "click": "stop-screen-share" },
"children": [{ "text": "▣" }]
},
{
"tag": "button",
"part": "accompaniment-toggle",
"className": "dc-stage-btn",
"attributes": { "type": "button", "aria-label": "{{skin.messages.toggleAccompaniment}}", "title": "{{skin.messages.toggleAccompaniment}}" },
"events": { "click": "toggle-accompaniment" },
"children": [{ "text": "♫" }]
}
]
}
]
},
{ "tag": "div", "className": "dc-stage-controls-side end" }
]
}
]
},
{
"tag": "aside",
"part": "chat-panel",
"className": "dc-chat",
"when": { "path": "state.chatopen", "equals": true },
"children": [
{
"tag": "header",
"className": "dc-chat-header",
"children": [
{ "tag": "div", "className": "dc-chat-title", "children": [{ "tag": "strong", "children": [{ "text": "{{session.status.channelName}}" }] }] },
{
"tag": "button",
"part": "chat-close",
"className": "dc-stage-icon",
"attributes": { "type": "button", "aria-label": "{{skin.messages.closeChat}}", "title": "{{skin.messages.closeChat}}" },
"events": { "click": "toggle-chat" },
"children": [{ "text": "×" }]
}
]
},
{ "widget": "voice.chat-panel", "part": "chat", "className": "dc-chat-body" }
]
}
]
}
}
]
}
+190
View File
@@ -0,0 +1,190 @@
{
"defaultLocale": "en",
"locales": {
"en": {
"messages": {
"homeComponentName": "Discord-style connection home",
"homeAccessibleName": "Discord-style WebSpeak connection page",
"voiceComponentName": "Discord-style voice workspace",
"voiceAccessibleName": "Discord-style WebSpeak voice workspace",
"tagline": "YOUR VOICE, EVERYWHERE.",
"eyebrow": "VOICE, TOGETHER",
"heroTitle": "Your people.",
"heroAccent": "Your voice.",
"heroDescription": "Join your TeamSpeak community from the browser, with the controls you already know.",
"featureOneTitle": "No client install",
"featureOneBody": "Connect directly from your browser.",
"featureTwoTitle": "Low-latency voice",
"featureTwoBody": "Use browser audio with your TeamSpeak server.",
"featureThreeTitle": "One familiar space",
"featureThreeBody": "Keep channels, members and chat together.",
"connectTitle": "Connect to a TeamSpeak server",
"connectDescription": "Enter a server address to join voice.",
"securityNote": "Your connection and identity stay under WebSpeak's control.",
"footerNote": "Voice in your browser",
"serverRailLabel": "Saved and recent servers",
"switchServer": "Switch to",
"favoriteServer": "Saved server",
"copyInvite": "Copy invite link",
"voiceChannels": "VOICE CHANNELS",
"voiceConnected": "VOICE CONNECTED",
"online": "Online",
"audioSettings": "Audio settings",
"toggleChat": "Toggle channel chat",
"invitePeople": "Invite people",
"closeChat": "Close chat",
"voiceControls": "Voice controls",
"stopScreenShare": "Stop screen sharing",
"toggleAccompaniment": "Toggle accompaniment"
}
},
"zh-CN": {
"messages": {
"homeComponentName": "Discord 风格连接首页",
"homeAccessibleName": "Discord 风格 WebSpeak 连接页",
"voiceComponentName": "Discord 风格语音工作区",
"voiceAccessibleName": "Discord 风格 WebSpeak 语音工作区",
"tagline": "你的声音,随时随地。",
"eyebrow": "一起语音",
"heroTitle": "和熟悉的人,",
"heroAccent": "畅快交流。",
"heroDescription": "在浏览器中加入你的 TeamSpeak 社区,使用熟悉的语音控制。",
"featureOneTitle": "无需安装客户端",
"featureOneBody": "直接从浏览器连接。",
"featureTwoTitle": "低延迟语音",
"featureTwoBody": "通过浏览器连接 TeamSpeak 服务器。",
"featureThreeTitle": "熟悉的语音空间",
"featureThreeBody": "频道、成员和聊天一目了然。",
"connectTitle": "连接 TeamSpeak 服务器",
"connectDescription": "填写服务器地址即可加入语音。",
"securityNote": "连接和身份信息由 WebSpeak 安全管理。",
"footerNote": "在浏览器中语音聊天",
"serverRailLabel": "收藏和最近连接的服务器",
"switchServer": "切换到",
"favoriteServer": "已收藏的服务器",
"copyInvite": "复制邀请链接",
"voiceChannels": "语音频道",
"voiceConnected": "语音已连接",
"online": "在线",
"audioSettings": "音频设置",
"toggleChat": "打开或关闭频道聊天",
"invitePeople": "邀请成员",
"closeChat": "关闭聊天",
"voiceControls": "语音控制",
"stopScreenShare": "停止屏幕共享",
"toggleAccompaniment": "切换伴奏"
}
},
"de": {
"messages": {
"homeComponentName": "Discord-inspirierte Verbindungsseite",
"homeAccessibleName": "Discord-inspirierte WebSpeak-Verbindungsseite",
"voiceComponentName": "Discord-inspirierter Sprachbereich",
"voiceAccessibleName": "Discord-inspirierter WebSpeak-Sprachbereich",
"tagline": "DEINE STIMME, ÜBERALL.",
"eyebrow": "ZUSAMMEN SPRECHEN",
"heroTitle": "Deine Leute.",
"heroAccent": "Deine Stimme.",
"heroDescription": "Tritt deiner TeamSpeak-Community direkt im Browser bei.",
"featureOneTitle": "Keine Installation",
"featureOneBody": "Verbinde dich direkt im Browser.",
"featureTwoTitle": "Sprachkommunikation mit geringer Latenz",
"featureTwoBody": "Nutze Browser-Audio mit deinem TeamSpeak-Server.",
"featureThreeTitle": "Ein vertrauter Bereich",
"featureThreeBody": "Kanäle, Mitglieder und Chat an einem Ort.",
"connectTitle": "Mit einem TeamSpeak-Server verbinden",
"connectDescription": "Gib die Serveradresse ein, um beizutreten.",
"securityNote": "WebSpeak schützt deine Verbindung und Identität.",
"footerNote": "Sprache im Browser",
"serverRailLabel": "Gespeicherte und zuletzt verwendete Server",
"switchServer": "Wechseln zu",
"favoriteServer": "Gespeicherter Server",
"copyInvite": "Einladungslink kopieren",
"voiceChannels": "SPRACHKANÄLE",
"voiceConnected": "SPRACHE VERBUNDEN",
"online": "Online",
"audioSettings": "Audioeinstellungen",
"toggleChat": "Kanalchat umschalten",
"invitePeople": "Mitglieder einladen",
"closeChat": "Chat schließen",
"voiceControls": "Sprachsteuerung",
"stopScreenShare": "Bildschirmfreigabe beenden",
"toggleAccompaniment": "Begleitung umschalten"
}
},
"ru": {
"messages": {
"homeComponentName": "Главная WebSpeak в стиле Discord",
"homeAccessibleName": "Страница подключения WebSpeak в стиле Discord",
"voiceComponentName": "Голосовое пространство в стиле Discord",
"voiceAccessibleName": "Голосовое пространство WebSpeak в стиле Discord",
"tagline": "ТВОЙ ГОЛОС — ВЕЗДЕ.",
"eyebrow": "ОБЩАЙТЕСЬ ВМЕСТЕ",
"heroTitle": "Твои друзья.",
"heroAccent": "Твой голос.",
"heroDescription": "Подключайтесь к сообществу TeamSpeak прямо в браузере.",
"featureOneTitle": "Без установки клиента",
"featureOneBody": "Подключайтесь прямо из браузера.",
"featureTwoTitle": "Голос с низкой задержкой",
"featureTwoBody": "Используйте браузерное аудио с сервером TeamSpeak.",
"featureThreeTitle": "Привычное пространство",
"featureThreeBody": "Каналы, участники и чат в одном месте.",
"connectTitle": "Подключиться к серверу TeamSpeak",
"connectDescription": "Введите адрес сервера, чтобы подключиться.",
"securityNote": "WebSpeak защищает подключение и данные личности.",
"footerNote": "Голосовое общение в браузере",
"serverRailLabel": "Избранные и недавние серверы",
"switchServer": "Переключиться на",
"favoriteServer": "Сохранённый сервер",
"copyInvite": "Скопировать ссылку-приглашение",
"voiceChannels": "ГОЛОСОВЫЕ КАНАЛЫ",
"voiceConnected": "ГОЛОС ПОДКЛЮЧЁН",
"online": "В сети",
"audioSettings": "Настройки звука",
"toggleChat": "Показать или скрыть чат канала",
"invitePeople": "Пригласить участников",
"closeChat": "Закрыть чат",
"voiceControls": "Управление голосом",
"stopScreenShare": "Остановить показ экрана",
"toggleAccompaniment": "Переключить сопровождение"
}
},
"ja": {
"messages": {
"homeComponentName": "Discord 風の接続ホーム",
"homeAccessibleName": "Discord 風 WebSpeak 接続ページ",
"voiceComponentName": "Discord 風のボイスワークスペース",
"voiceAccessibleName": "Discord 風 WebSpeak ボイスワークスペース",
"tagline": "あなたの声を、どこでも。",
"eyebrow": "一緒にボイスチャット",
"heroTitle": "仲間と、",
"heroAccent": "声をつなごう。",
"heroDescription": "ブラウザーから TeamSpeak コミュニティに参加できます。",
"featureOneTitle": "クライアント不要",
"featureOneBody": "ブラウザーから直接接続。",
"featureTwoTitle": "低遅延の音声",
"featureTwoBody": "TeamSpeak サーバーでブラウザー音声を利用。",
"featureThreeTitle": "使い慣れた空間",
"featureThreeBody": "チャンネル、メンバー、チャットをまとめて表示。",
"connectTitle": "TeamSpeak サーバーに接続",
"connectDescription": "サーバーアドレスを入力して参加します。",
"securityNote": "接続と ID 情報は WebSpeak が安全に管理します。",
"footerNote": "ブラウザーでボイスチャット",
"serverRailLabel": "保存済み・最近のサーバー",
"switchServer": "切り替え先",
"favoriteServer": "保存済みサーバー",
"copyInvite": "招待リンクをコピー",
"voiceChannels": "ボイスチャンネル",
"voiceConnected": "ボイス接続中",
"online": "オンライン",
"audioSettings": "音声設定",
"toggleChat": "チャンネルチャットの表示切替",
"invitePeople": "メンバーを招待",
"closeChat": "チャットを閉じる",
"voiceControls": "ボイスコントロール",
"stopScreenShare": "画面共有を停止",
"toggleAccompaniment": "伴奏を切り替え"
}
}
}
}
+14
View File
@@ -0,0 +1,14 @@
{
"schemaVersion": 3,
"packageType": "open-skin",
"id": "community.discord-voice",
"name": "Discord Voice",
"version": "1.0.12",
"author": "WebSpeak Project",
"license": "AGPL-3.0-only",
"description": "A Discord-inspired dark voice workspace built with WebSpeak's portable open-skin interface.",
"entry": "skin.css",
"components": "components.json",
"content": "content.json",
"minAppVersion": "0.3.2"
}
File diff suppressed because it is too large. Load diff
Binary file not shown.
@@ -0,0 +1,9 @@
# Harbor Voice Workspace
这是一个 KOOK 语音工作区风格的完整皮肤测试包,参考范围只限语音客户端:服务器快捷栏、频道列表、中央聊天、成员列表和底部语音控制。没有复用 KOOK 的图片、标志、广告或站点文案,也没有加入发现、陪玩、派对、商城、活动通知、排行榜或管理后台。
皮肤使用 `components.json` 的完整声明式 surface 自己构建频道树、聊天消息与输入框、成员状态和悄悄话控制;底部音频区嵌入 WebSpeak 的可信音频控件,继续使用现有麦克风/扬声器开关和音频设置(包括麦克风灵敏度)。样例隐藏与语音布局无关的伴奏开关;断开和频道控制仍由 WebSpeak 校验并执行。频道缩进直接映射 TeamSpeak 公开树深度;频道单击只改变皮肤本地选中态,双击才请求 TeamSpeak 切换频道。语音成员列表显示公开的说话、静音和离开状态。消息、频道和成员数据由权限筛选后提供。屏幕共享启动保留一个可自行排版和换肤的可信宿主按钮,以保留浏览器要求的真实用户手势;视频流和设备 API 不交给皮肤代码。皮肤不读取服务器地址、账号凭据或连接密钥,也不包含可执行 JavaScript/Wasm;这个样例用于验证 v3 surface 的可定制界面和交互,v4 Wasm 插件运行时另由运行时测试覆盖。
桌面布局保留四个区域:服务器快捷栏、频道树、聊天区和成员区;服务器栏底部展示当前 TeamSpeak 昵称,连接后语音控制坞固定在频道栏底部。昵称项只呈现当前会话身份,不模拟 KOOK 账号或资料运营功能。窄屏下服务器栏保持可用,频道项转为横向滚动,成员与语音控制各自占一行,基础连接控制不被隐藏。
`manifest.json`、`components.json` 与 `skin.css` 是可编辑源码。根目录的 `../harbor-voice.wskin` 是源码打包后的本地导入包;源码修改后运行 `npm run skin:harbor:build` 重新打包,再在测试实例的皮肤管理页导入验证。当前没有加入公共皮肤目录或发布到服务器。
+480
View File
@@ -0,0 +1,480 @@
{
"schemaVersion": 3,
"components": [
{
"id": "harbor-home",
"name": "Harbor connection home",
"page": "home",
"mode": "surface",
"accessibleName": "WebSpeak connection page",
"permissions": ["ui.surface.replace"],
"actions": {},
"root": {
"tag": "main",
"part": "home",
"children": [
{
"tag": "header",
"part": "home-header",
"children": [
{ "tag": "span", "part": "brand-mark", "children": [{ "text": "W" }] },
{ "tag": "span", "part": "brand-name", "children": [{ "text": "WEBSPEAK" }] },
{ "widget": "app.language-switcher", "part": "language" },
{ "widget": "app.skin-switcher", "part": "skin" }
]
},
{
"tag": "section",
"part": "connection-card",
"children": [
{ "tag": "p", "part": "eyebrow", "children": [{ "text": "VOICE CLIENT" }] },
{ "tag": "h1", "part": "title", "children": [{ "text": "Connect with your community" }] },
{ "tag": "p", "part": "description", "children": [{ "text": "Choose a TeamSpeak server and return to your voice channels." }] },
{ "widget": "home.connection-form", "part": "connection-form" }
]
},
{
"tag": "footer",
"part": "home-footer",
"children": [{ "text": "Your connection and identity stay under WebSpeak's control." }]
}
]
}
},
{
"id": "harbor-workspace",
"name": "Harbor voice workspace",
"page": "voice",
"mode": "surface",
"accessibleName": "WebSpeak voice workspace",
"permissions": [
"ui.surface.replace",
"session.status.read",
"session.channels.read",
"session.members.read",
"session.channel.join",
"servers.quickList.read",
"servers.quickList.switch",
"chat.channel.read",
"chat.channel.send",
"audio.status.read",
"audio.microphone.control",
"audio.output.control",
"voice.whisper.status.read",
"voice.whisper.control",
"voice.disconnect",
"voice.screenShare.read",
"voice.screenShare.control"
],
"actions": {
"switch-server": {
"type": "quickServers.switch",
"args": { "quickServerId": "{{server.id}}" }
},
"select-channel": {
"type": "ui.setState",
"args": { "key": "selectedchannel", "value": "{{channel.id}}" }
},
"join-channel": {
"type": "voice.joinChannel",
"args": { "channelId": "{{channel.id}}" }
},
"send-message": {
"type": "chat.sendMessage",
"args": { "text": "{{state.message}}" }
},
"disconnect": { "type": "voice.disconnect", "args": {} },
"whisper-on": { "type": "voice.setWhisperActive", "args": { "active": true } },
"whisper-off": { "type": "voice.setWhisperActive", "args": { "active": false } },
"watch-screen-share": {
"type": "voice.joinScreenShare",
"args": { "streamId": "{{member.screenShareStreamId}}" }
},
"watch-channel-member-screen-share": {
"type": "voice.joinScreenShare",
"args": { "streamId": "{{voicemember.screenShareStreamId}}" }
}
},
"state": { "selectedchannel": "", "message": "" },
"root": {
"tag": "main",
"part": "workspace",
"children": [
{
"tag": "header",
"part": "topbar",
"children": [
{ "tag": "span", "part": "brand-mark", "children": [{ "text": "W" }] },
{ "tag": "span", "part": "brand-name", "children": [{ "text": "WEBSPEAK" }] },
{ "tag": "span", "part": "server-title", "children": [{ "text": "{{session.status.serverLabel}}" }] },
{ "widget": "app.language-switcher", "part": "language" },
{ "widget": "app.skin-switcher", "part": "skin" }
]
},
{
"tag": "nav",
"part": "server-rail",
"attributes": { "aria-label": "Favorite and recent servers" },
"children": [
{
"tag": "div",
"part": "quick-server-item",
"repeat": { "path": "servers.quickList", "as": "server" },
"children": [
{
"tag": "button",
"part": "quick-server",
"attributes": {
"type": "button",
"aria-current": "{{server.current}}",
"aria-label": "Switch to {{server.label}}"
},
"events": { "click": "switch-server" },
"children": [
{ "tag": "span", "part": "server-monogram", "children": [{ "text": "{{server.label}}" }] },
{
"tag": "span",
"part": "server-kind",
"when": { "path": "server.favorite", "equals": true },
"children": [{ "text": "Saved" }]
},
{
"tag": "span",
"part": "server-kind",
"when": { "path": "server.kind", "equals": "recent" },
"children": [{ "text": "Recent" }]
}
]
}
]
}
]
},
{
"tag": "aside",
"part": "channel-panel",
"attributes": { "aria-label": "Server channels" },
"children": [
{
"tag": "header",
"part": "server-summary",
"children": [
{ "tag": "strong", "part": "server-name", "children": [{ "text": "{{session.status.serverLabel}}" }] },
{ "tag": "small", "part": "server-subtitle", "children": [{ "text": "VOICE CHANNELS" }] }
]
},
{
"tag": "nav",
"part": "channel-list",
"attributes": { "aria-label": "Channels" },
"children": [
{ "tag": "h2", "part": "section-label", "children": [{ "text": "CHANNELS" }] },
{
"tag": "div",
"part": "channel-item",
"repeat": { "path": "session.channels", "as": "channel" },
"children": [
{
"tag": "button",
"part": "channel-row",
"attributes": {
"type": "button",
"aria-current": "{{channel.current}}",
"aria-label": "Double-click to join {{channel.name}}",
"data-depth": "{{channel.depth}}"
},
"events": { "click": "select-channel", "dblclick": "join-channel" },
"children": [
{ "tag": "span", "part": "channel-glyph", "children": [{ "text": "◉" }] },
{ "tag": "span", "part": "channel-name", "children": [{ "text": "{{channel.name}}" }] },
{ "tag": "small", "part": "channel-count", "children": [{ "text": "{{channel.memberCount}}" }] },
{
"tag": "span",
"part": "selected-channel-indicator",
"when": { "path": "state.selectedchannel", "equals": "{{channel.id}}" },
"attributes": { "aria-label": "Selected" }
}
]
},
{
"tag": "ul",
"part": "channel-voice-members",
"when": { "path": "channel.current", "equals": true },
"attributes": { "aria-label": "Members connected to this channel" },
"children": [
{
"tag": "li",
"part": "channel-voice-member",
"repeat": { "path": "channel.members", "as": "voicemember" },
"children": [
{ "tag": "span", "part": "channel-member-avatar", "children": [{ "text": "{{voicemember.name}}" }] },
{ "tag": "span", "part": "channel-member-name", "children": [{ "text": "{{voicemember.name}}" }] },
{
"tag": "span",
"part": "channel-member-muted",
"when": { "path": "voicemember.status", "equals": "muted" },
"attributes": { "aria-label": "Microphone muted" },
"children": [{ "text": "MIC OFF" }]
},
{
"tag": "span",
"part": "channel-member-away",
"when": { "path": "voicemember.status", "equals": "away" },
"attributes": { "aria-label": "Away" },
"children": [{ "text": "AWAY" }]
},
{
"tag": "span",
"part": "channel-member-state",
"when": { "path": "voicemember.self", "equals": true },
"children": [{ "text": "YOU" }]
},
{
"tag": "span",
"part": "channel-member-state",
"when": { "path": "voicemember.speaking", "equals": true },
"attributes": { "aria-label": "Speaking" },
"children": [{ "text": "●" }]
},
{
"tag": "div",
"part": "channel-member-screen-share",
"when": { "path": "voicemember.screenSharing", "equals": true },
"children": [
{ "tag": "span", "part": "channel-member-screen-share-live", "children": [{ "text": "SHARING" }] },
{
"tag": "button",
"part": "channel-member-screen-share-watch",
"when": { "path": "voicemember.self", "equals": false },
"attributes": { "type": "button", "aria-label": "Watch {{voicemember.name}}'s screen" },
"events": { "click": "watch-channel-member-screen-share" },
"children": [{ "text": "WATCH" }]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"tag": "section",
"part": "conversation",
"attributes": { "aria-label": "Current channel conversation" },
"children": [
{
"tag": "header",
"part": "conversation-heading",
"children": [
{ "tag": "span", "part": "conversation-glyph", "children": [{ "text": "◉" }] },
{ "tag": "h1", "part": "channel-title", "children": [{ "text": "{{session.status.channelName}}" }] },
{
"tag": "span",
"part": "connection-state",
"when": { "path": "session.status.connected", "equals": true },
"children": [{ "text": "CONNECTED" }]
}
]
},
{
"tag": "div",
"part": "chat",
"children": [
{
"tag": "div",
"part": "chat-message-list",
"attributes": { "aria-label": "Current channel messages", "role": "log", "aria-live": "polite" },
"children": [
{
"tag": "p",
"part": "chat-empty",
"when": { "path": "chat.messages", "empty": true },
"children": [{ "text": "No messages yet. Say hello to the channel." }]
},
{
"tag": "article",
"part": "chat-message",
"repeat": { "path": "chat.messages", "as": "message" },
"children": [
{
"tag": "header",
"part": "chat-message-heading",
"children": [
{ "tag": "strong", "part": "chat-message-author", "children": [{ "text": "{{message.author}}" }] },
{ "tag": "time", "part": "chat-message-time", "children": [{ "text": "{{message.time}}" }] }
]
},
{ "tag": "p", "part": "chat-message-text", "children": [{ "text": "{{message.text}}" }] }
]
}
]
},
{
"tag": "form",
"part": "chat-composer",
"events": { "submit": "send-message" },
"children": [
{
"tag": "input",
"part": "chat-input",
"bindValue": "message",
"attributes": {
"type": "text",
"maxlength": 1000,
"autocomplete": "off",
"placeholder": "Message this channel",
"aria-label": "Message this channel"
}
},
{
"tag": "button",
"part": "chat-send",
"attributes": { "type": "submit", "aria-label": "Send message" },
"children": [{ "text": "Send" }]
}
]
}
]
},
{ "widget": "voice.screen-share-player", "part": "screen-player" }
]
},
{
"tag": "aside",
"part": "members-panel",
"attributes": { "aria-label": "Members in this channel" },
"children": [
{
"tag": "header",
"part": "members-heading",
"children": [
{ "tag": "h2", "part": "section-label", "children": [{ "text": "MEMBERS" }] }
]
},
{
"tag": "ul",
"part": "member-list",
"children": [
{
"tag": "li",
"part": "member-row",
"repeat": { "path": "session.members", "as": "member" },
"children": [
{ "tag": "span", "part": "member-avatar", "children": [{ "text": "{{member.name}}" }] },
{ "tag": "span", "part": "member-name", "children": [{ "text": "{{member.name}}" }] },
{
"tag": "span",
"part": "speaking-indicator",
"when": { "path": "member.speaking", "equals": true },
"attributes": { "aria-label": "Speaking" },
"children": [{ "text": "SPEAKING" }]
},
{
"tag": "span",
"part": "member-muted-state",
"when": { "path": "member.status", "equals": "muted" },
"attributes": { "aria-label": "Microphone muted" },
"children": [{ "text": "MIC OFF" }]
},
{
"tag": "span",
"part": "member-away-state",
"when": { "path": "member.status", "equals": "away" },
"attributes": { "aria-label": "Away" },
"children": [{ "text": "AWAY" }]
},
{
"tag": "div",
"part": "member-screen-share",
"when": { "path": "member.screenSharing", "equals": true },
"children": [
{ "tag": "span", "part": "member-screen-share-live", "children": [{ "text": "SHARING" }] },
{
"tag": "button",
"part": "member-screen-share-watch",
"when": { "path": "member.self", "equals": false },
"attributes": { "type": "button", "aria-label": "Watch {{member.name}}'s screen" },
"events": { "click": "watch-screen-share" },
"children": [{ "text": "WATCH" }]
}
]
}
]
}
]
},
{
"tag": "div",
"part": "whisper-controls",
"children": [
{
"tag": "button",
"part": "whisper-start",
"when": { "path": "whisper.status.active", "equals": false },
"attributes": { "type": "button", "aria-label": "Start whisper" },
"events": { "click": "whisper-on" },
"children": [{ "text": "Whisper" }]
},
{
"tag": "button",
"part": "whisper-stop",
"when": { "path": "whisper.status.active", "equals": true },
"attributes": { "type": "button", "aria-label": "Stop whisper" },
"events": { "click": "whisper-off" },
"children": [{ "text": "Whisper on" }]
}
]
}
]
},
{
"tag": "footer",
"part": "voice-dock",
"attributes": { "aria-label": "Voice controls" },
"children": [
{
"tag": "div",
"part": "voice-dock-heading",
"children": [
{ "tag": "span", "part": "connection-indicator", "children": [{ "text": "●" }] },
{ "tag": "strong", "part": "voice-channel-name", "children": [{ "text": "{{session.status.channelName}}" }] },
{ "tag": "span", "part": "voice-dock-caption", "children": [{ "text": "VOICE CONNECTED" }] }
]
},
{
"tag": "div",
"part": "voice-dock-actions",
"children": [
{ "widget": "voice.screen-share-start", "part": "screen-share-start" },
{ "widget": "voice.audio-controls", "part": "audio-controls" },
{
"tag": "button",
"part": "disconnect-control",
"attributes": { "type": "button", "aria-label": "Disconnect voice" },
"events": { "click": "disconnect" },
"children": [{ "text": "Leave" }]
}
]
}
]
},
{
"tag": "div",
"part": "identity-entry",
"when": { "path": "session.status.userName" },
"attributes": { "role": "group", "aria-label": "Current TeamSpeak identity" },
"children": [
{ "tag": "span", "part": "identity-monogram", "children": [{ "text": "TS" }] },
{ "tag": "span", "part": "identity-name", "children": [{ "text": "{{session.status.userName}}" }] }
]
}
]
}
}
]
}
+13
View File
@@ -0,0 +1,13 @@
{
"schemaVersion": 3,
"packageType": "open-skin",
"id": "community.harbor-voice",
"name": "Harbor Voice Workspace",
"version": "1.1.1",
"author": "WebSpeak Project",
"license": "AGPL-3.0-only",
"description": "A KOOK-inspired dark voice workspace using only WebSpeak host controls and public session data.",
"entry": "skin.css",
"components": "components.json",
"minAppVersion": "0.2.7"
}
+946
View File
@@ -0,0 +1,946 @@
:root {
color-scheme: dark;
--skin-harbor-bg: #17181b;
--skin-harbor-rail: #141518;
--skin-harbor-panel: #1d1e22;
--skin-harbor-raised: #292a2f;
--skin-harbor-hover: #303137;
--skin-harbor-border: #303136;
--skin-harbor-text: #f0f1f3;
--skin-harbor-muted: #a0a2a8;
--skin-harbor-dim: #777a82;
--skin-harbor-accent: #58c877;
--skin-harbor-danger: #e36b6b;
--skin-harbor-radius: 9px;
}
[data-ws-plugin-part="harbor-home"] {
display: grid;
grid-template-rows: auto 1fr auto;
justify-items: center;
min-height: 100dvh;
gap: 28px;
padding: clamp(16px, 4vw, 42px);
color: var(--skin-harbor-text);
background:
radial-gradient(ellipse at 50% 44%, #25272b 0, transparent 58%),
var(--skin-harbor-bg);
}
[data-ws-plugin-part="harbor-home.home-header"] {
display: flex;
align-items: center;
gap: 11px;
width: min(100%, 1080px);
}
[data-ws-plugin-part="harbor-home.brand-mark"],
[data-ws-plugin-part="harbor-workspace.brand-mark"] {
display: grid;
place-items: center;
flex: 0 0 34px;
width: 34px;
height: 34px;
border-radius: 50%;
color: #101512;
background: var(--skin-harbor-accent);
font-size: 14px;
font-weight: 900;
}
[data-ws-plugin-part="harbor-home.brand-name"],
[data-ws-plugin-part="harbor-workspace.brand-name"] {
color: var(--skin-harbor-text);
font-size: 12px;
font-weight: 850;
letter-spacing: .1em;
}
[data-ws-plugin-part="harbor-home.language"] { margin-left: auto; }
[data-ws-plugin-part="harbor-home.connection-card"] {
align-self: center;
width: min(100%, 510px);
padding: clamp(22px, 5vw, 40px);
border: 1px solid var(--skin-harbor-border);
border-radius: 16px;
background: color-mix(in srgb, var(--skin-harbor-panel) 96%, transparent);
box-shadow: 0 24px 70px #0007;
}
[data-ws-plugin-part="harbor-home.eyebrow"] {
color: var(--skin-harbor-accent);
font-size: 10px;
font-weight: 800;
letter-spacing: .14em;
}
[data-ws-plugin-part="harbor-home.title"] {
margin: 12px 0 8px;
font-size: clamp(26px, 5vw, 38px);
letter-spacing: -.04em;
}
[data-ws-plugin-part="harbor-home.description"],
[data-ws-plugin-part="harbor-home.home-footer"] {
color: var(--skin-harbor-muted);
line-height: 1.6;
}
[data-ws-plugin-part="harbor-home.home-footer"] {
width: min(100%, 1080px);
font-size: 12px;
}
[data-ws-plugin-part="harbor-home"] .join-card {
color: var(--skin-harbor-text);
background: transparent;
border-color: var(--skin-harbor-border);
box-shadow: none;
}
[data-ws-plugin-part="harbor-home"] .field-wrap,
[data-ws-plugin-part="harbor-home"] .settings-select {
color: var(--skin-harbor-muted);
background: var(--skin-harbor-raised);
border-color: var(--skin-harbor-border);
}
[data-ws-plugin-part="harbor-home"] .field-wrap input,
[data-ws-plugin-part="harbor-home"] .settings-select {
color: var(--skin-harbor-text);
}
[data-ws-plugin-part="harbor-workspace"] {
display: grid;
grid-template-columns: 68px 276px minmax(340px, 1fr) 244px;
grid-template-rows: 54px minmax(0, 1fr);
width: 100%;
height: 100dvh;
min-height: 560px;
overflow: hidden;
color: var(--skin-harbor-text);
background: var(--skin-harbor-bg);
font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
[data-ws-plugin-part="harbor-workspace"],
[data-ws-plugin-part="harbor-workspace"] * {
scrollbar-color: #4a4c51 transparent;
scrollbar-width: thin;
}
[data-ws-plugin-part="harbor-workspace"] *::-webkit-scrollbar { width: 6px; height: 6px; }
[data-ws-plugin-part="harbor-workspace"] *::-webkit-scrollbar-thumb { background: #4a4c51; border-radius: 6px; }
[data-ws-plugin-part="harbor-workspace.topbar"] {
z-index: 2;
grid-column: 1 / -1;
grid-row: 1;
display: flex;
align-items: center;
gap: 11px;
min-width: 0;
padding: 0 14px;
border-bottom: 1px solid var(--skin-harbor-border);
background: var(--skin-harbor-rail);
}
[data-ws-plugin-part="harbor-workspace.server-title"] {
overflow: hidden;
margin-right: auto;
color: var(--skin-harbor-muted);
font-size: 12px;
text-overflow: ellipsis;
white-space: nowrap;
}
[data-ws-plugin-part="harbor-workspace.server-rail"] {
grid-column: 1;
grid-row: 2;
display: flex;
flex-direction: column;
align-items: center;
gap: 9px;
min-height: 0;
overflow-y: auto;
padding: 13px 7px;
background: var(--skin-harbor-rail);
border-right: 1px solid #ffffff08;
}
[data-ws-plugin-part="harbor-workspace.quick-server"] {
display: grid;
justify-items: center;
gap: 3px;
width: 52px;
min-height: 54px;
padding: 4px;
border: 0;
border-radius: 13px;
color: var(--skin-harbor-muted);
background: transparent;
cursor: pointer;
}
[data-ws-plugin-part="harbor-workspace.quick-server"]:hover,
[data-ws-plugin-part="harbor-workspace.quick-server"]:focus-visible {
color: var(--skin-harbor-text);
background: var(--skin-harbor-raised);
}
[data-ws-plugin-part="harbor-workspace.quick-server"][aria-current="true"] {
color: var(--skin-harbor-text);
background: var(--skin-harbor-raised);
box-shadow: inset 3px 0 var(--skin-harbor-accent);
}
[data-ws-plugin-part="harbor-workspace.server-monogram"] {
display: grid;
place-items: center;
width: 40px;
height: 40px;
overflow: hidden;
border: 1px solid #ffffff12;
border-radius: 13px;
color: var(--skin-harbor-text);
background: linear-gradient(145deg, #383a40, #222429);
font-size: 11px;
font-weight: 800;
text-align: center;
}
[data-ws-plugin-part="harbor-workspace.server-kind"] {
color: var(--skin-harbor-dim);
font-size: 8px;
line-height: 1;
}
[data-ws-plugin-part="harbor-workspace.identity-entry"] {
display: grid;
justify-items: center;
gap: 4px;
width: 100%;
margin-top: auto;
padding: 9px 1px 1px;
border-top: 1px solid var(--skin-harbor-border);
}
[data-ws-plugin-part="harbor-workspace.identity-monogram"] {
display: grid;
place-items: center;
width: 38px;
height: 38px;
border: 1px solid #ffffff18;
border-radius: 50%;
color: var(--skin-harbor-text);
background: linear-gradient(145deg, #4a4c53, #292a30);
font-size: 10px;
font-weight: 850;
}
[data-ws-plugin-part="harbor-workspace.identity-name"] {
display: block;
max-width: 100%;
overflow: hidden;
color: var(--skin-harbor-muted);
font-size: 8px;
text-overflow: ellipsis;
white-space: nowrap;
}
[data-ws-plugin-part="harbor-workspace.channel-panel"] {
z-index: 1;
grid-column: 2;
grid-row: 2;
display: flex;
flex-direction: column;
min-width: 0;
min-height: 0;
overflow: auto;
padding: 12px 9px 118px;
border-right: 1px solid var(--skin-harbor-border);
background: var(--skin-harbor-panel);
}
[data-ws-plugin-part="harbor-workspace.server-summary"] {
display: flex;
flex-direction: column;
gap: 4px;
min-height: 49px;
padding: 3px 9px 13px;
border-bottom: 1px solid #ffffff0b;
}
[data-ws-plugin-part="harbor-workspace.server-name"] {
overflow: hidden;
color: var(--skin-harbor-text);
font-size: 13px;
text-overflow: ellipsis;
white-space: nowrap;
}
[data-ws-plugin-part="harbor-workspace.server-subtitle"],
[data-ws-plugin-part="harbor-workspace.section-label"] {
color: var(--skin-harbor-dim);
font-size: 10px;
font-weight: 800;
letter-spacing: .08em;
}
[data-ws-plugin-part="harbor-workspace.channel-list"] {
display: flex;
flex-direction: column;
gap: 2px;
min-height: 0;
padding-top: 13px;
}
[data-ws-plugin-part="harbor-workspace.section-label"] { margin: 0 8px 7px; }
[data-ws-plugin-part="harbor-workspace.channel-row"] {
position: relative;
display: flex;
align-items: center;
gap: 9px;
width: 100%;
min-height: 38px;
padding: 6px 9px;
border: 0;
border-radius: 6px;
color: var(--skin-harbor-muted);
background: transparent;
text-align: left;
cursor: pointer;
}
[data-ws-plugin-part="harbor-workspace.selected-channel-indicator"] {
position: absolute;
inset: 0;
border: 1px solid var(--skin-harbor-accent);
border-radius: inherit;
pointer-events: none;
}
[data-ws-plugin-part="harbor-workspace.channel-row"]:hover,
[data-ws-plugin-part="harbor-workspace.channel-row"][aria-current="true"] {
color: var(--skin-harbor-text);
background: var(--skin-harbor-raised);
}
[data-ws-plugin-part="harbor-workspace.channel-row"][aria-current="true"] {
box-shadow: inset 2px 0 var(--skin-harbor-accent);
}
[data-ws-plugin-part="harbor-workspace.channel-row"][data-depth="1"] { padding-inline-start: 19px; }
[data-ws-plugin-part="harbor-workspace.channel-row"][data-depth="2"] { padding-inline-start: 29px; }
[data-ws-plugin-part="harbor-workspace.channel-row"][data-depth="3"] { padding-inline-start: 39px; }
[data-ws-plugin-part="harbor-workspace.channel-row"][data-depth="4"] { padding-inline-start: 49px; }
[data-ws-plugin-part="harbor-workspace.channel-row"][data-depth="5"] { padding-inline-start: 59px; }
[data-ws-plugin-part="harbor-workspace.channel-row"][data-depth="6"] { padding-inline-start: 69px; }
[data-ws-plugin-part="harbor-workspace.channel-row"][data-depth="7"] { padding-inline-start: 79px; }
[data-ws-plugin-part="harbor-workspace.channel-row"][data-depth="8"] { padding-inline-start: 89px; }
[data-ws-plugin-part="harbor-workspace.channel-glyph"] {
display: grid;
place-items: center;
width: 18px;
color: var(--skin-harbor-dim);
font-size: 13px;
}
[data-ws-plugin-part="harbor-workspace.channel-name"] {
min-width: 0;
flex: 1;
overflow: hidden;
font-size: 13px;
text-overflow: ellipsis;
white-space: nowrap;
}
[data-ws-plugin-part="harbor-workspace.channel-count"] {
color: var(--skin-harbor-dim);
font-size: 10px;
}
[data-ws-plugin-part="harbor-workspace.channel-voice-members"] {
display: grid;
gap: 1px;
margin: 0 0 6px 29px;
padding: 2px 0 3px;
list-style: none;
}
[data-ws-plugin-part="harbor-workspace.channel-voice-member"] {
display: grid;
grid-template-columns: 18px minmax(0, 1fr) auto auto;
align-items: center;
gap: 5px;
min-height: 21px;
color: var(--skin-harbor-muted);
font-size: 10px;
}
[data-ws-plugin-part="harbor-workspace.channel-member-avatar"] {
display: grid;
place-items: center;
width: 16px;
height: 16px;
overflow: hidden;
border-radius: 50%;
color: var(--skin-harbor-text);
background: #393b41;
font-size: 7px;
font-weight: 800;
}
[data-ws-plugin-part="harbor-workspace.channel-member-name"] {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
[data-ws-plugin-part="harbor-workspace.channel-member-state"] {
color: var(--skin-harbor-accent);
font-size: 8px;
font-weight: 800;
}
[data-ws-plugin-part="harbor-workspace.channel-member-muted"],
[data-ws-plugin-part="harbor-workspace.member-muted-state"] {
color: var(--skin-harbor-danger);
font-size: 8px;
font-weight: 800;
}
[data-ws-plugin-part="harbor-workspace.channel-member-away"],
[data-ws-plugin-part="harbor-workspace.member-away-state"] {
color: var(--skin-harbor-dim);
font-size: 8px;
font-weight: 800;
}
[data-ws-plugin-part="harbor-workspace.channel-member-screen-share"] {
grid-column: 2 / -1;
display: flex;
align-items: center;
gap: 6px;
color: var(--skin-harbor-accent);
font-size: 8px;
font-weight: 800;
}
[data-ws-plugin-part="harbor-workspace.channel-member-screen-share-watch"],
[data-ws-plugin-part="harbor-workspace.member-screen-share-watch"] {
min-height: 28px;
padding: 0 8px;
border: 1px solid #7ed95755;
border-radius: 5px;
color: var(--skin-harbor-text);
background: var(--skin-harbor-raised);
font-size: 9px;
font-weight: 800;
cursor: pointer;
}
[data-ws-plugin-part="harbor-workspace.channel-member-screen-share-watch"]:hover,
[data-ws-plugin-part="harbor-workspace.member-screen-share-watch"]:hover {
color: var(--skin-harbor-accent);
background: #313238;
}
[data-ws-plugin-part="harbor-workspace.conversation"] {
grid-column: 3;
grid-row: 2;
display: grid;
grid-template-rows: 48px minmax(0, 1fr) auto;
gap: 10px;
min-width: 0;
min-height: 0;
padding: 0 17px 12px;
background: var(--skin-harbor-bg);
}
[data-ws-plugin-part="harbor-workspace.conversation-heading"] {
display: flex;
align-items: center;
gap: 9px;
min-width: 0;
border-bottom: 1px solid var(--skin-harbor-border);
}
[data-ws-plugin-part="harbor-workspace.conversation-glyph"] {
color: var(--skin-harbor-muted);
font-size: 15px;
}
[data-ws-plugin-part="harbor-workspace.channel-title"] {
min-width: 0;
margin: 0 auto 0 0;
overflow: hidden;
font-size: 14px;
font-weight: 700;
text-overflow: ellipsis;
white-space: nowrap;
}
[data-ws-plugin-part="harbor-workspace.connection-state"] {
color: var(--skin-harbor-accent);
font-size: 9px;
font-weight: 800;
letter-spacing: .06em;
}
[data-ws-plugin-part="harbor-workspace"] [data-ws-part="voice.chat"] {
min-width: 0;
min-height: 0;
color: var(--skin-harbor-text);
background: transparent;
border-color: transparent;
}
[data-ws-plugin-part="harbor-workspace.chat"] {
display: grid;
grid-template-rows: minmax(0, 1fr) auto;
min-width: 0;
min-height: 0;
overflow: hidden;
color: var(--skin-harbor-text);
}
[data-ws-plugin-part="harbor-workspace.chat-message-list"] {
display: flex;
flex-direction: column;
justify-content: flex-end;
gap: 14px;
min-height: 0;
overflow: auto;
padding: 8px 4px 16px;
}
[data-ws-plugin-part="harbor-workspace.chat-empty"] {
align-self: center;
margin: auto;
color: var(--skin-harbor-muted);
font-size: 13px;
}
[data-ws-plugin-part="harbor-workspace.chat-message"] { min-width: 0; }
[data-ws-plugin-part="harbor-workspace.chat-message-heading"] { display: flex; align-items: baseline; gap: 8px; }
[data-ws-plugin-part="harbor-workspace.chat-message-author"] { color: var(--skin-harbor-text); font-size: 12px; }
[data-ws-plugin-part="harbor-workspace.chat-message-time"] { color: var(--skin-harbor-dim); font-size: 10px; }
[data-ws-plugin-part="harbor-workspace.chat-message-text"] { margin: 3px 0 0; color: var(--skin-harbor-muted); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
[data-ws-plugin-part="harbor-workspace.chat-composer"] {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
padding: 8px;
border: 1px solid var(--skin-harbor-border);
border-radius: 9px;
background: var(--skin-harbor-panel);
}
[data-ws-plugin-part="harbor-workspace.chat-input"] {
flex: 1;
min-width: 0;
height: 38px;
padding: 0 10px;
border: 0;
outline: 0;
color: var(--skin-harbor-text);
background: transparent;
}
[data-ws-plugin-part="harbor-workspace.chat-send"] {
min-width: 54px;
min-height: 36px;
border: 0;
border-radius: 7px;
color: #111;
background: var(--skin-harbor-accent);
font-weight: 700;
cursor: pointer;
}
[data-ws-plugin-part="harbor-workspace"] .chat-panel { min-height: 0; background: transparent; }
[data-ws-plugin-part="harbor-workspace"] .chat-heading { border-color: var(--skin-harbor-border); }
[data-ws-plugin-part="harbor-workspace"] .message-bubble { color: var(--skin-harbor-text); background: var(--skin-harbor-panel); }
[data-ws-plugin-part="harbor-workspace"] .message-composer { border-color: var(--skin-harbor-border); background: var(--skin-harbor-panel); }
[data-ws-plugin-part="harbor-workspace"] .message-composer input { color: var(--skin-harbor-text); }
[data-ws-plugin-part="harbor-workspace.members-panel"] {
grid-column: 4;
grid-row: 2;
min-width: 0;
min-height: 0;
overflow: auto;
padding: 16px 11px 118px;
border-left: 1px solid var(--skin-harbor-border);
background: var(--skin-harbor-panel);
}
[data-ws-plugin-part="harbor-workspace.members-heading"] {
display: flex;
align-items: center;
justify-content: space-between;
min-height: 30px;
}
[data-ws-plugin-part="harbor-workspace.members-heading"] .section-label { margin: 0; }
[data-ws-plugin-part="harbor-workspace.member-total"] { color: var(--skin-harbor-dim); font-size: 11px; }
[data-ws-plugin-part="harbor-workspace.member-list"] {
display: grid;
gap: 3px;
margin: 8px 0 16px;
padding: 0;
list-style: none;
}
[data-ws-plugin-part="harbor-workspace.member-row"] {
display: grid;
grid-template-columns: 32px minmax(0, 1fr);
align-items: center;
column-gap: 8px;
min-height: 42px;
padding: 4px 5px;
border-radius: 6px;
color: var(--skin-harbor-muted);
font-size: 12px;
}
[data-ws-plugin-part="harbor-workspace.member-row"]:hover { background: var(--skin-harbor-raised); }
[data-ws-plugin-part="harbor-workspace.member-avatar"] {
grid-row: span 2;
display: grid;
place-items: center;
width: 30px;
height: 30px;
overflow: hidden;
border-radius: 50%;
color: var(--skin-harbor-text);
background: #393b41;
font-size: 10px;
font-weight: 700;
}
[data-ws-plugin-part="harbor-workspace.member-name"] {
min-width: 0;
overflow: hidden;
color: var(--skin-harbor-text);
text-overflow: ellipsis;
white-space: nowrap;
}
[data-ws-plugin-part="harbor-workspace.speaking-indicator"] {
color: var(--skin-harbor-accent);
font-size: 8px;
font-weight: 800;
letter-spacing: .05em;
}
[data-ws-plugin-part="harbor-workspace.member-muted-state"],
[data-ws-plugin-part="harbor-workspace.member-away-state"],
[data-ws-plugin-part="harbor-workspace.speaking-indicator"] { grid-column: 2 / -1; }
[data-ws-plugin-part="harbor-workspace.member-screen-share"] {
grid-column: 2 / -1;
display: flex;
align-items: center;
gap: 6px;
color: var(--skin-harbor-accent);
font-size: 8px;
font-weight: 800;
}
[data-ws-plugin-part="harbor-workspace.voice-dock"] {
z-index: 4;
grid-column: 2;
grid-row: 2;
align-self: end;
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 6px 8px;
min-width: 0;
padding: 9px;
border: 1px solid var(--skin-harbor-border);
border-radius: 10px;
background: #222328;
box-shadow: 0 8px 20px #0005;
}
[data-ws-plugin-part="harbor-workspace.voice-dock-heading"] {
grid-column: 1 / -1;
display: grid;
grid-template-columns: 10px minmax(0, 1fr);
align-items: center;
gap: 2px 7px;
}
[data-ws-plugin-part="harbor-workspace.voice-dock-actions"] {
grid-column: 1 / -1;
display: flex;
align-items: center;
justify-content: space-between;
gap: 4px;
min-width: 0;
}
[data-ws-plugin-part="harbor-workspace.connection-indicator"] {
grid-row: span 2;
color: var(--skin-harbor-accent);
font-size: 9px;
}
[data-ws-plugin-part="harbor-workspace.voice-channel-name"] {
overflow: hidden;
color: var(--skin-harbor-text);
font-size: 12px;
text-overflow: ellipsis;
white-space: nowrap;
}
[data-ws-plugin-part="harbor-workspace.voice-dock-caption"] {
color: var(--skin-harbor-dim);
font-size: 8px;
letter-spacing: .05em;
}
[data-ws-plugin-part="harbor-workspace.audio-controls"] {
display: flex;
align-items: center;
gap: 4px;
min-width: 0;
}
[data-ws-plugin-part="harbor-workspace.microphone-control"],
[data-ws-plugin-part="harbor-workspace.output-control"],
[data-ws-plugin-part="harbor-workspace.disconnect-control"],
[data-ws-plugin-part="harbor-workspace.whisper-start"],
[data-ws-plugin-part="harbor-workspace.whisper-stop"] {
min-width: 38px;
min-height: 38px;
padding: 0 8px;
border: 1px solid var(--skin-harbor-border);
border-radius: 7px;
color: var(--skin-harbor-muted);
background: var(--skin-harbor-raised);
cursor: pointer;
}
[data-ws-plugin-part="harbor-workspace.microphone-control"][aria-pressed="true"],
[data-ws-plugin-part="harbor-workspace.output-control"][aria-pressed="true"] { color: var(--skin-harbor-danger); }
[data-ws-plugin-part="harbor-workspace.disconnect-control"] { color: var(--skin-harbor-danger); }
[data-ws-plugin-part="harbor-workspace.output-volume"] { width: 72px; accent-color: var(--skin-harbor-accent); }
[data-ws-plugin-part="harbor-workspace.whisper-controls"] { display: flex; gap: 6px; margin-top: 12px; }
[data-ws-plugin-part="harbor-workspace.screen-share-start"] { flex: 0 0 auto; }
[data-ws-plugin-part="harbor-workspace.screen-share-start"] button {
display: grid;
place-items: center;
width: 34px;
height: 34px;
padding: 0;
border: 1px solid var(--skin-harbor-border);
border-radius: 7px;
color: var(--skin-harbor-muted);
background: var(--skin-harbor-raised);
cursor: pointer;
}
[data-ws-plugin-part="harbor-workspace.screen-share-start"] button:hover:not(:disabled),
[data-ws-plugin-part="harbor-workspace.screen-share-start"] button:focus-visible { color: var(--skin-harbor-accent); }
[data-ws-plugin-part="harbor-workspace.screen-share-start"] button:disabled { opacity: .45; cursor: not-allowed; }
[data-ws-plugin-part="harbor-workspace.screen-share-start"] button span {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
[data-ws-plugin-part="harbor-workspace"] .desktop-audio-dock {
min-width: 0;
margin: 0;
padding: 4px;
border: 0;
border-radius: 7px;
background: transparent;
box-shadow: none;
}
[data-ws-plugin-part="harbor-workspace"] .desktop-audio-dock-copy { display: none; }
[data-ws-plugin-part="harbor-workspace"] .desktop-audio-dock-actions { gap: 2px; }
[data-ws-plugin-part="harbor-workspace"] .dock-audio-button { width: 34px; height: 34px; color: var(--skin-harbor-muted); }
[data-ws-plugin-part="harbor-workspace"] .dock-audio-button:hover,
[data-ws-plugin-part="harbor-workspace"] .dock-audio-button:focus-visible { color: var(--skin-harbor-accent); background: var(--skin-harbor-raised); border-color: var(--skin-harbor-border); }
[data-ws-plugin-part="harbor-workspace.audio-controls"] .accompaniment-toggle { display: none; }
[data-ws-plugin-part="harbor-workspace.disconnect-control"] {
display: grid;
align-content: center;
}
[data-ws-plugin-part="harbor-workspace"] .ws-plugin-disconnect-control {
display: grid;
place-items: center;
width: 38px;
height: 38px;
border: 0;
border-radius: 8px;
color: var(--skin-harbor-danger);
background: var(--skin-harbor-raised);
cursor: pointer;
}
[data-ws-plugin-part="harbor-workspace"] .ws-plugin-disconnect-control:hover { background: #3a292b; }
[data-ws-plugin-part="harbor-workspace"] button:focus-visible,
[data-ws-plugin-part="harbor-home"] button:focus-visible,
[data-ws-plugin-part="harbor-home"] input:focus-visible {
outline: 2px solid var(--skin-harbor-accent);
outline-offset: 2px;
}
@media (max-width: 1060px) {
[data-ws-plugin-part="harbor-workspace"] {
grid-template-columns: 60px 236px minmax(300px, 1fr) 204px;
}
}
@media (max-width: 820px) {
[data-ws-plugin-part="harbor-workspace"] {
grid-template-columns: 56px minmax(0, 1fr);
grid-template-rows: 50px 126px minmax(220px, 1fr) 82px 74px;
height: 100dvh;
min-height: 540px;
}
[data-ws-plugin-part="harbor-workspace.topbar"] { padding: 0 8px; gap: 7px; }
[data-ws-plugin-part="harbor-workspace.brand-mark"] { flex-basis: 28px; width: 28px; height: 28px; }
[data-ws-plugin-part="harbor-workspace.brand-name"] { font-size: 10px; }
[data-ws-plugin-part="harbor-workspace.server-title"] { font-size: 10px; }
[data-ws-plugin-part="harbor-workspace.server-rail"] { grid-column: 1; grid-row: 2 / 6; padding: 8px 3px; }
[data-ws-plugin-part="harbor-workspace.quick-server"] { width: 48px; min-height: 48px; }
[data-ws-plugin-part="harbor-workspace.server-monogram"] { width: 36px; height: 36px; }
[data-ws-plugin-part="harbor-workspace.identity-monogram"] { width: 34px; height: 34px; }
[data-ws-plugin-part="harbor-workspace.channel-panel"] {
grid-column: 2;
grid-row: 2;
display: grid;
grid-template-columns: minmax(0, 1fr);
grid-template-rows: 30px minmax(0, 1fr);
gap: 4px;
overflow: hidden;
padding: 5px 8px;
border-right: 0;
border-bottom: 1px solid var(--skin-harbor-border);
}
[data-ws-plugin-part="harbor-workspace.server-summary"] {
min-height: 0;
flex-direction: row;
align-items: center;
gap: 8px;
padding: 0 2px;
border: 0;
}
[data-ws-plugin-part="harbor-workspace.server-name"] { max-width: 60%; font-size: 11px; }
[data-ws-plugin-part="harbor-workspace.server-subtitle"],
[data-ws-plugin-part="harbor-workspace.channel-list"] > [data-ws-plugin-part="harbor-workspace.section-label"] { display: none; }
[data-ws-plugin-part="harbor-workspace.channel-list"] {
flex-direction: row;
gap: 5px;
overflow: auto hidden;
padding: 0;
}
[data-ws-plugin-part="harbor-workspace.channel-item"] { flex: 0 0 auto; }
[data-ws-plugin-part="harbor-workspace.channel-row"] { width: max-content; min-width: 116px; min-height: 42px; margin: 0; }
[data-ws-plugin-part="harbor-workspace.channel-row"][data-depth] { padding-inline-start: 9px; }
[data-ws-plugin-part="harbor-workspace.channel-voice-members"] { display: none; }
[data-ws-plugin-part="harbor-workspace.conversation"] {
grid-column: 2;
grid-row: 3;
grid-template-rows: 40px minmax(0, 1fr) auto;
gap: 6px;
padding: 0 8px 6px;
}
[data-ws-plugin-part="harbor-workspace.members-panel"] {
grid-column: 2;
grid-row: 4;
display: grid;
grid-template-columns: auto minmax(0, 1fr);
align-items: center;
gap: 7px;
overflow: hidden;
padding: 5px 8px;
border-top: 1px solid var(--skin-harbor-border);
border-left: 0;
}
[data-ws-plugin-part="harbor-workspace.members-heading"] { gap: 5px; }
[data-ws-plugin-part="harbor-workspace.members-heading"] .section-label { max-width: 60px; font-size: 8px; }
[data-ws-plugin-part="harbor-workspace.member-list"] {
display: flex;
gap: 5px;
min-width: 0;
overflow: auto hidden;
margin: 0;
}
[data-ws-plugin-part="harbor-workspace.member-row"] { flex: 0 0 auto; grid-template-columns: 28px auto; min-height: 38px; padding: 2px 4px; }
[data-ws-plugin-part="harbor-workspace.member-avatar"] { width: 26px; height: 26px; }
[data-ws-plugin-part="harbor-workspace.speaking-indicator"] { display: none; }
[data-ws-plugin-part="harbor-workspace.member-muted-state"],
[data-ws-plugin-part="harbor-workspace.member-away-state"] { display: none; }
[data-ws-plugin-part="harbor-workspace.voice-dock"] {
grid-column: 2;
grid-row: 5;
align-self: stretch;
grid-template-columns: minmax(0, 1fr) auto;
grid-template-rows: minmax(0, 1fr);
align-items: center;
gap: 6px;
padding: 6px 8px;
border-radius: 0;
border-right: 0;
border-bottom: 0;
}
[data-ws-plugin-part="harbor-workspace.voice-dock-heading"] { grid-column: auto; grid-row: auto; }
[data-ws-plugin-part="harbor-workspace.voice-dock-actions"] { grid-column: 2; grid-row: 1; justify-content: flex-end; gap: 3px; }
[data-ws-plugin-part="harbor-workspace.voice-dock-caption"] { display: none; }
[data-ws-plugin-part="harbor-workspace.disconnect-control"] { grid-column: 2; grid-row: 1; }
[data-ws-plugin-part="harbor-workspace.audio-controls"] .mobile-voice-controls { display: flex; gap: 4px; }
[data-ws-plugin-part="harbor-workspace.audio-controls"] .mobile-voice-toggle { min-width: 44px; min-height: 44px; border-radius: 7px; color: var(--skin-harbor-muted); background: var(--skin-harbor-raised); }
[data-ws-plugin-part="harbor-workspace.microphone-control"],
[data-ws-plugin-part="harbor-workspace.output-control"],
[data-ws-plugin-part="harbor-workspace.disconnect-control"] { min-width: 42px; min-height: 44px; }
[data-ws-plugin-part="harbor-workspace.output-volume"] { width: 58px; }
[data-ws-plugin-part="harbor-workspace.screen-share-start"] button { width: 42px; height: 44px; }
}
@media (max-width: 460px) {
[data-ws-plugin-part="harbor-workspace"] { grid-template-columns: 50px minmax(0, 1fr); }
[data-ws-plugin-part="harbor-workspace.server-rail"] { padding-inline: 1px; }
[data-ws-plugin-part="harbor-workspace.quick-server"] { width: 44px; }
[data-ws-plugin-part="harbor-workspace.identity-name"] { max-width: 43px; }
[data-ws-plugin-part="harbor-workspace.topbar"] { padding-inline: 5px; }
[data-ws-plugin-part="harbor-workspace.brand-name"] { display: none; }
[data-ws-plugin-part="harbor-workspace.server-title"] { max-width: 100px; }
[data-ws-plugin-part="harbor-workspace.channel-panel"] { grid-column: 2; }
[data-ws-plugin-part="harbor-workspace.conversation"] { grid-column: 2; }
[data-ws-plugin-part="harbor-workspace.members-panel"] { grid-column: 2; }
[data-ws-plugin-part="harbor-workspace.voice-dock"] { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
[data-ws-plugin-part="harbor-home"] *,
[data-ws-plugin-part="harbor-workspace"] * {
scroll-behavior: auto;
animation-duration: .01ms;
animation-iteration-count: 1;
transition-duration: .01ms;
}
}
Binary file not shown.
@@ -0,0 +1,15 @@
{
"schemaVersion": 1,
"hiddenParts": ["host.plugins.launcher"],
"visibleParts": ["host.watermark", "host.hint", "host.voice-status-decoration"],
"icons": {
"language.trigger": "assets/icons/language.png",
"skin.trigger": "assets/icons/skin.png",
"host.plugins.launcher": "assets/icons/apps.png",
"home.toolbar.settings": "assets/icons/settings.png",
"voice.performance": "assets/icons/status.png"
},
"slots": {
"host.recovery": { "anchor": "voice.audio-dock", "align": "start", "compact": true }
}
}
@@ -0,0 +1,13 @@
{
"schemaVersion": 3,
"packageType": "open-skin",
"id": "community.host-chrome-demo",
"name": "Host Chrome Demo",
"version": "1.0.0",
"author": "WebSpeak Project",
"license": "AGPL-3.0-only",
"description": "Minimal open skin demonstrating host chrome theming, protected-control theming, declarative hiding and bitmap icon overrides.",
"entry": "skin.css",
"chrome": "chrome.json",
"minAppVersion": "0.3.2"
}
+135
View File
@@ -0,0 +1,135 @@
/* Host chrome demo — v3 open skin (schemaVersion 3).
Every selector uses :root, [data-ws-page] or [data-ws-part].
Host-only selectors are compiled into :root[data-ws-host-skin="…"]. */
:root {
--skin-accent: #1d4f9c;
--skin-panel: #ffffff;
--skin-border: #c9c9c9;
--skin-text: #141414;
/* Host-owned protected controls: one global set, per-part overrides below. */
--skin-host-accent: #1d4f9c;
--skin-host-background: #ffffff;
--skin-host-foreground: #141414;
--skin-host-border: #9db6b2;
--skin-host-radius: 10px;
--skin-host-font: Tahoma, "Segoe UI", sans-serif;
--skin-host-size: medium;
--skin-recovery-accent: #1d4f9c;
--skin-recovery-background: #ffffff;
--skin-recovery-foreground: #141414;
--skin-recovery-border: #9db6b2;
--skin-recovery-radius: 999px;
--skin-load-recovery-accent: #b45309;
--skin-load-recovery-background: #fff7ed;
--skin-load-recovery-foreground: #7c2d12;
--skin-permission-accent: #1d4f9c;
--skin-permission-background: #ffffff;
--skin-permission-foreground: #141414;
}
[data-ws-page] {
color-scheme: light;
font-family: Tahoma, "Segoe UI", "Microsoft YaHei", sans-serif;
font-size: 12px;
color: #141414;
}
[data-ws-part="home.header"] ,
[data-ws-part="voice.header"] {
background: linear-gradient(180deg, #fbfbfb, #e9e9e9);
border-bottom: 1px solid var(--skin-border);
}
[data-ws-part="voice.audio-dock"] {
border-top: 1px solid var(--skin-border);
background: #f7f9fb;
/* Fold the trusted recovery capsule into the audio dock (chrome.json#slots). */
--skin-recovery-accent: #1d4f9c;
--skin-recovery-background: #ffffff;
--skin-recovery-foreground: #141414;
--skin-recovery-radius: 999px;
--skin-recovery-font: Tahoma, "Segoe UI", sans-serif;
--skin-recovery-size: small;
}
/* --- Protected app-DOM controls: purely visual theming is allowed --- */
[data-ws-part="voice.audio-dock.microphone"] button,
[data-ws-part="voice.audio-dock.output"] button,
[data-ws-part="voice.connection-status.reconnect"],
[data-ws-part="home.footer.clear"] {
color: #141414;
background: linear-gradient(180deg, #ffffff, #eef3fa);
border: 1px solid var(--skin-accent);
border-radius: 8px;
font-family: Tahoma, "Segoe UI", sans-serif;
font-size: 12px;
padding: 8px 12px;
min-height: 44px;
box-shadow: 0 2px 6px #1d4f9c22;
}
[data-ws-part="voice.audio-dock.microphone"] button:hover,
[data-ws-part="voice.audio-dock.output"] button:hover,
[data-ws-part="voice.connection-status.reconnect"]:hover,
[data-ws-part="home.footer.clear"]:hover {
background: #e7eefb;
}
[data-ws-part="auth.password.dialog"],
[data-ws-part="voice.audio-settings"] {
background: #ffffff;
border: 2px solid var(--skin-accent);
border-radius: 18px;
box-shadow: 0 18px 48px #1d4f9c33;
}
[data-ws-part="auth.password.dialog"] h2,
[data-ws-part="voice.audio-settings"] h2 {
color: var(--skin-accent);
letter-spacing: .01em;
}
/* --- Host chrome (outside .ws-skin-root) --- */
[data-ws-part="host.plugins.launcher"] {
background: #1d4f9c;
color: #ffffff;
border: 1px solid #163c78;
border-radius: 3px;
padding: 7px 12px;
font-size: 12px;
font-weight: 600;
letter-spacing: .02em;
box-shadow: none;
}
[data-ws-part="host.plugins.launcher"]:hover {
background: #2a63bb;
}
[data-ws-part="host.plugins.overlay"] {
border: 2px solid #1d4f9c;
border-radius: 4px;
}
[data-ws-part="host.watermark"] {
color: #1d4f9c;
opacity: .12;
font-family: Tahoma, sans-serif;
}
[data-ws-part="host.hint"] {
color: #1d4f9c;
border-left: 2px solid #1d4f9c;
padding-left: 6px;
}
[data-ws-part="host.voice-status-decoration"] {
opacity: .45;
}
/* Icon slots can also be addressed directly from CSS. */
[data-ws-part="host.plugins.launcher"] [data-ws-icon-slot="host.plugins.launcher"] {
background-color: transparent;
}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
{
"schemaVersion": 1,
"slots": {
"host.recovery": {
"mode": "toolbar",
"appearance": "icon",
"anchor": ["home.header", "voice.header"],
"align": "end"
}
}
}
@@ -0,0 +1,13 @@
{
"schemaVersion": 3,
"packageType": "open-skin",
"id": "community.host-chrome-toolbar",
"name": "Host Chrome Toolbar",
"version": "1.1.2",
"author": "WebSpeak Community",
"license": "AGPL-3.0-only",
"description": "Minimal open skin that docks Classic-aligned host-owned recovery icons into the page header.",
"entry": "skin.css",
"chrome": "chrome.json",
"minAppVersion": "0.3.4-dev.0"
}
@@ -0,0 +1,76 @@
/* Host chrome toolbar demo — v3 open skin (schemaVersion 3).
The host owns the recovery structure, icons, labels, focus and actions.
This package only declares an anchor, appearance and validated tokens. */
:root {
color-scheme: light;
--skin-demo-surface: #f4f7fb;
--skin-demo-foreground: #1a1a1a;
--skin-demo-border: #d5dee8;
--skin-demo-accent: #1d4ed8;
/* Classic microphone-button geometry and colours. `surface` is the opaque
colour used to check text contrast behind the transparent toolbar. */
--skin-host-toolbar-background: transparent;
--skin-host-toolbar-foreground: #1a1a1a;
--skin-host-toolbar-border: transparent;
--skin-host-toolbar-hover-background: #eaf2fd;
--skin-host-toolbar-hover-border: #b8cfe8;
--skin-host-toolbar-surface: #f4f7fb;
--skin-host-toolbar-radius: 2px;
--skin-host-toolbar-font: Tahoma, "Segoe UI", sans-serif;
--skin-host-toolbar-font-size: 11px;
--skin-host-toolbar-padding: 0 4px;
--skin-host-toolbar-height: 22px;
--skin-host-toolbar-gap: 1px;
--skin-host-toolbar-icon-size: 16px;
--skin-host-toolbar-shadow: none;
/* The fallback and shortcut capsule remains opaque and full-text. */
--skin-recovery-background: #ffffff;
--skin-recovery-foreground: #1a1a1a;
--skin-recovery-border: #9db6b2;
--skin-recovery-accent: #1d4ed8;
--skin-recovery-radius: 8px;
}
[data-ws-page] {
color: #1a1a1a;
background: #ffffff;
font-family: Tahoma, "Segoe UI", "Microsoft YaHei", sans-serif;
}
[data-ws-part="home.header"],
[data-ws-part="voice.header"] {
background: #f4f7fb;
border-bottom: 1px solid var(--skin-demo-border);
color: var(--skin-demo-foreground);
}
/* Keep the two 24px icon buttons clear of ordinary header actions. */
[data-ws-part="home.header"],
[data-ws-part="voice.header"] {
padding-right: 72px;
}
[data-ws-part="home.join-card"],
[data-ws-part="home.content"],
[data-ws-part="voice.workspace"],
[data-ws-part="voice.content"] {
color: var(--skin-demo-foreground);
}
[data-ws-part="home.join-card"] {
background: #ffffff;
border: 1px solid var(--skin-demo-border);
border-radius: 12px;
box-shadow: 0 16px 40px #10203012;
}
[data-ws-part="voice.audio-dock"] {
background: #f4f7fb;
border-top: 1px solid var(--skin-demo-border);
}
[data-ws-part="home.footer"] { color: #52606d; }
[data-ws-part="home.footer.clear"] { color: var(--skin-demo-accent); }
Binary file not shown.
@@ -0,0 +1,31 @@
{
"schemaVersion": 1,
"components": [
{
"id": "illusia-now-playing",
"name": "ILLUSIA 当前频道 / current channel",
"page": "voice",
"accessibleName": "当前语音频道 / Current voice channel",
"permissions": ["session.status.read"],
"actions": {},
"root": {
"tag": "aside",
"part": "room-card",
"className": "illusia-now-playing",
"attributes": { "role": "status" },
"children": [
{
"tag": "small",
"part": "eyebrow",
"children": [{ "text": "ILLUSIA · 当前频道 / NOW IN" }]
},
{
"tag": "strong",
"part": "channel-name",
"children": [{ "text": "{{session.status.channelName}}" }]
}
]
}
}
]
}
+6 -4
View File
@@ -1,12 +1,14 @@
{
"schemaVersion": 1,
"schemaVersion": 3,
"packageType": "open-skin",
"id": "community.illusia-voice",
"name": "ILLUSIA风",
"version": "1.0.27",
"version": "2.0.2",
"author": "WebSpeak Project",
"license": "All rights reserved",
"description": "A bright original-character art skin for the home, voice room, and demo pages.",
"description": "A bright original-character art skin with a safe declarative live-channel badge.",
"entry": "skin.css",
"components": "components.json",
"preview": "assets/background-composite.webp",
"minAppVersion": "0.2.5-preview"
"minAppVersion": "0.2.7"
}
+249 -2
View File
@@ -271,6 +271,57 @@
}
}
/* Open-skin compatibility sample: a small, non-interactive live-channel card. */
[data-ws-page="voice"] .ws-plugin-component[data-ws-plugin-part="illusia-now-playing"] {
position: fixed;
z-index: 5;
top: 66px;
right: 18px;
display: grid;
gap: 3px;
width: min(236px, calc(100vw - 36px));
min-height: 58px;
padding: 10px 56px 10px 14px;
overflow: hidden;
color: #15545b;
border: 1px solid rgba(71, 201, 212, .52);
border-radius: 17px;
background-image: linear-gradient(110deg, rgba(255, 255, 255, .95), rgba(219, 249, 250, .8)), url("assets/banner-mascot-blob.webp");
background-repeat: no-repeat;
background-position: center, right 8px center;
background-size: auto, 42px 42px;
box-shadow: 0 12px 30px rgba(7, 55, 65, .16), inset 0 1px rgba(255, 255, 255, .9);
backdrop-filter: blur(12px);
pointer-events: none;
}
[data-ws-page="voice"] [data-ws-plugin-part="illusia-now-playing.eyebrow"] {
color: #168f99;
font-size: 9px;
font-weight: 800;
letter-spacing: .08em;
}
[data-ws-page="voice"] [data-ws-plugin-part="illusia-now-playing.channel-name"] {
overflow: hidden;
color: #173f48;
font-size: 13px;
font-weight: 750;
text-overflow: ellipsis;
white-space: nowrap;
}
@media (max-width: 740px) {
[data-ws-page="voice"] .ws-plugin-component[data-ws-plugin-part="illusia-now-playing"] {
top: 62px;
right: 10px;
width: min(218px, calc(100vw - 20px));
min-height: 52px;
padding-block: 8px;
border-radius: 14px;
}
}
[data-ws-part="home.join-title"] {
color: var(--skin-illusia-ink);
}
@@ -840,11 +891,12 @@
[data-ws-part="voice.screen-player.stage"] {
border-radius: 22px;
background: radial-gradient(ellipse at 50% 38%, rgba(248, 255, 255, .98), rgba(220, 246, 250, .92) 58%, rgba(202, 237, 244, .9));
background: #000;
}
[data-ws-part="voice.screen-player.video"] {
background: #e5f4f8;
object-fit: contain;
background: #000;
}
[data-ws-part="voice.screen-player.placeholder"] {
@@ -891,6 +943,201 @@
box-shadow: 0 0 0 2px rgba(255, 255, 255, .94), 0 0 0 4px rgba(71, 201, 212, .72);
}
/* Home quick servers use the same light glass language as the voice switcher. */
[data-ws-part="home.server-history.group"] {
color: var(--skin-illusia-muted);
}
[data-ws-part="home.server-history.item"] {
color: var(--skin-illusia-ink);
border-color: rgba(104, 183, 198, .42);
border-radius: 9px;
background: linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(220, 245, 249, .84));
box-shadow: 0 3px 10px rgba(37, 122, 143, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
}
[data-ws-part="home.server-history.select"] {
color: var(--skin-illusia-ink);
}
[data-ws-part="home.server-history.select"]:hover {
color: var(--skin-illusia-teal);
background: rgba(71, 201, 212, .12);
}
[data-ws-part="home.server-history.favorite-toggle"] {
color: var(--skin-illusia-muted);
border-color: rgba(104, 183, 198, .32);
}
[data-ws-part="home.server-history.favorite-toggle"][data-ws-state="saved"] {
color: #b47a09;
background: rgba(255, 245, 205, .62);
}
/* Favorite-server navigation shares the voice room's light glass appearance. */
[data-ws-part="voice.favorite-servers.rail"],
[data-ws-part="voice.favorite-servers.strip"] {
color: var(--skin-illusia-ink);
background: linear-gradient(180deg, rgba(248, 254, 255, .92), rgba(225, 246, 250, .86));
border-color: rgba(112, 190, 204, .38);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .84);
backdrop-filter: blur(16px);
}
[data-ws-part="voice.favorite-servers.server"],
[data-ws-part="voice.favorite-servers.strip.server"],
[data-ws-part="voice.favorite-servers.add"],
[data-ws-part="voice.favorite-servers.strip.add"] {
color: var(--skin-illusia-ink);
border-color: rgba(104, 183, 198, .4);
background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(220, 245, 249, .88));
box-shadow: 0 5px 16px rgba(37, 122, 143, .12), inset 0 1px 0 rgba(255, 255, 255, .92);
}
[data-ws-part="voice.favorite-servers.server"][data-ws-state="current"],
[data-ws-part="voice.favorite-servers.strip.server"][data-ws-state="current"] {
border-color: rgba(15, 151, 157, .72);
background: linear-gradient(145deg, rgba(220, 255, 249, .98), rgba(178, 239, 239, .94));
box-shadow: 0 0 0 2px rgba(26, 180, 180, .18), 0 8px 20px rgba(27, 143, 157, .18);
}
[data-ws-part="voice.favorite-servers.server"]:hover,
[data-ws-part="voice.favorite-servers.server"]:focus-visible,
[data-ws-part="voice.favorite-servers.strip.server"]:hover,
[data-ws-part="voice.favorite-servers.strip.server"]:focus-visible,
[data-ws-part="voice.favorite-servers.add"]:focus-visible,
[data-ws-part="voice.favorite-servers.strip.add"]:focus-visible {
border-color: rgba(12, 151, 159, .8);
box-shadow: 0 0 0 3px rgba(35, 183, 188, .22), 0 8px 20px rgba(27, 143, 157, .16);
}
[data-ws-part="voice.favorite-servers.avatar"] {
outline: 1px solid rgba(255, 255, 255, .82);
box-shadow: inset 0 0 0 1px rgba(20, 103, 119, .12), 0 3px 9px rgba(28, 104, 125, .16);
}
[data-ws-part="voice.favorite-servers.tooltip"] {
color: var(--skin-illusia-ink);
border-color: rgba(107, 189, 202, .48);
background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(230, 249, 251, .96));
box-shadow: 0 10px 26px rgba(25, 94, 115, .2), inset 0 1px 0 #fff;
}
[data-ws-part="voice.favorite-servers.favorite-toggle"],
[data-ws-part="voice.favorite-servers.strip.favorite-toggle"] {
color: var(--skin-illusia-muted);
border-color: rgba(255, 255, 255, .96);
background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(221, 246, 249, .94));
box-shadow: 0 2px 7px rgba(26, 82, 94, .22);
}
[data-ws-part="voice.favorite-servers.favorite-toggle"][data-ws-state="saved"],
[data-ws-part="voice.favorite-servers.strip.favorite-toggle"][data-ws-state="saved"] {
color: #a87405;
background: linear-gradient(145deg, rgba(255, 245, 205, .98), rgba(255, 255, 255, .96));
}
[data-ws-part="voice.favorite-servers.switch-status"] {
color: var(--skin-illusia-ink);
border-color: rgba(53, 172, 180, .42);
background: linear-gradient(105deg, rgba(224, 250, 250, .96), rgba(250, 255, 255, .94));
box-shadow: 0 8px 20px rgba(34, 120, 139, .1), inset 0 1px 0 #fff;
}
[data-ws-part="voice.favorite-servers.switch-status"][data-ws-state="failed"] {
border-color: rgba(190, 91, 105, .42);
background: linear-gradient(105deg, rgba(255, 239, 241, .98), rgba(255, 251, 251, .96));
}
[data-ws-part="voice.favorite-servers.current-toggle"][data-ws-state="saved"] {
color: #b47a09;
background: linear-gradient(145deg, rgba(255, 245, 205, .96), rgba(255, 255, 255, .94));
box-shadow: inset 0 0 0 1px rgba(224, 166, 47, .24);
}
[data-ws-part="voice.favorite-servers.dialog"] {
color: var(--skin-illusia-ink);
border-color: rgba(112, 190, 204, .52);
background: linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(226, 246, 250, .98));
box-shadow: 0 24px 70px rgba(16, 72, 91, .3), inset 0 1px 0 #fff;
}
[data-ws-part="voice.favorite-servers.dialog-backdrop"] {
background: rgba(16, 54, 62, .48);
backdrop-filter: blur(7px);
}
[data-ws-part="voice.favorite-servers.dialog.header"] {
color: var(--skin-illusia-ink);
}
[data-ws-part="voice.favorite-servers.dialog.close"] {
color: var(--skin-illusia-ink);
border-color: rgba(112, 190, 204, .4);
background: linear-gradient(145deg, #fff, #e7f6f9);
}
[data-ws-part="voice.favorite-servers.dialog.field"] {
color: var(--skin-illusia-ink);
}
[data-ws-part="voice.favorite-servers.dialog.hint"] {
color: #547782;
}
[data-ws-part="voice.favorite-servers.dialog.input"] {
color: var(--skin-illusia-ink);
border-color: rgba(108, 174, 189, .48);
background: rgba(248, 254, 255, .96);
box-shadow: inset 0 1px 3px rgba(34, 104, 125, .08);
}
[data-ws-part="voice.favorite-servers.dialog.input"]:focus-visible {
border-color: rgba(11, 148, 154, .84);
box-shadow: 0 0 0 3px rgba(34, 183, 185, .2), inset 0 1px 3px rgba(34, 104, 125, .08);
}
[data-ws-part="voice.favorite-servers.dialog.submit"] {
color: #fff;
border-color: rgba(7, 121, 130, .86);
background: linear-gradient(110deg, #0a9997, #08717e);
box-shadow: 0 7px 16px rgba(10, 116, 130, .22), inset 0 1px 0 rgba(255, 255, 255, .24);
}
[data-ws-part="voice.favorite-servers.dialog.cancel"] {
color: var(--skin-illusia-ink);
border-color: rgba(116, 179, 192, .4);
background: linear-gradient(145deg, #fff, #eaf7f9);
}
/* Shared voice roster: give live screen-share status and watch actions an ILLUSIA treatment. */
[data-ws-part="voice.member.live-indicator"] {
color: #075b65;
border-color: rgba(34, 156, 167, .48);
background: rgba(250, 255, 255, .98);
box-shadow: 0 5px 16px rgba(27, 119, 137, .2), inset 0 1px 0 #fff;
}
[data-ws-part="voice.member.live-indicator"]::before {
background: #25c18a;
box-shadow: 0 0 0 3px rgba(37, 193, 138, .16);
}
[data-ws-part="voice.member.live-indicator"] .screen-share-wave { color: #078b98; }
[data-ws-part="voice.member.share-actions"] .screen-share-card-button {
color: #075e68;
border-color: rgba(34, 156, 167, .42);
background: linear-gradient(120deg, #f6ffff, #dff7f5);
box-shadow: 0 4px 12px rgba(30, 150, 163, .12), inset 0 1px 0 #fff;
}
[data-ws-part="voice.member.share-actions"] .screen-share-card-button:hover {
background: linear-gradient(120deg, #fff, #c9f0ec);
}
[data-ws-part="voice.member.share-actions"] .screen-share-card-button.viewing {
color: #fff;
border-color: #087e86;
background: linear-gradient(110deg, #0a9997, #08717e);
}
/* The demo keeps its original controls, labels, and interactions. */
[data-ws-page="demo"] {
color: var(--skin-illusia-ink);
Binary file not shown.
File diff suppressed because it is too large. Load diff
+340
View File
@@ -0,0 +1,340 @@
{
"defaultLocale": "zh-CN",
"locales": {
"zh-CN": {
"home": {
"brandName": "KAAK"
},
"messages": {
"passwordDialogConfirm": "确定",
"kaakHomeComponentName": "KAAK 首页",
"kaakVoiceComponentName": "KAAK 语音工作区",
"kaakHomeAccessibleName": "KAAK 连接页",
"kaakVoiceAccessibleName": "KAAK 语音工作区",
"kaakTagline": "你的声音,随时随地。",
"kaakHomeIllustrationAlt": "WebSpeak 语音连接插图",
"kaakWelcomeTitle": "欢迎来到 WebSpeak",
"kaakConnectTitle": "连接 TeamSpeak 服务器",
"kaakConnectDescription": "无需注册账号,填写服务器信息即可加入语音",
"kaakBrowserDirect": "浏览器直连 · 无需安装 TeamSpeak 客户端",
"kaakFavoritesAndHistory": "收藏与最近服务器",
"kaakFavorites": "收藏",
"kaakRecent": "最近",
"kaakVoiceRoomControls": "语音房间控制",
"kaakReturnChannelsNoDisconnect": "返回频道树,不断开语音",
"kaakVoiceRoom": "语音房间",
"kaakMoreVoiceActions": "更多语音功能",
"kaakOpenChatHistory": "打开聊天记录",
"kaakChatHistory": "聊天记录",
"kaakCopyInviteLink": "复制邀请链接",
"kaakCloseMenu": "关闭菜单",
"kaakCurrentVoiceChannel": "当前语音频道",
"kaakVoiceConnected": "TeamSpeak · 已加入语音",
"kaakServerChannels": "服务器频道",
"kaakChannels": "频道",
"kaakToggleVoiceGroup": "展开或收起语音分组",
"kaakVoiceGroup": "语音分组",
"kaakReturnVoiceRoom": "返回当前语音房间",
"kaakReturnVoiceRoomConnected": "语音已连接 · 点击返回房间",
"kaakChat": "聊天",
"kaakToggleChatPanel": "收起或展开聊天面板",
"kaakVoiceRoomAccessibleName": "语音房间",
"kaakBackToChannels": "返回频道列表",
"kaakChannelMemberCount": "频道成员数",
"kaakExpandChatPanel": "展开聊天面板",
"kaakVoiceControls": "语音控制",
"kaakDisconnectVoice": "断开语音",
"kaakStopScreenShare": "停止屏幕共享",
"kaakAudioControls": "语音设置",
"kaakAudioSettings": "语音设置",
"kaakAudioSettingsShort": "语音设置",
"kaakNoiseSuppression": "噪声抑制",
"kaakMicrophone": "麦克风",
"kaakSpeakerMute": "扬声器静音",
"kaakAccompaniment": "伴奏",
"kaakMuteMicrophone": "闭麦",
"kaakUnmuteMicrophone": "开麦",
"kaakMuteOutput": "耳机静音",
"kaakMute": "静音",
"kaakUnmute": "恢复",
"kaakSpeaker": "扬声器",
"kaakScreenShare": "屏幕共享",
"kaakLeaveVoice": "退出",
"kaakCurrentIdentity": "当前 TeamSpeak 身份",
"kaakOnline": "在线",
"githubRepository": "Webspeak项目Github",
"qqGroup": "WebSpeak项目QQ群",
"adminConsole": "管理控制台",
"communityLinks": "社区与管理入口"
}
},
"en": {
"home": {
"brandName": "KAAK"
},
"messages": {
"passwordDialogConfirm": "Confirm",
"kaakHomeComponentName": "KAAK connection home",
"kaakVoiceComponentName": "KAAK voice workspace",
"kaakHomeAccessibleName": "KAAK connection page",
"kaakVoiceAccessibleName": "KAAK voice workspace",
"kaakTagline": "YOUR VOICE, EVERYWHERE.",
"kaakHomeIllustrationAlt": "WebSpeak voice connection illustration",
"kaakWelcomeTitle": "Welcome to WebSpeak",
"kaakConnectTitle": "Connect to a TeamSpeak server",
"kaakConnectDescription": "No account required. Enter the server details to join voice.",
"kaakBrowserDirect": "Connect directly in your browser · No TeamSpeak client needed",
"kaakFavoritesAndHistory": "Favorites and recent servers",
"kaakFavorites": "Favorites",
"kaakRecent": "Recent",
"kaakVoiceRoomControls": "Voice room controls",
"kaakReturnChannelsNoDisconnect": "Return to channels without disconnecting",
"kaakVoiceRoom": "Voice room",
"kaakMoreVoiceActions": "More voice actions",
"kaakOpenChatHistory": "Open chat history",
"kaakChatHistory": "Chat history",
"kaakCopyInviteLink": "Copy invite link",
"kaakCloseMenu": "Close menu",
"kaakCurrentVoiceChannel": "Current voice channel",
"kaakVoiceConnected": "TeamSpeak · Voice connected",
"kaakServerChannels": "Server channels",
"kaakChannels": "Channels",
"kaakToggleVoiceGroup": "Expand or collapse voice group",
"kaakVoiceGroup": "Voice group",
"kaakReturnVoiceRoom": "Return to the current voice room",
"kaakReturnVoiceRoomConnected": "Voice connected · Click to return to the room",
"kaakChat": "Chat",
"kaakToggleChatPanel": "Collapse or expand chat panel",
"kaakVoiceRoomAccessibleName": "Voice room",
"kaakBackToChannels": "Back to channel list",
"kaakChannelMemberCount": "Channel member count",
"kaakExpandChatPanel": "Expand chat panel",
"kaakVoiceControls": "Voice controls",
"kaakDisconnectVoice": "Disconnect voice",
"kaakStopScreenShare": "Stop screen sharing",
"kaakAudioControls": "Audio controls",
"kaakAudioSettings": "Audio settings",
"kaakAudioSettingsShort": "Audio settings",
"kaakNoiseSuppression": "Noise suppression",
"kaakMicrophone": "Microphone",
"kaakSpeakerMute": "Mute speakers",
"kaakAccompaniment": "Accompaniment",
"kaakMuteMicrophone": "Mute microphone",
"kaakUnmuteMicrophone": "Unmute microphone",
"kaakMuteOutput": "Mute output",
"kaakMute": "Mute",
"kaakUnmute": "Unmute",
"kaakSpeaker": "Speaker",
"kaakScreenShare": "Screen share",
"kaakLeaveVoice": "Leave",
"kaakCurrentIdentity": "Current TeamSpeak identity",
"kaakOnline": "Online",
"githubRepository": "WebSpeak project GitHub",
"qqGroup": "WebSpeak project QQ group",
"adminConsole": "Admin console",
"communityLinks": "Community and administration"
}
},
"de": {
"home": {
"brandName": "KAAK"
},
"messages": {
"passwordDialogConfirm": "Bestätigen",
"kaakHomeComponentName": "KAAK-Verbindungsseite",
"kaakVoiceComponentName": "KAAK-Sprachbereich",
"kaakHomeAccessibleName": "KAAK-Verbindungsseite",
"kaakVoiceAccessibleName": "KAAK-Sprachbereich",
"kaakTagline": "DEINE STIMME. ÜBERALL.",
"kaakHomeIllustrationAlt": "Illustration zur WebSpeak-Sprachverbindung",
"kaakWelcomeTitle": "Willkommen bei WebSpeak",
"kaakConnectTitle": "Mit einem TeamSpeak-Server verbinden",
"kaakConnectDescription": "Kein Konto nötig. Gib die Serverdaten ein, um dem Sprachkanal beizutreten.",
"kaakBrowserDirect": "Direkt im Browser · Kein TeamSpeak-Client erforderlich",
"kaakFavoritesAndHistory": "Favoriten und zuletzt verwendete Server",
"kaakFavorites": "Favoriten",
"kaakRecent": "Zuletzt",
"kaakVoiceRoomControls": "Sprachraum-Steuerung",
"kaakReturnChannelsNoDisconnect": "Zurück zu den Kanälen, ohne die Verbindung zu trennen",
"kaakVoiceRoom": "Sprachraum",
"kaakMoreVoiceActions": "Weitere Sprachaktionen",
"kaakOpenChatHistory": "Chatverlauf öffnen",
"kaakChatHistory": "Chatverlauf",
"kaakCopyInviteLink": "Einladungslink kopieren",
"kaakCloseMenu": "Menü schließen",
"kaakCurrentVoiceChannel": "Aktueller Sprachkanal",
"kaakVoiceConnected": "TeamSpeak · Sprachkanal beigetreten",
"kaakServerChannels": "Serverkanäle",
"kaakChannels": "Kanäle",
"kaakToggleVoiceGroup": "Sprachgruppe ein- oder ausklappen",
"kaakVoiceGroup": "Sprachgruppe",
"kaakReturnVoiceRoom": "Zum aktuellen Sprachraum zurückkehren",
"kaakReturnVoiceRoomConnected": "Sprachverbindung aktiv · Klicken, um zum Raum zurückzukehren",
"kaakChat": "Chat",
"kaakToggleChatPanel": "Chatbereich ein- oder ausklappen",
"kaakVoiceRoomAccessibleName": "Sprachraum",
"kaakBackToChannels": "Zur Kanalliste",
"kaakChannelMemberCount": "Anzahl der Kanalmitglieder",
"kaakExpandChatPanel": "Chatbereich erweitern",
"kaakVoiceControls": "Sprachsteuerung",
"kaakDisconnectVoice": "Sprachverbindung trennen",
"kaakStopScreenShare": "Bildschirmfreigabe beenden",
"kaakAudioControls": "Audio-Steuerung",
"kaakAudioSettings": "Audioeinstellungen",
"kaakAudioSettingsShort": "Audioeinstellungen",
"kaakNoiseSuppression": "Rauschunterdrückung",
"kaakMicrophone": "Mikrofon",
"kaakSpeakerMute": "Lautsprecher stummschalten",
"kaakAccompaniment": "Begleitton",
"kaakMuteMicrophone": "Mikrofon stummschalten",
"kaakUnmuteMicrophone": "Mikrofon einschalten",
"kaakMuteOutput": "Ausgabe stummschalten",
"kaakMute": "Stumm",
"kaakUnmute": "Ton einschalten",
"kaakSpeaker": "Lautsprecher",
"kaakScreenShare": "Bildschirm teilen",
"kaakLeaveVoice": "Verlassen",
"kaakCurrentIdentity": "Aktuelle TeamSpeak-Identität",
"kaakOnline": "Online",
"githubRepository": "GitHub-Repository des WebSpeak-Projekts",
"qqGroup": "QQ-Gruppe des WebSpeak-Projekts",
"adminConsole": "Administrationskonsole",
"communityLinks": "Community und Verwaltung"
}
},
"ru": {
"home": {
"brandName": "KAAK"
},
"messages": {
"passwordDialogConfirm": "Подтвердить",
"kaakHomeComponentName": "Страница подключения KAAK",
"kaakVoiceComponentName": "Голосовое пространство KAAK",
"kaakHomeAccessibleName": "Страница подключения KAAK",
"kaakVoiceAccessibleName": "Голосовое пространство KAAK",
"kaakTagline": "ТВОЙ ГОЛОС — ВЕЗДЕ.",
"kaakHomeIllustrationAlt": "Иллюстрация голосового подключения WebSpeak",
"kaakWelcomeTitle": "Добро пожаловать в WebSpeak",
"kaakConnectTitle": "Подключение к серверу TeamSpeak",
"kaakConnectDescription": "Аккаунт не нужен. Укажите данные сервера, чтобы подключиться к голосовому каналу.",
"kaakBrowserDirect": "Прямое подключение в браузере · Клиент TeamSpeak не нужен",
"kaakFavoritesAndHistory": "Избранные и недавние серверы",
"kaakFavorites": "Избранное",
"kaakRecent": "Недавние",
"kaakVoiceRoomControls": "Управление голосовой комнатой",
"kaakReturnChannelsNoDisconnect": "Вернуться к каналам без отключения",
"kaakVoiceRoom": "Голосовая комната",
"kaakMoreVoiceActions": "Дополнительные голосовые действия",
"kaakOpenChatHistory": "Открыть историю чата",
"kaakChatHistory": "История чата",
"kaakCopyInviteLink": "Скопировать ссылку-приглашение",
"kaakCloseMenu": "Закрыть меню",
"kaakCurrentVoiceChannel": "Текущий голосовой канал",
"kaakVoiceConnected": "TeamSpeak · Подключён к голосовому каналу",
"kaakServerChannels": "Каналы сервера",
"kaakChannels": "Каналы",
"kaakToggleVoiceGroup": "Развернуть или свернуть группу",
"kaakVoiceGroup": "Голосовая группа",
"kaakReturnVoiceRoom": "Вернуться в текущую голосовую комнату",
"kaakReturnVoiceRoomConnected": "Подключено · Нажмите, чтобы вернуться в комнату",
"kaakChat": "Чат",
"kaakToggleChatPanel": "Свернуть или развернуть панель чата",
"kaakVoiceRoomAccessibleName": "Голосовая комната",
"kaakBackToChannels": "Вернуться к списку каналов",
"kaakChannelMemberCount": "Количество участников канала",
"kaakExpandChatPanel": "Развернуть панель чата",
"kaakVoiceControls": "Голосовое управление",
"kaakDisconnectVoice": "Отключиться от голосового канала",
"kaakStopScreenShare": "Остановить демонстрацию экрана",
"kaakAudioControls": "Управление звуком",
"kaakAudioSettings": "Настройки звука",
"kaakAudioSettingsShort": "Настройки звука",
"kaakNoiseSuppression": "Шумоподавление",
"kaakMicrophone": "Микрофон",
"kaakSpeakerMute": "Отключить звук динамиков",
"kaakAccompaniment": "Сопровождение",
"kaakMuteMicrophone": "Выключить микрофон",
"kaakUnmuteMicrophone": "Включить микрофон",
"kaakMuteOutput": "Отключить звук",
"kaakMute": "Без звука",
"kaakUnmute": "Включить звук",
"kaakSpeaker": "Динамик",
"kaakScreenShare": "Демонстрация экрана",
"kaakLeaveVoice": "Выйти",
"kaakCurrentIdentity": "Текущая личность TeamSpeak",
"kaakOnline": "В сети",
"githubRepository": "GitHub проекта WebSpeak",
"qqGroup": "Группа QQ проекта WebSpeak",
"adminConsole": "Панель администратора",
"communityLinks": "Сообщество и управление"
}
},
"ja": {
"home": {
"brandName": "KAAK"
},
"messages": {
"passwordDialogConfirm": "確定",
"kaakHomeComponentName": "KAAK 接続ページ",
"kaakVoiceComponentName": "KAAK 音声ワークスペース",
"kaakHomeAccessibleName": "KAAK 接続ページ",
"kaakVoiceAccessibleName": "KAAK 音声ワークスペース",
"kaakTagline": "あなたの声を、どこでも。",
"kaakHomeIllustrationAlt": "WebSpeak 音声接続のイラスト",
"kaakWelcomeTitle": "WebSpeak へようこそ",
"kaakConnectTitle": "TeamSpeak サーバーに接続",
"kaakConnectDescription": "アカウント登録は不要です。サーバー情報を入力して音声に参加できます。",
"kaakBrowserDirect": "ブラウザーから直接接続 · TeamSpeak クライアント不要",
"kaakFavoritesAndHistory": "お気に入りと最近使ったサーバー",
"kaakFavorites": "お気に入り",
"kaakRecent": "最近",
"kaakVoiceRoomControls": "音声ルーム操作",
"kaakReturnChannelsNoDisconnect": "切断せずにチャンネル一覧へ戻る",
"kaakVoiceRoom": "音声ルーム",
"kaakMoreVoiceActions": "その他の音声操作",
"kaakOpenChatHistory": "チャット履歴を開く",
"kaakChatHistory": "チャット履歴",
"kaakCopyInviteLink": "招待リンクをコピー",
"kaakCloseMenu": "メニューを閉じる",
"kaakCurrentVoiceChannel": "現在の音声チャンネル",
"kaakVoiceConnected": "TeamSpeak · 音声に接続中",
"kaakServerChannels": "サーバーチャンネル",
"kaakChannels": "チャンネル",
"kaakToggleVoiceGroup": "音声グループを展開/折りたたむ",
"kaakVoiceGroup": "音声グループ",
"kaakReturnVoiceRoom": "現在の音声ルームに戻る",
"kaakReturnVoiceRoomConnected": "音声接続中 · タップしてルームに戻る",
"kaakChat": "チャット",
"kaakToggleChatPanel": "チャットパネルを折りたたむ/展開",
"kaakVoiceRoomAccessibleName": "音声ルーム",
"kaakBackToChannels": "チャンネル一覧に戻る",
"kaakChannelMemberCount": "チャンネルの参加者数",
"kaakExpandChatPanel": "チャットパネルを展開",
"kaakVoiceControls": "音声コントロール",
"kaakDisconnectVoice": "音声接続を切断",
"kaakStopScreenShare": "画面共有を停止",
"kaakAudioControls": "音声コントロール",
"kaakAudioSettings": "音声設定",
"kaakAudioSettingsShort": "音声設定",
"kaakNoiseSuppression": "ノイズ抑制",
"kaakMicrophone": "マイク",
"kaakSpeakerMute": "スピーカーをミュート",
"kaakAccompaniment": "伴奏音声",
"kaakMuteMicrophone": "マイクをミュート",
"kaakUnmuteMicrophone": "マイクのミュートを解除",
"kaakMuteOutput": "出力をミュート",
"kaakMute": "ミュート",
"kaakUnmute": "ミュート解除",
"kaakSpeaker": "スピーカー",
"kaakScreenShare": "画面共有",
"kaakLeaveVoice": "退出",
"kaakCurrentIdentity": "現在の TeamSpeak ID",
"kaakOnline": "オンライン",
"githubRepository": "WebSpeak プロジェクトの GitHub",
"qqGroup": "WebSpeak プロジェクトの QQ グループ",
"adminConsole": "管理コンソール",
"communityLinks": "コミュニティと管理"
}
}
}
}
+14
View File
@@ -0,0 +1,14 @@
{
"schemaVersion": 3,
"packageType": "open-skin",
"id": "community.kaak-voice",
"name": "KAAK",
"version": "3.1.134",
"author": "WebSpeak Project",
"license": "AGPL-3.0-only",
"description": "A KOOK-inspired WebSpeak skin with a split-screen connection home, searchable server header, TeamSpeak banner, nested channel members, unified chat with local history, and a compact audio dock.",
"entry": "skin.css",
"components": "components.json",
"content": "content.json",
"minAppVersion": "0.3.2"
}
File diff suppressed because it is too large. Load diff
Binary file not shown.
@@ -0,0 +1,240 @@
{
"schemaVersion": 3,
"components": [
{
"id": "open-voice-home",
"name": "Open voice connection page",
"page": "home",
"mode": "surface",
"accessibleName": "WebSpeak connection page",
"permissions": ["ui.surface.replace"],
"actions": {},
"root": {
"tag": "main",
"part": "home",
"children": [
{
"tag": "header",
"part": "home-header",
"children": [
{ "tag": "span", "part": "brand-mark", "children": [{ "text": "W" }] },
{ "tag": "span", "part": "brand-name", "children": [{ "text": "VOICE SPACE" }] },
{ "widget": "app.language-switcher", "part": "language" },
{ "widget": "app.skin-switcher", "part": "skin" }
]
},
{
"tag": "section",
"part": "connection-card",
"children": [
{ "tag": "p", "part": "eyebrow", "children": [{ "text": "TEAM SPEAK · VOICE CLIENT" }] },
{ "tag": "h1", "part": "title", "children": [{ "text": "Connect with your people" }] },
{ "tag": "p", "part": "description", "children": [{ "text": "Join a voice server and continue where your community meets." }] },
{ "widget": "home.connection-form", "part": "connection-form" }
]
},
{
"tag": "footer",
"part": "home-footer",
"children": [{ "text": "Your connection and identity remain managed by WebSpeak." }]
}
]
}
},
{
"id": "open-voice-workspace",
"name": "Open voice workspace",
"page": "voice",
"mode": "surface",
"accessibleName": "WebSpeak voice workspace",
"permissions": [
"ui.surface.replace",
"session.status.read",
"servers.quickList.read",
"servers.quickList.switch",
"session.channels.read",
"session.members.read",
"session.channel.join",
"chat.channel.read",
"chat.channel.send",
"audio.status.read",
"audio.microphone.control",
"audio.output.control",
"voice.whisper.status.read",
"voice.whisper.control",
"voice.disconnect",
"voice.screenShare.read",
"voice.screenShare.control"
],
"actions": {
"switch-server": {
"type": "quickServers.switch",
"args": { "quickServerId": "{{server.id}}" }
},
"join-channel": {
"type": "voice.joinChannel",
"args": { "channelId": "{{channel.id}}" }
},
"watch-screen-share": {
"type": "voice.joinScreenShare",
"args": { "streamId": "{{member.screenShareStreamId}}" }
}
},
"root": {
"tag": "main",
"part": "workspace",
"children": [
{
"tag": "header",
"part": "workspace-header",
"children": [
{ "tag": "span", "part": "brand-mark", "children": [{ "text": "W" }] },
{ "tag": "strong", "part": "server-title", "children": [{ "text": "{{session.status.channelName}}" }] },
{ "widget": "app.language-switcher", "part": "language" },
{ "widget": "app.skin-switcher", "part": "skin" }
]
},
{
"tag": "nav",
"part": "quick-rail",
"attributes": { "aria-label": "Favorite and recent servers" },
"children": [
{
"tag": "div",
"part": "quick-server-item",
"repeat": { "path": "servers.quickList", "as": "server" },
"children": [
{
"tag": "button",
"part": "quick-server",
"attributes": {
"type": "button",
"aria-current": "{{server.current}}",
"aria-label": "Switch to {{server.label}}"
},
"events": { "click": "switch-server" },
"children": [
{ "tag": "span", "part": "server-monogram", "children": [{ "text": "{{server.label}}" }] },
{
"tag": "small",
"part": "server-kind",
"when": { "path": "server.favorite", "equals": true },
"children": [{ "text": "Favorite" }]
},
{
"tag": "small",
"part": "server-kind",
"when": { "path": "server.kind", "equals": "recent" },
"children": [{ "text": "Recent" }]
}
]
}
]
}
]
},
{
"tag": "nav",
"part": "channels",
"attributes": { "aria-label": "Voice channels" },
"children": [
{ "tag": "h2", "part": "section-title", "children": [{ "text": "VOICE CHANNELS" }] },
{
"tag": "div",
"part": "channel-item",
"repeat": { "path": "session.channels", "as": "channel" },
"children": [
{
"tag": "button",
"part": "channel-row",
"attributes": {
"type": "button",
"aria-current": "{{channel.current}}",
"aria-label": "Join {{channel.name}}"
},
"events": { "dblclick": "join-channel", "keydown": "join-channel" },
"children": [
{ "tag": "span", "part": "channel-glyph", "children": [{ "text": "◖" }] },
{ "tag": "span", "part": "channel-name", "children": [{ "text": "{{channel.name}}" }] },
{ "tag": "small", "part": "channel-count", "children": [{ "text": "{{channel.memberCount}}" }] }
]
}
]
}
]
},
{
"tag": "section",
"part": "conversation",
"children": [
{
"tag": "header",
"part": "conversation-heading",
"children": [
{ "tag": "h1", "part": "channel-title", "children": [{ "text": "{{session.status.channelName}}" }] },
{ "tag": "span", "part": "connection-state", "children": [{ "text": "Connected" }] }
]
},
{ "widget": "voice.chat-panel", "part": "chat" },
{ "widget": "voice.screen-share-player", "part": "screen-share" }
]
},
{
"tag": "aside",
"part": "members-and-controls",
"children": [
{ "tag": "h2", "part": "section-title", "children": [{ "text": "IN THIS CHANNEL" }] },
{
"tag": "ul",
"part": "member-list",
"children": [
{
"tag": "li",
"part": "member-row",
"repeat": { "path": "session.members", "as": "member" },
"children": [
{ "tag": "span", "part": "member-avatar", "children": [{ "text": "{{member.name}}" }] },
{ "tag": "span", "part": "member-name", "children": [{ "text": "{{member.name}}" }] },
{
"tag": "small",
"part": "speaking-indicator",
"when": { "path": "member.speaking", "equals": true },
"attributes": { "aria-label": "Speaking" },
"children": [{ "text": "Speaking" }]
},
{
"tag": "div",
"part": "member-screen-share",
"when": { "path": "member.screenSharing", "equals": true },
"children": [
{
"tag": "span",
"part": "member-screen-share-live",
"attributes": { "role": "status" },
"children": [{ "text": "Sharing screen" }]
},
{
"tag": "button",
"part": "member-screen-share-watch",
"when": { "path": "member.self", "equals": false },
"attributes": { "type": "button", "aria-label": "Watch {{member.name}}'s screen" },
"events": { "click": "watch-screen-share" },
"children": [{ "text": "Watch" }]
}
]
}
]
}
]
},
{ "widget": "voice.whisper-controls", "part": "whisper" },
{ "widget": "voice.audio-controls", "part": "audio" },
{ "widget": "voice.connection-controls", "part": "connection" },
{ "widget": "voice.disconnect-control", "part": "disconnect" }
]
}
]
}
}
]
}
@@ -0,0 +1,13 @@
{
"schemaVersion": 3,
"packageType": "open-skin",
"id": "community.open-voice-surface",
"name": "Open Voice Surface",
"version": "1.0.1",
"author": "WebSpeak Project",
"license": "AGPL-3.0-only",
"description": "A complete, script-free public voice client surface scaffold.",
"entry": "skin.css",
"components": "components.json",
"minAppVersion": "0.2.7"
}
+313
View File
@@ -0,0 +1,313 @@
:root {
color-scheme: dark;
--skin-voice-bg: #111318;
--skin-voice-panel: #191c24;
--skin-voice-raised: #222631;
--skin-voice-text: #f0f1f5;
--skin-voice-muted: #969baa;
--skin-voice-accent: #8e7bff;
--skin-voice-live: #62d5a7;
}
[data-ws-plugin-part="open-voice-home"] {
min-height: 100vh;
display: grid;
grid-template-rows: auto 1fr auto;
justify-items: center;
gap: 32px;
padding: clamp(18px, 5vw, 56px);
color: var(--skin-voice-text);
background: radial-gradient(ellipse at 50% 42%, #25253c 0, var(--skin-voice-bg) 66%);
}
[data-ws-plugin-part="open-voice-home.home-header"] {
display: flex;
align-items: center;
gap: 12px;
width: min(100%, 1080px);
}
[data-ws-plugin-part="open-voice-home.brand-mark"],
[data-ws-plugin-part="open-voice-workspace.brand-mark"] {
display: grid;
place-items: center;
width: 38px;
height: 38px;
border-radius: 14px;
color: white;
background: var(--skin-voice-accent);
font-weight: 800;
}
[data-ws-plugin-part="open-voice-home.brand-name"] {
margin-right: auto;
font-size: 13px;
font-weight: 800;
letter-spacing: .14em;
}
[data-ws-plugin-part="open-voice-home.connection-card"] {
align-self: center;
width: min(100%, 520px);
padding: clamp(22px, 5vw, 42px);
border: 1px solid #ffffff17;
border-radius: 24px;
background: color-mix(in srgb, var(--skin-voice-panel) 94%, transparent);
box-shadow: 0 28px 90px #0008;
}
[data-ws-plugin-part="open-voice-home.eyebrow"],
[data-ws-plugin-part="open-voice-workspace.section-title"] {
color: var(--skin-voice-muted);
font-size: 10px;
font-weight: 800;
letter-spacing: .14em;
}
[data-ws-plugin-part="open-voice-home.title"] {
margin: 10px 0;
font-size: clamp(27px, 5vw, 40px);
letter-spacing: -.04em;
}
[data-ws-plugin-part="open-voice-home.description"],
[data-ws-plugin-part="open-voice-home.home-footer"] {
color: var(--skin-voice-muted);
line-height: 1.6;
}
[data-ws-plugin-part="open-voice-workspace"] {
display: grid;
grid-template-columns: 72px 228px minmax(320px, 1fr) 252px;
grid-template-rows: 62px minmax(0, 1fr);
width: 100%;
min-height: 100vh;
color: var(--skin-voice-text);
background: var(--skin-voice-bg);
}
[data-ws-plugin-part="open-voice-workspace.workspace-header"] {
grid-column: 1 / -1;
display: flex;
align-items: center;
gap: 14px;
padding: 0 18px;
border-bottom: 1px solid #ffffff12;
background: #171920;
}
[data-ws-plugin-part="open-voice-workspace.server-title"] { margin-right: auto; }
[data-ws-plugin-part="open-voice-workspace.quick-rail"] {
grid-column: 1;
grid-row: 2;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
overflow-y: auto;
padding: 14px 8px;
background: #171920;
}
[data-ws-plugin-part="open-voice-workspace.quick-server"] {
display: grid;
justify-items: center;
gap: 4px;
width: 52px;
min-height: 58px;
padding: 5px;
border: 0;
border-radius: 16px;
color: var(--skin-voice-muted);
background: transparent;
cursor: pointer;
}
[data-ws-plugin-part="open-voice-workspace.quick-server"][aria-current="true"] {
color: white;
background: var(--skin-voice-accent);
}
[data-ws-plugin-part="open-voice-workspace.server-monogram"] {
display: grid;
place-items: center;
width: 36px;
height: 36px;
overflow: hidden;
border-radius: 12px;
background: #ffffff18;
font-size: 11px;
font-weight: 800;
}
[data-ws-plugin-part="open-voice-workspace.server-kind"] { font-size: 8px; }
[data-ws-plugin-part="open-voice-workspace.channels"],
[data-ws-plugin-part="open-voice-workspace.members-and-controls"] {
min-height: 0;
overflow: auto;
padding: 18px 12px;
background: var(--skin-voice-panel);
}
[data-ws-plugin-part="open-voice-workspace.channels"] { grid-column: 2; grid-row: 2; }
[data-ws-plugin-part="open-voice-workspace.members-and-controls"] { grid-column: 4; grid-row: 2; }
[data-ws-plugin-part="open-voice-workspace.channel-row"] {
display: flex;
align-items: center;
gap: 9px;
width: 100%;
margin-top: 4px;
padding: 9px 10px;
border: 0;
border-radius: 8px;
color: var(--skin-voice-muted);
background: transparent;
text-align: left;
cursor: pointer;
}
[data-ws-plugin-part="open-voice-workspace.channel-row"][aria-current="true"] {
color: var(--skin-voice-text);
background: var(--skin-voice-raised);
}
[data-ws-plugin-part="open-voice-workspace.channel-name"] { flex: 1; }
[data-ws-plugin-part="open-voice-workspace.channel-count"] { font-size: 11px; }
[data-ws-plugin-part="open-voice-workspace.conversation"] {
grid-column: 3;
grid-row: 2;
display: grid;
grid-template-rows: auto minmax(0, 1fr) auto;
min-width: 0;
min-height: 0;
padding: 18px;
gap: 12px;
}
[data-ws-plugin-part="open-voice-workspace.conversation-heading"] {
display: flex;
align-items: center;
gap: 12px;
min-height: 46px;
border-bottom: 1px solid #ffffff12;
}
[data-ws-plugin-part="open-voice-workspace.channel-title"] { margin-right: auto; }
[data-ws-plugin-part="open-voice-workspace.connection-state"] { color: var(--skin-voice-live); font-size: 12px; }
[data-ws-plugin-part="open-voice-workspace.member-list"] {
display: grid;
gap: 8px;
margin: 12px 0 20px;
padding: 0;
list-style: none;
}
[data-ws-plugin-part="open-voice-workspace.member-row"] {
display: grid;
grid-template-columns: 34px minmax(0, 1fr);
align-items: center;
column-gap: 10px;
color: var(--skin-voice-text);
font-size: 12px;
}
[data-ws-plugin-part="open-voice-workspace.member-avatar"] {
grid-row: span 2;
display: grid;
place-items: center;
width: 34px;
height: 34px;
overflow: hidden;
border-radius: 50%;
color: white;
background: var(--skin-voice-raised);
font-weight: 700;
}
[data-ws-plugin-part="open-voice-workspace.speaking-indicator"] { color: var(--skin-voice-live); font-size: 10px; }
[data-ws-plugin-part="open-voice-workspace.member-screen-share"] {
grid-column: 2;
display: flex;
align-items: center;
gap: 8px;
color: var(--skin-voice-live);
font-size: 10px;
}
[data-ws-plugin-part="open-voice-workspace.member-screen-share-watch"] {
min-height: 32px;
padding: 0 10px;
border: 1px solid color-mix(in srgb, var(--skin-voice-live) 50%, transparent);
border-radius: 7px;
color: var(--skin-voice-text);
background: var(--skin-voice-raised);
cursor: pointer;
}
[data-ws-plugin-part="open-voice-workspace"] [data-ws-part="voice.chat"],
[data-ws-plugin-part="open-voice-workspace"] [data-ws-part="voice.audio-controls"],
[data-ws-plugin-part="open-voice-workspace"] [data-ws-part="voice.connection-controls"],
[data-ws-plugin-part="open-voice-workspace"] [data-ws-part="voice.disconnect-control"],
[data-ws-plugin-part="open-voice-workspace"] [data-ws-part="voice.whisper-controls"],
[data-ws-plugin-part="open-voice-workspace"] [data-ws-part="voice.screen-player"] {
border-radius: 12px;
color: var(--skin-voice-text);
background-color: var(--skin-voice-panel);
}
[data-ws-plugin-part="open-voice-workspace"] button:focus-visible {
outline: 2px solid var(--skin-voice-accent);
outline-offset: 2px;
}
@media (max-width: 800px) {
[data-ws-plugin-part="open-voice-workspace"] {
grid-template-columns: 58px minmax(0, 1fr);
grid-template-rows: 56px minmax(320px, 1fr) auto;
min-height: 100dvh;
}
[data-ws-plugin-part="open-voice-workspace.workspace-header"] { padding: 0 10px; }
[data-ws-plugin-part="open-voice-workspace.quick-rail"] { grid-column: 1; grid-row: 2; }
[data-ws-plugin-part="open-voice-workspace.channels"] {
grid-column: 1 / -1;
grid-row: 3;
display: flex;
gap: 6px;
overflow-x: auto;
overflow-y: hidden;
padding: 8px;
}
[data-ws-plugin-part="open-voice-workspace.section-title"] { display: none; }
[data-ws-plugin-part="open-voice-workspace.channel-row"] { width: max-content; min-width: 130px; margin: 0; }
[data-ws-plugin-part="open-voice-workspace.conversation"] {
grid-column: 2;
grid-row: 2;
padding: 10px;
}
[data-ws-plugin-part="open-voice-workspace.members-and-controls"] {
grid-column: 1 / -1;
grid-row: 4;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
padding: 8px;
}
[data-ws-plugin-part="open-voice-workspace.member-list"] { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
[data-ws-plugin-part="open-voice-workspace"] *,
[data-ws-plugin-part="open-voice-home"] * {
scroll-behavior: auto;
animation-duration: .01ms;
animation-iteration-count: 1;
transition-duration: .01ms;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

+3
View File
@@ -0,0 +1,3 @@
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Application starter</title><link rel="stylesheet" href="./style.css"><script type="module" src="./main.js"></script></head>
<body><main><span class="eyebrow">WEBSPEAK · APPLICATION RUNTIME 2</span><h1 id="title"></h1><p id="intro"></p><section><div class="status"><i></i><span id="status"></span></div><dl><div><dt id="user-label"></dt><dd id="user"></dd></div><div><dt id="scope-label"></dt><dd id="scope"></dd></div></dl><button id="request" type="button"></button><output id="result" aria-live="polite"></output></section></main></body></html>
+12
View File
@@ -0,0 +1,12 @@
const host=window.webspeak;
let context=await host.ready;
const copy={
en:['Your application starts here','Standard browser APIs, your own routes and an optional Node backend.','Connected application context','Participant','Scope','Call my backend','Persisted requests','Frontend only'],
zh:['从这里构建你的应用','使用标准浏览器 API、自定义路由和可选的 Node 后端。','应用上下文已连接','参与者','作用域','调用自己的后端','已保存的请求次数','仅前端模式'],
de:['Hier beginnt deine Anwendung','Browser-APIs, eigene Routen und ein optionales Node-Backend.','Anwendungskontext verbunden','Teilnehmer','Bereich','Backend aufrufen','Gespeicherte Anfragen','Nur Frontend'],
ru:['Начните своё приложение здесь','API браузера, собственные маршруты и необязательный сервис Node.','Контекст приложения подключён','Участник','Область','Вызвать свой сервис','Сохранённые запросы','Только браузер'],
ja:['ここからアプリを作成','標準ブラウザー API、独自ルート、任意の Node バックエンド。','アプリの接続情報を取得済み','参加者','範囲','バックエンドを呼び出す','保存したリクエスト数','フロントエンドのみ']};
const element=id=>document.getElementById(id);
function render(){const t=copy[context.language]??copy.en;for(const [id,index]of [['title',0],['intro',1],['status',2],['user-label',3],['scope-label',4],['request',5]])element(id).textContent=t[index];element('user').textContent=context.self.nickname;element('scope').textContent=context.scope.type;element('request').disabled=!context.serverUrl;if(!context.serverUrl)element('result').textContent=t[7];}
host.onContextChange(next=>{context=next;render();});render();
element('request').addEventListener('click',async()=>{element('request').disabled=true;try{const response=await fetch(context.serverUrl+'/my-counter',{method:'POST',signal:host.signal});if(!response.ok)throw new Error(String(response.status));const result=await response.json();element('result').textContent=(copy[context.language]??copy.en)[6]+': '+result.count;}catch(error){element('result').textContent=error.message;}finally{element('request').disabled=!context.serverUrl;}});
+1
View File
@@ -0,0 +1 @@
:root{color-scheme:light;--bg:#f1f5f4;--surface:#fff;--text:#183d39;--muted:#5b7671;--border:#d4e3df;--accent:#126b60;--soft:#e8f4ef}html[data-theme=dark]{color-scheme:dark;--bg:#161c21;--surface:#202a30;--text:#e4efec;--muted:#9eb6b0;--border:#37474c;--accent:#8ee2be;--soft:#293e37}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:15px/1.6 system-ui,sans-serif}main{max-width:800px;margin:0 auto;padding:clamp(24px,6vw,64px)}.eyebrow{color:var(--accent);font-size:11px;font-weight:750;letter-spacing:.14em}h1{font-size:clamp(25px,4vw,38px);letter-spacing:-.04em;line-height:1.2;margin:20px 0 14px}p{color:var(--muted);max-width:550px}section{margin-top:30px;padding:26px;border:1px solid var(--border);border-radius:18px;background:var(--surface)}.status{display:flex;align-items:center;gap:9px;font-size:12px;color:var(--accent)}.status i{width:8px;height:8px;border-radius:50%;background:var(--accent)}dl{display:flex;gap:32px;flex-wrap:wrap;margin:22px 0 30px}dt{font-size:12px;color:var(--muted)}dd{margin:4px 0 0;font-weight:650;overflow-wrap:anywhere}button{font:600 14px system-ui;padding:12px 18px;border-radius:10px;border:1px solid var(--border);color:var(--accent);background:var(--soft);cursor:pointer}button:disabled{opacity:.5;cursor:default}output{display:block;margin-top:16px;color:var(--muted);font-size:13px}
+19
View File
@@ -0,0 +1,19 @@
{
"apiVersion": 2,
"id": "community.application-starter",
"name": "Application starter",
"version": "1.0.0",
"author": "Your community",
"license": "AGPL-3.0-only",
"description": "A starting point for an independent browser application and optional Node service.",
"scopes": [
"server",
"instance"
],
"client": {
"entry": "client/index.html"
},
"server": {
"entry": "server/main.mjs"
}
}
+19
View File
@@ -0,0 +1,19 @@
import { readFile, writeFile, rename } from 'node:fs/promises';
import path from 'node:path';
// Ordinary trusted Node code: use your own modules, network clients and routes.
export default async function activate({ dataDir, signal }) {
const filename=path.join(dataDir,'counter.json');
let count=JSON.parse(await readFile(filename,'utf8').catch(()=> '0'));
let writes=Promise.resolve();
return {
async handle(request,response) {
if(request.method!=='POST'||new URL(request.url,'http://app.local').pathname!=='/my-counter'){response.writeHead(404);response.end();return;}
// req.webspeak is host-authenticated context; it is not supplied by the browser.
writes=writes.then(async()=>{count++;await writeFile(filename+'.tmp',JSON.stringify(count));await rename(filename+'.tmp',filename);});
try{await writes;response.setHeader('content-type','application/json');response.end(JSON.stringify({count,participant:request.webspeak.self.id}));}
catch{response.writeHead(500);response.end();}
},
async stop(){await writes.catch(()=>undefined);}
};
}
+37
View File
@@ -0,0 +1,37 @@
# Android client
The Android app packages the Vue client with a small local gateway. Capacitor starts the embedded Node.js runtime, the gateway listens on `127.0.0.1:3040`, and the WebView opens that local address. The gateway is loopback-only; it does not expose an HTTP listener to the LAN. Release APKs are debug-signed sideload packages, not Google Play builds.
## Build on Windows
Use a short checkout path such as `C:\src\webspeak`. The Node.js plugin's CMake/Ninja object paths can exceed the Windows toolchain limit in deeply nested workspaces. A clean build in a nested validation directory failed with CMake's 250-character object-path warning and a Ninja `mkdir` error; the same source and dependencies built successfully from a shorter path. Changing application code or the embedded runtime is not required for this build-host issue.
Use Node.js 22.12 or newer on the build host. Install all three dependency sets, then prepare and sync the Android project:
```powershell
npm ci --ignore-scripts --no-audit --no-fund
npm rebuild @discordjs/opus --foreground-scripts --no-audit --no-fund
npm --prefix web ci --no-audit --no-fund
npm --prefix mobile ci --no-audit --no-fund
npm run android:sync
```
Build the debug APKs with Android Studio's JDK and the checked-in Gradle wrapper:
```powershell
$env:JAVA_HOME = "C:\Program Files\Android\Android Studio\jbr"
$env:ANDROID_HOME = "$env:LOCALAPPDATA\Android\Sdk"
Set-Location web\android
.\gradlew.bat assembleDebug
```
Gradle writes one APK per supported CPU architecture under `web/android/app/build/outputs/apk/debug/`: `arm64-v8a`, `armeabi-v7a`, and `x86_64`. Use `arm64-v8a` for most modern Android phones and `x86_64` for the Android emulator. GitHub Releases contains all three APKs with versioned filenames.
## Current scope
- Platform startup is isolated in `web/src/platform/`. Ordinary browser sessions mount directly; the native shell loads the Node.js plugin only while waiting for its loopback gateway. Startup errors, timeouts and page exit release polling and message listeners. Retry repeats the readiness handshake without restarting the embedded Node.js runtime.
- The local gateway serves the join page, public configuration, skin package, join-ticket endpoint, and voice WebSocket bridge.
- The admin console and server-side skin management are not available in the Android package.
- Mobile audio encoding uses the JavaScript/WASM Opus codec. The normal server build continues to use the native Opus codec.
- The embedded runtime supplied by the current Capacitor Node.js plugin is Node.js 18.20.4. The gateway, identity parsing, and Opus encode/decode paths have been smoke-checked on that runtime. The upstream TeamSpeak SDK 1.0 declares Node.js 22.12 or newer, so real TeamSpeak connectivity and two-way audio remain unverified on Android; the APKs are for sideload testing.
- Android WebView on the tested emulator does not expose `getDisplayMedia`; screen sharing needs a native MediaProjection integration. A persistent Android foreground service and real-device background audio behavior also remain to be implemented and verified.
+33
View File
@@ -0,0 +1,33 @@
const path = require("node:path");
const os = require("node:os");
let app;
let channel;
try {
({ app, channel } = require("bridge"));
} catch (error) {
if (error.code !== "MODULE_NOT_FOUND") throw error;
app = { datadir: () => path.join(os.tmpdir(), "webspeak-android-gateway-dev") };
channel = { on: () => {}, post: () => {} };
}
process.env.WEBSPEAK_MOBILE = "1";
process.env.WEBSPEAK_DATA_DIR = app.datadir();
process.env.WEBSPEAK_MOBILE_WWW = path.join(__dirname, "www");
process.env.WEBSPEAK_VERSION = require("./package.json").version;
let gatewayReady = false;
const gatewayPort = Number(process.env.WEBSPEAK_MOBILE_PORT || 3040);
channel.on("webspeak-health", () => {
channel.post("webspeak-health", { ready: gatewayReady, port: gatewayPort });
});
import("./dist/mobile/index.js")
.then(() => {
gatewayReady = true;
channel.post("webspeak-health", { ready: true, port: gatewayPort });
})
.catch((error) => {
const message = error instanceof Error ? error.stack || error.message : String(error);
console.error("WebSpeak mobile gateway failed:", message);
channel.post("webspeak-error", { message });
});
+29
View File
@@ -0,0 +1,29 @@
import { cp, mkdir, readdir, copyFile, stat, readFile, writeFile, rm } from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
const mobileDir = path.dirname(fileURLToPath(import.meta.url));
const rootDir = path.resolve(mobileDir, "..");
const webDist = path.join(rootDir, "web", "dist");
const outputDir = path.join(webDist, "nodejs");
for (const required of [path.join(rootDir, "dist", "mobile", "index.js"), path.join(mobileDir, "node_modules"), path.join(webDist, "index.html")]) {
if (!(await stat(required).catch(() => null))) throw new Error(`Missing Android build input: ${required}`);
}
await rm(outputDir, { recursive: true, force: true });
await mkdir(path.join(outputDir, "www"), { recursive: true });
await cp(path.join(rootDir, "dist"), path.join(outputDir, "dist"), { recursive: true, force: true });
await cp(path.join(mobileDir, "node_modules"), path.join(outputDir, "node_modules"), { recursive: true, force: true });
await copyFile(path.join(mobileDir, "index.cjs"), path.join(outputDir, "index.cjs"));
const appPackage = JSON.parse(await readFile(path.join(rootDir, "package.json"), "utf8"));
const mobilePackage = JSON.parse(await readFile(path.join(mobileDir, "package.json"), "utf8"));
mobilePackage.version = appPackage.version;
await writeFile(path.join(outputDir, "package.json"), `${JSON.stringify(mobilePackage, null, 2)}\n`);
for (const entry of await readdir(webDist, { withFileTypes: true })) {
if (entry.name === "nodejs") continue;
await cp(path.join(webDist, entry.name), path.join(outputDir, "www", entry.name), { recursive: entry.isDirectory(), force: true });
}
console.log(`Android gateway assets prepared at ${outputDir}`);
+1572
View File
File diff suppressed because it is too large. Load diff
+15
View File
@@ -0,0 +1,15 @@
{
"name": "webspeak-android-gateway",
"version": "0.3.4-dev.0",
"private": true,
"type": "module",
"main": "index.cjs",
"dependencies": {
"@honeybbq/teamspeak": "1.0.0-beta.23",
"express": "^4.21.2",
"opusscript": "^0.1.1",
"pino": "^10.3.1",
"werift": "0.24.4",
"ws": "^8.20.0"
}
}
+192 -15
View File
@@ -1,18 +1,22 @@
{
"name": "webspeak-webclient",
"version": "0.2.5-preview",
"version": "0.3.4-dev.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "webspeak-webclient",
"version": "0.2.5-preview",
"version": "0.3.4-dev.0",
"license": "AGPL-3.0-only",
"dependencies": {
"@discordjs/opus": "^0.10.0",
"@echosixhiya/teamspeak-client": "git+https://github.com/EchoSixHIYA/teamspeak-js.git#56d426d24852c39439f7bfe1d5850b574a1b0811",
"@honeybbq/teamspeak": "1.0.0-beta.23",
"express": "^5.2.1",
"pino": "^10.3.1",
"postcss": "^8.5.29",
"postcss-selector-parser": "^7.1.6",
"postcss-value-parser": "^4.2.0",
"ssh2": "^1.17.0",
"werift": "0.24.4",
"ws": "^8.20.0"
},
@@ -24,7 +28,7 @@
"typescript": "^6.0.2"
},
"engines": {
"node": ">=22.5.0"
"node": ">=22.12.0"
}
},
"node_modules/@discordjs/node-pre-gyp": {
@@ -61,17 +65,6 @@
"node": ">=12.0.0"
}
},
"node_modules/@echosixhiya/teamspeak-client": {
"version": "0.2.4",
"resolved": "git+https://github.com/EchoSixHIYA/teamspeak-js.git#56d426d24852c39439f7bfe1d5850b574a1b0811",
"license": "MIT",
"dependencies": {
"@noble/curves": "^2.0.1"
},
"engines": {
"node": ">=20.19"
}
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz",
@@ -536,6 +529,26 @@
"node": ">= 8"
}
},
"node_modules/@honeybbq/teamspeak": {
"version": "1.0.0-beta.23",
"resolved": "https://registry.npmjs.org/@honeybbq/teamspeak/-/teamspeak-1.0.0-beta.23.tgz",
"integrity": "sha512-Y0fV4NOdvaU3Df4231XZkFOfSgm7G4xN50x5hglxVV+HtYlxx5sS+G3vAF0rvOcW80qUy20nfnD/Sxx+JgQ1TA==",
"license": "MIT",
"dependencies": {
"@noble/curves": "^2.0.1"
},
"engines": {
"node": ">=22.12"
},
"peerDependencies": {
"ssh2": "^1.17.0"
},
"peerDependenciesMeta": {
"ssh2": {
"optional": true
}
}
},
"node_modules/@isaacs/fs-minipass": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",
@@ -970,6 +983,15 @@
"node": ">=10"
}
},
"node_modules/asn1": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
"integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==",
"license": "MIT",
"dependencies": {
"safer-buffer": "~2.1.0"
}
},
"node_modules/asn1js": {
"version": "3.0.10",
"resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.10.tgz",
@@ -1019,6 +1041,21 @@
],
"license": "MIT"
},
"node_modules/bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",
"license": "BSD-3-Clause",
"dependencies": {
"tweetnacl": "^0.14.3"
}
},
"node_modules/bcrypt-pbkdf/node_modules/tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==",
"license": "Unlicense"
},
"node_modules/body-parser": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
@@ -1090,6 +1127,15 @@
"ieee754": "^1.2.1"
}
},
"node_modules/buildcheck": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/buildcheck/-/buildcheck-0.0.7.tgz",
"integrity": "sha512-lHblz4ahamxpTmnsk+MNTRWsjYKv965MwOrSJyeD588rR3Jcu7swE+0wN5F+PbL5cjgu/9ObkhfzEPuofEMwLA==",
"optional": true,
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
@@ -1198,6 +1244,32 @@
"node": ">=6.6.0"
}
},
"node_modules/cpu-features": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.10.tgz",
"integrity": "sha512-9IkYqtX3YHPCzoVg1Py+o9057a3i0fp7S530UWokCSaFVTc7CwXPRiOjRjBQQ18ZCNafx78YfnG+HALxtVmOGA==",
"hasInstallScript": true,
"optional": true,
"dependencies": {
"buildcheck": "~0.0.6",
"nan": "^2.19.0"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/cssesc": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
"license": "MIT",
"bin": {
"cssesc": "bin/cssesc"
},
"engines": {
"node": ">=4"
}
},
"node_modules/debug": {
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
@@ -1901,6 +1973,31 @@
"multicast-dns": "cli.js"
}
},
"node_modules/nan": {
"version": "2.29.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.29.0.tgz",
"integrity": "sha512-GlGk3HIvitbvs+LT3g6XUP1kpirKNvmDFwF/bmo6XNWSb/eYEs/O4bfgIEIXCZ+lIOTS5xNwDvSGMw6FJdAhtA==",
"license": "MIT",
"optional": true
},
"node_modules/nanoid": {
"version": "3.3.20",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
"integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"bin": {
"nanoid": "bin/nanoid.cjs"
},
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/negotiator": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
@@ -2046,6 +2143,12 @@
"url": "https://opencollective.com/express"
}
},
"node_modules/picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
"license": "ISC"
},
"node_modules/pino": {
"version": "10.3.1",
"resolved": "https://registry.npmjs.org/pino/-/pino-10.3.1.tgz",
@@ -2083,6 +2186,53 @@
"integrity": "sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw==",
"license": "MIT"
},
"node_modules/postcss": {
"version": "8.5.29",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.29.tgz",
"integrity": "sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"nanoid": "^3.3.19",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.2"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/postcss-selector-parser": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.6.tgz",
"integrity": "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==",
"license": "MIT",
"dependencies": {
"cssesc": "^3.0.0",
"util-deprecate": "^1.0.2"
},
"engines": {
"node": ">=4"
}
},
"node_modules/postcss-value-parser": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",
"license": "MIT"
},
"node_modules/process-warning": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.0.0.tgz",
@@ -2427,6 +2577,15 @@
"atomic-sleep": "^1.0.0"
}
},
"node_modules/source-map-js": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
"integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/split2": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
@@ -2436,6 +2595,24 @@
"node": ">= 10.x"
}
},
"node_modules/ssh2": {
"version": "1.17.0",
"resolved": "https://registry.npmjs.org/ssh2/-/ssh2-1.17.0.tgz",
"integrity": "sha512-wPldCk3asibAjQ/kziWQQt1Wh3PgDFpC0XpwclzKcdT1vql6KeYxf5LIt4nlFkUeR8WuphYMKqUA56X4rjbfgQ==",
"hasInstallScript": true,
"peer": true,
"dependencies": {
"asn1": "^0.2.6",
"bcrypt-pbkdf": "^1.0.2"
},
"engines": {
"node": ">=10.16.0"
},
"optionalDependencies": {
"cpu-features": "~0.0.10",
"nan": "^2.23.0"
}
},
"node_modules/statuses": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
+20 -7
View File
@@ -1,31 +1,44 @@
{
"name": "webspeak-webclient",
"version": "0.2.5-preview",
"version": "0.3.4-dev.0",
"private": true,
"license": "AGPL-3.0-only",
"type": "module",
"description": "Server-side browser gateway for TeamSpeak — deploy on your server, users join from any browser",
"engines": {
"node": ">=22.5.0"
"node": ">=22.12.0"
},
"scripts": {
"dev": "tsx src/index.ts",
"build": "tsc",
"test": "node --import tsx --test src/admin/skin-registry.test.ts src/server/visitor-count.test.ts web/src/services/skin-catalog.test.ts web/src/services/skin-pack.test.ts",
"test": "node --import tsx --test src/admin/security-boundaries.test.ts src/admin/update-routes.test.ts src/updater/version.test.ts src/updater/deployment.test.ts src/updater/archive.test.ts src/updater/code-swap.test.ts src/updater/update-state.test.ts src/updater/update-service.test.ts src/updater/restart-runner.test.ts src/updater/swap-recovery.test.ts src/domain/teamspeak-target.test.ts web/src/voice/member-volume-preferences.test.ts web/src/services/voice-channel-tree.test.ts src/admin/skin-registry.test.ts web/test/skin-store.test.ts src/admin/ts-admin-service.test.ts web/test/admin-api.integration.test.ts web/test/admin-view.test.mjs web/src/services/admin-api.test.ts src/security/open-target-policy.test.ts scripts/acceleration-poc/target-guard-parity.test.mjs src/server/acceleration-relay.test.ts src/server/visitor-count.test.ts src/server/voice-gateway-auth.test.ts src/server/voice-gateway.test.ts src/server/relay-delegation.integration.test.ts src/persistence/database.test.ts src/server/voice-protocol.test.ts src/server/teamspeak-resolver.test.ts src/server/teamspeak-adapter.test.ts src/server/teamspeak-sdk.test.ts src/server/ts-client.test.ts src/server/join-ticket.test.ts src/server/identity-lease.test.ts src/server/session-manager.test.ts src/server/directory-sync.test.ts src/server/session-events.test.ts src/server/reconnect-policy.test.ts src/server/voice-commands.test.ts src/server/voice-bridge.test.ts src/server/session-audio.test.ts src/server/voice-bridge.integration.test.ts src/server/webrtc-audio.test.ts src/server/webrtc-config.test.ts src/server/audio-stats.test.ts src/server/turn-credentials.test.ts src/server/voice-ice-config.test.ts src/server/audio-pacer.test.ts src/server/channel-capacity.test.ts src/server/directory-view.test.ts src/server/member-avatars.test.ts src/server/screen-share-coordinator.test.ts src/shared/client-commands.test.ts src/shared/skin-layout.test.ts src/shared/skin-css.test.ts src/shared/skin-plugin.test.ts src/shared/skin-runtime-plugin-context.test.ts src/shared/skin-runtime-plugins.test.ts src/shared/skin-runtime-plugin-approval.test.ts src/shared/server-messages.test.ts src/shared/voice-ice.test.ts src/shared/voice-profile.test.ts src/shared/webrtc.test.ts scripts/docker-healthcheck.test.mjs web/test/voice-session.test.mjs web/test/audio-controls.test.mjs web/test/connection-dialogs.test.mjs web/test/voice-workspace.test.mjs web/test/skin-workspace.test.ts web/test/voice-performance.test.mjs web/test/jitter-buffer.test.ts web/test/remote-playback.test.ts web/test/opus-uplink.test.ts web/test/screen-share.test.ts web/test/screen-share-ui.test.mjs web/test/android-gateway.test.ts web/src/services/skin-catalog.test.ts web/src/services/skin-content.test.ts web/src/services/skin-plugin-runtime.test.ts web/src/services/skin-plugin-authoring.test.ts web/src/services/skin-editor-mode.test.ts web/src/services/skin-plugin-approval.test.ts web/src/services/host-editor-top-layer.test.ts web/src/services/skin-extension-ui.test.ts web/src/services/member-menu-placement.test.ts web/src/services/audio-device-menu-placement.test.ts web/src/services/mobile-viewport.test.ts web/src/services/mobile-away.test.ts web/src/services/screen-wake-lock.test.ts web/src/services/microphone-start.test.ts web/src/services/skin-pack.test.ts web/src/services/skin-runtime-plugin-approval.test.ts web/src/services/skin-layout-storage.test.ts web/src/services/skin-layout-geometry.test.ts web/src/services/skin-layout-focus.test.ts web/test/skin-layout-runtime.test.mjs web/test/skin-plugin-editor.test.mjs web/src/services/identity-import.test.ts web/src/services/identity-provider.test.ts web/test/identity-dialog.test.mjs web/test/skin-lifecycle.test.mjs web/src/services/local-persistence.test.ts web/src/services/quick-servers.test.ts src/server/teamspeak-alias.test.ts src/server/teamspeak-alias-integration.test.ts web/src/services/teamspeak-target.test.ts web/src/services/skin-extension-sandbox.test.ts web/src/services/skin-extension-wasm-policy.test.ts web/src/services/skin-extension-wasm-sandbox.test.ts web/src/services/skin-runtime-plugin-wasm.test.ts web/src/services/skin-extension-wasm-ui-loop.test.ts web/src/services/skin-wasm-interpreter.test.ts src/plugins/plugins.test.ts web/test/plugins.integration.test.ts web/src/services/plugin-app-client.test.ts web/src/services/instance-authorization.test.ts web/src/services/host-chrome-visibility.test.ts web/src/services/host-control-tokens.test.ts web/src/services/host-recovery-helpers.test.ts web/src/services/host-slot-placement.test.ts web/src/services/host-floating-placement.test.ts web/test/host-chrome-recovery.test.mjs web/src/services/host-recovery-presentation.test.ts web/test/opus-uplink-browser.test.mjs",
"verify": "npm test && npm run build && npm run web:build",
"skin:harbor:build": "node web/scripts/build-harbor-voice-skin.mjs",
"skin:open-voice:build": "node web/scripts/build-open-voice-surface-skin.mjs",
"skin:host-chrome:build": "node web/scripts/build-host-chrome-demo-skin.mjs",
"skin:kaak:build": "node web/scripts/build-kaak-voice-skin.mjs",
"skin:illusia:build": "node web/scripts/build-illusia-voice-skin.mjs",
"start": "node dist/index.js",
"web:dev": "cd web && npx vite --host",
"web:build": "cd web && npx vite build",
"prepare:sdk": "node scripts/prepare-sdk.mjs",
"web:build": "npm --prefix web run build",
"skin:wasm:build": "node scripts/build-skin-wasm-interpreter.mjs",
"android:prepare": "npm run build && npm --prefix web run build && node mobile/pack.mjs",
"android:sync": "npm run android:prepare && cd web && npx cap sync android",
"acceleration:poc": "node scripts/acceleration-poc/smoke.mjs",
"acceleration:ipv6-smoke": "node scripts/acceleration-poc/smoke-ipv6.mjs",
"acceleration:sdk-smoke": "node scripts/acceleration-poc/sdk-smoke.mjs",
"acceleration:relay": "node dist/relay.js"
"acceleration:relay": "node dist/relay.js",
"plugin:build": "node scripts/build-plugin.mjs"
},
"dependencies": {
"@discordjs/opus": "^0.10.0",
"@echosixhiya/teamspeak-client": "git+https://github.com/EchoSixHIYA/teamspeak-js.git#56d426d24852c39439f7bfe1d5850b574a1b0811",
"@honeybbq/teamspeak": "1.0.0-beta.23",
"express": "^5.2.1",
"pino": "^10.3.1",
"postcss": "^8.5.29",
"postcss-selector-parser": "^7.1.6",
"postcss-value-parser": "^4.2.0",
"ssh2": "^1.17.0",
"werift": "0.24.4",
"ws": "^8.20.0"
},
+19 -6
View File
@@ -4,11 +4,12 @@
它验证以下核心能力:
- 香港侧客户端向上海侧中继发起认证;
- 客户端向远端中继发起认证;
- 每个会话动态指定 TeamSpeak 目标地址;
- 双向 UDP 数据报转发,并保持数据包边界;
- 会话之间按随机 ID 隔离;
- 错误密钥不能建立会话;
- 未开启 `allowPrivate` 时,解析到非公网地址的目标一律被拒绝;
- 不修改系统路由,因此不是 VPN。
## 本地冒烟
@@ -19,7 +20,13 @@
npm run acceleration:poc
```
成功时会输出 `ACCELERATION_POC_OK`,并显示数据包数量、丢包率和往返延迟。
成功时会输出 `ACCELERATION_POC_OK`,并显示数据包数量、丢包率和往返延迟。除吞吐与错误密钥外,该冒烟还会用一个独立的 `allowPrivate: false` 中继断言私网目标防护生效:
```text
ssrf_guard_ok=true blocked=5/5 public_target_allowed=true
```
任一被禁目标未被拦截、或公网目标被误拦,都会输出 `LEAK` / 失败。
IPv6 回环验证:
@@ -27,16 +34,22 @@ IPv6 回环验证:
npm run acceleration:ipv6-smoke
```
## 通过隧道连接上海 TeamSpeak
## 私网目标防护与主程序保持一致
下面的命令会让 SDK 连接本地代理端口,再由 PoC 中继把 UDP 数据转发到指定 TeamSpeak。它不进入指定频道,只验证 TeamSpeak 握手和断开:
中继的 `isRestrictedAddress()` 是 `src/security/open-target-policy.ts` 中同名函数的镜像。PoC 必须是可直接拷贝到远端运行的 `.mjs` 文件,不能 import 主程序的 TypeScript 模块,因此这段判断是**有意重复**的。`scripts/acceleration-poc/target-guard-parity.test.mjs` 会逐条比对两边的分类结果,任何一侧改动而另一侧未同步都会让 CI 失败。
该测试放在 PoC 目录内而非 `src/` 下:`.dockerignore` 把 `scripts/acceleration-poc` 排除在 Docker 构建上下文之外,而 Dockerfile 会对 `src/**` 执行 `tsc`,因此 `src/` 下任何 import 该目录的文件都会让镜像构建以 TS2307 失败。
## 通过隧道连接指定 TeamSpeak
必须先将下方示例域名替换为你获准测试的 TeamSpeak 地址;脚本不内置真实服务器默认值。下面的命令会让 SDK 连接本地代理端口,再由 PoC 中继把 UDP 数据转发到指定 TeamSpeak。它不进入指定频道,只验证 TeamSpeak 握手和断开:
```bash
$env:WEBSPEAK_ACCEL_TS_TARGET="203.0.113.10#9987"
$env:WEBSPEAK_ACCEL_TS_TARGET="ts.example.invalid#9987"
npm run acceleration:sdk-smoke
```
跨机器验证时,需要在上海启动 `relay-server.mjs`,再把 `WEBSPEAK_ACCEL_RELAY` 指向上海中继地址。当前项目不会自动部署或启动该远程进程。
跨机器验证时,需要在目标服务器启动 `relay-server.mjs`,再把 `WEBSPEAK_ACCEL_RELAY` 指向中继地址。当前项目不会自动部署或启动该远程进程。
## 手动启动中继
+62 -30
View File
@@ -1,44 +1,73 @@
import { createSocket } from "node:dgram";
import { lookup } from "node:dns/promises";
import { isIP } from "node:net";
import { BlockList, isIP, SocketAddress } from "node:net";
import { decodeFrame, encodeFrame, FrameType, jsonPayload, parseJsonPayload, verifyFrame } from "./protocol.mjs";
function endpointKey(address, port) {
return `${address}/${port}`;
}
function isPrivateAddress(host) {
const family = isIP(host);
if (family === 4) {
const octets = host.split(".").map(Number);
return octets[0] === 10
|| (octets[0] === 172 && octets[1] >= 16 && octets[1] <= 31)
|| octets[0] === 192 && octets[1] === 168
|| octets[0] === 127
|| octets[0] === 169 && octets[1] === 254
|| octets[0] === 0;
/**
* Mirror of `isRestrictedAddress()` in `src/security/open-target-policy.ts`.
*
* The PoC ships as a plain `.mjs` file that the README documents copying to a
* remote host without a build step, so it cannot import the TypeScript policy.
* The logic is duplicated rather than shared, and
* `scripts/acceleration-poc/target-guard-parity.test.mjs` fails the moment the two
* classifications disagree, so drift is caught in CI instead of in production.
*
* Keep this an exact mirror: fail closed on anything that is not a literal
* public address.
*/
const restrictedIpv6 = new BlockList();
for (const [network, prefix] of [
["::", 16], ["64:ff9b::", 96], ["64:ff9b:1::", 48],
["100::", 64], ["100:0:0:1::", 64], ["2001::", 32], ["2002::", 16],
["2001:db8::", 32], ["3fff::", 20], ["fc00::", 7], ["fe80::", 10],
["fec0::", 10], ["ff00::", 8],
]) restrictedIpv6.addSubnet(network, prefix, "ipv6");
export function isRestrictedAddress(host) {
if (host.includes("%")) return true;
const version = isIP(host);
if (version === 4) return isRestrictedIpv4(host);
if (version !== 6) return true;
const normalized = new SocketAddress({ address: host, family: "ipv6" }).address;
if (normalized.startsWith("::ffff:")) {
// IPv4-mapped addresses must be unwrapped before the IPv4 rules apply:
// ::ffff:10.0.0.1 is private traffic in IPv6 clothing.
const mapped = normalized.slice("::ffff:".length);
return isIP(mapped) !== 4 || isRestrictedIpv4(mapped);
}
if (family === 6) {
const normalized = host.toLowerCase();
return normalized === "::1"
|| normalized === "::"
|| normalized.startsWith("fc")
|| normalized.startsWith("fd")
|| normalized.startsWith("fe8")
|| normalized.startsWith("fe9")
|| normalized.startsWith("fea")
|| normalized.startsWith("feb");
}
return host === "localhost" || host.endsWith(".localhost");
return restrictedIpv6.check(normalized, "ipv6");
}
function isRestrictedIpv4(host) {
const parts = host.split(".").map(Number);
if (parts.length !== 4 || parts.some((part) => !Number.isInteger(part) || part < 0 || part > 255)) return true;
const [a, b, c] = parts;
return a === 0
|| a === 10
|| a === 127
|| (a === 100 && b >= 64 && b <= 127)
|| (a === 169 && b === 254)
|| (a === 172 && b >= 16 && b <= 31)
|| (a === 192 && b === 0)
|| (a === 192 && b === 168)
|| (a === 198 && (b === 18 || b === 19))
|| (a === 198 && b === 51 && c === 100)
|| (a === 203 && b === 0 && c === 113)
|| a >= 224;
}
async function resolveTarget(host) {
const family = isIP(host);
if (family) return { host, family };
if (family) return { host, family, resolved: [host] };
const records = await lookup(host, { all: true, verbatim: true });
const record = records.find((item) => item.family === 4) ?? records[0];
if (!record) throw new Error("TARGET_DNS_EMPTY");
return { host: record.address, family: record.family };
return { host: record.address, family: record.family, resolved: records.map((item) => item.address) };
}
export async function createRelayServer({
@@ -71,11 +100,6 @@ export async function createRelayServer({
if (!request || typeof request.targetHost !== "string" || !Number.isInteger(request.targetPort)) {
return;
}
if (!allowPrivate && (isPrivateAddress(request.targetHost) || request.targetHost === "localhost")) {
const error = { code: "PRIVATE_TARGET_BLOCKED" };
socket.send(encodeFrame(FrameType.OPEN_ERR, frame.sessionId, 0, jsonPayload(error), token), client.port, client.address);
return;
}
const existing = sessions.get(frame.sessionId);
if (existing) cleanup(existing);
@@ -92,6 +116,14 @@ export async function createRelayServer({
try {
const target = await resolveTarget(request.targetHost);
// Validate the resolved addresses, not the caller-supplied name: a DNS
// answer can point any hostname at loopback or an internal address.
if (!allowPrivate && target.resolved.some((address) => isRestrictedAddress(address))) {
const error = { code: "PRIVATE_TARGET_BLOCKED" };
socket.send(encodeFrame(FrameType.OPEN_ERR, frame.sessionId, 0, jsonPayload(error), token), client.port, client.address);
cleanup(session);
return;
}
const targetSocket = createSocket(target.family === 6 ? "udp6" : "udp4");
session.targetSocket = targetSocket;
targetSocket.on("message", (payload) => {
+7 -3
View File
@@ -1,10 +1,14 @@
import { Client, generateIdentity } from "../../../teamspeak-js/dist/index.mjs";
import { Client, generateIdentitySync } from "@honeybbq/teamspeak/client";
import { createRelayClient } from "./relay-client.mjs";
import { createRelayServer } from "./relay-server.mjs";
import { parseEndpoint } from "./protocol.mjs";
const token = process.env.WEBSPEAK_ACCEL_TOKEN ?? "local-acceleration-poc-token";
const target = parseEndpoint(process.env.WEBSPEAK_ACCEL_TS_TARGET ?? "203.0.113.10#9987", 9987);
const targetAddress = process.env.WEBSPEAK_ACCEL_TS_TARGET;
if (!targetAddress?.trim()) {
throw new Error("Set WEBSPEAK_ACCEL_TS_TARGET to your authorized TeamSpeak test endpoint");
}
const target = parseEndpoint(targetAddress, 9987);
const relayEndpoint = process.env.WEBSPEAK_ACCEL_RELAY;
let relayServer = null;
let relayClient = null;
@@ -34,7 +38,7 @@ try {
token,
});
tsClient = new Client(generateIdentity(8), `127.0.0.1:${relayClient.localPort}`, "acceleration-sdk-smoke");
tsClient = new Client(generateIdentitySync(8), `127.0.0.1:${relayClient.localPort}`, "acceleration-sdk-smoke");
await withTimeout(tsClient.connect(), 15_000, "TS_CONNECT");
console.log(`TS_ACCEL_CONNECTED target=${target.host}#${target.port}`);
await new Promise((resolve) => setTimeout(resolve, 500));
+58 -1
View File
@@ -51,6 +51,59 @@ async function run() {
rejectedBadToken = true;
}
// SSRF guard: a relay started without allowPrivate must refuse every request
// that resolves to a non-public address, and must still serve public ones.
// Asserting only the happy path would let the private-address guard regress
// unnoticed, since the throughput relay above runs with allowPrivate: true.
const guardedRelay = await createRelayServer({
host: "127.0.0.1",
port: 0,
token: TOKEN,
allowPrivate: false,
});
const blockedTargets = ["127.0.0.1", "10.0.0.1", "169.254.169.254", "192.168.1.1", "::ffff:127.0.0.1"];
const blockedResults = [];
for (const targetHost of blockedTargets) {
let allowed = false;
try {
const tunnel = await createRelayClient({
relayHost: "127.0.0.1",
relayPort: guardedRelay.port,
targetHost,
targetPort: 9987,
token: TOKEN,
timeoutMs: 1_000,
});
tunnel.close();
allowed = true;
} catch (error) {
// The relay answers OPEN_ERR(PRIVATE_TARGET_BLOCKED); any other failure
// (timeout, bad token) would not prove the guard fired.
allowed = !(error instanceof Error && error.message === "PRIVATE_TARGET_BLOCKED");
}
blockedResults.push({ targetHost, blocked: !allowed });
}
let publicTargetAllowed = false;
try {
const tunnel = await createRelayClient({
relayHost: "127.0.0.1",
relayPort: guardedRelay.port,
targetHost: "8.8.8.8",
targetPort: 9987,
token: TOKEN,
timeoutMs: 2_000,
});
publicTargetAllowed = true;
tunnel.close();
} catch {
publicTargetAllowed = false;
}
guardedRelay.close();
const guardFailures = blockedResults.filter((entry) => !entry.blocked);
const ssrfGuardOk = guardFailures.length === 0 && publicTargetAllowed;
const sender = createSocket("udp4");
await bind(sender);
const pending = new Map();
@@ -90,7 +143,11 @@ async function run() {
console.log(`packets=${PACKET_COUNT} received=${received} loss=${loss.toFixed(2)}%`);
console.log(`rtt_ms_avg=${average.toFixed(3)} p95=${Number(percentile(0.95)).toFixed(3)} max=${Number(percentile(0.99)).toFixed(3)}`);
console.log(`bad_token_rejected=${rejectedBadToken}`);
if (received !== PACKET_COUNT || !rejectedBadToken) throw new Error("ACCELERATION_POC_FAILED");
console.log(`ssrf_guard_ok=${ssrfGuardOk} blocked=${blockedResults.filter((entry) => entry.blocked).length}/${blockedResults.length} public_target_allowed=${publicTargetAllowed}`);
for (const entry of blockedResults) {
if (!entry.blocked) console.log(` LEAK: ${entry.targetHost} was not blocked by the private-target guard`);
}
if (received !== PACKET_COUNT || !rejectedBadToken || !ssrfGuardOk) throw new Error("ACCELERATION_POC_FAILED");
console.log("ACCELERATION_POC_OK");
}
@@ -0,0 +1,110 @@
import assert from "node:assert/strict";
import test from "node:test";
import { isRestrictedAddress } from "../../src/security/open-target-policy.js";
import { isRestrictedAddress as isPocRestrictedAddress } from "./relay-server.mjs";
/**
* The acceleration PoC relay keeps its own copy of the restricted-address
* predicate because it is a standalone `.mjs` file that the README documents
* copying to a remote host without a build step, so it cannot import the
* gateway's TypeScript module. Duplication is only safe while the two stay
* identical: these cases pin both classifications to the same answer, so a
* change to either side without the other fails here instead of silently
* widening the PoC's SSRF boundary.
*
* This test lives beside the PoC because `.dockerignore` excludes
* `scripts/acceleration-poc` from the Docker build context while the Dockerfile
* runs `tsc` over `src/**`; a copy under `src/` would make the image build fail
* with TS2307.
*/
const CASES = [
// Public addresses that must stay reachable.
["8.8.8.8", false],
["1.1.1.1", false],
["172.32.0.1", false],
["100.128.0.1", false],
["2001:4860:4860::8888", false],
["2606:4700:4700::1111", false],
// Private, loopback and link-local.
["10.0.0.1", true],
["172.16.0.1", true],
["172.31.255.255", true],
["192.168.1.1", true],
["127.0.0.1", true],
["169.254.169.254", true],
["0.0.0.0", true],
["0.1.2.3", true],
// Carrier-grade NAT.
["100.64.0.1", true],
["100.127.255.255", true],
// Special-use ranges: the PoC's first implementation missed every one of these.
["192.0.0.1", true],
["192.0.2.5", true],
["198.18.0.1", true],
["198.19.5.5", true],
["198.51.100.7", true],
["203.0.113.9", true],
["224.0.0.1", true],
["239.1.1.1", true],
["255.255.255.255", true],
// IPv6 loopback, unspecified, unique-local, link-local, site-local, multicast.
["::1", true],
["::", true],
["fc00::1", true],
["fd12::1", true],
["fe80::1", true],
["fec0::1", true],
["ff02::1", true],
["2001:db8::1", true],
// IPv4-mapped forms must unwrap before the IPv4 rules apply.
["::ffff:127.0.0.1", true],
["::ffff:10.0.0.1", true],
["::ffff:8.8.8.8", false],
["0:0:0:0:0:ffff:808:808", false],
["2001:4860:0:0:0:0:0:8888", false],
["0:0:0:0:0:0:0:1", true],
["0::1", true],
["0:1234::1", true],
["0:0:0:0:0:0:0:0", true],
["::ffff:7f00:1", true],
["0::ffff:a00:1", true],
["::127.0.0.1", true],
["fe80::1%eth0", true],
["64:ff9b::808:808", true],
["64:ff9b:1:1234::1", true],
["64:ff9b:2::1", false],
["100::1", true],
["100:0:0:1::1", true],
["100:0:1::1", false],
["2001:0::1", true],
["2002:808:808::1", true],
["2001:0db8::1", true],
["2001:db9::1", false],
["3fff:fff::1", true],
["3fff:1000::1", false],
// Anything that is not a literal address fails closed.
["localhost", true],
["public.example.invalid", true],
["", true],
];
test("the acceleration PoC relay classifies restricted addresses exactly like the gateway policy", () => {
const mismatches = [];
for (const [address, expected] of CASES) {
const policy = isRestrictedAddress(address);
const poc = isPocRestrictedAddress(address);
assert.equal(policy, expected, `gateway policy disagrees with the pinned expectation for ${address}`);
if (poc !== policy) {
mismatches.push(`${address}: policy=${policy} poc=${poc}`);
}
}
assert.deepEqual(mismatches, [], "the PoC relay's restricted-address guard drifted from the gateway policy");
});
test("the acceleration PoC relay fails closed on a non-literal address", () => {
// `isIP()` returns 0 for a hostname, so the guard must not treat an
// unresolved name as public just because it is not a literal address.
for (const hostname of ["localhost", "internal.example.invalid", "attacker.example.invalid", ""]) {
assert.equal(isPocRestrictedAddress(hostname), true, `${hostname} must fail closed`);
}
});
+25
View File
@@ -0,0 +1,25 @@
import { readFile, readdir, writeFile } from 'node:fs/promises';
import path from 'node:path';
const [input, output] = process.argv.slice(2);
if (!input || !output) throw new Error('Usage: node scripts/build-plugin.mjs APPLICATION_DIR OUTPUT.wplugin');
const root=path.resolve(input),manifest=JSON.parse(await readFile(path.join(root,'manifest.json'),'utf8'));
if(manifest.apiVersion!==2||manifest.permissions!==undefined)throw new Error('Application runtime v2 manifest required');
const validPath=value=>typeof value==='string'&&value.length<=500&&value.split('/').every(s=>/^[A-Za-z0-9._@+~-]+$/.test(s)&&!['.','..'].includes(s)&&!s.endsWith('.')&&!/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(s));
const files=Object.create(null);let total=0;
async function collect(directory){
for(const entry of(await readdir(path.join(root,directory),{withFileTypes:true})).sort((a,b)=>a.name<b.name?-1:1)){
const name=directory+'/'+entry.name;if(!validPath(name)||entry.isSymbolicLink())throw new Error('Invalid package path: '+name);
if(entry.isDirectory())await collect(name);
else if(entry.isFile()){
const bytes=await readFile(path.join(root,name));total+=bytes.length;
if(bytes.length>16*1024*1024||total>32*1024*1024||Object.keys(files).length>=4096)throw new Error('Package size limit');
try{files[name]={encoding:'utf8',data:new TextDecoder('utf-8',{fatal:true}).decode(bytes)};}
catch{files[name]={encoding:'base64',data:bytes.toString('base64')};}
}else throw new Error('Only ordinary files are supported: '+name);
}
}
await collect('client');if(manifest.server)await collect('server');
if(!validPath(manifest.client?.entry)||!manifest.client.entry.startsWith('client/')||files[manifest.client.entry]?.encoding!=='utf8')throw new Error('Missing HTML client entry');
if(manifest.server&&(!validPath(manifest.server.entry)||!manifest.server.entry.startsWith('server/')||files[manifest.server.entry]?.encoding!=='utf8'))throw new Error('Missing bundled server entry');
const bytes=JSON.stringify({manifest,files});if(Buffer.byteLength(bytes)>48*1024*1024)throw new Error('Package size limit');
await writeFile(output,bytes);console.log(`${manifest.id} v${manifest.version} -> ${output}`);
+32
View File
@@ -0,0 +1,32 @@
import { copyFile, mkdir, readFile, stat } from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { spawnSync } from "node:child_process";
const repositoryRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const interpreterRoot = path.join(repositoryRoot, "web", "skin-wasm-interpreter");
const sourceArtifact = path.join(interpreterRoot, "target", "wasm32-unknown-unknown", "release", "webspeak_skin_wasm_interpreter.wasm");
const publicDirectory = path.join(repositoryRoot, "web", "public");
const publicArtifact = path.join(publicDirectory, "skin-wasm-interpreter.wasm");
const rustFlags = "-C link-arg=--max-memory=67108864 -C panic=abort";
const result = spawnSync("cargo", ["build", "--locked", "--release", "--target", "wasm32-unknown-unknown"], {
cwd: interpreterRoot,
env: { ...process.env, RUSTFLAGS: rustFlags },
stdio: "inherit",
});
if (result.error) throw result.error;
if (result.status !== 0) process.exit(result.status ?? 1);
const artifactInfo = await stat(sourceArtifact);
if (artifactInfo.size < 8 || artifactInfo.size > 8 * 1024 * 1024) {
throw new Error(`The Wasmi interpreter artifact has an unexpected size: ${artifactInfo.size} bytes.`);
}
const header = await readFile(sourceArtifact, { encoding: null, flag: "r" });
if (header[0] !== 0 || header[1] !== 0x61 || header[2] !== 0x73 || header[3] !== 0x6d) {
throw new Error("The Wasmi interpreter build did not produce a WebAssembly module.");
}
await mkdir(publicDirectory, { recursive: true });
await copyFile(sourceArtifact, publicArtifact);
console.log(`Built bounded Wasmi interpreter (${artifactInfo.size} bytes) at web/public/skin-wasm-interpreter.wasm.`);
+34
View File
@@ -0,0 +1,34 @@
import { existsSync } from "node:fs";
import http from "node:http";
import https from "node:https";
import path from "node:path";
import { fileURLToPath } from "node:url";
const scriptDirectory = path.dirname(fileURLToPath(import.meta.url));
const appRoot = path.resolve(scriptDirectory, "..");
const defaultCertDirectory = path.join(appRoot, "certs");
export function healthcheckUsesHttps(certDirectory = defaultCertDirectory) {
return existsSync(path.join(certDirectory, "cert.pem"));
}
export function runDockerHealthcheck({ mode = process.env.WEBSPEAK_MODE, certDirectory = defaultCertDirectory } = {}) {
const relayMode = mode?.trim().toLowerCase() === "relay";
const secure = !relayMode && healthcheckUsesHttps(certDirectory);
const client = secure ? https : http;
const request = client.get({
hostname: "127.0.0.1",
port: relayMode ? process.env.WEBSPEAK_VOICE_GATEWAY_PORT || 3041 : 3040,
path: "/health",
...(secure ? { rejectUnauthorized: false } : {}),
}, (response) => {
response.resume();
process.exitCode = response.statusCode >= 200 && response.statusCode < 300 ? 0 : 1;
});
request.setTimeout(4_000, () => request.destroy(new Error("Healthcheck timed out")));
request.on("error", () => { process.exitCode = 1; });
}
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
runDockerHealthcheck();
}
+16
View File
@@ -0,0 +1,16 @@
import assert from "node:assert/strict";
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import path from "node:path";
import test from "node:test";
import { healthcheckUsesHttps } from "./docker-healthcheck.mjs";
test("Docker healthcheck selects HTTP or HTTPS from the same certificate marker as the server", (context) => {
const directory = mkdtempSync(path.join(tmpdir(), "webspeak-healthcheck-"));
context.after(() => rmSync(directory, { recursive: true, force: true }));
assert.equal(healthcheckUsesHttps(directory), false);
mkdirSync(directory, { recursive: true });
writeFileSync(path.join(directory, "cert.pem"), "test certificate marker");
assert.equal(healthcheckUsesHttps(directory), true);
});
-48
View File
@@ -1,48 +0,0 @@
import { cpSync, existsSync, mkdtempSync, mkdirSync, readdirSync, readFileSync, rmSync } from "node:fs";
import { execFileSync } from "node:child_process";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import process from "node:process";
const root = process.cwd();
const sdkPackage = "@echosixhiya/teamspeak-client";
const packageJson = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
const dependency = packageJson.dependencies?.[sdkPackage];
const match = typeof dependency === "string" ? /^git\+(.+?)#(.+)$/.exec(dependency) : null;
if (!match) {
throw new Error(`${sdkPackage} must be pinned to a Git repository commit`);
}
const [, repository, commit] = match;
const temporaryRoot = mkdtempSync(join(tmpdir(), "webspeak-sdk-build-"));
const destination = join(root, "node_modules", "@echosixhiya", "teamspeak-client", "dist");
try {
execFileSync("git", ["clone", "--no-checkout", repository, temporaryRoot], { stdio: "inherit" });
execFileSync("git", ["checkout", "--detach", commit], { cwd: temporaryRoot, stdio: "inherit" });
const npmOptions = { cwd: temporaryRoot, stdio: "inherit" };
const runNpm = (args) => {
if (process.platform === "win32") {
execFileSync(process.env.ComSpec ?? "cmd.exe", ["/d", "/s", "/c", `npm.cmd ${args.join(" ")}`], npmOptions);
} else {
execFileSync("npm", args, npmOptions);
}
};
runNpm(["install", "--ignore-scripts", "--no-audit", "--no-fund"]);
runNpm(["run", "build"]);
const source = join(temporaryRoot, "dist");
if (!existsSync(join(source, "index.mjs"))) {
throw new Error(`SDK build did not produce ${join(source, "index.mjs")}`);
}
mkdirSync(dirname(destination), { recursive: true });
mkdirSync(destination, { recursive: true });
for (const entry of readdirSync(source)) {
cpSync(join(source, entry), join(destination, entry), { recursive: true, force: true });
}
console.log(`Prepared ${sdkPackage} from ${commit}`);
} finally {
rmSync(temporaryRoot, { recursive: true, force: true });
}
+209
View File
@@ -0,0 +1,209 @@
#!/usr/bin/env sh
# WebSpeak official release launcher.
#
# This file is the single source of truth for the launcher shipped in release
# packages: .github/workflows/build-release.yml copies it verbatim, and the
# self-update pre-swap installer copies the same file from the staged package.
# Keep it a plain POSIX shell script: it must be able to repair an interrupted
# code swap before Node (dist/index.js) is available at all.
set -eu
cd -- "$(dirname -- "$0")"
# Mirrors src/index.ts: a custom data directory is the only supported override.
data_dir="${WEBSPEAK_DATA_DIR:-$PWD/data}"
backups="$data_dir/updates/backups"
# Only executable code is swapped by the updater. data/, config.json, certs/,
# identities, skins and plugins are deliberately never listed here.
code_entries="dist web/dist node_modules runtime package.json package-lock.json README.md LICENSE config.example.json start-webspeak.cmd"
required_entries="dist/index.js web/dist/index.html node_modules package.json runtime/node"
code_missing() {
for entry in $required_entries; do
if [ ! -e "$entry" ]; then
return 0
fi
done
return 1
}
# A backup can only repair a missing-code install if it is complete. Partial
# backups are still resumable when they belong to the active task.
backup_is_complete() {
[ -f "$1/.webspeak-swap.json" ] || return 1
for entry in $required_entries; do
[ -e "$1/$entry" ] || return 1
done
return 0
}
# During the first phase of a swap, only some old entries have been moved.
# The rest still live at the install root. The current task can be recovered
# from that union, including a kill between rename and manifest persistence.
# Never combine a stale task's partial backup with this install.
task_backup_can_repair() {
[ -f "$1/.webspeak-swap.json" ] || return 1
for entry in $required_entries; do
if [ ! -e "$1/$entry" ] && [ ! -e "$entry" ]; then
return 1
fi
done
return 0
}
state_file="$data_dir/updates/state.json"
lock_file="$data_dir/updates/update.lock"
read_update_task() {
task_id=""
task_status=""
if [ -f "$state_file" ]; then
task_id=$(sed -n 's/.*"id"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$state_file" | head -n 1)
task_status=$(sed -n 's/.*"status"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$state_file" | head -n 1)
fi
case "$task_id" in
""|*[!A-Za-z0-9_-]*) task_id="" ;;
esac
}
read_update_task
process_start() {
# After the last ')' field 3 is first; starttime (field 22) is twentieth.
if [ -r "/proc/$1/stat" ]; then
sed 's/.*) //' "/proc/$1/stat" 2>/dev/null | awk '{print $20}'
fi
}
release_recovery_lock() {
if [ "${lock_owned:-0}" = 1 ] && [ "$(cat "$lock_file" 2>/dev/null)" = "$lock_payload" ]; then
rm -f -- "$lock_file"
fi
lock_owned=0
}
acquire_recovery_lock() {
# Share the updater's exclusive-create JSON lock. A distinct task id stops
# a delayed restart runner from taking this recovery lock over. Keep it for
# the entire restore, and only reclaim a proven-dead, unchanged owner.
mkdir -p "$data_dir/updates"
lock_owned=0
start=$(process_start "$$")
lock_payload="{\"pid\":$$,\"taskId\":\"recovery_$$\",\"createdAt\":\"\",\"processStart\":\"$start\"}"
for attempt in 1 2 3 4; do
if (umask 077; set -C; printf '%s\n' "$lock_payload" > "$lock_file") 2>/dev/null; then
lock_owned=1
trap 'release_recovery_lock' 0
trap 'exit 1' HUP INT TERM
return 0
fi
observed=$(cat "$lock_file" 2>/dev/null) || return 1
owner=$(printf '%s\n' "$observed" | sed -n 's/.*"pid"[[:space:]]*:[[:space:]]*\([0-9][0-9]*\)[[:space:]]*[,}].*/\1/p' | head -n 1)
owner_task=$(printf '%s\n' "$observed" | sed -n 's/.*"taskId"[[:space:]]*:[[:space:]]*"\([^"]\{1,\}\)".*/\1/p' | head -n 1)
case "$owner" in ""|*[!0-9]*) return 1 ;; esac
[ -n "$owner_task" ] || return 1
if [ "$owner" != 0 ]; then
if kill -0 "$owner" 2>/dev/null || [ -d "/proc/$owner" ]; then
saved_start=$(printf '%s\n' "$observed" | sed -n 's/.*"processStart"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -n 1)
current_start=$(process_start "$owner")
# Unknown markers and inaccessible processes are conservatively live.
if [ -z "$saved_start" ] || [ -z "$current_start" ] || [ "$saved_start" = "$current_start" ]; then
return 1
fi
elif [ ! -d /proc ]; then
return 1
fi
fi
[ "$(cat "$lock_file" 2>/dev/null)" = "$observed" ] || continue
rm -f -- "$lock_file" || return 1
done
return 1
}
recovery_needed() {
if code_missing; then
return 0
fi
case "$task_status" in
downloading|verifying|extracting|staging|restarting)
[ -n "$task_id" ] && [ -d "$backups/$task_id" ] && [ -f "$backups/$task_id/.webspeak-swap.json" ]
return $?
;;
esac
return 1
}
restore_from_backup() {
backup="$1"
# Move whatever partial new code the interrupted swap left in the install
# root aside, so a later restore never mistakes it for the old tree.
for entry in $code_entries; do
if [ -e "$entry" ] && [ -e "$backup/$entry" ]; then
rejected="$backup/rejected/$entry"
rejected_parent="${rejected%/*}"
mkdir -p "$rejected_parent"
if [ -e "$rejected" ]; then
rm -rf -- "$entry"
else
mv -- "$entry" "$rejected"
fi
fi
done
# Put back every complete entry recorded by the swap manifest.
for entry in $code_entries; do
if [ ! -e "$entry" ] && [ -e "$backup/$entry" ]; then
parent="${entry%/*}"
if [ "$parent" != "$entry" ]; then
mkdir -p "$parent"
fi
mv -- "$backup/$entry" "$entry"
fi
done
}
if recovery_needed; then
if ! acquire_recovery_lock; then
echo "WebSpeak update or recovery is already running, or its lock cannot be verified; refusing to change application files." >&2
exit 75
fi
# The runner may have completed between the first state read and the lock.
read_update_task
fi
if [ "${lock_owned:-0}" = 1 ] && recovery_needed; then
restore_backup=""
# The interrupted task is the source of truth. Its backup may be partial
# while the old tree is being saved or while a previous recovery is still
# consuming it, but it must never be replaced by an older complete backup.
if [ -n "$task_id" ] && [ -d "$backups/$task_id" ]; then
candidate="$backups/$task_id"
if task_backup_can_repair "$candidate"; then
restore_backup="$candidate"
fi
else
# No current task backup (e.g. state.json was lost): use the most recently
# modified complete backup rather than whichever name happens to sort first.
for manifest in "$backups"/*/.webspeak-swap.json; do
[ -f "$manifest" ] || continue
backup="${manifest%/.webspeak-swap.json}"
backup_is_complete "$backup" || continue
if [ -z "$restore_backup" ] || [ "$backup" -nt "$restore_backup" ]; then
restore_backup="$backup"
fi
done
fi
if [ -z "$restore_backup" ]; then
echo "WebSpeak update was interrupted and automatic recovery from $backups failed." >&2
exit 1
fi
restore_from_backup "$restore_backup"
if code_missing; then
echo "WebSpeak update was interrupted and automatic recovery from $restore_backup failed." >&2
exit 1
fi
fi
release_recovery_lock
exec "$PWD/runtime/node" "$PWD/dist/index.js"
+6
View File
@@ -0,0 +1,6 @@
export class AdminInputError extends Error {
constructor(readonly code: string, message: string) {
super(message);
this.name = "AdminInputError";
}
}
+208 -29
View File
@@ -1,12 +1,18 @@
import { Router, raw as expressRaw, type NextFunction, type Request, type Response } from "express";
import { existsSync, readFileSync } from "node:fs";
import type { Logger } from "../logger.js";
import { AdminInputError, AdminService, type AdminSettingsInput, type RelayNodeInput } from "./admin-service.js";
import { AdminInputError, AdminService, type AdminSettingsInput, type RelayNodeInput, type TsAdminSettingsInput } from "./admin-service.js";
import { AdminSessionStore, isSecureRequest } from "./admin-session.js";
import { AdminLoginRateLimiter, waitFor } from "./login-rate-limit.js";
import { TeamSpeakProbeError } from "../server/teamspeak-probe.js";
import type { AdminSessionSummary } from "../server/voice-bridge.js";
import { SkinRegistry, SkinRegistryError } from "./skin-registry.js";
import { SkinStore } from "./skin-store.js";
import { createPluginAdminRouter } from "../plugins/admin-router.js";
import type { PluginRegistry } from "../plugins/registry.js";
import type { PluginStore } from "../plugins/store.js";
import type { PluginRuntime } from "../plugins/runtime.js";
import { UpdateError, type UpdateService } from "../updater/update-service.js";
export interface AdminConnectionRecord {
id: string;
@@ -36,13 +42,36 @@ export interface AdminRouterOptions {
version?: string;
logFile?: string;
skinRegistry?: SkinRegistry;
skinStore?: SkinStore;
pluginRegistry?: PluginRegistry;
pluginStore?: PluginStore;
pluginRuntime?: PluginRuntime;
updateService?: UpdateService;
/** Stops the current process after the update response has been flushed. */
restartAfterUpdate?: () => void;
startedAt: number;
clientIp?: (request: Request) => string;
}
export function createAdminRouter(options: AdminRouterOptions): Router {
const router = Router();
const limiter = new AdminLoginRateLimiter();
const logger = options.logger.child({ component: "admin-api" });
const skinStore = options.skinStore ?? new SkinStore(options.version ?? "0.0.0");
// Include uploads, enable/default changes and deletion in the same queue as store installs.
let skinMutation: Promise<unknown> = Promise.resolve();
function mutateSkins<T>(run: () => Promise<T>): Promise<T> {
const next = skinMutation.then(run, run);
skinMutation = next.catch(() => undefined);
return next;
}
function sendStoreError(response: Response, error: unknown) {
if (error instanceof SkinRegistryError) {
const status = error.code === "SKIN_STORE_UNAVAILABLE" ? 502 : error.code === "SKIN_STORE_NOT_FOUND" ? 404
: ["SKIN_STORE_CHANGED", "SKIN_STORE_INSTALLED_CHANGED", "SKIN_STORE_NOT_NEWER", "SKIN_STORE_INCOMPATIBLE"].includes(error.code) ? 409 : 400;
response.status(status).json({ ok: false, code: error.code });
} else sendAdminError(response, error);
}
router.use((_request, response, next) => {
response.setHeader("Cache-Control", "no-store");
@@ -68,25 +97,29 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
response.status(409).json({ ok: false, code: "NOT_INITIALIZED" });
return;
}
const peer = request.socket.remoteAddress ?? "unknown";
const retryAfterMs = limiter.retryAfterMs(peer);
if (retryAfterMs > 0) {
response.setHeader("Retry-After", String(Math.ceil(retryAfterMs / 1000)));
response.status(429).json({ ok: false, code: "RATE_LIMITED", retryAfterMs });
return;
}
const peer = options.clientIp?.(request) ?? request.socket.remoteAddress ?? "unknown";
const body = asRecord(request.body);
const username = readString(body, "username", 64).trim();
const password = readOptionalString(body, "password", 1024);
if (!await options.service.verifyPassword(username, password)) {
const delayMs = limiter.recordFailure(peer);
const reservation = limiter.reserve(peer);
if (!reservation.allowed) {
response.setHeader("Retry-After", String(Math.ceil(reservation.retryAfterMs / 1000)));
response.status(429).json({ ok: false, code: "RATE_LIMITED", retryAfterMs: reservation.retryAfterMs });
return;
}
const revision = options.service.credentialRevision;
let verified: boolean;
try { verified = await options.service.verifyPassword(username, password); }
catch (error) { reservation.finish("cancelled"); sendAdminError(response, error); return; }
if (!verified || revision !== options.service.credentialRevision) {
const delayMs = reservation.finish("failure");
await waitFor(delayMs);
options.service.database.addAudit("ADMIN_LOGIN_FAILED");
logger.warn("Administrator login failed");
response.status(401).json({ ok: false, code: "INVALID_PASSWORD" });
return;
}
limiter.recordSuccess(peer);
reservation.finish("success");
options.service.database.addAudit("ADMIN_LOGIN_SUCCEEDED");
const session = options.sessions.create(response, isSecureRequest(request));
response.json({ ok: true, csrfToken: session.csrfToken, expiresAt: session.expiresAt, mustChangePassword: options.service.isPasswordChangeRequired() });
@@ -96,6 +129,7 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
try {
const body = asRecord(request.body);
await options.service.changePassword(readString(body, "newPassword", 1024));
options.sessions.revokeOthers(request);
response.json({ ok: true, mustChangePassword: false });
} catch (error: unknown) {
sendAdminError(response, error);
@@ -109,6 +143,10 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
});
router.use(requireAdmin(options.sessions, options.service));
router.use("/plugins", createPluginAdminRouter({ registry: options.pluginRegistry, store: options.pluginStore, runtime: options.pluginRuntime,
protect: [requireSameOrigin, requireCsrf(options.sessions)],
audit: (event, data) => options.service.database.addAudit(event, data),
}));
router.get("/overview", (_request, response) => {
response.json(options.service.getOverview(
@@ -122,6 +160,32 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
response.json(options.service.getAdminSettings());
});
router.get("/ts-admin/settings", (_request, response) => {
response.json(options.service.getTsAdminSettings());
});
router.put("/ts-admin/settings", requireSameOrigin, requireCsrf(options.sessions), (request, response) => {
try {
options.service.saveTsAdminSettings(readTsAdminSettingsInput(asRecord(request.body)));
response.json({ ok: true, settings: options.service.getTsAdminSettings() });
} catch (error: unknown) {
sendAdminError(response, error);
}
});
router.post("/ts-admin/overview", requireSameOrigin, requireCsrf(options.sessions), async (_request, response) => {
try {
response.json(await options.service.getTsAdminOverview());
} catch (error: unknown) {
sendAdminError(response, error);
}
});
router.post("/ts-admin/action", requireSameOrigin, requireCsrf(options.sessions), async (request, response) => {
try { response.json(await options.service.runTsAdminAction(request.body)); }
catch (error: unknown) { sendAdminError(response, error); }
});
router.get("/skins", async (_request, response) => {
response.json({
skins: await options.skinRegistry?.list() ?? [],
@@ -129,11 +193,32 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
});
});
router.get("/skin-store", async (_request, response) => {
try { response.json(await skinStore.list()); }
catch (error) { sendStoreError(response, error); }
});
router.post("/skin-store/refresh", requireSameOrigin, requireCsrf(options.sessions), async (_request, response) => {
try { response.json(await skinStore.list(true)); }
catch (error) { sendStoreError(response, error); }
});
router.post("/skin-store/install", requireSameOrigin, requireCsrf(options.sessions), async (request, response) => {
try {
if (!options.skinRegistry) throw new SkinRegistryError("Skin storage is unavailable.", "SKIN_STORAGE_UNAVAILABLE");
const registry = options.skinRegistry;
const skin = await mutateSkins(() => skinStore.install(registry, request.body));
options.service.database.addAudit("ADMIN_SKIN_INSTALLED", { id: skin.id, version: skin.version, source: "github-store" });
response.status(201).json({ ok: true, skin });
} catch (error) { sendStoreError(response, error); }
});
router.put("/skins/default", requireSameOrigin, requireCsrf(options.sessions), async (request, response) => {
try {
if (!options.skinRegistry) throw new SkinRegistryError("Skin storage is unavailable.", "SKIN_STORAGE_UNAVAILABLE");
const id = typeof asRecord(request.body).id === "string" ? (asRecord(request.body).id as string).trim() : "";
const settings = await options.skinRegistry.setDefaultSkin(id);
const registry = options.skinRegistry;
const settings = await mutateSkins(() => registry.setDefaultSkin(id));
response.json({ ok: true, defaultSkinId: settings.defaultSkinId });
} catch (error: unknown) {
if (error instanceof SkinRegistryError) {
@@ -149,7 +234,8 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
const id = typeof request.params.id === "string" ? request.params.id : "";
const body = asRecord(request.body);
if (!options.skinRegistry || typeof body.enabled !== "boolean") throw new SkinRegistryError("A skin and boolean enabled value are required.", "SKIN_ENABLE_INVALID");
const skin = await options.skinRegistry.setEnabled(id, body.enabled);
const registry = options.skinRegistry, enabled = body.enabled;
const skin = await mutateSkins(() => registry.setEnabled(id, enabled));
options.service.database.addAudit(body.enabled ? "ADMIN_SKIN_ENABLED" : "ADMIN_SKIN_DISABLED", { id });
response.json({ ok: true, skin, defaultSkinId: await options.skinRegistry.getDefaultSkinId() });
} catch (error: unknown) {
@@ -166,7 +252,8 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
try {
const id = typeof request.params.id === "string" ? request.params.id : "";
if (!options.skinRegistry || !Buffer.isBuffer(request.body)) throw new SkinRegistryError("Skin storage is unavailable.", "SKIN_STORAGE_UNAVAILABLE");
const skin = await options.skinRegistry.save(request.body, id);
const registry = options.skinRegistry, bytes = request.body;
const skin = await mutateSkins(() => registry.save(bytes, id));
options.service.database.addAudit("ADMIN_SKIN_INSTALLED", { id: skin.id, version: skin.version });
response.status(201).json({ ok: true, skin });
} catch (error: unknown) {
@@ -182,7 +269,8 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
router.delete("/skins/:id", requireSameOrigin, requireCsrf(options.sessions), async (request, response) => {
const id = typeof request.params.id === "string" ? request.params.id : "";
try {
if (!options.skinRegistry || !await options.skinRegistry.remove(id)) {
const registry = options.skinRegistry;
if (!registry || !await mutateSkins(() => registry.remove(id))) {
response.status(404).json({ ok: false, code: "SKIN_NOT_FOUND" });
return;
}
@@ -261,7 +349,7 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
options.getActiveSessions(),
options.getPeakSessions(),
options.startedAt,
) as unknown as AdminOverview;
);
response.json({
generatedAt: new Date().toISOString(),
gateway: {
@@ -288,7 +376,7 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
options.getActiveSessions(),
options.getPeakSessions(),
options.startedAt,
) as unknown as AdminOverview;
);
const report = {
generatedAt: new Date().toISOString(),
gateway: {
@@ -330,6 +418,63 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
}
});
router.get("/update", (_request, response) => {
if (!options.updateService) {
response.json({
currentVersion: options.version ?? "0.0.0",
deployment: {
mode: "source",
platform: process.platform,
architecture: process.arch,
applyAllowed: false,
reasonCode: "UPDATE_UNAVAILABLE",
upgradePath: "source",
},
task: null,
});
return;
}
response.json(options.updateService.getStatus());
});
router.post("/update/check", requireSameOrigin, requireCsrf(options.sessions), async (_request, response) => {
if (!options.updateService) {
response.status(503).json({ ok: false, code: "UPDATE_UNAVAILABLE" });
return;
}
try {
response.json(await options.updateService.checkForUpdates());
} catch (error: unknown) {
sendUpdateError(response, error);
}
});
router.post("/update/apply", requireSameOrigin, requireCsrf(options.sessions), async (request, response) => {
if (!options.updateService) {
response.status(503).json({ ok: false, code: "UPDATE_UNAVAILABLE" });
return;
}
if (!options.restartAfterUpdate) {
response.status(503).json({ ok: false, code: "UPDATE_RESTART_UNAVAILABLE" });
return;
}
try {
const body = asRecord(request.body);
const version = readString(body, "version", 32);
const confirmVersion = readString(body, "confirmVersion", 32);
if (version !== confirmVersion) throw new UpdateError("UPDATE_CONFIRMATION_REQUIRED", "The confirmation does not match the selected version.");
const task = await options.updateService.applyUpdate(version, confirmVersion);
options.service.database.addAudit("ADMIN_UPDATE_STARTED", { version });
response.status(202).json({ ok: true, task });
// Do not wait for the response to finish: a reverse proxy or a client
// that disconnects early must not leave the restart runner waiting for
// this process until its timeout expires.
setTimeout(() => options.restartAfterUpdate?.(), 250).unref();
} catch (error: unknown) {
sendUpdateError(response, error);
}
});
router.put("/server", requireSameOrigin, requireCsrf(options.sessions), (request, response) => {
try {
options.service.updateSettings(readSettingsInput(asRecord(request.body)));
@@ -446,6 +591,7 @@ function readSettingsInput(body: Record<string, unknown>): AdminSettingsInput {
id: typeof node.id === "string" ? node.id.slice(0, 110) : undefined,
name: typeof node.name === "string" ? node.name.slice(0, 80) : "",
target: typeof node.target === "string" ? node.target.slice(0, 300) : "",
voiceEndpoint: typeof node.voiceEndpoint === "string" ? node.voiceEndpoint.slice(0, 300) : undefined,
enabled: node.enabled === true,
token: typeof node.token === "string" ? node.token.slice(0, 512) : undefined,
tokenAction: readPasswordAction(node.tokenAction),
@@ -464,8 +610,18 @@ function readSettingsInput(body: Record<string, unknown>): AdminSettingsInput {
welcomeTextRu: typeof body.welcomeTextRu === "string" ? body.welcomeTextRu.slice(0, 500) : undefined,
welcomeTextJa: typeof body.welcomeTextJa === "string" ? body.welcomeTextJa.slice(0, 500) : undefined,
webRtcEnabled: body.webRtcEnabled === true,
webRtcPublicHost: body.webRtcPublicHost as string | undefined,
webRtcIpv6Enabled: body.webRtcIpv6Enabled as boolean | undefined,
webRtcStunServer: body.webRtcStunServer as string | undefined,
webRtcUdpStart: readOptionalInteger(body, "webRtcUdpStart"),
webRtcUdpEnd: readOptionalInteger(body, "webRtcUdpEnd"),
voiceProfile: body.voiceProfile as AdminSettingsInput["voiceProfile"],
voiceTurnUrls: typeof body.voiceTurnUrls === "string" ? body.voiceTurnUrls.slice(0, 4096) : undefined,
voiceTurnSecret: typeof body.voiceTurnSecret === "string" ? body.voiceTurnSecret.slice(0, 512) : undefined,
voiceTurnSecretAction: readPasswordAction(body.voiceTurnSecretAction),
voiceTurnTtlSeconds: readOptionalInteger(body, "voiceTurnTtlSeconds"),
voiceOpusWs: typeof body.voiceOpusWs === "boolean" ? body.voiceOpusWs : undefined,
voiceJitterMaxMs: readOptionalInteger(body, "voiceJitterMaxMs"),
relaySettingsAction: readRelaySettingsAction(body.relaySettingsAction),
relayEnabled: body.relayEnabled === true,
relayName: typeof body.relayName === "string" ? body.relayName.slice(0, 80) : undefined,
@@ -476,6 +632,28 @@ function readSettingsInput(body: Record<string, unknown>): AdminSettingsInput {
};
}
function readTsAdminSettingsInput(body: Record<string, unknown>): TsAdminSettingsInput {
if (typeof body.enabled !== "boolean") throw new AdminInputError("INVALID_TS_ADMIN_SETTINGS", "Expected enabled flag");
if (body.transport !== undefined && !["web", "ssh", "tcp"].includes(String(body.transport))) throw new AdminInputError("INVALID_TS_ADMIN_SETTINGS", "Invalid transport");
for (const key of ["apiKeyAction", "passwordAction"]) {
if (body[key] !== undefined && !["keep", "replace", "remove"].includes(String(body[key]))) throw new AdminInputError("INVALID_TS_ADMIN_SETTINGS", "Invalid credential action");
}
return {
enabled: body.enabled === true,
transport: body.transport as TsAdminSettingsInput["transport"],
queryHost: body.queryHost === undefined ? undefined : readString(body, "queryHost", 253),
webQueryUrl: body.webQueryUrl === undefined ? undefined : readString(body, "webQueryUrl", 2048),
apiKey: body.apiKey === undefined ? undefined : readString(body, "apiKey", 4096),
apiKeyAction: readPasswordAction(body.apiKeyAction),
serverId: body.serverId === undefined ? undefined : readOptionalNumber(body, "serverId", 0),
queryPort: readOptionalNumber(body, "queryPort", 10022),
username: readOptionalString(body, "username", 128),
password: readOptionalString(body, "password", 1024),
passwordAction: readPasswordAction(body.passwordAction),
hostKeyFingerprint: readOptionalString(body, "hostKeyFingerprint", 128),
};
}
function readRelaySettingsAction(value: unknown): "keep" | "replace" | "remove" {
return value === "replace" || value === "remove" ? value : "keep";
}
@@ -688,17 +866,6 @@ function readStructuredLogs(logFile: string): StructuredLogEntry[] {
return entries.sort((left, right) => Date.parse(left.timestamp ?? "") - Date.parse(right.timestamp ?? ""));
}
interface AdminOverview {
gateway: { uptimeSeconds: number };
teamSpeak: {
target: string;
status: string;
lastTestAt: string | null;
latencyMs: number | null;
lastError: string | null;
};
}
function logLevelName(level: unknown): string {
if (level === 10) return "DEBUG";
if (level === 30) return "INFO";
@@ -710,8 +877,20 @@ function logLevelName(level: unknown): string {
function sendAdminError(response: Response, error: unknown): void {
if (error instanceof AdminInputError) {
response.status(400).json({ ok: false, code: error.code });
response.status(error.code === "AUTH_REQUIRED" ? 401 : 400).json({ ok: false, code: error.code });
return;
}
response.status(500).json({ ok: false, code: "INTERNAL_ERROR" });
}
function sendUpdateError(response: Response, error: unknown): void {
if (error instanceof UpdateError) {
response.status(error.statusCode).json({ ok: false, code: error.code, message: error.message });
return;
}
if (error instanceof AdminInputError) {
response.status(400).json({ ok: false, code: error.code });
return;
}
response.status(500).json({ ok: false, code: "UPDATE_FAILED" });
}
+248 -67
View File
@@ -1,62 +1,37 @@
import { WorkspaceInvites, type WorkspaceInviteCredentials } from "../server/workspace-invites.js";
import type { AdminSettingsInput, RelayNodeInput, ManagedInviteInput, TsAdminSettingsInput } from "../shared/admin-inputs.js";
export type { AdminSettingsInput, RelayNodeInput, ManagedInviteInput, TsAdminSettingsInput } from "../shared/admin-inputs.js";
import type { AdminOverview, AdminSettings } from "../shared/admin-responses.js";
import { createHash, randomBytes } from "node:crypto";
import { existsSync } from "node:fs";
import { isIP } from "node:net";
import type { Logger } from "../logger.js";
import { loadConfig } from "../config.js";
import { formatTeamSpeakTarget, parseTeamSpeakTarget, type TeamSpeakTarget } from "../domain/teamspeak-target.js";
import { DEFAULT_TEAM_SPEAK_PORT, formatTeamSpeakTarget, parseTeamSpeakTarget, type TeamSpeakTarget } from "../domain/teamspeak-target.js";
import { formatTeamSpeakConnectionTarget, parseTeamSpeakConnectionTarget, type TeamSpeakConnectionTarget } from "../domain/teamspeak-connection-target.js";
import { resolveTeamSpeakTarget, TeamSpeakAliasLookupError } from "../server/teamspeak-alias.js";
import { type AccessMode, type ManagedInviteRecord, type PersistedRelayNode, type SettingsUpdate, WebSpeakDatabase } from "../persistence/database.js";
import { hashAdminPassword, validateAdminPassword, verifyAdminPassword } from "../security/admin-password.js";
import { decryptSecret, encryptSecret } from "../security/secret-crypto.js";
import { probeTeamSpeak, TeamSpeakProbeError } from "../server/teamspeak-probe.js";
import { pingTeamSpeakHost } from "../server/network-probe.js";
import { normalizeVoiceMediaHost, normalizeVoiceStunServer, normalizeVoiceTurnRestUrls, VOICE_JITTER_MAX_MS, VOICE_JITTER_MIN_MS, VOICE_TURN_MIN_SECRET_LENGTH, VOICE_TURN_TTL_DEFAULT_SECONDS, VOICE_TURN_TTL_MAX_SECONDS, VOICE_TURN_TTL_MIN_SECONDS } from "../shared/voice-ice.js";
import type { WebRtcAudioOptions } from "../server/webrtc-audio.js";
import { DEFAULT_VOICE_ICE_CONFIG, type VoiceIceConfig } from "../server/voice-ice-config.js";
import { isVoiceProfileSetting } from "../shared/voice-profile.js";
import { DEFAULT_ACCELERATION_RELAY_PORT, type ConfiguredAccelerationRelay } from "../server/acceleration-relay.js";
import { DEFAULT_WEBRTC_UDP_PORT_RANGE, WEBRTC_UDP_PORT_MAX, WEBRTC_UDP_PORT_MIN } from "../server/webrtc-config.js";
import { DEFAULT_WELCOME_TEXTS, resolveWelcomeTexts } from "../site-copy.js";
export interface AdminSettingsInput {
target: string;
serverPassword?: string;
passwordAction?: "keep" | "replace" | "remove";
accessMode: AccessMode;
siteName: string;
welcomeText: string;
welcomeTextEn?: string;
welcomeTextDe?: string;
welcomeTextRu?: string;
welcomeTextJa?: string;
webRtcEnabled: boolean;
webRtcUdpStart?: number;
webRtcUdpEnd?: number;
relaySettingsAction?: "keep" | "replace" | "remove";
relayEnabled?: boolean;
relayName?: string;
relayTarget?: string;
relayToken?: string;
relayTokenAction?: "keep" | "replace" | "remove";
relayNodes?: RelayNodeInput[];
}
export interface RelayNodeInput {
id?: string;
name: string;
target: string;
enabled: boolean;
token?: string;
tokenAction?: "keep" | "replace" | "remove";
}
import { TsAdminService, type TsAdminQueryClientFactory } from "./ts-admin-service.js";
import { AdminInputError } from "./admin-errors.js";
export { AdminInputError } from "./admin-errors.js";
export interface ConnectionPolicy {
defaultTarget: TeamSpeakTarget;
defaultTarget: string;
serverPassword: string;
accessMode: AccessMode;
}
export interface ManagedInviteInput {
channel: string;
expiresInHours: number;
maxUses: number;
}
export interface ManagedInviteView {
id: string;
target: string;
@@ -70,8 +45,12 @@ export interface ManagedInviteView {
}
type ProbeFunction = typeof probeTeamSpeak;
const VOICE_TURN_SECRET_PURPOSE = "webspeak:voice-turn-rest-secret:v1";
export class AdminService {
private readonly tsAdmin: TsAdminService;
private revision = 0;
get credentialRevision(): number { return this.revision; }
constructor(
readonly database: WebSpeakDatabase,
private readonly masterSecret: Buffer,
@@ -79,7 +58,15 @@ export class AdminService {
private readonly legacyConfigPath: string,
private readonly probe: ProbeFunction = probeTeamSpeak,
private readonly version = "0.1.0",
) {}
tsAdminClientFactory?: TsAdminQueryClientFactory,
/** Environment baseline; console values override it without requiring a restart. */
private readonly voiceIceDefaults: VoiceIceConfig = DEFAULT_VOICE_ICE_CONFIG,
) {
this.tsAdmin = new TsAdminService(database, masterSecret, logger, () => {
const settings = database.getSettings();
return { mode: settings.accessMode, target: settings.tsTarget || formatTeamSpeakTarget({ host: settings.tsHost, port: settings.tsPort }) };
}, tsAdminClientFactory);
}
async initialize(): Promise<void> {
this.importLegacyConfigOnce();
@@ -95,8 +82,9 @@ export class AdminService {
}
async verifyPassword(username: string, password: string): Promise<boolean> {
const revision = this.revision;
const credential = this.database.getAdminCredential();
return credential?.username === username && await verifyAdminPassword(password, credential);
return credential?.username === username && await verifyAdminPassword(password, credential) && revision === this.revision;
}
isPasswordChangeRequired(): boolean {
@@ -104,12 +92,15 @@ export class AdminService {
}
async changePassword(password: string): Promise<void> {
const revision = this.revision;
const credential = this.database.getAdminCredential();
if (!credential) throw new AdminInputError("NOT_INITIALIZED", "The administrator account is not initialized");
const passwordError = validateAdminPassword(password);
if (passwordError) throw new AdminInputError("INVALID_ADMIN_PASSWORD", passwordError);
const replacement = await hashAdminPassword(password, { username: credential.username, mustChangePassword: false });
if (revision !== this.revision) throw new AdminInputError("AUTH_REQUIRED", "Administrator credentials changed during the request");
this.database.updateAdminCredential(replacement);
this.revision++;
this.database.addAudit("ADMIN_PASSWORD_CHANGED");
}
@@ -132,14 +123,15 @@ export class AdminService {
welcomeTextEn: welcomeTexts.en,
welcomeTexts,
accessMode: settings.accessMode,
target: formatTeamSpeakTarget({ host: settings.tsHost, port: settings.tsPort }),
target: settingsTarget(settings),
};
}
getAdminSettings(): Record<string, unknown> {
getAdminSettings(): AdminSettings {
const settings = this.database.getSettings();
const turn = this.resolveVoiceTurnSettings(settings);
return {
target: formatTeamSpeakTarget({ host: settings.tsHost, port: settings.tsPort }),
target: settingsTarget(settings),
hasPassword: Boolean(settings.tsPasswordEncrypted),
accessMode: settings.accessMode,
siteName: settings.siteName,
@@ -153,8 +145,17 @@ export class AdminService {
lastTestLatencyMs: settings.lastTestLatencyMs,
lastTestError: settings.lastTestError,
webRtcEnabled: settings.webRtcEnabled,
webRtcPublicHost: settings.webRtcPublicHost,
webRtcIpv6Enabled: settings.webRtcIpv6Enabled,
webRtcStunServer: settings.webRtcStunServer,
webRtcUdpStart: settings.webRtcUdpStart,
webRtcUdpEnd: settings.webRtcUdpEnd,
voiceProfile: settings.voiceProfile ?? this.voiceIceDefaults.profile,
voiceTurnUrls: turn.urls.join("\n"),
hasVoiceTurnSecret: turn.secret.length > 0,
voiceTurnTtlSeconds: turn.ttlSeconds,
voiceOpusWs: settings.voiceOpusWs ?? this.voiceIceDefaults.opusWebSocket,
voiceJitterMaxMs: settings.voiceJitterMaxMs ?? this.voiceIceDefaults.jitterMaxMs,
relayConfigured: settings.relayConfigured,
relayEnabled: settings.relayEnabled,
relayName: settings.relayName,
@@ -170,17 +171,57 @@ export class AdminService {
const settings = this.database.getSettings();
return {
enabled: settings.webRtcEnabled,
publicHost: settings.webRtcPublicHost,
ipv6Enabled: settings.webRtcIpv6Enabled,
stunServer: settings.webRtcStunServer,
udpPortRange: [settings.webRtcUdpStart, settings.webRtcUdpEnd],
};
}
/** Resolve environment defaults plus console overrides for every new voice connection. */
getVoiceIceConfig(): VoiceIceConfig {
const settings = this.database.getSettings();
const turn = this.resolveVoiceTurnSettings(settings);
const turnRest = turn.urls.length > 0 && turn.secret.length >= VOICE_TURN_MIN_SECRET_LENGTH
? { urls: turn.urls, secret: turn.secret, ttlSeconds: turn.ttlSeconds }
: undefined;
return {
servers: [...this.voiceIceDefaults.servers],
...(turnRest ? { turnRest } : {}),
transportPolicy: this.voiceIceDefaults.transportPolicy,
gatewayTransportPolicy: this.voiceIceDefaults.gatewayTransportPolicy,
profile: settings.voiceProfile ?? this.voiceIceDefaults.profile,
opusWebSocket: settings.voiceOpusWs ?? this.voiceIceDefaults.opusWebSocket,
jitterMaxMs: settings.voiceJitterMaxMs ?? this.voiceIceDefaults.jitterMaxMs,
};
}
private resolveVoiceTurnSettings(settings: ReturnType<WebSpeakDatabase["getSettings"]>): { urls: string[]; secret: string; ttlSeconds: number } {
const baseline = this.voiceIceDefaults.turnRest;
const urls = settings.voiceTurnUrls === null
? baseline?.urls ?? []
: normalizeVoiceTurnRestUrls(settings.voiceTurnUrls) ?? [];
const ttlSeconds = settings.voiceTurnTtlSeconds ?? baseline?.ttlSeconds ?? VOICE_TURN_TTL_DEFAULT_SECONDS;
let secret = "";
if (settings.voiceTurnSecretEncrypted === null) {
secret = baseline?.secret ?? "";
} else if (settings.voiceTurnSecretEncrypted !== "") {
try {
secret = decryptSecret(settings.voiceTurnSecretEncrypted, this.masterSecret, VOICE_TURN_SECRET_PURPOSE);
} catch (error: unknown) {
this.logger.error({ err: error instanceof Error ? error.message : String(error) }, "Stored TURN shared secret could not be decrypted");
}
}
return { urls, secret, ttlSeconds };
}
getAccelerationRelayOptions(): ConfiguredAccelerationRelay[] {
const relays: ConfiguredAccelerationRelay[] = [];
for (const node of this.database.listRelayNodes()) {
if (!node.enabled || !node.host || !node.tokenEncrypted) continue;
try {
const token = decryptSecret(node.tokenEncrypted, this.masterSecret);
relays.push({ id: node.id, name: node.name, relayHost: node.host, relayPort: node.port, token });
relays.push({ id: node.id, name: node.name, relayHost: node.host, relayPort: node.port, token, voiceEndpoint: node.voiceEndpoint || defaultRelayVoiceEndpoint(node.host) });
} catch (error: unknown) {
this.logger.error({ err: error instanceof Error ? error.message : String(error), relayId: node.id }, "Stored acceleration relay token could not be decrypted");
}
@@ -196,8 +237,12 @@ export class AdminService {
const current = this.database.getSettings();
const relayNodes = input.relayNodes === undefined ? undefined : this.normalizeRelayNodes(input.relayNodes);
const settings = this.normalizeSettings(input, current, relayNodes);
const targetChanged = current.tsHost !== settings.tsHost || current.tsPort !== settings.tsPort;
const targetChanged = current.tsHost !== settings.tsHost || current.tsPort !== settings.tsPort || current.tsTarget !== settings.tsTarget;
this.database.updateSettings(settings);
if (settings.accessMode === "open") {
const tsAdmin = this.database.getTsAdminSettings();
if (tsAdmin.enabled) this.database.updateTsAdminSettings({ ...tsAdmin, enabled: false });
}
if (relayNodes !== undefined) {
this.database.replaceRelayNodes(relayNodes);
} else if (input.relaySettingsAction && input.relaySettingsAction !== "keep") {
@@ -215,7 +260,7 @@ export class AdminService {
this.logger.error({ err: error instanceof Error ? error.message : String(error) }, "Stored TeamSpeak password could not be decrypted");
}
return {
defaultTarget: { host: settings.tsHost, port: settings.tsPort },
defaultTarget: settingsTarget(settings),
serverPassword,
accessMode: settings.accessMode,
};
@@ -224,11 +269,12 @@ export class AdminService {
async testConnection(targetText: string, password: string, persistResult: boolean): Promise<{ ok: boolean; checkType: "network" | "protocol"; passwordVerified: boolean; latencyMs: number; serverName: string | null; requiresPassword: boolean; packetLossPercent?: number; attempts?: number; successfulAttempts?: number; errorCode?: string }> {
let target: TeamSpeakTarget;
try {
target = parseTeamSpeakTarget(targetText);
parseTeamSpeakConnectionTarget(targetText);
} catch {
throw new AdminInputError("INVALID_TARGET", "TeamSpeak target is invalid");
}
try {
target = await resolveTeamSpeakTarget(targetText);
// The admin connection test must not create a temporary TeamSpeak
// client: that client becomes visible in the target channel. Use the
// WebSpeak host's ICMP route measurement instead. The injected probe is
@@ -267,7 +313,9 @@ export class AdminService {
} catch (error: unknown) {
const probeError = error instanceof TeamSpeakProbeError
? error
: new TeamSpeakProbeError("INTERNAL_ERROR", "Connection test failed", error);
: error instanceof TeamSpeakAliasLookupError
? new TeamSpeakProbeError("HOST_NOT_FOUND", "TeamSpeak server nickname could not be resolved", error)
: new TeamSpeakProbeError("INTERNAL_ERROR", "Connection test failed", error);
if (persistResult) {
this.database.recordConnectionTest({ protocol: null, latencyMs: null, error: probeError.code });
this.database.addAudit("CONNECTION_TEST_FAILED", { code: probeError.code });
@@ -276,7 +324,7 @@ export class AdminService {
}
}
getOverview(activeSessions: number, peakSessions: number, startedAt: number): Record<string, unknown> {
getOverview(activeSessions: number, peakSessions: number, startedAt: number): AdminOverview {
const settings = this.database.getSettings();
return {
gateway: {
@@ -285,7 +333,7 @@ export class AdminService {
uptimeSeconds: Math.max(0, Math.floor((Date.now() - startedAt) / 1000)),
},
teamSpeak: {
target: formatTeamSpeakTarget({ host: settings.tsHost, port: settings.tsPort }),
target: settingsTarget(settings),
status: settings.lastTestError ? "unreachable" : settings.lastTestAt ? "reachable" : "unknown",
lastTestAt: settings.lastTestAt,
latencyMs: settings.lastTestLatencyMs,
@@ -297,6 +345,14 @@ export class AdminService {
};
}
createWorkspaceInvite(credentials: WorkspaceInviteCredentials, expiresInMinutes: number, now = Date.now()) {
return new WorkspaceInvites(this.database, this.masterSecret).create(credentials, expiresInMinutes, now);
}
getWorkspaceInvite(token: string, now = Date.now()) {
return new WorkspaceInvites(this.database, this.masterSecret).get(token, now);
}
createManagedInvite(input: ManagedInviteInput): { invite: ManagedInviteView; token: string } {
const channel = input.channel.trim();
if (channel.length > 100) throw new AdminInputError("INVALID_INVITE_CHANNEL", "Invite channel cannot exceed 100 characters");
@@ -313,6 +369,7 @@ export class AdminService {
tokenHash: hashInviteToken(token),
targetHost: settings.tsHost,
targetPort: settings.tsPort,
targetText: settings.tsTarget,
serverPasswordEncrypted: settings.tsPasswordEncrypted,
channel,
expiresAt: new Date(Date.now() + input.expiresInHours * 60 * 60 * 1000).toISOString(),
@@ -333,7 +390,22 @@ export class AdminService {
return revoked;
}
consumeManagedInvite(token: string): { target: TeamSpeakTarget; serverPassword: string; channel: string } | null {
getTsAdminSettings() { return this.tsAdmin.settings(); }
saveTsAdminSettings(input: TsAdminSettingsInput): void { this.tsAdmin.save(input); }
getTsAdminOverview() { return this.tsAdmin.overview(); }
runTsAdminAction(input: unknown) { return this.tsAdmin.action(input); }
getManagedInvite(token: string): { target: string; channel: string } | null {
if (!/^[A-Za-z0-9_-]{32,128}$/.test(token)) return null;
const record = this.database.getManagedInvite(hashInviteToken(token));
if (!record) return null;
return {
target: record.targetText ?? formatTeamSpeakTarget({ host: record.targetHost, port: record.targetPort }),
channel: record.channel,
};
}
consumeManagedInvite(token: string): { target: string; serverPassword: string; channel: string } | null {
if (!/^[A-Za-z0-9_-]{32,128}$/.test(token)) return null;
const record = this.database.consumeManagedInvite(hashInviteToken(token));
if (!record) return null;
@@ -344,7 +416,7 @@ export class AdminService {
this.logger.error({ err: error instanceof Error ? error.message : String(error), inviteId: record.id }, "Managed invite password could not be decrypted");
}
this.database.addAudit("INVITE_CONSUMED", { id: record.id });
return { target: { host: record.targetHost, port: record.targetPort }, serverPassword, channel: record.channel };
return { target: record.targetText ?? formatTeamSpeakTarget({ host: record.targetHost, port: record.targetPort }), serverPassword, channel: record.channel };
}
dismissLegacyImportNotice(): void {
@@ -352,9 +424,9 @@ export class AdminService {
}
private normalizeSettings(input: AdminSettingsInput, current: ReturnType<WebSpeakDatabase["getSettings"]>, relayNodes?: PersistedRelayNode[]): SettingsUpdate {
let target: TeamSpeakTarget;
let target: TeamSpeakConnectionTarget;
try {
target = parseTeamSpeakTarget(input.target);
target = parseTeamSpeakConnectionTarget(input.target);
} catch {
throw new AdminInputError("INVALID_TARGET", "TeamSpeak target is invalid");
}
@@ -376,6 +448,12 @@ export class AdminService {
if (typeof input.webRtcEnabled !== "boolean") {
throw new AdminInputError("INVALID_WEBRTC_ENABLED", "WebRTC enabled value is invalid");
}
const webRtcPublicHost = normalizeVoiceMediaHost(input.webRtcPublicHost === undefined ? current.webRtcPublicHost : input.webRtcPublicHost);
const webRtcStunServer = normalizeVoiceStunServer(input.webRtcStunServer === undefined ? current.webRtcStunServer : input.webRtcStunServer);
const webRtcIpv6Enabled = input.webRtcIpv6Enabled === undefined ? current.webRtcIpv6Enabled : input.webRtcIpv6Enabled;
if (webRtcPublicHost === null) throw new AdminInputError("INVALID_WEBRTC_PUBLIC_HOST", "Use an IP address or hostname without a scheme, path or port");
if (webRtcStunServer === null) throw new AdminInputError("INVALID_WEBRTC_STUN_SERVER", "Use a UDP STUN URL: stun:host:port");
if (typeof webRtcIpv6Enabled !== "boolean") throw new AdminInputError("INVALID_WEBRTC_IPV6", "WebRTC IPv6 value must be boolean");
const webRtcUdpStart = input.webRtcUdpStart ?? current.webRtcUdpStart ?? DEFAULT_WEBRTC_UDP_PORT_RANGE[0];
const webRtcUdpEnd = input.webRtcUdpEnd ?? current.webRtcUdpEnd ?? DEFAULT_WEBRTC_UDP_PORT_RANGE[1];
if (!Number.isInteger(webRtcUdpStart) || webRtcUdpStart < WEBRTC_UDP_PORT_MIN || webRtcUdpStart > WEBRTC_UDP_PORT_MAX) {
@@ -391,6 +469,60 @@ export class AdminService {
throw new AdminInputError("WEBRTC_PORT_LOCKED", "Disable WebRTC and save before changing its UDP port range");
}
const voiceProfile = input.voiceProfile === undefined ? current.voiceProfile : input.voiceProfile;
if (voiceProfile !== null && !isVoiceProfileSetting(voiceProfile)) {
throw new AdminInputError("INVALID_VOICE_PROFILE", "Voice profile must be auto, legacy or adaptive");
}
let voiceTurnUrls = current.voiceTurnUrls;
let requestedTurnUrls = current.voiceTurnUrls === null
? this.voiceIceDefaults.turnRest?.urls ?? []
: normalizeVoiceTurnRestUrls(current.voiceTurnUrls) ?? [];
if (input.voiceTurnUrls !== undefined) {
const normalized = normalizeVoiceTurnRestUrls(input.voiceTurnUrls);
if (normalized === null) throw new AdminInputError("INVALID_VOICE_TURN_URLS", "Use one turn:/turns: URL per entry, at most eight");
voiceTurnUrls = normalized.join("\n");
requestedTurnUrls = normalized;
}
let voiceTurnSecretEncrypted = current.voiceTurnSecretEncrypted;
const voiceTurnSecretAction = input.voiceTurnSecretAction ?? (input.voiceTurnSecret === undefined ? "keep" : "replace");
if (voiceTurnSecretAction === "remove") {
voiceTurnSecretEncrypted = "";
voiceTurnUrls = "";
requestedTurnUrls = [];
}
if (voiceTurnSecretAction === "replace") {
const secret = input.voiceTurnSecret?.trim() ?? "";
if (secret && secret.length < VOICE_TURN_MIN_SECRET_LENGTH) {
throw new AdminInputError("INVALID_VOICE_TURN_SECRET", `The TURN shared secret must contain at least ${VOICE_TURN_MIN_SECRET_LENGTH} characters`);
}
voiceTurnSecretEncrypted = secret ? encryptSecret(secret, this.masterSecret, VOICE_TURN_SECRET_PURPOSE) : "";
}
const voiceTurnTtlSeconds = input.voiceTurnTtlSeconds === undefined ? current.voiceTurnTtlSeconds : input.voiceTurnTtlSeconds;
if (voiceTurnTtlSeconds !== null && (!Number.isInteger(voiceTurnTtlSeconds) || voiceTurnTtlSeconds < VOICE_TURN_TTL_MIN_SECONDS || voiceTurnTtlSeconds > VOICE_TURN_TTL_MAX_SECONDS)) {
throw new AdminInputError("INVALID_VOICE_TURN_TTL", `TURN credential lifetime must be between ${VOICE_TURN_TTL_MIN_SECONDS} and ${VOICE_TURN_TTL_MAX_SECONDS} seconds`);
}
const voiceOpusWs = input.voiceOpusWs === undefined ? current.voiceOpusWs : input.voiceOpusWs;
if (voiceOpusWs !== null && typeof voiceOpusWs !== "boolean") {
throw new AdminInputError("INVALID_VOICE_OPUS", "Opus over WebSocket must be a boolean");
}
const voiceJitterMaxMs = input.voiceJitterMaxMs === undefined ? current.voiceJitterMaxMs : input.voiceJitterMaxMs;
if (voiceJitterMaxMs !== null && (!Number.isInteger(voiceJitterMaxMs) || voiceJitterMaxMs < VOICE_JITTER_MIN_MS || voiceJitterMaxMs > VOICE_JITTER_MAX_MS)) {
throw new AdminInputError("INVALID_VOICE_JITTER_MAX", `Adaptive jitter limit must be between ${VOICE_JITTER_MIN_MS} and ${VOICE_JITTER_MAX_MS} ms`);
}
let turnSecret = "";
if (voiceTurnSecretEncrypted === null) {
turnSecret = this.voiceIceDefaults.turnRest?.secret ?? "";
} else if (voiceTurnSecretEncrypted !== "") {
try {
turnSecret = decryptSecret(voiceTurnSecretEncrypted, this.masterSecret, VOICE_TURN_SECRET_PURPOSE);
} catch {
throw new AdminInputError("INVALID_VOICE_TURN_SECRET", "The stored TURN shared secret cannot be decrypted; enter it again");
}
}
if (requestedTurnUrls.length > 0 && turnSecret.length < VOICE_TURN_MIN_SECRET_LENGTH) {
throw new AdminInputError("INVALID_VOICE_TURN_SECRET", `Configure a TURN shared secret of at least ${VOICE_TURN_MIN_SECRET_LENGTH} characters for the TURN URLs`);
}
let encryptedPassword = current.tsPasswordEncrypted;
const action = input.passwordAction ?? (input.serverPassword === undefined ? "keep" : "replace");
if (action === "remove") encryptedPassword = null;
@@ -452,12 +584,20 @@ export class AdminService {
welcomeTextRu,
welcomeTextJa,
accessMode: input.accessMode,
tsHost: target.host,
tsPort: target.port,
tsHost: target.kind === "nickname" ? target.name : target.target.host,
tsPort: target.kind === "nickname" ? target.port ?? DEFAULT_TEAM_SPEAK_PORT : target.target.port,
tsTarget: target.kind === "nickname" ? formatTeamSpeakConnectionTarget(target) : null,
tsPasswordEncrypted: encryptedPassword,
webRtcEnabled: input.webRtcEnabled,
webRtcPublicHost, webRtcIpv6Enabled, webRtcStunServer,
webRtcUdpStart,
webRtcUdpEnd,
voiceProfile,
voiceTurnUrls,
voiceTurnSecretEncrypted,
voiceTurnTtlSeconds,
voiceOpusWs,
voiceJitterMaxMs,
relayConfigured,
relayEnabled,
relayName,
@@ -486,6 +626,8 @@ export class AdminService {
if (seen.has(id)) throw new AdminInputError("INVALID_RELAY_ID", "Relay id must be unique");
seen.add(id);
const previous = current.get(id);
const voiceEndpointInput = typeof input.voiceEndpoint === "string" ? input.voiceEndpoint.trim() : previous?.voiceEndpoint ?? "";
const voiceEndpoint = normalizeRelayVoiceEndpoint(voiceEndpointInput, target.host);
const tokenAction = input.tokenAction ?? (input.token === undefined ? "keep" : "replace");
let tokenEncrypted = previous?.tokenEncrypted ?? null;
if (tokenAction === "remove") tokenEncrypted = null;
@@ -502,6 +644,7 @@ export class AdminService {
enabled: input.enabled === true,
host: target.host,
port: target.port,
voiceEndpoint,
tokenEncrypted,
createdAt: previous?.createdAt ?? now,
updatedAt: now,
@@ -517,12 +660,13 @@ export class AdminService {
}
}
private getRelayNodeViews(): Array<{ id: string; name: string; enabled: boolean; target: string; hasToken: boolean }> {
private getRelayNodeViews(): Array<{ id: string; name: string; enabled: boolean; target: string; voiceEndpoint: string; hasToken: boolean }> {
return this.database.listRelayNodes().map((node) => ({
id: node.id,
name: node.name,
enabled: node.enabled,
target: formatRelayTarget(node.host, node.port),
voiceEndpoint: node.voiceEndpoint || defaultRelayVoiceEndpoint(node.host),
hasToken: Boolean(node.tokenEncrypted),
}));
}
@@ -537,6 +681,7 @@ export class AdminService {
enabled: settings.relayEnabled,
host: settings.relayHost,
port: settings.relayPort || DEFAULT_ACCELERATION_RELAY_PORT,
voiceEndpoint: defaultRelayVoiceEndpoint(settings.relayHost),
tokenEncrypted: settings.relayTokenEncrypted,
createdAt: previous?.createdAt ?? now,
updatedAt: now,
@@ -549,7 +694,7 @@ export class AdminService {
const exhausted = record.maxUses > 0 && record.useCount >= record.maxUses;
return {
id: record.id,
target: formatTeamSpeakTarget({ host: record.targetHost, port: record.targetPort }),
target: record.targetText ?? formatTeamSpeakTarget({ host: record.targetHost, port: record.targetPort }),
channel: record.channel,
expiresAt: record.expiresAt,
maxUses: record.maxUses,
@@ -571,10 +716,20 @@ export class AdminService {
accessMode: settings.accessMode,
tsHost: settings.tsHost,
tsPort: settings.tsPort,
tsTarget: settings.tsTarget,
tsPasswordEncrypted: settings.tsPasswordEncrypted,
webRtcEnabled: settings.webRtcEnabled,
webRtcPublicHost: settings.webRtcPublicHost,
webRtcIpv6Enabled: settings.webRtcIpv6Enabled,
webRtcStunServer: settings.webRtcStunServer,
webRtcUdpStart: settings.webRtcUdpStart,
webRtcUdpEnd: settings.webRtcUdpEnd,
voiceProfile: settings.voiceProfile,
voiceTurnUrls: settings.voiceTurnUrls,
voiceTurnSecretEncrypted: settings.voiceTurnSecretEncrypted,
voiceTurnTtlSeconds: settings.voiceTurnTtlSeconds,
voiceOpusWs: settings.voiceOpusWs,
voiceJitterMaxMs: settings.voiceJitterMaxMs,
relayConfigured: settings.relayConfigured,
relayEnabled: settings.relayEnabled,
relayName: settings.relayName,
@@ -599,10 +754,20 @@ export class AdminService {
accessMode: current.accessMode,
tsHost: legacy.tsHost,
tsPort: legacy.tsPort,
tsTarget: legacy.tsTarget ?? null,
tsPasswordEncrypted: legacy.tsServerPassword ? encryptSecret(legacy.tsServerPassword, this.masterSecret) : null,
webRtcEnabled: current.webRtcEnabled,
webRtcPublicHost: current.webRtcPublicHost,
webRtcIpv6Enabled: current.webRtcIpv6Enabled,
webRtcStunServer: current.webRtcStunServer,
webRtcUdpStart: current.webRtcUdpStart,
webRtcUdpEnd: current.webRtcUdpEnd,
voiceProfile: current.voiceProfile,
voiceTurnUrls: current.voiceTurnUrls,
voiceTurnSecretEncrypted: current.voiceTurnSecretEncrypted,
voiceTurnTtlSeconds: current.voiceTurnTtlSeconds,
voiceOpusWs: current.voiceOpusWs,
voiceJitterMaxMs: current.voiceJitterMaxMs,
relayConfigured: current.relayConfigured,
relayEnabled: current.relayEnabled,
relayName: current.relayName,
@@ -622,13 +787,29 @@ function hashInviteToken(token: string): string {
return createHash("sha256").update(token).digest("hex");
}
function settingsTarget(settings: { tsHost: string; tsPort: number; tsTarget?: string | null }): string {
return settings.tsTarget ?? formatTeamSpeakTarget({ host: settings.tsHost, port: settings.tsPort });
}
function defaultRelayVoiceEndpoint(host: string): string {
const formattedHost = isIP(host) === 6 ? `[${host}]` : host;
return `https://${formattedHost}`;
}
function normalizeRelayVoiceEndpoint(value: string, relayHost: string): string {
const endpoint = value || defaultRelayVoiceEndpoint(relayHost);
let parsed: URL;
try { parsed = new URL(endpoint); }
catch { throw new AdminInputError("INVALID_RELAY_VOICE_ENDPOINT", "Relay voice gateway address must be an HTTP(S) origin"); }
const hostname = parsed.hostname.replace(/^\[|\]$/g, "").toLowerCase();
const local = hostname === "localhost" || hostname === "::1" || hostname === "127.0.0.1" || hostname.startsWith("127.");
if ((parsed.protocol !== "https:" && !(parsed.protocol === "http:" && local))
|| parsed.username || parsed.password || parsed.pathname !== "/" || parsed.search || parsed.hash) {
throw new AdminInputError("INVALID_RELAY_VOICE_ENDPOINT", "Relay voice gateway must use HTTPS and contain only an origin");
}
return parsed.origin;
}
function formatRelayTarget(host: string, port: number): string {
return `${host.includes(":") ? `[${host}]` : host}#${port}`;
}
export class AdminInputError extends Error {
constructor(readonly code: string, message: string) {
super(message);
this.name = "AdminInputError";
}
}
+7
View File
@@ -50,6 +50,13 @@ export class AdminSessionStore {
clear(): void {
this.sessions.clear();
}
/** A credential change retains only the authenticated session that performed it. */
revokeOthers(request: Request): void {
const token = readCookie(request.headers.cookie, COOKIE_NAME);
const keep = token ? hashToken(token) : null;
for (const key of this.sessions.keys()) if (key !== keep) this.sessions.delete(key);
}
}
export function isSecureRequest(request: Request): boolean {
+32 -29
View File
@@ -1,51 +1,54 @@
import { performance } from "node:perf_hooks";
const WINDOW_MS = 5 * 60 * 1000;
const MAX_FAILURES = 5;
interface LoginAttempt {
failures: number;
pending: number;
firstFailureAt: number;
}
type Reservation = { allowed: false; retryAfterMs: number }
| { allowed: true; finish(result: "success" | "failure" | "cancelled"): number };
export class AdminLoginRateLimiter {
private readonly attempts = new Map<string, LoginAttempt>();
private pending = 0;
constructor(private readonly maxTrackedPeers = 1024) {}
constructor(private readonly maxTrackedPeers = 1024, private readonly maxConcurrentChecks = 8) {}
retryAfterMs(peer: string, now = Date.now()): number {
const attempt = this.attempts.get(peer);
if (!attempt) return 0;
if (now - attempt.firstFailureAt >= WINDOW_MS) {
this.attempts.delete(peer);
return 0;
}
if (attempt.failures < MAX_FAILURES) return 0;
return WINDOW_MS - (now - attempt.firstFailureAt);
}
recordFailure(peer: string, now = Date.now()): number {
/** Reserve before hashing; pending checks count against capacity, successes are not failures. */
reserve(peer: string, now = performance.now()): Reservation {
this.pruneExpired(now);
const current = this.attempts.get(peer);
if (!current) {
this.pruneExpired(now);
while (this.attempts.size >= this.maxTrackedPeers) {
const oldestPeer = this.attempts.keys().next().value;
if (!oldestPeer) break;
this.attempts.delete(oldestPeer);
}
if (current && current.failures + current.pending >= MAX_FAILURES) {
return { allowed: false, retryAfterMs: Math.max(1000, WINDOW_MS - (now - current.firstFailureAt)) };
}
const attempt = !current || now - current.firstFailureAt >= WINDOW_MS
? { failures: 1, firstFailureAt: now }
: { ...current, failures: current.failures + 1 };
if (this.pending >= this.maxConcurrentChecks || (!current && this.attempts.size >= this.maxTrackedPeers)) {
// Never evict another visitor's lockout or pending check to admit a new address.
return { allowed: false, retryAfterMs: 1000 };
}
const attempt = current ?? { failures: 0, pending: 0, firstFailureAt: now };
this.attempts.set(peer, attempt);
return Math.min(2000, 250 * (2 ** Math.min(3, attempt.failures - 1)));
}
recordSuccess(peer: string): void {
this.attempts.delete(peer);
attempt.pending++;
this.pending++;
let finished = false;
return { allowed: true, finish: result => {
if (finished) return 0;
finished = true;
this.pending--;
attempt.pending--;
if (result === "success") attempt.failures = 0;
else if (result === "failure") attempt.failures++;
if (!attempt.failures && !attempt.pending) this.attempts.delete(peer);
return result === "failure" ? Math.min(2000, 250 * 2 ** Math.min(3, attempt.failures - 1)) : 0;
} };
}
private pruneExpired(now: number): void {
for (const [peer, attempt] of this.attempts) {
if (now - attempt.firstFailureAt >= WINDOW_MS) this.attempts.delete(peer);
if (!attempt.pending && now - attempt.firstFailureAt >= WINDOW_MS) this.attempts.delete(peer);
}
}
}
Loaded 100 of 575 files, more files were not shown because too many files have changed in this diff. Show more