mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
Compare commits
108
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddc7ce5dec | ||
|
|
a79f2aa4a7 | ||
|
|
2b668a7f73 | ||
|
|
eba1e1af92 | ||
|
|
034be9cc77 | ||
|
|
92479d8a38 | ||
|
|
37a84e4cee | ||
|
|
e89d83c4bb | ||
|
|
57447fdd11 | ||
|
|
b87eb0f4b7 | ||
|
|
4124071371 | ||
|
|
295af1781e | ||
|
|
914afd19bd | ||
|
|
032969d16a | ||
|
|
0428f80af8 | ||
|
|
3c58650c1c | ||
|
|
395aa3e6b6 | ||
|
|
da4f416e32 | ||
|
|
d54c4d0dc2 | ||
|
|
c0e7f7412e | ||
|
|
cfd9503313 | ||
|
|
ed9fb80a9b | ||
|
|
9285e50412 | ||
|
|
f113dbbecb | ||
|
|
d319d989da | ||
|
|
f29a1da7d4 | ||
|
|
587c0048e3 | ||
|
|
a98cf59111 | ||
|
|
eb7cb78042 | ||
|
|
dd8528d3cb | ||
|
|
dcb57aedbe | ||
|
|
bd33b962fe | ||
|
|
7b52c0baa4 | ||
|
|
effabafa23 | ||
|
|
258d108f59 | ||
|
|
390a2b5749 | ||
|
|
41e415d98b | ||
|
|
934c41fefd | ||
|
|
83afe6c2cd | ||
|
|
667012d710 | ||
|
|
3ffd7e5ce5 | ||
|
|
ae8f1f764b | ||
|
|
42ac4e9aaa | ||
|
|
961084e9a0 | ||
|
|
faeb269fdd | ||
|
|
f44327aabc | ||
|
|
7357dfa85d | ||
|
|
ceeba24f86 | ||
|
|
817aa0f5f6 | ||
|
|
bc6022b45f | ||
|
|
8d17514774 | ||
|
|
d62e47ca63 | ||
|
|
45af66f84b | ||
|
|
be946c2a5e | ||
|
|
732a905f32 | ||
|
|
77e147cc27 | ||
|
|
b0495367cb | ||
|
|
73303e1229 | ||
|
|
741528220e | ||
|
|
0b34e7ecfb | ||
|
|
6ebc3e22e0 | ||
|
|
fa4daf7831 | ||
|
|
f48c1cc91a | ||
|
|
cc715e24b2 | ||
|
|
2ee6d1f0b5 | ||
|
|
06f38b4582 | ||
|
|
5024bf9856 | ||
|
|
478e5c0384 | ||
|
|
550a8896a5 | ||
|
|
e7d5b3be0a | ||
|
|
9652a3efe5 | ||
|
|
4d549887d5 | ||
|
|
686458807a | ||
|
|
b505d68f56 | ||
|
|
13d3f56c89 | ||
|
|
4d0954054c | ||
|
|
115cd7150e | ||
|
|
7083e8e29f | ||
|
|
15e215d892 | ||
|
|
b57d32bc18 | ||
|
|
c2e4760e37 | ||
|
|
087b8a90c5 | ||
|
|
6107501445 | ||
|
|
11a413d2b6 | ||
|
|
9f1a63c9d3 | ||
|
|
7776a71e84 | ||
|
|
5b5f4caf79 | ||
|
|
dc35526727 | ||
|
|
20a861caff | ||
|
|
6c764578a7 | ||
|
|
d48172f4d1 | ||
|
|
e2a09fbb43 | ||
|
|
1d20eb15de | ||
|
|
42f33840a5 | ||
|
|
48f5e35a38 | ||
|
|
20d1944dc9 | ||
|
|
fd5a4cd6e0 | ||
|
|
701bd867fc | ||
|
|
b6448e65e8 | ||
|
|
bf85173a54 | ||
|
|
cf5ecb1455 | ||
|
|
9206b12e25 | ||
|
|
5d2b02feb0 | ||
|
|
77165af5e4 | ||
|
|
a118c0f58e | ||
|
|
3db5d90d89 | ||
|
|
ecdd69bceb | ||
|
|
27ac828641 |
No files matched your search
@@ -20,30 +20,35 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Determine image tags
|
||||
id: tags
|
||||
# Passed via env, never spliced into the script: a tag name is
|
||||
# user-controlled text and would otherwise run as shell code.
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||
run: |
|
||||
TAGS="moepchi/webspeak3:latest"
|
||||
if [ "${{ github.event_name }}" = "release" ]; then
|
||||
TAGS="$TAGS,moepchi/webspeak3:${{ github.event.release.tag_name }}"
|
||||
if [ "$EVENT_NAME" = "release" ]; then
|
||||
TAGS="$TAGS,moepchi/webspeak3:$RELEASE_TAG"
|
||||
fi
|
||||
echo "tags=$TAGS" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
|
||||
@@ -28,10 +28,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v5
|
||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
|
||||
- name: Upload Safari screenshots
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||
with:
|
||||
name: safari-client-screenshots
|
||||
path: test-results/safari-client-*.png
|
||||
|
||||
@@ -10,3 +10,9 @@ docker-compose.override.yml
|
||||
.claude/
|
||||
CLAUDE.md
|
||||
.serena/
|
||||
|
||||
# TLS material for local HTTPS - a private key never belongs in the repo.
|
||||
gateway/certs/
|
||||
|
||||
# Prebuilt WASM assets synced from node_modules by scripts/sync-aec3-assets.mjs
|
||||
web/public/vendor/
|
||||
@@ -1,3 +1,4 @@
|
||||
[submodule "tsclientlib"]
|
||||
path = tsclientlib
|
||||
url = https://github.com/Moepchi/tsclientlib.git
|
||||
branch = webspeak3
|
||||
+30
-2
@@ -23,9 +23,26 @@ RUN npm ci
|
||||
RUN node -e "require('@rolldown/binding-linux-x64-gnu')" \
|
||||
|| (rm -rf node_modules package-lock.json && npm install)
|
||||
COPY web/ ./
|
||||
# The UI carries a small Ko-fi donation button (see web/src/App.tsx).
|
||||
# `--build-arg DONATE_URL=` (empty) drops it, any other value points it
|
||||
# elsewhere; left alone, the project default is used. The "keep" sentinel
|
||||
# exists because an unset build arg and an empty one are indistinguishable
|
||||
# inside RUN - without it, "not passed" would silently mean "remove".
|
||||
ARG DONATE_URL=keep
|
||||
# A self-hosted build can bake in a server to auto-connect to with zero user
|
||||
# input (see web/src/App.tsx's AUTO_CONNECT_FROM_URL/DEFAULT_SERVER, GitHub
|
||||
# issue #10). Unlike DONATE_URL, unset already means "no default" - no "keep"
|
||||
# sentinel needed.
|
||||
ARG DEFAULT_SERVER=
|
||||
ARG DEFAULT_CHANNEL=
|
||||
# Design Store catalog to use - unset means "use the maintainer's shared
|
||||
# one" (App.tsx's own default), same unset-means-no-override convention as
|
||||
# DEFAULT_SERVER above.
|
||||
ARG STORE_URL=
|
||||
# tsc -b currently fails on pre-existing type errors unrelated to this build;
|
||||
# vite build alone is enough to produce the production bundle.
|
||||
RUN npx vite build
|
||||
RUN if [ "$DONATE_URL" = "keep" ]; then DONATE_URL_ENV=; else DONATE_URL_ENV="VITE_DONATE_URL=$DONATE_URL"; fi; \
|
||||
env $DONATE_URL_ENV VITE_DEFAULT_SERVER="$DEFAULT_SERVER" VITE_DEFAULT_CHANNEL="$DEFAULT_CHANNEL" VITE_STORE_URL="$STORE_URL" npx vite build
|
||||
|
||||
# --- Gateway ----------------------------------------------------------------
|
||||
FROM node:22-bookworm-slim AS gateway-builder
|
||||
@@ -40,6 +57,11 @@ FROM node:22-bookworm-slim AS runtime
|
||||
LABEL org.opencontainers.image.title="WebSpeak3"
|
||||
LABEL org.opencontainers.image.description="Self-hosted web client for TeamSpeak 3 servers"
|
||||
WORKDIR /app
|
||||
# ts-connector (Rust, native-tls) needs the OS CA bundle for its HTTPS calls
|
||||
# (e.g. TeamSpeak nickname lookup) - Node bundles its own certs and works
|
||||
# without this, but native-tls doesn't, so it's not optional here.
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY gateway/package*.json ./
|
||||
# npm/npx are only needed to install the gateway's runtime deps; the
|
||||
# container never runs either afterwards, so strip them (plus npm's own
|
||||
@@ -59,7 +81,13 @@ ENV WEB_DIST=/app/web/dist
|
||||
ENV CONNECTOR_BIN=/app/connector-bin/ts-connector
|
||||
EXPOSE 8080
|
||||
|
||||
# Run unprivileged. /app itself is the default spot for feedback.log and
|
||||
# store-themes.json, so it has to be writable by that user; a volume mounted
|
||||
# there from an older (root) image may need a one-off `chown 1000:1000`.
|
||||
RUN chown node:node /app
|
||||
USER node
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD ["node", "-e", "fetch('http://127.0.0.1:8080/').then(r => { if (!r.ok) process.exit(1) }).catch(() => process.exit(1))"]
|
||||
CMD ["node", "-e", "fetch('http://127.0.0.1:8080/healthz').then(r => { if (!r.ok) process.exit(1) }).catch(() => process.exit(1))"]
|
||||
|
||||
CMD ["node", "dist/index.js"]
|
||||
@@ -14,7 +14,7 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<b>A modern, self-hosted browser client for TeamSpeak 3 servers — no install, just open a tab.</b>
|
||||
<b>A modern, self-hosted browser client for TeamSpeak, TeaSpeak, and GreenTeaSpeak servers — no install, just open a tab.</b>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
@@ -52,9 +52,9 @@ Run the ready-made container and open **http://localhost:8080**:
|
||||
docker run -d --name webspeak3 --restart unless-stopped -p 8080:8080 moepchi/webspeak3:latest
|
||||
```
|
||||
|
||||
Enter the address and port of **any reachable TeamSpeak 3 or TeamSpeak 6
|
||||
server** in the connection dialog. The TeamSpeak server does not need to be
|
||||
installed on the same machine, modified, or operated by you.
|
||||
Enter the address and port of **any reachable TeamSpeak 3, TeamSpeak 6,
|
||||
TeaSpeak, or GreenTeaSpeak server** in the connection dialog. The server does
|
||||
not need to be installed on the same machine, modified, or operated by you.
|
||||
|
||||
> Voice requires a secure context. Microphone access works on `localhost`; for
|
||||
> access from other devices, place WebSpeak3 behind an HTTPS reverse proxy.
|
||||
@@ -63,7 +63,7 @@ installed on the same machine, modified, or operated by you.
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| 🔌 **Real TeamSpeak protocol** | Connects to actual TS3/TS6 servers over a WebSocket gateway — the server stays exactly as-is |
|
||||
| 🔌 **Real TeamSpeak protocol** | Connects to actual TS3/TS6, TeaSpeak, and GreenTeaSpeak servers over a WebSocket gateway — the server stays exactly as-is |
|
||||
| 🎙️ **Low-latency voice** | Opus-encoded voice with voice activation ("Sprachaktivierung") and adjustable sensitivity |
|
||||
| 🤫 **Whisper** | Target your voice at specific channels or clients instead of your whole current channel |
|
||||
| 🔊 **Custom audio output picker** | Route playback to any output device — works even in browsers without `AudioContext.setSinkId` |
|
||||
@@ -78,8 +78,10 @@ installed on the same machine, modified, or operated by you.
|
||||
| 📱 **Mobile-friendly layout** | Responsive single-column layout for narrow screens, not just a shrunk desktop UI |
|
||||
| 🌍 **Localized UI** | Interface available in German, English, and Simplified Chinese, detected automatically or switchable in Options |
|
||||
| 🌗 **Dark / light theme** | Clean, modern UI that adapts to your preference |
|
||||
| 🔁 **Multi-join (server tabs)** | Several TeamSpeak connections in parallel — one tab per server, like GreenTeaSpeak 2. Audio stays on the active tab |
|
||||
| 🔁 **Multi-join (server tabs)** | Several connections in parallel — one tab per server, like GreenTeaSpeak 2. Audio stays on the active tab |
|
||||
| 🔁 **Seamless reconnect** | Switch or add connections mid-session without tearing down unrelated tabs |
|
||||
| 🍵 **GreenTeaSpeak support** | Connects to real GreenTeaSpeak servers (not just TS3/TS6/TeaSpeak), plus an optional GTS-styled UI chrome (dark panels, gold menu bar, connection-tab strip) alongside the default look |
|
||||
| 🖥️ **Screen streaming to/from TS6** | <sub>**ALPHA · UNSTABLE**</sub> Share your screen to native TeamSpeak 6 clients and watch theirs. Built on TS6's undocumented Stream/Call protocol — expect it to break; see [Roadmap](ROADMAP.md) |
|
||||
|
||||
## 🧱 Tech Stack
|
||||
|
||||
@@ -103,19 +105,22 @@ gateway is required that speaks the real TS protocol on one side and
|
||||
WebSocket to the browser on the other.
|
||||
|
||||
```
|
||||
Browser (web/) <--WebSocket--> Gateway (gateway/) <--stdin/stdout JSON--> Rust connector (connector/) <--TS3/TS6 protocol--> TeamSpeak Server
|
||||
Browser (web/) <--WebSocket--> Gateway (gateway/) <--stdin/stdout JSON--> Rust connector (connector/) <--TS3/TS6/TeaSpeak/GreenTeaSpeak protocol--> Server
|
||||
```
|
||||
|
||||
- **`web/`** — Vite + React frontend. TS3-lookalike UI: channel tree, chat
|
||||
tabs, voice controls.
|
||||
tabs, voice controls. Optional GreenTeaSpeak-styled chrome for the
|
||||
connection-tab strip and menu bar.
|
||||
- **`gateway/`** — Node.js/TypeScript WebSocket server. Spawns the Rust
|
||||
connector **per browser WebSocket** and relays newline-delimited JSON events
|
||||
between it and the browser. Multi-join opens one `/ws` connection per server
|
||||
tab (parallel connectors).
|
||||
- **`connector/`** — Rust binary wrapping [`tsclientlib`](https://github.com/ReSpeak/tsclientlib)
|
||||
(vendored as a git submodule in `tsclientlib/`), the actual TS3/TS6
|
||||
(vendored as a git submodule in `tsclientlib/`, currently tracking a fork
|
||||
with TeaSpeak/GreenTeaSpeak protocol support), the actual TS3/TS6/TeaSpeak
|
||||
protocol implementation. Handles connecting, channel/client state, chat,
|
||||
and Opus-encoded voice.
|
||||
and Opus-encoded voice. Auto-detects the server dialect on connect (or it
|
||||
can be forced via `--server-type`).
|
||||
|
||||
</details>
|
||||
|
||||
@@ -173,6 +178,33 @@ Prefer to skip the build entirely? A prebuilt image is published on [Docker Hub]
|
||||
docker run -d -p 8080:8080 --name webspeak3 moepchi/webspeak3:latest
|
||||
```
|
||||
|
||||
The UI shows a small **Ko-fi donation button** in the bottom right corner. Building it yourself and would rather not carry someone else's donation link? `docker compose build --build-arg DONATE_URL=` removes it (any other value points it somewhere else). Outside Docker the same thing is a build-time variable: `VITE_DONATE_URL= npm run build` in `web/`.
|
||||
|
||||
The **Design Store** (browse/upload community themes) points at the maintainer's shared catalog by default, same as the official client — no setup needed. Want to run your own store instead, backed by your own gateway (`STORE_ENABLED=1`, see below)? `docker compose build --build-arg STORE_URL=https://your-gateway.example.com/api/store/themes`. Outside Docker: `VITE_STORE_URL=https://your-gateway.example.com/api/store/themes npm run build` in `web/`.
|
||||
|
||||
#### Environment variables
|
||||
|
||||
All optional; add them under `environment:` in your compose override next to `PORT`.
|
||||
|
||||
| Variable | Default | Purpose |
|
||||
|---|---|---|
|
||||
| `PORT` | `8080` | Port the gateway listens on. |
|
||||
| `WEB_STATIC` | on | Set to `0` to disable serving the built UI (`web/dist`) entirely — the gateway then only answers `/ws`, `/api/feedback` and `/healthz`. Use this when the UI is hosted elsewhere (e.g. a CDN/static host) and the gateway is purely a backend. |
|
||||
| `WEB_DIST` | `web/dist` next to the gateway | Overrides the directory served when `WEB_STATIC` is on. Only needed for non-standard layouts. |
|
||||
| `BROADCAST_TOKEN` | unset | Bearer token required to call `/api/broadcast` (send an in-app notice to all connected clients before a maintenance restart). Endpoint 404s while unset. |
|
||||
| `TLS_CERT` / `TLS_KEY` | unset | Paths to serve the gateway over HTTPS/WSS directly instead of behind a reverse proxy/tunnel. Both must be set together. |
|
||||
| `STORE_ENABLED` | off | Set to `1` to turn this gateway's own `/api/store/themes` endpoint on. Only needed if you want to run your own Design Store instead of using the maintainer's shared one (see `STORE_URL` build arg above) — the endpoint 404s while unset. |
|
||||
| `STORE_DATA_FILE` | `store-themes.json` in the container's working dir | Where submitted themes (including screenshots) are stored. Mount a volume over this path if they should survive a container recreate. |
|
||||
| `STORE_ALLOWED_ORIGIN` | `*` | CORS origin allowed to call the store endpoint, if you want to restrict it to your own frontend's origin. |
|
||||
| `STORE_ADMIN_TOKEN` | unset | Bearer token for moderation. New submissions wait as "pending" until approved on the review page at `/api/store/admin` (enter the token there); the token holder's own submissions and the reserved author name(s) skip the queue. Without it, nothing ever gets published. Submitted CSS is also checked server-side: no `@import`/`@font-face`, no external `url()` — only inline `data:` images. |
|
||||
| `ALLOWED_SERVERS` | unset (any server) | Comma-separated list of server addresses this gateway is allowed to connect to (e.g. `ts.example.com,*.example.net`). A port is matched separately from the host, so listing `ts.example.com` allows any port on it. An entry starting with `*.` matches any subdomain (`*.example.com` allows `ts.example.com`, not `example.com` itself - list that separately too if it should also be reachable). Locks a self-hosted instance down to specific server(s) instead of acting as a general "connect anywhere" client; a rejected `connect` gets an error back before any connector process is even spawned. |
|
||||
| `ALLOW_PRIVATE_TARGETS` | off | By default the gateway refuses to connect to private/internal addresses (loopback, `10.x`, `192.168.x`, CGNAT, link-local, …), no matter how they were reached (IP, DNS, SRV, TSDNS, nickname, file-transfer redirect), so it can't be abused to probe the network it runs in. **If your TeamSpeak server is on the same LAN as the gateway, set this to `1`.** |
|
||||
| `ALLOWED_ORIGINS` | unset (any origin) | Comma-separated list of web origins allowed to open `/ws` (e.g. `https://client.example.com`). Stops other websites from silently using your gateway as their relay. |
|
||||
| `MAX_CONNECTIONS_PER_IP` / `MAX_CONNECTIONS` | `10` / `300` | Concurrent `/ws` connections per client IP and in total (each can hold a live TeamSpeak session). `0` disables a limit. |
|
||||
| `TRUST_PROXY` | off | Set to `1` when the gateway is **only** reachable through a reverse proxy/tunnel (e.g. cloudflared): per-IP limits then use `CF-Connecting-IP` / `X-Forwarded-For` instead of the proxy's own address. Don't set it on a directly exposed gateway - clients could then spoof their IP. |
|
||||
|
||||
> **Trust model:** the gateway speaks the TeamSpeak protocol on the user's behalf, so whoever runs it necessarily handles their identity key, server/channel passwords and privilege keys (they're kept out of process listings, but the operator can still see them). Only use gateways you trust, and serve them over HTTPS/WSS (`TLS_CERT`/`TLS_KEY` or a TLS-terminating proxy) - plain HTTP exposes all of that on the wire. File uploads are limited to 24 MiB, downloads to 25 MiB.
|
||||
|
||||
<details>
|
||||
<summary><b>🛠️ Manual installation (without Docker)</b></summary>
|
||||
|
||||
@@ -252,6 +284,47 @@ In the web UI, enter the address of a TeamSpeak server and a nickname, then clic
|
||||
|
||||
</details>
|
||||
|
||||
## 🔗 Auto-Connect Links
|
||||
|
||||
Skip the connect dialog entirely and drop visitors straight into a TeamSpeak server. Two ways to do it — use either, or both together.
|
||||
|
||||
### 1. Share a link
|
||||
|
||||
Add a `connect` parameter to your instance's URL and send that link out — in a Discord post, a landing page button, a QR code, wherever:
|
||||
|
||||
```
|
||||
https://your-instance/?connect=voice.example.com&nickname=Guest&channel=Lobby#token=abc123
|
||||
```
|
||||
|
||||
| Parameter | Required | What it does |
|
||||
|------------|----------|--------------|
|
||||
| `connect` | yes | Server address to join, `host` or `host:port` |
|
||||
| `nickname` | no | Nickname to connect with — omit it and the visitor gets an auto-generated `Guest-XXXX` |
|
||||
| `channel` | no | Default channel to join |
|
||||
| `token` | no | Server/channel privilege key, if the target requires one. Put it after `#` (as above) so it never reaches server logs or `Referer` headers; `?token=` still works too |
|
||||
|
||||
This works on **any** deployment — no rebuild, no configuration. WebSpeak3 connects as soon as the page loads and immediately strips these parameters from the address bar, so refreshing the tab (or someone screenshotting/forwarding the URL later) won't silently reconnect off a stale link.
|
||||
|
||||
### 2. Bake in a default server
|
||||
|
||||
Running a dedicated instance for one community or event? Set a default at build time so **every** visitor auto-connects with zero parameters, no link needed:
|
||||
|
||||
```bash
|
||||
docker compose build --build-arg DEFAULT_SERVER=voice.example.com --build-arg DEFAULT_CHANNEL=Lobby
|
||||
```
|
||||
|
||||
Outside Docker, the same thing is a build-time variable:
|
||||
|
||||
```bash
|
||||
VITE_DEFAULT_SERVER=voice.example.com VITE_DEFAULT_CHANNEL=Lobby npm run build
|
||||
```
|
||||
|
||||
(in `web/`). Leave `DEFAULT_CHANNEL`/`VITE_DEFAULT_CHANNEL` out to just join the server's default channel.
|
||||
|
||||
A share link (above) always takes priority over the baked-in default when both are present — so you can point most visitors at your default server while still sending specific people somewhere else via link.
|
||||
|
||||
Either way: on your own hosted instance, the mandatory first-visit Terms of Use is shown and accepted before anything auto-connects; and if the connection fails, the connect dialog opens prefilled so the visitor can fix it and retry by hand.
|
||||
|
||||
## Credits
|
||||
|
||||
The vast majority of this project's code was written by [Claude Code](https://claude.com/claude-code) (Anthropic's Claude), working iteratively with the repo owner one feature at a time.
|
||||
@@ -265,6 +338,9 @@ The vast majority of this project's code was written by [Claude Code](https://cl
|
||||
any way officially connected with TeamSpeak Systems GmbH.
|
||||
|
||||
"TeamSpeak", "TS3", and related logos or names are registered trademarks of
|
||||
TeamSpeak Systems GmbH. All product and company names are trademarks™ or
|
||||
registered® trademarks of their respective holders. Use of them does not
|
||||
imply any affiliation with or endorsement by them.
|
||||
TeamSpeak Systems GmbH. Likewise, WebSpeak3 is not affiliated with,
|
||||
associated with, authorized by, or endorsed by TeaSpeak or GreenTeaSpeak;
|
||||
"TeaSpeak" and "GreenTeaSpeak" are names of their respective projects/
|
||||
operators. All product and company names are trademarks™ or registered®
|
||||
trademarks of their respective holders. Use of them does not imply any
|
||||
affiliation with or endorsement by them.
|
||||
+35
-1
@@ -14,11 +14,28 @@ This roadmap is intentionally outcome-focused. It does not promise fixed dates.
|
||||
- Server, channel, and private text chat
|
||||
- Favorites, identities, contacts, pokes, away state, and reconnect
|
||||
- File transfers, local session recording, sound packs, and administration tools
|
||||
- Design Store: browse, upload, rate, and download community-made themes
|
||||
- Opt-in WASM AEC3 echo cancellation for speaker+mic setups
|
||||
- Responsive desktop and mobile interfaces in German and English
|
||||
- Docker image and Compose-based self-hosting
|
||||
|
||||
## Experimental or still being validated
|
||||
|
||||
- **Screen streaming to and from TeamSpeak 6 (alpha, unstable).** WebSpeak3 can
|
||||
publish a screen share that a native TS6 client can watch, and watch a stream
|
||||
a TS6 client publishes. It speaks TS6's Stream/Call protocol, which TeamSpeak
|
||||
does not document, so the wire format was derived from observed behavior and
|
||||
may break with any TS6 update. Connection setup, picture quality, and viewer
|
||||
admission are not yet dependable. The "Server" connection mode (TS6's SFU) is
|
||||
not implemented; only direct P2P works. The UI is gated by a build-time flag,
|
||||
because the hosted client updates on every push while the gateway image is
|
||||
deployed by hand, and a browser that offers streaming to a gateway too old to
|
||||
answer waits forever instead of reporting an error — on since 2026-09-11 for
|
||||
client.webspeak3.de now that its gateway answers setupStream/joinStream/
|
||||
sendStreamSignal (v0.11.0-beta.1+). The durable fix is a capability handshake
|
||||
so the client can detect what its gateway supports rather than assuming;
|
||||
until then the flag is flipped by hand whenever the frontend gains a stream
|
||||
feature the deployed gateway doesn't have yet.
|
||||
- Safari and Mobile Safari audio/microphone behavior
|
||||
- Uncommon TeamSpeak permission combinations and large permission sets
|
||||
- Very large servers and long-running browser sessions
|
||||
@@ -31,9 +48,26 @@ This roadmap is intentionally outcome-focused. It does not promise fixed dates.
|
||||
|
||||
- Expand real-browser audio testing, especially Safari
|
||||
- Improve reconnect and recovery behavior under unstable networks
|
||||
- Continue accessibility, keyboard-navigation, and mobile usability work
|
||||
- Turn recurring deployment and compatibility reports into documentation
|
||||
|
||||
### Accessibility
|
||||
|
||||
The interface currently assumes a mouse and sighted use; a real pass is
|
||||
still needed:
|
||||
|
||||
- Replace clickable `<div>`s that aren't real `<button>`s with actual
|
||||
buttons, so they're reachable and operable by keyboard
|
||||
- Add keyboard handlers next to the many click-only interactions (channel
|
||||
tree, context menus, client list)
|
||||
- Label icon-only toggle controls (mute, away, streaming, recording, ...)
|
||||
with `aria-label`/`aria-pressed` so their state is announced, not just shown
|
||||
as a color/icon change
|
||||
- Fix the document's `lang` attribute to follow the active UI language
|
||||
instead of staying fixed
|
||||
- Manage focus in modals and dialogs: move it in on open, return it on close
|
||||
- Do a full screen-reader pass (NVDA/VoiceOver) through a real connect
|
||||
session to find what else is missing beyond the above
|
||||
|
||||
### Deployment experience
|
||||
|
||||
- Keep the one-command Docker path reliable
|
||||
|
||||
@@ -11,7 +11,7 @@ tokio = { version = "1", features = ["rt-multi-thread", "macros", "time", "io-st
|
||||
futures = "0.3"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
clap = { version = "4", features = ["derive"] }
|
||||
clap = { version = "4", features = ["derive", "env"] }
|
||||
anyhow = "1"
|
||||
num-traits = "0.2"
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
|
||||
+465
-29
@@ -1,5 +1,6 @@
|
||||
use std::borrow::Cow;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::collections::{BTreeMap, HashMap, HashSet};
|
||||
use std::str;
|
||||
use std::time::Duration;
|
||||
|
||||
use anyhow::Result;
|
||||
@@ -17,9 +18,9 @@ use tsclientlib::messages::c2s::{
|
||||
OutChannelAddPermPart, OutChannelClientAddPermPart, OutChannelClientDelPermPart,
|
||||
OutChannelClientPermListRequestPart, OutChannelDelPermPart, OutChannelGroupAddPermPart,
|
||||
OutChannelGroupDelPermPart, OutChannelGroupPermListRequestPart, OutChannelPermListRequestPart,
|
||||
OutClientAddPermPart, OutClientDelPermPart, OutClientPermListRequestPart, OutClientPokeRequestPart,
|
||||
OutCreateDirectoryPart, OutDeleteFilePart, OutFileListRequestPart, OutRenameFilePart,
|
||||
OutSendTextMessagePart, OutServerGroupAddPermPart, OutServerGroupDelPermPart,
|
||||
OutClientAddPermPart, OutClientDelPermPart, OutClientMovePart, OutClientPermListRequestPart,
|
||||
OutClientPokeRequestPart, OutCreateDirectoryPart, OutDeleteFilePart, OutFileListRequestPart,
|
||||
OutRenameFilePart, OutSendTextMessagePart, OutServerGroupAddPermPart, OutServerGroupDelPermPart,
|
||||
OutServerGroupPermListRequestPart,
|
||||
};
|
||||
use tsclientlib::prelude::*;
|
||||
@@ -27,12 +28,16 @@ use tsclientlib::{
|
||||
data, ChannelGroupId, ChannelId, ClientDbId, ClientId, ClientType, CodecEncryptionMode,
|
||||
Connection, DisconnectOptions, HostBannerMode, HostMessageMode, Identity, InMessage,
|
||||
LicenseType, MaxClients, MessageHandle, MessageTarget, Permission, Reason, ServerGroupId,
|
||||
ServerType, StreamItem, TextMessageTargetMode,
|
||||
ServerType, StreamItem, TextMessageTargetMode, TsError,
|
||||
};
|
||||
use tsproto_packets::commands::{CommandItem, CommandParser};
|
||||
use tsproto_packets::packets::{AudioData, CodecType, Direction, Flags, OutAudio, OutCommand, PacketType};
|
||||
|
||||
/// 20ms frames at 48kHz, which is what TeamSpeak's Opus voice codec expects.
|
||||
const FRAME_SAMPLES: usize = 960;
|
||||
/// Upper bound for a file download relayed to the browser (see its use).
|
||||
const MAX_DOWNLOAD_BYTES: u64 = 25 << 20;
|
||||
const MAX_ICON_BYTES: u64 = 512 << 10;
|
||||
const OUT_CHANNELS: usize = 2;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
@@ -44,11 +49,13 @@ struct Args {
|
||||
/// Nickname to use on the server
|
||||
#[arg(short, long, default_value = "Browser User")]
|
||||
nickname: String,
|
||||
/// Server password, if the server requires one
|
||||
#[arg(long)]
|
||||
/// Server password, if the server requires one. The secrets below are
|
||||
/// normally passed via their env vars (as the gateway does) rather than
|
||||
/// as flags, since argv is visible to every process on the host.
|
||||
#[arg(long, env = "TS_SERVER_PASSWORD", hide_env_values = true)]
|
||||
server_password: Option<String>,
|
||||
/// Password for the default channel to join, if it's password-protected
|
||||
#[arg(long)]
|
||||
#[arg(long, env = "TS_CHANNEL_PASSWORD", hide_env_values = true)]
|
||||
channel_password: Option<String>,
|
||||
/// Channel (name or path, e.g. "Default Channel/Nested") to join on connect,
|
||||
/// instead of the server's actual default channel
|
||||
@@ -58,14 +65,14 @@ struct Args {
|
||||
/// `identity` field) to reconnect with, so the server sees the same
|
||||
/// client UID across sessions. A fresh identity is generated - and
|
||||
/// reported back the same way - when omitted or unparseable.
|
||||
#[arg(long)]
|
||||
#[arg(long, env = "TS_IDENTITY", hide_env_values = true)]
|
||||
identity: Option<String>,
|
||||
/// Server flavour: `teamspeak` (skip TeaSpeak handshake), `teaspeak`
|
||||
/// (always handshake), or `auto` (handshake when server sends `teaspeak=1`).
|
||||
#[arg(long, default_value = "auto", value_parser = ["auto", "teamspeak", "teaspeak"])]
|
||||
server_type: String,
|
||||
/// Privilege key / token (`client_default_token` in clientinit).
|
||||
#[arg(long, alias = "token")]
|
||||
#[arg(long, alias = "token", env = "TS_PRIVILEGE_KEY", hide_env_values = true)]
|
||||
privilege_key: Option<String>,
|
||||
}
|
||||
|
||||
@@ -103,6 +110,51 @@ struct ClientInfo {
|
||||
/// haven't been individually granted talk power. Always `true` in a
|
||||
/// non-moderated channel.
|
||||
has_talk_power: bool,
|
||||
/// ServerQuery client (`ClientType::Query`). Always included in the
|
||||
/// snapshot; the UI hides these unless the user enables them per favorite.
|
||||
is_query: bool,
|
||||
/// Whether this client is broadcasting a TS6 Stream/Call right now. This is
|
||||
/// the only way a client that joins late learns a stream exists - the server
|
||||
/// sends no stream command in that case, so the id has to be fetched with
|
||||
/// `requeststreaminfo`. Always `false` on servers that don't report it.
|
||||
is_streaming: bool,
|
||||
}
|
||||
|
||||
/// Payload for the "streamsetup " stdin command - the `setupstream` args, which
|
||||
/// TS6 always sends in full. The server answers by broadcasting
|
||||
/// `notifystreamstarted` with the stream id it assigned; there is no id here
|
||||
/// because the client does not get to pick one.
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct StreamSetupPayload {
|
||||
name: String,
|
||||
/// Source kind. A real TS6 screen share sends 3.
|
||||
#[serde(rename = "type")]
|
||||
kind: u8,
|
||||
bitrate: u32,
|
||||
/// Who may join: TS6's Privacy setting (public / contacts / private).
|
||||
accessibility: u8,
|
||||
/// Connection mode - P2P or via the server's SFU.
|
||||
mode: u8,
|
||||
/// 0 means unlimited.
|
||||
viewer_limit: u32,
|
||||
audio: bool,
|
||||
}
|
||||
|
||||
/// Payload for the "streamrespond " stdin command - our reply to a
|
||||
/// `notifyjoinstreamrequest`. JSON rather than a plain argument line because
|
||||
/// `offer` is a multi-line SDP and stdin here is line-based.
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct StreamRespondPayload {
|
||||
id: String,
|
||||
clid: u16,
|
||||
#[serde(default)]
|
||||
msg: String,
|
||||
/// The publisher offers, so on accept this carries our whole SDP.
|
||||
#[serde(default)]
|
||||
offer: String,
|
||||
decision: u8,
|
||||
}
|
||||
|
||||
/// Payload for the "serveredit " stdin command - every field is optional so
|
||||
@@ -237,6 +289,11 @@ enum Event {
|
||||
Disconnected { reason: String },
|
||||
#[serde(rename = "error")]
|
||||
Error { message: String },
|
||||
/// A "switch" to a password-protected channel was rejected because no (or
|
||||
/// the wrong) password was supplied. The frontend should prompt for a
|
||||
/// password and retry with it rather than showing a generic error.
|
||||
#[serde(rename = "channelPasswordRequired")]
|
||||
ChannelPasswordRequired { channel_id: u64 },
|
||||
/// Server-tab log notification (client join/leave/switch, channel group
|
||||
/// assignment, channel/server changes, own permission errors).
|
||||
#[serde(rename = "serverLog")]
|
||||
@@ -336,6 +393,16 @@ enum Event {
|
||||
/// anywhere), for populating an "add permission" picker.
|
||||
#[serde(rename = "permissionCatalog")]
|
||||
PermissionCatalog { entries: Vec<PermissionCatalogEntry> },
|
||||
/// A TS6 Stream/Call command the server sent us, forwarded verbatim.
|
||||
///
|
||||
/// `tsclientlib` has no declarations for these, so they arrive as
|
||||
/// `StreamItem::UnknownCommand` and are only unescaped here - the payload
|
||||
/// of `notifystreamsignaling` is an opaque JSON blob (SDP offer/answer,
|
||||
/// ICE candidates) that belongs to the browser's `RTCPeerConnection`, not
|
||||
/// to the connector. `name` is the raw command name, e.g.
|
||||
/// `notifystreamsignaling`.
|
||||
#[serde(rename = "streamEvent")]
|
||||
StreamEvent { name: String, args: BTreeMap<String, String> },
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
@@ -568,13 +635,13 @@ fn snapshot(con: &data::Connection) -> Event {
|
||||
has_password: ch.has_password.unwrap_or(false),
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
// Bookkeeping includes ServerQuery clients (`ClientType::Query`); hide them
|
||||
// from the channel tree / client lists, and from the online-count fallback
|
||||
// below too, so the number shown never counts a client the list doesn't.
|
||||
// Bookkeeping includes ServerQuery clients (`ClientType::Query`). We always
|
||||
// forward them (with `is_query`) so the UI can toggle visibility live from
|
||||
// a favorite setting without reconnecting. Online counts below still exclude
|
||||
// Query by default so the headline matches the default (hidden) tree.
|
||||
let clients = con
|
||||
.clients
|
||||
.values()
|
||||
.filter(|c| !matches!(c.client_type, ClientType::Query { .. }))
|
||||
.map(|c| {
|
||||
// A channel with no talk power requirement at all (the common
|
||||
// case) is never moderated, so everyone can talk regardless of
|
||||
@@ -600,18 +667,27 @@ fn snapshot(con: &data::Connection) -> Event {
|
||||
channel_group: c.channel_group.0,
|
||||
server_groups: c.server_groups.iter().map(|g| g.0).collect(),
|
||||
has_talk_power,
|
||||
is_query: matches!(c.client_type, ClientType::Query { .. }),
|
||||
is_streaming: c.is_streaming.unwrap_or(false),
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// Prefer server-reported counters (GTS/TS `virtualserver_*` via notifyserverupdated)
|
||||
// but never under-report vs. the visible (non-Query) client set (stale
|
||||
// optional_data after joins would otherwise freeze the InfoPanel left number).
|
||||
// but never under-report vs. the non-Query client set (stale optional_data
|
||||
// after joins would otherwise freeze the InfoPanel left number).
|
||||
// `virtualserver_clientsonline` usually includes ServerQuery; subtract them
|
||||
// so the default (Query-hidden) headline matches the default tree.
|
||||
let opt = con.server.optional_data.as_ref();
|
||||
let visible_channels = channels.len() as u64;
|
||||
let visible_clients_count = clients.len() as u16;
|
||||
let server_clients_online =
|
||||
opt.map(|d| d.client_count.max(visible_clients_count)).unwrap_or(visible_clients_count);
|
||||
let query_count = clients.iter().filter(|c| c.is_query).count() as u16;
|
||||
let visible_clients_count = (clients.len() as u16).saturating_sub(query_count);
|
||||
let server_clients_online = opt
|
||||
.map(|d| {
|
||||
let without_query = d.client_count.saturating_sub(query_count);
|
||||
without_query.max(visible_clients_count)
|
||||
})
|
||||
.unwrap_or(visible_clients_count);
|
||||
let server_channels_online =
|
||||
opt.map(|d| d.channel_count.max(visible_channels)).unwrap_or(visible_channels);
|
||||
|
||||
@@ -625,6 +701,57 @@ fn snapshot(con: &data::Connection) -> Event {
|
||||
}
|
||||
}
|
||||
|
||||
/// Splits a raw TS command line into its unescaped key/value pairs.
|
||||
///
|
||||
/// Only the first part of a `|`-separated multi-part command is read; none of
|
||||
/// the stream commands use multiple parts. A flag without `=` becomes an empty
|
||||
/// string, which is how TeamSpeak treats it too.
|
||||
fn parse_ts_args(content: &str) -> BTreeMap<String, String> {
|
||||
let (_, parser) = CommandParser::new(content.as_bytes());
|
||||
let mut args = BTreeMap::new();
|
||||
for item in parser {
|
||||
match item {
|
||||
CommandItem::Argument(arg) => {
|
||||
let (Ok(name), Ok(value)) = (str::from_utf8(arg.name()), arg.value().get_str())
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
args.insert(name.to_string(), value.into_owned());
|
||||
}
|
||||
// Stop at the first part boundary.
|
||||
CommandItem::NextCommand => break,
|
||||
}
|
||||
}
|
||||
args
|
||||
}
|
||||
|
||||
/// Sends `joinstreamrequest` for a `"<stream-id> <clid> [msg]"` argument line.
|
||||
///
|
||||
/// Parameter names and order are as recovered from TS6's `TeamSpeak.dll`; `msg`
|
||||
/// is written even when empty so the shape matches the native client.
|
||||
fn send_join_stream_request(con: &mut tsclientlib::Connection, rest: &str, is_remove: bool) {
|
||||
let mut parts = rest.splitn(3, ' ');
|
||||
let (Some(id), Some(Ok(clid))) = (parts.next(), parts.next().map(|c| c.parse::<u16>())) else {
|
||||
emit(&Event::Error { message: "Usage: streamjoin <stream-id> <clid> [msg]".into() });
|
||||
return;
|
||||
};
|
||||
if id.is_empty() {
|
||||
emit(&Event::Error { message: "Usage: streamjoin <stream-id> <clid> [msg]".into() });
|
||||
return;
|
||||
}
|
||||
let msg = parts.next().unwrap_or("");
|
||||
|
||||
let mut packet =
|
||||
OutCommand::new(Direction::C2S, Flags::empty(), PacketType::Command, "joinstreamrequest");
|
||||
packet.write_arg("id", &id);
|
||||
packet.write_arg("clid", &clid);
|
||||
packet.write_arg("msg", &msg);
|
||||
packet.write_arg("is_remove", &u8::from(is_remove));
|
||||
if let Err(e) = packet.send(con) {
|
||||
emit(&Event::Error { message: format!("joinstreamrequest failed: {e}") });
|
||||
}
|
||||
}
|
||||
|
||||
fn send_server_get_variables(con: &mut tsclientlib::Connection) {
|
||||
let packet = OutCommand::new(
|
||||
Direction::C2S,
|
||||
@@ -713,6 +840,12 @@ GreenTeaSpeak public servers often only allow the official GreenTeaSpeak desktop
|
||||
Try a self-hosted TeaSpeak with TeamSpeak-compat enabled, or use GreenTeaSpeak 2 for ts.greenteaspeak.de."
|
||||
);
|
||||
}
|
||||
if raw.contains("BlockedTarget") {
|
||||
return anyhow::anyhow!(
|
||||
"Could not connect to \"{address}\": it points to a private/internal network address, \
|
||||
which this gateway does not connect to. (Self-hosting admin? Set ALLOW_PRIVATE_TARGETS=1 for LAN servers.)"
|
||||
);
|
||||
}
|
||||
match &e {
|
||||
tsclientlib::Error::ConnectTs(inner) => {
|
||||
anyhow::anyhow!("The server rejected the connection: {inner}")
|
||||
@@ -730,7 +863,16 @@ Try a self-hosted TeaSpeak with TeamSpeak-compat enabled, or use GreenTeaSpeak 2
|
||||
async fn run(args: Args) -> Result<()> {
|
||||
// stdout is a strict newline-delimited-JSON channel for the gateway to parse;
|
||||
// all diagnostic logging must go to stderr instead.
|
||||
tracing_subscriber::fmt().with_env_filter("warn").with_writer(std::io::stderr).init();
|
||||
//
|
||||
// ts_bookkeeping::messages::s2c logs a WARN for every server/property field
|
||||
// it doesn't have a parser for - harmless (the field is just ignored) but,
|
||||
// on TeaSpeak/GreenTeaSpeak servers especially, noisy enough on every
|
||||
// ServerUpdated/ClientEnterView to drown out warnings that actually matter.
|
||||
// Downgraded to error by default; RUST_LOG still overrides this entirely
|
||||
// when set, e.g. RUST_LOG=debug for full tracing.
|
||||
let filter = tracing_subscriber::EnvFilter::try_from_default_env()
|
||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("warn,ts_bookkeeping::messages::s2c=error"));
|
||||
tracing_subscriber::fmt().with_env_filter(filter).with_writer(std::io::stderr).init();
|
||||
|
||||
let address = args.address.clone();
|
||||
// Accepts either our own persisted JSON blob (serialized below) or a raw
|
||||
@@ -840,6 +982,10 @@ async fn run(args: Args) -> Result<()> {
|
||||
// `send_with_result()` for text messages gets us a `MessageResult` event we
|
||||
// can surface as a visible error instead of the message just vanishing.
|
||||
let mut pending_messages: HashMap<MessageHandle, String> = HashMap::new();
|
||||
// Tracks which channel a pending "Channel switch" MessageResult is for, so
|
||||
// a ChannelInvalidPassword failure can be reported as ChannelPasswordRequired
|
||||
// for that specific channel instead of a generic error.
|
||||
let mut pending_switch_channel: HashMap<MessageHandle, u64> = HashMap::new();
|
||||
// When non-empty, outgoing voice is whispered to just these channels/clients
|
||||
// instead of being sent to the current channel - set via the "whisper "
|
||||
// stdin command, cleared via "unwhisper".
|
||||
@@ -950,17 +1096,37 @@ async fn run(args: Args) -> Result<()> {
|
||||
emit(&Event::Disconnected { reason: "client requested".into() });
|
||||
break;
|
||||
} else if let Some(rest) = l.strip_prefix("switch ") {
|
||||
match rest.trim().parse::<u64>() {
|
||||
// "switch <id>" or "switch <id> <base64-encoded password>" - the
|
||||
// password travels base64-encoded since this is a line-based
|
||||
// stdin protocol and a password could contain spaces/newlines.
|
||||
let mut switch_args = rest.trim().splitn(2, ' ');
|
||||
let id_arg = switch_args.next().unwrap_or("");
|
||||
let password_arg = switch_args.next();
|
||||
match id_arg.parse::<u64>() {
|
||||
Ok(id) => {
|
||||
let password = password_arg.and_then(|p| {
|
||||
base64::engine::general_purpose::STANDARD
|
||||
.decode(p)
|
||||
.ok()
|
||||
.and_then(|bytes| String::from_utf8(bytes).ok())
|
||||
});
|
||||
// Build clientmove defensively: missing own client must not panic
|
||||
// the whole connector (that looked like a dead Join from the UI).
|
||||
let part = match con.get_state() {
|
||||
Ok(state) => match state.clients.get(&state.own_client) {
|
||||
Some(own) => {
|
||||
// Always include cpw= (empty) like the GTS desktop client —
|
||||
// some TeaSpeak builds are picky about an omitted key.
|
||||
let mut part = own.client_move(ChannelId(id));
|
||||
part.channel_password = Some(std::borrow::Cow::Borrowed(""));
|
||||
match &password {
|
||||
Some(pwd) => {
|
||||
part = part.set_password(pwd);
|
||||
}
|
||||
None => {
|
||||
// Always include cpw= (empty) like the GTS desktop client -
|
||||
// some TeaSpeak builds are picky about an omitted key.
|
||||
part.channel_password =
|
||||
Some(std::borrow::Cow::Borrowed(""));
|
||||
}
|
||||
}
|
||||
Some(part)
|
||||
}
|
||||
None => {
|
||||
@@ -982,12 +1148,13 @@ async fn run(args: Args) -> Result<()> {
|
||||
match part.send_with_result(&mut con) {
|
||||
Ok(handle) => {
|
||||
pending_messages.insert(handle, "Channel switch".into());
|
||||
pending_switch_channel.insert(handle, id);
|
||||
}
|
||||
Err(e) => emit(&Event::Error { message: e.to_string() }),
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(_) => emit(&Event::Error { message: format!("Invalid channel id: {rest}") }),
|
||||
}
|
||||
Err(_) => emit(&Event::Error { message: format!("Invalid channel id: {id_arg}") }),
|
||||
}
|
||||
} else if let Some(message) = l.strip_prefix("chat ") {
|
||||
let part = OutSendTextMessagePart {
|
||||
@@ -1057,6 +1224,72 @@ async fn run(args: Args) -> Result<()> {
|
||||
}
|
||||
Err(_) => emit(&Event::Error { message: format!("Invalid client id: {id}") }),
|
||||
}
|
||||
} else if let Some(rest) = l.strip_prefix("moveclient ") {
|
||||
// Move another client (or self) into a channel: clientmove clid=… cid=…
|
||||
// Optional trailing base64 password, same as `switch`.
|
||||
let mut move_args = rest.trim().splitn(3, ' ');
|
||||
let clid_arg = move_args.next().unwrap_or("");
|
||||
let cid_arg = move_args.next().unwrap_or("");
|
||||
let password_arg = move_args.next();
|
||||
match (clid_arg.parse::<u16>(), cid_arg.parse::<u64>()) {
|
||||
(Ok(clid), Ok(cid)) => {
|
||||
let password = password_arg.and_then(|p| {
|
||||
base64::engine::general_purpose::STANDARD
|
||||
.decode(p)
|
||||
.ok()
|
||||
.and_then(|bytes| String::from_utf8(bytes).ok())
|
||||
});
|
||||
let part = match con.get_state() {
|
||||
Ok(state) => match state.clients.get(&ClientId(clid)) {
|
||||
Some(client) => {
|
||||
let mut part = client.client_move(ChannelId(cid));
|
||||
match &password {
|
||||
Some(pwd) => {
|
||||
part = part.set_password(pwd);
|
||||
}
|
||||
None => {
|
||||
part.channel_password =
|
||||
Some(std::borrow::Cow::Borrowed(""));
|
||||
}
|
||||
}
|
||||
Some(part)
|
||||
}
|
||||
None => {
|
||||
// Still try with raw ids if the client left our view.
|
||||
// Carry through the already-decoded password instead of
|
||||
// dropping it - this path is also used for self-moves
|
||||
// via drag-and-drop, which still need the password to
|
||||
// reach the server when the target channel requires one.
|
||||
Some(OutClientMovePart {
|
||||
client_id: ClientId(clid),
|
||||
channel_id: ChannelId(cid),
|
||||
channel_password: Some(match &password {
|
||||
Some(pwd) => Cow::Owned(pwd.clone()),
|
||||
None => Cow::Borrowed(""),
|
||||
}),
|
||||
})
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
emit(&Event::Error {
|
||||
message: format!("Move client failed: {e}"),
|
||||
});
|
||||
None
|
||||
}
|
||||
};
|
||||
if let Some(part) = part {
|
||||
match part.send_with_result(&mut con) {
|
||||
Ok(handle) => {
|
||||
pending_messages.insert(handle, "Move client".into());
|
||||
}
|
||||
Err(e) => emit(&Event::Error { message: e.to_string() }),
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => emit(&Event::Error {
|
||||
message: format!("Malformed moveclient command: {rest}"),
|
||||
}),
|
||||
}
|
||||
} else if l == "away" || l.starts_with("away ") {
|
||||
let message = l.strip_prefix("away").unwrap_or("").trim();
|
||||
let part = con.get_state()?.client_update().set_away(Some(message));
|
||||
@@ -1285,6 +1518,150 @@ async fn run(args: Args) -> Result<()> {
|
||||
}
|
||||
Err(e) => emit(&Event::Error { message: e.to_string() }),
|
||||
}
|
||||
} else if let Some(rest) = l.strip_prefix("streaminfo ") {
|
||||
// A late joiner only learns *that* someone streams, from
|
||||
// the client_is_streaming property; the stream id has to
|
||||
// be pulled per client with this.
|
||||
match rest.trim().parse::<u16>() {
|
||||
Ok(clid) => {
|
||||
let mut packet = OutCommand::new(
|
||||
Direction::C2S,
|
||||
Flags::empty(),
|
||||
PacketType::Command,
|
||||
"requeststreaminfo",
|
||||
);
|
||||
packet.write_arg("clid", &clid);
|
||||
if let Err(e) = packet.send(&mut con) {
|
||||
emit(&Event::Error { message: format!("requeststreaminfo failed: {e}") });
|
||||
}
|
||||
}
|
||||
Err(_) => emit(&Event::Error {
|
||||
message: format!("Invalid client id: {rest}"),
|
||||
}),
|
||||
}
|
||||
} else if let Some(rest) = l.strip_prefix("streamsetup ") {
|
||||
// Announce a stream we publish. The id is assigned by the
|
||||
// server and comes back as notifystreamstarted.
|
||||
match serde_json::from_str::<StreamSetupPayload>(rest) {
|
||||
Ok(s) => {
|
||||
let mut packet = OutCommand::new(
|
||||
Direction::C2S,
|
||||
Flags::empty(),
|
||||
PacketType::Command,
|
||||
"setupstream",
|
||||
);
|
||||
packet.write_arg("name", &s.name);
|
||||
packet.write_arg("type", &s.kind);
|
||||
packet.write_arg("bitrate", &s.bitrate);
|
||||
packet.write_arg("accessibility", &s.accessibility);
|
||||
packet.write_arg("mode", &s.mode);
|
||||
packet.write_arg("viewer_limit", &s.viewer_limit);
|
||||
packet.write_arg("audio", &u8::from(s.audio));
|
||||
match packet.send_with_result(&mut con) {
|
||||
Ok(handle) => {
|
||||
pending_messages.insert(handle, "Start stream".into());
|
||||
}
|
||||
Err(e) => emit(&Event::Error {
|
||||
message: format!("setupstream failed: {e}"),
|
||||
}),
|
||||
}
|
||||
}
|
||||
Err(e) => emit(&Event::Error {
|
||||
message: format!("Invalid streamsetup payload: {e}"),
|
||||
}),
|
||||
}
|
||||
} else if let Some(rest) = l.strip_prefix("streamrespond ") {
|
||||
// Accept or refuse a viewer. decision=1 carries our SDP offer,
|
||||
// which is the mirror of how TS6 answered us when we watched.
|
||||
match serde_json::from_str::<StreamRespondPayload>(rest) {
|
||||
Ok(s) => {
|
||||
let mut packet = OutCommand::new(
|
||||
Direction::C2S,
|
||||
Flags::empty(),
|
||||
PacketType::Command,
|
||||
"respondjoinstreamrequest",
|
||||
);
|
||||
packet.write_arg("id", &s.id);
|
||||
packet.write_arg("clid", &s.clid);
|
||||
packet.write_arg("msg", &s.msg);
|
||||
packet.write_arg("offer", &s.offer);
|
||||
packet.write_arg("decision", &s.decision);
|
||||
match packet.send_with_result(&mut con) {
|
||||
Ok(handle) => {
|
||||
pending_messages.insert(handle, "Stream join response".into());
|
||||
}
|
||||
Err(e) => emit(&Event::Error {
|
||||
message: format!("respondjoinstreamrequest failed: {e}"),
|
||||
}),
|
||||
}
|
||||
}
|
||||
Err(e) => emit(&Event::Error {
|
||||
message: format!("Invalid streamrespond payload: {e}"),
|
||||
}),
|
||||
}
|
||||
} else if let Some(rest) = l.strip_prefix("streamstop ") {
|
||||
// "streamstop <stream-id> [reason]"
|
||||
let mut parts = rest.splitn(2, ' ');
|
||||
match parts.next() {
|
||||
Some(id) if !id.is_empty() => {
|
||||
let mut packet = OutCommand::new(
|
||||
Direction::C2S,
|
||||
Flags::empty(),
|
||||
PacketType::Command,
|
||||
"stopstream",
|
||||
);
|
||||
packet.write_arg("id", &id);
|
||||
packet.write_arg("reason", &parts.next().unwrap_or(""));
|
||||
if let Err(e) = packet.send(&mut con) {
|
||||
emit(&Event::Error { message: format!("stopstream failed: {e}") });
|
||||
}
|
||||
}
|
||||
_ => emit(&Event::Error {
|
||||
message: "Usage: streamstop <stream-id> [reason]".into(),
|
||||
}),
|
||||
}
|
||||
} else if let Some(rest) = l.strip_prefix("streamjoin ") {
|
||||
// "streamjoin <stream-id> <clid> [msg]" - ask the client
|
||||
// publishing a TS6 stream to let us in. Its reply is a
|
||||
// notifyrespondjoinstreamrequest carrying the SDP offer.
|
||||
send_join_stream_request(&mut con, rest, false);
|
||||
} else if let Some(rest) = l.strip_prefix("streamleave ") {
|
||||
// Same command with is_remove=1, which is how TS6 leaves
|
||||
// a stream it has joined.
|
||||
send_join_stream_request(&mut con, rest, true);
|
||||
} else if let Some(rest) = l.strip_prefix("streamsignal ") {
|
||||
// "streamsignal <stream-id> <clid> <json>" - the json is
|
||||
// the rest of the line, opaque to us. Escaping is done by
|
||||
// write_arg.
|
||||
let mut parts = rest.splitn(3, ' ');
|
||||
match (parts.next(), parts.next().and_then(|c| c.parse::<u16>().ok()), parts.next()) {
|
||||
(Some(id), Some(clid), Some(json)) if !id.is_empty() && !json.is_empty() => {
|
||||
let mut packet = OutCommand::new(
|
||||
Direction::C2S,
|
||||
Flags::empty(),
|
||||
PacketType::Command,
|
||||
"streamsignaling",
|
||||
);
|
||||
packet.write_arg("id", &id);
|
||||
packet.write_arg("clid", &clid);
|
||||
packet.write_arg("json", &json);
|
||||
// Not fire-and-forget: a signaling command the server refuses
|
||||
// (a stale clid, say) is otherwise indistinguishable from a peer
|
||||
// that simply ignored the payload, and the whole handshake then
|
||||
// stalls with nothing to look at.
|
||||
match packet.send_with_result(&mut con) {
|
||||
Ok(handle) => {
|
||||
pending_messages.insert(handle, "Stream signaling".into());
|
||||
}
|
||||
Err(e) => emit(&Event::Error {
|
||||
message: format!("streamsignaling failed: {e}"),
|
||||
}),
|
||||
}
|
||||
}
|
||||
_ => emit(&Event::Error {
|
||||
message: "Usage: streamsignal <stream-id> <clid> <json>".into(),
|
||||
}),
|
||||
}
|
||||
} else if l == "banlist" {
|
||||
// No typed builder exists for banlist, so this is built as a raw
|
||||
// command; the reply arrives via StreamItem::MessageEvent (see below).
|
||||
@@ -2167,8 +2544,15 @@ async fn run(args: Args) -> Result<()> {
|
||||
}
|
||||
Some(Ok(StreamItem::MessageResult(handle, result))) => {
|
||||
if let Some(label) = pending_messages.remove(&handle) {
|
||||
let switch_channel_id = pending_switch_channel.remove(&handle);
|
||||
if let Err(e) = result {
|
||||
if e.missing_permission.is_some() {
|
||||
if label == "Channel switch" && e.error == TsError::ChannelInvalidPassword {
|
||||
if let Some(channel_id) = switch_channel_id {
|
||||
emit(&Event::ChannelPasswordRequired { channel_id });
|
||||
} else {
|
||||
emit(&Event::Error { message: format!("{label} failed: {e}") });
|
||||
}
|
||||
} else if e.missing_permission.is_some() {
|
||||
emit(&Event::ServerLog {
|
||||
entry: ServerLogEntry::PermissionError { action: label },
|
||||
});
|
||||
@@ -2247,7 +2631,43 @@ async fn run(args: Args) -> Result<()> {
|
||||
}
|
||||
}
|
||||
}
|
||||
Some(Ok(StreamItem::UnknownCommand { name, content })) => {
|
||||
// Undeclared commands are invisible everywhere else, so name
|
||||
// them on stderr - that is the only way to tell "the server
|
||||
// sent nothing" apart from "we filtered it out".
|
||||
eprintln!("[unknown-command] {name}");
|
||||
// TS6 Stream/Call signaling. Everything else undeclared is
|
||||
// dropped on purpose - forwarding every unknown command
|
||||
// would turn this into a firehose, and nothing downstream
|
||||
// wants it.
|
||||
// ends_with, not starts_with: the inbound request is
|
||||
// notifyjoinstreamrequest and the reply
|
||||
// notifyrespondjoinstreamrequest. Matching only the latter's
|
||||
// prefix silently dropped every viewer asking to watch *us*,
|
||||
// which is the whole publishing direction.
|
||||
if name.starts_with("notifystream") || name.ends_with("joinstreamrequest")
|
||||
{
|
||||
emit(&Event::StreamEvent { args: parse_ts_args(&content), name });
|
||||
}
|
||||
}
|
||||
Some(Ok(StreamItem::MessageEvent(msg))) => {
|
||||
// Defense in depth: TeaSpeak/GTS may surface notifyclientpoke as an
|
||||
// unhandled MessageEvent if bookkeeping did not mark it handled.
|
||||
if let InMessage::ClientPoke(poke) = &msg {
|
||||
for part in poke.iter() {
|
||||
emit(&Event::Poke {
|
||||
from: part.invoker_name.clone(),
|
||||
message: part.message.clone().unwrap_or_default(),
|
||||
});
|
||||
}
|
||||
} else if let InMessage::ClientPokeNormal(poke) = &msg {
|
||||
for part in poke.iter() {
|
||||
emit(&Event::Poke {
|
||||
from: part.invoker_name.clone(),
|
||||
message: part.message.clone().unwrap_or_default(),
|
||||
});
|
||||
}
|
||||
}
|
||||
if pending_server_log {
|
||||
if let InMessage::ServerLog(log) = &msg {
|
||||
let lines: Vec<String> = log.iter().map(|part| part.log.clone()).collect();
|
||||
@@ -2496,10 +2916,26 @@ async fn run(args: Args) -> Result<()> {
|
||||
// file does not stall channel switches, chat, etc. while in flight;
|
||||
// emit() is just a println! under the hood, so it is safe to call
|
||||
// from a spawned task even while the main loop is emitting too.
|
||||
let mut stream = result.stream;
|
||||
// Everything is buffered and then sent as one base64 JSON line,
|
||||
// so cap it - a server could otherwise announce (or just send)
|
||||
// gigabytes and take the whole gateway host's memory with it.
|
||||
let stream = result.stream;
|
||||
let announced_size = result.size;
|
||||
// Group/server icons are fetched automatically, without the user
|
||||
// asking, so they get a far smaller budget than explicit downloads.
|
||||
let limit = if cid == 0 && path.starts_with("/icon_") { MAX_ICON_BYTES } else { MAX_DOWNLOAD_BYTES };
|
||||
tokio::spawn(async move {
|
||||
if announced_size > limit {
|
||||
emit(&Event::Error {
|
||||
message: format!("Download refused: {path} is larger than {} KiB", limit >> 10),
|
||||
});
|
||||
return;
|
||||
}
|
||||
let mut buf = Vec::new();
|
||||
match stream.read_to_end(&mut buf).await {
|
||||
match stream.take(limit + 1).read_to_end(&mut buf).await {
|
||||
Ok(_) if buf.len() as u64 > limit => emit(&Event::Error {
|
||||
message: format!("Download aborted: {path} is larger than {} KiB", limit >> 10),
|
||||
}),
|
||||
Ok(_) => {
|
||||
let data = base64::engine::general_purpose::STANDARD.encode(&buf);
|
||||
emit(&Event::FileDownloadData { cid, path, data });
|
||||
|
||||
@@ -6,6 +6,15 @@ services:
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- PORT=8080
|
||||
# This file publishes no port - the gateway is only reachable through
|
||||
# the cloudflared tunnel below, so the client IP it forwards can be
|
||||
# trusted (per-IP limits would otherwise see every user as the tunnel).
|
||||
# Remove this if you publish a port directly instead.
|
||||
- TRUST_PROXY=1
|
||||
# Nothing in here needs Linux capabilities (unprivileged port, plain
|
||||
# TCP/UDP sockets), so drop them all.
|
||||
cap_drop: [ALL]
|
||||
security_opt: [no-new-privileges:true]
|
||||
# Port publishing is deployment-specific and left out of this file on
|
||||
# purpose - Compose concatenates `ports:` lists across an override file
|
||||
# instead of replacing them, so adding one here would double-publish
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
// --- Activity logging (feedback + connection events) -----------------------
|
||||
//
|
||||
// Narrow interface so the private VPS overlay can swap in SQLite persistence
|
||||
// (see mem:reference_webspeak3_private_sqlite_persistence) without forking
|
||||
// index.ts - only this module differs between public and private; index.ts's
|
||||
// two call sites just call logFeedback/logConnectionEvent unconditionally.
|
||||
// This file itself has zero private modifications, same as store.ts.
|
||||
import { appendFile, rename, stat } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
// Plain JSON-lines file. Defaults under the container's WORKDIR (/app in
|
||||
// the Docker image); mount a volume over it if you want submissions to
|
||||
// survive a container recreate.
|
||||
const FEEDBACK_LOG_FILE = process.env.FEEDBACK_LOG_FILE ?? path.resolve(process.cwd(), "feedback.log");
|
||||
// Simple size-based rotation: once the log crosses this size, the current
|
||||
// file is moved to feedback.log.1 (overwriting any previous one) and a
|
||||
// fresh file is started. Keeps disk usage bounded on a plain JSON-lines
|
||||
// file with no other retention policy.
|
||||
const FEEDBACK_LOG_MAX_BYTES = 5 * 1024 * 1024;
|
||||
|
||||
async function rotateFeedbackLogIfNeeded(): Promise<void> {
|
||||
try {
|
||||
const { size } = await stat(FEEDBACK_LOG_FILE);
|
||||
if (size < FEEDBACK_LOG_MAX_BYTES) return;
|
||||
await rename(FEEDBACK_LOG_FILE, `${FEEDBACK_LOG_FILE}.1`);
|
||||
} catch (err) {
|
||||
// ENOENT just means there's no log yet - nothing to rotate.
|
||||
if ((err as NodeJS.ErrnoException).code !== "ENOENT") {
|
||||
console.error("[feedback] Failed to rotate feedback log:", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface FeedbackEntry {
|
||||
at: string;
|
||||
category: string;
|
||||
message: string;
|
||||
email?: string;
|
||||
}
|
||||
|
||||
export async function logFeedback(entry: FeedbackEntry): Promise<void> {
|
||||
try {
|
||||
await rotateFeedbackLogIfNeeded();
|
||||
await appendFile(FEEDBACK_LOG_FILE, JSON.stringify(entry) + "\n", "utf-8");
|
||||
} catch (err) {
|
||||
console.error("[feedback] Failed to write feedback log:", err);
|
||||
}
|
||||
}
|
||||
|
||||
// Opt-in only, off by default: this is an open-source, self-hostable image,
|
||||
// and other instances shouldn't get connection logging just because it's in
|
||||
// the codebase. Set LOG_CONNECTIONS=1 in the .env of the instance you want it
|
||||
// on. Logs only host/server-name/timestamp — no nickname, no IP.
|
||||
export const LOG_CONNECTIONS = process.env.LOG_CONNECTIONS === "1";
|
||||
|
||||
export interface ConnectionEvent {
|
||||
type: "connected" | "disconnected";
|
||||
host: string;
|
||||
server?: string;
|
||||
}
|
||||
|
||||
export function logConnectionEvent(event: ConnectionEvent): void {
|
||||
if (!LOG_CONNECTIONS) return;
|
||||
if (event.type === "connected") {
|
||||
console.log(`[connections] connected host=${event.host} server=${event.server} at=${new Date().toISOString()}`);
|
||||
} else {
|
||||
console.log(`[connections] disconnected host=${event.host} at=${new Date().toISOString()}`);
|
||||
}
|
||||
}
|
||||
+648
-18
@@ -1,9 +1,15 @@
|
||||
import { createServer } from "node:http";
|
||||
import { createServer, type IncomingMessage, type ServerResponse } from "node:http";
|
||||
import { createServer as createSecureServer } from "node:https";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { timingSafeEqual } from "node:crypto";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { WebSocketServer, type WebSocket } from "ws";
|
||||
import { Ts3Connection, type ServerType, type Ts3ConnectOptions } from "./ts3/connection.js";
|
||||
import { handleStore } from "./store.js";
|
||||
import { logFeedback, logConnectionEvent } from "./activity-log.js";
|
||||
import { clientIp, createRateLimiter } from "./net.js";
|
||||
|
||||
const SERVER_TYPES = new Set<ServerType>(["teamspeak", "teaspeak", "auto"]);
|
||||
|
||||
@@ -20,6 +26,79 @@ function parsePrivilegeKey(msg: { privilegeKey?: unknown; token?: unknown }): st
|
||||
return trimmed || undefined;
|
||||
}
|
||||
|
||||
// Self-hosting admins may want to lock their instance to specific server(s)
|
||||
// instead of leaving it as a general-purpose "connect anywhere" client.
|
||||
// Unset (the default) means unrestricted, unchanged from before this existed.
|
||||
const ALLOWED_SERVERS = (process.env.ALLOWED_SERVERS ?? "")
|
||||
.split(",")
|
||||
.map((s) => s.trim().toLowerCase())
|
||||
.filter(Boolean);
|
||||
|
||||
// Strips a trailing ":port" so "ts.example.com:9987" and "ts.example.com"
|
||||
// both match a plain "ts.example.com" allowlist entry. IPv6 literals come
|
||||
// wrapped in brackets ("[::1]:9987"); nicknames have neither and pass through
|
||||
// as-is. Deliberately not full URL parsing - `host` here is never a URL.
|
||||
function stripPort(host: string): string {
|
||||
if (host.startsWith("[")) {
|
||||
const end = host.indexOf("]");
|
||||
return end === -1 ? host : host.slice(1, end);
|
||||
}
|
||||
const i = host.lastIndexOf(":");
|
||||
return i !== -1 && /^\d+$/.test(host.slice(i + 1)) ? host.slice(0, i) : host;
|
||||
}
|
||||
|
||||
function isServerAllowed(host: unknown): boolean {
|
||||
if (ALLOWED_SERVERS.length === 0) return true;
|
||||
if (typeof host !== "string") return false;
|
||||
const target = stripPort(host).trim().toLowerCase();
|
||||
return ALLOWED_SERVERS.some((entry) => {
|
||||
// "*.example.com" matches any subdomain (TLS-wildcard-style: not the
|
||||
// bare apex itself - list that separately if it should be allowed too).
|
||||
if (entry.startsWith("*.")) return target.endsWith(entry.slice(1));
|
||||
return target === entry;
|
||||
});
|
||||
}
|
||||
|
||||
// Everything a "connect" message hands to the connector as a CLI argument.
|
||||
// The connector's own resolver does the real parsing; this only rejects input
|
||||
// no legitimate address or nickname has (control chars, absurd lengths), and
|
||||
// anything starting with "-" so it can never be read as a flag.
|
||||
const HOST_PATTERN = /^[\p{L}\p{N}._\-:[\]]{1,253}$/u;
|
||||
|
||||
function isValidHost(host: unknown): host is string {
|
||||
return typeof host === "string" && HOST_PATTERN.test(host) && !host.startsWith("-");
|
||||
}
|
||||
|
||||
function isValidNickname(nickname: unknown): nickname is string {
|
||||
return (
|
||||
typeof nickname === "string" &&
|
||||
nickname.trim().length > 0 &&
|
||||
nickname.length <= 100 &&
|
||||
!/[\p{Cc}]/u.test(nickname)
|
||||
);
|
||||
}
|
||||
|
||||
// Which web pages may open /ws. Without this any website can embed a hidden
|
||||
// WebSocket to this gateway and use it as a free relay into TeamSpeak land.
|
||||
// Unset keeps the old "any origin" behavior for self-hosters; entries are
|
||||
// full origins ("https://client.example.com"). Non-browser clients send no
|
||||
// Origin header at all - they could fake one anyway, so they aren't blocked.
|
||||
const ALLOWED_ORIGINS = (process.env.ALLOWED_ORIGINS ?? "")
|
||||
.split(",")
|
||||
.map((s) => s.trim().replace(/\/+$/, "").toLowerCase())
|
||||
.filter(Boolean);
|
||||
|
||||
// Each /ws socket can spawn a connector process holding a live TeamSpeak
|
||||
// session, so both need a ceiling. 0 disables the respective limit.
|
||||
const MAX_CONNECTIONS_PER_IP = Number(process.env.MAX_CONNECTIONS_PER_IP ?? 10);
|
||||
const MAX_CONNECTIONS = Number(process.env.MAX_CONNECTIONS ?? 300);
|
||||
const connectionsPerIp = new Map<string, number>();
|
||||
|
||||
// Largest single WS message: file uploads travel base64-encoded inside one,
|
||||
// so this is ~4/3 of the biggest uploadable file (see MAX_UPLOAD_BYTES in
|
||||
// web/src/App.tsx). ws's own default is 100 MiB.
|
||||
const WS_MAX_PAYLOAD = 34 * 1024 * 1024;
|
||||
|
||||
const PORT = Number(process.env.PORT ?? 8080);
|
||||
|
||||
// In production (Docker), the built web app lives alongside the gateway and
|
||||
@@ -41,28 +120,349 @@ const MIME_TYPES: Record<string, string> = {
|
||||
".ico": "image/x-icon",
|
||||
".json": "application/json",
|
||||
".woff2": "font/woff2",
|
||||
".webmanifest": "application/manifest+json",
|
||||
};
|
||||
|
||||
// --- Feedback endpoint ---------------------------------------------------
|
||||
//
|
||||
// Opt-in only, same convention as LOG_CONNECTIONS above: this is an open-
|
||||
// source, self-hostable image, so other instances don't get a public
|
||||
// feedback inbox (and potential GitHub-issue creator) just because it's in
|
||||
// the codebase. Set FEEDBACK_ENABLED=1 on the instance you want it on. The
|
||||
// web client only shows the "Feedback" menu entry on specific hostnames
|
||||
// (see IS_OWN_HOSTED_INSTANCE in web/src/App.tsx), but this endpoint
|
||||
// enforces its own opt-in independently since it's reachable directly over
|
||||
// HTTP by anyone who finds the gateway's address, not just from that UI.
|
||||
const FEEDBACK_ENABLED = process.env.FEEDBACK_ENABLED === "1";
|
||||
// The web app is commonly hosted on a different origin than the gateway
|
||||
// (see mem:deployment / GATEWAY_URL in web/), so this needs its own CORS
|
||||
// allowance; default "*" since the endpoint is opt-in, rate-limited, and
|
||||
// only ever accepts a feedback submission, nothing that reads data back.
|
||||
const FEEDBACK_ALLOWED_ORIGIN = process.env.FEEDBACK_ALLOWED_ORIGIN ?? "*";
|
||||
// A token with "Issues: write" access on the target repo. Without it,
|
||||
// feedback is still accepted and logged, just never turned into an issue.
|
||||
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
|
||||
const GITHUB_REPO = process.env.GITHUB_REPO ?? "Moepchi/webspeak3";
|
||||
const FEEDBACK_CATEGORIES = new Set(["bug", "idea", "report", "other"]);
|
||||
const FEEDBACK_MESSAGE_MAX_LENGTH = 4000;
|
||||
|
||||
// --- Broadcast endpoint ---------------------------------------------------
|
||||
//
|
||||
// Opt-in only, same convention as LOG_CONNECTIONS/FEEDBACK_ENABLED above: lets
|
||||
// the operator push a free-text maintenance notice to every connected browser
|
||||
// tab (reuses the same {type:"notice"} message the SIGTERM handler already
|
||||
// sends, which the frontend renders even without a messageKey). Unset
|
||||
// BROADCAST_TOKEN and the endpoint 404s, same as feedback when disabled.
|
||||
const BROADCAST_TOKEN = process.env.BROADCAST_TOKEN;
|
||||
const BROADCAST_MESSAGE_MAX_LENGTH = 500;
|
||||
|
||||
function isValidBroadcastToken(provided: string): boolean {
|
||||
if (!BROADCAST_TOKEN) return false;
|
||||
const a = Buffer.from(provided);
|
||||
const b = Buffer.from(BROADCAST_TOKEN);
|
||||
return a.length === b.length && timingSafeEqual(a, b);
|
||||
}
|
||||
|
||||
async function handleBroadcast(req: IncomingMessage, res: ServerResponse) {
|
||||
if (!BROADCAST_TOKEN) {
|
||||
res.writeHead(404, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "not_found" }));
|
||||
return;
|
||||
}
|
||||
if (req.method !== "POST") {
|
||||
res.writeHead(405, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "method_not_allowed" }));
|
||||
return;
|
||||
}
|
||||
|
||||
const authHeader = req.headers.authorization ?? "";
|
||||
const token = authHeader.startsWith("Bearer ") ? authHeader.slice("Bearer ".length) : "";
|
||||
if (!isValidBroadcastToken(token)) {
|
||||
res.writeHead(401, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "unauthorized" }));
|
||||
return;
|
||||
}
|
||||
|
||||
let raw = "";
|
||||
for await (const chunk of req) {
|
||||
raw += chunk;
|
||||
if (raw.length > 5_000) {
|
||||
res.writeHead(413, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "payload_too_large" }));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let body: { message?: unknown };
|
||||
try {
|
||||
body = JSON.parse(raw || "{}");
|
||||
} catch {
|
||||
res.writeHead(400, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "invalid_json" }));
|
||||
return;
|
||||
}
|
||||
|
||||
const message = typeof body.message === "string" ? body.message.trim().slice(0, BROADCAST_MESSAGE_MAX_LENGTH) : "";
|
||||
if (!message) {
|
||||
res.writeHead(400, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "message_required" }));
|
||||
return;
|
||||
}
|
||||
|
||||
const payload = JSON.stringify({ type: "notice", message });
|
||||
let sent = 0;
|
||||
for (const socket of wss.clients) {
|
||||
try {
|
||||
socket.send(payload);
|
||||
sent++;
|
||||
} catch {
|
||||
/* socket already gone */
|
||||
}
|
||||
}
|
||||
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ ok: true, sent }));
|
||||
}
|
||||
|
||||
// Small in-memory rate limit: a handful of submissions per IP per hour is
|
||||
// far more than any real user needs, and keeps one abusive client from
|
||||
// spamming the log file or (worse) the GitHub issue tracker. In-memory is
|
||||
// fine here - it only needs to survive as long as the process does.
|
||||
const FEEDBACK_RATE_LIMIT = 5;
|
||||
const FEEDBACK_RATE_WINDOW_MS = 60 * 60 * 1000;
|
||||
const isFeedbackRateLimited = createRateLimiter(FEEDBACK_RATE_LIMIT, FEEDBACK_RATE_WINDOW_MS);
|
||||
|
||||
// The issue is public, and its text is whatever an anonymous visitor typed:
|
||||
// a zero-width space after "@" stops @mentions from pinging real users, and
|
||||
// the body goes into a fenced code block (longer than any backtick run in the
|
||||
// message) so links, images and markup render as inert text.
|
||||
function neutralizeMentions(text: string): string {
|
||||
return text.replace(/@/g, "@\u200b");
|
||||
}
|
||||
|
||||
// The contact e-mail is deliberately *not* part of this: it's only kept in
|
||||
// the private feedback log (logFeedback), never in the public issue.
|
||||
async function createGithubIssue(payload: { category: string; message: string }): Promise<string | undefined> {
|
||||
if (!GITHUB_TOKEN) return undefined;
|
||||
const title = neutralizeMentions(
|
||||
`[Feedback/${payload.category}] ${payload.message.replace(/\s+/g, " ").trim().slice(0, 72)}`,
|
||||
);
|
||||
const longestTicks = Math.max(0, ...(payload.message.match(/`+/g) ?? []).map((m) => m.length));
|
||||
const fence = "`".repeat(Math.max(3, longestTicks + 1));
|
||||
const body = [
|
||||
`${fence}text`,
|
||||
neutralizeMentions(payload.message),
|
||||
fence,
|
||||
"",
|
||||
"---",
|
||||
`Category: ${payload.category}`,
|
||||
"_Submitted via the in-client feedback form._",
|
||||
].join("\n");
|
||||
|
||||
const res = await fetch(`https://api.github.com/repos/${GITHUB_REPO}/issues`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: `Bearer ${GITHUB_TOKEN}`,
|
||||
Accept: "application/vnd.github+json",
|
||||
"Content-Type": "application/json",
|
||||
"User-Agent": "webspeak3-gateway",
|
||||
},
|
||||
// GitHub auto-creates labels that don't already exist in the repo, so
|
||||
// the category label needs no manual setup on first use.
|
||||
body: JSON.stringify({ title, body, labels: ["feedback", payload.category] }),
|
||||
});
|
||||
if (!res.ok) {
|
||||
console.error(`[feedback] GitHub issue creation failed (${res.status}): ${await res.text().catch(() => "")}`);
|
||||
return undefined;
|
||||
}
|
||||
const json = (await res.json()) as { html_url?: string };
|
||||
return json.html_url;
|
||||
}
|
||||
|
||||
async function handleFeedback(req: IncomingMessage, res: ServerResponse) {
|
||||
res.setHeader("Access-Control-Allow-Origin", FEEDBACK_ALLOWED_ORIGIN);
|
||||
res.setHeader("Access-Control-Allow-Methods", "POST, OPTIONS");
|
||||
res.setHeader("Access-Control-Allow-Headers", "Content-Type");
|
||||
|
||||
if (req.method === "OPTIONS") {
|
||||
res.writeHead(204);
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
if (!FEEDBACK_ENABLED) {
|
||||
res.writeHead(404, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "not_found" }));
|
||||
return;
|
||||
}
|
||||
if (req.method !== "POST") {
|
||||
res.writeHead(405, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "method_not_allowed" }));
|
||||
return;
|
||||
}
|
||||
|
||||
if (isFeedbackRateLimited(clientIp(req))) {
|
||||
res.writeHead(429, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "rate_limited" }));
|
||||
return;
|
||||
}
|
||||
|
||||
let raw = "";
|
||||
for await (const chunk of req) {
|
||||
raw += chunk;
|
||||
if (raw.length > 20_000) {
|
||||
res.writeHead(413, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "payload_too_large" }));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let body: { category?: unknown; message?: unknown; email?: unknown; publishAsIssue?: unknown; website?: unknown };
|
||||
try {
|
||||
body = JSON.parse(raw || "{}");
|
||||
} catch {
|
||||
res.writeHead(400, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "invalid_json" }));
|
||||
return;
|
||||
}
|
||||
|
||||
// Honeypot: a field named to look attractive to form-filling bots, kept
|
||||
// hidden from real users via CSS. Any value here means a bot filled it in
|
||||
// blindly - report success without actually logging or filing anything,
|
||||
// so the bot has no signal to adapt on.
|
||||
if (typeof body.website === "string" && body.website.trim() !== "") {
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ ok: true }));
|
||||
return;
|
||||
}
|
||||
|
||||
const category = typeof body.category === "string" && FEEDBACK_CATEGORIES.has(body.category) ? body.category : "other";
|
||||
const message =
|
||||
typeof body.message === "string" ? body.message.trim().slice(0, FEEDBACK_MESSAGE_MAX_LENGTH) : "";
|
||||
const email = typeof body.email === "string" ? body.email.trim().slice(0, 200) || undefined : undefined;
|
||||
const publishAsIssue = body.publishAsIssue === true;
|
||||
|
||||
if (!message) {
|
||||
res.writeHead(400, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "message_required" }));
|
||||
return;
|
||||
}
|
||||
|
||||
await logFeedback({ at: new Date().toISOString(), category, message, email });
|
||||
|
||||
let githubIssueUrl: string | undefined;
|
||||
if (publishAsIssue) {
|
||||
try {
|
||||
githubIssueUrl = await createGithubIssue({ category, message });
|
||||
} catch (err) {
|
||||
console.error("[feedback] Failed to create GitHub issue:", err);
|
||||
}
|
||||
}
|
||||
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ ok: true, githubIssueUrl }));
|
||||
}
|
||||
|
||||
// --- Design Store endpoint --------------------------------------------------
|
||||
// Moved to store.ts - see that file's header comment for why.
|
||||
|
||||
const DEV_HINT = `<!doctype html><html><body style="font:14px system-ui;padding:2rem;max-width:40rem">
|
||||
<h1>WebSpeak3 gateway</h1>
|
||||
<p>WebSocket: <code>/ws</code></p>
|
||||
<p>Static UI is disabled (<code>WEB_STATIC=0</code>) or <code>web/dist</code> is missing.</p>
|
||||
<p><code>web/dist</code> is missing — the UI has not been built yet.</p>
|
||||
<p>For local development open the Vite app at <a href="http://localhost:5173/">http://localhost:5173/</a>
|
||||
(run <code>npm run dev</code> in <code>web/</code>). Rebuild with <code>npm run build</code> in <code>web/</code>
|
||||
to serve the UI from this port again.</p>
|
||||
</body></html>`;
|
||||
|
||||
const server = createServer((req, res) => {
|
||||
/**
|
||||
* TLS material, when configured.
|
||||
*
|
||||
* Not a nicety: `getDisplayMedia`, `getUserMedia` and `crypto.randomUUID` are
|
||||
* secure-context-only, so a LAN instance reached over plain http can neither
|
||||
* share a screen nor use the microphone. Chrome also hides host ICE candidates
|
||||
* behind mDNS names until a media permission is granted, which keeps a
|
||||
* peer-to-peer stream from connecting at all.
|
||||
*
|
||||
* Set TLS_CERT and TLS_KEY to enable; a self-signed pair is enough, the
|
||||
* browser only has to be told once to trust it.
|
||||
*/
|
||||
const TLS_CERT = process.env.TLS_CERT;
|
||||
const TLS_KEY = process.env.TLS_KEY;
|
||||
const tlsOptions =
|
||||
TLS_CERT && TLS_KEY
|
||||
? { cert: readFileSync(TLS_CERT), key: readFileSync(TLS_KEY) }
|
||||
: null;
|
||||
|
||||
// Only for the UI this process serves itself; a separately hosted frontend
|
||||
// (GitHub/Cloudflare Pages) needs its own. Theme CSS from the Design Store is
|
||||
// the main thing this contains: it can't load scripts, frame the app, or
|
||||
// pull in fonts/styles from arbitrary hosts.
|
||||
const CONTENT_SECURITY_POLICY = [
|
||||
"default-src 'self'",
|
||||
"script-src 'self' 'wasm-unsafe-eval'",
|
||||
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com",
|
||||
"font-src 'self' data: https://fonts.gstatic.com",
|
||||
"img-src 'self' data: blob: https:",
|
||||
"media-src 'self' data: blob:",
|
||||
"connect-src 'self' https: wss: ws:",
|
||||
"worker-src 'self' blob:",
|
||||
"object-src 'none'",
|
||||
"base-uri 'self'",
|
||||
"frame-ancestors 'self'",
|
||||
].join("; ");
|
||||
|
||||
const requestHandler = (req: IncomingMessage, res: ServerResponse) => {
|
||||
res.setHeader("X-Content-Type-Options", "nosniff");
|
||||
res.setHeader("Referrer-Policy", "strict-origin-when-cross-origin");
|
||||
res.setHeader("X-Frame-Options", "SAMEORIGIN");
|
||||
void (async () => {
|
||||
try {
|
||||
if (!SERVE_STATIC) {
|
||||
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
||||
res.end(DEV_HINT);
|
||||
const requestUrl = new URL(req.url ?? "/", "http://localhost");
|
||||
if (requestUrl.pathname === "/api/feedback") {
|
||||
await handleFeedback(req, res);
|
||||
return;
|
||||
}
|
||||
const url = new URL(req.url ?? "/", "http://localhost");
|
||||
let filePath = path.join(WEB_DIST, decodeURIComponent(url.pathname));
|
||||
if (!filePath.startsWith(WEB_DIST)) {
|
||||
if (requestUrl.pathname === "/api/broadcast") {
|
||||
await handleBroadcast(req, res);
|
||||
return;
|
||||
}
|
||||
if (
|
||||
requestUrl.pathname === "/api/store/admin" ||
|
||||
requestUrl.pathname === "/api/store/themes" ||
|
||||
requestUrl.pathname.startsWith("/api/store/themes/")
|
||||
) {
|
||||
await handleStore(req, res, requestUrl.pathname).catch((err) => {
|
||||
console.error("[store] Request failed:", err);
|
||||
if (!res.headersSent) {
|
||||
res.writeHead(500, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "internal" }));
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Container healthcheck target (see Dockerfile). Deliberately its own
|
||||
// route rather than "/": with WEB_STATIC=0 every browser-facing path
|
||||
// answers 404, and a probe against "/" would then report the process as
|
||||
// unhealthy for doing exactly what it was configured to do.
|
||||
if (requestUrl.pathname === "/healthz") {
|
||||
res.writeHead(200, { "Content-Type": "text/plain; charset=utf-8" });
|
||||
res.end("ok\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SERVE_STATIC) {
|
||||
// With the UI hosted elsewhere this process is an API endpoint and
|
||||
// nothing else: no SPA fallback, and not even a notice page at "/",
|
||||
// which would only put a second, stale-looking "app" on a hostname
|
||||
// that is meant to answer /ws and /api/feedback. Everything a browser
|
||||
// asks for is simply absent.
|
||||
res.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" });
|
||||
res.end("Not found\n");
|
||||
return;
|
||||
}
|
||||
let filePath = path.join(WEB_DIST, decodeURIComponent(requestUrl.pathname));
|
||||
if (filePath !== WEB_DIST && !filePath.startsWith(WEB_DIST + path.sep)) {
|
||||
res.writeHead(403);
|
||||
res.end();
|
||||
return;
|
||||
@@ -75,37 +475,186 @@ const server = createServer((req, res) => {
|
||||
filePath = path.join(WEB_DIST, "index.html");
|
||||
body = await readFile(filePath);
|
||||
}
|
||||
res.writeHead(200, { "Content-Type": MIME_TYPES[path.extname(filePath)] ?? "application/octet-stream" });
|
||||
const ext = path.extname(filePath);
|
||||
res.writeHead(200, {
|
||||
"Content-Type": MIME_TYPES[ext] ?? "application/octet-stream",
|
||||
...(ext === ".html" ? { "Content-Security-Policy": CONTENT_SECURITY_POLICY } : {}),
|
||||
});
|
||||
res.end(body);
|
||||
} catch {
|
||||
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
||||
res.end(DEV_HINT);
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
// The frontend derives ws:// or wss:// from the page's own scheme, so the
|
||||
// WebSocket follows this choice without any further configuration.
|
||||
const server = tlsOptions
|
||||
? createSecureServer(tlsOptions, requestHandler)
|
||||
: createServer(requestHandler);
|
||||
|
||||
const wss = new WebSocketServer({
|
||||
server,
|
||||
path: "/ws",
|
||||
maxPayload: WS_MAX_PAYLOAD,
|
||||
verifyClient: ({ origin, req }, done) => {
|
||||
if (ALLOWED_ORIGINS.length > 0 && origin && !ALLOWED_ORIGINS.includes(origin.toLowerCase())) {
|
||||
return done(false, 403, "Origin not allowed");
|
||||
}
|
||||
if (MAX_CONNECTIONS > 0 && wss.clients.size >= MAX_CONNECTIONS) {
|
||||
return done(false, 503, "Gateway is full");
|
||||
}
|
||||
const ip = clientIp(req);
|
||||
if (MAX_CONNECTIONS_PER_IP > 0 && (connectionsPerIp.get(ip) ?? 0) >= MAX_CONNECTIONS_PER_IP) {
|
||||
return done(false, 429, "Too many connections");
|
||||
}
|
||||
done(true);
|
||||
},
|
||||
});
|
||||
|
||||
const wss = new WebSocketServer({ server, path: "/ws" });
|
||||
// Heartbeat: a browser tab that loses its network mid-session (mobile
|
||||
// handover, Wi-Fi drop, backgrounded/frozen tab) often never sends a proper
|
||||
// WS close frame — the OS-level TCP timeout that would eventually notice can
|
||||
// take minutes, during which the connector child process (and the TS3/TeaSpeak
|
||||
// session it holds open) stays alive even though the frontend has already
|
||||
// given up and shown "disconnected". Standard `ws` ping/pong liveness check
|
||||
// closes those zombie sockets (and their connector) promptly instead.
|
||||
const HEARTBEAT_INTERVAL_MS = 20_000;
|
||||
|
||||
interface HeartbeatState {
|
||||
isAlive: boolean;
|
||||
}
|
||||
|
||||
const heartbeats = new WeakMap<WebSocket, HeartbeatState>();
|
||||
|
||||
// Tracked so SIGTERM (below) can tell every live TS3/TeaSpeak session to
|
||||
// disconnect properly before the process exits, instead of leaving the
|
||||
// target server to notice on its own timeout.
|
||||
const liveConnections = new Set<Ts3Connection>();
|
||||
// Set right before that graceful disconnect: suppresses forwarding the
|
||||
// connector's own "disconnected" event to the browser during shutdown, so
|
||||
// the browser sees a raw socket close (which it auto-reconnects from) rather
|
||||
// than an explicit disconnect (which it treats as deliberate and gives up
|
||||
// on) — see the SIGTERM handler.
|
||||
let shuttingDown = false;
|
||||
|
||||
const heartbeatTimer = setInterval(() => {
|
||||
for (const socket of wss.clients) {
|
||||
const state = heartbeats.get(socket);
|
||||
if (!state) continue;
|
||||
if (!state.isAlive) {
|
||||
socket.terminate();
|
||||
continue;
|
||||
}
|
||||
state.isAlive = false;
|
||||
socket.ping();
|
||||
}
|
||||
}, HEARTBEAT_INTERVAL_MS);
|
||||
|
||||
wss.on("close", () => clearInterval(heartbeatTimer));
|
||||
|
||||
// Docker sends SIGTERM on `docker stop`/`docker compose up -d` (redeploy)
|
||||
// before the default ~10s grace period elapses. Warn every connected
|
||||
// browser tab so an active call/stream doesn't just silently drop, then
|
||||
// exit quickly rather than waiting out the grace period doing nothing.
|
||||
process.on("SIGTERM", () => {
|
||||
void (async () => {
|
||||
const payload = JSON.stringify({ type: "notice", messageKey: "restartNotice.body" });
|
||||
for (const socket of wss.clients) {
|
||||
try {
|
||||
socket.send(payload);
|
||||
} catch {
|
||||
/* socket already gone */
|
||||
}
|
||||
}
|
||||
console.log(`[gateway] SIGTERM received, notified ${wss.clients.size} client(s), disconnecting ${liveConnections.size} live session(s)`);
|
||||
|
||||
// Tell every connector to leave its TS3/TeaSpeak server *before* the
|
||||
// process exits. Without this, `docker stop`'s grace period expires and
|
||||
// the container is killed, taking the connector child processes with it
|
||||
// mid-session - the target server only notices via its own timeout
|
||||
// (which can take a while), during which a client's automatic reconnect
|
||||
// (see App.tsx's scheduleReconnect) gets rejected by the server as a
|
||||
// duplicate identity (e.g. "ClientTooManyClonesConnected"). shuttingDown
|
||||
// suppresses forwarding the resulting "disconnected" event to the
|
||||
// browser - the browser must see a raw socket close here, not an
|
||||
// explicit disconnect, or it treats it as deliberate and won't retry.
|
||||
shuttingDown = true;
|
||||
await Promise.race([
|
||||
Promise.all([...liveConnections].map((c) => c.disconnect().catch(() => {}))),
|
||||
new Promise((resolve) => setTimeout(resolve, 5000)),
|
||||
]);
|
||||
console.log(`[gateway] shutting down`);
|
||||
process.exit(0);
|
||||
})();
|
||||
});
|
||||
|
||||
server.listen(PORT, () => {
|
||||
console.log(`WebSpeak3 gateway listening on http://localhost:${PORT} (WebSocket at /ws)`);
|
||||
const scheme = tlsOptions ? "https" : "http";
|
||||
console.log(
|
||||
`WebSpeak3 gateway listening on ${scheme}://localhost:${PORT} (WebSocket at /ws)`
|
||||
);
|
||||
if (SERVE_STATIC) {
|
||||
console.log(`Serving static UI from ${WEB_DIST}`);
|
||||
console.log(`Dev tip: use http://localhost:5173/ for live UI; rebuild web/dist after UI changes if you open :${PORT}`);
|
||||
} else {
|
||||
console.log(`Static UI disabled (WEB_STATIC=0) — open http://localhost:5173/ for the Vite dev UI`);
|
||||
console.log(`Static UI disabled (WEB_STATIC=0): WebSocket and /api/feedback only, no UI served from this host`);
|
||||
}
|
||||
});
|
||||
|
||||
wss.on("connection", (socket: WebSocket) => {
|
||||
wss.on("connection", (socket: WebSocket, req: IncomingMessage) => {
|
||||
// One browser WebSocket ↔ one Rust connector. Multi-join in the UI opens
|
||||
// multiple /ws connections in parallel (one per server tab).
|
||||
let connection: Ts3Connection | undefined;
|
||||
|
||||
socket.on("message", async (raw) => {
|
||||
const msg = JSON.parse(raw.toString());
|
||||
const ip = clientIp(req);
|
||||
connectionsPerIp.set(ip, (connectionsPerIp.get(ip) ?? 0) + 1);
|
||||
|
||||
heartbeats.set(socket, { isAlive: true });
|
||||
socket.on("pong", () => {
|
||||
const state = heartbeats.get(socket);
|
||||
if (state) state.isAlive = true;
|
||||
});
|
||||
|
||||
socket.on("message", async (raw) => {
|
||||
// Everything below runs inside this try/catch on purpose: any exception
|
||||
// here - malformed JSON, a handler throwing on unexpected input - would
|
||||
// otherwise become an unhandled rejection (this callback is async) and
|
||||
// take the whole process down with it, dropping every other connected
|
||||
// user's live session. One bad message from one tab must never do that.
|
||||
let msg: any;
|
||||
try {
|
||||
msg = JSON.parse(raw.toString());
|
||||
} catch {
|
||||
socket.send(JSON.stringify({ type: "error", message: "Invalid JSON" }));
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await handleMessage(msg);
|
||||
} catch (err) {
|
||||
console.error("[gateway] Error handling WS message:", err);
|
||||
try {
|
||||
socket.send(JSON.stringify({ type: "error", message: "Internal error handling message" }));
|
||||
} catch {
|
||||
/* socket already gone */
|
||||
}
|
||||
}
|
||||
|
||||
async function handleMessage(msg: any): Promise<void> {
|
||||
switch (msg.type) {
|
||||
case "connect": {
|
||||
if (!isValidHost(msg.host) || !isValidNickname(msg.nickname)) {
|
||||
socket.send(JSON.stringify({ type: "error", message: "Invalid server address or nickname." }));
|
||||
break;
|
||||
}
|
||||
if (!isServerAllowed(msg.host)) {
|
||||
socket.send(
|
||||
JSON.stringify({ type: "error", message: "This server is not allowed by this gateway's admin." }),
|
||||
);
|
||||
break;
|
||||
}
|
||||
// Replacing a connection on the same socket: tear down the previous
|
||||
// connector so we don't leak processes.
|
||||
if (connection) {
|
||||
@@ -114,6 +663,7 @@ wss.on("connection", (socket: WebSocket) => {
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
liveConnections.delete(connection);
|
||||
connection = undefined;
|
||||
}
|
||||
const options: Ts3ConnectOptions = {
|
||||
@@ -127,14 +677,31 @@ wss.on("connection", (socket: WebSocket) => {
|
||||
privilegeKey: parsePrivilegeKey(msg),
|
||||
};
|
||||
connection = new Ts3Connection(options);
|
||||
connection.onEvent((event) => socket.send(JSON.stringify(event)));
|
||||
liveConnections.add(connection);
|
||||
connection.onEvent((event) => {
|
||||
if (shuttingDown) return;
|
||||
if (event.type === "connected") {
|
||||
logConnectionEvent({ type: "connected", host: options.host, server: event.serverName });
|
||||
} else if (event.type === "disconnected") {
|
||||
logConnectionEvent({ type: "disconnected", host: options.host });
|
||||
}
|
||||
socket.send(JSON.stringify(event));
|
||||
});
|
||||
await connection.connect();
|
||||
break;
|
||||
}
|
||||
case "switchChannel": {
|
||||
const channelId = Number(msg.channelId);
|
||||
if (Number.isFinite(channelId)) {
|
||||
await connection?.switchChannel(channelId);
|
||||
await connection?.switchChannel(channelId, msg.channelPassword);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "moveClient": {
|
||||
const clientId = Number(msg.clientId);
|
||||
const channelId = Number(msg.channelId);
|
||||
if (Number.isFinite(clientId) && Number.isFinite(channelId)) {
|
||||
await connection?.moveClient(clientId, channelId, msg.channelPassword);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -158,6 +725,61 @@ wss.on("connection", (socket: WebSocket) => {
|
||||
await connection?.sendAudio(msg.pcm);
|
||||
break;
|
||||
}
|
||||
case "requestStreamInfo": {
|
||||
const clientId = Number(msg.clientId);
|
||||
if (Number.isFinite(clientId)) await connection?.requestStreamInfo(clientId);
|
||||
break;
|
||||
}
|
||||
case "joinStream": {
|
||||
const clientId = Number(msg.clientId);
|
||||
if (Number.isFinite(clientId)) {
|
||||
await connection?.joinStream(String(msg.streamId ?? ""), clientId, msg.message ?? "");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "leaveStream": {
|
||||
const clientId = Number(msg.clientId);
|
||||
if (Number.isFinite(clientId)) {
|
||||
await connection?.leaveStream(String(msg.streamId ?? ""), clientId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "streamSignal": {
|
||||
const clientId = Number(msg.clientId);
|
||||
if (Number.isFinite(clientId) && msg.payload !== undefined) {
|
||||
await connection?.sendStreamSignal(String(msg.streamId ?? ""), clientId, msg.payload);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "setupStream": {
|
||||
await connection?.setupStream({
|
||||
name: String(msg.name ?? "Stream"),
|
||||
type: Number(msg.streamType ?? 3),
|
||||
bitrate: Number(msg.bitrate ?? 1_500_000),
|
||||
accessibility: Number(msg.accessibility ?? 1),
|
||||
mode: Number(msg.mode ?? 1),
|
||||
viewerLimit: Number(msg.viewerLimit ?? 0),
|
||||
audio: Boolean(msg.audio),
|
||||
});
|
||||
break;
|
||||
}
|
||||
case "respondJoinStream": {
|
||||
const clientId = Number(msg.clientId);
|
||||
if (Number.isFinite(clientId)) {
|
||||
await connection?.respondJoinStream(
|
||||
String(msg.streamId ?? ""),
|
||||
clientId,
|
||||
Boolean(msg.accept),
|
||||
String(msg.offer ?? ""),
|
||||
String(msg.message ?? ""),
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "stopStream": {
|
||||
await connection?.stopStream(String(msg.streamId ?? ""), String(msg.reason ?? ""));
|
||||
break;
|
||||
}
|
||||
case "setAway": {
|
||||
await connection?.setAway(msg.away, msg.message ?? "");
|
||||
break;
|
||||
@@ -320,6 +942,8 @@ wss.on("connection", (socket: WebSocket) => {
|
||||
}
|
||||
case "disconnect": {
|
||||
await connection?.disconnect(msg.message ?? "");
|
||||
if (connection) liveConnections.delete(connection);
|
||||
connection = undefined;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -327,9 +951,15 @@ wss.on("connection", (socket: WebSocket) => {
|
||||
JSON.stringify({ type: "error", message: `Unknown message type: ${msg.type}` })
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socket.on("close", () => {
|
||||
const remaining = (connectionsPerIp.get(ip) ?? 1) - 1;
|
||||
if (remaining > 0) connectionsPerIp.set(ip, remaining);
|
||||
else connectionsPerIp.delete(ip);
|
||||
heartbeats.delete(socket);
|
||||
if (connection) liveConnections.delete(connection);
|
||||
connection?.disconnect();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
import type { IncomingMessage } from "node:http";
|
||||
|
||||
// Behind a reverse proxy / tunnel (e.g. cloudflared) every request arrives
|
||||
// from the proxy's own address, so per-IP limits would lump all users into
|
||||
// one bucket. TRUST_PROXY=1 makes us read the client IP the proxy reports
|
||||
// instead - only set it when the gateway is reachable *solely* through that
|
||||
// proxy, otherwise anyone can send the header and pick their own "IP".
|
||||
const TRUST_PROXY = process.env.TRUST_PROXY === "1";
|
||||
|
||||
export function clientIp(req: IncomingMessage): string {
|
||||
if (TRUST_PROXY) {
|
||||
const cf = req.headers["cf-connecting-ip"];
|
||||
if (typeof cf === "string" && cf) return cf.trim();
|
||||
const xff = req.headers["x-forwarded-for"];
|
||||
const first = (Array.isArray(xff) ? xff[0] : xff)?.split(",")[0]?.trim();
|
||||
if (first) return first;
|
||||
}
|
||||
return (req.socket.remoteAddress ?? "unknown").replace(/^::ffff:/, "");
|
||||
}
|
||||
|
||||
/** Sliding-window "N per window per key" limiter. Expired keys are swept
|
||||
* periodically so the map can't grow without bound under a stream of
|
||||
* one-shot IPs. */
|
||||
export function createRateLimiter(limit: number, windowMs: number): (key: string) => boolean {
|
||||
const hits = new Map<string, number[]>();
|
||||
setInterval(() => {
|
||||
const now = Date.now();
|
||||
for (const [key, times] of hits) {
|
||||
if (times.every((t) => now - t >= windowMs)) hits.delete(key);
|
||||
}
|
||||
}, windowMs).unref();
|
||||
return (key) => {
|
||||
const now = Date.now();
|
||||
const recent = (hits.get(key) ?? []).filter((t) => now - t < windowMs);
|
||||
recent.push(now);
|
||||
hits.set(key, recent);
|
||||
return recent.length > limit;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,524 @@
|
||||
// --- Design Store endpoint -------------------------------------------------
|
||||
//
|
||||
// Opt-in only, same convention as LOG_CONNECTIONS/FEEDBACK_ENABLED/BROADCAST_TOKEN
|
||||
// in index.ts: public CSS uploads need moderation attention a plain self-hosted
|
||||
// instance shouldn't inherit just because the code exists. Set STORE_ENABLED=1
|
||||
// to turn it on.
|
||||
//
|
||||
// Kept in its own module (unlike feedback/broadcast, which stay inline in
|
||||
// index.ts) so the private VPS overlay - a hand-patched fork of index.ts that
|
||||
// swaps feedback/connection persistence to SQLite - never needs this file
|
||||
// touched. It has zero private modifications, so the overlay just copies it
|
||||
// verbatim; only index.ts's small SQLite-persistence sections need patching.
|
||||
import type { IncomingMessage, ServerResponse } from "node:http";
|
||||
import { readFile, rename, writeFile } from "node:fs/promises";
|
||||
import { timingSafeEqual, randomUUID } from "node:crypto";
|
||||
import path from "node:path";
|
||||
import { clientIp, createRateLimiter } from "./net.js";
|
||||
|
||||
const STORE_ENABLED = process.env.STORE_ENABLED === "1";
|
||||
const STORE_ALLOWED_ORIGIN = process.env.STORE_ALLOWED_ORIGIN ?? "*";
|
||||
// Plain JSON file (whole-array read-modify-write, not JSON-lines like
|
||||
// feedback.log in index.ts): the store needs to list and look up by id, and
|
||||
// the expected volume (community theme submissions) is small enough that
|
||||
// rewriting the whole file each time is simpler than a real DB - see the
|
||||
// "never add SQLite to the public gateway" note in mem:reference_webspeak3_private_sqlite_persistence.
|
||||
const STORE_DATA_FILE = process.env.STORE_DATA_FILE ?? path.resolve(process.cwd(), "store-themes.json");
|
||||
const STORE_NAME_MAX_LENGTH = 60;
|
||||
const STORE_AUTHOR_MAX_LENGTH = 40;
|
||||
const STORE_DESCRIPTION_MAX_LENGTH = 300;
|
||||
const STORE_CSS_MAX_LENGTH = 50_000;
|
||||
// ~300KB image after base64 overhead - screenshots live inline in the same
|
||||
// flat JSON file as everything else, so this also bounds that file's growth.
|
||||
const STORE_SCREENSHOT_MAX_DATA_URL_LENGTH = 400_000;
|
||||
const STORE_SCREENSHOT_RE = /^data:image\/(png|jpe?g|webp);base64,[A-Za-z0-9+/]+=*$/;
|
||||
// Hard cap so the flat file - and the in-memory cache mirroring it - can't
|
||||
// grow unbounded from spam that slips past rate limiting (a fresh IP per
|
||||
// submission, say). Bounds worst case to ~300 * 450KB =~ 135MB in RAM.
|
||||
const STORE_MAX_THEMES = 300;
|
||||
const STORE_BASE_THEMES = new Set(["standard", "nova", "greenteaspeak", "pulse"]);
|
||||
|
||||
// A handful of names (the operator's own) that only whoever holds
|
||||
// STORE_ADMIN_TOKEN may publish under - stops anyone else from impersonating
|
||||
// the maintainer in the author field. Everyone else's name is first-come,
|
||||
// unenforced, same as any other free-text field here.
|
||||
const STORE_RESERVED_AUTHORS = new Set(
|
||||
(process.env.STORE_RESERVED_AUTHORS ?? "Möpchi,Moepchi")
|
||||
.split(",")
|
||||
.map((s) => s.trim().toLowerCase())
|
||||
.filter(Boolean)
|
||||
);
|
||||
const STORE_ADMIN_TOKEN = process.env.STORE_ADMIN_TOKEN;
|
||||
|
||||
function isValidStoreAdminToken(provided: string): boolean {
|
||||
if (!STORE_ADMIN_TOKEN) return false;
|
||||
const a = Buffer.from(provided);
|
||||
const b = Buffer.from(STORE_ADMIN_TOKEN);
|
||||
return a.length === b.length && timingSafeEqual(a, b);
|
||||
}
|
||||
|
||||
interface StoreTheme {
|
||||
id: string;
|
||||
name: string;
|
||||
baseTheme: string;
|
||||
css: string;
|
||||
author: string;
|
||||
description: string;
|
||||
screenshot: string | null;
|
||||
ratingSum: number;
|
||||
ratingCount: number;
|
||||
createdAt: string;
|
||||
// New submissions start "pending" and only become public once someone
|
||||
// holding STORE_ADMIN_TOKEN approves them (GET /api/store/admin); rejected
|
||||
// ones are deleted outright. "rejected" only survives in old data files.
|
||||
status: "approved" | "pending" | "rejected";
|
||||
}
|
||||
|
||||
// Undo what a plain pattern check would miss: comments splitting a keyword
|
||||
// (u/**/rl), CSS escapes (\75 rl( is url(), and case.
|
||||
function normalizeCss(css: string): string {
|
||||
return css
|
||||
.replace(/\/\*[\s\S]*?\*\//g, "")
|
||||
.replace(/\\([0-9a-f]{1,6})\s?/gi, (_, hex: string) => {
|
||||
const cp = parseInt(hex, 16);
|
||||
return cp > 0 && cp <= 0x10ffff ? String.fromCodePoint(cp) : "\ufffd";
|
||||
})
|
||||
.replace(/\\(.)/gs, "$1")
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
// Theme CSS runs in every installer's browser, so it may style the app but
|
||||
// never load anything: no imports/fonts, no functions that fetch a resource,
|
||||
// and url() only for inline data: images. Everything else (colors,
|
||||
// selectors, animations) can at worst look bad - which moderation catches.
|
||||
const FORBIDDEN_CSS = [
|
||||
/@import/,
|
||||
/@font-face/,
|
||||
/@namespace/,
|
||||
/(?:^|[^a-z-])(?:image-set|image|cross-fade|element|src|expression)\s*\(/,
|
||||
/-moz-binding/,
|
||||
/behavior\s*:/,
|
||||
/javascript:/,
|
||||
/<\/?style/,
|
||||
];
|
||||
|
||||
export function isSafeThemeCss(css: string): boolean {
|
||||
const normalized = normalizeCss(css);
|
||||
if (FORBIDDEN_CSS.some((re) => re.test(normalized))) return false;
|
||||
for (const match of normalized.matchAll(/url\s*\(\s*(["']?)\s*([^"')\s]*)/g)) {
|
||||
if (!/^data:image\/(?:png|jpeg|gif|webp|svg\+xml)[;,]/.test(match[2])) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
let storeCache: StoreTheme[] | null = null;
|
||||
|
||||
async function loadStoreThemes(): Promise<StoreTheme[]> {
|
||||
if (storeCache) return storeCache;
|
||||
try {
|
||||
storeCache = JSON.parse(await readFile(STORE_DATA_FILE, "utf-8")) as StoreTheme[];
|
||||
} catch (err) {
|
||||
// Only a missing file means "no themes yet". Anything else (unreadable,
|
||||
// corrupt) must fail loudly - treating it as empty would let the next
|
||||
// submission overwrite every stored theme.
|
||||
if ((err as NodeJS.ErrnoException).code !== "ENOENT") throw err;
|
||||
storeCache = [];
|
||||
}
|
||||
return storeCache;
|
||||
}
|
||||
|
||||
async function saveStoreThemes(themes: StoreTheme[]): Promise<void> {
|
||||
storeCache = themes;
|
||||
// Write-then-rename: a crash mid-write must not leave a truncated file,
|
||||
// which loadStoreThemes() would read as "no themes" and then overwrite.
|
||||
const tmp = `${STORE_DATA_FILE}.tmp`;
|
||||
await writeFile(tmp, JSON.stringify(themes), "utf-8");
|
||||
await rename(tmp, STORE_DATA_FILE);
|
||||
}
|
||||
|
||||
function isAdminRequest(req: IncomingMessage): boolean {
|
||||
const authHeader = req.headers.authorization ?? "";
|
||||
return authHeader.startsWith("Bearer ") && isValidStoreAdminToken(authHeader.slice("Bearer ".length));
|
||||
}
|
||||
|
||||
// Approved, and still passing today's CSS check - themes published before
|
||||
// that check got stricter are hidden instead of served.
|
||||
function isPublic(theme: StoreTheme): boolean {
|
||||
return theme.status === "approved" && isSafeThemeCss(theme.css);
|
||||
}
|
||||
|
||||
// Same in-memory-per-IP approach as FEEDBACK_RATE_LIMIT in index.ts; kept as a
|
||||
// separate map since the two endpoints are independent.
|
||||
const STORE_RATE_LIMIT = 5;
|
||||
const STORE_RATE_WINDOW_MS = 60 * 60 * 1000;
|
||||
const isStoreRateLimited = createRateLimiter(STORE_RATE_LIMIT, STORE_RATE_WINDOW_MS);
|
||||
|
||||
// One rating per IP per theme - not robust against a determined multi-IP
|
||||
// spammer, but it stops the trivial "click again" case with no accounts to
|
||||
// build. Memory-only, so it resets on redeploy; a repeat vote after that just
|
||||
// counts twice, which is an acceptable ceiling for a beta feature.
|
||||
const storeRatingsSeen = new Set<string>();
|
||||
|
||||
function setStoreCors(res: ServerResponse) {
|
||||
res.setHeader("Access-Control-Allow-Origin", STORE_ALLOWED_ORIGIN);
|
||||
res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
||||
res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization");
|
||||
}
|
||||
|
||||
function storeRating(theme: StoreTheme): { average: number; count: number } {
|
||||
// theme.ratingCount is undefined for themes submitted before this field existed.
|
||||
const count = theme.ratingCount ?? 0;
|
||||
return { average: count ? theme.ratingSum / count : 0, count };
|
||||
}
|
||||
|
||||
async function handleStoreList(res: ServerResponse) {
|
||||
const themes = await loadStoreThemes();
|
||||
const listing = themes
|
||||
.filter(isPublic)
|
||||
.sort((a, b) => b.createdAt.localeCompare(a.createdAt))
|
||||
.map((t) => ({
|
||||
id: t.id,
|
||||
name: t.name,
|
||||
baseTheme: t.baseTheme,
|
||||
author: t.author,
|
||||
description: t.description ?? "",
|
||||
hasScreenshot: Boolean(t.screenshot),
|
||||
rating: storeRating(t),
|
||||
createdAt: t.createdAt,
|
||||
}));
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify(listing));
|
||||
}
|
||||
|
||||
async function handleStoreDownload(req: IncomingMessage, res: ServerResponse, id: string) {
|
||||
const themes = await loadStoreThemes();
|
||||
const theme = themes.find((t) => t.id === id && (isPublic(t) || isAdminRequest(req)));
|
||||
if (!theme) {
|
||||
res.writeHead(404, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "not_found" }));
|
||||
return;
|
||||
}
|
||||
// Same shape as the client's own .webspeak3theme.json export/import, so the
|
||||
// browsed result feeds straight into the existing import validator.
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ name: theme.name, baseTheme: theme.baseTheme, css: theme.css }));
|
||||
}
|
||||
|
||||
async function handleStoreScreenshot(req: IncomingMessage, res: ServerResponse, id: string) {
|
||||
const themes = await loadStoreThemes();
|
||||
const theme = themes.find((t) => t.id === id && (isPublic(t) || isAdminRequest(req)));
|
||||
if (!theme?.screenshot) {
|
||||
res.writeHead(404, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "not_found" }));
|
||||
return;
|
||||
}
|
||||
const match = /^data:(image\/[a-z]+);base64,(.+)$/.exec(theme.screenshot);
|
||||
if (!match) {
|
||||
res.writeHead(404, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "not_found" }));
|
||||
return;
|
||||
}
|
||||
res.writeHead(200, { "Content-Type": match[1], "Cache-Control": "public, max-age=3600" });
|
||||
res.end(Buffer.from(match[2], "base64"));
|
||||
}
|
||||
|
||||
async function handleStoreRate(req: IncomingMessage, res: ServerResponse, id: string) {
|
||||
const ip = clientIp(req);
|
||||
const seenKey = `${ip}:${id}`;
|
||||
if (storeRatingsSeen.has(seenKey)) {
|
||||
res.writeHead(409, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "already_rated" }));
|
||||
return;
|
||||
}
|
||||
|
||||
let raw = "";
|
||||
for await (const chunk of req) {
|
||||
raw += chunk;
|
||||
if (raw.length > 200) {
|
||||
res.writeHead(413, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "payload_too_large" }));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let body: { stars?: unknown };
|
||||
try {
|
||||
body = JSON.parse(raw || "{}");
|
||||
} catch {
|
||||
res.writeHead(400, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "invalid_json" }));
|
||||
return;
|
||||
}
|
||||
|
||||
const stars = typeof body.stars === "number" ? Math.round(body.stars) : NaN;
|
||||
if (!Number.isInteger(stars) || stars < 1 || stars > 5) {
|
||||
res.writeHead(400, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "invalid_stars" }));
|
||||
return;
|
||||
}
|
||||
|
||||
const themes = await loadStoreThemes();
|
||||
const theme = themes.find((t) => t.id === id && isPublic(t));
|
||||
if (!theme) {
|
||||
res.writeHead(404, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "not_found" }));
|
||||
return;
|
||||
}
|
||||
|
||||
theme.ratingSum = (theme.ratingSum ?? 0) + stars;
|
||||
theme.ratingCount = (theme.ratingCount ?? 0) + 1;
|
||||
try {
|
||||
await saveStoreThemes(themes);
|
||||
} catch (err) {
|
||||
console.error("[store] Failed to save rating:", err);
|
||||
res.writeHead(500, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "save_failed" }));
|
||||
return;
|
||||
}
|
||||
// ponytail: wholesale reset instead of per-entry expiry; only bounds memory,
|
||||
// at worst it lets old voters vote once more, same as a redeploy does.
|
||||
if (storeRatingsSeen.size > 100_000) storeRatingsSeen.clear();
|
||||
storeRatingsSeen.add(seenKey);
|
||||
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ ok: true, rating: storeRating(theme) }));
|
||||
}
|
||||
|
||||
async function handleStoreSubmit(req: IncomingMessage, res: ServerResponse) {
|
||||
const ip = clientIp(req);
|
||||
if (isStoreRateLimited(ip)) {
|
||||
res.writeHead(429, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "rate_limited" }));
|
||||
return;
|
||||
}
|
||||
|
||||
let raw = "";
|
||||
const maxBytes = STORE_CSS_MAX_LENGTH + STORE_SCREENSHOT_MAX_DATA_URL_LENGTH + 5_000;
|
||||
for await (const chunk of req) {
|
||||
raw += chunk;
|
||||
if (raw.length > maxBytes) {
|
||||
res.writeHead(413, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "payload_too_large" }));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let body: {
|
||||
name?: unknown;
|
||||
baseTheme?: unknown;
|
||||
css?: unknown;
|
||||
author?: unknown;
|
||||
description?: unknown;
|
||||
screenshot?: unknown;
|
||||
website?: unknown;
|
||||
};
|
||||
try {
|
||||
body = JSON.parse(raw || "{}");
|
||||
} catch {
|
||||
res.writeHead(400, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "invalid_json" }));
|
||||
return;
|
||||
}
|
||||
|
||||
// Honeypot, same as /api/feedback in index.ts.
|
||||
if (typeof body.website === "string" && body.website.trim() !== "") {
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ ok: true }));
|
||||
return;
|
||||
}
|
||||
|
||||
const name = typeof body.name === "string" ? body.name.trim().slice(0, STORE_NAME_MAX_LENGTH) : "";
|
||||
const baseTheme = typeof body.baseTheme === "string" && STORE_BASE_THEMES.has(body.baseTheme) ? body.baseTheme : "";
|
||||
const rawCss = typeof body.css === "string" ? body.css.slice(0, STORE_CSS_MAX_LENGTH) : "";
|
||||
const author =
|
||||
typeof body.author === "string" ? body.author.trim().slice(0, STORE_AUTHOR_MAX_LENGTH) || "Anonymous" : "Anonymous";
|
||||
const description = typeof body.description === "string" ? body.description.trim().slice(0, STORE_DESCRIPTION_MAX_LENGTH) : "";
|
||||
|
||||
if (!name || !baseTheme || !rawCss) {
|
||||
res.writeHead(400, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "invalid_theme" }));
|
||||
return;
|
||||
}
|
||||
|
||||
const isAdmin = isAdminRequest(req);
|
||||
if (STORE_RESERVED_AUTHORS.has(author.toLowerCase())) {
|
||||
if (!isAdmin) {
|
||||
res.writeHead(403, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "author_reserved" }));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const css = rawCss;
|
||||
if (!isSafeThemeCss(css)) {
|
||||
res.writeHead(400, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "css_rejected" }));
|
||||
return;
|
||||
}
|
||||
|
||||
let screenshot: string | null = null;
|
||||
if (typeof body.screenshot === "string" && body.screenshot !== "") {
|
||||
if (body.screenshot.length > STORE_SCREENSHOT_MAX_DATA_URL_LENGTH || !STORE_SCREENSHOT_RE.test(body.screenshot)) {
|
||||
res.writeHead(400, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "invalid_screenshot" }));
|
||||
return;
|
||||
}
|
||||
screenshot = body.screenshot;
|
||||
}
|
||||
|
||||
const themes = await loadStoreThemes();
|
||||
if (themes.length >= STORE_MAX_THEMES) {
|
||||
res.writeHead(507, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "store_full" }));
|
||||
return;
|
||||
}
|
||||
|
||||
const theme: StoreTheme = {
|
||||
id: randomUUID(),
|
||||
name,
|
||||
baseTheme,
|
||||
css,
|
||||
author,
|
||||
description,
|
||||
screenshot,
|
||||
ratingSum: 0,
|
||||
ratingCount: 0,
|
||||
createdAt: new Date().toISOString(),
|
||||
// The admin's own submissions skip the queue - they'd approve them anyway.
|
||||
status: isAdmin ? "approved" : "pending",
|
||||
};
|
||||
themes.push(theme);
|
||||
try {
|
||||
await saveStoreThemes(themes);
|
||||
} catch (err) {
|
||||
console.error("[store] Failed to save theme:", err);
|
||||
res.writeHead(500, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "save_failed" }));
|
||||
return;
|
||||
}
|
||||
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ ok: true, id: theme.id, status: theme.status }));
|
||||
if (theme.status === "pending") console.log(`[store] New theme awaiting review: "${theme.name}" (${theme.id})`);
|
||||
}
|
||||
|
||||
async function handleStorePending(req: IncomingMessage, res: ServerResponse) {
|
||||
if (!isAdminRequest(req)) {
|
||||
res.writeHead(401, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "unauthorized" }));
|
||||
return;
|
||||
}
|
||||
const themes = await loadStoreThemes();
|
||||
const pending = themes
|
||||
.filter((t) => t.status === "pending")
|
||||
.map(({ screenshot, ratingSum: _s, ratingCount: _c, ...t }) => ({ ...t, hasScreenshot: Boolean(screenshot) }));
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify(pending));
|
||||
}
|
||||
|
||||
async function handleStoreModerate(req: IncomingMessage, res: ServerResponse, id: string, action: string) {
|
||||
if (!isAdminRequest(req)) {
|
||||
res.writeHead(401, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "unauthorized" }));
|
||||
return;
|
||||
}
|
||||
const themes = await loadStoreThemes();
|
||||
const index = themes.findIndex((t) => t.id === id);
|
||||
if (index === -1) {
|
||||
res.writeHead(404, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "not_found" }));
|
||||
return;
|
||||
}
|
||||
// Reject and delete are the same thing: drop it, freeing its slot.
|
||||
if (action === "approve") themes[index].status = "approved";
|
||||
else themes.splice(index, 1);
|
||||
try {
|
||||
await saveStoreThemes(themes);
|
||||
} catch (err) {
|
||||
console.error("[store] Failed to save moderation result:", err);
|
||||
res.writeHead(500, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "save_failed" }));
|
||||
return;
|
||||
}
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ ok: true }));
|
||||
}
|
||||
|
||||
// Minimal moderation page. The theme CSS is shown as text only (textContent),
|
||||
// never applied, so reviewing a hostile submission is harmless.
|
||||
const ADMIN_PAGE = `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Store moderation</title><style>
|
||||
body{font:14px system-ui;margin:0 auto;padding:1rem;max-width:60rem;background:#111;color:#eee}
|
||||
input,button{font:inherit;padding:.4rem .7rem}article{border:1px solid #444;border-radius:8px;padding:1rem;margin:1rem 0}
|
||||
pre{max-height:20rem;overflow:auto;background:#000;padding:.5rem;white-space:pre-wrap}img{max-width:100%}
|
||||
.ok{background:#2a6}.no{background:#a33}button{color:#fff;border:0;border-radius:4px;cursor:pointer}
|
||||
</style></head><body><h1>Design Store – pending themes</h1>
|
||||
<p><input id="token" type="password" placeholder="STORE_ADMIN_TOKEN" size="40"> <button class="ok" id="load">Load</button></p>
|
||||
<div id="list"></div><script>
|
||||
const base = location.pathname.replace(/\/admin$/, "/themes");
|
||||
const auth = () => ({ Authorization: "Bearer " + document.getElementById("token").value });
|
||||
async function load() {
|
||||
const list = document.getElementById("list");
|
||||
list.textContent = "Loading…";
|
||||
const res = await fetch(base + "/pending", { headers: auth() });
|
||||
if (!res.ok) { list.textContent = "Error " + res.status; return; }
|
||||
const themes = await res.json();
|
||||
list.textContent = themes.length ? "" : "Nothing to review.";
|
||||
for (const t of themes) {
|
||||
const el = document.createElement("article");
|
||||
const h = document.createElement("h2"); h.textContent = t.name + " – " + t.author + " (" + t.baseTheme + ")"; el.append(h);
|
||||
const d = document.createElement("p"); d.textContent = t.description + " · " + t.createdAt; el.append(d);
|
||||
if (t.hasScreenshot) {
|
||||
const img = document.createElement("img"); el.append(img);
|
||||
fetch(base + "/" + t.id + "/screenshot", { headers: auth() }).then(r => r.blob()).then(b => img.src = URL.createObjectURL(b));
|
||||
}
|
||||
const pre = document.createElement("pre"); pre.textContent = t.css; el.append(pre);
|
||||
for (const [action, label, cls] of [["approve", "Approve", "ok"], ["reject", "Reject (delete)", "no"]]) {
|
||||
const b = document.createElement("button"); b.textContent = label; b.className = cls; b.style.marginRight = ".5rem";
|
||||
b.onclick = async () => {
|
||||
const r = await fetch(base + "/" + t.id + "/" + action, { method: "POST", headers: auth() });
|
||||
if (r.ok) el.remove(); else alert("Error " + r.status);
|
||||
};
|
||||
el.append(b);
|
||||
}
|
||||
list.append(el);
|
||||
}
|
||||
}
|
||||
document.getElementById("load").onclick = load;
|
||||
</script></body></html>`;
|
||||
|
||||
export async function handleStore(req: IncomingMessage, res: ServerResponse, pathname: string) {
|
||||
setStoreCors(res);
|
||||
if (req.method === "OPTIONS") {
|
||||
res.writeHead(204);
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
if (!STORE_ENABLED) {
|
||||
res.writeHead(404, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "not_found" }));
|
||||
return;
|
||||
}
|
||||
|
||||
if (pathname === "/api/store/admin") {
|
||||
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-store" });
|
||||
res.end(ADMIN_PAGE);
|
||||
return;
|
||||
}
|
||||
if (pathname === "/api/store/themes") {
|
||||
if (req.method === "GET") return handleStoreList(res);
|
||||
if (req.method === "POST") return handleStoreSubmit(req, res);
|
||||
} else {
|
||||
const [id, sub] = pathname.slice("/api/store/themes/".length).split("/");
|
||||
if (id === "pending" && !sub && req.method === "GET") return handleStorePending(req, res);
|
||||
if (id && !sub && req.method === "GET") return handleStoreDownload(req, res, id);
|
||||
if (id && sub === "screenshot" && req.method === "GET") return handleStoreScreenshot(req, res, id);
|
||||
if (id && (sub === "approve" || sub === "reject") && req.method === "POST") {
|
||||
return handleStoreModerate(req, res, id, sub);
|
||||
}
|
||||
if (id && sub === "rate" && req.method === "POST") return handleStoreRate(req, res, id);
|
||||
}
|
||||
|
||||
res.writeHead(405, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "method_not_allowed" }));
|
||||
}
|
||||
+226
-61
@@ -21,6 +21,24 @@ export interface ChannelInfo {
|
||||
hasPassword: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The `setupstream` arguments. TS6 always sends all of them, so none are
|
||||
* optional here - the defaults live in the caller, not on the wire.
|
||||
*/
|
||||
export interface StreamSetupOptions {
|
||||
name: string;
|
||||
/** Source kind; a real TS6 screen share sends 3. */
|
||||
type: number;
|
||||
bitrate: number;
|
||||
/** TS6's Privacy setting: who may join without being asked. */
|
||||
accessibility: number;
|
||||
/** Connection mode - peer-to-peer or via the server's SFU. */
|
||||
mode: number;
|
||||
/** 0 means unlimited. */
|
||||
viewerLimit: number;
|
||||
audio: boolean;
|
||||
}
|
||||
|
||||
export interface ClientInfo {
|
||||
id: number;
|
||||
channel: number;
|
||||
@@ -37,6 +55,10 @@ export interface ClientInfo {
|
||||
channelGroup: number;
|
||||
serverGroups: number[];
|
||||
hasTalkPower: boolean;
|
||||
/** ServerQuery client; UI may hide these unless enabled per favorite. */
|
||||
isQuery: boolean;
|
||||
/** Broadcasting a TS6 Stream/Call. The stream id is fetched separately. */
|
||||
isStreaming: boolean;
|
||||
}
|
||||
|
||||
export interface GroupEntry {
|
||||
@@ -131,6 +153,7 @@ export type Ts3ConnectionEvent =
|
||||
| { type: "talkers"; clients: number[] }
|
||||
| { type: "disconnected"; reason: string }
|
||||
| { type: "error"; message: string }
|
||||
| { type: "channelPasswordRequired"; channelId: number }
|
||||
| ({ type: "serverLog" } & ServerLogEntry)
|
||||
| {
|
||||
type: "clientConnectionInfo";
|
||||
@@ -181,7 +204,9 @@ export type Ts3ConnectionEvent =
|
||||
| { type: "fileDownloadData"; cid: number; path: string; data: string }
|
||||
| { type: "fileUploadDone"; cid: number; path: string }
|
||||
| { type: "permList"; scope: PermScope; id1: number; id2: number | null; entries: PermissionOverviewEntry[] }
|
||||
| { type: "permissionCatalog"; entries: PermissionCatalogEntry[] };
|
||||
| { type: "permissionCatalog"; entries: PermissionCatalogEntry[] }
|
||||
/** TS6 Stream/Call signaling, forwarded verbatim; `args` is already unescaped. */
|
||||
| { type: "streamEvent"; name: string; args: Record<string, string> };
|
||||
|
||||
export type ServerType = "teamspeak" | "teaspeak" | "auto";
|
||||
|
||||
@@ -212,6 +237,11 @@ const CONNECTOR_BIN =
|
||||
export class Ts3Connection {
|
||||
private listeners = new Set<(event: Ts3ConnectionEvent) => void>();
|
||||
private child?: ChildProcessWithoutNullStreams;
|
||||
// Set once the child is confirmed gone - either it exited, or it never
|
||||
// managed to spawn at all. disconnect() uses this to skip waiting on an
|
||||
// "exit" event that already fired (and so will never fire again) before
|
||||
// disconnect() got a chance to listen for it.
|
||||
private childGone = false;
|
||||
|
||||
constructor(private options: Ts3ConnectOptions) {}
|
||||
|
||||
@@ -223,15 +253,50 @@ export class Ts3Connection {
|
||||
for (const listener of this.listeners) listener(event);
|
||||
}
|
||||
|
||||
/** Every connector command is exactly one line on this stdin protocol.
|
||||
* Several call sites forward fields (permission scope/ids, whisper
|
||||
* targets, ...) without stripping embedded CR/LF first - routing every
|
||||
* write through here means a stray newline in any of them can never
|
||||
* smuggle in a second, attacker-chosen command. */
|
||||
private writeLine(line: string): void {
|
||||
if (!this.child || this.child.killed) return;
|
||||
this.child.stdin.write(`${line.replace(/[\r\n]+/g, " ")}\n`);
|
||||
}
|
||||
|
||||
async connect(): Promise<void> {
|
||||
const args = ["--address", this.options.host, "--nickname", this.options.nickname];
|
||||
if (this.options.serverPassword) args.push("--server-password", this.options.serverPassword);
|
||||
if (this.options.channelPassword) args.push("--channel-password", this.options.channelPassword);
|
||||
if (this.options.defaultChannel) args.push("--default-channel", this.options.defaultChannel);
|
||||
if (this.options.identity) args.push("--identity", this.options.identity);
|
||||
if (this.options.serverType) args.push("--server-type", this.options.serverType);
|
||||
if (this.options.privilegeKey) args.push("--privilege-key", this.options.privilegeKey);
|
||||
this.child = spawn(CONNECTOR_BIN, args);
|
||||
// "--flag=value" so a value starting with "-" can never be parsed as a
|
||||
// flag of its own. Secrets go through the environment instead of argv,
|
||||
// which any process on the host can read via `ps`.
|
||||
const args = [`--address=${this.options.host}`, `--nickname=${this.options.nickname}`];
|
||||
if (this.options.defaultChannel) args.push(`--default-channel=${this.options.defaultChannel}`);
|
||||
if (this.options.serverType) args.push(`--server-type=${this.options.serverType}`);
|
||||
const env: NodeJS.ProcessEnv = { ...process.env };
|
||||
if (this.options.serverPassword) env.TS_SERVER_PASSWORD = this.options.serverPassword;
|
||||
if (this.options.channelPassword) env.TS_CHANNEL_PASSWORD = this.options.channelPassword;
|
||||
if (this.options.identity) env.TS_IDENTITY = this.options.identity;
|
||||
if (this.options.privilegeKey) env.TS_PRIVILEGE_KEY = this.options.privilegeKey;
|
||||
this.child = spawn(CONNECTOR_BIN, args, { env });
|
||||
|
||||
// The connector can exit on its own (e.g. the TS3 server drops it) and close
|
||||
// its stdin pipe before writeLine()'s `this.child.killed` guard has any way
|
||||
// to know - killed only reflects Node-side .kill() calls. A write to that
|
||||
// closed pipe emits an unhandled 'error' (EPIPE) on the stream, which Node
|
||||
// treats as fatal and crashes the whole gateway process, killing every
|
||||
// other client's session too. Listening here turns it into a normal,
|
||||
// isolated write failure instead of a process-wide crash.
|
||||
this.child.stdin.on("error", () => {});
|
||||
|
||||
// spawn() itself can fail asynchronously - wrong CONNECTOR_BIN path, no
|
||||
// exec permission, or (under load, with many connections already open)
|
||||
// EMFILE/ENFILE from running out of file descriptors. That failure surfaces
|
||||
// as an unhandled 'error' event on the child process object, which is just
|
||||
// as fatal to the whole gateway process as the stdin case above - and far
|
||||
// more likely to hit at the worst possible time, since a file-descriptor
|
||||
// limit is reached exactly when the most other connections are active.
|
||||
this.child.on("error", (err) => {
|
||||
this.childGone = true;
|
||||
this.emit({ type: "error", message: `Connector failed to start: ${err.message}` });
|
||||
});
|
||||
|
||||
createInterface({ input: this.child.stdout }).on("line", (line) => {
|
||||
try {
|
||||
@@ -251,6 +316,8 @@ export class Ts3Connection {
|
||||
channel_group: number;
|
||||
server_groups: number[];
|
||||
has_talk_power: boolean;
|
||||
is_query?: boolean;
|
||||
is_streaming?: boolean;
|
||||
}
|
||||
|
||||
interface RawChannelInfo {
|
||||
@@ -293,6 +360,7 @@ export class Ts3Connection {
|
||||
| { type: "talkers"; clients: number[] }
|
||||
| { type: "disconnected"; reason: string }
|
||||
| { type: "error"; message: string }
|
||||
| { type: "channelPasswordRequired"; channel_id: number }
|
||||
| ({ type: "serverLog" } & ServerLogEntry)
|
||||
| {
|
||||
type: "clientConnectionInfo";
|
||||
@@ -379,7 +447,8 @@ export class Ts3Connection {
|
||||
| { type: "fileDownloadData"; cid: number; path: string; data: string }
|
||||
| { type: "fileUploadDone"; cid: number; path: string }
|
||||
| { type: "permList"; scope: PermScope; id1: number; id2: number | null; entries: PermissionOverviewEntry[] }
|
||||
| { type: "permissionCatalog"; entries: PermissionCatalogEntry[] };
|
||||
| { type: "permissionCatalog"; entries: PermissionCatalogEntry[] }
|
||||
| { type: "streamEvent"; name: string; args: Record<string, string> };
|
||||
|
||||
if (event.type === "connected") {
|
||||
this.emit({
|
||||
@@ -422,6 +491,8 @@ export class Ts3Connection {
|
||||
channelGroup: c.channel_group,
|
||||
serverGroups: c.server_groups,
|
||||
hasTalkPower: c.has_talk_power,
|
||||
isQuery: Boolean(c.is_query),
|
||||
isStreaming: Boolean(c.is_streaming),
|
||||
})),
|
||||
ownClientId: event.own_client_id ?? 0,
|
||||
serverMaxClients: event.server_max_clients ?? 0,
|
||||
@@ -516,6 +587,8 @@ export class Ts3Connection {
|
||||
message: event.message,
|
||||
timestamp: event.timestamp,
|
||||
});
|
||||
} else if (event.type === "channelPasswordRequired") {
|
||||
this.emit({ type: "channelPasswordRequired", channelId: event.channel_id });
|
||||
} else {
|
||||
this.emit(event);
|
||||
}
|
||||
@@ -531,39 +604,51 @@ export class Ts3Connection {
|
||||
});
|
||||
|
||||
this.child.on("exit", (code) => {
|
||||
this.childGone = true;
|
||||
if (code !== 0) {
|
||||
this.emit({ type: "error", message: `Connector exited with code ${code}` });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async switchChannel(channelId: number): Promise<void> {
|
||||
async switchChannel(channelId: number, channelPassword?: string): Promise<void> {
|
||||
const id = Number(channelId);
|
||||
if (!Number.isFinite(id)) return;
|
||||
this.child?.stdin.write(`switch ${id}\n`);
|
||||
// The password travels base64-encoded on this line-based stdin protocol
|
||||
// so it can safely contain spaces or other characters.
|
||||
const passwordArg = channelPassword ? ` ${Buffer.from(channelPassword, "utf8").toString("base64")}` : "";
|
||||
this.writeLine(`switch ${id}${passwordArg}`);
|
||||
}
|
||||
|
||||
async moveClient(clientId: number, channelId: number, channelPassword?: string): Promise<void> {
|
||||
const clid = Number(clientId);
|
||||
const cid = Number(channelId);
|
||||
if (!Number.isFinite(clid) || !Number.isFinite(cid)) return;
|
||||
const passwordArg = channelPassword ? ` ${Buffer.from(channelPassword, "utf8").toString("base64")}` : "";
|
||||
this.writeLine(`moveclient ${clid} ${cid}${passwordArg}`);
|
||||
}
|
||||
|
||||
async getClientConnectionInfo(clientId: number): Promise<void> {
|
||||
this.child?.stdin.write(`clientconninfo ${clientId}\n`);
|
||||
this.writeLine(`clientconninfo ${clientId}`);
|
||||
}
|
||||
|
||||
async getServerConnectionInfo(): Promise<void> {
|
||||
this.child?.stdin.write(`serverconninfo\n`);
|
||||
this.writeLine(`serverconninfo`);
|
||||
}
|
||||
|
||||
async kickFromChannel(clientId: number, reason: string): Promise<void> {
|
||||
const sanitized = reason.replace(/[\r\n]+/g, " ").trim();
|
||||
this.child?.stdin.write(`kickchannel ${clientId} ${sanitized}\n`);
|
||||
this.writeLine(`kickchannel ${clientId} ${sanitized}`);
|
||||
}
|
||||
|
||||
async kickFromServer(clientId: number, reason: string): Promise<void> {
|
||||
const sanitized = reason.replace(/[\r\n]+/g, " ").trim();
|
||||
this.child?.stdin.write(`kickserver ${clientId} ${sanitized}\n`);
|
||||
this.writeLine(`kickserver ${clientId} ${sanitized}`);
|
||||
}
|
||||
|
||||
async banClient(clientId: number, seconds: number, reason: string): Promise<void> {
|
||||
const sanitized = reason.replace(/[\r\n]+/g, " ").trim();
|
||||
this.child?.stdin.write(`banclient ${clientId} ${Math.max(0, Math.floor(seconds))} ${sanitized}\n`);
|
||||
this.writeLine(`banclient ${clientId} ${Math.max(0, Math.floor(seconds))} ${sanitized}`);
|
||||
}
|
||||
|
||||
/** Every field is optional - only send what actually changed. JSON.stringify
|
||||
@@ -587,95 +672,95 @@ export class Ts3Connection {
|
||||
phoneticName?: string;
|
||||
codecEncryptionMode?: string;
|
||||
}): Promise<void> {
|
||||
this.child?.stdin.write(`serveredit ${JSON.stringify(payload)}\n`);
|
||||
this.writeLine(`serveredit ${JSON.stringify(payload)}`);
|
||||
}
|
||||
|
||||
async getServerLog(): Promise<void> {
|
||||
this.child?.stdin.write(`serverlog\n`);
|
||||
this.writeLine(`serverlog`);
|
||||
}
|
||||
|
||||
async getBanList(): Promise<void> {
|
||||
this.child?.stdin.write(`banlist\n`);
|
||||
this.writeLine(`banlist`);
|
||||
}
|
||||
|
||||
async deleteBan(banId: number): Promise<void> {
|
||||
this.child?.stdin.write(`bandel ${banId}\n`);
|
||||
this.writeLine(`bandel ${banId}`);
|
||||
}
|
||||
|
||||
async deleteAllBans(): Promise<void> {
|
||||
this.child?.stdin.write(`bandelall\n`);
|
||||
this.writeLine(`bandelall`);
|
||||
}
|
||||
|
||||
async getComplainList(): Promise<void> {
|
||||
this.child?.stdin.write(`complainlist\n`);
|
||||
this.writeLine(`complainlist`);
|
||||
}
|
||||
|
||||
async deleteComplaint(targetClientDbId: number, fromClientDbId: number): Promise<void> {
|
||||
this.child?.stdin.write(`complaindel ${targetClientDbId} ${fromClientDbId}\n`);
|
||||
this.writeLine(`complaindel ${targetClientDbId} ${fromClientDbId}`);
|
||||
}
|
||||
|
||||
async deleteAllComplaintsFor(targetClientDbId: number): Promise<void> {
|
||||
this.child?.stdin.write(`complaindelall ${targetClientDbId}\n`);
|
||||
this.writeLine(`complaindelall ${targetClientDbId}`);
|
||||
}
|
||||
|
||||
async getOfflineMessageList(): Promise<void> {
|
||||
this.child?.stdin.write(`messagelist\n`);
|
||||
this.writeLine(`messagelist`);
|
||||
}
|
||||
|
||||
async getOfflineMessage(messageId: number): Promise<void> {
|
||||
this.child?.stdin.write(`messageget ${messageId}\n`);
|
||||
this.writeLine(`messageget ${messageId}`);
|
||||
}
|
||||
|
||||
async sendOfflineMessage(clientUid: string, subject: string, message: string): Promise<void> {
|
||||
const sanitize = (s: string) => s.replace(/[\r\n\t]+/g, " ").trim();
|
||||
this.child?.stdin.write(`messageadd ${sanitize(clientUid)}\t${sanitize(subject)}\t${sanitize(message)}\n`);
|
||||
this.writeLine(`messageadd ${sanitize(clientUid)}\t${sanitize(subject)}\t${sanitize(message)}`);
|
||||
}
|
||||
|
||||
async deleteOfflineMessage(messageId: number): Promise<void> {
|
||||
this.child?.stdin.write(`messagedel ${messageId}\n`);
|
||||
this.writeLine(`messagedel ${messageId}`);
|
||||
}
|
||||
|
||||
async markOfflineMessageRead(messageId: number): Promise<void> {
|
||||
this.child?.stdin.write(`messageupdateflag ${messageId} 1\n`);
|
||||
this.writeLine(`messageupdateflag ${messageId} 1`);
|
||||
}
|
||||
|
||||
async getChannelGroupList(): Promise<void> {
|
||||
this.child?.stdin.write(`channelgrouplist\n`);
|
||||
this.writeLine(`channelgrouplist`);
|
||||
}
|
||||
|
||||
async getServerGroupList(): Promise<void> {
|
||||
this.child?.stdin.write(`servergrouplist\n`);
|
||||
this.writeLine(`servergrouplist`);
|
||||
}
|
||||
|
||||
async setChannelGroup(channelGroupId: number, channelId: number, clientDbId: number): Promise<void> {
|
||||
this.child?.stdin.write(`setchannelgroup ${channelGroupId} ${channelId} ${clientDbId}\n`);
|
||||
this.writeLine(`setchannelgroup ${channelGroupId} ${channelId} ${clientDbId}`);
|
||||
}
|
||||
|
||||
async addServerGroup(serverGroupId: number, clientDbId: number): Promise<void> {
|
||||
this.child?.stdin.write(`addservergroup ${serverGroupId} ${clientDbId}\n`);
|
||||
this.writeLine(`addservergroup ${serverGroupId} ${clientDbId}`);
|
||||
}
|
||||
|
||||
async removeServerGroup(serverGroupId: number, clientDbId: number): Promise<void> {
|
||||
this.child?.stdin.write(`delservergroup ${serverGroupId} ${clientDbId}\n`);
|
||||
this.writeLine(`delservergroup ${serverGroupId} ${clientDbId}`);
|
||||
}
|
||||
|
||||
async serverQueryLogin(username: string, password: string): Promise<void> {
|
||||
const u = Buffer.from(username, "utf8").toString("base64");
|
||||
const p = Buffer.from(password, "utf8").toString("base64");
|
||||
this.child?.stdin.write(`serverquerylogin ${u} ${p}\n`);
|
||||
this.writeLine(`serverquerylogin ${u} ${p}`);
|
||||
}
|
||||
|
||||
async getPermissionOverview(): Promise<void> {
|
||||
this.child?.stdin.write(`permoverview\n`);
|
||||
this.writeLine(`permoverview`);
|
||||
}
|
||||
|
||||
async getPermissionCatalog(): Promise<void> {
|
||||
this.child?.stdin.write(`permissionlist\n`);
|
||||
this.writeLine(`permissionlist`);
|
||||
}
|
||||
|
||||
async getPermList(scope: PermScope, id1: number, id2?: number): Promise<void> {
|
||||
const args = id2 !== undefined ? `${scope} ${id1} ${id2}` : `${scope} ${id1}`;
|
||||
this.child?.stdin.write(`permlist ${args}\n`);
|
||||
this.writeLine(`permlist ${args}`);
|
||||
}
|
||||
|
||||
/** `negated`/`skip` only apply to the "server" and "client" scopes - the
|
||||
@@ -692,103 +777,183 @@ export class Ts3Connection {
|
||||
let args = `${scope} ${ids.join(" ")} ${permId} ${value}`;
|
||||
if (scope === "server") args += ` ${negated ? 1 : 0} ${skip ? 1 : 0}`;
|
||||
else if (scope === "client") args += ` ${skip ? 1 : 0}`;
|
||||
this.child?.stdin.write(`permadd ${args}\n`);
|
||||
this.writeLine(`permadd ${args}`);
|
||||
}
|
||||
|
||||
async removePermission(scope: PermScope, ids: number[], permId: number): Promise<void> {
|
||||
this.child?.stdin.write(`permdel ${scope} ${ids.join(" ")} ${permId}\n`);
|
||||
this.writeLine(`permdel ${scope} ${ids.join(" ")} ${permId}`);
|
||||
}
|
||||
|
||||
async getFileList(channelId: number, path: string): Promise<void> {
|
||||
const sanitized = (path || "/").replace(/[\r\n]+/g, " ").trim() || "/";
|
||||
this.child?.stdin.write(`ftlist ${channelId} ${sanitized}\n`);
|
||||
this.writeLine(`ftlist ${channelId} ${sanitized}`);
|
||||
}
|
||||
|
||||
async createDirectory(channelId: number, dirname: string): Promise<void> {
|
||||
const sanitized = dirname.replace(/[\r\n]+/g, " ").trim();
|
||||
if (sanitized) this.child?.stdin.write(`ftmkdir ${channelId} ${sanitized}\n`);
|
||||
if (sanitized) this.writeLine(`ftmkdir ${channelId} ${sanitized}`);
|
||||
}
|
||||
|
||||
async deleteFile(channelId: number, name: string): Promise<void> {
|
||||
const sanitized = name.replace(/[\r\n]+/g, " ").trim();
|
||||
if (sanitized) this.child?.stdin.write(`ftdelete ${channelId} ${sanitized}\n`);
|
||||
if (sanitized) this.writeLine(`ftdelete ${channelId} ${sanitized}`);
|
||||
}
|
||||
|
||||
async renameFile(channelId: number, oldName: string, newName: string): Promise<void> {
|
||||
const sanitize = (s: string) => s.replace(/[\r\n\t]+/g, " ").trim();
|
||||
this.child?.stdin.write(`ftrename ${channelId}\t${sanitize(oldName)}\t${sanitize(newName)}\n`);
|
||||
this.writeLine(`ftrename ${channelId}\t${sanitize(oldName)}\t${sanitize(newName)}`);
|
||||
}
|
||||
|
||||
async downloadFile(channelId: number, path: string): Promise<void> {
|
||||
const sanitized = path.replace(/[\r\n]+/g, " ").trim();
|
||||
if (sanitized) this.child?.stdin.write(`ftdownload ${channelId} ${sanitized}\n`);
|
||||
if (sanitized) this.writeLine(`ftdownload ${channelId} ${sanitized}`);
|
||||
}
|
||||
|
||||
/** `dataBase64` is the raw file content, base64-encoded - the browser reads
|
||||
* the picked File as a data URL/ArrayBuffer and sends it up already encoded. */
|
||||
async uploadFile(channelId: number, path: string, dataBase64: string): Promise<void> {
|
||||
const sanitizedPath = path.replace(/[\r\n\t]+/g, " ").trim();
|
||||
this.child?.stdin.write(`ftupload ${channelId}\t${sanitizedPath}\t${dataBase64}\n`);
|
||||
this.writeLine(`ftupload ${channelId}\t${sanitizedPath}\t${dataBase64}`);
|
||||
}
|
||||
|
||||
async sendChatMessage(message: string): Promise<void> {
|
||||
const sanitized = message.replace(/[\r\n]+/g, " ").trim();
|
||||
if (sanitized) this.child?.stdin.write(`chat ${sanitized}\n`);
|
||||
if (sanitized) this.writeLine(`chat ${sanitized}`);
|
||||
}
|
||||
|
||||
async sendServerMessage(message: string): Promise<void> {
|
||||
const sanitized = message.replace(/[\r\n]+/g, " ").trim();
|
||||
if (sanitized) this.child?.stdin.write(`serverchat ${sanitized}\n`);
|
||||
if (sanitized) this.writeLine(`serverchat ${sanitized}`);
|
||||
}
|
||||
|
||||
async sendPrivateMessage(clientId: number, message: string): Promise<void> {
|
||||
const sanitized = message.replace(/[\r\n]+/g, " ").trim();
|
||||
if (sanitized) this.child?.stdin.write(`pm ${clientId} ${sanitized}\n`);
|
||||
if (sanitized) this.writeLine(`pm ${clientId} ${sanitized}`);
|
||||
}
|
||||
|
||||
async sendPoke(clientId: number, message: string): Promise<void> {
|
||||
const sanitized = message.replace(/[\r\n]+/g, " ").trim();
|
||||
this.child?.stdin.write(`poke ${clientId} ${sanitized}\n`);
|
||||
this.writeLine(`poke ${clientId} ${sanitized}`);
|
||||
}
|
||||
|
||||
async sendAudio(pcmBase64: string): Promise<void> {
|
||||
this.child?.stdin.write(`audio ${pcmBase64}\n`);
|
||||
this.writeLine(`audio ${pcmBase64}`);
|
||||
}
|
||||
|
||||
/** Pulls a streaming client's stream details; answered with a
|
||||
* `notifystreaminfo` streamEvent carrying the stream id. */
|
||||
async requestStreamInfo(clientId: number): Promise<void> {
|
||||
this.writeLine(`streaminfo ${clientId}`);
|
||||
}
|
||||
|
||||
/** Ask the client publishing a TS6 stream to let us watch. The answer comes
|
||||
* back as a `streamEvent` of type `notifyrespondjoinstreamrequest`, which
|
||||
* carries the SDP offer. */
|
||||
async joinStream(streamId: string, clientId: number, message = ""): Promise<void> {
|
||||
const id = streamId.replace(/[\s]+/g, "");
|
||||
const sanitized = message.replace(/[\r\n]+/g, " ").trim();
|
||||
if (id) this.writeLine(`streamjoin ${id} ${clientId} ${sanitized}`);
|
||||
}
|
||||
|
||||
async leaveStream(streamId: string, clientId: number): Promise<void> {
|
||||
const id = streamId.replace(/[\s]+/g, "");
|
||||
if (id) this.writeLine(`streamleave ${id} ${clientId}`);
|
||||
}
|
||||
|
||||
/** Relays one signaling payload (SDP answer, ICE candidate) to a stream peer.
|
||||
* `payload` is passed straight through - the connector only escapes it for
|
||||
* the TS wire, nobody in this path interprets it. Serializing here rather
|
||||
* than accepting a string keeps literal newlines out of the line-based
|
||||
* stdin protocol. */
|
||||
async sendStreamSignal(streamId: string, clientId: number, payload: unknown): Promise<void> {
|
||||
const id = streamId.replace(/[\s]+/g, "");
|
||||
if (id) this.writeLine(`streamsignal ${id} ${clientId} ${JSON.stringify(payload)}`);
|
||||
}
|
||||
|
||||
/** Announces a stream we publish. The server assigns the id and reports it
|
||||
* back as a `notifystreamstarted` streamEvent naming our own client id. */
|
||||
async setupStream(options: StreamSetupOptions): Promise<void> {
|
||||
const payload = {
|
||||
name: options.name.replace(/[\r\n]+/g, " ").trim() || "Stream",
|
||||
type: options.type,
|
||||
bitrate: options.bitrate,
|
||||
accessibility: options.accessibility,
|
||||
mode: options.mode,
|
||||
viewerLimit: options.viewerLimit,
|
||||
audio: options.audio,
|
||||
};
|
||||
this.writeLine(`streamsetup ${JSON.stringify(payload)}`);
|
||||
}
|
||||
|
||||
/** Accepts or refuses a viewer that asked to watch our stream. On accept,
|
||||
* `offer` is our SDP - the publisher offers, which is the mirror of how a
|
||||
* TS6 publisher answered us. JSON-encoded because an SDP is multi-line. */
|
||||
async respondJoinStream(
|
||||
streamId: string,
|
||||
clientId: number,
|
||||
accept: boolean,
|
||||
offer = "",
|
||||
message = "",
|
||||
): Promise<void> {
|
||||
const id = streamId.replace(/[\s]+/g, "");
|
||||
if (!id) return;
|
||||
const payload = {
|
||||
id,
|
||||
clid: clientId,
|
||||
msg: message.replace(/[\r\n]+/g, " ").trim(),
|
||||
offer,
|
||||
decision: accept ? 1 : 0,
|
||||
};
|
||||
this.writeLine(`streamrespond ${JSON.stringify(payload)}`);
|
||||
}
|
||||
|
||||
async stopStream(streamId: string, reason = ""): Promise<void> {
|
||||
const id = streamId.replace(/[\s]+/g, "");
|
||||
const sanitized = reason.replace(/[\r\n]+/g, " ").trim();
|
||||
if (id) this.writeLine(`streamstop ${id} ${sanitized}`);
|
||||
}
|
||||
|
||||
async setAway(away: boolean, message: string): Promise<void> {
|
||||
if (away) {
|
||||
const sanitized = message.replace(/[\r\n]+/g, " ").trim();
|
||||
this.child?.stdin.write(`away ${sanitized}\n`);
|
||||
this.writeLine(`away ${sanitized}`);
|
||||
} else {
|
||||
this.child?.stdin.write("unaway\n");
|
||||
this.writeLine("unaway");
|
||||
}
|
||||
}
|
||||
|
||||
async setInputMuted(muted: boolean): Promise<void> {
|
||||
this.child?.stdin.write(`muteinput ${muted ? "1" : "0"}\n`);
|
||||
this.writeLine(`muteinput ${muted ? "1" : "0"}`);
|
||||
}
|
||||
|
||||
async setOutputMuted(muted: boolean): Promise<void> {
|
||||
this.child?.stdin.write(`muteoutput ${muted ? "1" : "0"}\n`);
|
||||
this.writeLine(`muteoutput ${muted ? "1" : "0"}`);
|
||||
}
|
||||
|
||||
async setNickname(nickname: string): Promise<void> {
|
||||
const sanitized = nickname.replace(/[\r\n]+/g, " ").trim();
|
||||
if (sanitized) this.child?.stdin.write(`nickname ${sanitized}\n`);
|
||||
if (sanitized) this.writeLine(`nickname ${sanitized}`);
|
||||
}
|
||||
|
||||
/** Empty channelIds/clientIds clears whisper mode, returning outgoing
|
||||
* voice to the normal current-channel broadcast. */
|
||||
async setWhisperTargets(channelIds: number[], clientIds: number[]): Promise<void> {
|
||||
if (channelIds.length === 0 && clientIds.length === 0) {
|
||||
this.child?.stdin.write("unwhisper\n");
|
||||
const chans = channelIds.map(Number);
|
||||
const clients = clientIds.map(Number);
|
||||
if (chans.some((n) => !Number.isFinite(n)) || clients.some((n) => !Number.isFinite(n))) return;
|
||||
if (chans.length === 0 && clients.length === 0) {
|
||||
this.writeLine("unwhisper");
|
||||
} else {
|
||||
this.child?.stdin.write(`whisper ${channelIds.join(",")};${clientIds.join(",")}\n`);
|
||||
this.writeLine(`whisper ${chans.join(",")};${clients.join(",")}`);
|
||||
}
|
||||
}
|
||||
|
||||
async disconnect(message = ""): Promise<void> {
|
||||
if (this.child && !this.child.killed) {
|
||||
// childGone means the "exit" event already fired - which happens exactly
|
||||
// once, so a .once("exit", ...) listener attached only now (below) would
|
||||
// never see it, and this would always fall through to the 3s hard-kill
|
||||
// timeout for a process that's already gone. Skip straight past it.
|
||||
if (this.child && !this.child.killed && !this.childGone) {
|
||||
const child = this.child;
|
||||
const sanitized = message.replace(/[\r\n]+/g, " ").trim();
|
||||
child.stdin.write(`disconnect ${sanitized}\n`);
|
||||
|
||||
+1
-1
Submodule tsclientlib updated: 0b74239a34...2e7794928f.
@@ -7,6 +7,13 @@
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/favicon-192.png" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="theme-color" content="#03060d" />
|
||||
<!-- iOS ignores most of the Web App Manifest — these are the fields it
|
||||
actually reads for "Add to Home Screen" (standalone display, status
|
||||
bar style, home-screen title). -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="apple-mobile-web-app-title" content="WebSpeak3" />
|
||||
<title>WebSpeak3</title>
|
||||
<meta name="description" content="WebSpeak3 — an independent, self-hosted web client for TeamSpeak 3 servers." />
|
||||
|
||||
|
||||
Generated
+5281
-55
File diff suppressed because it is too large.
Load diff
+5
-1
@@ -4,12 +4,15 @@
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"predev": "node scripts/sync-aec3-assets.mjs",
|
||||
"dev": "vite",
|
||||
"prebuild": "node scripts/sync-aec3-assets.mjs",
|
||||
"build": "tsc -b && vite build",
|
||||
"lint": "oxlint",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ennuicastr/webrtcaec3.js": "^0.3.0",
|
||||
"fflate": "^0.8.3",
|
||||
"react": "^19.2.7",
|
||||
"react-dom": "^19.2.7"
|
||||
@@ -21,6 +24,7 @@
|
||||
"@vitejs/plugin-react": "^6.0.3",
|
||||
"oxlint": "^1.71.0",
|
||||
"typescript": "~6.0.2",
|
||||
"vite": "^8.1.1"
|
||||
"vite": "^8.1.1",
|
||||
"vite-plugin-pwa": "^1.3.0"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 165 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 235 KiB |
@@ -0,0 +1,20 @@
|
||||
// Copies the AEC3 WASM module's prebuilt assets into public/vendor/ so they're
|
||||
// served unhashed, at the exact filenames the module's own glue code expects
|
||||
// (it resolves its .wasm next to its own <script src> by a hardcoded literal
|
||||
// name - see web/src/aec3.ts). Run via predev/prebuild rather than committed,
|
||||
// so the binary blobs never enter git.
|
||||
import { copyFileSync, mkdirSync, readFileSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const webRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const pkgDir = path.join(webRoot, "node_modules/@ennuicastr/webrtcaec3.js");
|
||||
const { version } = JSON.parse(readFileSync(path.join(pkgDir, "package.json"), "utf8"));
|
||||
const outDir = path.join(webRoot, "public/vendor");
|
||||
|
||||
mkdirSync(outDir, { recursive: true });
|
||||
// The .js is renamed to a stable name (we choose its <script src>, so nothing
|
||||
// depends on this filename); the .wasm keeps its exact original name (the glue
|
||||
// code's own lookup is hardcoded to it).
|
||||
copyFileSync(path.join(pkgDir, "dist", `webrtcaec3-${version}.js`), path.join(outDir, "webrtcaec3.js"));
|
||||
copyFileSync(path.join(pkgDir, "dist", `webrtcaec3-${version}.wasm`), path.join(outDir, `webrtcaec3-${version}.wasm`));
|
||||
+1149
-12
File diff suppressed because it is too large.
Load diff
+2686
-188
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,65 @@
|
||||
// Lazy loader for Google WebRTC's AEC3 (compiled to WASM via
|
||||
// @ennuicastr/webrtcaec3.js), an opt-in, stronger alternative to the browser's
|
||||
// native echo cancellation for speaker+mic (no headset) setups where native
|
||||
// AEC often isn't enough (github.com/Moepchi/webspeak3 issue #2). Loaded as a
|
||||
// plain <script> tag rather than bundled: the module's own glue code resolves
|
||||
// its .wasm file next to its own <script src>, by a name it decides itself -
|
||||
// see scripts/sync-aec3-assets.mjs for how that file gets there.
|
||||
|
||||
export interface Aec3Instance {
|
||||
free(): void;
|
||||
analyze(data: Float32Array[]): void;
|
||||
processSize(data: Float32Array[]): number;
|
||||
process(out: Float32Array[], data: Float32Array[]): void;
|
||||
}
|
||||
|
||||
interface Aec3Module {
|
||||
AEC3: new (sampleRate: number, renderChannels: number, captureChannels: number) => Aec3Instance;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
WebRtcAec3?: () => Promise<Aec3Module>;
|
||||
}
|
||||
}
|
||||
|
||||
let modulePromise: Promise<Aec3Module> | null = null;
|
||||
|
||||
function loadScript(src: string): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const el = document.createElement("script");
|
||||
el.src = src;
|
||||
el.onload = () => resolve();
|
||||
el.onerror = () => reject(new Error(`Failed to load ${src}`));
|
||||
document.head.appendChild(el);
|
||||
});
|
||||
}
|
||||
|
||||
function loadModule(): Promise<Aec3Module> {
|
||||
if (!modulePromise) {
|
||||
// BASE_URL keeps sub-path deployments (VITE_BASE_PATH) working; a failed
|
||||
// load is forgotten so the next attempt retries instead of reusing it.
|
||||
modulePromise = loadScript(`${import.meta.env.BASE_URL}vendor/webrtcaec3.js`)
|
||||
.then(() => {
|
||||
if (!window.WebRtcAec3) throw new Error("AEC3 script loaded but did not register window.WebRtcAec3");
|
||||
return window.WebRtcAec3();
|
||||
})
|
||||
.catch((err) => {
|
||||
modulePromise = null;
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
return modulePromise;
|
||||
}
|
||||
|
||||
/** Creates a fresh AEC3 instance. `renderChannels` must match the channel
|
||||
* count passed to `analyze()`, `captureChannels` the count passed to
|
||||
* `process()`. */
|
||||
export async function createAec3(
|
||||
sampleRate: number,
|
||||
renderChannels: number,
|
||||
captureChannels: number,
|
||||
): Promise<Aec3Instance> {
|
||||
const mod = await loadModule();
|
||||
return new mod.AEC3(sampleRate, renderChannels, captureChannels);
|
||||
}
|
||||
@@ -50,6 +50,8 @@ export type ClientInfo = {
|
||||
channelGroup: number;
|
||||
serverGroups: number[];
|
||||
hasTalkPower: boolean;
|
||||
/** ServerQuery client; hidden in the tree unless the favorite enables them. */
|
||||
isQuery?: boolean;
|
||||
};
|
||||
|
||||
export type WhisperLogEntry = {
|
||||
@@ -92,6 +94,8 @@ export type ParkedSessionState = {
|
||||
previousClients: ClientInfo[] | null;
|
||||
/** Whether the mic was on for this tab when it was parked, so switching back restores it. */
|
||||
micWasOn: boolean;
|
||||
/** Favorite used to open this session (drives ServerQuery visibility). */
|
||||
favoriteId: string | null;
|
||||
};
|
||||
|
||||
export type SessionTabInfo = {
|
||||
@@ -143,6 +147,7 @@ export function emptyParkedState(partial?: Partial<ParkedSessionState>): ParkedS
|
||||
hasConnected: false,
|
||||
previousClients: null,
|
||||
micWasOn: false,
|
||||
favoriteId: null,
|
||||
...partial,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -277,6 +277,20 @@ export class DemoSocket {
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "moveClient": {
|
||||
const clientId = Number(msg.clientId);
|
||||
const channelId = Number(msg.channelId);
|
||||
if (Number.isFinite(clientId) && Number.isFinite(channelId)) {
|
||||
if (clientId === SELF_ID) {
|
||||
this.selfChannel = channelId;
|
||||
} else {
|
||||
const npc = DEMO_NPCS.find((c) => c.id === clientId);
|
||||
if (npc) npc.channel = channelId;
|
||||
}
|
||||
this.after(120, () => this.sendChannels(this.lastNickname));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "getClientConnectionInfo": {
|
||||
this.after(400, () =>
|
||||
this.emit({
|
||||
|
||||
+19
-1111
File diff suppressed because it is too large.
Load diff
@@ -15,7 +15,7 @@ export type ParsedChannelName = {
|
||||
};
|
||||
|
||||
/** Pure line fillers that look better as a CSS rule than raw `---` / `***`. */
|
||||
const LINE_FILLER_RE = /^[\-\u2013\u2014\u2500\u2501\u2550=\*\.·_\s]+$/;
|
||||
const LINE_FILLER_RE = /^[-\u2013\u2014\u2500\u2501\u2550=*.·_\s]+$/;
|
||||
|
||||
/** Corners / verticals of box-frame spacers (not pure horizontal fills). */
|
||||
const BOX_FRAME_RE = /[╔╗╚╝╒╓╕╖╘╙╛╜┌┐└┘├┤┬┴┼║│╟╢╤╧╪╫╬╒╓╕╖╘╙╛╜]/;
|
||||
|
||||
@@ -0,0 +1,662 @@
|
||||
{
|
||||
"menu.connections": "Verbindungen",
|
||||
"menu.connections.connect": "Verbinden",
|
||||
"menu.connections.disconnectCurrent": "Aktuelle Verbindung trennen",
|
||||
"menu.connections.disconnectAll": "Alle Verbindungen trennen",
|
||||
"menu.favorites": "Favoriten",
|
||||
"menu.favorites.add": "Zu Favoriten hinzufügen",
|
||||
"menu.favorites.manage": "Favoriten verwalten",
|
||||
"menu.self": "Selbst",
|
||||
"menu.rights": "Rechte",
|
||||
"menu.rights.serverGroups": "Server-Gruppen bearbeiten...",
|
||||
"menu.rights.channelGroups": "Channel-Gruppen bearbeiten...",
|
||||
"menu.rights.serverPermissions": "Server-Rechte bearbeiten...",
|
||||
"menu.rights.channelPermissions": "Channel-Rechte bearbeiten...",
|
||||
"menu.rights.overview": "Rechteübersicht...",
|
||||
"menu.rights.myRights": "Eigene Rechte anzeigen",
|
||||
"menu.extras": "Extras",
|
||||
"menu.help": "Hilfe",
|
||||
"menu.help.about": "Über WebSpeak3",
|
||||
"menu.help.github": "GitHub",
|
||||
"menu.help.changelog": "Changelog",
|
||||
"menu.help.translate": "Mitübersetzen (Weblate)",
|
||||
"menu.extras.identities": "Identitäten",
|
||||
"menu.extras.contacts": "Kontakte",
|
||||
"menu.extras.collectedUrls": "Gesammelte URLs",
|
||||
"menu.extras.inviteFriend": "Freund einladen",
|
||||
"menu.extras.whisperLists": "Whisperlisten",
|
||||
"menu.extras.whisperHistory": "Whisper Verlauf",
|
||||
"menu.extras.clientLog": "Client Protokoll",
|
||||
"menu.extras.banList": "Bannliste",
|
||||
"menu.extras.complaintList": "Beschwerdeliste",
|
||||
"menu.extras.offlineMessages": "Offline Nachrichten",
|
||||
"menu.extras.serverQueryLogin": "ServerQuery Login",
|
||||
"menu.extras.serverLog": "Server Protokoll",
|
||||
"menu.extras.startRecording": "Aufnahme starten",
|
||||
"menu.extras.startMultitrackRecording": "Start Multitrack Recording",
|
||||
"menu.extras.stopRecording": "Aufnahme beenden",
|
||||
"menu.extras.options": "Optionen",
|
||||
"menu.extras.feedback": "Feedback geben",
|
||||
"feedback.fab.nudge": "Was denkst du über WebSpeak3? Feedback ist willkommen!",
|
||||
"donate.label": "Spenden",
|
||||
"donate.title": "WebSpeak3 auf Ko-fi unterstützen",
|
||||
"pwa.updateAvailable": "Neue Version verfügbar",
|
||||
"pwa.reload": "Neu laden",
|
||||
"feedback.dialog.title": "Feedback",
|
||||
"feedback.dialog.intro": "Melde einen Fehler oder teile eine Idee zur Weiterentwicklung von WebSpeak3 mit.",
|
||||
"feedback.dialog.category": "Kategorie",
|
||||
"feedback.dialog.category.bug": "Fehler",
|
||||
"feedback.dialog.category.idea": "Idee",
|
||||
"feedback.dialog.category.report": "Meldung (Verstoß/Missbrauch)",
|
||||
"feedback.dialog.category.other": "Sonstiges",
|
||||
"feedback.dialog.reportHint": "Meldungen bleiben privat und werden nie als GitHub-Issue veröffentlicht. Gib bei Bedarf den betroffenen Server mit an.",
|
||||
"feedback.dialog.message": "Nachricht",
|
||||
"feedback.dialog.messagePlaceholder": "Was ist passiert, oder was schlägst du vor?",
|
||||
"feedback.dialog.email": "E-Mail (optional, für Rückfragen – bleibt privat, wird nie veröffentlicht)",
|
||||
"feedback.dialog.publishAsIssue": "Als öffentliches GitHub-Issue veröffentlichen",
|
||||
"feedback.dialog.publishAsIssueHint": "Ohne Haken bleibt dein Feedback privat und geht nur an den Betreiber.",
|
||||
"feedback.dialog.publishAsIssueHintBug": "Fehlermeldungen werden immer als öffentliches GitHub-Issue veröffentlicht.",
|
||||
"feedback.dialog.send": "Senden",
|
||||
"feedback.dialog.cancel": "Abbrechen",
|
||||
"restartNotice.title": "Kurze Unterbrechung",
|
||||
"restartNotice.body": "Der Server wird gleich kurz neu gestartet. Deine Verbindung wird dabei kurz unterbrochen.",
|
||||
"restartNotice.ack": "Verstanden",
|
||||
"menu.extras.tos": "Nutzungsbedingungen",
|
||||
"tos.title": "Nutzungsbedingungen für client.webspeak3.de",
|
||||
"tos.rule1": "Dieser Client dient der privaten, nicht-kommerziellen Nutzung von TeamSpeak-/TeaSpeak-/GreenTeaSpeak-Servern über den Browser.",
|
||||
"tos.rule2": "Verboten sind insbesondere: Straftaten jeder Art, Belästigung und Hassrede, Spam und Flooding, Störung des Dienstes sowie die Umgehung von Sperren.",
|
||||
"tos.rule3": "Bei Verstößen kann der Zugang ohne Vorwarnung gesperrt werden; schwerwiegende Fälle werden ggf. an die zuständigen Behörden gemeldet.",
|
||||
"tos.rule4Pre": "Zur Betriebssicherheit und Missbrauchserkennung werden Verbindungen protokolliert (Serveradresse, Servername, Zeitpunkt) und nach 90 Tagen automatisch gelöscht – siehe ",
|
||||
"tos.rule4Post": ".",
|
||||
"tos.privacyLinkText": "Datenschutzerklärung",
|
||||
"tos.rule5Pre": "Bei Missbrauch oder Beschwerden: siehe ",
|
||||
"tos.rule5Post": ".",
|
||||
"tos.legalLinkText": "Impressum",
|
||||
"tos.rule6": "Mit Klick auf „Akzeptieren\" stimmst du diesen Bedingungen zu. Die Zustimmung wird nur lokal in deinem Browser gespeichert; bei Regeländerungen wirst du erneut gefragt.",
|
||||
"tos.accept": "Akzeptieren",
|
||||
"tos.close": "Schließen",
|
||||
"feedback.dialog.sending": "Wird gesendet…",
|
||||
"feedback.dialog.success": "Danke für dein Feedback!",
|
||||
"feedback.dialog.successWithIssue": "Danke! Issue erstellt:",
|
||||
"feedback.dialog.error": "Senden fehlgeschlagen. Bitte später erneut versuchen.",
|
||||
"toolbar.setAway": "Als abwesend markieren",
|
||||
"toolbar.backOnline": "Wieder online",
|
||||
"toolbar.awayOptions": "Abwesenheitsoptionen",
|
||||
"toolbar.whisper": "Whisper-Ziele",
|
||||
"whisper.channels": "Channels",
|
||||
"whisper.clients": "Clients",
|
||||
"whisper.clearAll": "Alle Whisper-Ziele entfernen",
|
||||
"toolbar.micEnable": "Mikrofon aktivieren",
|
||||
"toolbar.micMute": "Mikrofon stummschalten",
|
||||
"toolbar.micUnmute": "Mikrofon aktivieren (unmute)",
|
||||
"toolbar.vadSensitivity": "Empfindlichkeit der Sprachaktivierung",
|
||||
"toolbar.muteSound": "Ton stummschalten (Ausgabe stumm)",
|
||||
"toolbar.unmuteSound": "Ton aktivieren (Ausgabe an)",
|
||||
"toolbar.chooseOutputDevice": "Wiedergabegerät wählen",
|
||||
"toolbar.toggleTheme": "Design wechseln",
|
||||
"away.setGlobal": "Global abwesend setzen",
|
||||
"away.setGlobalStatus": "Abwesenheit-Status global setzen",
|
||||
"connect.title": "Verbinden",
|
||||
"connect.novaSubtitle": "WebSpeak3 läuft komplett im Browser — kein Download nötig",
|
||||
"connect.serverAddress": "Server Nickname oder Adresse:",
|
||||
"connect.serverPassword": "Server Passwort:",
|
||||
"connect.nickname": "Nickname:",
|
||||
"connect.phoneticNickname": "Phonetischer Nickname:",
|
||||
"connect.identity": "Identität:",
|
||||
"connect.defaultChannel": "Standard Channel:",
|
||||
"connect.recordingProfile": "Aufnahmeprofil:",
|
||||
"connect.channelPassword": "Channel Passwort:",
|
||||
"connect.playbackProfile": "Wiedergabeprofil:",
|
||||
"connect.onetimeGrant": "Einmalige Berechtigung:",
|
||||
"connect.serverType": "Server-Typ:",
|
||||
"connect.serverType.auto": "Auto",
|
||||
"connect.serverType.teamspeak": "TeamSpeak",
|
||||
"connect.serverType.teaspeak": "TeaSpeak",
|
||||
"connect.hotkeyProfile": "Hotkeyprofil:",
|
||||
"connect.soundPack": "Sound Pack:",
|
||||
"connect.more": "Mehr",
|
||||
"connect.less": "Weniger",
|
||||
"connect.connect": "Verbinden",
|
||||
"connect.connecting": "Verbinde…",
|
||||
"connect.newTab": "In neuem Tab",
|
||||
"connect.cancel": "Abbrechen",
|
||||
"channelPasswordDialog.title": "Channel-Passwort erforderlich",
|
||||
"channelPasswordDialog.prompt": "Dieser Channel ist passwortgeschützt. Bitte Passwort eingeben:",
|
||||
"channelPasswordDialog.wrongPassword": "Falsches Passwort, bitte erneut versuchen:",
|
||||
"channelPasswordDialog.submit": "Beitreten",
|
||||
"channelPasswordDialog.cancel": "Abbrechen",
|
||||
"collectedUrls.title": "Gesammelte URLs",
|
||||
"collectedUrls.search": "Suchen:",
|
||||
"collectedUrls.url": "URL",
|
||||
"collectedUrls.count": "Anzahl",
|
||||
"collectedUrls.lastSeen": "Zuletzt erwähnt",
|
||||
"collectedUrls.mentionedBy": "Erwähnt von",
|
||||
"collectedUrls.clearList": "Liste löschen",
|
||||
"inviteFriend.title": "Freund einladen",
|
||||
"inviteFriend.type": "Art der Einladung",
|
||||
"inviteFriend.includeChannel": "Aktuellen Channel einfügen",
|
||||
"inviteFriend.link": "Link",
|
||||
"inviteFriend.addPermissionKey": "Berechtigungsschlüssel hinzufügen",
|
||||
"inviteFriend.copyToClipboard": "In Zwischenablage kopieren",
|
||||
"inviteFriend.copied": "Kopiert!",
|
||||
"clientLog.title": "Client Protokoll",
|
||||
"clientLog.level.critical": "Kritisch",
|
||||
"clientLog.level.error": "Fehler",
|
||||
"clientLog.level.warning": "Warnungen",
|
||||
"clientLog.level.info": "Info",
|
||||
"clientLog.level.debug": "Debug",
|
||||
"clientLog.search": "Suchen:",
|
||||
"clientLog.filter": "Filter:",
|
||||
"clientLog.caseSensitive": "Groß-/Kleinschreibung",
|
||||
"clientLog.mark": "Markieren",
|
||||
"whisperHistory.title": "Whisper Verlauf - {server}",
|
||||
"whisperHistory.empty": "Kein Whisper-Verlauf vorhanden.",
|
||||
"whisperHistory.started": "Whispern an: {targets}",
|
||||
"whisperHistory.stopped": "Whispern beendet",
|
||||
"whisperHistory.clear": "Löschen",
|
||||
"whisperHistory.options": "Optionen",
|
||||
"whisperLists.title": "Whisperlisten",
|
||||
"whisperLists.namePlaceholder": "Name der Liste",
|
||||
"whisperLists.saveCurrent": "Aktuelle Auswahl speichern",
|
||||
"whisperLists.itemDetail": "{channels} Channel, {clients} Clients",
|
||||
"whisperLists.activate": "Aktivieren",
|
||||
"whisperLists.delete": "Löschen",
|
||||
"whisperLists.empty": "Keine Whisperlisten gespeichert. Wähle Whisper-Ziele aus und speichere sie hier als Liste.",
|
||||
"identities.title": "Identitäten",
|
||||
"identities.activate": "Aktivieren",
|
||||
"identities.add": "Neue Identität",
|
||||
"identities.delete": "Löschen",
|
||||
"identities.newName": "Neue Identität",
|
||||
"identities.generated": "Erstellt",
|
||||
"identities.pending": "Wird bei der nächsten Verbindung erstellt",
|
||||
"identities.listLabel": "Lokale Identitäten",
|
||||
"identities.name": "Identität Name:",
|
||||
"identities.phoneticNickname": "Phonetischer Nickname:",
|
||||
"identities.uniqueId": "Eindeutige ID:",
|
||||
"identities.unknown": "Unbekannt",
|
||||
"identities.setDefault": "Standard",
|
||||
"identities.isDefault": "Aktuell als Standard verwendet",
|
||||
"identities.export": "Exportieren",
|
||||
"identities.import": "Importieren",
|
||||
"connectionInfo.clientTitle": "Verbindungsinformationen - {name}",
|
||||
"connectionInfo.serverTitle": "Serververbindungsinformationen",
|
||||
"connectionInfo.loading": "Wird geladen…",
|
||||
"connectionInfo.unavailable": "Keine Antwort vom Server (fehlende Berechtigung?).",
|
||||
"connectionInfo.ping": "Ping:",
|
||||
"connectionInfo.connectedSince": "Verbunden seit:",
|
||||
"connectionInfo.uptime": "Uptime:",
|
||||
"connectionInfo.name": "Name:",
|
||||
"connectionInfo.avgPing": "Mittlerer Ping:",
|
||||
"connectionInfo.avgPacketLoss": "Mittlerer Paketverlust:",
|
||||
"connectionInfo.incoming": "Eingehend",
|
||||
"connectionInfo.outgoing": "Ausgehend",
|
||||
"connectionInfo.packetsTransferred": "Übertragene Pakete",
|
||||
"connectionInfo.bytesTransferred": "Übertragene Bytes",
|
||||
"connectionInfo.bandwidthLastSecond": "Bandbreite letzte Sekunde",
|
||||
"connectionInfo.bandwidthLastMinute": "Bandbreite letzte Minute",
|
||||
"connectionInfo.ftBandwidth": "Dateitransfer Bandbreite",
|
||||
"connectionInfo.ftBytes": "Dateitransfer übertragene Bytes",
|
||||
"connectionInfo.ip": "IP-Adresse:",
|
||||
"connectionInfo.packetLoss": "Paketverlust:",
|
||||
"connectionInfo.packetsSent": "Pakete gesendet:",
|
||||
"connectionInfo.packetsReceived": "Pakete empfangen:",
|
||||
"connectionInfo.bytesSent": "Daten gesendet:",
|
||||
"connectionInfo.bytesReceived": "Daten empfangen:",
|
||||
"connectionInfo.bandwidthSent": "Bandbreite gesendet:",
|
||||
"connectionInfo.bandwidthReceived": "Bandbreite empfangen:",
|
||||
"menu.self.recordingProfile": "Aufnahmeprofil",
|
||||
"menu.self.playbackProfile": "Wiedergabeprofil",
|
||||
"menu.self.hotkeyProfile": "Hotkeyprofil",
|
||||
"menu.self.soundPack": "Sound Pack",
|
||||
"menu.self.setAway": "Abwesend setzen",
|
||||
"menu.self.enableMic": "Mikrofon aktivieren",
|
||||
"menu.self.disableMic": "Mikrofon ausschalten",
|
||||
"menu.self.muteOutput": "Lautsprecher/Kopfhörer ausschalten",
|
||||
"menu.self.unmuteOutput": "Lautsprecher/Kopfhörer einschalten",
|
||||
"menu.self.changeNickname": "Nickname ändern",
|
||||
"menu.self.requestTalkPower": "Talk Power anfordern",
|
||||
"menu.self.setAvatar": "Avatar setzen",
|
||||
"menu.self.setPhoneticNickname": "Phonetischen Nicknamen setzen",
|
||||
"menu.self.connectionInfo": "Verbindungsinformationen",
|
||||
"contacts.title": "Kontakte",
|
||||
"contacts.addOnlineClient": "Online-Client auswählen...",
|
||||
"contacts.add": "Hinzufügen",
|
||||
"contacts.remove": "Entfernen",
|
||||
"contacts.empty": "Noch keine Kontakte.",
|
||||
"contacts.customName": "Benutzerdefinierter Name:",
|
||||
"contacts.category.acquaintance": "Bekannter",
|
||||
"contacts.category.blocked": "Blockiert",
|
||||
"contacts.category.friend": "Freund",
|
||||
"contacts.phoneticName": "Phonetischer Name:",
|
||||
"contacts.show": "Anzeige",
|
||||
"contacts.ignore": "Ignorieren",
|
||||
"contacts.unignore": "Nicht mehr ignorieren",
|
||||
"contacts.whisper": "Whispern",
|
||||
"contacts.preferences": "Voreinstellungen",
|
||||
"favorites.title": "🔖 myTeamSpeak Favoriten",
|
||||
"favorites.synced": "Synchronisierte Favoriten",
|
||||
"favorites.notLoggedIn": "Nicht angemeldet",
|
||||
"favorites.local": "Lokale Favoriten",
|
||||
"favorites.unnamed": "(unbenannt)",
|
||||
"favorites.bookmarkName": "Bookmark Name:",
|
||||
"favorites.newFavoriteName": "Neuer Favorit",
|
||||
"favorites.showServerQueryClients": "ServerQuery Clients anzeigen",
|
||||
"favorites.connectOnStartup": "Beim Start verbinden",
|
||||
"favorites.new": "Neuer Favorit",
|
||||
"favorites.newFolder": "Neuer Ordner",
|
||||
"favorites.remove": "Entfernen",
|
||||
"favorites.ok": "OK",
|
||||
"favorites.cancel": "Abbrechen",
|
||||
"favorites.apply": "Anwenden",
|
||||
"away.dialog.title": "Abwesenheit-Nachricht setzen",
|
||||
"away.dialog.message": "Nachricht:",
|
||||
"away.dialog.template": "Vorlage:",
|
||||
"away.dialog.none": "<Keine>",
|
||||
"away.dialog.ok": "OK",
|
||||
"away.dialog.save": "Speichern",
|
||||
"away.dialog.cancel": "Abbrechen",
|
||||
"options.title": "Optionen",
|
||||
"options.ok": "OK",
|
||||
"options.cancel": "Abbrechen",
|
||||
"options.notImplemented": "Diese Einstellungen sind noch nicht implementiert.",
|
||||
"options.section.anwendung": "Anwendung",
|
||||
"options.section.wiedergabe": "Wiedergabe",
|
||||
"options.section.aufnahme": "Aufnahme",
|
||||
"options.section.design": "Design",
|
||||
"design.subtitle": "Wähle das Erscheinungsbild der Anwendung.",
|
||||
"design.theme.standard": "Standard",
|
||||
"design.theme.standard.desc": "Das originale WebSpeak3-Design.",
|
||||
"design.theme.nova": "Nova",
|
||||
"design.theme.nova.desc": "Moderneres, dunkles Design mit abgerundeten Elementen.",
|
||||
"design.theme.greenteaspeak": "GreenTeaSpeak",
|
||||
"design.theme.greenteaspeak.desc": "Klassisches GreenTeaSpeak-Client-Layout mit dunklen Panels und goldener Menüleiste.",
|
||||
"design.theme.pulse": "Pulse",
|
||||
"design.theme.pulse.desc": "Karten-Layout mit Breadcrumb-Leiste und farbigem Akzent.",
|
||||
"design.status.connected": "Verbunden",
|
||||
"design.custom.new": "+ Neues Design",
|
||||
"design.custom.import": "Design importieren",
|
||||
"design.custom.edit": "Bearbeiten",
|
||||
"design.custom.duplicate": "Duplizieren",
|
||||
"design.custom.export": "Exportieren",
|
||||
"design.custom.delete": "Löschen",
|
||||
"design.custom.deleteConfirm": "Dieses Design wirklich löschen?",
|
||||
"design.custom.newTitle": "Neues Design erstellen",
|
||||
"design.custom.editTitle": "Design bearbeiten",
|
||||
"design.custom.name": "Name",
|
||||
"design.custom.base": "Basis-Layout",
|
||||
"design.custom.css": "CSS",
|
||||
"design.custom.hint": "Dieses CSS wird geladen, solange das Design aktiv ist. Nutze .ts-app { ... } und die vorhandenen CSS-Variablen (--accent, --bg, --text, --border, ...), um Farben, Radien und Abstände anzupassen - mit .ts-app .irgendeine-klasse { display: none } oder order lässt sich auch das Layout verändern.",
|
||||
"design.custom.save": "Speichern",
|
||||
"design.custom.copyOf": "Kopie von {name}",
|
||||
"design.custom.importError": "Diese Datei konnte nicht als WebSpeak3-Design gelesen werden.",
|
||||
"design.store.open": "Store",
|
||||
"design.store.title": "Design-Store",
|
||||
"design.store.back": "Zurück",
|
||||
"design.store.loading": "Lädt…",
|
||||
"design.store.unavailable": "Der Design-Store ist auf diesem Server nicht verfügbar.",
|
||||
"design.store.empty": "Noch keine Designs im Store.",
|
||||
"design.store.install": "Installieren",
|
||||
"design.store.installed": "Installiert",
|
||||
"design.store.by": "von {author}",
|
||||
"design.store.screenshotAlt": "Screenshot von {name}",
|
||||
"design.store.rating.rate": "Mit {stars} Sternen bewerten",
|
||||
"design.store.rating.summary": "{average} ({count})",
|
||||
"design.store.rating.none": "Noch keine Bewertungen",
|
||||
"design.store.publishTitle": "Ein Design veröffentlichen",
|
||||
"design.store.publish.select": "Eigenes Design auswählen",
|
||||
"design.store.publish.none": "Du hast noch kein eigenes Design zum Veröffentlichen.",
|
||||
"design.store.publish.author": "Dein Name (optional)",
|
||||
"design.store.publish.authorPlaceholder": "Anonym",
|
||||
"design.store.publish.description": "Beschreibung (optional)",
|
||||
"design.store.publish.descriptionPlaceholder": "Was macht dieses Design besonders?",
|
||||
"design.store.publish.screenshot": "Screenshot (optional)",
|
||||
"design.store.publish.screenshotTooLarge": "Das Bild ist zu groß. Bitte ein kleineres Screenshot verwenden.",
|
||||
"design.store.publish.adminToken": "Admin-Token (nur für reservierte Namen nötig)",
|
||||
"design.store.publish.adminTokenPlaceholder": "Leer lassen, außer du weißt, was das ist",
|
||||
"design.store.publish.submit": "Im Store veröffentlichen",
|
||||
"design.store.publish.success": "Design wurde veröffentlicht!",
|
||||
"design.store.publish.pending": "Danke! Dein Design wurde eingereicht und erscheint im Store, sobald es geprüft wurde.",
|
||||
"design.store.publish.error": "Veröffentlichen fehlgeschlagen.",
|
||||
"options.section.erweiterungen": "Erweiterungen",
|
||||
"options.section.hotkeys": "Hotkeys",
|
||||
"options.section.whispern": "Whispern",
|
||||
"options.section.downloads": "Downloads",
|
||||
"options.section.chat": "Chat",
|
||||
"options.section.sicherheit": "Sicherheit",
|
||||
"options.section.nachrichten": "Nachrichten",
|
||||
"options.section.meldungen": "Meldungen",
|
||||
"options.section.sounds": "Sounds",
|
||||
"app.title": "Anwendung",
|
||||
"app.subtitle": "Allgemeine Anwendungseinstellungen",
|
||||
"app.language": "Sprache",
|
||||
"app.language.auto": "Systemvorgabe",
|
||||
"app.language.de": "Deutsch",
|
||||
"app.language.en": "English",
|
||||
"app.language.zh-CN": "简体中文",
|
||||
"app.language.fa": "فارسی (بتا)",
|
||||
"app.language.helpTranslate": "Fehlt deine Sprache oder eine Übersetzung ist ungenau? Hilf mit auf Weblate →",
|
||||
"playback.title": "Wiedergabe",
|
||||
"playback.subtitle": "Ändern der Wiedergabeeinstellungen",
|
||||
"playback.profile": "Profile",
|
||||
"playback.default": "Standard",
|
||||
"playback.device": "Wiedergabegerät:",
|
||||
"playback.systemDefault": "System default",
|
||||
"playback.quiet": "Leise",
|
||||
"playback.loud": "Laut",
|
||||
"playback.voiceVolume": "Sprachlautstärke",
|
||||
"playback.playTestTone": "▶ Test Ton abspielen",
|
||||
"playback.options": "Optionen",
|
||||
"playback.autoVolume": "Automatische Lautstärkeanpassung",
|
||||
"playback.ownMicClicks": "Eigener Client spielt Mikro Klicks",
|
||||
"playback.otherMicClicks": "Andere Clients spielen Mikro Klicks",
|
||||
"recording.title": "Aufnahme",
|
||||
"recording.subtitle": "Ändern der Aufnahmeeinstellungen",
|
||||
"recording.device": "Aufnahmegerät:",
|
||||
"recording.activation": "Aktivierung",
|
||||
"recording.pushToTalk": "Push-To-Talk",
|
||||
"recording.continuous": "Dauersenden",
|
||||
"recording.voiceActivation": "Automatische Spracherkennung",
|
||||
"recording.testStart": "Test starten",
|
||||
"recording.testStop": "Test beenden",
|
||||
"recording.hangoverDelay": "Abschaltverzögerung:",
|
||||
"recording.secondsUnit": "Sek",
|
||||
"recording.dsp": "Digital Signal Processing",
|
||||
"recording.typingAttenuation": "Typing attenuation",
|
||||
"recording.echoCancellation": "Echo Dämpfung",
|
||||
"recording.noiseSuppression": "Hintergrundgeräusche entfernen",
|
||||
"recording.autoGainControl": "Automatische Verstärkung",
|
||||
"recording.aec3": "Erweiterte Echounterdrückung (Beta, mehr CPU-Last)",
|
||||
"info.address": "Adresse:",
|
||||
"info.version": "Version:",
|
||||
"info.license": "Lizenz:",
|
||||
"info.currentClients": "Aktuelle Clients:",
|
||||
"info.currentChannels": "Aktuelle Channel:",
|
||||
"info.topic": "Topic:",
|
||||
"info.audioCodec": "Audio Codec:",
|
||||
"info.spacer": "Spacer:",
|
||||
"info.rawName": "Rohname:",
|
||||
"info.passwordProtected": "Passwort geschützt:",
|
||||
"info.clients": "Clients:",
|
||||
"info.country": "Land:",
|
||||
"info.muted": "Mikrofon stumm:",
|
||||
"info.outputMuted": "Lautsprecher stumm:",
|
||||
"info.serverGroups": "Servergruppen:",
|
||||
"info.yes": "Ja",
|
||||
"info.no": "Nein",
|
||||
"tree.notConnected": "Nicht verbunden",
|
||||
"tree.clickToSelect": "Klicken zum Auswählen, Doppelklick zum Beitreten",
|
||||
"tree.clickToJoin": "Doppelklick zum Beitreten",
|
||||
"tree.joinNotConnected": "Nicht verbunden — Channel-Wechsel nicht möglich",
|
||||
"tree.passwordProtected": "Passwortgeschützt",
|
||||
"tree.privateChatWith": "Privater Chat mit",
|
||||
"tree.poke": "Anstupsen",
|
||||
"tree.channelCommander": "Channel Commander",
|
||||
"tree.away": "Abwesend",
|
||||
"tree.micMuted": "Mikrofon stummgeschaltet",
|
||||
"tree.talking": "Spricht",
|
||||
"tree.noTalkPower": "Keine Redeerlaubnis in diesem Channel",
|
||||
"tree.soundMuted": "Ton stummgeschaltet (deafened)",
|
||||
"tree.streaming": "Überträgt einen Stream",
|
||||
"publish.alpha": "Alpha",
|
||||
"publish.alphaTitle": "Alpha – instabil, kann sich jederzeit ändern oder brechen",
|
||||
"publish.demoUnavailable": "Übertragen ist in der Demo nicht verfügbar – dafür braucht es einen echten TeamSpeak-6-Server.",
|
||||
"publish.alphaNote": "Streaming ist Alpha. Es spricht TeamSpeak 6s Stream/Call-Protokoll, das nicht dokumentiert ist – Verbindungsaufbau, Bildqualität und Zuschauerverwaltung können fehlschlagen oder sich ohne Vorankündigung ändern. Nicht für produktive Nutzung gedacht.",
|
||||
"publish.start": "Bildschirm übertragen",
|
||||
"publish.stop": "Übertragung beenden",
|
||||
"publish.title": "Deine Übertragung",
|
||||
"publish.screen": "Bildschirm",
|
||||
"publish.starting": "Wird gestartet…",
|
||||
"publish.viewers": "{count} Zuschauer",
|
||||
"publish.request.allow": "Zulassen",
|
||||
"publish.request.deny": "Ablehnen",
|
||||
"publish.request.block": "Sperren",
|
||||
"publish.request.blockHint": "Ablehnen und nicht erneut fragen",
|
||||
"publish.dialog.title": "Stream-Einstellungen",
|
||||
"publish.dialog.basic": "Grundeinstellungen",
|
||||
"publish.dialog.advanced": "Erweiterte Einstellungen",
|
||||
"publish.dialog.golive": "Live gehen",
|
||||
"publish.dialog.cancel": "Zurück",
|
||||
"publish.preset": "Voreinstellung",
|
||||
"publish.preset.presentation": "Präsentation",
|
||||
"publish.audio": "Audio aufnehmen",
|
||||
"publish.privacy": "Privatsphäre",
|
||||
"publish.privacy.public": "Öffentlich",
|
||||
"publish.privacy.contacts": "Kontakte",
|
||||
"publish.privacy.private": "Privat",
|
||||
"publish.resolution": "Auflösung",
|
||||
"publish.res.source": "Quelle",
|
||||
"publish.fps": "FPS",
|
||||
"publish.bitrate": "Bitrate",
|
||||
"publish.audioBitrate": "Audio-Bitrate [Kbps]",
|
||||
"publish.viewerLimit": "Zuschauerbegrenzung",
|
||||
"publish.mode": "Verbindungsmodus",
|
||||
"publish.mode.p2p": "P2P",
|
||||
"publish.mode.server": "Server",
|
||||
"publish.mode.serverUnavailable": "Der Server-Modus läuft über TS6s SFU und ist noch nicht implementiert.",
|
||||
"stream.untitled": "Stream",
|
||||
"stream.stop": "Stream schließen",
|
||||
"stream.live": "Live",
|
||||
"stream.state.new": "Warte auf Angebot…",
|
||||
"stream.state.connecting": "Verbinde…",
|
||||
"stream.state.connected": "Live",
|
||||
"stream.state.disconnected": "Verbindung unterbrochen",
|
||||
"stream.state.failed": "Verbindung fehlgeschlagen",
|
||||
"stream.state.closed": "Beendet",
|
||||
"chat.server": "Server",
|
||||
"chat.channel": "Channel",
|
||||
"chat.notConnected": "Nicht verbunden",
|
||||
"chat.messageChannel": "Nachricht an Channel...",
|
||||
"chat.messageServer": "Nachricht an Server...",
|
||||
"chat.messagePartner": "Nachricht an {name}...",
|
||||
"chat.send": "Senden",
|
||||
"chat.you": "Du",
|
||||
"serverLog.clientJoin": "{client} loggte sich in Channel \"{channel}\" ein",
|
||||
"serverLog.clientLeave": "{client} hat die Verbindung getrennt (Verlassen)",
|
||||
"serverLog.clientChannelSwitch": "{client} ging von Channel \"{fromChannel}\" in \"{toChannel}\"",
|
||||
"serverLog.clientChannelGroupAssigned": "Die Channel-Gruppe \"{group}\" wurde {client} zugewiesen",
|
||||
"serverLog.channelCreated": "Channel \"{channel}\" wurde erstellt",
|
||||
"serverLog.channelDeleted": "Channel \"{channel}\" wurde gelöscht",
|
||||
"serverLog.channelEdited": "Channel \"{channel}\" wurde bearbeitet",
|
||||
"serverLog.serverEdited": "Die Servereinstellungen wurden geändert",
|
||||
"serverLog.permissionError": "Fehlende Berechtigung: {action}",
|
||||
"poke.title": "Anstupsen",
|
||||
"poke.optionalMessage": "Optionale Nachricht...",
|
||||
"poke.send": "Anstupsen",
|
||||
"poke.cancel": "Abbrechen",
|
||||
"poke.pokedYou": "hat dich angestupst",
|
||||
"poke.dismiss": "Schließen",
|
||||
"kick.title": "Kicken:",
|
||||
"kick.reasonPlaceholder": "Grund (optional)...",
|
||||
"kick.confirm": "Kicken",
|
||||
"kick.cancel": "Abbrechen",
|
||||
"ban.title": "Bannen:",
|
||||
"ban.reasonPlaceholder": "Grund (optional)...",
|
||||
"ban.duration": "Dauer:",
|
||||
"ban.durationPermanent": "Permanent",
|
||||
"ban.duration1h": "1 Stunde",
|
||||
"ban.duration1d": "1 Tag",
|
||||
"ban.duration1w": "1 Woche",
|
||||
"ban.confirm": "Bannen",
|
||||
"ban.cancel": "Abbrechen",
|
||||
"serverEdit.title": "Virtuellen Server editieren",
|
||||
"serverEdit.tab.host": "Host",
|
||||
"serverEdit.tab.misc": "Verschiedenes",
|
||||
"serverEdit.tab.transmission": "Übertragung",
|
||||
"serverEdit.tab.antiflood": "Anti-Flood",
|
||||
"serverEdit.tab.security": "Sicherheit",
|
||||
"serverEdit.tab.log": "Protokoll",
|
||||
"serverEdit.name": "Servername:",
|
||||
"serverEdit.welcomeMessage": "Willkommensnachricht:",
|
||||
"serverEdit.clearPassword": "Serverpasswort entfernen",
|
||||
"serverEdit.newPassword": "Neues Serverpasswort:",
|
||||
"serverEdit.hostmessage": "Hostnachricht:",
|
||||
"serverEdit.hostmessageMode": "Anzeigemodus:",
|
||||
"serverEdit.hostmessageMode.none": "Nicht anzeigen",
|
||||
"serverEdit.hostmessageMode.log": "Im Protokoll anzeigen",
|
||||
"serverEdit.hostmessageMode.modal": "Als Dialog anzeigen",
|
||||
"serverEdit.hostmessageMode.modalquit": "Als Dialog anzeigen und trennen",
|
||||
"serverEdit.hostbannerUrl": "Host-Banner URL:",
|
||||
"serverEdit.hostbannerGfxUrl": "Host-Banner Bild-URL:",
|
||||
"serverEdit.hostbannerGfxInterval": "Banner-Aktualisierung (Sekunden):",
|
||||
"serverEdit.hostbannerMode": "Banner-Anpassung:",
|
||||
"serverEdit.hostbannerMode.noadjust": "Nicht anpassen",
|
||||
"serverEdit.hostbannerMode.adjustignoreaspect": "Anpassen (Seitenverhältnis ignorieren)",
|
||||
"serverEdit.hostbannerMode.adjustkeepaspect": "Anpassen (Seitenverhältnis beibehalten)",
|
||||
"serverEdit.hostbuttonTooltip": "Host-Button Tooltip:",
|
||||
"serverEdit.hostbuttonUrl": "Host-Button URL:",
|
||||
"serverEdit.hostbuttonGfxUrl": "Host-Button Bild-URL:",
|
||||
"serverEdit.maxClients": "Maximale Clientanzahl:",
|
||||
"serverEdit.nickname": "Server-Nickname:",
|
||||
"serverEdit.phoneticName": "Phonetischer Name:",
|
||||
"serverEdit.codecEncryptionMode": "Sprachverschlüsselung:",
|
||||
"serverEdit.codecEncryptionMode.perchannel": "Pro Channel konfigurierbar",
|
||||
"serverEdit.codecEncryptionMode.forcedoff": "Global deaktiviert",
|
||||
"serverEdit.codecEncryptionMode.forcedon": "Global aktiviert",
|
||||
"serverEdit.unchanged": "Unverändert lassen",
|
||||
"serverEdit.save": "Speichern",
|
||||
"serverEdit.cancel": "Abbrechen",
|
||||
"serverProtocolLog.title": "Server Protokoll",
|
||||
"serverProtocolLog.empty": "Keine Protokolleinträge vorhanden.",
|
||||
"banList.title": "Bannliste",
|
||||
"banList.empty": "Keine Bans vorhanden.",
|
||||
"banList.name": "Name",
|
||||
"banList.ip": "IP",
|
||||
"banList.created": "Erstellt",
|
||||
"banList.duration": "Dauer",
|
||||
"banList.invoker": "Von",
|
||||
"banList.reason": "Grund",
|
||||
"banList.permanent": "Permanent",
|
||||
"banList.delete": "Löschen",
|
||||
"banList.deleteAll": "Alle löschen",
|
||||
"complainList.title": "Beschwerdeliste",
|
||||
"complainList.empty": "Keine Beschwerden vorhanden.",
|
||||
"complainList.target": "Ziel",
|
||||
"complainList.from": "Von",
|
||||
"complainList.message": "Nachricht",
|
||||
"complainList.timestamp": "Zeitpunkt",
|
||||
"offlineMessages.title": "Offline Nachrichten",
|
||||
"offlineMessages.empty": "Keine Nachrichten vorhanden.",
|
||||
"offlineMessages.subject": "Betreff",
|
||||
"offlineMessages.from": "Von",
|
||||
"offlineMessages.timestamp": "Zeitpunkt",
|
||||
"offlineMessages.targetUid": "Ziel-UID",
|
||||
"offlineMessages.message": "Nachricht",
|
||||
"offlineMessages.send": "Senden",
|
||||
"offlineMessages.new": "Neue Nachricht",
|
||||
"offlineMessages.markRead": "Als gelesen markieren",
|
||||
"offlineMessages.backToList": "Zurück zur Liste",
|
||||
"dialog.cancel": "Abbrechen",
|
||||
"groupAssign.channelTitle": "Channel-Gruppe zuweisen",
|
||||
"groupAssign.serverTitle": "Server-Gruppe zuweisen",
|
||||
"groupAssign.empty": "Keine Gruppen vorhanden.",
|
||||
"groupAssign.clickToRemove": "Klicken zum Entfernen",
|
||||
"serverQueryLogin.username": "Benutzername",
|
||||
"serverQueryLogin.password": "Passwort",
|
||||
"serverQueryLogin.login": "Anmelden",
|
||||
"permissionOverview.title": "Eigene Rechte",
|
||||
"permissionOverview.empty": "Keine Rechte gefunden.",
|
||||
"permissionOverview.name": "Recht",
|
||||
"permissionOverview.value": "Wert",
|
||||
"permissionOverview.negated": "Negiert",
|
||||
"permissionOverview.skip": "Skip",
|
||||
"permsEditor.title": "Rechte",
|
||||
"permsEditor.tab.server": "Server Gruppen",
|
||||
"permsEditor.tab.client": "Client Rechte",
|
||||
"permsEditor.tab.channel": "Channel Rechte",
|
||||
"permsEditor.tab.channelgroup": "Channel Gruppen",
|
||||
"permsEditor.tab.channelclient": "Channel Client Rechte",
|
||||
"permsEditor.clientDbId": "Eindeutige Client-DB-ID:",
|
||||
"permsEditor.load": "Laden",
|
||||
"permsEditor.pickOnlineClient": "Oder Online-Client wählen...",
|
||||
"permsEditor.pickTarget": "Bitte links eine Gruppe/einen Channel wählen bzw. eine Client-ID eingeben.",
|
||||
"permsEditor.addPermission": "Hinzufügen",
|
||||
"permsEditor.searchPermission": "Recht suchen...",
|
||||
"dialog.ok": "OK",
|
||||
"channelContext.join": "Channel wechseln",
|
||||
"channelContext.files": "Dateien...",
|
||||
"fileBrowser.title": "Dateitransfers",
|
||||
"fileBrowser.up": "Nach oben",
|
||||
"fileBrowser.tooLarge": "Datei zu groß – höchstens {mb} MiB pro Upload.",
|
||||
"fileBrowser.refresh": "Aktualisieren",
|
||||
"fileBrowser.newFolder": "Neuer Ordner",
|
||||
"fileBrowser.upload": "Hochladen",
|
||||
"fileBrowser.folderName": "Ordnername",
|
||||
"fileBrowser.empty": "Dieser Ordner ist leer.",
|
||||
"fileBrowser.name": "Name",
|
||||
"fileBrowser.size": "Größe",
|
||||
"fileBrowser.modified": "Geändert",
|
||||
"fileBrowser.download": "Herunterladen",
|
||||
"fileBrowser.rename": "Umbenennen",
|
||||
"fileBrowser.delete": "Löschen",
|
||||
"fileBrowser.deleteConfirm": "Wirklich löschen?",
|
||||
"fileBrowser.uploading": "Wird hochgeladen...",
|
||||
"fileBrowser.downloading": "Wird heruntergeladen...",
|
||||
"serverContext.icons": "Server-Icons...",
|
||||
"serverIcons.title": "Server-Icons verwalten",
|
||||
"serverIcons.upload": "Icon hochladen",
|
||||
"serverIcons.iconId": "Icon-ID",
|
||||
"serverIcons.empty": "Keine Icons vorhanden.",
|
||||
"clientContext.privateChat": "Privater Chat",
|
||||
"clientContext.poke": "Anstupsen",
|
||||
"clientContext.watchStream": "Stream ansehen",
|
||||
"clientContext.moveTo": "Verschieben in…",
|
||||
"clientContext.copyName": "Namen kopieren",
|
||||
"clientContext.connectionInfo": "Verbindungsinformationen anzeigen",
|
||||
"clientContext.addWhisperTarget": "Als Whisper-Ziel hinzufügen",
|
||||
"clientContext.removeWhisperTarget": "Als Whisper-Ziel entfernen",
|
||||
"clientContext.assignChannelGroup": "Channel-Gruppe zuweisen",
|
||||
"clientContext.assignServerGroup": "Server-Gruppe zuweisen",
|
||||
"clientContext.kickChannel": "Aus dem Channel kicken",
|
||||
"clientContext.kick": "Vom Server kicken",
|
||||
"clientContext.ban": "Bannen",
|
||||
"clientContext.notSupported": "Im Web-Client noch nicht unterstützt",
|
||||
"moveClient.title": "Verschieben",
|
||||
"moveClient.empty": "Keine Channels verfügbar.",
|
||||
"moveClient.current": "Aktueller Channel",
|
||||
"moveClient.spacer": "Spacer",
|
||||
"serverContext.connectionInfo": "Serververbindungsinformationen",
|
||||
"serverContext.copyAddress": "Serveradresse kopieren",
|
||||
"serverContext.addFavorite": "Zu Favoriten hinzufügen",
|
||||
"serverContext.disconnect": "Verbindung trennen",
|
||||
"connectError.dismiss": "Schließen",
|
||||
"dialog.close": "Schließen",
|
||||
"sounds.title": "Sounds",
|
||||
"sounds.subtitle": "Sound-Benachrichtigungen für Ereignisse festlegen",
|
||||
"sounds.enable": "Sounds aktivieren",
|
||||
"sounds.volume": "Lautstärke",
|
||||
"sounds.eventEnable": "Diesen Sound aktivieren",
|
||||
"sounds.event.connect": "Verbunden",
|
||||
"sounds.event.disconnect": "Getrennt",
|
||||
"sounds.event.clientJoin": "Client kommt",
|
||||
"sounds.event.clientLeave": "Client geht",
|
||||
"sounds.event.message": "Nachricht empfangen",
|
||||
"sounds.event.poke": "Anstupsen erhalten",
|
||||
"sounds.default": "Standard",
|
||||
"sounds.custom": "Eigene Datei: {name}",
|
||||
"sounds.test": "▶ Testen",
|
||||
"sounds.upload": "Hochladen",
|
||||
"sounds.reset": "Zurücksetzen",
|
||||
"sounds.importSoundpack": "Soundpack importieren (.ts3soundpack)",
|
||||
"sounds.importResult": "{matched} Sound(s) übernommen, {unmatched} Datei(en) nicht zugeordnet",
|
||||
"nachrichten.title": "Nachrichten",
|
||||
"nachrichten.subtitle": "Nachrichten anpassen",
|
||||
"nachrichten.disconnectMessage": "Verbindung trennen:",
|
||||
"nachrichten.disconnectMessagePlaceholder": "verlassen",
|
||||
"nachrichten.presetsTitle": "Voreingestellte Nachrichten",
|
||||
"nachrichten.type": "Typ",
|
||||
"nachrichten.type.away": "Abwesend",
|
||||
"nachrichten.templateName": "Vorlagenname",
|
||||
"nachrichten.message": "Nachricht",
|
||||
"nachrichten.add": "Hinzufügen",
|
||||
"nachrichten.delete": "Löschen",
|
||||
"tree.expand": "Aufklappen",
|
||||
"tree.collapse": "Zuklappen",
|
||||
"tabs.disconnect": "Verbindung trennen",
|
||||
"tabs.closeTab": "Tab schließen: {label}",
|
||||
"identity.importInvalid": "„{file}“ ist keine gültige Identitätsdatei.",
|
||||
"log.fileTransferFailed": "Dateiübertragung fehlgeschlagen:",
|
||||
"log.fileTransferInvalidAddress": "Dateiübertragung fehlgeschlagen (ungültige Adresse)",
|
||||
"sounds.importFailed": "Das Soundpack konnte nicht gelesen werden – ist es eine gültige .ts3soundpack-/ZIP-Datei?",
|
||||
"tabs.connections": "Server-Verbindungen",
|
||||
"shortcut.ctrl": "Strg"
|
||||
}
|
||||
@@ -0,0 +1,662 @@
|
||||
{
|
||||
"menu.connections": "Connections",
|
||||
"menu.connections.connect": "Connect",
|
||||
"menu.connections.disconnectCurrent": "Disconnect from current server",
|
||||
"menu.connections.disconnectAll": "Disconnect from all servers",
|
||||
"menu.favorites": "Bookmarks",
|
||||
"menu.favorites.add": "Add bookmark",
|
||||
"menu.favorites.manage": "Manage bookmarks",
|
||||
"menu.self": "Self",
|
||||
"menu.rights": "Permissions",
|
||||
"menu.rights.serverGroups": "Edit server groups...",
|
||||
"menu.rights.channelGroups": "Edit channel groups...",
|
||||
"menu.rights.serverPermissions": "Edit server permissions...",
|
||||
"menu.rights.channelPermissions": "Edit channel permissions...",
|
||||
"menu.rights.overview": "Permission overview...",
|
||||
"menu.rights.myRights": "Show my permissions",
|
||||
"menu.extras": "Tools",
|
||||
"menu.help": "Help",
|
||||
"menu.help.about": "About WebSpeak3",
|
||||
"menu.help.github": "GitHub",
|
||||
"menu.help.changelog": "Changelog",
|
||||
"menu.help.translate": "Help translate (Weblate)",
|
||||
"menu.extras.identities": "Identities",
|
||||
"menu.extras.contacts": "Contacts",
|
||||
"menu.extras.collectedUrls": "Collected URLs",
|
||||
"menu.extras.inviteFriend": "Invite a friend",
|
||||
"menu.extras.whisperLists": "Whisper Lists",
|
||||
"menu.extras.whisperHistory": "Whisper History",
|
||||
"menu.extras.clientLog": "Client Log",
|
||||
"menu.extras.banList": "Ban List",
|
||||
"menu.extras.complaintList": "Complaint List",
|
||||
"menu.extras.offlineMessages": "Offline Messages",
|
||||
"menu.extras.serverQueryLogin": "ServerQuery Login",
|
||||
"menu.extras.serverLog": "Server Log",
|
||||
"menu.extras.startRecording": "Start Recording",
|
||||
"menu.extras.startMultitrackRecording": "Start Multitrack Recording",
|
||||
"menu.extras.stopRecording": "Stop Recording",
|
||||
"menu.extras.options": "Options",
|
||||
"menu.extras.feedback": "Send Feedback",
|
||||
"feedback.fab.nudge": "What do you think of WebSpeak3? Feedback welcome!",
|
||||
"donate.label": "Donate",
|
||||
"donate.title": "Support WebSpeak3 on Ko-fi",
|
||||
"pwa.updateAvailable": "New version available",
|
||||
"pwa.reload": "Reload",
|
||||
"feedback.dialog.title": "Feedback",
|
||||
"feedback.dialog.intro": "Report a bug or share an idea to help improve WebSpeak3.",
|
||||
"feedback.dialog.category": "Category",
|
||||
"feedback.dialog.category.bug": "Bug",
|
||||
"feedback.dialog.category.idea": "Idea",
|
||||
"feedback.dialog.category.report": "Report (violation/abuse)",
|
||||
"feedback.dialog.category.other": "Other",
|
||||
"feedback.dialog.reportHint": "Reports stay private and are never published as a GitHub issue. Feel free to name the affected server.",
|
||||
"feedback.dialog.message": "Message",
|
||||
"feedback.dialog.messagePlaceholder": "What happened, or what are you suggesting?",
|
||||
"feedback.dialog.email": "Email (optional, for follow-up – stays private, never published)",
|
||||
"feedback.dialog.publishAsIssue": "Publish as a public GitHub issue",
|
||||
"feedback.dialog.publishAsIssueHint": "Leave unchecked to keep your feedback private, visible only to the maintainer.",
|
||||
"feedback.dialog.publishAsIssueHintBug": "Bug reports are always published as a public GitHub issue.",
|
||||
"feedback.dialog.send": "Send",
|
||||
"restartNotice.title": "Brief interruption",
|
||||
"restartNotice.body": "The server is about to restart briefly. Your connection will drop for a moment.",
|
||||
"restartNotice.ack": "Got it",
|
||||
"menu.extras.tos": "Terms of use",
|
||||
"tos.title": "Terms of use for client.webspeak3.de",
|
||||
"tos.rule1": "This client is for private, non-commercial use of TeamSpeak/TeaSpeak/GreenTeaSpeak servers via the browser.",
|
||||
"tos.rule2": "Prohibited in particular: any criminal activity, harassment and hate speech, spam and flooding, disrupting the service, and circumventing bans.",
|
||||
"tos.rule3": "Violations may result in access being blocked without warning; serious cases may be reported to the relevant authorities.",
|
||||
"tos.rule4Pre": "For operational security and abuse detection, connections are logged (server address, server name, timestamp) and automatically deleted after 90 days – see the ",
|
||||
"tos.rule4Post": ".",
|
||||
"tos.privacyLinkText": "privacy policy",
|
||||
"tos.rule5Pre": "For abuse or complaints: see the ",
|
||||
"tos.rule5Post": ".",
|
||||
"tos.legalLinkText": "legal notice (Impressum)",
|
||||
"tos.rule6": "By clicking \"Accept\" you agree to these terms. Your acceptance is stored only locally in your browser; you'll be asked again if the rules change.",
|
||||
"tos.accept": "Accept",
|
||||
"tos.close": "Close",
|
||||
"feedback.dialog.cancel": "Cancel",
|
||||
"feedback.dialog.sending": "Sending…",
|
||||
"feedback.dialog.success": "Thanks for your feedback!",
|
||||
"feedback.dialog.successWithIssue": "Thanks! Issue created:",
|
||||
"feedback.dialog.error": "Failed to send. Please try again later.",
|
||||
"toolbar.setAway": "Set away",
|
||||
"toolbar.backOnline": "Back online",
|
||||
"toolbar.awayOptions": "Away options",
|
||||
"toolbar.whisper": "Whisper targets",
|
||||
"whisper.channels": "Channels",
|
||||
"whisper.clients": "Clients",
|
||||
"whisper.clearAll": "Clear all whisper targets",
|
||||
"toolbar.micEnable": "Enable microphone",
|
||||
"toolbar.micMute": "Mute microphone",
|
||||
"toolbar.micUnmute": "Unmute microphone",
|
||||
"toolbar.vadSensitivity": "Voice activation sensitivity",
|
||||
"toolbar.muteSound": "Mute sound (deafen)",
|
||||
"toolbar.unmuteSound": "Unmute sound (undeafen)",
|
||||
"toolbar.chooseOutputDevice": "Choose output device",
|
||||
"toolbar.toggleTheme": "Toggle theme",
|
||||
"away.setGlobal": "Set globally away",
|
||||
"away.setGlobalStatus": "Set global away status",
|
||||
"connect.title": "Connect",
|
||||
"connect.novaSubtitle": "WebSpeak3 runs entirely in the browser — no download needed",
|
||||
"connect.serverAddress": "Server nickname or address:",
|
||||
"connect.serverPassword": "Server password:",
|
||||
"connect.nickname": "Nickname:",
|
||||
"connect.phoneticNickname": "Phonetic nickname:",
|
||||
"connect.identity": "Identity:",
|
||||
"connect.defaultChannel": "Default channel:",
|
||||
"connect.recordingProfile": "Capture profile:",
|
||||
"connect.channelPassword": "Channel password:",
|
||||
"connect.playbackProfile": "Playback profile:",
|
||||
"connect.onetimeGrant": "One-time privilege key:",
|
||||
"connect.serverType": "Server type:",
|
||||
"connect.serverType.auto": "Auto",
|
||||
"connect.serverType.teamspeak": "TeamSpeak",
|
||||
"connect.serverType.teaspeak": "TeaSpeak",
|
||||
"connect.hotkeyProfile": "Hotkey profile:",
|
||||
"connect.soundPack": "Sound pack:",
|
||||
"connect.more": "More",
|
||||
"connect.less": "Less",
|
||||
"connect.connect": "Connect",
|
||||
"connect.connecting": "Connecting…",
|
||||
"connect.newTab": "In new tab",
|
||||
"connect.cancel": "Cancel",
|
||||
"channelPasswordDialog.title": "Channel password required",
|
||||
"channelPasswordDialog.prompt": "This channel is password-protected. Please enter the password:",
|
||||
"channelPasswordDialog.wrongPassword": "Wrong password, please try again:",
|
||||
"channelPasswordDialog.submit": "Join",
|
||||
"channelPasswordDialog.cancel": "Cancel",
|
||||
"collectedUrls.title": "Collected URLs",
|
||||
"collectedUrls.search": "Search:",
|
||||
"collectedUrls.url": "URL",
|
||||
"collectedUrls.count": "Count",
|
||||
"collectedUrls.lastSeen": "Last mentioned",
|
||||
"collectedUrls.mentionedBy": "Mentioned by",
|
||||
"collectedUrls.clearList": "Clear list",
|
||||
"inviteFriend.title": "Invite a friend",
|
||||
"inviteFriend.type": "Invitation type",
|
||||
"inviteFriend.includeChannel": "Insert current channel",
|
||||
"inviteFriend.link": "Link",
|
||||
"inviteFriend.addPermissionKey": "Add permission key",
|
||||
"inviteFriend.copyToClipboard": "Copy to clipboard",
|
||||
"inviteFriend.copied": "Copied!",
|
||||
"clientLog.title": "Client Log",
|
||||
"clientLog.level.critical": "Critical",
|
||||
"clientLog.level.error": "Errors",
|
||||
"clientLog.level.warning": "Warnings",
|
||||
"clientLog.level.info": "Info",
|
||||
"clientLog.level.debug": "Debug",
|
||||
"clientLog.search": "Search:",
|
||||
"clientLog.filter": "Filter:",
|
||||
"clientLog.caseSensitive": "Case sensitive",
|
||||
"clientLog.mark": "Mark",
|
||||
"whisperHistory.title": "Whisper History - {server}",
|
||||
"whisperHistory.empty": "No whisper history yet.",
|
||||
"whisperHistory.started": "Whispering to: {targets}",
|
||||
"whisperHistory.stopped": "Stopped whispering",
|
||||
"whisperHistory.clear": "Clear",
|
||||
"whisperHistory.options": "Options",
|
||||
"whisperLists.title": "Whisper Lists",
|
||||
"whisperLists.namePlaceholder": "List name",
|
||||
"whisperLists.saveCurrent": "Save current selection",
|
||||
"whisperLists.itemDetail": "{channels} channels, {clients} clients",
|
||||
"whisperLists.activate": "Activate",
|
||||
"whisperLists.delete": "Delete",
|
||||
"whisperLists.empty": "No whisper lists saved yet. Select whisper targets and save them here as a list.",
|
||||
"identities.title": "Identities",
|
||||
"identities.activate": "Activate",
|
||||
"identities.add": "New Identity",
|
||||
"identities.delete": "Delete",
|
||||
"identities.newName": "New Identity",
|
||||
"identities.generated": "Generated",
|
||||
"identities.pending": "Will be generated on next connection",
|
||||
"identities.listLabel": "Local Identities",
|
||||
"identities.name": "Identity Name:",
|
||||
"identities.phoneticNickname": "Phonetic Nickname:",
|
||||
"identities.uniqueId": "Unique ID:",
|
||||
"identities.unknown": "Unknown",
|
||||
"identities.setDefault": "Set as Default",
|
||||
"identities.isDefault": "Currently used as default",
|
||||
"identities.export": "Export",
|
||||
"identities.import": "Import",
|
||||
"connectionInfo.clientTitle": "Connection Info - {name}",
|
||||
"connectionInfo.serverTitle": "Server Connection Info",
|
||||
"connectionInfo.loading": "Loading…",
|
||||
"connectionInfo.unavailable": "No response from the server (missing permission?).",
|
||||
"connectionInfo.ping": "Ping:",
|
||||
"connectionInfo.connectedSince": "Connected since:",
|
||||
"connectionInfo.uptime": "Uptime:",
|
||||
"connectionInfo.name": "Name:",
|
||||
"connectionInfo.avgPing": "Average ping:",
|
||||
"connectionInfo.avgPacketLoss": "Average packet loss:",
|
||||
"connectionInfo.incoming": "Incoming",
|
||||
"connectionInfo.outgoing": "Outgoing",
|
||||
"connectionInfo.packetsTransferred": "Packets transferred",
|
||||
"connectionInfo.bytesTransferred": "Bytes transferred",
|
||||
"connectionInfo.bandwidthLastSecond": "Bandwidth last second",
|
||||
"connectionInfo.bandwidthLastMinute": "Bandwidth last minute",
|
||||
"connectionInfo.ftBandwidth": "File transfer bandwidth",
|
||||
"connectionInfo.ftBytes": "File transfer bytes",
|
||||
"connectionInfo.ip": "IP address:",
|
||||
"connectionInfo.packetLoss": "Packet loss:",
|
||||
"connectionInfo.packetsSent": "Packets sent:",
|
||||
"connectionInfo.packetsReceived": "Packets received:",
|
||||
"connectionInfo.bytesSent": "Data sent:",
|
||||
"connectionInfo.bytesReceived": "Data received:",
|
||||
"connectionInfo.bandwidthSent": "Bandwidth sent:",
|
||||
"connectionInfo.bandwidthReceived": "Bandwidth received:",
|
||||
"menu.self.recordingProfile": "Recording Profile",
|
||||
"menu.self.playbackProfile": "Playback Profile",
|
||||
"menu.self.hotkeyProfile": "Hotkey Profile",
|
||||
"menu.self.soundPack": "Sound Pack",
|
||||
"menu.self.setAway": "Set Away",
|
||||
"menu.self.enableMic": "Enable Microphone",
|
||||
"menu.self.disableMic": "Disable Microphone",
|
||||
"menu.self.muteOutput": "Mute Speakers/Headphones",
|
||||
"menu.self.unmuteOutput": "Unmute Speakers/Headphones",
|
||||
"menu.self.changeNickname": "Change Nickname",
|
||||
"menu.self.requestTalkPower": "Request Talk Power",
|
||||
"menu.self.setAvatar": "Set Avatar",
|
||||
"menu.self.setPhoneticNickname": "Set Phonetic Nickname",
|
||||
"menu.self.connectionInfo": "Connection Info",
|
||||
"contacts.title": "Contacts",
|
||||
"contacts.addOnlineClient": "Select an online client...",
|
||||
"contacts.add": "Add",
|
||||
"contacts.remove": "Remove",
|
||||
"contacts.empty": "No contacts yet.",
|
||||
"contacts.customName": "Custom Name:",
|
||||
"contacts.category.acquaintance": "Acquaintance",
|
||||
"contacts.category.blocked": "Blocked",
|
||||
"contacts.category.friend": "Friend",
|
||||
"contacts.phoneticName": "Phonetic Name:",
|
||||
"contacts.show": "Show",
|
||||
"contacts.ignore": "Ignore",
|
||||
"contacts.unignore": "Unignore",
|
||||
"contacts.whisper": "Whisper",
|
||||
"contacts.preferences": "Preferences",
|
||||
"favorites.title": "🔖 myTeamSpeak Bookmarks",
|
||||
"favorites.synced": "Synced Bookmarks",
|
||||
"favorites.notLoggedIn": "Not logged in",
|
||||
"favorites.local": "Local Bookmarks",
|
||||
"favorites.unnamed": "(unnamed)",
|
||||
"favorites.bookmarkName": "Bookmark name:",
|
||||
"favorites.newFavoriteName": "New bookmark",
|
||||
"favorites.showServerQueryClients": "Show ServerQuery clients",
|
||||
"favorites.connectOnStartup": "Connect on startup",
|
||||
"favorites.new": "New bookmark",
|
||||
"favorites.newFolder": "New folder",
|
||||
"favorites.remove": "Remove",
|
||||
"favorites.ok": "OK",
|
||||
"favorites.cancel": "Cancel",
|
||||
"favorites.apply": "Apply",
|
||||
"away.dialog.title": "Set away message",
|
||||
"away.dialog.message": "Message:",
|
||||
"away.dialog.template": "Template:",
|
||||
"away.dialog.none": "<None>",
|
||||
"away.dialog.ok": "OK",
|
||||
"away.dialog.save": "Save",
|
||||
"away.dialog.cancel": "Cancel",
|
||||
"options.title": "Options",
|
||||
"options.ok": "OK",
|
||||
"options.cancel": "Cancel",
|
||||
"options.notImplemented": "This setting isn't implemented yet.",
|
||||
"options.section.anwendung": "Application",
|
||||
"options.section.wiedergabe": "Playback",
|
||||
"options.section.aufnahme": "Capture",
|
||||
"options.section.design": "Appearance",
|
||||
"design.subtitle": "Choose the application's look.",
|
||||
"design.theme.standard": "Standard",
|
||||
"design.theme.standard.desc": "The original WebSpeak3 design.",
|
||||
"design.theme.nova": "Nova",
|
||||
"design.theme.nova.desc": "A more modern, dark design with rounded elements.",
|
||||
"design.theme.greenteaspeak": "GreenTeaSpeak",
|
||||
"design.theme.greenteaspeak.desc": "Classic GreenTeaSpeak client layout with dark panels and a gold menu bar.",
|
||||
"design.theme.pulse": "Pulse",
|
||||
"design.theme.pulse.desc": "Card-based layout with a breadcrumb bar and a color accent.",
|
||||
"design.status.connected": "Connected",
|
||||
"design.custom.new": "+ New design",
|
||||
"design.custom.import": "Import design",
|
||||
"design.custom.edit": "Edit",
|
||||
"design.custom.duplicate": "Duplicate",
|
||||
"design.custom.export": "Export",
|
||||
"design.custom.delete": "Delete",
|
||||
"design.custom.deleteConfirm": "Really delete this design?",
|
||||
"design.custom.newTitle": "Create a new design",
|
||||
"design.custom.editTitle": "Edit design",
|
||||
"design.custom.name": "Name",
|
||||
"design.custom.base": "Base layout",
|
||||
"design.custom.css": "CSS",
|
||||
"design.custom.hint": "This CSS loads while the design is active. Use .ts-app { ... } and the existing CSS variables (--accent, --bg, --text, --border, ...) to adjust colors, radii and spacing - with .ts-app .some-class { display: none } or order you can even change the layout.",
|
||||
"design.custom.save": "Save",
|
||||
"design.custom.copyOf": "Copy of {name}",
|
||||
"design.custom.importError": "This file couldn't be read as a WebSpeak3 design.",
|
||||
"design.store.open": "Store",
|
||||
"design.store.title": "Design store",
|
||||
"design.store.back": "Back",
|
||||
"design.store.loading": "Loading…",
|
||||
"design.store.unavailable": "The design store isn't available on this server.",
|
||||
"design.store.empty": "No designs in the store yet.",
|
||||
"design.store.install": "Install",
|
||||
"design.store.installed": "Installed",
|
||||
"design.store.by": "by {author}",
|
||||
"design.store.screenshotAlt": "Screenshot of {name}",
|
||||
"design.store.rating.rate": "Rate {stars} stars",
|
||||
"design.store.rating.summary": "{average} ({count})",
|
||||
"design.store.rating.none": "No ratings yet",
|
||||
"design.store.publishTitle": "Publish a design",
|
||||
"design.store.publish.select": "Choose one of your own designs",
|
||||
"design.store.publish.none": "You don't have a custom design to publish yet.",
|
||||
"design.store.publish.author": "Your name (optional)",
|
||||
"design.store.publish.authorPlaceholder": "Anonymous",
|
||||
"design.store.publish.description": "Description (optional)",
|
||||
"design.store.publish.descriptionPlaceholder": "What makes this design special?",
|
||||
"design.store.publish.screenshot": "Screenshot (optional)",
|
||||
"design.store.publish.screenshotTooLarge": "That image is too large. Please use a smaller screenshot.",
|
||||
"design.store.publish.adminToken": "Admin token (only needed for reserved names)",
|
||||
"design.store.publish.adminTokenPlaceholder": "Leave empty unless you know what this is",
|
||||
"design.store.publish.submit": "Publish to the store",
|
||||
"design.store.publish.success": "Design published!",
|
||||
"design.store.publish.pending": "Thanks! Your design was submitted and will appear in the store once it has been reviewed.",
|
||||
"design.store.publish.error": "Publishing failed.",
|
||||
"options.section.erweiterungen": "Addons",
|
||||
"options.section.hotkeys": "Hotkeys",
|
||||
"options.section.whispern": "Whisper",
|
||||
"options.section.downloads": "Downloads",
|
||||
"options.section.chat": "Chat",
|
||||
"options.section.sicherheit": "Security",
|
||||
"options.section.nachrichten": "Messages",
|
||||
"options.section.meldungen": "Notifications",
|
||||
"options.section.sounds": "Sounds",
|
||||
"app.title": "Application",
|
||||
"app.subtitle": "General application settings",
|
||||
"app.language": "Language",
|
||||
"app.language.auto": "System default",
|
||||
"app.language.de": "Deutsch",
|
||||
"app.language.en": "English",
|
||||
"app.language.zh-CN": "简体中文",
|
||||
"app.language.fa": "فارسی (بتا)",
|
||||
"app.language.helpTranslate": "Missing your language or spotted a wrong translation? Help out on Weblate →",
|
||||
"playback.title": "Playback",
|
||||
"playback.subtitle": "Change your playback settings",
|
||||
"playback.profile": "Profile",
|
||||
"playback.default": "Default",
|
||||
"playback.device": "Playback device:",
|
||||
"playback.systemDefault": "System default",
|
||||
"playback.quiet": "Quiet",
|
||||
"playback.loud": "Loud",
|
||||
"playback.voiceVolume": "Voice volume",
|
||||
"playback.playTestTone": "▶ Play test sound",
|
||||
"playback.options": "Options",
|
||||
"playback.autoVolume": "Automatic volume adjustment",
|
||||
"playback.ownMicClicks": "Play mic clicks for own client",
|
||||
"playback.otherMicClicks": "Play mic clicks for other clients",
|
||||
"recording.title": "Capture",
|
||||
"recording.subtitle": "Change your capture settings",
|
||||
"recording.device": "Capture device:",
|
||||
"recording.activation": "Activation",
|
||||
"recording.pushToTalk": "Push-To-Talk",
|
||||
"recording.continuous": "Continuous transmission",
|
||||
"recording.voiceActivation": "Voice activation detection",
|
||||
"recording.testStart": "Start test",
|
||||
"recording.testStop": "Stop test",
|
||||
"recording.hangoverDelay": "Delay before deactivation:",
|
||||
"recording.secondsUnit": "sec",
|
||||
"recording.dsp": "Digital Signal Processing",
|
||||
"recording.typingAttenuation": "Typing attenuation",
|
||||
"recording.echoCancellation": "Echo cancellation",
|
||||
"recording.noiseSuppression": "Remove background noise",
|
||||
"recording.autoGainControl": "Automatic gain control",
|
||||
"recording.aec3": "Advanced echo cancellation (Beta, more CPU load)",
|
||||
"info.address": "Address:",
|
||||
"info.version": "Version:",
|
||||
"info.license": "License:",
|
||||
"info.currentClients": "Current clients:",
|
||||
"info.currentChannels": "Current channels:",
|
||||
"info.topic": "Topic:",
|
||||
"info.audioCodec": "Audio codec:",
|
||||
"info.spacer": "Spacer:",
|
||||
"info.rawName": "Raw name:",
|
||||
"info.passwordProtected": "Password protected:",
|
||||
"info.clients": "Clients:",
|
||||
"info.country": "Country:",
|
||||
"info.muted": "Microphone muted:",
|
||||
"info.outputMuted": "Speakers muted:",
|
||||
"info.serverGroups": "Server groups:",
|
||||
"info.yes": "Yes",
|
||||
"info.no": "No",
|
||||
"tree.notConnected": "Not connected",
|
||||
"tree.clickToSelect": "Click to select, double-click to join",
|
||||
"tree.clickToJoin": "Double-click to join",
|
||||
"tree.joinNotConnected": "Not connected — cannot switch channel",
|
||||
"tree.passwordProtected": "Password protected",
|
||||
"tree.privateChatWith": "Private chat with",
|
||||
"tree.poke": "Poke",
|
||||
"tree.channelCommander": "Channel commander",
|
||||
"tree.away": "Away",
|
||||
"tree.micMuted": "Microphone muted",
|
||||
"tree.talking": "Talking",
|
||||
"tree.noTalkPower": "No talk power in this channel",
|
||||
"tree.soundMuted": "Sound muted (deafened)",
|
||||
"tree.streaming": "Broadcasting a stream",
|
||||
"publish.alpha": "Alpha",
|
||||
"publish.alphaTitle": "Alpha - unstable, may change or break at any time",
|
||||
"publish.demoUnavailable": "Streaming is not available in the demo - it needs a real TeamSpeak 6 server.",
|
||||
"publish.alphaNote": "Streaming is alpha. It speaks TeamSpeak 6's undocumented Stream/Call protocol, so connecting, picture quality and viewer handling can fail or change without notice. Not meant for production use.",
|
||||
"publish.start": "Share your screen",
|
||||
"publish.stop": "Stop sharing",
|
||||
"publish.title": "Your broadcast",
|
||||
"publish.screen": "Screen",
|
||||
"publish.starting": "Starting…",
|
||||
"publish.viewers": "{count} watching",
|
||||
"publish.request.allow": "Allow",
|
||||
"publish.request.deny": "Deny",
|
||||
"publish.request.block": "Block",
|
||||
"publish.request.blockHint": "Deny and stop asking",
|
||||
"publish.dialog.title": "Stream settings",
|
||||
"publish.dialog.basic": "Basic settings",
|
||||
"publish.dialog.advanced": "Advanced settings",
|
||||
"publish.dialog.golive": "Go live",
|
||||
"publish.dialog.cancel": "Back",
|
||||
"publish.preset": "Preset",
|
||||
"publish.preset.presentation": "Presentation",
|
||||
"publish.audio": "Capture audio",
|
||||
"publish.privacy": "Privacy",
|
||||
"publish.privacy.public": "Public",
|
||||
"publish.privacy.contacts": "Contacts",
|
||||
"publish.privacy.private": "Private",
|
||||
"publish.resolution": "Resolution",
|
||||
"publish.res.source": "Source",
|
||||
"publish.fps": "FPS",
|
||||
"publish.bitrate": "Bitrate",
|
||||
"publish.audioBitrate": "Audio bitrate [Kbps]",
|
||||
"publish.viewerLimit": "Viewer limit",
|
||||
"publish.mode": "Connection mode",
|
||||
"publish.mode.p2p": "P2P",
|
||||
"publish.mode.server": "Server",
|
||||
"publish.mode.serverUnavailable": "Server mode goes through TS6's SFU and is not implemented yet.",
|
||||
"stream.untitled": "Stream",
|
||||
"stream.stop": "Close stream",
|
||||
"stream.live": "Live",
|
||||
"stream.state.new": "Waiting for offer…",
|
||||
"stream.state.connecting": "Connecting…",
|
||||
"stream.state.connected": "Live",
|
||||
"stream.state.disconnected": "Connection interrupted",
|
||||
"stream.state.failed": "Connection failed",
|
||||
"stream.state.closed": "Ended",
|
||||
"chat.server": "Server",
|
||||
"chat.channel": "Channel",
|
||||
"chat.notConnected": "Not connected",
|
||||
"chat.messageChannel": "Message channel...",
|
||||
"chat.messageServer": "Message server...",
|
||||
"chat.messagePartner": "Message {name}...",
|
||||
"chat.send": "Send",
|
||||
"chat.you": "You",
|
||||
"serverLog.clientJoin": "{client} entered channel \"{channel}\"",
|
||||
"serverLog.clientLeave": "{client} disconnected (Left)",
|
||||
"serverLog.clientChannelSwitch": "{client} moved from channel \"{fromChannel}\" to \"{toChannel}\"",
|
||||
"serverLog.clientChannelGroupAssigned": "Channel group \"{group}\" was assigned to {client}",
|
||||
"serverLog.channelCreated": "Channel \"{channel}\" was created",
|
||||
"serverLog.channelDeleted": "Channel \"{channel}\" was deleted",
|
||||
"serverLog.channelEdited": "Channel \"{channel}\" was edited",
|
||||
"serverLog.serverEdited": "Server settings were changed",
|
||||
"serverLog.permissionError": "Missing permission: {action}",
|
||||
"poke.title": "Poke",
|
||||
"poke.optionalMessage": "Optional message...",
|
||||
"poke.send": "Poke",
|
||||
"poke.cancel": "Cancel",
|
||||
"poke.pokedYou": "poked you",
|
||||
"poke.dismiss": "Dismiss",
|
||||
"kick.title": "Kick:",
|
||||
"kick.reasonPlaceholder": "Reason (optional)...",
|
||||
"kick.confirm": "Kick",
|
||||
"kick.cancel": "Cancel",
|
||||
"ban.title": "Ban:",
|
||||
"ban.reasonPlaceholder": "Reason (optional)...",
|
||||
"ban.duration": "Duration:",
|
||||
"ban.durationPermanent": "Permanent",
|
||||
"ban.duration1h": "1 hour",
|
||||
"ban.duration1d": "1 day",
|
||||
"ban.duration1w": "1 week",
|
||||
"ban.confirm": "Ban",
|
||||
"ban.cancel": "Cancel",
|
||||
"serverEdit.title": "Edit Virtual Server",
|
||||
"serverEdit.tab.host": "Host",
|
||||
"serverEdit.tab.misc": "Misc",
|
||||
"serverEdit.tab.transmission": "Transmission",
|
||||
"serverEdit.tab.antiflood": "Anti-Flood",
|
||||
"serverEdit.tab.security": "Security",
|
||||
"serverEdit.tab.log": "Log",
|
||||
"serverEdit.name": "Server name:",
|
||||
"serverEdit.welcomeMessage": "Welcome message:",
|
||||
"serverEdit.clearPassword": "Remove server password",
|
||||
"serverEdit.newPassword": "New server password:",
|
||||
"serverEdit.hostmessage": "Host message:",
|
||||
"serverEdit.hostmessageMode": "Display mode:",
|
||||
"serverEdit.hostmessageMode.none": "Don't display",
|
||||
"serverEdit.hostmessageMode.log": "Display in log",
|
||||
"serverEdit.hostmessageMode.modal": "Display as dialog",
|
||||
"serverEdit.hostmessageMode.modalquit": "Display as dialog and disconnect",
|
||||
"serverEdit.hostbannerUrl": "Host banner URL:",
|
||||
"serverEdit.hostbannerGfxUrl": "Host banner image URL:",
|
||||
"serverEdit.hostbannerGfxInterval": "Banner refresh (seconds):",
|
||||
"serverEdit.hostbannerMode": "Banner scaling:",
|
||||
"serverEdit.hostbannerMode.noadjust": "Don't adjust",
|
||||
"serverEdit.hostbannerMode.adjustignoreaspect": "Adjust (ignore aspect ratio)",
|
||||
"serverEdit.hostbannerMode.adjustkeepaspect": "Adjust (keep aspect ratio)",
|
||||
"serverEdit.hostbuttonTooltip": "Host button tooltip:",
|
||||
"serverEdit.hostbuttonUrl": "Host button URL:",
|
||||
"serverEdit.hostbuttonGfxUrl": "Host button image URL:",
|
||||
"serverEdit.maxClients": "Max clients:",
|
||||
"serverEdit.nickname": "Server nickname:",
|
||||
"serverEdit.phoneticName": "Phonetic name:",
|
||||
"serverEdit.codecEncryptionMode": "Voice encryption:",
|
||||
"serverEdit.codecEncryptionMode.perchannel": "Configurable per channel",
|
||||
"serverEdit.codecEncryptionMode.forcedoff": "Globally disabled",
|
||||
"serverEdit.codecEncryptionMode.forcedon": "Globally enabled",
|
||||
"serverEdit.unchanged": "Leave unchanged",
|
||||
"serverEdit.save": "Save",
|
||||
"serverEdit.cancel": "Cancel",
|
||||
"serverProtocolLog.title": "Server Log",
|
||||
"serverProtocolLog.empty": "No log entries.",
|
||||
"banList.title": "Ban List",
|
||||
"banList.empty": "No bans found.",
|
||||
"banList.name": "Name",
|
||||
"banList.ip": "IP",
|
||||
"banList.created": "Created",
|
||||
"banList.duration": "Duration",
|
||||
"banList.invoker": "By",
|
||||
"banList.reason": "Reason",
|
||||
"banList.permanent": "Permanent",
|
||||
"banList.delete": "Delete",
|
||||
"banList.deleteAll": "Delete all",
|
||||
"complainList.title": "Complaint List",
|
||||
"complainList.empty": "No complaints found.",
|
||||
"complainList.target": "Target",
|
||||
"complainList.from": "From",
|
||||
"complainList.message": "Message",
|
||||
"complainList.timestamp": "Timestamp",
|
||||
"offlineMessages.title": "Offline Messages",
|
||||
"offlineMessages.empty": "No messages found.",
|
||||
"offlineMessages.subject": "Subject",
|
||||
"offlineMessages.from": "From",
|
||||
"offlineMessages.timestamp": "Timestamp",
|
||||
"offlineMessages.targetUid": "Target UID",
|
||||
"offlineMessages.message": "Message",
|
||||
"offlineMessages.send": "Send",
|
||||
"offlineMessages.new": "New message",
|
||||
"offlineMessages.markRead": "Mark as read",
|
||||
"offlineMessages.backToList": "Back to list",
|
||||
"dialog.cancel": "Cancel",
|
||||
"groupAssign.channelTitle": "Assign Channel Group",
|
||||
"groupAssign.serverTitle": "Assign Server Group",
|
||||
"groupAssign.empty": "No groups found.",
|
||||
"groupAssign.clickToRemove": "Click to remove",
|
||||
"serverQueryLogin.username": "Username",
|
||||
"serverQueryLogin.password": "Password",
|
||||
"serverQueryLogin.login": "Login",
|
||||
"permissionOverview.title": "My Permissions",
|
||||
"permissionOverview.empty": "No permissions found.",
|
||||
"permissionOverview.name": "Permission",
|
||||
"permissionOverview.value": "Value",
|
||||
"permissionOverview.negated": "Negated",
|
||||
"permissionOverview.skip": "Skip",
|
||||
"permsEditor.title": "Permissions",
|
||||
"permsEditor.tab.server": "Server Groups",
|
||||
"permsEditor.tab.client": "Client Permissions",
|
||||
"permsEditor.tab.channel": "Channel Permissions",
|
||||
"permsEditor.tab.channelgroup": "Channel Groups",
|
||||
"permsEditor.tab.channelclient": "Channel Client Permissions",
|
||||
"permsEditor.clientDbId": "Unique client DB ID:",
|
||||
"permsEditor.load": "Load",
|
||||
"permsEditor.pickOnlineClient": "Or pick an online client...",
|
||||
"permsEditor.pickTarget": "Pick a group/channel on the left, or enter a client ID.",
|
||||
"permsEditor.addPermission": "Add",
|
||||
"permsEditor.searchPermission": "Search permission...",
|
||||
"dialog.ok": "OK",
|
||||
"channelContext.join": "Switch to channel",
|
||||
"channelContext.files": "Files...",
|
||||
"fileBrowser.title": "File Transfers",
|
||||
"fileBrowser.up": "Up",
|
||||
"fileBrowser.tooLarge": "File too large – uploads are limited to {mb} MiB.",
|
||||
"fileBrowser.refresh": "Refresh",
|
||||
"fileBrowser.newFolder": "New Folder",
|
||||
"fileBrowser.upload": "Upload",
|
||||
"fileBrowser.folderName": "Folder name",
|
||||
"fileBrowser.empty": "This folder is empty.",
|
||||
"fileBrowser.name": "Name",
|
||||
"fileBrowser.size": "Size",
|
||||
"fileBrowser.modified": "Modified",
|
||||
"fileBrowser.download": "Download",
|
||||
"fileBrowser.rename": "Rename",
|
||||
"fileBrowser.delete": "Delete",
|
||||
"fileBrowser.deleteConfirm": "Really delete?",
|
||||
"fileBrowser.uploading": "Uploading...",
|
||||
"fileBrowser.downloading": "Downloading...",
|
||||
"serverContext.icons": "Server Icons...",
|
||||
"serverIcons.title": "Manage Server Icons",
|
||||
"serverIcons.upload": "Upload Icon",
|
||||
"serverIcons.iconId": "Icon ID",
|
||||
"serverIcons.empty": "No icons found.",
|
||||
"clientContext.privateChat": "Private chat",
|
||||
"clientContext.poke": "Poke",
|
||||
"clientContext.watchStream": "Watch stream",
|
||||
"clientContext.moveTo": "Move to…",
|
||||
"clientContext.copyName": "Copy name",
|
||||
"clientContext.connectionInfo": "Show connection info",
|
||||
"clientContext.addWhisperTarget": "Add as whisper target",
|
||||
"clientContext.removeWhisperTarget": "Remove as whisper target",
|
||||
"clientContext.assignChannelGroup": "Assign channel group",
|
||||
"clientContext.assignServerGroup": "Assign server group",
|
||||
"clientContext.kickChannel": "Kick from channel",
|
||||
"clientContext.kick": "Kick from server",
|
||||
"clientContext.ban": "Ban",
|
||||
"clientContext.notSupported": "Not yet supported in the web client",
|
||||
"moveClient.title": "Move",
|
||||
"moveClient.empty": "No channels available.",
|
||||
"moveClient.current": "Current channel",
|
||||
"moveClient.spacer": "Spacer",
|
||||
"serverContext.connectionInfo": "Server Connection Info",
|
||||
"serverContext.copyAddress": "Copy server address",
|
||||
"serverContext.addFavorite": "Add to favorites",
|
||||
"serverContext.disconnect": "Disconnect",
|
||||
"connectError.dismiss": "Dismiss",
|
||||
"dialog.close": "Close",
|
||||
"sounds.title": "Sounds",
|
||||
"sounds.subtitle": "Configure sound notifications for events",
|
||||
"sounds.enable": "Enable sounds",
|
||||
"sounds.volume": "Volume",
|
||||
"sounds.eventEnable": "Enable this sound",
|
||||
"sounds.event.connect": "Connected",
|
||||
"sounds.event.disconnect": "Disconnected",
|
||||
"sounds.event.clientJoin": "Client joins",
|
||||
"sounds.event.clientLeave": "Client leaves",
|
||||
"sounds.event.message": "Message received",
|
||||
"sounds.event.poke": "Poke received",
|
||||
"sounds.default": "Default",
|
||||
"sounds.custom": "Custom file: {name}",
|
||||
"sounds.test": "▶ Test",
|
||||
"sounds.upload": "Upload",
|
||||
"sounds.reset": "Reset",
|
||||
"sounds.importSoundpack": "Import soundpack (.ts3soundpack)",
|
||||
"sounds.importResult": "{matched} sound(s) imported, {unmatched} file(s) not matched",
|
||||
"nachrichten.title": "Messages",
|
||||
"nachrichten.subtitle": "Customize messages",
|
||||
"nachrichten.disconnectMessage": "Disconnect:",
|
||||
"nachrichten.disconnectMessagePlaceholder": "leaving",
|
||||
"nachrichten.presetsTitle": "Preset messages",
|
||||
"nachrichten.type": "Type",
|
||||
"nachrichten.type.away": "Away",
|
||||
"nachrichten.templateName": "Template name",
|
||||
"nachrichten.message": "Message",
|
||||
"nachrichten.add": "Add",
|
||||
"nachrichten.delete": "Delete",
|
||||
"tree.expand": "Expand",
|
||||
"tree.collapse": "Collapse",
|
||||
"tabs.disconnect": "Disconnect",
|
||||
"tabs.closeTab": "Close tab: {label}",
|
||||
"identity.importInvalid": "\"{file}\" is not a valid identity file.",
|
||||
"log.fileTransferFailed": "File transfer failed:",
|
||||
"log.fileTransferInvalidAddress": "File transfer failed (invalid address)",
|
||||
"sounds.importFailed": "Could not read this soundpack - is it a valid .ts3soundpack/ZIP file?",
|
||||
"tabs.connections": "Server connections",
|
||||
"shortcut.ctrl": "Ctrl"
|
||||
}
|
||||
@@ -0,0 +1,661 @@
|
||||
{
|
||||
"menu.connections": "اتصالها",
|
||||
"menu.connections.connect": "اتصال",
|
||||
"menu.connections.disconnectCurrent": "قطع اتصال از سرور فعلی",
|
||||
"menu.connections.disconnectAll": "قطع اتصال از همه سرورها",
|
||||
"menu.favorites": "نشانکها",
|
||||
"menu.favorites.add": "افزودن نشانک",
|
||||
"menu.favorites.manage": "مدیریت نشانکها",
|
||||
"menu.self": "خودم",
|
||||
"menu.rights": "مجوزها",
|
||||
"menu.rights.serverGroups": "ویرایش گروههای سرور...",
|
||||
"menu.rights.channelGroups": "ویرایش گروههای کانال...",
|
||||
"menu.rights.serverPermissions": "ویرایش مجوزهای سرور...",
|
||||
"menu.rights.channelPermissions": "ویرایش مجوزهای کانال...",
|
||||
"menu.rights.overview": "نمای کلی مجوزها...",
|
||||
"menu.rights.myRights": "نمایش مجوزهای من",
|
||||
"menu.extras": "ابزارها",
|
||||
"menu.help": "راهنما",
|
||||
"menu.help.about": "درباره WebSpeak3",
|
||||
"menu.help.github": "گیتهاب",
|
||||
"menu.help.changelog": "تاریخچه تغییرات",
|
||||
"menu.help.translate": "کمک به ترجمه (Weblate)",
|
||||
"menu.extras.identities": "هویتها",
|
||||
"menu.extras.contacts": "مخاطبین",
|
||||
"menu.extras.collectedUrls": "لینکهای جمعآوریشده",
|
||||
"menu.extras.inviteFriend": "دعوت از یک دوست",
|
||||
"menu.extras.whisperLists": "لیستهای نجوا",
|
||||
"menu.extras.whisperHistory": "تاریخچه نجوا",
|
||||
"menu.extras.clientLog": "گزارش کلاینت",
|
||||
"menu.extras.banList": "لیست مسدودشدهها",
|
||||
"menu.extras.complaintList": "لیست شکایات",
|
||||
"menu.extras.offlineMessages": "پیامهای آفلاین",
|
||||
"menu.extras.serverQueryLogin": "ورود ServerQuery",
|
||||
"menu.extras.serverLog": "گزارش سرور",
|
||||
"menu.extras.startRecording": "شروع ضبط",
|
||||
"menu.extras.startMultitrackRecording": "شروع ضبط چندکاناله",
|
||||
"menu.extras.stopRecording": "توقف ضبط",
|
||||
"menu.extras.options": "تنظیمات",
|
||||
"menu.extras.feedback": "ارسال بازخورد",
|
||||
"feedback.fab.nudge": "نظرت درباره WebSpeak3 چیه؟ بازخوردت رو منتظریم!",
|
||||
"donate.label": "حمایت مالی",
|
||||
"donate.title": "حمایت از WebSpeak3 در Ko-fi",
|
||||
"pwa.updateAvailable": "نسخه جدید موجود است",
|
||||
"pwa.reload": "بارگذاری مجدد",
|
||||
"feedback.dialog.title": "بازخورد",
|
||||
"feedback.dialog.intro": "یک اشکال گزارش بده یا ایدهای برای بهبود WebSpeak3 به اشتراک بگذار.",
|
||||
"feedback.dialog.category": "دسته",
|
||||
"feedback.dialog.category.bug": "اشکال",
|
||||
"feedback.dialog.category.idea": "ایده",
|
||||
"feedback.dialog.category.report": "گزارش تخلف (نقض قوانین/سوءاستفاده)",
|
||||
"feedback.dialog.category.other": "سایر",
|
||||
"feedback.dialog.reportHint": "گزارشها همیشه خصوصی میمانند و هرگز بهصورت Issue عمومی در گیتهاب منتشر نمیشوند. در صورت نیاز میتوانی نام سرور مربوطه را ذکر کنی.",
|
||||
"feedback.dialog.message": "پیام",
|
||||
"feedback.dialog.messagePlaceholder": "چه اتفاقی افتاد، یا چه پیشنهادی داری؟",
|
||||
"feedback.dialog.email": "ایمیل (اختیاری، برای پیگیری – خصوصی میماند و هرگز منتشر نمیشود)",
|
||||
"feedback.dialog.publishAsIssue": "بهصورت Issue عمومی در گیتهاب منتشر شود",
|
||||
"feedback.dialog.publishAsIssueHint": "اگر تیک نزنی، بازخوردت خصوصی میماند و فقط برای مدیر پروژه قابل مشاهده است.",
|
||||
"feedback.dialog.publishAsIssueHintBug": "گزارش اشکالها همیشه بهصورت Issue عمومی در گیتهاب منتشر میشوند.",
|
||||
"feedback.dialog.send": "ارسال",
|
||||
"restartNotice.title": "وقفه کوتاه",
|
||||
"restartNotice.body": "سرور بهزودی برای مدت کوتاهی مجدداً راهاندازی میشود. اتصال شما لحظهای قطع خواهد شد.",
|
||||
"restartNotice.ack": "متوجه شدم",
|
||||
"menu.extras.tos": "شرایط استفاده",
|
||||
"tos.title": "شرایط استفاده از client.webspeak3.de",
|
||||
"tos.rule1": "این کلاینت برای استفاده خصوصی و غیرتجاری از سرورهای TeamSpeak/TeaSpeak/GreenTeaSpeak از طریق مرورگر است.",
|
||||
"tos.rule2": "بهطور خاص ممنوع است: هرگونه فعالیت مجرمانه، آزار و سخنان نفرتپراکنانه، اسپم و سیل پیام، ایجاد اختلال در سرویس، و دور زدن مسدودیتها.",
|
||||
"tos.rule3": "تخلفات ممکن است بدون هشدار منجر به مسدود شدن دسترسی شوند؛ در موارد جدی، گزارش به مراجع ذیصلاح نیز ممکن است.",
|
||||
"tos.rule4Pre": "بهمنظور امنیت عملیاتی و شناسایی سوءاستفاده، اطلاعات اتصال (آدرس سرور، نام سرور، زمان اتصال) ثبت میشود و پس از ۹۰ روز بهصورت خودکار حذف میشود - برای جزئیات به ",
|
||||
"tos.rule4Post": " مراجعه کن.",
|
||||
"tos.privacyLinkText": "سیاست حریم خصوصی",
|
||||
"tos.rule5Pre": "برای گزارش سوءاستفاده یا شکایات: به ",
|
||||
"tos.rule5Post": " مراجعه کن.",
|
||||
"tos.legalLinkText": "اطلاعیه حقوقی (Impressum)",
|
||||
"tos.rule6": "با کلیک روی «پذیرفتن» این شرایط را میپذیری. تأیید تو فقط بهصورت محلی در مرورگرت ذخیره میشود؛ در صورت تغییر قوانین، دوباره از تو پرسیده خواهد شد.",
|
||||
"tos.accept": "پذیرفتن",
|
||||
"tos.close": "بستن",
|
||||
"feedback.dialog.cancel": "لغو",
|
||||
"feedback.dialog.sending": "در حال ارسال…",
|
||||
"feedback.dialog.success": "از بازخوردت متشکریم!",
|
||||
"feedback.dialog.successWithIssue": "متشکریم! Issue ایجاد شد:",
|
||||
"feedback.dialog.error": "ارسال ناموفق بود. لطفاً بعداً دوباره امتحان کن.",
|
||||
"toolbar.setAway": "تنظیم بهعنوان غایب",
|
||||
"toolbar.backOnline": "بازگشت به آنلاین",
|
||||
"toolbar.awayOptions": "گزینههای غیبت",
|
||||
"toolbar.whisper": "مقصدهای نجوا",
|
||||
"whisper.channels": "کانالها",
|
||||
"whisper.clients": "کاربران",
|
||||
"whisper.clearAll": "پاک کردن همه مقصدهای نجوا",
|
||||
"toolbar.micEnable": "فعالسازی میکروفون",
|
||||
"toolbar.micMute": "بیصدا کردن میکروفون",
|
||||
"toolbar.micUnmute": "فعال کردن صدای میکروفون",
|
||||
"toolbar.vadSensitivity": "حساسیت فعالسازی صوتی",
|
||||
"toolbar.muteSound": "بیصدا کردن صدا (کر کردن)",
|
||||
"toolbar.unmuteSound": "فعال کردن صدا",
|
||||
"toolbar.chooseOutputDevice": "انتخاب دستگاه خروجی",
|
||||
"toolbar.toggleTheme": "تغییر پوسته",
|
||||
"away.setGlobal": "تنظیم غیبت سراسری",
|
||||
"away.setGlobalStatus": "تنظیم وضعیت غیبت سراسری",
|
||||
"connect.title": "اتصال",
|
||||
"connect.novaSubtitle": "WebSpeak3 بهطور کامل در مرورگر اجرا میشود — بدون نیاز به دانلود",
|
||||
"connect.serverAddress": "نام مستعار یا آدرس سرور:",
|
||||
"connect.serverPassword": "رمز عبور سرور:",
|
||||
"connect.nickname": "نام مستعار:",
|
||||
"connect.phoneticNickname": "تلفظ نام مستعار:",
|
||||
"connect.identity": "هویت:",
|
||||
"connect.defaultChannel": "کانال پیشفرض:",
|
||||
"connect.recordingProfile": "پروفایل ضبط:",
|
||||
"connect.channelPassword": "رمز عبور کانال:",
|
||||
"connect.playbackProfile": "پروفایل پخش:",
|
||||
"connect.onetimeGrant": "کلید امتیاز یکبار مصرف:",
|
||||
"connect.serverType": "نوع سرور:",
|
||||
"connect.serverType.auto": "خودکار",
|
||||
"connect.serverType.teamspeak": "TeamSpeak",
|
||||
"connect.serverType.teaspeak": "TeaSpeak",
|
||||
"connect.hotkeyProfile": "پروفایل کلید میانبر:",
|
||||
"connect.soundPack": "بسته صوتی:",
|
||||
"connect.more": "بیشتر",
|
||||
"connect.less": "کمتر",
|
||||
"connect.connect": "اتصال",
|
||||
"connect.connecting": "در حال اتصال…",
|
||||
"connect.newTab": "در تب جدید",
|
||||
"connect.cancel": "لغو",
|
||||
"channelPasswordDialog.title": "رمز عبور کانال لازم است",
|
||||
"channelPasswordDialog.prompt": "این کانال با رمز عبور محافظت میشود. لطفاً رمز عبور را وارد کن:",
|
||||
"channelPasswordDialog.wrongPassword": "رمز عبور اشتباه است، دوباره امتحان کن:",
|
||||
"channelPasswordDialog.submit": "ورود",
|
||||
"channelPasswordDialog.cancel": "لغو",
|
||||
"collectedUrls.title": "لینکهای جمعآوریشده",
|
||||
"collectedUrls.search": "جستجو:",
|
||||
"collectedUrls.url": "لینک",
|
||||
"collectedUrls.count": "تعداد",
|
||||
"collectedUrls.lastSeen": "آخرین اشاره",
|
||||
"collectedUrls.mentionedBy": "ذکرشده توسط",
|
||||
"collectedUrls.clearList": "پاک کردن لیست",
|
||||
"inviteFriend.title": "دعوت از یک دوست",
|
||||
"inviteFriend.type": "نوع دعوت",
|
||||
"inviteFriend.includeChannel": "افزودن کانال فعلی",
|
||||
"inviteFriend.link": "لینک",
|
||||
"inviteFriend.addPermissionKey": "افزودن کلید مجوز",
|
||||
"inviteFriend.copyToClipboard": "کپی در کلیپبورد",
|
||||
"inviteFriend.copied": "کپی شد!",
|
||||
"clientLog.title": "گزارش کلاینت",
|
||||
"clientLog.level.critical": "بحرانی",
|
||||
"clientLog.level.error": "خطاها",
|
||||
"clientLog.level.warning": "هشدارها",
|
||||
"clientLog.level.info": "اطلاعات",
|
||||
"clientLog.level.debug": "اشکالزدایی",
|
||||
"clientLog.search": "جستجو:",
|
||||
"clientLog.filter": "فیلتر:",
|
||||
"clientLog.caseSensitive": "حساس به بزرگی/کوچکی حروف",
|
||||
"clientLog.mark": "علامتگذاری",
|
||||
"whisperHistory.title": "تاریخچه نجوا - {server}",
|
||||
"whisperHistory.empty": "هنوز تاریخچه نجوایی وجود ندارد.",
|
||||
"whisperHistory.started": "در حال نجوا با: {targets}",
|
||||
"whisperHistory.stopped": "نجوا متوقف شد",
|
||||
"whisperHistory.clear": "پاک کردن",
|
||||
"whisperHistory.options": "گزینهها",
|
||||
"whisperLists.title": "لیستهای نجوا",
|
||||
"whisperLists.namePlaceholder": "نام لیست",
|
||||
"whisperLists.saveCurrent": "ذخیره انتخاب فعلی",
|
||||
"whisperLists.itemDetail": "{channels} کانال، {clients} کاربر",
|
||||
"whisperLists.activate": "فعالسازی",
|
||||
"whisperLists.delete": "حذف",
|
||||
"whisperLists.empty": "هنوز لیست نجوایی ذخیره نشده است. مقصدهای نجوا را انتخاب کن و اینجا بهصورت لیست ذخیره کن.",
|
||||
"identities.title": "هویتها",
|
||||
"identities.activate": "فعالسازی",
|
||||
"identities.add": "هویت جدید",
|
||||
"identities.delete": "حذف",
|
||||
"identities.newName": "هویت جدید",
|
||||
"identities.generated": "ایجاد شد",
|
||||
"identities.pending": "در اتصال بعدی ایجاد خواهد شد",
|
||||
"identities.listLabel": "هویتهای محلی",
|
||||
"identities.name": "نام هویت:",
|
||||
"identities.phoneticNickname": "تلفظ نام مستعار:",
|
||||
"identities.uniqueId": "شناسه یکتا:",
|
||||
"identities.unknown": "نامشخص",
|
||||
"identities.setDefault": "تنظیم بهعنوان پیشفرض",
|
||||
"identities.isDefault": "در حال حاضر بهعنوان پیشفرض استفاده میشود",
|
||||
"identities.export": "خروجی گرفتن",
|
||||
"identities.import": "وارد کردن",
|
||||
"connectionInfo.clientTitle": "اطلاعات اتصال - {name}",
|
||||
"connectionInfo.serverTitle": "اطلاعات اتصال سرور",
|
||||
"connectionInfo.loading": "در حال بارگذاری…",
|
||||
"connectionInfo.unavailable": "پاسخی از سرور دریافت نشد (شاید مجوز کافی وجود ندارد؟).",
|
||||
"connectionInfo.ping": "پینگ:",
|
||||
"connectionInfo.connectedSince": "متصل از:",
|
||||
"connectionInfo.uptime": "مدت آنلاین بودن:",
|
||||
"connectionInfo.name": "نام:",
|
||||
"connectionInfo.avgPing": "میانگین پینگ:",
|
||||
"connectionInfo.avgPacketLoss": "میانگین افت بسته:",
|
||||
"connectionInfo.incoming": "ورودی",
|
||||
"connectionInfo.outgoing": "خروجی",
|
||||
"connectionInfo.packetsTransferred": "بستههای منتقلشده",
|
||||
"connectionInfo.bytesTransferred": "بایتهای منتقلشده",
|
||||
"connectionInfo.bandwidthLastSecond": "پهنای باند ثانیه گذشته",
|
||||
"connectionInfo.bandwidthLastMinute": "پهنای باند دقیقه گذشته",
|
||||
"connectionInfo.ftBandwidth": "پهنای باند انتقال فایل",
|
||||
"connectionInfo.ftBytes": "بایتهای انتقال فایل",
|
||||
"connectionInfo.ip": "آدرس IP:",
|
||||
"connectionInfo.packetLoss": "افت بسته:",
|
||||
"connectionInfo.packetsSent": "بستههای ارسالی:",
|
||||
"connectionInfo.packetsReceived": "بستههای دریافتی:",
|
||||
"connectionInfo.bytesSent": "داده ارسالی:",
|
||||
"connectionInfo.bytesReceived": "داده دریافتی:",
|
||||
"connectionInfo.bandwidthSent": "پهنای باند ارسالی:",
|
||||
"connectionInfo.bandwidthReceived": "پهنای باند دریافتی:",
|
||||
"menu.self.recordingProfile": "پروفایل ضبط",
|
||||
"menu.self.playbackProfile": "پروفایل پخش",
|
||||
"menu.self.hotkeyProfile": "پروفایل کلید میانبر",
|
||||
"menu.self.soundPack": "بسته صوتی",
|
||||
"menu.self.setAway": "تنظیم غیبت",
|
||||
"menu.self.enableMic": "فعالسازی میکروفون",
|
||||
"menu.self.disableMic": "غیرفعالسازی میکروفون",
|
||||
"menu.self.muteOutput": "بیصدا کردن بلندگو/هدفون",
|
||||
"menu.self.unmuteOutput": "فعال کردن بلندگو/هدفون",
|
||||
"menu.self.changeNickname": "تغییر نام مستعار",
|
||||
"menu.self.requestTalkPower": "درخواست حق صحبت",
|
||||
"menu.self.setAvatar": "تنظیم آواتار",
|
||||
"menu.self.setPhoneticNickname": "تنظیم تلفظ نام مستعار",
|
||||
"menu.self.connectionInfo": "اطلاعات اتصال",
|
||||
"contacts.title": "مخاطبین",
|
||||
"contacts.addOnlineClient": "یک کاربر آنلاین را انتخاب کن...",
|
||||
"contacts.add": "افزودن",
|
||||
"contacts.remove": "حذف",
|
||||
"contacts.empty": "هنوز مخاطبی وجود ندارد.",
|
||||
"contacts.customName": "نام سفارشی:",
|
||||
"contacts.category.acquaintance": "آشنا",
|
||||
"contacts.category.blocked": "مسدود",
|
||||
"contacts.category.friend": "دوست",
|
||||
"contacts.phoneticName": "تلفظ نام:",
|
||||
"contacts.show": "نمایش",
|
||||
"contacts.ignore": "نادیده گرفتن",
|
||||
"contacts.unignore": "لغو نادیده گرفتن",
|
||||
"contacts.whisper": "نجوا",
|
||||
"contacts.preferences": "ترجیحات",
|
||||
"favorites.title": "🔖 نشانکهای myTeamSpeak",
|
||||
"favorites.synced": "نشانکهای همگامسازیشده",
|
||||
"favorites.notLoggedIn": "وارد نشدهای",
|
||||
"favorites.local": "نشانکهای محلی",
|
||||
"favorites.unnamed": "(بدون نام)",
|
||||
"favorites.bookmarkName": "نام نشانک:",
|
||||
"favorites.newFavoriteName": "نشانک جدید",
|
||||
"favorites.showServerQueryClients": "نمایش کاربران ServerQuery",
|
||||
"favorites.connectOnStartup": "اتصال هنگام راهاندازی",
|
||||
"favorites.new": "نشانک جدید",
|
||||
"favorites.newFolder": "پوشه جدید",
|
||||
"favorites.remove": "حذف",
|
||||
"favorites.ok": "تأیید",
|
||||
"favorites.cancel": "لغو",
|
||||
"favorites.apply": "اعمال",
|
||||
"away.dialog.title": "تنظیم پیام غیبت",
|
||||
"away.dialog.message": "پیام:",
|
||||
"away.dialog.template": "الگو:",
|
||||
"away.dialog.none": "<هیچکدام>",
|
||||
"away.dialog.ok": "تأیید",
|
||||
"away.dialog.save": "ذخیره",
|
||||
"away.dialog.cancel": "لغو",
|
||||
"options.title": "تنظیمات",
|
||||
"options.ok": "تأیید",
|
||||
"options.cancel": "لغو",
|
||||
"options.notImplemented": "این تنظیم هنوز پیادهسازی نشده است.",
|
||||
"options.section.anwendung": "برنامه",
|
||||
"options.section.wiedergabe": "پخش",
|
||||
"options.section.aufnahme": "ضبط",
|
||||
"options.section.design": "ظاهر",
|
||||
"design.subtitle": "ظاهر برنامه را انتخاب کن.",
|
||||
"design.theme.standard": "استاندارد",
|
||||
"design.theme.standard.desc": "طراحی اصلی WebSpeak3.",
|
||||
"design.theme.nova": "Nova",
|
||||
"design.theme.nova.desc": "طراحی مدرنتر و تیره با عناصر گرد.",
|
||||
"design.theme.greenteaspeak": "GreenTeaSpeak",
|
||||
"design.theme.greenteaspeak.desc": "چیدمان کلاسیک کلاینت GreenTeaSpeak با پنلهای تیره و نوار منوی طلایی.",
|
||||
"design.theme.pulse": "Pulse",
|
||||
"design.theme.pulse.desc": "چیدمان کارتی با نوار مسیر و رنگ تأکیدی.",
|
||||
"design.status.connected": "متصل",
|
||||
"design.custom.new": "+ طراحی جدید",
|
||||
"design.custom.import": "وارد کردن طراحی",
|
||||
"design.custom.edit": "ویرایش",
|
||||
"design.custom.duplicate": "تکثیر",
|
||||
"design.custom.export": "خروجی گرفتن",
|
||||
"design.custom.delete": "حذف",
|
||||
"design.custom.deleteConfirm": "واقعاً این طراحی حذف شود؟",
|
||||
"design.custom.newTitle": "ایجاد طراحی جدید",
|
||||
"design.custom.editTitle": "ویرایش طراحی",
|
||||
"design.custom.name": "نام",
|
||||
"design.custom.base": "چیدمان پایه",
|
||||
"design.custom.css": "CSS",
|
||||
"design.custom.hint": "این CSS هنگام فعال بودن طراحی بارگذاری میشود. از .ts-app { ... } و متغیرهای CSS موجود (--accent، --bg، --text، --border و...) برای تنظیم رنگها، شعاع گوشهها و فاصلهها استفاده کن - با .ts-app .some-class { display: none } یا تغییر ترتیب حتی میتوانی چیدمان را هم تغییر دهی.",
|
||||
"design.custom.save": "ذخیره",
|
||||
"design.custom.copyOf": "کپی از {name}",
|
||||
"design.custom.importError": "این فایل بهعنوان طراحی WebSpeak3 خوانده نشد.",
|
||||
"design.store.open": "فروشگاه",
|
||||
"design.store.title": "فروشگاه طراحیها",
|
||||
"design.store.back": "بازگشت",
|
||||
"design.store.loading": "در حال بارگذاری…",
|
||||
"design.store.unavailable": "فروشگاه طراحی روی این سرور در دسترس نیست.",
|
||||
"design.store.empty": "هنوز طراحی در فروشگاه نیست.",
|
||||
"design.store.install": "نصب",
|
||||
"design.store.installed": "نصب شد",
|
||||
"design.store.by": "از {author}",
|
||||
"design.store.screenshotAlt": "اسکرینشات {name}",
|
||||
"design.store.rating.rate": "امتیاز {stars} ستاره",
|
||||
"design.store.rating.summary": "{average} ({count})",
|
||||
"design.store.rating.none": "هنوز امتیازی ثبت نشده",
|
||||
"design.store.publishTitle": "انتشار یک طراحی",
|
||||
"design.store.publish.select": "یکی از طراحیهای خودت را انتخاب کن",
|
||||
"design.store.publish.none": "هنوز طراحی سفارشی برای انتشار نداری.",
|
||||
"design.store.publish.author": "نام تو (اختیاری)",
|
||||
"design.store.publish.authorPlaceholder": "ناشناس",
|
||||
"design.store.publish.description": "توضیحات (اختیاری)",
|
||||
"design.store.publish.descriptionPlaceholder": "چه چیزی این طراحی را خاص میکند؟",
|
||||
"design.store.publish.screenshot": "اسکرینشات (اختیاری)",
|
||||
"design.store.publish.screenshotTooLarge": "این تصویر خیلی بزرگ است. لطفاً تصویر کوچکتری استفاده کن.",
|
||||
"design.store.publish.adminToken": "توکن ادمین (فقط برای نامهای رزرو شده لازم است)",
|
||||
"design.store.publish.adminTokenPlaceholder": "اگر نمیدانی این چیست، خالی بگذار",
|
||||
"design.store.publish.submit": "انتشار در فروشگاه",
|
||||
"design.store.publish.success": "طراحی منتشر شد!",
|
||||
"design.store.publish.pending": "ممنون! طراحی تو ارسال شد و پس از بررسی در فروشگاه نمایش داده میشود.",
|
||||
"design.store.publish.error": "انتشار ناموفق بود.",
|
||||
"options.section.erweiterungen": "افزونهها",
|
||||
"options.section.hotkeys": "کلیدهای میانبر",
|
||||
"options.section.whispern": "نجوا",
|
||||
"options.section.downloads": "دانلودها",
|
||||
"options.section.chat": "گفتگو",
|
||||
"options.section.sicherheit": "امنیت",
|
||||
"options.section.nachrichten": "پیامها",
|
||||
"options.section.meldungen": "اعلانها",
|
||||
"options.section.sounds": "صداها",
|
||||
"app.title": "برنامه",
|
||||
"app.subtitle": "تنظیمات عمومی برنامه",
|
||||
"app.language": "زبان",
|
||||
"app.language.auto": "پیشفرض سیستم",
|
||||
"app.language.de": "Deutsch",
|
||||
"app.language.en": "English",
|
||||
"app.language.zh-CN": "简体中文",
|
||||
"app.language.fa": "فارسی (بتا)",
|
||||
"app.language.helpTranslate": "زبان شما موجود نیست یا ترجمهای اشتباه دیدید؟ در Weblate کمک کنید →",
|
||||
"playback.title": "پخش",
|
||||
"playback.subtitle": "تنظیمات پخش را تغییر بده",
|
||||
"playback.profile": "پروفایل",
|
||||
"playback.default": "پیشفرض",
|
||||
"playback.device": "دستگاه پخش:",
|
||||
"playback.systemDefault": "پیشفرض سیستم",
|
||||
"playback.quiet": "آرام",
|
||||
"playback.loud": "بلند",
|
||||
"playback.voiceVolume": "میزان صدای صحبت",
|
||||
"playback.playTestTone": "▶ پخش صدای آزمایشی",
|
||||
"playback.options": "گزینهها",
|
||||
"playback.autoVolume": "تنظیم خودکار میزان صدا",
|
||||
"playback.ownMicClicks": "پخش کلیک میکروفون برای کاربر خودم",
|
||||
"playback.otherMicClicks": "پخش کلیک میکروفون برای سایر کاربران",
|
||||
"recording.title": "ضبط",
|
||||
"recording.subtitle": "تنظیمات ضبط را تغییر بده",
|
||||
"recording.device": "دستگاه ضبط:",
|
||||
"recording.activation": "فعالسازی",
|
||||
"recording.pushToTalk": "فشار برای صحبت (Push-To-Talk)",
|
||||
"recording.continuous": "ارسال پیوسته",
|
||||
"recording.voiceActivation": "تشخیص فعالسازی صوتی",
|
||||
"recording.testStart": "شروع آزمایش",
|
||||
"recording.testStop": "توقف آزمایش",
|
||||
"recording.hangoverDelay": "تأخیر قبل از غیرفعالسازی:",
|
||||
"recording.secondsUnit": "ثانیه",
|
||||
"recording.dsp": "پردازش دیجیتال سیگنال",
|
||||
"recording.typingAttenuation": "کاهش صدای تایپ",
|
||||
"recording.echoCancellation": "حذف پژواک",
|
||||
"recording.noiseSuppression": "حذف نویز پسزمینه",
|
||||
"recording.autoGainControl": "کنترل خودکار میزان صدا",
|
||||
"info.address": "آدرس:",
|
||||
"info.version": "نسخه:",
|
||||
"info.license": "مجوز:",
|
||||
"info.currentClients": "کاربران فعلی:",
|
||||
"info.currentChannels": "کانالهای فعلی:",
|
||||
"info.topic": "موضوع:",
|
||||
"info.audioCodec": "کدک صوتی:",
|
||||
"info.spacer": "فاصلهگذار:",
|
||||
"info.rawName": "نام خام:",
|
||||
"info.passwordProtected": "محافظتشده با رمز عبور:",
|
||||
"info.clients": "کاربران:",
|
||||
"info.country": "کشور:",
|
||||
"info.muted": "میکروفون بیصدا:",
|
||||
"info.outputMuted": "بلندگو بیصدا:",
|
||||
"info.serverGroups": "گروههای سرور:",
|
||||
"info.yes": "بله",
|
||||
"info.no": "خیر",
|
||||
"tree.notConnected": "متصل نیست",
|
||||
"tree.clickToSelect": "برای انتخاب کلیک کن، برای ورود دوبار کلیک کن",
|
||||
"tree.clickToJoin": "برای ورود دوبار کلیک کن",
|
||||
"tree.joinNotConnected": "متصل نیست — نمیتوان کانال را تغییر داد",
|
||||
"tree.passwordProtected": "محافظتشده با رمز عبور",
|
||||
"tree.privateChatWith": "گفتگوی خصوصی با",
|
||||
"tree.poke": "سقلمه",
|
||||
"tree.channelCommander": "فرمانده کانال",
|
||||
"tree.away": "غایب",
|
||||
"tree.micMuted": "میکروفون بیصدا",
|
||||
"tree.talking": "در حال صحبت",
|
||||
"tree.noTalkPower": "در این کانال حق صحبت ندارد",
|
||||
"tree.soundMuted": "صدا بیصدا (کر)",
|
||||
"tree.streaming": "در حال پخش زنده",
|
||||
"publish.alpha": "آلفا",
|
||||
"publish.alphaTitle": "آلفا - ناپایدار، ممکن است هر زمان تغییر کند یا از کار بیفتد",
|
||||
"publish.demoUnavailable": "پخش زنده در حالت دمو در دسترس نیست - به یک سرور واقعی TeamSpeak 6 نیاز دارد.",
|
||||
"publish.alphaNote": "پخش زنده در مرحله آلفا است. این ویژگی از پروتکل مستندنشده Stream/Call در TeamSpeak 6 استفاده میکند، بنابراین اتصال، کیفیت تصویر و مدیریت بینندگان ممکن است بدون اطلاع قبلی دچار خطا شوند یا تغییر کنند. برای استفاده تولیدی مناسب نیست.",
|
||||
"publish.start": "اشتراکگذاری صفحه",
|
||||
"publish.stop": "توقف اشتراکگذاری",
|
||||
"publish.title": "پخش زنده تو",
|
||||
"publish.screen": "صفحه نمایش",
|
||||
"publish.starting": "در حال شروع…",
|
||||
"publish.viewers": "{count} بیننده",
|
||||
"publish.request.allow": "اجازه دادن",
|
||||
"publish.request.deny": "رد کردن",
|
||||
"publish.request.block": "مسدود کردن",
|
||||
"publish.request.blockHint": "رد کردن و دیگر نپرسیدن",
|
||||
"publish.dialog.title": "تنظیمات پخش زنده",
|
||||
"publish.dialog.basic": "تنظیمات پایه",
|
||||
"publish.dialog.advanced": "تنظیمات پیشرفته",
|
||||
"publish.dialog.golive": "شروع پخش زنده",
|
||||
"publish.dialog.cancel": "بازگشت",
|
||||
"publish.preset": "پیشتنظیم",
|
||||
"publish.preset.presentation": "ارائه",
|
||||
"publish.audio": "ضبط صدا",
|
||||
"publish.privacy": "حریم خصوصی",
|
||||
"publish.privacy.public": "عمومی",
|
||||
"publish.privacy.contacts": "مخاطبین",
|
||||
"publish.privacy.private": "خصوصی",
|
||||
"publish.resolution": "وضوح تصویر",
|
||||
"publish.res.source": "منبع اصلی",
|
||||
"publish.fps": "فریم بر ثانیه",
|
||||
"publish.bitrate": "بیتریت",
|
||||
"publish.audioBitrate": "بیتریت صدا [کیلوبیت بر ثانیه]",
|
||||
"publish.viewerLimit": "حداکثر تعداد بیننده",
|
||||
"publish.mode": "حالت اتصال",
|
||||
"publish.mode.p2p": "نظیر به نظیر (P2P)",
|
||||
"publish.mode.server": "سرور",
|
||||
"publish.mode.serverUnavailable": "حالت سرور از طریق SFU در TS6 انجام میشود و هنوز پیادهسازی نشده است.",
|
||||
"stream.untitled": "پخش زنده",
|
||||
"stream.stop": "بستن پخش زنده",
|
||||
"stream.live": "زنده",
|
||||
"stream.state.new": "در انتظار پیشنهاد اتصال…",
|
||||
"stream.state.connecting": "در حال اتصال…",
|
||||
"stream.state.connected": "زنده",
|
||||
"stream.state.disconnected": "اتصال قطع شد",
|
||||
"stream.state.failed": "اتصال ناموفق بود",
|
||||
"stream.state.closed": "پایان یافت",
|
||||
"chat.server": "سرور",
|
||||
"chat.channel": "کانال",
|
||||
"chat.notConnected": "متصل نیست",
|
||||
"chat.messageChannel": "پیام به کانال...",
|
||||
"chat.messageServer": "پیام به سرور...",
|
||||
"chat.messagePartner": "پیام به {name}...",
|
||||
"chat.send": "ارسال",
|
||||
"chat.you": "شما",
|
||||
"serverLog.clientJoin": "{client} وارد کانال «{channel}» شد",
|
||||
"serverLog.clientLeave": "{client} قطع اتصال شد (خروج)",
|
||||
"serverLog.clientChannelSwitch": "{client} از کانال «{fromChannel}» به «{toChannel}» منتقل شد",
|
||||
"serverLog.clientChannelGroupAssigned": "گروه کانال «{group}» به {client} اختصاص یافت",
|
||||
"serverLog.channelCreated": "کانال «{channel}» ایجاد شد",
|
||||
"serverLog.channelDeleted": "کانال «{channel}» حذف شد",
|
||||
"serverLog.channelEdited": "کانال «{channel}» ویرایش شد",
|
||||
"serverLog.serverEdited": "تنظیمات سرور تغییر کرد",
|
||||
"serverLog.permissionError": "مجوز کافی نیست: {action}",
|
||||
"poke.title": "سقلمه",
|
||||
"poke.optionalMessage": "پیام اختیاری...",
|
||||
"poke.send": "سقلمه",
|
||||
"poke.cancel": "لغو",
|
||||
"poke.pokedYou": "به تو سقلمه زد",
|
||||
"poke.dismiss": "رد کردن",
|
||||
"kick.title": "اخراج:",
|
||||
"kick.reasonPlaceholder": "دلیل (اختیاری)...",
|
||||
"kick.confirm": "اخراج",
|
||||
"kick.cancel": "لغو",
|
||||
"ban.title": "مسدود کردن:",
|
||||
"ban.reasonPlaceholder": "دلیل (اختیاری)...",
|
||||
"ban.duration": "مدت زمان:",
|
||||
"ban.durationPermanent": "دائمی",
|
||||
"ban.duration1h": "۱ ساعت",
|
||||
"ban.duration1d": "۱ روز",
|
||||
"ban.duration1w": "۱ هفته",
|
||||
"ban.confirm": "مسدود کردن",
|
||||
"ban.cancel": "لغو",
|
||||
"serverEdit.title": "ویرایش سرور مجازی",
|
||||
"serverEdit.tab.host": "میزبان",
|
||||
"serverEdit.tab.misc": "متفرقه",
|
||||
"serverEdit.tab.transmission": "انتقال",
|
||||
"serverEdit.tab.antiflood": "ضد سیل پیام",
|
||||
"serverEdit.tab.security": "امنیت",
|
||||
"serverEdit.tab.log": "گزارش",
|
||||
"serverEdit.name": "نام سرور:",
|
||||
"serverEdit.welcomeMessage": "پیام خوشآمدگویی:",
|
||||
"serverEdit.clearPassword": "حذف رمز عبور سرور",
|
||||
"serverEdit.newPassword": "رمز عبور جدید سرور:",
|
||||
"serverEdit.hostmessage": "پیام میزبان:",
|
||||
"serverEdit.hostmessageMode": "حالت نمایش:",
|
||||
"serverEdit.hostmessageMode.none": "نمایش داده نشود",
|
||||
"serverEdit.hostmessageMode.log": "نمایش در گزارش",
|
||||
"serverEdit.hostmessageMode.modal": "نمایش بهصورت پنجره",
|
||||
"serverEdit.hostmessageMode.modalquit": "نمایش بهصورت پنجره و قطع اتصال",
|
||||
"serverEdit.hostbannerUrl": "آدرس بنر میزبان:",
|
||||
"serverEdit.hostbannerGfxUrl": "آدرس تصویر بنر میزبان:",
|
||||
"serverEdit.hostbannerGfxInterval": "بازه بهروزرسانی بنر (ثانیه):",
|
||||
"serverEdit.hostbannerMode": "مقیاس بنر:",
|
||||
"serverEdit.hostbannerMode.noadjust": "تنظیم نشود",
|
||||
"serverEdit.hostbannerMode.adjustignoreaspect": "تنظیم (نادیده گرفتن نسبت ابعاد)",
|
||||
"serverEdit.hostbannerMode.adjustkeepaspect": "تنظیم (حفظ نسبت ابعاد)",
|
||||
"serverEdit.hostbuttonTooltip": "راهنمای دکمه میزبان:",
|
||||
"serverEdit.hostbuttonUrl": "آدرس دکمه میزبان:",
|
||||
"serverEdit.hostbuttonGfxUrl": "آدرس تصویر دکمه میزبان:",
|
||||
"serverEdit.maxClients": "حداکثر کاربران:",
|
||||
"serverEdit.nickname": "نام مستعار سرور:",
|
||||
"serverEdit.phoneticName": "تلفظ نام:",
|
||||
"serverEdit.codecEncryptionMode": "رمزنگاری صدا:",
|
||||
"serverEdit.codecEncryptionMode.perchannel": "قابل تنظیم برای هر کانال",
|
||||
"serverEdit.codecEncryptionMode.forcedoff": "غیرفعال سراسری",
|
||||
"serverEdit.codecEncryptionMode.forcedon": "فعال سراسری",
|
||||
"serverEdit.unchanged": "بدون تغییر",
|
||||
"serverEdit.save": "ذخیره",
|
||||
"serverEdit.cancel": "لغو",
|
||||
"serverProtocolLog.title": "گزارش سرور",
|
||||
"serverProtocolLog.empty": "هیچ رکورد گزارشی وجود ندارد.",
|
||||
"banList.title": "لیست مسدودشدهها",
|
||||
"banList.empty": "هیچ مسدودیای یافت نشد.",
|
||||
"banList.name": "نام",
|
||||
"banList.ip": "IP",
|
||||
"banList.created": "ایجادشده",
|
||||
"banList.duration": "مدت زمان",
|
||||
"banList.invoker": "توسط",
|
||||
"banList.reason": "دلیل",
|
||||
"banList.permanent": "دائمی",
|
||||
"banList.delete": "حذف",
|
||||
"banList.deleteAll": "حذف همه",
|
||||
"complainList.title": "لیست شکایات",
|
||||
"complainList.empty": "هیچ شکایتی یافت نشد.",
|
||||
"complainList.target": "هدف",
|
||||
"complainList.from": "از طرف",
|
||||
"complainList.message": "پیام",
|
||||
"complainList.timestamp": "زمان",
|
||||
"offlineMessages.title": "پیامهای آفلاین",
|
||||
"offlineMessages.empty": "هیچ پیامی یافت نشد.",
|
||||
"offlineMessages.subject": "موضوع",
|
||||
"offlineMessages.from": "از طرف",
|
||||
"offlineMessages.timestamp": "زمان",
|
||||
"offlineMessages.targetUid": "شناسه یکتای مقصد",
|
||||
"offlineMessages.message": "پیام",
|
||||
"offlineMessages.send": "ارسال",
|
||||
"offlineMessages.new": "پیام جدید",
|
||||
"offlineMessages.markRead": "علامتگذاری بهعنوان خواندهشده",
|
||||
"offlineMessages.backToList": "بازگشت به لیست",
|
||||
"dialog.cancel": "لغو",
|
||||
"groupAssign.channelTitle": "اختصاص گروه کانال",
|
||||
"groupAssign.serverTitle": "اختصاص گروه سرور",
|
||||
"groupAssign.empty": "هیچ گروهی یافت نشد.",
|
||||
"groupAssign.clickToRemove": "برای حذف کلیک کن",
|
||||
"serverQueryLogin.username": "نام کاربری",
|
||||
"serverQueryLogin.password": "رمز عبور",
|
||||
"serverQueryLogin.login": "ورود",
|
||||
"permissionOverview.title": "مجوزهای من",
|
||||
"permissionOverview.empty": "هیچ مجوزی یافت نشد.",
|
||||
"permissionOverview.name": "مجوز",
|
||||
"permissionOverview.value": "مقدار",
|
||||
"permissionOverview.negated": "معکوسشده",
|
||||
"permissionOverview.skip": "رد شدن",
|
||||
"permsEditor.title": "مجوزها",
|
||||
"permsEditor.tab.server": "گروههای سرور",
|
||||
"permsEditor.tab.client": "مجوزهای کاربر",
|
||||
"permsEditor.tab.channel": "مجوزهای کانال",
|
||||
"permsEditor.tab.channelgroup": "گروههای کانال",
|
||||
"permsEditor.tab.channelclient": "مجوزهای کاربر در کانال",
|
||||
"permsEditor.clientDbId": "شناسه یکتای پایگاهداده کاربر:",
|
||||
"permsEditor.load": "بارگذاری",
|
||||
"permsEditor.pickOnlineClient": "یا یک کاربر آنلاین را انتخاب کن...",
|
||||
"permsEditor.pickTarget": "یک گروه/کانال را از سمت چپ انتخاب کن یا شناسه کاربر را وارد کن.",
|
||||
"permsEditor.addPermission": "افزودن",
|
||||
"permsEditor.searchPermission": "جستجوی مجوز...",
|
||||
"dialog.ok": "تأیید",
|
||||
"channelContext.join": "تغییر به این کانال",
|
||||
"channelContext.files": "فایلها...",
|
||||
"fileBrowser.title": "انتقال فایل",
|
||||
"fileBrowser.up": "بالا",
|
||||
"fileBrowser.tooLarge": "فایل خیلی بزرگ است – حداکثر {mb} مگابایت برای هر آپلود.",
|
||||
"fileBrowser.refresh": "بارگذاری مجدد",
|
||||
"fileBrowser.newFolder": "پوشه جدید",
|
||||
"fileBrowser.upload": "بارگذاری",
|
||||
"fileBrowser.folderName": "نام پوشه",
|
||||
"fileBrowser.empty": "این پوشه خالی است.",
|
||||
"fileBrowser.name": "نام",
|
||||
"fileBrowser.size": "حجم",
|
||||
"fileBrowser.modified": "آخرین تغییر",
|
||||
"fileBrowser.download": "دانلود",
|
||||
"fileBrowser.rename": "تغییر نام",
|
||||
"fileBrowser.delete": "حذف",
|
||||
"fileBrowser.deleteConfirm": "واقعاً حذف شود؟",
|
||||
"fileBrowser.uploading": "در حال بارگذاری...",
|
||||
"fileBrowser.downloading": "در حال دانلود...",
|
||||
"serverContext.icons": "آیکونهای سرور...",
|
||||
"serverIcons.title": "مدیریت آیکونهای سرور",
|
||||
"serverIcons.upload": "بارگذاری آیکون",
|
||||
"serverIcons.iconId": "شناسه آیکون",
|
||||
"serverIcons.empty": "هیچ آیکونی یافت نشد.",
|
||||
"clientContext.privateChat": "گفتگوی خصوصی",
|
||||
"clientContext.poke": "سقلمه",
|
||||
"clientContext.watchStream": "تماشای پخش زنده",
|
||||
"clientContext.moveTo": "انتقال به…",
|
||||
"clientContext.copyName": "کپی نام",
|
||||
"clientContext.connectionInfo": "نمایش اطلاعات اتصال",
|
||||
"clientContext.addWhisperTarget": "افزودن به مقصدهای نجوا",
|
||||
"clientContext.removeWhisperTarget": "حذف از مقصدهای نجوا",
|
||||
"clientContext.assignChannelGroup": "اختصاص گروه کانال",
|
||||
"clientContext.assignServerGroup": "اختصاص گروه سرور",
|
||||
"clientContext.kickChannel": "اخراج از کانال",
|
||||
"clientContext.kick": "اخراج از سرور",
|
||||
"clientContext.ban": "مسدود کردن",
|
||||
"clientContext.notSupported": "هنوز در کلاینت وب پشتیبانی نمیشود",
|
||||
"moveClient.title": "انتقال",
|
||||
"moveClient.empty": "هیچ کانالی موجود نیست.",
|
||||
"moveClient.current": "کانال فعلی",
|
||||
"moveClient.spacer": "فاصلهگذار",
|
||||
"serverContext.connectionInfo": "اطلاعات اتصال سرور",
|
||||
"serverContext.copyAddress": "کپی آدرس سرور",
|
||||
"serverContext.addFavorite": "افزودن به نشانکها",
|
||||
"serverContext.disconnect": "قطع اتصال",
|
||||
"connectError.dismiss": "رد کردن",
|
||||
"dialog.close": "بستن",
|
||||
"sounds.title": "صداها",
|
||||
"sounds.subtitle": "پیکربندی اعلانهای صوتی برای رویدادها",
|
||||
"sounds.enable": "فعالسازی صداها",
|
||||
"sounds.volume": "میزان صدا",
|
||||
"sounds.eventEnable": "فعالسازی این صدا",
|
||||
"sounds.event.connect": "متصل شد",
|
||||
"sounds.event.disconnect": "قطع اتصال شد",
|
||||
"sounds.event.clientJoin": "ورود کاربر",
|
||||
"sounds.event.clientLeave": "خروج کاربر",
|
||||
"sounds.event.message": "پیام دریافت شد",
|
||||
"sounds.event.poke": "سقلمه دریافت شد",
|
||||
"sounds.default": "پیشفرض",
|
||||
"sounds.custom": "فایل سفارشی: {name}",
|
||||
"sounds.test": "▶ آزمایش",
|
||||
"sounds.upload": "بارگذاری",
|
||||
"sounds.reset": "بازنشانی",
|
||||
"sounds.importSoundpack": "وارد کردن بسته صوتی (.ts3soundpack)",
|
||||
"sounds.importResult": "{matched} صدا وارد شد، {unmatched} فایل مطابقت نداشت",
|
||||
"nachrichten.title": "پیامها",
|
||||
"nachrichten.subtitle": "سفارشیسازی پیامها",
|
||||
"nachrichten.disconnectMessage": "قطع اتصال:",
|
||||
"nachrichten.disconnectMessagePlaceholder": "خروج",
|
||||
"nachrichten.presetsTitle": "پیامهای از پیش تنظیمشده",
|
||||
"nachrichten.type": "نوع",
|
||||
"nachrichten.type.away": "غیبت",
|
||||
"nachrichten.templateName": "نام الگو",
|
||||
"nachrichten.message": "پیام",
|
||||
"nachrichten.add": "افزودن",
|
||||
"nachrichten.delete": "حذف",
|
||||
"tree.expand": "باز کردن",
|
||||
"tree.collapse": "بستن",
|
||||
"tabs.disconnect": "قطع اتصال",
|
||||
"tabs.closeTab": "بستن زبانه: {label}",
|
||||
"identity.importInvalid": "«{file}» یک فایل هویت معتبر نیست.",
|
||||
"log.fileTransferFailed": "انتقال فایل ناموفق بود:",
|
||||
"log.fileTransferInvalidAddress": "انتقال فایل ناموفق بود (نشانی نامعتبر)",
|
||||
"sounds.importFailed": "این بسته صدا خوانده نشد - آیا یک فایل .ts3soundpack/ZIP معتبر است؟",
|
||||
"tabs.connections": "اتصالهای سرور",
|
||||
"shortcut.ctrl": "Ctrl"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export const zhCN: Record<string, string> = {
|
||||
{
|
||||
"menu.connections": "连接",
|
||||
"menu.connections.connect": "连接",
|
||||
"menu.connections.disconnectCurrent": "断开当前服务器",
|
||||
@@ -32,7 +32,6 @@ export const zhCN: Record<string, string> = {
|
||||
"menu.extras.startMultitrackRecording": "开始多轨录音",
|
||||
"menu.extras.stopRecording": "停止录音",
|
||||
"menu.extras.options": "选项",
|
||||
|
||||
"toolbar.setAway": "设为离开",
|
||||
"toolbar.backOnline": "恢复在线",
|
||||
"toolbar.awayOptions": "离开选项",
|
||||
@@ -48,10 +47,8 @@ export const zhCN: Record<string, string> = {
|
||||
"toolbar.unmuteSound": "开启声音(取消拒听)",
|
||||
"toolbar.chooseOutputDevice": "选择输出设备",
|
||||
"toolbar.toggleTheme": "切换主题",
|
||||
|
||||
"away.setGlobal": "全局设为离开",
|
||||
"away.setGlobalStatus": "设置全局离开状态",
|
||||
|
||||
"connect.title": "连接",
|
||||
"connect.serverAddress": "服务器昵称或地址:",
|
||||
"connect.serverPassword": "服务器密码:",
|
||||
@@ -68,7 +65,6 @@ export const zhCN: Record<string, string> = {
|
||||
"connect.serverType.teamspeak": "TeamSpeak",
|
||||
"connect.serverType.teaspeak": "TeaSpeak",
|
||||
"connect.hotkeyProfile": "快捷键配置:",
|
||||
"connect.sendMyTeamSpeakId": "发送 myTeamSpeak ID",
|
||||
"connect.soundPack": "声音包:",
|
||||
"connect.more": "更多",
|
||||
"connect.less": "收起",
|
||||
@@ -76,7 +72,6 @@ export const zhCN: Record<string, string> = {
|
||||
"connect.connecting": "正在连接…",
|
||||
"connect.newTab": "在新标签页中打开",
|
||||
"connect.cancel": "取消",
|
||||
|
||||
"collectedUrls.title": "收集的链接",
|
||||
"collectedUrls.search": "搜索:",
|
||||
"collectedUrls.url": "链接",
|
||||
@@ -84,7 +79,6 @@ export const zhCN: Record<string, string> = {
|
||||
"collectedUrls.lastSeen": "最后提及",
|
||||
"collectedUrls.mentionedBy": "提及者",
|
||||
"collectedUrls.clearList": "清空列表",
|
||||
|
||||
"inviteFriend.title": "邀请好友",
|
||||
"inviteFriend.type": "邀请类型",
|
||||
"inviteFriend.includeChannel": "包含当前频道",
|
||||
@@ -92,7 +86,6 @@ export const zhCN: Record<string, string> = {
|
||||
"inviteFriend.addPermissionKey": "添加权限密钥",
|
||||
"inviteFriend.copyToClipboard": "复制到剪贴板",
|
||||
"inviteFriend.copied": "已复制!",
|
||||
|
||||
"clientLog.title": "客户端日志",
|
||||
"clientLog.level.critical": "严重",
|
||||
"clientLog.level.error": "错误",
|
||||
@@ -103,14 +96,12 @@ export const zhCN: Record<string, string> = {
|
||||
"clientLog.filter": "筛选:",
|
||||
"clientLog.caseSensitive": "区分大小写",
|
||||
"clientLog.mark": "标记",
|
||||
|
||||
"whisperHistory.title": "悄悄话历史 - {server}",
|
||||
"whisperHistory.empty": "暂无悄悄话历史。",
|
||||
"whisperHistory.started": "正在向以下目标发送悄悄话:{targets}",
|
||||
"whisperHistory.stopped": "已停止悄悄话",
|
||||
"whisperHistory.clear": "清除",
|
||||
"whisperHistory.options": "选项",
|
||||
|
||||
"whisperLists.title": "悄悄话列表",
|
||||
"whisperLists.namePlaceholder": "列表名称",
|
||||
"whisperLists.saveCurrent": "保存当前选择",
|
||||
@@ -118,7 +109,6 @@ export const zhCN: Record<string, string> = {
|
||||
"whisperLists.activate": "启用",
|
||||
"whisperLists.delete": "删除",
|
||||
"whisperLists.empty": "尚未保存悄悄话列表。请选择悄悄话目标并在此保存为列表。",
|
||||
|
||||
"identities.title": "身份",
|
||||
"identities.activate": "启用",
|
||||
"identities.add": "新建身份",
|
||||
@@ -135,7 +125,6 @@ export const zhCN: Record<string, string> = {
|
||||
"identities.isDefault": "当前用作默认身份",
|
||||
"identities.export": "导出",
|
||||
"identities.import": "导入",
|
||||
|
||||
"connectionInfo.clientTitle": "连接信息 - {name}",
|
||||
"connectionInfo.serverTitle": "服务器连接信息",
|
||||
"connectionInfo.loading": "正在加载…",
|
||||
@@ -162,7 +151,6 @@ export const zhCN: Record<string, string> = {
|
||||
"connectionInfo.bytesReceived": "已接收数据:",
|
||||
"connectionInfo.bandwidthSent": "发送带宽:",
|
||||
"connectionInfo.bandwidthReceived": "接收带宽:",
|
||||
|
||||
"menu.self.recordingProfile": "录音配置",
|
||||
"menu.self.playbackProfile": "播放配置",
|
||||
"menu.self.hotkeyProfile": "快捷键配置",
|
||||
@@ -177,7 +165,6 @@ export const zhCN: Record<string, string> = {
|
||||
"menu.self.setAvatar": "设置头像",
|
||||
"menu.self.setPhoneticNickname": "设置昵称读音",
|
||||
"menu.self.connectionInfo": "连接信息",
|
||||
|
||||
"contacts.title": "联系人",
|
||||
"contacts.addOnlineClient": "选择在线用户...",
|
||||
"contacts.add": "添加",
|
||||
@@ -193,7 +180,6 @@ export const zhCN: Record<string, string> = {
|
||||
"contacts.unignore": "取消忽略",
|
||||
"contacts.whisper": "悄悄话",
|
||||
"contacts.preferences": "偏好设置",
|
||||
|
||||
"favorites.title": "🔖 myTeamSpeak 收藏夹",
|
||||
"favorites.synced": "已同步的收藏",
|
||||
"favorites.notLoggedIn": "未登录",
|
||||
@@ -203,14 +189,12 @@ export const zhCN: Record<string, string> = {
|
||||
"favorites.newFavoriteName": "新收藏",
|
||||
"favorites.showServerQueryClients": "显示 ServerQuery 用户",
|
||||
"favorites.connectOnStartup": "启动时连接",
|
||||
"favorites.enableMyTeamSpeak": "启用 myTeamSpeak 功能",
|
||||
"favorites.new": "新建收藏",
|
||||
"favorites.newFolder": "新建文件夹",
|
||||
"favorites.remove": "移除",
|
||||
"favorites.ok": "确定",
|
||||
"favorites.cancel": "取消",
|
||||
"favorites.apply": "应用",
|
||||
|
||||
"away.dialog.title": "设置离开消息",
|
||||
"away.dialog.message": "消息:",
|
||||
"away.dialog.template": "模板:",
|
||||
@@ -218,7 +202,6 @@ export const zhCN: Record<string, string> = {
|
||||
"away.dialog.ok": "确定",
|
||||
"away.dialog.save": "保存",
|
||||
"away.dialog.cancel": "取消",
|
||||
|
||||
"options.title": "选项",
|
||||
"options.ok": "确定",
|
||||
"options.cancel": "取消",
|
||||
@@ -234,6 +217,8 @@ export const zhCN: Record<string, string> = {
|
||||
"design.theme.nova.desc": "更现代的深色设计,带圆角元素。",
|
||||
"design.theme.greenteaspeak": "GreenTeaSpeak",
|
||||
"design.theme.greenteaspeak.desc": "经典 GreenTeaSpeak 客户端布局:深色面板与金色菜单栏。",
|
||||
"design.theme.pulse": "Pulse",
|
||||
"design.theme.pulse.desc": "卡片式布局,带面包屑栏和彩色强调。",
|
||||
"design.status.connected": "已连接",
|
||||
"options.section.erweiterungen": "扩展",
|
||||
"options.section.hotkeys": "快捷键",
|
||||
@@ -244,7 +229,6 @@ export const zhCN: Record<string, string> = {
|
||||
"options.section.nachrichten": "消息",
|
||||
"options.section.meldungen": "通知",
|
||||
"options.section.sounds": "声音",
|
||||
|
||||
"app.title": "应用",
|
||||
"app.subtitle": "常规应用设置",
|
||||
"app.language": "语言",
|
||||
@@ -252,7 +236,8 @@ export const zhCN: Record<string, string> = {
|
||||
"app.language.de": "Deutsch",
|
||||
"app.language.en": "English",
|
||||
"app.language.zh-CN": "简体中文",
|
||||
|
||||
"app.language.fa": "فارسی (بتا)",
|
||||
"app.language.helpTranslate": "没有你的语言,或发现翻译有误?欢迎到 Weblate 参与改进 →",
|
||||
"playback.title": "播放",
|
||||
"playback.subtitle": "更改播放设置",
|
||||
"playback.profile": "配置",
|
||||
@@ -267,7 +252,6 @@ export const zhCN: Record<string, string> = {
|
||||
"playback.autoVolume": "自动调节音量",
|
||||
"playback.ownMicClicks": "播放自己的麦克风按键音",
|
||||
"playback.otherMicClicks": "播放其他用户的麦克风按键音",
|
||||
|
||||
"recording.title": "录音",
|
||||
"recording.subtitle": "更改录音设置",
|
||||
"recording.device": "录音设备:",
|
||||
@@ -283,7 +267,6 @@ export const zhCN: Record<string, string> = {
|
||||
"recording.typingAttenuation": "键盘声衰减",
|
||||
"recording.echoCancellation": "回声消除",
|
||||
"recording.noiseSuppression": "消除背景噪声",
|
||||
|
||||
"info.address": "地址:",
|
||||
"info.version": "版本:",
|
||||
"info.license": "许可证:",
|
||||
@@ -301,7 +284,6 @@ export const zhCN: Record<string, string> = {
|
||||
"info.serverGroups": "服务器组:",
|
||||
"info.yes": "是",
|
||||
"info.no": "否",
|
||||
|
||||
"tree.notConnected": "未连接",
|
||||
"tree.clickToSelect": "单击选择,双击加入",
|
||||
"tree.clickToJoin": "双击加入",
|
||||
@@ -315,7 +297,6 @@ export const zhCN: Record<string, string> = {
|
||||
"tree.talking": "正在说话",
|
||||
"tree.noTalkPower": "在此频道中没有发言权限",
|
||||
"tree.soundMuted": "声音已关闭(拒听)",
|
||||
|
||||
"chat.server": "服务器",
|
||||
"chat.channel": "频道",
|
||||
"chat.notConnected": "未连接",
|
||||
@@ -324,7 +305,6 @@ export const zhCN: Record<string, string> = {
|
||||
"chat.messagePartner": "向 {name} 发送消息...",
|
||||
"chat.send": "发送",
|
||||
"chat.you": "你",
|
||||
|
||||
"serverLog.clientJoin": "{client} 进入了频道“{channel}”",
|
||||
"serverLog.clientLeave": "{client} 已断开连接(离开)",
|
||||
"serverLog.clientChannelSwitch": "{client} 从频道“{fromChannel}”移动到“{toChannel}”",
|
||||
@@ -334,19 +314,16 @@ export const zhCN: Record<string, string> = {
|
||||
"serverLog.channelEdited": "频道“{channel}”已编辑",
|
||||
"serverLog.serverEdited": "服务器设置已更改",
|
||||
"serverLog.permissionError": "缺少权限:{action}",
|
||||
|
||||
"poke.title": "戳一戳",
|
||||
"poke.optionalMessage": "可选消息...",
|
||||
"poke.send": "发送",
|
||||
"poke.cancel": "取消",
|
||||
"poke.pokedYou": "戳了你一下",
|
||||
"poke.dismiss": "关闭",
|
||||
|
||||
"kick.title": "踢出:",
|
||||
"kick.reasonPlaceholder": "原因(可选)...",
|
||||
"kick.confirm": "踢出",
|
||||
"kick.cancel": "取消",
|
||||
|
||||
"ban.title": "封禁:",
|
||||
"ban.reasonPlaceholder": "原因(可选)...",
|
||||
"ban.duration": "时长:",
|
||||
@@ -356,7 +333,6 @@ export const zhCN: Record<string, string> = {
|
||||
"ban.duration1w": "1 周",
|
||||
"ban.confirm": "封禁",
|
||||
"ban.cancel": "取消",
|
||||
|
||||
"serverEdit.title": "编辑虚拟服务器",
|
||||
"serverEdit.tab.host": "主机",
|
||||
"serverEdit.tab.misc": "其他",
|
||||
@@ -394,7 +370,6 @@ export const zhCN: Record<string, string> = {
|
||||
"serverEdit.unchanged": "保持不变",
|
||||
"serverEdit.save": "保存",
|
||||
"serverEdit.cancel": "取消",
|
||||
|
||||
"serverProtocolLog.title": "服务器日志",
|
||||
"serverProtocolLog.empty": "暂无日志条目。",
|
||||
"banList.title": "封禁列表",
|
||||
@@ -426,23 +401,19 @@ export const zhCN: Record<string, string> = {
|
||||
"offlineMessages.markRead": "标记为已读",
|
||||
"offlineMessages.backToList": "返回列表",
|
||||
"dialog.cancel": "取消",
|
||||
|
||||
"groupAssign.channelTitle": "分配频道组",
|
||||
"groupAssign.serverTitle": "分配服务器组",
|
||||
"groupAssign.empty": "未找到组。",
|
||||
"groupAssign.clickToRemove": "单击移除",
|
||||
|
||||
"serverQueryLogin.username": "用户名",
|
||||
"serverQueryLogin.password": "密码",
|
||||
"serverQueryLogin.login": "登录",
|
||||
|
||||
"permissionOverview.title": "我的权限",
|
||||
"permissionOverview.empty": "未找到权限。",
|
||||
"permissionOverview.name": "权限",
|
||||
"permissionOverview.value": "值",
|
||||
"permissionOverview.negated": "否定",
|
||||
"permissionOverview.skip": "跳过",
|
||||
|
||||
"permsEditor.title": "权限",
|
||||
"permsEditor.tab.server": "服务器组",
|
||||
"permsEditor.tab.client": "用户权限",
|
||||
@@ -455,12 +426,12 @@ export const zhCN: Record<string, string> = {
|
||||
"permsEditor.pickTarget": "请在左侧选择组或频道,或输入用户 ID。",
|
||||
"permsEditor.addPermission": "添加",
|
||||
"permsEditor.searchPermission": "搜索权限...",
|
||||
|
||||
"dialog.ok": "确定",
|
||||
"channelContext.join": "切换到频道",
|
||||
"channelContext.files": "文件...",
|
||||
"fileBrowser.title": "文件传输",
|
||||
"fileBrowser.up": "上一级",
|
||||
"fileBrowser.tooLarge": "文件过大——每次上传最多 {mb} MiB。",
|
||||
"fileBrowser.refresh": "刷新",
|
||||
"fileBrowser.newFolder": "新建文件夹",
|
||||
"fileBrowser.upload": "上传",
|
||||
@@ -475,15 +446,14 @@ export const zhCN: Record<string, string> = {
|
||||
"fileBrowser.deleteConfirm": "确定要删除吗?",
|
||||
"fileBrowser.uploading": "正在上传...",
|
||||
"fileBrowser.downloading": "正在下载...",
|
||||
|
||||
"serverContext.icons": "服务器图标...",
|
||||
"serverIcons.title": "管理服务器图标",
|
||||
"serverIcons.upload": "上传图标",
|
||||
"serverIcons.iconId": "图标 ID",
|
||||
"serverIcons.empty": "未找到图标。",
|
||||
|
||||
"clientContext.privateChat": "私聊",
|
||||
"clientContext.poke": "戳一戳",
|
||||
"clientContext.moveTo": "移动到…",
|
||||
"clientContext.copyName": "复制名称",
|
||||
"clientContext.connectionInfo": "查看连接信息",
|
||||
"clientContext.addWhisperTarget": "添加为悄悄话目标",
|
||||
@@ -494,15 +464,16 @@ export const zhCN: Record<string, string> = {
|
||||
"clientContext.kick": "踢出服务器",
|
||||
"clientContext.ban": "封禁",
|
||||
"clientContext.notSupported": "网页客户端暂不支持此功能",
|
||||
|
||||
"moveClient.title": "移动",
|
||||
"moveClient.empty": "没有可用频道。",
|
||||
"moveClient.current": "当前频道",
|
||||
"moveClient.spacer": "间隔频道",
|
||||
"serverContext.connectionInfo": "服务器连接信息",
|
||||
"serverContext.copyAddress": "复制服务器地址",
|
||||
"serverContext.addFavorite": "添加到收藏夹",
|
||||
"serverContext.disconnect": "断开连接",
|
||||
|
||||
"connectError.dismiss": "关闭",
|
||||
"dialog.close": "关闭",
|
||||
|
||||
"sounds.title": "声音",
|
||||
"sounds.subtitle": "配置事件提示音",
|
||||
"sounds.enable": "启用声音",
|
||||
@@ -521,7 +492,6 @@ export const zhCN: Record<string, string> = {
|
||||
"sounds.reset": "重置",
|
||||
"sounds.importSoundpack": "导入声音包(.ts3soundpack)",
|
||||
"sounds.importResult": "已导入 {matched} 个声音,{unmatched} 个文件未匹配",
|
||||
|
||||
"nachrichten.title": "消息",
|
||||
"nachrichten.subtitle": "自定义消息",
|
||||
"nachrichten.disconnectMessage": "断开连接:",
|
||||
@@ -533,4 +503,159 @@ export const zhCN: Record<string, string> = {
|
||||
"nachrichten.message": "消息",
|
||||
"nachrichten.add": "添加",
|
||||
"nachrichten.delete": "删除",
|
||||
};
|
||||
"menu.help.about": "关于 WebSpeak3",
|
||||
"menu.help.github": "GitHub",
|
||||
"menu.help.changelog": "更新日志",
|
||||
"menu.help.translate": "参与翻译(Weblate)",
|
||||
"menu.extras.feedback": "发送反馈",
|
||||
"feedback.fab.nudge": "你觉得 WebSpeak3 怎么样?欢迎反馈!",
|
||||
"donate.label": "捐助",
|
||||
"donate.title": "在 Ko-fi 上支持 WebSpeak3",
|
||||
"pwa.updateAvailable": "有新版本可用",
|
||||
"pwa.reload": "重新加载",
|
||||
"feedback.dialog.title": "反馈",
|
||||
"feedback.dialog.intro": "报告一个问题,或分享改进 WebSpeak3 的想法。",
|
||||
"feedback.dialog.category": "类别",
|
||||
"feedback.dialog.category.bug": "错误",
|
||||
"feedback.dialog.category.idea": "建议",
|
||||
"feedback.dialog.category.report": "举报(违规/滥用)",
|
||||
"feedback.dialog.category.other": "其他",
|
||||
"feedback.dialog.reportHint": "举报内容保持私密,不会作为 GitHub Issue 公开。如有需要可注明相关服务器。",
|
||||
"feedback.dialog.message": "消息",
|
||||
"feedback.dialog.messagePlaceholder": "发生了什么,或者你有什么建议?",
|
||||
"feedback.dialog.email": "邮箱(可选,用于回复——仅私下保存,绝不公开)",
|
||||
"feedback.dialog.publishAsIssue": "作为公开的 GitHub Issue 发布",
|
||||
"feedback.dialog.publishAsIssueHint": "不勾选则反馈保持私密,仅维护者可见。",
|
||||
"feedback.dialog.publishAsIssueHintBug": "错误报告将始终作为公开的 GitHub Issue 发布。",
|
||||
"feedback.dialog.send": "发送",
|
||||
"feedback.dialog.cancel": "取消",
|
||||
"feedback.dialog.sending": "发送中…",
|
||||
"feedback.dialog.success": "感谢你的反馈!",
|
||||
"feedback.dialog.successWithIssue": "谢谢!已创建 Issue:",
|
||||
"feedback.dialog.error": "发送失败,请稍后重试。",
|
||||
"restartNotice.title": "短暂中断",
|
||||
"restartNotice.body": "服务器即将短暂重启,你的连接会中断片刻。",
|
||||
"restartNotice.ack": "知道了",
|
||||
"menu.extras.tos": "使用条款",
|
||||
"tos.title": "client.webspeak3.de 使用条款",
|
||||
"tos.rule1": "本客户端仅供通过浏览器私人、非商业使用 TeamSpeak / TeaSpeak / GreenTeaSpeak 服务器。",
|
||||
"tos.rule2": "尤其禁止:任何违法行为、骚扰与仇恨言论、垃圾信息与刷屏、干扰服务运行,以及规避封禁。",
|
||||
"tos.rule3": "违规可能导致访问权限被无预警封禁;严重情况可能会上报相关部门。",
|
||||
"tos.rule4Pre": "出于运行安全和滥用检测的目的,连接信息(服务器地址、服务器名称、连接时间)会被记录,并在 90 天后自动删除 —— 详见",
|
||||
"tos.rule4Post": "。",
|
||||
"tos.privacyLinkText": "隐私政策",
|
||||
"tos.rule5Pre": "如遇滥用或投诉:详见",
|
||||
"tos.rule5Post": "。",
|
||||
"tos.legalLinkText": "法律声明(Impressum)",
|
||||
"tos.rule6": "点击“接受”即表示你同意本条款。你的同意状态仅保存在本地浏览器中;若条款更新,系统会再次询问。",
|
||||
"tos.accept": "接受",
|
||||
"tos.close": "关闭",
|
||||
"connect.novaSubtitle": "WebSpeak3 完全在浏览器中运行 —— 无需下载",
|
||||
"channelPasswordDialog.title": "需要频道密码",
|
||||
"channelPasswordDialog.prompt": "此频道受密码保护,请输入密码:",
|
||||
"channelPasswordDialog.wrongPassword": "密码错误,请重试:",
|
||||
"channelPasswordDialog.submit": "加入",
|
||||
"channelPasswordDialog.cancel": "取消",
|
||||
"design.custom.new": "+ 新建设计",
|
||||
"design.custom.import": "导入设计",
|
||||
"design.custom.edit": "编辑",
|
||||
"design.custom.duplicate": "复制",
|
||||
"design.custom.export": "导出",
|
||||
"design.custom.delete": "删除",
|
||||
"design.custom.deleteConfirm": "确定要删除此设计吗?",
|
||||
"design.custom.newTitle": "创建新设计",
|
||||
"design.custom.editTitle": "编辑设计",
|
||||
"design.custom.name": "名称",
|
||||
"design.custom.base": "基础布局",
|
||||
"design.custom.css": "CSS",
|
||||
"design.custom.hint": "此 CSS 会在设计启用时加载。使用 .ts-app { ... } 以及现有的 CSS 变量(--accent、--bg、--text、--border 等)来调整颜色、圆角和间距 —— 通过 .ts-app .some-class { display: none } 或调整顺序,甚至可以改变布局。",
|
||||
"design.custom.save": "保存",
|
||||
"design.custom.copyOf": "{name} 的副本",
|
||||
"design.custom.importError": "该文件无法作为 WebSpeak3 设计读取。",
|
||||
"design.store.open": "商店",
|
||||
"design.store.title": "设计商店",
|
||||
"design.store.back": "返回",
|
||||
"design.store.loading": "加载中…",
|
||||
"design.store.unavailable": "此服务器未启用设计商店。",
|
||||
"design.store.empty": "商店里还没有设计。",
|
||||
"design.store.install": "安装",
|
||||
"design.store.installed": "已安装",
|
||||
"design.store.by": "作者:{author}",
|
||||
"design.store.screenshotAlt": "{name} 的截图",
|
||||
"design.store.rating.rate": "评{stars}星",
|
||||
"design.store.rating.summary": "{average}({count})",
|
||||
"design.store.rating.none": "暂无评分",
|
||||
"design.store.publishTitle": "发布设计",
|
||||
"design.store.publish.select": "选择你自己的设计",
|
||||
"design.store.publish.none": "你还没有可发布的自定义设计。",
|
||||
"design.store.publish.author": "你的名字(可选)",
|
||||
"design.store.publish.authorPlaceholder": "匿名",
|
||||
"design.store.publish.description": "描述(可选)",
|
||||
"design.store.publish.descriptionPlaceholder": "这个设计有什么特别之处?",
|
||||
"design.store.publish.screenshot": "截图(可选)",
|
||||
"design.store.publish.screenshotTooLarge": "图片太大,请使用更小的截图。",
|
||||
"design.store.publish.adminToken": "管理员令牌(仅保留名称需要)",
|
||||
"design.store.publish.adminTokenPlaceholder": "不确定的话请留空",
|
||||
"design.store.publish.submit": "发布到商店",
|
||||
"design.store.publish.success": "设计已发布!",
|
||||
"design.store.publish.pending": "谢谢!你的设计已提交,审核通过后将显示在商店中。",
|
||||
"design.store.publish.error": "发布失败。",
|
||||
"recording.autoGainControl": "自动增益控制",
|
||||
"tree.streaming": "正在直播",
|
||||
"publish.alpha": "内测",
|
||||
"publish.alphaTitle": "内测阶段 —— 不稳定,可能随时变更或失效",
|
||||
"publish.demoUnavailable": "演示模式下无法使用直播功能 —— 需要真实的 TeamSpeak 6 服务器。",
|
||||
"publish.alphaNote": "直播功能处于内测阶段,使用的是 TeamSpeak 6 未公开文档的 Stream/Call 协议,因此连接、画质和观众处理可能会出错或在无预警的情况下发生变化,不建议用于正式场合。",
|
||||
"publish.start": "共享屏幕",
|
||||
"publish.stop": "停止共享",
|
||||
"publish.title": "你的直播",
|
||||
"publish.screen": "屏幕",
|
||||
"publish.starting": "启动中…",
|
||||
"publish.viewers": "{count} 人观看",
|
||||
"publish.request.allow": "允许",
|
||||
"publish.request.deny": "拒绝",
|
||||
"publish.request.block": "屏蔽",
|
||||
"publish.request.blockHint": "拒绝并不再询问",
|
||||
"publish.dialog.title": "直播设置",
|
||||
"publish.dialog.basic": "基本设置",
|
||||
"publish.dialog.advanced": "高级设置",
|
||||
"publish.dialog.golive": "开始直播",
|
||||
"publish.dialog.cancel": "返回",
|
||||
"publish.preset": "预设",
|
||||
"publish.preset.presentation": "演示",
|
||||
"publish.audio": "采集音频",
|
||||
"publish.privacy": "可见范围",
|
||||
"publish.privacy.public": "公开",
|
||||
"publish.privacy.contacts": "联系人",
|
||||
"publish.privacy.private": "私密",
|
||||
"publish.resolution": "分辨率",
|
||||
"publish.res.source": "源画质",
|
||||
"publish.fps": "帧率",
|
||||
"publish.bitrate": "码率",
|
||||
"publish.audioBitrate": "音频码率 [Kbps]",
|
||||
"publish.viewerLimit": "观众人数上限",
|
||||
"publish.mode": "连接模式",
|
||||
"publish.mode.p2p": "点对点(P2P)",
|
||||
"publish.mode.server": "服务器",
|
||||
"publish.mode.serverUnavailable": "服务器模式需经过 TS6 的 SFU,尚未实现。",
|
||||
"stream.untitled": "直播",
|
||||
"stream.stop": "关闭直播",
|
||||
"stream.live": "直播中",
|
||||
"stream.state.new": "等待推流…",
|
||||
"stream.state.connecting": "连接中…",
|
||||
"stream.state.connected": "直播中",
|
||||
"stream.state.disconnected": "连接中断",
|
||||
"stream.state.failed": "连接失败",
|
||||
"stream.state.closed": "已结束",
|
||||
"clientContext.watchStream": "观看直播",
|
||||
"tree.expand": "展开",
|
||||
"tree.collapse": "折叠",
|
||||
"tabs.disconnect": "断开连接",
|
||||
"tabs.closeTab": "关闭标签页:{label}",
|
||||
"identity.importInvalid": "“{file}”不是有效的身份文件。",
|
||||
"log.fileTransferFailed": "文件传输失败:",
|
||||
"log.fileTransferInvalidAddress": "文件传输失败(地址无效)",
|
||||
"sounds.importFailed": "无法读取此音效包——它是有效的 .ts3soundpack/ZIP 文件吗?",
|
||||
"tabs.connections": "服务器连接",
|
||||
"shortcut.ctrl": "Ctrl"
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import './storageFallback'
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import './index.css'
|
||||
|
||||
@@ -0,0 +1,499 @@
|
||||
// Publishing a stream that TeamSpeak 6 clients can watch.
|
||||
//
|
||||
// The mirror image of stream.ts. Where a viewer answers an offer, a publisher
|
||||
// makes one - TS6 puts the first SDP in `respondjoinstreamrequest`, so the
|
||||
// side that owns the stream is the side that offers.
|
||||
//
|
||||
// The exchange, from our side:
|
||||
//
|
||||
// 1. setupStream -> notifystreamstarted naming our own clid + the id
|
||||
// 2. wait <- notifyjoinstreamrequest, one per viewer
|
||||
// 3. offer respondJoinStream(accept, <our SDP>)
|
||||
// 4. answer <- {cmd:"answer", args:{answer:"<sdp>"}}
|
||||
// 5. trickle ICE both directions via {cmd:"iceCandidate"}
|
||||
//
|
||||
// TS6's P2P mode is a mesh: there is no SFU in the path, so every viewer gets
|
||||
// its own peer connection and its own copy of the encoded media.
|
||||
|
||||
import type { StreamEvent } from "./stream";
|
||||
|
||||
// The three enums below are read straight out of TS6's own UI bundle
|
||||
// (main.js), not inferred - see ts6-re/findings §10.
|
||||
|
||||
/** `type` in `setupstream`: what is being captured. */
|
||||
export const StreamSource = {
|
||||
NONE: 0,
|
||||
CAMERA: 1,
|
||||
SCREEN: 2,
|
||||
WINDOW: 3,
|
||||
EXISTING_SESSION: 4,
|
||||
} as const;
|
||||
|
||||
/** `accessibility` in `setupstream`: TS6's Privacy setting. */
|
||||
export const StreamAccess = {
|
||||
NONE: 0,
|
||||
PUBLIC: 1,
|
||||
CONTACTS_ONLY: 2,
|
||||
PRIVATE: 3,
|
||||
} as const;
|
||||
|
||||
/** `mode` in `setupstream`: TS6's Connection Mode. */
|
||||
export const StreamMode = {
|
||||
NONE: 0,
|
||||
P2P: 1,
|
||||
SFU: 2,
|
||||
} as const;
|
||||
|
||||
const DEFAULT_ICE_SERVERS: RTCIceServer[] = [
|
||||
{ urls: "stun:turn.teamspeak.com:3478" },
|
||||
{ urls: "stun:turn2.teamspeak.com:3478" },
|
||||
{ urls: "stun:stun.l.google.com:19302" },
|
||||
];
|
||||
|
||||
export interface StreamPublishOptions {
|
||||
name: string;
|
||||
/** Send the capture's audio track too, when the source has one. */
|
||||
audio: boolean;
|
||||
/** One of StreamAccess. */
|
||||
accessibility: number;
|
||||
/** One of StreamMode. Only P2P is implemented; SFU needs the mediasoup path. */
|
||||
mode: number;
|
||||
/** 0 means unlimited. */
|
||||
viewerLimit: number;
|
||||
/** Capture height in pixels; 0 keeps the source's own resolution. */
|
||||
height: number;
|
||||
/** Capture frame rate; 0 leaves it to the browser. */
|
||||
fps: number;
|
||||
videoBitrateKbps: number;
|
||||
audioBitrateKbps: number;
|
||||
/**
|
||||
* What the encoder should protect when it runs out of bitrate. Slides and
|
||||
* code want "detail" (keep text sharp, drop frames); a game wants "motion".
|
||||
*/
|
||||
contentHint: "motion" | "detail";
|
||||
}
|
||||
|
||||
export interface StreamPublisherOptions {
|
||||
send: (message: Record<string, unknown>) => void;
|
||||
/** Needed to recognise our own `notifystreamstarted` among everyone's. */
|
||||
ownClientId: number;
|
||||
onStateChange?: (state: PublishState) => void;
|
||||
onViewersChange?: (viewers: number[]) => void;
|
||||
/** Join requests awaiting a decision, as [clid, message] pairs. */
|
||||
onPendingChange?: (pending: [number, string][]) => void;
|
||||
onError?: (error: string) => void;
|
||||
iceServers?: RTCIceServer[];
|
||||
}
|
||||
|
||||
export type PublishState = "idle" | "starting" | "live" | "stopped";
|
||||
|
||||
interface Viewer {
|
||||
pc: RTCPeerConnection;
|
||||
/** Candidates that arrived before the answer; replayed after. */
|
||||
pending: RTCIceCandidateInit[];
|
||||
answered: boolean;
|
||||
}
|
||||
|
||||
export class StreamPublisher {
|
||||
private readonly opts: StreamPublisherOptions;
|
||||
private readonly viewers = new Map<number, Viewer>();
|
||||
/** Requests waiting for the user to decide: clid -> the viewer's message. */
|
||||
private readonly pending = new Map<number, string>();
|
||||
/** Clients denied with "block"; they are refused without asking again. */
|
||||
private readonly blocked = new Set<number>();
|
||||
private media: MediaStream | null = null;
|
||||
private state: PublishState = "idle";
|
||||
private options: StreamPublishOptions | null = null;
|
||||
|
||||
/** Assigned by the server, not by us; null until notifystreamstarted. */
|
||||
streamId: string | null = null;
|
||||
|
||||
/** The local capture, for showing the user what they are sending. */
|
||||
get previewStream(): MediaStream | null {
|
||||
return this.media;
|
||||
}
|
||||
|
||||
constructor(opts: StreamPublisherOptions) {
|
||||
this.opts = opts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Captures a screen and announces the stream.
|
||||
*
|
||||
* `getDisplayMedia` is secure-context-only, so this throws on a plain-http
|
||||
* origin - the same limitation the microphone already has.
|
||||
*/
|
||||
async start(options: StreamPublishOptions): Promise<void> {
|
||||
if (this.state === "live" || this.state === "starting") return;
|
||||
if (!navigator.mediaDevices?.getDisplayMedia) {
|
||||
this.fail("Screen sharing requires HTTPS (or localhost) - the site is not a secure context.");
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState("starting");
|
||||
this.options = options;
|
||||
|
||||
const video: MediaTrackConstraints = {};
|
||||
if (options.height > 0) video.height = { ideal: options.height };
|
||||
if (options.fps > 0) video.frameRate = { ideal: options.fps };
|
||||
|
||||
try {
|
||||
this.media = await navigator.mediaDevices.getDisplayMedia({
|
||||
video: Object.keys(video).length > 0 ? video : true,
|
||||
audio: options.audio,
|
||||
});
|
||||
} catch (err) {
|
||||
this.setState("idle");
|
||||
this.fail(`Could not capture the screen: ${describe(err)}`);
|
||||
return;
|
||||
}
|
||||
|
||||
for (const track of this.media.getVideoTracks()) track.contentHint = options.contentHint;
|
||||
|
||||
// The browser's own "stop sharing" bar bypasses our UI entirely, so the
|
||||
// track ending is the authoritative signal that the stream is over.
|
||||
for (const track of this.media.getTracks()) {
|
||||
track.onended = () => this.stop();
|
||||
}
|
||||
|
||||
this.opts.send({
|
||||
type: "setupStream",
|
||||
name: options.name,
|
||||
// The browser's own picker decides whether this is a whole screen or a
|
||||
// single window, so the type is read back off the track rather than
|
||||
// asked for up front.
|
||||
streamType: this.detectSourceType(),
|
||||
bitrate: options.videoBitrateKbps * 1000,
|
||||
accessibility: options.accessibility,
|
||||
mode: options.mode,
|
||||
viewerLimit: options.viewerLimit,
|
||||
audio: options.audio && this.media.getAudioTracks().length > 0,
|
||||
});
|
||||
}
|
||||
|
||||
/** Feeds one `streamEvent` in; events for other streams are ignored. */
|
||||
handleEvent(event: StreamEvent): void {
|
||||
switch (event.name) {
|
||||
case "notifystreamstarted":
|
||||
// Everyone in the channel sees this, so the clid decides whether it
|
||||
// is the answer to our own setupstream.
|
||||
if (Number(event.args.clid) === this.opts.ownClientId && event.args.id) {
|
||||
this.streamId = event.args.id;
|
||||
this.setState("live");
|
||||
}
|
||||
break;
|
||||
case "notifyjoinstreamrequest":
|
||||
if (event.args.id === this.streamId) void this.admit(event.args);
|
||||
break;
|
||||
case "notifystreamsignaling":
|
||||
if (event.args.id === this.streamId) void this.handleSignaling(event.args);
|
||||
break;
|
||||
case "notifystreamclientleft":
|
||||
if (event.args.id === this.streamId) this.dropViewer(Number(event.args.clid));
|
||||
break;
|
||||
case "notifystreamstopped":
|
||||
if (event.args.id === this.streamId) this.teardown("stopped");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides what to do with an incoming join request.
|
||||
*
|
||||
* This mirrors TS6's own publisher-side rule, which is the only place either
|
||||
* setting is enforced at all - the server stores `accessibility` and
|
||||
* `viewer_limit`, echoes them back, and then forwards every request anyway
|
||||
* (verified live: a PRIVATE stream at viewer_limit=1 still had both viewers
|
||||
* announced to us).
|
||||
*
|
||||
* The important half is what happens to a request we do not take: TS6 leaves
|
||||
* it *pending* rather than refusing it. A refusal is not sticky - TS6's own
|
||||
* "block" path is deny plus a ban - so a refused client simply asks again, in
|
||||
* a loop, and shows its user nothing. Left pending, it asks once and displays
|
||||
* "waiting for access" until we answer.
|
||||
*/
|
||||
private async admit(args: Record<string, string>): Promise<void> {
|
||||
const clid = Number(args.clid);
|
||||
if (!Number.isFinite(clid) || !this.media || !this.streamId) return;
|
||||
|
||||
// is_remove=1 is how TS6 says "stop watching"; the same notify carries it.
|
||||
if (args.is_remove === "1") {
|
||||
this.dropViewer(clid);
|
||||
return;
|
||||
}
|
||||
if (this.viewers.has(clid) || this.pending.has(clid)) return;
|
||||
|
||||
// Explicitly blocked earlier: refuse without bothering the user again.
|
||||
if (this.blocked.has(clid)) {
|
||||
this.refuse(clid, "Blocked");
|
||||
return;
|
||||
}
|
||||
|
||||
const limit = this.options?.viewerLimit ?? 0;
|
||||
const full = limit > 0 && this.viewers.size >= limit;
|
||||
const autoAccept = this.options?.accessibility === StreamAccess.PUBLIC && !full;
|
||||
|
||||
if (!autoAccept) {
|
||||
// CONTACTS_ONLY behaves as PRIVATE here: the contact list is a TS6
|
||||
// account feature webspeak3 has no access to, so it cannot be consulted.
|
||||
this.pending.set(clid, args.msg ?? "");
|
||||
this.notifyPending();
|
||||
return;
|
||||
}
|
||||
|
||||
await this.openTo(clid);
|
||||
}
|
||||
|
||||
/** Lets a pending viewer in. Called by admit() or by the user. */
|
||||
async approve(clid: number): Promise<void> {
|
||||
if (!this.pending.delete(clid)) return;
|
||||
this.notifyPending();
|
||||
await this.openTo(clid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns a pending viewer away. `block` also remembers the refusal, which is
|
||||
* what makes it stick - TS6 pairs its deny with a ban for the same reason.
|
||||
*/
|
||||
deny(clid: number, block = false): void {
|
||||
this.pending.delete(clid);
|
||||
if (block) this.blocked.add(clid);
|
||||
this.notifyPending();
|
||||
this.refuse(clid, block ? "Blocked" : "Denied");
|
||||
}
|
||||
|
||||
private refuse(clid: number, message: string): void {
|
||||
if (!this.streamId) return;
|
||||
this.opts.send({
|
||||
type: "respondJoinStream",
|
||||
streamId: this.streamId,
|
||||
clientId: clid,
|
||||
accept: false,
|
||||
message,
|
||||
});
|
||||
}
|
||||
|
||||
/** Builds the peer connection for a viewer we have decided to let in. */
|
||||
private async openTo(clid: number): Promise<void> {
|
||||
if (!this.media || !this.streamId || this.viewers.has(clid)) return;
|
||||
|
||||
const pc = new RTCPeerConnection({ iceServers: this.opts.iceServers ?? DEFAULT_ICE_SERVERS });
|
||||
const viewer: Viewer = { pc, pending: [], answered: false };
|
||||
this.viewers.set(clid, viewer);
|
||||
|
||||
for (const track of this.media.getTracks()) pc.addTrack(track, this.media);
|
||||
|
||||
pc.onicecandidate = (ev) => {
|
||||
if (!ev.candidate) return;
|
||||
this.signal(clid, "iceCandidate", {
|
||||
sdp: ev.candidate.candidate,
|
||||
mid: ev.candidate.sdpMid ?? "0",
|
||||
mLine: ev.candidate.sdpMLineIndex ?? 0,
|
||||
});
|
||||
};
|
||||
pc.onconnectionstatechange = () => {
|
||||
if (pc.connectionState === "failed" || pc.connectionState === "closed") this.dropViewer(clid);
|
||||
};
|
||||
|
||||
try {
|
||||
const offer = await pc.createOffer();
|
||||
await pc.setLocalDescription(offer);
|
||||
await this.applySendParameters(pc);
|
||||
this.opts.send({
|
||||
type: "respondJoinStream",
|
||||
streamId: this.streamId,
|
||||
clientId: clid,
|
||||
accept: true,
|
||||
offer: offer.sdp ?? "",
|
||||
});
|
||||
this.notifyViewers();
|
||||
} catch (err) {
|
||||
this.dropViewer(clid);
|
||||
this.fail(`Could not offer the stream to client ${clid}: ${describe(err)}`);
|
||||
}
|
||||
}
|
||||
|
||||
private async handleSignaling(args: Record<string, string>): Promise<void> {
|
||||
const clid = Number(args.clid);
|
||||
const viewer = this.viewers.get(clid);
|
||||
if (!viewer) return;
|
||||
|
||||
let msg: { cmd: string; args: unknown };
|
||||
try {
|
||||
msg = JSON.parse(args.json ?? "");
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
const payload = msg.args as Record<string, unknown> | string | null;
|
||||
switch (msg.cmd) {
|
||||
case "answer": {
|
||||
// Same key rule as the sending side: the key is named after the cmd.
|
||||
const sdp =
|
||||
typeof payload === "string"
|
||||
? payload
|
||||
: typeof payload?.answer === "string"
|
||||
? payload.answer
|
||||
: typeof payload?.sdp === "string"
|
||||
? payload.sdp
|
||||
: null;
|
||||
if (!sdp) return;
|
||||
try {
|
||||
await viewer.pc.setRemoteDescription({ type: "answer", sdp });
|
||||
viewer.answered = true;
|
||||
const pending = viewer.pending;
|
||||
viewer.pending = [];
|
||||
for (const c of pending) {
|
||||
try {
|
||||
await viewer.pc.addIceCandidate(c);
|
||||
} catch (err) {
|
||||
console.warn("[publish] ignoring buffered ICE candidate:", describe(err));
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
this.fail(`Could not accept the viewer's answer: ${describe(err)}`);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "iceCandidate": {
|
||||
if (typeof payload !== "object" || payload === null) return;
|
||||
const candidate = payload.sdp;
|
||||
if (typeof candidate !== "string" || !candidate) return;
|
||||
const init: RTCIceCandidateInit = {
|
||||
candidate,
|
||||
sdpMid: typeof payload.mid === "string" ? payload.mid : undefined,
|
||||
sdpMLineIndex: typeof payload.mLine === "number" ? payload.mLine : undefined,
|
||||
};
|
||||
// TS6 trickles from the moment it gets the offer, so these routinely
|
||||
// beat its own answer. Holding them is not an edge case.
|
||||
if (!viewer.answered) {
|
||||
viewer.pending.push(init);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await viewer.pc.addIceCandidate(init);
|
||||
} catch (err) {
|
||||
console.warn("[publish] ignoring ICE candidate:", describe(err));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Caps each sender at the configured bitrate and pins the resolution.
|
||||
*
|
||||
* `setupstream`'s `bitrate` is only what the stream *advertises* - the
|
||||
* server does not even echo our value back unchanged, and it certainly does
|
||||
* not reach the encoder. The actual limit is a sender parameter, and the
|
||||
* encodings it lives on only exist once a local description is set.
|
||||
*
|
||||
* `degradationPreference` matters just as much. Its default for a track
|
||||
* hinted "motion" is to protect the frame rate and shrink the picture, which
|
||||
* for a screen share is exactly backwards: the user picked 1080p, so 1080p is
|
||||
* the thing to keep. Measured on a 1440x1080 capture at a 6000 kbps cap:
|
||||
*
|
||||
* default / maintain-framerate / balanced -> 480x270, a 3x downscale
|
||||
* maintain-resolution -> 1440x810, no downscale
|
||||
*
|
||||
* Without this the encoder collapses within seconds of the connection coming
|
||||
* up and never recovers, and every resolution setting above 360p is a lie.
|
||||
*/
|
||||
private async applySendParameters(pc: RTCPeerConnection): Promise<void> {
|
||||
const options = this.options;
|
||||
if (!options) return;
|
||||
for (const sender of pc.getSenders()) {
|
||||
if (!sender.track) continue;
|
||||
const video = sender.track.kind === "video";
|
||||
const kbps = video ? options.videoBitrateKbps : options.audioBitrateKbps;
|
||||
const params = sender.getParameters();
|
||||
if (video) params.degradationPreference = "maintain-resolution";
|
||||
if (kbps > 0) {
|
||||
if (!params.encodings || params.encodings.length === 0) params.encodings = [{}];
|
||||
for (const encoding of params.encodings) encoding.maxBitrate = kbps * 1000;
|
||||
}
|
||||
try {
|
||||
await sender.setParameters(params);
|
||||
} catch (err) {
|
||||
// Not fatal - the stream still runs, just uncapped and free to shrink.
|
||||
console.warn("[publish] could not apply the send parameters:", describe(err));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps the capture to TS6's source enum.
|
||||
*
|
||||
* `displaySurface` is what the user actually picked in the browser's own
|
||||
* share dialog, so it is more truthful than anything we could ask for in
|
||||
* advance. A browser tab has no TS6 equivalent and reads closest to a window.
|
||||
*/
|
||||
private detectSourceType(): number {
|
||||
const surface = this.media?.getVideoTracks()[0]?.getSettings().displaySurface;
|
||||
return surface === "monitor" ? StreamSource.SCREEN : StreamSource.WINDOW;
|
||||
}
|
||||
|
||||
private dropViewer(clid: number): void {
|
||||
// Someone can also leave while their request is still queued - by closing
|
||||
// TS6, or by giving up on "waiting for access". The row has to go with
|
||||
// them, or the user is left approving a viewer who is no longer there.
|
||||
if (this.pending.delete(clid)) this.notifyPending();
|
||||
|
||||
const viewer = this.viewers.get(clid);
|
||||
if (!viewer) return;
|
||||
this.viewers.delete(clid);
|
||||
viewer.pc.close();
|
||||
this.notifyViewers();
|
||||
}
|
||||
|
||||
/** Stops the capture and takes the stream down. Safe to call twice. */
|
||||
stop(): void {
|
||||
if (this.state === "idle" || this.state === "stopped") return;
|
||||
if (this.streamId) this.opts.send({ type: "stopStream", streamId: this.streamId });
|
||||
this.teardown("stopped");
|
||||
}
|
||||
|
||||
private teardown(state: PublishState): void {
|
||||
for (const [, viewer] of this.viewers) viewer.pc.close();
|
||||
this.viewers.clear();
|
||||
this.pending.clear();
|
||||
this.blocked.clear();
|
||||
for (const track of this.media?.getTracks() ?? []) track.stop();
|
||||
this.media = null;
|
||||
this.streamId = null;
|
||||
this.options = null;
|
||||
this.notifyViewers();
|
||||
this.notifyPending();
|
||||
this.setState(state);
|
||||
}
|
||||
|
||||
private signal(clid: number, cmd: string, args: unknown): void {
|
||||
this.opts.send({
|
||||
type: "streamSignal",
|
||||
streamId: this.streamId,
|
||||
clientId: clid,
|
||||
payload: { cmd, args },
|
||||
});
|
||||
}
|
||||
|
||||
private setState(state: PublishState): void {
|
||||
this.state = state;
|
||||
this.opts.onStateChange?.(state);
|
||||
}
|
||||
|
||||
private notifyViewers(): void {
|
||||
this.opts.onViewersChange?.([...this.viewers.keys()]);
|
||||
}
|
||||
|
||||
private notifyPending(): void {
|
||||
this.opts.onPendingChange?.([...this.pending.entries()]);
|
||||
}
|
||||
|
||||
private fail(message: string): void {
|
||||
this.opts.onError?.(message);
|
||||
}
|
||||
}
|
||||
|
||||
function describe(err: unknown): string {
|
||||
return err instanceof Error ? err.message : String(err);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// With storage blocked (privacy settings, some embedded webviews) merely
|
||||
// touching `localStorage` throws, and dozens of module-level reads would
|
||||
// leave a blank page. Swap in an in-memory stand-in so the app runs; settings
|
||||
// just don't survive a reload then. Imported first thing in main.tsx.
|
||||
try {
|
||||
const probe = "__webspeak3_probe__";
|
||||
localStorage.setItem(probe, probe);
|
||||
localStorage.removeItem(probe);
|
||||
} catch {
|
||||
const data = new Map<string, string>();
|
||||
const memory: Storage = {
|
||||
get length() {
|
||||
return data.size;
|
||||
},
|
||||
key: (i) => [...data.keys()][i] ?? null,
|
||||
getItem: (k) => data.get(k) ?? null,
|
||||
setItem: (k, v) => void data.set(k, String(v)),
|
||||
removeItem: (k) => void data.delete(k),
|
||||
clear: () => data.clear(),
|
||||
};
|
||||
Object.defineProperty(window, "localStorage", { value: memory, configurable: true });
|
||||
}
|
||||
@@ -0,0 +1,315 @@
|
||||
// Viewing a TeamSpeak 6 Stream/Call broadcast in the browser.
|
||||
//
|
||||
// TS6's stream signaling rides the ordinary TS3 command channel, so everything
|
||||
// here travels the same WebSocket as the rest of the session: the connector
|
||||
// unescapes the TS wire format and hands us the JSON payload untouched (see
|
||||
// ts6-re/findings/ts6-stream-protocol-static-analysis.md).
|
||||
//
|
||||
// The exchange, from our side:
|
||||
//
|
||||
// 1. discover client_is_streaming=1 on a client in view
|
||||
// 2. joinStream -> notifyrespondjoinstreamrequest (decision=1 + SDP offer)
|
||||
// 3. answer <- streamSignal {cmd:"answer"}
|
||||
// 4. trickle ICE both directions via {cmd:"iceCandidate"}
|
||||
//
|
||||
// TS6 publishes sendonly, so this is a receive-only peer connection.
|
||||
|
||||
/** A `streamEvent` as the connector emits it. */
|
||||
export interface StreamEvent {
|
||||
type: "streamEvent";
|
||||
name: string;
|
||||
args: Record<string, string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The payload shape inside `notifystreamsignaling`'s `json` argument.
|
||||
*
|
||||
* Each `cmd` names its own key inside `args`, and the key is *not* `sdp`
|
||||
* except for `iceCandidate`: an answer is `{answer: "<sdp>"}`, an offer
|
||||
* `{offer: "<sdp>"}`, a candidate `{sdp, mid, mLine}`. Live-verified against
|
||||
* TS6 6.0.0-beta12.1 - `{sdp: "<sdp>"}` and a bare string are both accepted
|
||||
* by the server and then silently dropped by the client.
|
||||
*/
|
||||
interface SignalingMessage {
|
||||
cmd: string;
|
||||
args: unknown;
|
||||
}
|
||||
|
||||
export interface StreamInfo {
|
||||
id: string;
|
||||
clientId: number;
|
||||
name: string;
|
||||
/** Current viewer count as of the last notifystreaminfo. */
|
||||
viewers: number;
|
||||
hasAudio: boolean;
|
||||
bitrate: number;
|
||||
}
|
||||
|
||||
export interface StreamViewerOptions {
|
||||
/** Sends one message up the session WebSocket. */
|
||||
send: (message: Record<string, unknown>) => void;
|
||||
/** The remote media, once the first track arrives. */
|
||||
onTrack: (stream: MediaStream) => void;
|
||||
onStateChange?: (state: RTCPeerConnectionState) => void;
|
||||
onError?: (error: string) => void;
|
||||
/** The viewer shut down — by us, or because the publisher stopped. */
|
||||
onClosed?: () => void;
|
||||
/**
|
||||
* ICE servers to use. TS6 itself only ever configures `stun:` URLs and so
|
||||
* never gathers a relay candidate, but it will happily *connect* to one we
|
||||
* offer - which is how webspeak3 can work on networks where TS6 cannot.
|
||||
*/
|
||||
iceServers?: RTCIceServer[];
|
||||
}
|
||||
|
||||
const DEFAULT_ICE_SERVERS: RTCIceServer[] = [
|
||||
{ urls: "stun:turn.teamspeak.com:3478" },
|
||||
{ urls: "stun:turn2.teamspeak.com:3478" },
|
||||
{ urls: "stun:stun.l.google.com:19302" },
|
||||
];
|
||||
|
||||
/**
|
||||
* Reads a stream's properties out of a `notifystreaminfo` / `notifystreamstarted`.
|
||||
*
|
||||
* The two notifies disagree on one name: `notifystreaminfo` says
|
||||
* `accessibility`, `notifystreamstarted` shortens it to `access`. Only
|
||||
* `notifystreaminfo` carries `viewer`.
|
||||
*/
|
||||
export function parseStreamInfo(args: Record<string, string>): StreamInfo | null {
|
||||
const id = args.id;
|
||||
const clientId = Number(args.clid);
|
||||
if (!id || !Number.isFinite(clientId)) return null;
|
||||
return {
|
||||
id,
|
||||
clientId,
|
||||
name: args.name ?? "",
|
||||
viewers: Number(args.viewer ?? 0) || 0,
|
||||
hasAudio: args.audio === "1",
|
||||
bitrate: Number(args.bitrate ?? 0) || 0,
|
||||
};
|
||||
}
|
||||
|
||||
export class StreamViewer {
|
||||
private pc: RTCPeerConnection | null = null;
|
||||
private readonly opts: StreamViewerOptions;
|
||||
private readonly remote = new MediaStream();
|
||||
|
||||
/** Candidates that arrived before setRemoteDescription; replayed after. */
|
||||
private pendingRemoteCandidates: RTCIceCandidateInit[] = [];
|
||||
private remoteDescriptionSet = false;
|
||||
private closed = false;
|
||||
|
||||
readonly streamId: string;
|
||||
readonly peerClientId: number;
|
||||
|
||||
constructor(streamId: string, peerClientId: number, opts: StreamViewerOptions) {
|
||||
this.streamId = streamId;
|
||||
this.peerClientId = peerClientId;
|
||||
this.opts = opts;
|
||||
}
|
||||
|
||||
/** Asks the publishing client to let us watch. The offer arrives asynchronously. */
|
||||
join(message = ""): void {
|
||||
this.opts.send({
|
||||
type: "joinStream",
|
||||
streamId: this.streamId,
|
||||
clientId: this.peerClientId,
|
||||
message,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Feeds one `streamEvent` in. Events for other streams are ignored, so the
|
||||
* caller can pass everything it receives without filtering.
|
||||
*/
|
||||
handleEvent(event: StreamEvent): void {
|
||||
if (this.closed) return;
|
||||
if (event.args.id && event.args.id !== this.streamId) return;
|
||||
|
||||
switch (event.name) {
|
||||
case "notifyrespondjoinstreamrequest":
|
||||
void this.handleJoinResponse(event.args);
|
||||
break;
|
||||
case "notifystreamsignaling":
|
||||
void this.handleSignaling(event.args);
|
||||
break;
|
||||
case "notifystreamstopped":
|
||||
case "notifystreamclientleft":
|
||||
this.close();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private async handleJoinResponse(args: Record<string, string>): Promise<void> {
|
||||
if (args.decision !== "1") {
|
||||
this.fail(args.msg ? `Stream join refused: ${args.msg}` : "Stream join refused");
|
||||
return;
|
||||
}
|
||||
if (!args.offer) {
|
||||
this.fail("Stream join accepted but no SDP offer was sent");
|
||||
return;
|
||||
}
|
||||
await this.acceptOffer(args.offer);
|
||||
}
|
||||
|
||||
private async acceptOffer(sdp: string): Promise<void> {
|
||||
const pc = this.ensurePeerConnection();
|
||||
try {
|
||||
await pc.setRemoteDescription({ type: "offer", sdp });
|
||||
this.remoteDescriptionSet = true;
|
||||
await this.flushRemoteCandidates();
|
||||
|
||||
const answer = await pc.createAnswer();
|
||||
await pc.setLocalDescription(answer);
|
||||
this.signal("answer", { answer: answer.sdp ?? "" });
|
||||
} catch (err) {
|
||||
this.fail(`Could not answer the stream offer: ${describe(err)}`);
|
||||
}
|
||||
}
|
||||
|
||||
private async handleSignaling(args: Record<string, string>): Promise<void> {
|
||||
let msg: SignalingMessage;
|
||||
try {
|
||||
msg = JSON.parse(args.json ?? "");
|
||||
} catch {
|
||||
this.fail("Received malformed stream signaling payload");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (msg.cmd) {
|
||||
case "iceCandidate": {
|
||||
const candidate =
|
||||
typeof msg.args === "object" && msg.args !== null
|
||||
? candidateFromArgs(msg.args as Record<string, unknown>)
|
||||
: null;
|
||||
if (!candidate) return;
|
||||
if (!this.remoteDescriptionSet) {
|
||||
// TS6 starts trickling immediately, so these routinely beat the
|
||||
// offer's setRemoteDescription. Holding them is not an edge case.
|
||||
this.pendingRemoteCandidates.push(candidate);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await this.ensurePeerConnection().addIceCandidate(candidate);
|
||||
} catch (err) {
|
||||
// A single unusable candidate must not tear the session down; ICE
|
||||
// only needs one working pair.
|
||||
console.warn("[stream] ignoring ICE candidate:", describe(err));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "offer":
|
||||
case "reconnectOffer": {
|
||||
// Renegotiation from the publisher, e.g. after it switches source.
|
||||
// `offer` mirrors the `answer` key we send; the other two are cheap
|
||||
// to tolerate and cost nothing if they never arrive.
|
||||
const a = msg.args as Record<string, unknown> | string | null;
|
||||
const sdp =
|
||||
typeof a === "string"
|
||||
? a
|
||||
: typeof a?.offer === "string"
|
||||
? a.offer
|
||||
: typeof a?.sdp === "string"
|
||||
? a.sdp
|
||||
: null;
|
||||
if (sdp) await this.acceptOffer(sdp);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private async flushRemoteCandidates(): Promise<void> {
|
||||
const pending = this.pendingRemoteCandidates;
|
||||
this.pendingRemoteCandidates = [];
|
||||
const pc = this.ensurePeerConnection();
|
||||
for (const candidate of pending) {
|
||||
try {
|
||||
await pc.addIceCandidate(candidate);
|
||||
} catch (err) {
|
||||
console.warn("[stream] ignoring buffered ICE candidate:", describe(err));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ensurePeerConnection(): RTCPeerConnection {
|
||||
if (this.pc) return this.pc;
|
||||
|
||||
const pc = new RTCPeerConnection({
|
||||
iceServers: this.opts.iceServers ?? DEFAULT_ICE_SERVERS,
|
||||
});
|
||||
|
||||
pc.ontrack = (ev) => {
|
||||
this.remote.addTrack(ev.track);
|
||||
this.opts.onTrack(this.remote);
|
||||
};
|
||||
|
||||
pc.onicecandidate = (ev) => {
|
||||
if (!ev.candidate) return; // end-of-candidates; TS6 sends no such marker
|
||||
this.signal("iceCandidate", {
|
||||
sdp: ev.candidate.candidate,
|
||||
mid: ev.candidate.sdpMid ?? "0",
|
||||
mLine: ev.candidate.sdpMLineIndex ?? 0,
|
||||
});
|
||||
};
|
||||
|
||||
pc.onconnectionstatechange = () => {
|
||||
this.opts.onStateChange?.(pc.connectionState);
|
||||
if (pc.connectionState === "failed") this.fail("The stream connection failed");
|
||||
};
|
||||
|
||||
this.pc = pc;
|
||||
return pc;
|
||||
}
|
||||
|
||||
private signal(cmd: string, args: unknown): void {
|
||||
this.opts.send({
|
||||
type: "streamSignal",
|
||||
streamId: this.streamId,
|
||||
clientId: this.peerClientId,
|
||||
payload: { cmd, args },
|
||||
});
|
||||
}
|
||||
|
||||
private fail(message: string): void {
|
||||
this.opts.onError?.(message);
|
||||
}
|
||||
|
||||
/** Leaves the stream and releases the peer connection. Safe to call twice. */
|
||||
close(): void {
|
||||
if (this.closed) return;
|
||||
this.closed = true;
|
||||
|
||||
this.opts.send({
|
||||
type: "leaveStream",
|
||||
streamId: this.streamId,
|
||||
clientId: this.peerClientId,
|
||||
});
|
||||
|
||||
for (const track of this.remote.getTracks()) track.stop();
|
||||
this.pc?.close();
|
||||
this.pc = null;
|
||||
this.opts.onClosed?.();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds an `RTCIceCandidateInit` from TS6's `iceCandidate` args.
|
||||
*
|
||||
* TS6 names them `sdp`, `mid` and `mLine`, which map to `candidate`, `sdpMid`
|
||||
* and `sdpMLineIndex`.
|
||||
*/
|
||||
function candidateFromArgs(args: Record<string, unknown>): RTCIceCandidateInit | null {
|
||||
const candidate = args.sdp;
|
||||
if (typeof candidate !== "string" || !candidate) return null;
|
||||
return {
|
||||
candidate,
|
||||
sdpMid: typeof args.mid === "string" ? args.mid : undefined,
|
||||
sdpMLineIndex: typeof args.mLine === "number" ? args.mLine : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
function describe(err: unknown): string {
|
||||
return err instanceof Error ? err.message : String(err);
|
||||
}
|
||||
@@ -652,6 +652,13 @@
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-greenteaspeak .ts-channel-row.ts-drop-target,
|
||||
.ts-app.ts-design-greenteaspeak .ts-channel-row.ts-spacer.ts-drop-target {
|
||||
background: color-mix(in srgb, var(--accent, #4caf50) 28%, transparent);
|
||||
outline: 1px dashed var(--accent, #4caf50);
|
||||
outline-offset: -1px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-greenteaspeak .ts-channel-row.ts-spacer .ts-spacer-label {
|
||||
left: 4px;
|
||||
right: 4px;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { useT } from "../../i18n";
|
||||
|
||||
export type ConnectionTabItem = {
|
||||
id: string;
|
||||
@@ -39,11 +40,12 @@ export function GreenteaSpeakChrome({
|
||||
: []);
|
||||
|
||||
const hasTabs = resolvedTabs.length > 0;
|
||||
const t = useT();
|
||||
|
||||
return (
|
||||
<>
|
||||
{hasTabs ? (
|
||||
<div className="gts-connection-tabs" role="tablist" aria-label="Server-Verbindungen">
|
||||
<div className="gts-connection-tabs" role="tablist" aria-label={t("tabs.connections")}>
|
||||
{resolvedTabs.map((tab) => {
|
||||
const isActive = tab.id === (activeTabId ?? resolvedTabs[0]?.id);
|
||||
return (
|
||||
@@ -62,8 +64,8 @@ export function GreenteaSpeakChrome({
|
||||
<button
|
||||
type="button"
|
||||
className="gts-connection-tab-close"
|
||||
title="Verbindung trennen"
|
||||
aria-label={`Tab schließen: ${tab.label}`}
|
||||
title={t("tabs.disconnect")}
|
||||
aria-label={t("tabs.closeTab", { label: tab.label })}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onCloseTab(tab.id);
|
||||
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
/// <reference types="vite/client" />
|
||||
/// <reference types="vite-plugin-pwa/client" />
|
||||
/// <reference types="vite-plugin-pwa/react" />
|
||||
|
||||
/** Injected by vite.config.ts; matches the `buildId` in version.json. */
|
||||
declare const __BUILD_ID__: string
|
||||
+66
-7
@@ -4,6 +4,8 @@
|
||||
// microphone -> server direction (which it Opus-encodes), stereo mixed
|
||||
// for the server -> speakers direction (already decoded/mixed for us).
|
||||
|
||||
import type { Aec3Instance } from "./aec3";
|
||||
|
||||
export const SAMPLE_RATE = 48000;
|
||||
export const FRAME_SAMPLES = 960; // 20ms @ 48kHz
|
||||
|
||||
@@ -41,6 +43,10 @@ export interface MicCaptureOptions {
|
||||
* browser's own AEC runs can bring back audible echo residue in speaker+mic
|
||||
* (no headset) setups - some users get a cleaner result with it off. */
|
||||
autoGainControl?: boolean;
|
||||
/** When set, mic audio is run through this AEC3 instance (opts:
|
||||
* captureNumChannels=1) before VAD/encoding, in place of relying solely on
|
||||
* the browser's native echoCancellation. */
|
||||
aec3?: Aec3Instance;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,6 +73,8 @@ export class MicCapture {
|
||||
private echoCancellation: boolean;
|
||||
private noiseSuppression: boolean;
|
||||
private autoGainControl: boolean;
|
||||
private aec3?: Aec3Instance;
|
||||
private aec3Out: Float32Array[] | null = null;
|
||||
private context: AudioContext;
|
||||
threshold: number;
|
||||
hangoverSeconds: number;
|
||||
@@ -82,6 +90,7 @@ export class MicCapture {
|
||||
this.echoCancellation = options.echoCancellation ?? true;
|
||||
this.noiseSuppression = options.noiseSuppression ?? true;
|
||||
this.autoGainControl = options.autoGainControl ?? true;
|
||||
this.aec3 = options.aec3;
|
||||
}
|
||||
|
||||
async start(): Promise<void> {
|
||||
@@ -110,7 +119,20 @@ export class MicCapture {
|
||||
this.source = this.context.createMediaStreamSource(this.stream);
|
||||
this.processor = this.context.createScriptProcessor(2048, 1, 1);
|
||||
this.processor.onaudioprocess = (event) => {
|
||||
const input = event.inputBuffer.getChannelData(0);
|
||||
const raw = event.inputBuffer.getChannelData(0);
|
||||
let input: Float32Array = raw;
|
||||
if (this.aec3) {
|
||||
const captureIn = [raw];
|
||||
const outSize = this.aec3.processSize(captureIn);
|
||||
if (!this.aec3Out || this.aec3Out[0].length !== outSize) this.aec3Out = [new Float32Array(outSize)];
|
||||
this.aec3.process(this.aec3Out, captureIn);
|
||||
input = this.aec3Out[0];
|
||||
}
|
||||
// Mirrors the (possibly AEC3-cancelled) signal to the output buffer, so
|
||||
// setMonitoring() below can tap what's actually being sent rather than
|
||||
// the raw pre-cancellation mic feed - a self-test through the raw feed
|
||||
// always howls, whether or not AEC3 is on.
|
||||
event.outputBuffer.getChannelData(0).set(input);
|
||||
|
||||
let sumSquares = 0;
|
||||
for (let i = 0; i < input.length; i++) sumSquares += input[i] * input[i];
|
||||
@@ -153,21 +175,25 @@ export class MicCapture {
|
||||
return this.source;
|
||||
}
|
||||
|
||||
/** Routes the raw mic signal to `destination` too, so you can hear yourself (a mic test), until disabled again. */
|
||||
/** Routes the (possibly AEC3-cancelled) mic signal to `destination` too, so
|
||||
* you can hear yourself - a mic test - until disabled again. Taps the
|
||||
* processor's output rather than the raw source, so the test actually
|
||||
* reflects AEC3 when it's on, instead of always howling via the
|
||||
* uncancelled raw feed. */
|
||||
setMonitoring(enabled: boolean, destination: AudioNode): void {
|
||||
if (!this.source) return;
|
||||
if (!this.processor) return;
|
||||
if (enabled && this.monitorTarget !== destination) {
|
||||
if (this.monitorTarget) this.source.disconnect(this.monitorTarget);
|
||||
this.source.connect(destination);
|
||||
if (this.monitorTarget) this.processor.disconnect(this.monitorTarget);
|
||||
this.processor.connect(destination);
|
||||
this.monitorTarget = destination;
|
||||
} else if (!enabled && this.monitorTarget) {
|
||||
this.source.disconnect(this.monitorTarget);
|
||||
this.processor.disconnect(this.monitorTarget);
|
||||
this.monitorTarget = null;
|
||||
}
|
||||
}
|
||||
|
||||
stop(): void {
|
||||
if (this.source && this.monitorTarget) this.source.disconnect(this.monitorTarget);
|
||||
if (this.processor && this.monitorTarget) this.processor.disconnect(this.monitorTarget);
|
||||
this.monitorTarget = null;
|
||||
this.processor?.disconnect();
|
||||
this.silence?.disconnect();
|
||||
@@ -280,6 +306,8 @@ export class AudioPlayer {
|
||||
private element: SinkableElement;
|
||||
private gain: GainNode;
|
||||
private context: AudioContext;
|
||||
private aecTap: ScriptProcessorNode | null = null;
|
||||
private aecSink: GainNode | null = null;
|
||||
|
||||
constructor(context: AudioContext) {
|
||||
this.context = context;
|
||||
@@ -352,6 +380,36 @@ export class AudioPlayer {
|
||||
};
|
||||
}
|
||||
|
||||
/** Feeds everything played back through this player into `aec3.analyze()` as
|
||||
* the far-end/render reference, so a paired `MicCapture`'s aec3 `process()`
|
||||
* calls can cancel it back out of the mic signal. Taps post-gain: what's
|
||||
* actually reaching the speakers is what needs cancelling, not the
|
||||
* pre-volume mix. */
|
||||
attachAecRenderTap(aec3: Pick<Aec3Instance, "analyze">): void {
|
||||
this.detachAecRenderTap();
|
||||
const tap = this.context.createScriptProcessor(2048, 2, 2);
|
||||
tap.onaudioprocess = (e) => {
|
||||
aec3.analyze([e.inputBuffer.getChannelData(0), e.inputBuffer.getChannelData(1)]);
|
||||
};
|
||||
const sink = this.context.createGain();
|
||||
sink.gain.value = 0;
|
||||
this.gain.connect(tap);
|
||||
tap.connect(sink);
|
||||
sink.connect(this.context.destination);
|
||||
this.aecTap = tap;
|
||||
this.aecSink = sink;
|
||||
}
|
||||
|
||||
detachAecRenderTap(): void {
|
||||
if (this.aecTap) {
|
||||
this.gain.disconnect(this.aecTap);
|
||||
this.aecTap.disconnect();
|
||||
this.aecTap = null;
|
||||
}
|
||||
this.aecSink?.disconnect();
|
||||
this.aecSink = null;
|
||||
}
|
||||
|
||||
/** Routes playback to a specific device (empty string = system default). */
|
||||
async setOutputDevice(deviceId: string): Promise<void> {
|
||||
if (typeof this.element.setSinkId === "function") {
|
||||
@@ -366,6 +424,7 @@ export class AudioPlayer {
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.detachAecRenderTap();
|
||||
this.element.pause();
|
||||
this.element.srcObject = null;
|
||||
this.element.remove();
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"types": ["vite/client"],
|
||||
"allowArbitraryExtensions": true,
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
|
||||
+96
-2
@@ -1,9 +1,103 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import { execSync } from 'node:child_process'
|
||||
import { defineConfig, type Plugin } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
|
||||
// Identifies the build a bundle came from. Only has to differ between two
|
||||
// builds — the client compares its own baked-in value against version.json to
|
||||
// notice when it is running something the server no longer serves.
|
||||
function resolveBuildId(): string {
|
||||
const fromCi = process.env.CF_PAGES_COMMIT_SHA || process.env.GITHUB_SHA
|
||||
if (fromCi) return fromCi.slice(0, 12)
|
||||
try {
|
||||
return execSync('git rev-parse --short=12 HEAD', { stdio: ['ignore', 'pipe', 'ignore'] })
|
||||
.toString()
|
||||
.trim()
|
||||
} catch {
|
||||
// No git checkout (the Docker build copies sources in without .git).
|
||||
return String(Date.now())
|
||||
}
|
||||
}
|
||||
|
||||
const buildId = resolveBuildId()
|
||||
|
||||
// version.json must never be precached, or a stuck client would ask the very
|
||||
// cache it is stuck in what the server has. `.json` is not in globPatterns
|
||||
// below, so Workbox leaves it alone and the fetch always hits the network.
|
||||
function versionManifest(): Plugin {
|
||||
return {
|
||||
name: 'webspeak3-version-manifest',
|
||||
apply: 'build',
|
||||
generateBundle() {
|
||||
this.emitFile({
|
||||
type: 'asset',
|
||||
fileName: 'version.json',
|
||||
source: `${JSON.stringify({ buildId })}\n`,
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
define: {
|
||||
__BUILD_ID__: JSON.stringify(buildId),
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
versionManifest(),
|
||||
VitePWA({
|
||||
// The generated worker takes over as soon as it has installed
|
||||
// (skipWaiting + clientsClaim). It must NOT wait for the page to ask it
|
||||
// to: between 2026-09-07 and 2026-09-10 this was `prompt`, and every
|
||||
// client cached in that window froze — the new worker sat in `waiting`
|
||||
// forever because the only code that could have released it (the update
|
||||
// toast) lived in the version behind that worker. Deciding *when* to
|
||||
// reload is a UI concern and stays one: `onNeedReload` in App.tsx shows
|
||||
// the toast instead of pulling the page out from under an active
|
||||
// connection.
|
||||
registerType: 'autoUpdate',
|
||||
// We register from inside the app (virtual:pwa-register/react) rather
|
||||
// than through an injected registerSW.js, because that script would
|
||||
// reload the page on its own the moment a new worker activates.
|
||||
injectRegister: false,
|
||||
// Dev-time Workbox would sit in front of Vite's own HMR/WS traffic and
|
||||
// stale-cache the app shell while iterating — only ever ship the SW in
|
||||
// production builds.
|
||||
devOptions: { enabled: false },
|
||||
includeAssets: ['favicon.ico', 'apple-touch-icon.png'],
|
||||
manifest: {
|
||||
name: 'WebSpeak3',
|
||||
short_name: 'WebSpeak3',
|
||||
description: 'An independent, self-hosted web client for TeamSpeak 3 servers.',
|
||||
theme_color: '#03060d',
|
||||
background_color: '#03060d',
|
||||
display: 'standalone',
|
||||
start_url: '.',
|
||||
icons: [
|
||||
{ src: 'favicon-192.png', sizes: '192x192', type: 'image/png' },
|
||||
{ src: 'icon-512.png', sizes: '512x512', type: 'image/png' },
|
||||
{ src: 'icon-512-maskable.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
|
||||
],
|
||||
},
|
||||
workbox: {
|
||||
// Both are what `registerType: 'autoUpdate'` is supposed to imply, but
|
||||
// the plugin only sets them when it also injects registerSW.js (see
|
||||
// resolveOptions: `injectRegister === 'auto' || injectRegister == null`)
|
||||
// — with injectRegister: false they have to be spelled out, or the
|
||||
// generated worker is byte-identical to the `prompt` one and strands
|
||||
// clients all over again. Verified in dist/sw.js after building.
|
||||
skipWaiting: true,
|
||||
clientsClaim: true,
|
||||
// Precache the built app shell (JS/CSS/HTML/icons) only. The gateway's
|
||||
// /ws endpoint and any file-transfer/API traffic must never be
|
||||
// intercepted or cached — Workbox's default fetch handler already
|
||||
// ignores non-GET and non-http(s) requests (ws:// isn't touched), so
|
||||
// no extra runtimeCaching exclusions are needed here.
|
||||
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
|
||||
},
|
||||
}),
|
||||
],
|
||||
// Set by the GitHub Pages workflow to the repo subpath (e.g. /webspeak3/);
|
||||
// the normal Docker build serves from the domain root and leaves this unset.
|
||||
base: process.env.VITE_BASE_PATH || '/',
|
||||
|
||||
Reference in new issue
Block a user