Commit Graph
80 Commits
Author SHA1 Message Date
MoepchiandClaude Opus 5.5 632e77ccc8 Add news ticker at the bottom of the client
Central feed (/api/store/news on the store server: manual items via
STORE_ADMIN_TOKEN, plus the latest release and newest store design for
30 days) and a per-gateway /api/news with NEWS_TICKER, NEWS_TICKER_CENTRAL
and NEWS_TICKER_MESSAGES so self-hosters can turn it off or add their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-22 18:38:00 +00:00
MoepchiandClaude Opus 5.5 aa324274a4 Feedback: keep the bug report's server out of the public issue
The server is sent as its own field and only appended to the private
feedback log, like the contact e-mail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-22 18:28:13 +00:00
MoepchiandClaude Opus 5.5 7a0a64b518 Point links at the new WebSpeak3 organization
The repo moved from Moepchi/webspeak3 to WebSpeak3/webspeak3. GitHub
redirects the old URLs, but the feedback-to-issue default (GITHUB_REPO)
POSTs to the API, and a 301 there turns the POST into a GET.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-19 15:26:08 +00:00
MoepchiandClaude Opus 5.5 cc70bc4736 Anonymous usage ping from self-hosted gateways
On startup and once a day the gateway sends a random instance id and its
version to gateway.webspeak3.de (TELEMETRY=0 turns it off, the startup log
says so). The standalone store server receives it with PING_DATA_FILE set,
keeps id/version/first/last seen without IPs, and serves admin-only counts.
The release tag is baked into the image as WEBSPEAK3_VERSION.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-19 09:01:59 +00:00
MoepchiandClaude Opus 5.5 603cedd907 Push-to-talk with custom key/mouse button, Hotkeys options, standalone store
- Push-to-talk: configurable key or middle/side mouse button (tab must be
  focused), hold button in the toolbar, settings under Capture and the new
  Options -> Hotkeys page, which also lists the fixed shortcuts.
- Design Store rejects uploads whose CSS is already in the store.
- gateway/src/store-server.ts runs the store as its own process from the
  same image, so store deploys don't drop voice connections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-19 08:40:03 +00:00
MoepchiandClaude Opus 5.5 e28e18c88c Add the Command Center (IDE) layout
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-18 12:34:11 +00:00
MoepchiandClaude Opus 5.5 882265beae Send file transfers in 192 KiB pieces instead of one message
A whole file used to cross the gateway as a single base64 line, which
readline, JSON.parse and JSON.stringify each copied: over 100 MB of heap
for one 25 MB download. Two parallel downloads ran the gateway out of
memory on 2026-10-11.

Downloads now arrive as fileDownloadChunk events that the web client
joins back together. Uploads go out as uploadFileChunk pieces when the
gateway announces "chunkedUpload"; older gateways still get the single
uploadFile message, and the gateway keeps accepting it from cached
clients.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-11 14:59:07 +00:00
MoepchiandClaude Opus 5.5 c2b52b323d fix(gateway): rate-limit server connects per IP
Each "connect" spawns a new connector and a socket could send any number
of them, so a handful of sockets could join-flood a TeamSpeak server
through the gateway. New CONNECT_RATE_LIMIT (default 30/min per IP).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-07 11:47:05 +00:00
MoepchiandClaude Opus 5.5 bbb44b3eaa fix(gateway): don't let clients pick their IP behind TRUST_PROXY
TRUST_PROXY=1 trusted CF-Connecting-IP and the first X-Forwarded-For
entry, both of which a client can send itself when the proxy in front
isn't Cloudflare (nginx's $proxy_add_x_forwarded_for only appends), so
per-IP limits could be sidestepped. Now TRUST_PROXY=1 takes the last
X-Forwarded-For entry (the one the proxy appended), and the new
TRUST_PROXY=cloudflare takes only CF-Connecting-IP. The bundled compose
file (cloudflared) switches to cloudflare.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-05 18:31:13 +00:00
MoepchiandClaude Opus 5.5 45e4af026f feat: offer ALLOWED_SERVERS as a dropdown or locked address field
With ALLOWED_SERVERS set, the gateway now passes the list to the web client
it serves, and the connect dialog shows a dropdown of those servers instead
of a free-text address, or a locked field when only one is allowed.
SERVER_PICKER=0 keeps the plain text field; lists with *. wildcards can't be
enumerated and keep it too. Entries may now carry a port, which is the
address offered in the dialog (the allowlist still ignores ports).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-05 15:06:45 +00:00
MoepchiandClaude Opus 5.5 12e482b223 fix: recover from silent network drops on both sides of the gateway
Measured with relays that blackhole traffic:

- Gateway to TS server: tsclientlib reconnects on its own after a timeout or
  server restart, but the connector ignored that, so the browser got no notice
  and the new session stayed unsubscribed - everyone but us vanished from the
  tree. The connector now emits "reconnecting"/"reconnected", resubscribes,
  and pauses the server-variable poll meanwhile; the page logs both.
- Browser to gateway: a network that dies silently never closed the socket on
  the page, which kept showing "connected" indefinitely. The gateway now sends
  an app-level keepalive every 20 s (announced as "keepalive" in hello), and
  a socket quiet for 50 s is handled as dropped and reconnected.
- Coming back online skips any remaining reconnect backoff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-03 01:37:13 +00:00
MoepchiandClaude Opus 5.5 23e61c86b3 feat: optional TURN relay for screen streams
TURN_URLS on the gateway is handed to the browser in "hello" and added to the
STUN defaults for both watching and publishing. With TURN_SECRET (coturn's
use-auth-secret) each socket gets its own credential valid for 24 h; static
TURN_USERNAME/TURN_CREDENTIAL work too but are public to every visitor.

Also moves GATEWAY_FEATURES above the runtime-config comment it had split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-03 00:58:22 +00:00
MoepchiandClaude Opus 5.5 4b245d69d3 feat: show real TeamSpeak avatars
The connector now reports client_flag_avatar (the avatar's MD5) per client.
The browser derives /avatar_<uid> from the UID and fetches it through the
existing channel-0 file cache used for group icons, again whenever the hash
changes. Only the own channel and the selected client are fetched, so a big
server does not push every avatar through the gateway; avatars are capped at
512 KiB like icons. They replace the initials tile in the tree (Nova/Pulse),
the speaking-now bar, and appear in the client info panel.

Also fixes the Nova connect dialog staying open over an auto-connect: its
"forced open while disconnected" effect ran after the auto-connect had closed
it, and nothing closed it again once connected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-03 00:50:54 +00:00
MoepchiandClaude Opus 5.5 7b3cb5ef09 feat: per-speaker volume and a gateway feature handshake
The gateway now greets every browser with {type:"hello", features:[...]} so
the hosted client, which updates on every push, can hide what an older
gateway cannot do instead of hanging on it. A gateway without "hello" is
treated as the v0.14 feature set, which replaces the hand-flipped
STREAM_UI_ENABLED switch.

First feature behind it: "clientVolume". The client context menu gets a
0-200% slider, stored per client UID in localStorage. The connector applies
it to tsclientlib's per-speaker AudioQueue.volume while mixing, and keeps the
value across talk pauses, when that queue is torn down and recreated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-03 00:34:12 +00:00
MoepchiandClaude Opus 5.5 8e934c6646 Default server/channel as runtime config for the Docker image (#12)
DEFAULT_SERVER/DEFAULT_CHANNEL used to be build args only, so pointing a
self-hosted instance at its server meant cloning the repo and rebuilding
the image. The gateway now reads them from its own environment and puts
them into the index.html it serves as <meta> tags (HTML-escaped; an
inline script would be blocked by the page's CSP). The client prefers
those over the build-time VITE_ values, which keep working as before.

Closes #12

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-02 07:26:05 +00:00
MoepchiandClaude Opus 5.5 2b668a7f73 Gateway: unreadable store file fails loudly instead of reading as empty (S13)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-27 19:20:47 +00:00
MoepchiandClaude Opus 5.5 57447fdd11 Design Store: moderation queue and stricter CSS check (S4, S13)
New submissions are "pending" until approved by the STORE_ADMIN_TOKEN
holder via the new /api/store/admin review page (CSS shown as text only).
Theme CSS is normalized (comments, escapes, case) before checking and may
no longer load anything: no @import/@font-face, no image-set()/src()/etc.,
url() only for inline data: images. Already-approved themes failing the
new check are hidden. Store file is written atomically.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-27 19:01:53 +00:00
MoepchiandClaude Opus 5.5 4124071371 Harden the gateway against abuse (review S1-S3, S5-S7, S9)
- /ws: optional ALLOWED_ORIGINS allowlist, connection limits per IP and
  in total, 34 MiB maxPayload (uploads capped at 24 MiB client-side)
- connect: reject malformed host/nickname before spawning a connector;
  args passed as --flag=value, secrets via env instead of argv
- connector: 25 MiB download cap, 512 KiB for auto-fetched icons, friendly
  error for blocked private targets (tsclientlib: ALLOW_PRIVATE_TARGETS)
- feedback: contact e-mail never goes into the public GitHub issue;
  mentions/links in the issue body are neutralized; form says so
- rate limits: TRUST_PROXY-aware client IP, expiring limiter maps
- security headers (nosniff, frame options, CSP on served HTML)
- web: icon downloads requested once per path instead of on every update

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-27 18:52:35 +00:00
MoepchiandClaude Sonnet 5 295af1781e Fix nickname-connect failures and add ALLOWED_SERVERS gateway allowlist
- Dockerfile: install ca-certificates in the runtime stage. Its absence
  broke the Rust connector's native-tls HTTPS call to the TeamSpeak
  nickname-lookup API for every nickname-based connection (GitHub
  issue #11, "mgonline" report) - Node's own bundled certs masked this
  everywhere else in the gateway, so only that one HTTPS call failed.
- tsclientlib bump: resolver.rs now surfaces the real per-step errors
  instead of an empty list when every resolution method fails (see
  that submodule's own commit for detail).
- gateway: new ALLOWED_SERVERS env var lets self-hosting admins lock
  their instance down to specific server(s) (with *.example.com
  wildcard support) instead of accepting connections to any address.
  Documented in the README env var table.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-27 11:18:17 +00:00
MoepchiandClaude Sonnet 5 914afd19bd gateway: guard child-process spawn errors and skip a pointless disconnect() stall
Two more unhandled-EventEmitter crash/latency bugs in the same spot as the
last one:

spawn() itself can fail asynchronously (bad CONNECTOR_BIN path, no exec
permission, or EMFILE/ENFILE under load) and emits an unhandled 'error' on
the child process object - just as fatal to the whole gateway as the stdin
EPIPE case, and more likely to hit exactly when the most connections are
already open. Now caught and turned into a normal error event.

disconnect() attached its exit listener with child.once("exit", ...), which
never fires if the connector already exited before disconnect() was called -
'exit' fires exactly once, and by then it's already happened. That always
fell through to the 3s hard-kill timeout for a process that was already
gone, needlessly stalling explicit disconnects and same-socket reconnects
after the connector died on its own. A childGone flag, set by both the new
error handler and the existing exit handler, lets disconnect() skip that
wait entirely when there's nothing left to wait for.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-23 11:36:50 +00:00
MoepchiandClaude Sonnet 5 032969d16a gateway: don't crash the whole process on a dead connector stdin pipe
writeLine()'s killed check only reflects Node-side .kill() calls, so it
can't catch the connector exiting on its own (e.g. the TS3 server drops
it) and closing its stdin first. Writing to that closed pipe threw an
unhandled EPIPE 'error' event, which Node treats as fatal - crashing the
gateway and every other client's live session along with it. Listening
for the error on child.stdin turns it into an isolated write failure.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-23 10:36:39 +00:00
MoepchiandClaude Sonnet 5 da4f416e32 Extract feedback/connection logging into a swappable module
Same pattern as the recent store.ts extraction: feedback-log writes and
connection-event logging move from inline file/console I/O in index.ts
into activity-log.ts, called via logFeedback()/logConnectionEvent(). The
public default behavior is unchanged (JSON-lines file with rotation,
console logging gated by LOG_CONNECTIONS).

This is the piece of the private SQLite overlay's persistence swap that's
a clean drop-in replacement - the private VPS gateway now imports the same
two function names from its own activity-log.ts (SQLite-backed) instead of
patching these call sites into a forked index.ts.

Note: the private overlay's live host-ban enforcement (blocked_hosts
table, heartbeat-driven disconnect) is NOT extracted here - it has no
public equivalent and touches the WS connection/heartbeat control flow
directly, not just a persistence call. Left as-is for now.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-18 11:09:37 +00:00
MoepchiandClaude Sonnet 5 d54c4d0dc2 Extract design store into its own module
Moved all store code (constants, cache, handlers) from index.ts into
store.ts verbatim, no behavior change. It has zero private-VPS
modifications (unlike feedback/connection persistence, which the private
overlay patches to use SQLite), so this file can be copied unmodified into
the private overlay - future store changes there no longer need a manual
diff/patch against a hand-patched index.ts.

A full separate microservice was considered but rejected: this repo builds
one Docker image (connector + web + gateway) and self-hosters run one
container via docker-compose.yml; splitting the store into its own service
would force a second mandatory container for what's an opt-in, currently
tiny feature. A module boundary gets the actual pain point (patch-merge
friction) without that cost.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-18 11:00:11 +00:00
MoepchiandClaude Sonnet 5 c0e7f7412e Lower design store cap to bound worst-case RAM usage
STORE_MAX_THEMES was 2000, meaning the in-memory store cache could
theoretically grow to ~900MB (2000 * up to 450KB CSS+screenshot each) with
no eviction. 300 bounds that to ~135MB, which is proportionate for what is
currently a niche community design store.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-18 10:47:35 +00:00
MoepchiandClaude Sonnet 5 a98cf59111 Design store: fix hasScreenshot/rating defaults for pre-existing themes
Themes published before this schema existed have no screenshot/rating
fields at all, so `t.screenshot !== null` (undefined) and the rating
counters (undefined += n) were both wrong for them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-18 06:46:38 +00:00
MoepchiandClaude Sonnet 5 eb7cb78042 Design store: reserved author names, screenshots, ratings, descriptions
Möpchi/Moepchi can only be used as an author name with a matching
STORE_ADMIN_TOKEN bearer token. Submissions can now include an optional
description and a manually uploaded screenshot (data URL, capped size),
shown on browse cards, plus a simple 1-5 star rating (one vote per IP
per theme).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-18 06:38:25 +00:00
MoepchiandClaude Sonnet 5 bd33b962fe Add client-only Design Store MVP
Opt-in gateway endpoints (STORE_ENABLED=1, off by default like every other
optional feature here) to browse and publish community themes, reusing the
existing {name, baseTheme, css} export/import shape so no new packaging
format is needed. CSS is sanitized against @import and remote url() before
being accepted, since it's rendered on other users' pages. Client side adds
a "Store" button to the design picker with a browse/install and a publish
view built on the same DesignPanel patterns as import/export.

No website-side store yet - deliberately client-only for the MVP.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-17 21:22:57 +00:00
MoepchiandClaude Sonnet 5 390a2b5749 Remove implicit database/analytics contrast from feedback log comment
Wording implied a fancier database-backed variant exists elsewhere;
just describe what this file actually is.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-17 17:48:09 +00:00
MoepchiandClaude Sonnet 5 83afe6c2cd Fix path-traversal-adjacent bypass in static file containment check
The WEB_STATIC file server checked containment with a plain string
prefix (filePath.startsWith(WEB_DIST)), which a sibling directory
sharing that prefix passes without actually being inside WEB_DIST -
e.g. WEB_DIST "/app/web/dist" also accepts "/app/web/dist-backup/...".
Now requires an exact match or a path-separator boundary.

WEB_STATIC defaults to on, so this affects any self-hoster serving the
UI from the gateway with the stock config, not just this deployment.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-17 17:35:54 +00:00
MoepchiandClaude Sonnet 5 667012d710 Fix WS message handler crash and stdin command injection in gateway
socket.on("message") parsed JSON and ran the whole handler switch with no
try/catch. Since the callback is async, any throw - malformed JSON from
any connected browser tab, or a handler throwing on unexpected input -
became an unhandled rejection and crashed the entire gateway process,
dropping every other connected user's live session. Now wrapped so one bad
message only errors back to that socket.

connection.ts wrote several fields (permission scope/ids, whisper targets)
straight into the connector's line-based stdin protocol without stripping
embedded CR/LF, unlike the sanitization already applied to every other
free-text field in the file - a newline in one of them could smuggle in a
second, attacker-chosen connector command. All stdin writes now go through
one writeLine() helper that strips embedded CR/LF, closing this for every
call site at once instead of patching each one individually.

Bumps the tsclientlib submodule for the matching SSRF/panic fixes there.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-17 11:06:16 +00:00
MoepchiandClaude Sonnet 5 817aa0f5f6 Gracefully disconnect live sessions on SIGTERM before exiting
Previously the container was killed with connector child processes still
mid-session, so the target TS3/TeaSpeak server only noticed the drop via
its own timeout. A client's automatic reconnect (see App.tsx's
scheduleReconnect) landing before that timeout got rejected as a
duplicate identity (e.g. ClientTooManyClonesConnected).

Now SIGTERM disconnects every live connection first (bounded to 5s) so
the target server frees the slot immediately. The connector's own
resulting "disconnected" event is suppressed from reaching the browser
during shutdown (shuttingDown flag) so the browser sees a raw socket
close, which it treats as an unexpected drop and retries, rather than an
explicit disconnect, which it treats as deliberate and gives up on.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-15 06:56:19 +00:00
MoepchiandClaude Sonnet 5 bc6022b45f Add optional token-authenticated /api/broadcast endpoint
Lets the operator send a free-text maintenance notice to every connected
browser tab via POST /api/broadcast (Bearer BROADCAST_TOKEN). Reuses the
existing {type:"notice"} WebSocket message the frontend already renders
for the SIGTERM restart notice, so no frontend changes are needed. Off
(404) unless BROADCAST_TOKEN is set, same opt-in convention as
FEEDBACK_ENABLED/LOG_CONNECTIONS.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-15 05:25:33 +00:00
MoepchiandClaude Sonnet 5 b0495367cb Link ToS modal to legal pages, add report feedback category
- ToS modal: Datenschutzerklärung/Impressum words are now real links
- Feedback form: new "report" category (abuse/violation), hidden
  GitHub-issue option since reports must stay private
- Gateways: accept "report" in FEEDBACK_CATEGORIES

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-14 18:33:27 +00:00
MoepchiandClaude Sonnet 5 73303e1229 Add SIGTERM restart-warning broadcast and first-visit ToS modal
- Gateway: on SIGTERM, broadcast a "notice" event to every connected
  socket before shutting down, so an active call/stream doesn't just
  silently drop during a redeploy.
- Web client: new "notice" event handling shows a non-dismissable
  restart-warning dialog; new ToS modal shown on first visit to the
  own-hosted instance (client.webspeak3.de only), versioned via
  localStorage, reopenable from the menu.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-14 18:15:15 +00:00
MoepchiandClaude Opus 5 fa4daf7831 gateway: serve nothing to browsers when WEB_STATIC=0
The notice page at "/" was the last thing a browser could get from a
host that only exists to answer /ws and /api/feedback. It is gone; every
path now 404s, so the gateway hostname has no web presence at all.

That broke the container healthcheck, which probed "/" and required a
200 - a correctly configured gateway would have reported itself
unhealthy. The probe now has its own route, /healthz, served before the
WEB_STATIC branch so it answers in either mode.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-11 15:34:16 +00:00
MoepchiandClaude Opus 5 f48c1cc91a Say what WEB_STATIC=0 actually does in the startup log
The line pointed at the Vite dev server, which is only ever right on a
developer's machine - on a deployed gateway it reads like a bug report
waiting to happen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-11 12:45:02 +00:00
MoepchiandClaude Opus 5 cc715e24b2 Fix the feedback URL and stop serving a UI when WEB_STATIC=0
VITE_GATEWAY_URL names a WebSocket origin, and FEEDBACK_URL was derived
from it verbatim - so with VITE_GATEWAY_URL=wss://gateway.example the
form posted to wss://gateway.example/api/feedback, which fetch() refuses
outright ("TypeError: unknown scheme"). Every submission from a
separately hosted frontend failed before it left the browser. Map the
scheme back to http(s); an already-http VITE_GATEWAY_URL is untouched.

While there: WEB_STATIC=0 answered every path with the dev hint page,
which talks about localhost:5173 and npm run dev. That page is wrong for
a gateway that is reachable publicly, and an SPA-shaped answer on every
path makes the host look like a second, stale copy of the app. Serve a
short deployment-neutral notice at "/" and 404 everywhere else; the dev
hint stays for the case it is actually about, a missing web/dist.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-11 12:39:50 +00:00
MoepchiandClaude Opus 5 7083e8e29f gateway: serve HTTPS when TLS_CERT and TLS_KEY are set
Not a nicety. getDisplayMedia, getUserMedia and crypto.randomUUID are
secure-context-only, so a LAN instance reached over plain http could
neither share a screen nor use the microphone. Chrome additionally hides
host ICE candidates behind mDNS names until a media permission is
granted, which keeps a peer-to-peer stream from connecting at all - so
the publishing direction was effectively unreachable from anywhere but
localhost.

The frontend already derives ws:// or wss:// from the page's own scheme,
so nothing else needs configuring. Verified from the LAN address with a
self-signed cert: isSecureContext true, both media APIs present.

gateway/certs/ is gitignored - a private key never belongs in the repo.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-11 05:26:33 +00:00
MoepchiandClaude Opus 5 15e215d892 stream: publish a stream TS6 can watch
The other direction, live-verified against TS6 6.0.0-beta12.1: a real
client rendered our video. Connector gains setupstream, stopstream and
respondjoinstreamrequest; the browser gains publish.ts and a toolbar
button.

The publisher offers. TS6 puts the first SDP in respondjoinstreamrequest,
so the side that owns the stream is the side that makes the offer - the
mirror of how it answered us when we were watching. Its reply confirmed
the key rule found in 7a8a1ea from the other side: TS6 sends us
args.answer, exactly as it expects args.answer from us. The key is always
named after the cmd.

The notify filter had to be fixed first. It matched
starts_with("notifyrespondjoinstream"), which drops the inbound
notifyjoinstreamrequest - so every viewer asking to watch *us* was
silently discarded, and the whole publishing direction was mute. Match
ends_with("joinstreamrequest") instead.

P2P mode is a mesh with no SFU in the path, so each viewer gets its own
peer connection and its own encode. Watching and broadcasting can run at
once, so the two panels stack in a shared container rather than both
anchoring to the same corner.

Note for later: we send bitrate=1500000 and the server reports 58208
back. It does not take our value - a real TS6 client showed 50880. Looks
server-side, and it does not stop the connection.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-11 05:26:33 +00:00
MoepchiandClaude Opus 5 6107501445 Browser: watch a TS6 stream
Adds web/src/stream.ts, the receive-only RTCPeerConnection that takes TS6's
SDP offer out of notifyrespondjoinstreamrequest, trickles ICE both ways over
notifystreamsignaling and hands the remote MediaStream back.

App.tsx only wires it up: a client with client_is_streaming gets a requeststreaminfo
(that property is the *only* way a late joiner learns a stream is running), a
badge in the tree, a context-menu entry and a floating video panel.

Also adds the missing requestStreamInfo path in the gateway - the connector
already had `streaminfo <clid>` on stdin, nothing could reach it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-11 05:26:33 +00:00
MoepchiandClaude Opus 5 9f1a63c9d3 Pass TS6 stream signaling through connector and gateway
tsclientlib dropped every command missing from the message declarations,
which silently swallowed TS6's whole Stream/Call signaling exchange: none of
the stream commands are declared, so notifystreamsignaling never reached a
consumer. That is why the protocol could only be captured with a standalone
raw-tsproto tool.

handle_command now splits the parse failure - ParseError::UnknownCommand hands
the raw line up as StreamItem::UnknownCommand instead of warning and returning,
everything else keeps the old behaviour.

The connector unescapes the TS wire format and forwards the stream commands as
a streamEvent, filtered to notifystream*/notifyrespondjoinstream* so unrelated
undeclared commands stay dropped. The JSON payload stays opaque the whole way -
SDP and ICE belong to the browser's RTCPeerConnection, not to the connector.
Outbound, streamjoin/streamleave/streamsignal join the existing raw OutCommand
handlers; parameter names and order are as recovered from TeamSpeak.dll and
confirmed against a live TS6 client.

The gateway serializes the payload itself so no literal newline can reach the
line-based stdin protocol.

Nothing renders video yet - the browser side is still missing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-09-11 05:26:33 +00:00
MoepchiandClaude Sonnet 5 7776a71e84 Harden and polish the feedback endpoint
- Honeypot field ("website", hidden via CSS + tabIndex -1): any
  non-empty value silently short-circuits to a fake success response
  without logging or filing anything, at near-zero cost to real users.
- Tag created GitHub issues with the feedback category (bug/idea/
  other) alongside the existing "feedback" label, for easier triage -
  GitHub auto-creates labels that don't exist yet.
- Rotate feedback.log once it crosses 5MB (move to feedback.log.1) so
  a busy instance doesn't grow the file unbounded.
- Push the nudge bubble's cooldown out from the moment someone
  actually submits feedback, so it doesn't ask again shortly after
  they just did.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 09:15:05 +02:00
MoepchiandClaude Sonnet 5 e2a09fbb43 Add in-client feedback form (own-hosted instance only)
- gateway: opt-in POST /api/feedback endpoint (FEEDBACK_ENABLED=1),
  logs submissions to feedback.log and optionally files a GitHub issue
  on Moepchi/webspeak3 when GITHUB_TOKEN is set and the user opts in.
  Rate-limited per IP, CORS-aware for split-hosted deployments.
- web: new "Feedback" menu entry under Extras, gated to
  client.webspeak3.de at runtime (IS_OWN_HOSTED_INSTANCE) so other
  self-hosted/forked deployments and the public demo never see it.
  New FeedbackDialog with category/message/email fields and an
  opt-in "publish as GitHub issue" checkbox. New i18n strings (DE/EN).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 07:29:48 +02:00
Moepchi 42f33840a5 Add opt-in connection logging (LOG_CONNECTIONS env var)
Off by default — this is an open-source, self-hostable image, so other
instances shouldn't get connection logging just because it's in the
codebase. Set LOG_CONNECTIONS=1 in an instance's .env to log a single
line per TS3/TeaSpeak connect and disconnect (host, server name,
timestamp — no nickname, no IP).
2026-09-09 07:20:24 +02:00
Moepchi 48f5e35a38 Add PWA installability (manifest + service worker)
- Wire up vite-plugin-pwa: generates a web app manifest and a
  precache-only service worker for the built app shell (JS/CSS/HTML/
  icons). WebSocket (/ws) and file-transfer traffic are never
  intercepted or cached. Disabled in dev so it doesn't interfere with
  Vite's own HMR websocket.
- Add 512px + maskable 512px icons generated from the existing logo.
- Add iOS "Add to Home Screen" meta tags (manifest support there is
  partial).
- Gateway: serve .webmanifest with the correct MIME type.
2026-09-07 16:16:44 +02:00
Moepchi 20d1944dc9 Reconnect resilience: gateway heartbeat + session auto-reconnect
Two related bugs: a browser tab that lost network (or got backgrounded/
suspended on Android) could leave the connector alive on the TS3/TeaSpeak
server for minutes after the frontend showed disconnected, and multi-join
background tabs simply vanished on any drop instead of staying connected.

- gateway: WebSocket ping/pong heartbeat (20s) so a dead browser socket is
  detected and its connector torn down promptly instead of waiting on an
  OS-level TCP timeout.
- web: every session (active tab or parked multi-join background tab) now
  remembers its connect params and can reopen its own socket after an
  unexpected drop, with exponential backoff (1s-30s) so a persistently
  unreachable gateway isn't hammered. Wake Lock keeps the screen (and the
  tab's throttling) at bay while any session is live; a visibilitychange
  sweep reconnects every dropped session once the page is visible again.
  Mic stays off for background sessions throughout, same as before.
2026-09-07 16:01:05 +02:00
Nico B.andCursor b6448e65e8 Add client move/DnD, ServerQuery favorite toggle, and TeaSpeak poke handling.
Lets users move clients via context menu or drag-and-drop (including spacers), show ServerQuery clients per favorite without reconnecting, and surface TeaSpeak/GTS notifyclientpoke reliably via connector fallback plus tsclientlib parse fallthrough.

EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 02:09:52 +02:00
Nico B. a118c0f58e Merge pull request #1 from Moepchi/fix/pr-4-review-bugs
Fix 8 correctness bugs found in review of TeaSpeak/GTS + multi-join PR
2026-09-06 01:20:59 +02:00
Nico B.andCursor 3db5d90d89 Merge upstream/main into GreenTeaSpeak main to resolve PR #4 conflicts.
Keep TeaSpeak/GTS multi-tab work while integrating channel-password prompts and the Pulse theme.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 00:54:04 +02:00
Moepchi 9702c671e8 Fix 8 correctness bugs found in code review of PR #4
- Connection log only ever rendered the single latest entry
  (log.slice(-1) -> log.slice(-50)), and appendLog grew log[] unbounded
- Mic stayed off after switching back to a parked multi-join tab
  (added ParkedSessionState.micWasOn, restore mic on switch-back)
- Packet-loss heuristic guessed fraction-vs-percent by magnitude, which
  can't disambiguate; now branches on actual server type (GTS vs TS3)
- serverGroups/channelGroups/permissionCatalog/banList/fileBrowser were
  page-global caches never invalidated on multi-join tab switch, so a
  newly active tab could show another server's stale data
- ServerQuery clients were filtered from the client list but still
  counted in the online-total fallback; total now matches the list
- gateway disconnect() resolved before the connector child process
  actually exited, allowing two connector processes to run briefly on
  a fast reconnect; now waits for exit (with a hard-kill fallback)
- switching a parked multi-join tab back in replayed a spurious
  whisper-target log entry and resent setWhisperTargets even when
  nothing changed, because the diff was against the wrong tab's ref
- double-click-to-join channel detection used module-level state,
  so a click in one multi-join tab could pair with a click in another
  tab's tree as a false double-click; now keyed per session

Note: could not verify with a full cargo build - the PR's own
'Update tsclientlib' commit (cd6928b) points at a tsclientlib submodule
commit that isn't pushed to any reachable branch (not even the PR
author's own fork), so nobody can currently build this PR end-to-end.
That is unrelated to these fixes.
2026-09-06 00:20:33 +02:00