mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 17:02:49 +08:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffb542d9bd | ||
|
|
e02a41d855 | ||
|
|
999262b6df | ||
|
|
9e61f21316 | ||
|
|
a720f72943 | ||
|
|
9a4639f76c | ||
|
|
bf6ab112ed |
No files matched your search
@@ -14,7 +14,7 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<b>A modern, self-hosted browser client for TeamSpeak, TeaSpeak, and GreenTeaSpeak servers — no install, just open a tab.</b>
|
||||
<b>A modern, self-hosted browser client for TeamSpeak, TeaSpeak, and VoySpeak servers — no install, just open a tab.</b>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
@@ -53,7 +53,7 @@ docker run -d --name webspeak3 --restart unless-stopped -p 8080:8080 moepchi/web
|
||||
```
|
||||
|
||||
Enter the address and port of **any reachable TeamSpeak 3, TeamSpeak 6,
|
||||
TeaSpeak, or GreenTeaSpeak server** in the connection dialog. The server does
|
||||
TeaSpeak, or VoySpeak 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
|
||||
@@ -63,7 +63,7 @@ not need to be installed on the same machine, modified, or operated by you.
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| 🔌 **Real TeamSpeak protocol** | Connects to actual TS3/TS6, TeaSpeak, and GreenTeaSpeak servers over a WebSocket gateway — the server stays exactly as-is |
|
||||
| 🔌 **Real TeamSpeak protocol** | Connects to actual TS3/TS6, TeaSpeak, and VoySpeak 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` |
|
||||
@@ -80,10 +80,10 @@ not need to be 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, Simplified Chinese, and Persian (Beta), detected automatically or switchable in Options |
|
||||
| 🌗 **Dark / light theme** | Clean, modern UI that adapts to your preference |
|
||||
| 🔁 **Multi-join (server tabs)** | Several 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 VoySpeak. Audio stays on the active tab |
|
||||
| 🔁 **Seamless reconnect** | Switch or add connections mid-session without tearing down unrelated tabs; dropped connections come back on their own, with the channel tree intact |
|
||||
| ⌨️ **Keyboard & screen readers** | Arrow keys through the channel tree (exposed as an ARIA tree) and through menus, Enter joins, context-menu key opens the menu; focus-trapped dialogs, labelled toolbar buttons |
|
||||
| 🍵 **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 |
|
||||
| 🍵 **VoySpeak support** | Connects to real VoySpeak servers (formerly GreenTeaSpeak), not just TS3/TS6/TeaSpeak |
|
||||
| 🖥️ **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
|
||||
@@ -108,19 +108,18 @@ 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/TeaSpeak/GreenTeaSpeak protocol--> Server
|
||||
Browser (web/) <--WebSocket--> Gateway (gateway/) <--stdin/stdout JSON--> Rust connector (connector/) <--TS3/TS6/TeaSpeak/VoySpeak protocol--> Server
|
||||
```
|
||||
|
||||
- **`web/`** — Vite + React frontend. TS3-lookalike UI: channel tree, chat
|
||||
tabs, voice controls. Optional GreenTeaSpeak-styled chrome for the
|
||||
connection-tab strip and menu bar.
|
||||
tabs, voice controls.
|
||||
- **`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/`, currently tracking a fork
|
||||
with TeaSpeak/GreenTeaSpeak protocol support), the actual TS3/TS6/TeaSpeak
|
||||
with TeaSpeak/VoySpeak protocol support), the actual TS3/TS6/TeaSpeak
|
||||
protocol implementation. Handles connecting, channel/client state, chat,
|
||||
and Opus-encoded voice. Auto-detects the server dialect on connect (or it
|
||||
can be forced via `--server-type`).
|
||||
@@ -225,7 +224,7 @@ All optional; add them under `environment:` in your compose override next to `PO
|
||||
| `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`.** |
|
||||
| `TURN_URLS` | unset | Comma-separated TURN URLs (e.g. `turn:turn.example.com:3478`) offered to browsers for screen streams, for viewers or publishers behind NATs where direct P2P fails. Pair with `TURN_SECRET` (coturn's `use-auth-secret`; each browser gets its own credential valid for 24 h) or with static `TURN_USERNAME` / `TURN_CREDENTIAL`, which every visitor can read. |
|
||||
| `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. |
|
||||
| `MAX_CONNECTIONS_PER_IP` / `MAX_CONNECTIONS` | `10` / `60` | Concurrent `/ws` connections per client IP and in total (each can hold a live TeamSpeak session). `0` disables a limit. |
|
||||
| `CONNECT_RATE_LIMIT` | `30` | Server connects per client IP per minute. Each one starts a new TeamSpeak session, so this stops anyone from flooding a server through your gateway. `0` disables it. |
|
||||
| `TRUST_PROXY` | off | Only when the gateway is reachable **solely** through a proxy/tunnel, so per-IP limits see the real client instead of the proxy: `cloudflare` (Cloudflare Tunnel or proxy) uses `CF-Connecting-IP`; `1` (your own nginx/Caddy/Traefik) uses the last `X-Forwarded-For` entry, the one your proxy appended. Don't set it on a directly exposed gateway - clients could then fake their IP. |
|
||||
| `TELEMETRY` | on | Set to `0` to turn off the anonymous usage ping (see below). |
|
||||
@@ -399,8 +398,8 @@ any way officially connected with TeamSpeak Systems GmbH.
|
||||
|
||||
"TeamSpeak", "TS3", and related logos or names are registered trademarks of
|
||||
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/
|
||||
associated with, authorized by, or endorsed by TeaSpeak or VoySpeak (formerly GreenTeaSpeak);
|
||||
"TeaSpeak" and "VoySpeak" 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.
|
||||
@@ -872,7 +872,7 @@ async fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
/// GreenTeaSpeak servers report versions like `2.5.1 [Build: …]`.
|
||||
/// VoySpeak (formerly GreenTeaSpeak) servers report versions like `2.5.1 [Build: …]`.
|
||||
/// Classic TeaSpeak reports `TeaSpeak 1.4.21-beta [Build: …]` — not a GTS host.
|
||||
/// Classic TeamSpeak 3 reports `3.13.8 [Build: …]` — must not use GTS labels.
|
||||
fn is_greenteaspeak_server_version(version: &str) -> bool {
|
||||
@@ -902,12 +902,12 @@ fn format_server_license(license: LicenseType, version: &str) -> String {
|
||||
return match license {
|
||||
LicenseType::Offline => "Private".into(),
|
||||
LicenseType::Sdk => "Premium".into(),
|
||||
LicenseType::SdkOffline => "Authorized GreenTeaSpeak Host Provider".into(),
|
||||
LicenseType::SdkOffline => "Authorized VoySpeak Host Provider".into(),
|
||||
_ => "Keine Lizenz".into(),
|
||||
};
|
||||
}
|
||||
if version.trim().to_ascii_lowercase().starts_with("teaspeak") {
|
||||
return "Kein GreenTeaSpeak-Server".into();
|
||||
return "Kein VoySpeak-Server".into();
|
||||
}
|
||||
match license {
|
||||
LicenseType::NoLicense => "No License".into(),
|
||||
@@ -936,8 +936,8 @@ fn friendly_connect_error(address: &str, e: tsclientlib::Error) -> anyhow::Error
|
||||
{
|
||||
return anyhow::anyhow!(
|
||||
"Could not connect to \"{address}\": this server rejects this client type (error 533). \
|
||||
GreenTeaSpeak public servers often only allow the official GreenTeaSpeak desktop client. \
|
||||
Try a self-hosted TeaSpeak with TeamSpeak-compat enabled, or use GreenTeaSpeak 2 for ts.greenteaspeak.de."
|
||||
VoySpeak (formerly GreenTeaSpeak) public servers often only allow the official VoySpeak desktop client. \
|
||||
Try a self-hosted TeaSpeak with TeamSpeak-compat enabled, or use the VoySpeak desktop client."
|
||||
);
|
||||
}
|
||||
if raw.contains("BlockedTarget") {
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
# TeaSpeak / GreenTeaSpeak support (WebSpeak3)
|
||||
# TeaSpeak / VoySpeak (formerly GreenTeaSpeak) support (WebSpeak3)
|
||||
|
||||
WebSpeak3 can speak the TeamSpeak 3/6 protocol via `ts-connector` / `tsclientlib`.
|
||||
TeaSpeak / GreenTeaSpeak servers need an extra identity handshake before `clientinit`.
|
||||
@@ -12,7 +12,6 @@ TeaSpeak / GreenTeaSpeak servers need an extra identity handshake before `client
|
||||
answers that way — required for GreenTeaSpeak hubs that disable TeamSpeak clients
|
||||
- TEAMSPEAK identity handshake after crypto when needed
|
||||
- DNS SRV `_gts._udp` in addition to `_ts3._udp`
|
||||
- Design theme **GreenTeaSpeak** (third UI style)
|
||||
|
||||
Verified against `ts.greenteaspeak.de` (Official GreenTeaSpeak Public Server).
|
||||
|
||||
|
||||
+10
-4
@@ -93,7 +93,9 @@ const ALLOWED_ORIGINS = (process.env.ALLOWED_ORIGINS ?? "")
|
||||
// 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);
|
||||
// Measured 2026-10-25: ~8-9 % of a core per client listening to constant audio
|
||||
// (connector + node + cloudflared), ~10-15 MB RAM. 60 suits a 2-core VPS.
|
||||
const MAX_CONNECTIONS = Number(process.env.MAX_CONNECTIONS ?? 60);
|
||||
const connectionsPerIp = new Map<string, number>();
|
||||
// Every "connect" spawns a fresh connector, and a socket can send any number
|
||||
// of them - without this, 10 sockets were enough to join-flood a TS server
|
||||
@@ -570,9 +572,6 @@ const wss = new WebSocketServer({
|
||||
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");
|
||||
@@ -679,6 +678,13 @@ wss.on("connection", (socket: WebSocket, req: IncomingMessage) => {
|
||||
// multiple /ws connections in parallel (one per server tab).
|
||||
let connection: Ts3Connection | undefined;
|
||||
|
||||
// Full: accept and say so, since a browser can't read why an upgrade was refused.
|
||||
if (MAX_CONNECTIONS > 0 && wss.clients.size > MAX_CONNECTIONS) {
|
||||
socket.send(JSON.stringify({ type: "error", code: "gateway_full", message: "This gateway is full right now. Please try again in a few minutes." }));
|
||||
socket.close(1013, "Gateway is full");
|
||||
return;
|
||||
}
|
||||
|
||||
const ip = clientIp(req);
|
||||
connectionsPerIp.set(ip, (connectionsPerIp.get(ip) ?? 0) + 1);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ const STORE_SCREENSHOT_RE = /^data:image\/(png|jpe?g|webp);base64,[A-Za-z0-9+/]+
|
||||
// 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", "ide"]);
|
||||
const STORE_BASE_THEMES = new Set(["standard", "nova", "pulse", "ide"]);
|
||||
|
||||
// A handful of names (the operator's own) that only whoever holds
|
||||
// STORE_ADMIN_TOKEN may publish under - stops anyone else from impersonating
|
||||
|
||||
+73
-3
@@ -3007,6 +3007,13 @@
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* The unique ID is 28 base64 characters - don't cut it off. */
|
||||
input.ts-identities-uid {
|
||||
width: 36ch;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ts-identities-status {
|
||||
color: var(--text-muted);
|
||||
font-size: 11px;
|
||||
@@ -3603,9 +3610,6 @@
|
||||
box-shadow: inset 0 0 0 1px #7fb0e8;
|
||||
}
|
||||
|
||||
.ts-design-theme-swatch-greenteaspeak {
|
||||
background: linear-gradient(135deg, #1f2329 40%, #6fbf5c 40%, #386896 70%, #c8b882 70%);
|
||||
}
|
||||
.ts-design-theme-swatch-pulse {
|
||||
background: linear-gradient(135deg, oklch(0.22 0.02 285) 0%, oklch(0.15 0.03 290) 100%);
|
||||
box-shadow: inset 0 0 0 1px #9d8cf0;
|
||||
@@ -4929,3 +4933,69 @@
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Multi-join server tabs. No theme defines --bg-app/--bg-toolbar, so this
|
||||
strip is always dark: its text colors are fixed, not the theme's --text (which is dark
|
||||
in the light theme and made the active tab unreadable). */
|
||||
.ts-app .gts-connection-tabs {
|
||||
display: flex;
|
||||
gap: 1px;
|
||||
padding: 0 4px;
|
||||
background: var(--bg-app, #1a1a1a);
|
||||
border-bottom: 1px solid var(--border, #333);
|
||||
height: 24px;
|
||||
min-height: 24px;
|
||||
align-items: stretch;
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ts-app .gts-connection-tab {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
background: var(--bg-toolbar, #2a2a2a);
|
||||
border: 1px solid var(--border, #444);
|
||||
border-bottom: none;
|
||||
color: #aaa;
|
||||
padding: 0 4px 0 10px;
|
||||
max-width: 280px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.ts-app .gts-connection-tab-active {
|
||||
background: var(--bg-panel, #333);
|
||||
color: #eee;
|
||||
border-color: #b0b8c0;
|
||||
}
|
||||
|
||||
.ts-app .gts-connection-tab-label {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.ts-app .gts-connection-tab-close {
|
||||
flex-shrink: 0;
|
||||
text-align: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: inherit;
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.ts-app .gts-connection-tab-close:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
+58
-37
@@ -9,6 +9,7 @@ import {
|
||||
useSyncExternalStore,
|
||||
type ReactNode,
|
||||
} from "react";
|
||||
import { identityUid } from "./identityUid";
|
||||
import qrcode from "qrcode-generator";
|
||||
import { useRegisterSW } from "virtual:pwa-register/react";
|
||||
import "./App.css";
|
||||
@@ -231,10 +232,8 @@ import {
|
||||
type ChatSettings,
|
||||
} from "./chatlog";
|
||||
import {
|
||||
GREENTEASPEAK_THEME_ID,
|
||||
GreenteaSpeakChrome,
|
||||
isGreenteaSpeakTheme,
|
||||
} from "./themes/greenteaspeak";
|
||||
ConnectionTabs,
|
||||
} from "./ConnectionTabs";
|
||||
import { BARE_URL_REGEX, renderBbcode, wrapUrls } from "./lib/bbcode";
|
||||
import { parseChannelName, spacerDisplayName } from "./lib/spacer";
|
||||
import akimoPhoto from "./assets/akimo.jpg";
|
||||
@@ -497,18 +496,18 @@ const CONTINUOUS_KEY = "webspeak3:continuous-transmission";
|
||||
const TYPING_ATTENUATION_KEY = "webspeak3:typing-attenuation";
|
||||
const PTT_BINDING_KEY = "webspeak3:ptt-key";
|
||||
const DESIGN_THEME_KEY = "webspeak3:design-theme";
|
||||
// The user's actual pick - "standard" | "nova" | "greenteaspeak" | "custom:<id>".
|
||||
// The user's actual pick - "standard" | "nova" | "pulse" | "ide" | "custom:<id>".
|
||||
// DESIGN_THEME_KEY above keeps tracking just the resolved structural base, since a
|
||||
// couple of early call sites (e.g. the host-field default below) need that cheaply,
|
||||
// before customThemes is loaded.
|
||||
const DESIGN_SELECTION_KEY = "webspeak3:design-selection";
|
||||
const CUSTOM_THEMES_KEY = "webspeak3:custom-themes";
|
||||
|
||||
type DesignTheme = "standard" | "nova" | "greenteaspeak" | "pulse" | "ide";
|
||||
type DesignTheme = "standard" | "nova" | "pulse" | "ide";
|
||||
|
||||
/** A user-authored theme package: a name, which built-in layout it behaves like
|
||||
* (Standard's plain chrome, Nova's collapsed menu/splash, GreenTeaSpeak shell,
|
||||
* or Pulse's card/sidebar layout), and raw CSS that gets injected while it's
|
||||
* (Standard's plain chrome, Nova's collapsed menu/splash, Pulse's card/sidebar
|
||||
* layout or IDE), and raw CSS that gets injected while it's
|
||||
* active - free-form, so it can restyle or even reflow the existing markup
|
||||
* (e.g. via flex `order`, `display:none`, overlays). */
|
||||
type CustomTheme = {
|
||||
@@ -545,7 +544,7 @@ const STORE_SCREENSHOT_MAX_DATA_URL_LENGTH = 400_000;
|
||||
|
||||
function isDesignTheme(value: string): value is DesignTheme {
|
||||
return (
|
||||
value === "standard" || value === "nova" || value === "greenteaspeak" || value === "pulse" || value === "ide"
|
||||
value === "standard" || value === "nova" || value === "pulse" || value === "ide"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -557,7 +556,9 @@ function loadDesignTheme(): DesignTheme {
|
||||
|
||||
function resolveDesignThemeBase(selection: string, customThemes: CustomTheme[]): DesignTheme {
|
||||
if (selection.startsWith("custom:")) {
|
||||
return customThemes.find((th) => `custom:${th.id}` === selection)?.baseTheme ?? "standard";
|
||||
// A removed base (e.g. the old GreenTeaSpeak theme) falls back to Standard.
|
||||
const base = customThemes.find((th) => `custom:${th.id}` === selection)?.baseTheme;
|
||||
return base && isDesignTheme(base) ? base : "standard";
|
||||
}
|
||||
return isDesignTheme(selection) ? selection : "standard";
|
||||
}
|
||||
@@ -566,13 +567,11 @@ function designThemeClassName(theme: DesignTheme): string {
|
||||
if (theme === "nova") return " ts-design-nova";
|
||||
if (theme === "pulse") return " ts-design-pulse";
|
||||
if (theme === "ide") return " ts-design-ide";
|
||||
if (isGreenteaSpeakTheme(theme)) return " ts-design-greenteaspeak";
|
||||
return "";
|
||||
}
|
||||
|
||||
function designThemeLabel(theme: DesignTheme, t: (key: string) => string): string {
|
||||
if (theme === "nova") return t("design.theme.nova");
|
||||
if (theme === "greenteaspeak") return t("design.theme.greenteaspeak");
|
||||
if (theme === "pulse") return t("design.theme.pulse");
|
||||
if (theme === "ide") return t("design.theme.ide");
|
||||
return t("design.theme.standard");
|
||||
@@ -602,7 +601,9 @@ function saveCustomThemes(list: CustomTheme[]) {
|
||||
}
|
||||
|
||||
function loadDesignSelection(): string {
|
||||
return localStorage.getItem(DESIGN_SELECTION_KEY) ?? loadDesignTheme();
|
||||
const raw = localStorage.getItem(DESIGN_SELECTION_KEY);
|
||||
// A removed builtin (e.g. "greenteaspeak") falls back to Standard.
|
||||
return raw && (raw.startsWith("custom:") || isDesignTheme(raw)) ? raw : loadDesignTheme();
|
||||
}
|
||||
|
||||
function loadBoolPref(key: string, fallback: boolean): boolean {
|
||||
@@ -3027,6 +3028,9 @@ type NewsItem =
|
||||
|
||||
const NEWS_DISMISSED_STORAGE_KEY = "webspeak3.newsTicker.dismissed";
|
||||
|
||||
/** Hash links that open a dialog in this client (#about, #options/<section>). */
|
||||
const isInAppHash = (hash: string) => hash === "#about" || OPTIONS_SECTIONS.some((s) => hash === `#options/${s.id}`);
|
||||
|
||||
// Like the scrolling news line at the bottom of the native TS3 client.
|
||||
// Dismissing hides the current set of items until a new one shows up.
|
||||
function NewsTicker() {
|
||||
@@ -3073,9 +3077,13 @@ function NewsTicker() {
|
||||
: item.text;
|
||||
const entries = items.map((item) => {
|
||||
const url = item.kind === "theme" ? undefined : item.url;
|
||||
// https://…/#options/konto or #about: open the dialog here instead of a new tab.
|
||||
const inApp = url && isInAppHash(new URL(url).hash);
|
||||
return (
|
||||
<span key={item.id} className="ts-news-item">
|
||||
{url ? (
|
||||
{inApp ? (
|
||||
<a href={new URL(url).hash}>{label(item)}</a>
|
||||
) : url ? (
|
||||
<a href={url} target="_blank" rel="noopener noreferrer">
|
||||
{label(item)}
|
||||
</a>
|
||||
@@ -5596,6 +5604,15 @@ function IdentitiesDialog({
|
||||
const importInputRef = useRef<HTMLInputElement>(null);
|
||||
const [selectedId, setSelectedId] = useState(activeId ?? identities[0]?.id ?? null);
|
||||
const selected = identities.find((i) => i.id === selectedId) ?? identities[0] ?? null;
|
||||
const [computedUid, setComputedUid] = useState<string | null>(null);
|
||||
useEffect(() => {
|
||||
let current = true;
|
||||
setComputedUid(null);
|
||||
if (selected?.blob) void identityUid(selected.blob).then((uid) => current && setComputedUid(uid));
|
||||
return () => {
|
||||
current = false;
|
||||
};
|
||||
}, [selected?.blob]);
|
||||
|
||||
return (
|
||||
<div className="ts-dialog-backdrop" {...backdrop}>
|
||||
@@ -5651,8 +5668,8 @@ function IdentitiesDialog({
|
||||
{t("identities.uniqueId")}
|
||||
<input
|
||||
readOnly
|
||||
value={selected.id === activeId && ownUid ? ownUid : t("identities.unknown")}
|
||||
className="ts-identities-readonly"
|
||||
value={computedUid || (selected.id === activeId && ownUid) || t("identities.unknown")}
|
||||
className="ts-identities-readonly ts-identities-uid"
|
||||
/>
|
||||
</label>
|
||||
<div className="ts-identities-status">
|
||||
@@ -7450,11 +7467,6 @@ function DesignPanel({
|
||||
const builtins: { id: DesignTheme; name: string; desc: string }[] = [
|
||||
{ id: "standard", name: t("design.theme.standard"), desc: t("design.theme.standard.desc") },
|
||||
{ id: "nova", name: t("design.theme.nova"), desc: t("design.theme.nova.desc") },
|
||||
{
|
||||
id: GREENTEASPEAK_THEME_ID,
|
||||
name: t("design.theme.greenteaspeak"),
|
||||
desc: t("design.theme.greenteaspeak.desc"),
|
||||
},
|
||||
{ id: "pulse", name: t("design.theme.pulse"), desc: t("design.theme.pulse.desc") },
|
||||
{ id: "ide", name: t("design.theme.ide"), desc: t("design.theme.ide.desc") },
|
||||
];
|
||||
@@ -7545,7 +7557,6 @@ function DesignPanel({
|
||||
>
|
||||
<option value="standard">{t("design.theme.standard")}</option>
|
||||
<option value="nova">{t("design.theme.nova")}</option>
|
||||
<option value="greenteaspeak">{t("design.theme.greenteaspeak")}</option>
|
||||
<option value="pulse">{t("design.theme.pulse")}</option>
|
||||
<option value="ide">{t("design.theme.ide")}</option>
|
||||
</select>
|
||||
@@ -8903,7 +8914,7 @@ function AppInner() {
|
||||
? customThemes.find((th) => `custom:${th.id}` === designSelection) ?? null
|
||||
: null;
|
||||
// Structural base - everywhere else in the app that branches on "nova" /
|
||||
// "greenteaspeak" behavior keeps working unchanged, whether that behavior
|
||||
// "pulse" behavior keeps working unchanged, whether that behavior
|
||||
// came from picking the builtin directly or from a custom theme on top of it.
|
||||
const designTheme: DesignTheme = resolveDesignThemeBase(designSelection, customThemes);
|
||||
useEffect(() => setSoundStyle(designTheme === "ide" ? "ide" : "classic"), [designTheme]);
|
||||
@@ -9128,8 +9139,23 @@ function AppInner() {
|
||||
const entry: ClientLogEntry = { id: ++logIdRef.current, timestamp: Date.now(), category, level, message };
|
||||
setLogEntries((prev) => [...prev.slice(-(MAX_LOG_ENTRIES - 1)), entry]);
|
||||
};
|
||||
const [optionsDialogOpen, setOptionsDialogOpen] = useState(false);
|
||||
const [optionsSection, setOptionsSection] = useState<string>(OPTIONS_SECTIONS[0].id);
|
||||
// client.webspeak3.de/#options/konto opens Options on that section (shareable link, e.g. for the ticker).
|
||||
const linkedOptionsSection = OPTIONS_SECTIONS.find((s) => window.location.hash === `#options/${s.id}`)?.id;
|
||||
const [optionsDialogOpen, setOptionsDialogOpen] = useState(!!linkedOptionsSection);
|
||||
const [optionsSection, setOptionsSection] = useState<string>(linkedOptionsSection ?? OPTIONS_SECTIONS[0].id);
|
||||
useEffect(() => {
|
||||
const onHash = () => {
|
||||
const hash = window.location.hash;
|
||||
if (hash === "#about") setAboutOpen(true);
|
||||
const section = OPTIONS_SECTIONS.find((s) => hash === `#options/${s.id}`)?.id;
|
||||
if (section) {
|
||||
setOptionsSection(section);
|
||||
setOptionsDialogOpen(true);
|
||||
}
|
||||
};
|
||||
window.addEventListener("hashchange", onHash);
|
||||
return () => window.removeEventListener("hashchange", onHash);
|
||||
}, []);
|
||||
const socketRef = useRef<WebSocket | DemoSocket | null>(null);
|
||||
/** Multi-join: one gateway WebSocket (+ connector) per session tab. */
|
||||
const [sessionTabs, setSessionTabs] = useState<SessionTabInfo[]>([]);
|
||||
@@ -10230,7 +10256,7 @@ function AppInner() {
|
||||
appendLog({ text: data.message, kind: "error" });
|
||||
} else {
|
||||
setConnecting(false);
|
||||
setConnectError(data.message);
|
||||
setConnectError(data.code === "gateway_full" ? t("connectError.gatewayFull") : data.message);
|
||||
updateTabMeta(sessionId, { connecting: false, connected: false });
|
||||
}
|
||||
break;
|
||||
@@ -13118,14 +13144,6 @@ function AppInner() {
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{isGreenteaSpeakTheme(designTheme) && (
|
||||
<div className="gts-toolbar-brand" title="GreenTeaSpeak">
|
||||
<span className="gts-toolbar-brand-mark">GTS</span>
|
||||
<span className="gts-toolbar-brand-name">
|
||||
{connected ? serverName || host || "GreenTeaSpeak" : "GreenTeaSpeak"}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="ts-toolbar-icons">
|
||||
<div className="ts-toolbar-away" ref={awayMenuRef}>
|
||||
<button
|
||||
@@ -13364,8 +13382,8 @@ function AppInner() {
|
||||
|
||||
</div>
|
||||
|
||||
{sessionTabs.length > 0 || isGreenteaSpeakTheme(designTheme) ? (
|
||||
<GreenteaSpeakChrome
|
||||
{sessionTabs.length > 0 ? (
|
||||
<ConnectionTabs
|
||||
tabs={sessionTabs}
|
||||
activeTabId={activeSessionId}
|
||||
onSelectTab={switchToSession}
|
||||
@@ -13714,7 +13732,10 @@ function AppInner() {
|
||||
onClearCache={handleClearCache}
|
||||
section={optionsSection}
|
||||
onSectionChange={setOptionsSection}
|
||||
onClose={() => setOptionsDialogOpen(false)}
|
||||
onClose={() => {
|
||||
setOptionsDialogOpen(false);
|
||||
if (window.location.hash.startsWith("#options/")) window.history.replaceState(null, "", window.location.pathname + window.location.search);
|
||||
}}
|
||||
designSelection={designSelection}
|
||||
onDesignSelectionChange={handleDesignSelectionChange}
|
||||
customThemes={customThemes}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
import { useT } from "./i18n";
|
||||
|
||||
export type ConnectionTabItem = {
|
||||
id: string;
|
||||
label: string;
|
||||
connected?: boolean;
|
||||
connecting?: boolean;
|
||||
};
|
||||
|
||||
/** Server tab strip for multi-join: one tab per open connection. */
|
||||
export function ConnectionTabs({
|
||||
tabs,
|
||||
activeTabId,
|
||||
onSelectTab,
|
||||
onCloseTab,
|
||||
}: {
|
||||
tabs: ConnectionTabItem[];
|
||||
activeTabId?: string | null;
|
||||
onSelectTab?: (id: string) => void;
|
||||
onCloseTab?: (id: string) => void;
|
||||
}) {
|
||||
const t = useT();
|
||||
return (
|
||||
<div
|
||||
className="gts-connection-tabs"
|
||||
role="tablist"
|
||||
aria-label={t("tabs.connections")}
|
||||
>
|
||||
{tabs.map((tab) => {
|
||||
const isActive = tab.id === (activeTabId ?? tabs[0]?.id);
|
||||
return (
|
||||
<div
|
||||
key={tab.id}
|
||||
role="tab"
|
||||
aria-selected={isActive}
|
||||
className={`gts-connection-tab${isActive ? " gts-connection-tab-active" : ""}${
|
||||
tab.connecting ? " gts-connection-tab-connecting" : ""
|
||||
}`}
|
||||
onClick={() => onSelectTab?.(tab.id)}
|
||||
tabIndex={0}
|
||||
aria-keyshortcuts={onCloseTab ? "Delete" : undefined}
|
||||
onKeyDown={(e) => {
|
||||
if (e.target !== e.currentTarget) return;
|
||||
// The × below is mouse-only (a button can't sit inside a tab); Delete closes.
|
||||
if (e.key === "Delete" && onCloseTab) onCloseTab(tab.id);
|
||||
else if (e.key === "Enter" || e.key === " ")
|
||||
onSelectTab?.(tab.id);
|
||||
else return;
|
||||
e.preventDefault();
|
||||
}}
|
||||
title={tab.label}
|
||||
>
|
||||
<span className="gts-connection-tab-label">{tab.label}</span>
|
||||
{onCloseTab ? (
|
||||
<span
|
||||
className="gts-connection-tab-close"
|
||||
aria-hidden="true"
|
||||
title={t("tabs.disconnect")}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onCloseTab(tab.id);
|
||||
}}
|
||||
>
|
||||
×
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
// Computes a TeamSpeak client UID from a stored identity, so the Identitäten dialog
|
||||
// can show it without connecting. UID = base64(sha1(base64(tomcrypt public key DER))),
|
||||
// same as tsproto's EccKeyPubP256::get_uid. Accepts what an identity blob can be:
|
||||
// tsclientlib's JSON ({"key": base64 scalar}), a native "<counter>V<obfuscated>" string,
|
||||
// or a plain base64 tomcrypt key. Needs crypto.subtle, so null on plain-http origins.
|
||||
|
||||
const OBFUSCATION = new TextEncoder().encode(
|
||||
"b9dfaa7bee6ac57ac7b65f1094a1c155e747327bc2fe5d51c512023fe54a280201004e90ad1daaae1075d53b7d571c30e063b5a62a4a017bb394833aa0983e6e"
|
||||
);
|
||||
|
||||
const unb64 = (s: string) => Uint8Array.from(atob(s), (c) => c.charCodeAt(0));
|
||||
const b64 = (bytes: Uint8Array) => btoa(String.fromCharCode(...bytes));
|
||||
const sha1 = async (data: Uint8Array) => new Uint8Array(await crypto.subtle.digest("SHA-1", data as BufferSource));
|
||||
|
||||
/** One DER element at pos -> [tag, content, end]. */
|
||||
function derRead(buf: Uint8Array, pos: number): [number, Uint8Array, number] {
|
||||
let len = buf[pos + 1];
|
||||
let start = pos + 2;
|
||||
if (len & 0x80) {
|
||||
const n = len & 0x7f;
|
||||
len = 0;
|
||||
for (let i = 0; i < n; i++) len = (len << 8) | buf[start + i];
|
||||
start += n;
|
||||
}
|
||||
if (start + len > buf.length) throw new Error("bad der");
|
||||
return [buf[pos], buf.subarray(start, start + len), start + len];
|
||||
}
|
||||
|
||||
/** Top-level DER sequence -> its elements as [tag, content]. */
|
||||
function derSequence(der: Uint8Array): [number, Uint8Array][] {
|
||||
const [tag, body] = derRead(der, 0);
|
||||
if (tag !== 0x30) throw new Error("no sequence");
|
||||
const items: [number, Uint8Array][] = [];
|
||||
for (let pos = 0; pos < body.length; ) {
|
||||
const [t, content, end] = derRead(body, pos);
|
||||
items.push([t, content]);
|
||||
pos = end;
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
function derLength(n: number): number[] {
|
||||
return n < 0x80 ? [n] : [0x81, n];
|
||||
}
|
||||
|
||||
/** DER INTEGER content for an unsigned big-endian number. */
|
||||
function derUint(bytes: Uint8Array): Uint8Array {
|
||||
let i = 0;
|
||||
while (i < bytes.length - 1 && bytes[i] === 0) i++;
|
||||
const trimmed = bytes.subarray(i);
|
||||
return trimmed[0] & 0x80 ? Uint8Array.of(0, ...trimmed) : trimmed;
|
||||
}
|
||||
|
||||
async function uidFromPoint(x: Uint8Array, y: Uint8Array): Promise<string> {
|
||||
const parts = [
|
||||
[0x03, 0x02, 0x07, 0x00], // BIT STRING: 1 bit, 0 = public key only
|
||||
[0x02, 0x01, 0x20], // INTEGER 32
|
||||
[0x02, ...derLength(x.length), ...x],
|
||||
[0x02, ...derLength(y.length), ...y],
|
||||
].flat();
|
||||
const der = Uint8Array.of(0x30, ...derLength(parts.length), ...parts);
|
||||
return b64(await sha1(new TextEncoder().encode(b64(der))));
|
||||
}
|
||||
|
||||
/** Public point from a bare P-256 scalar, via a PKCS#8 import without public key. */
|
||||
async function uidFromScalar(scalar: Uint8Array): Promise<string> {
|
||||
const d = new Uint8Array(32);
|
||||
d.set(scalar.subarray(Math.max(0, scalar.length - 32)), 32 - Math.min(32, scalar.length));
|
||||
const pkcs8 = Uint8Array.of(
|
||||
...[0x30, 0x41, 0x02, 0x01, 0x00, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01],
|
||||
...[0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x04, 0x27, 0x30, 0x25, 0x02, 0x01, 0x01, 0x04, 0x20],
|
||||
...d
|
||||
);
|
||||
const key = await crypto.subtle.importKey("pkcs8", pkcs8, { name: "ECDSA", namedCurve: "P-256" }, true, ["sign"]);
|
||||
const jwk = await crypto.subtle.exportKey("jwk", key);
|
||||
const fromUrl = (s: string) => unb64(s.replace(/-/g, "+").replace(/_/g, "/").padEnd(Math.ceil(s.length / 4) * 4, "="));
|
||||
return uidFromPoint(derUint(fromUrl(jwk.x!)), derUint(fromUrl(jwk.y!)));
|
||||
}
|
||||
|
||||
/** tomcrypt private key DER (with or without the public point, like tsproto's from_tomcrypt). */
|
||||
async function uidFromTomcrypt(der: Uint8Array): Promise<string> {
|
||||
const items = derSequence(der);
|
||||
const [bitTag, bits] = items[0];
|
||||
if (bitTag !== 0x03) throw new Error("no bit string");
|
||||
// TS3AudioBot keys set two bits and leave out the public point.
|
||||
const withPoint = bits[0] === 0x07;
|
||||
if (withPoint) return uidFromPoint(items[2][1], items[3][1]);
|
||||
return uidFromScalar(items[2][1]);
|
||||
}
|
||||
|
||||
async function deobfuscate(data: Uint8Array): Promise<Uint8Array> {
|
||||
const out = data.slice();
|
||||
let end = out.indexOf(0, 20);
|
||||
if (end < 0) end = out.length;
|
||||
const hash = await sha1(out.subarray(20, end));
|
||||
for (let i = 0; i < 20; i++) out[i] ^= hash[i];
|
||||
for (let i = 0; i < Math.min(out.length, 100); i++) out[i] ^= OBFUSCATION[i];
|
||||
return out;
|
||||
}
|
||||
|
||||
export async function identityUid(blob: string): Promise<string | null> {
|
||||
if (!crypto.subtle) return null;
|
||||
try {
|
||||
const text = blob.trim().replace(/^"|"$/g, "");
|
||||
if (text.startsWith("{")) return await uidFromScalar(unb64(JSON.parse(text).key));
|
||||
const native = /^\d+V(.+)$/.exec(text);
|
||||
const tomcrypt = native ? atob(new TextDecoder().decode(await deobfuscate(unb64(native[1])))) : atob(text);
|
||||
return await uidFromTomcrypt(Uint8Array.from(tomcrypt, (c) => c.charCodeAt(0)));
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@
|
||||
"restartNotice.ack": "Rozumím",
|
||||
"menu.extras.tos": "Podmínky používání",
|
||||
"tos.title": "Podmínky používání pro client.webspeak3.de",
|
||||
"tos.rule1": "This client is for private, non-commercial use of TeamSpeak/TeaSpeak/GreenTeaSpeak servers via browser.",
|
||||
"tos.rule1": "This client is for private, non-commercial use of TeamSpeak/TeaSpeak/VoySpeak servers via browser.",
|
||||
"tos.rule2": "Prohibited in particular: any criminal activity, harassment and hate speech, spam and flooding, disrupting service, and circumventing bans.",
|
||||
"tos.rule3": "Violations may result in access being blocked without warning; serious cases may be reported to 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",
|
||||
@@ -298,8 +298,6 @@
|
||||
"design.theme.standard.desc": "Původní vzhled WebSpeak3.",
|
||||
"design.theme.nova": "Nova",
|
||||
"design.theme.nova.desc": "Modernější tmavý vzhled se zaoblenými prvky.",
|
||||
"design.theme.greenteaspeak": "GreenTeaSpeak",
|
||||
"design.theme.greenteaspeak.desc": "Klasické rozvržení klienta GreenTeaSpeak s tmavými panely a zlatou lištou nabídky.",
|
||||
"design.theme.pulse": "Pulse",
|
||||
"design.theme.pulse.desc": "Rozvržení založené na kartách s navigační lištou a barevným zvýrazněním.",
|
||||
"design.theme.ide": "Command Center",
|
||||
@@ -711,6 +709,7 @@
|
||||
"serverContext.addFavorite": "Přidat do oblíbených",
|
||||
"serverContext.disconnect": "Odpojit",
|
||||
"connectError.dismiss": "Zavřít",
|
||||
"connectError.gatewayFull": "Brána je právě plná. Zkus to za pár minut znovu – nebo si WebSpeak3 hostuj sám: github.com/WebSpeak3/webspeak3",
|
||||
"dialog.close": "Zavřít",
|
||||
"sounds.title": "Zvuky",
|
||||
"sounds.subtitle": "Nastavit zvuková upozornění na události",
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
"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.rule1": "Dieser Client dient der privaten, nicht-kommerziellen Nutzung von TeamSpeak-/TeaSpeak-/VoySpeak-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 ",
|
||||
@@ -298,8 +298,6 @@
|
||||
"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.theme.ide": "Command Center",
|
||||
@@ -711,6 +709,7 @@
|
||||
"serverContext.addFavorite": "Zu Favoriten hinzufügen",
|
||||
"serverContext.disconnect": "Verbindung trennen",
|
||||
"connectError.dismiss": "Schließen",
|
||||
"connectError.gatewayFull": "Das Gateway ist gerade voll. Versuch es in ein paar Minuten nochmal – oder hoste WebSpeak3 selbst: github.com/WebSpeak3/webspeak3",
|
||||
"dialog.close": "Schließen",
|
||||
"sounds.title": "Sounds",
|
||||
"sounds.subtitle": "Sound-Benachrichtigungen für Ereignisse festlegen",
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
"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.rule1": "This client is for private, non-commercial use of TeamSpeak/TeaSpeak/VoySpeak 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 ",
|
||||
@@ -298,8 +298,6 @@
|
||||
"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.theme.ide": "Command Center",
|
||||
@@ -711,6 +709,7 @@
|
||||
"serverContext.addFavorite": "Add to favorites",
|
||||
"serverContext.disconnect": "Disconnect",
|
||||
"connectError.dismiss": "Dismiss",
|
||||
"connectError.gatewayFull": "The gateway is full right now. Try again in a few minutes – or host WebSpeak3 yourself: github.com/WebSpeak3/webspeak3",
|
||||
"dialog.close": "Close",
|
||||
"sounds.title": "Sounds",
|
||||
"sounds.subtitle": "Configure sound notifications for events",
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
"restartNotice.ack": "متوجه شدم",
|
||||
"menu.extras.tos": "شرایط استفاده",
|
||||
"tos.title": "شرایط استفاده از client.webspeak3.de",
|
||||
"tos.rule1": "این کلاینت برای استفاده خصوصی و غیرتجاری از سرورهای TeamSpeak/TeaSpeak/GreenTeaSpeak از طریق مرورگر است.",
|
||||
"tos.rule1": "این کلاینت برای استفاده خصوصی و غیرتجاری از سرورهای TeamSpeak/TeaSpeak/VoySpeak از طریق مرورگر است.",
|
||||
"tos.rule2": "بهطور خاص ممنوع است: هرگونه فعالیت مجرمانه، آزار و سخنان نفرتپراکنانه، اسپم و سیل پیام، ایجاد اختلال در سرویس، و دور زدن مسدودیتها.",
|
||||
"tos.rule3": "تخلفات ممکن است بدون هشدار منجر به مسدود شدن دسترسی شوند؛ در موارد جدی، گزارش به مراجع ذیصلاح نیز ممکن است.",
|
||||
"tos.rule4Pre": "بهمنظور امنیت عملیاتی و شناسایی سوءاستفاده، اطلاعات اتصال (آدرس سرور، نام سرور، زمان اتصال) ثبت میشود و پس از ۹۰ روز بهصورت خودکار حذف میشود - برای جزئیات به ",
|
||||
@@ -298,8 +298,6 @@
|
||||
"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.theme.ide": "Command Center",
|
||||
@@ -710,6 +708,7 @@
|
||||
"serverContext.addFavorite": "افزودن به نشانکها",
|
||||
"serverContext.disconnect": "قطع اتصال",
|
||||
"connectError.dismiss": "رد کردن",
|
||||
"connectError.gatewayFull": "گیتوی در حال حاضر پر است. چند دقیقه دیگر دوباره امتحان کنید – یا WebSpeak3 را خودتان میزبانی کنید: github.com/WebSpeak3/webspeak3",
|
||||
"dialog.close": "بستن",
|
||||
"sounds.title": "صداها",
|
||||
"sounds.subtitle": "پیکربندی اعلانهای صوتی برای رویدادها",
|
||||
|
||||
@@ -237,8 +237,6 @@
|
||||
"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.theme.ide": "Command Center",
|
||||
@@ -556,6 +554,7 @@
|
||||
"serverContext.addFavorite": "添加到收藏夹",
|
||||
"serverContext.disconnect": "断开连接",
|
||||
"connectError.dismiss": "关闭",
|
||||
"connectError.gatewayFull": "网关当前已满。请几分钟后再试,或自行部署 WebSpeak3:github.com/WebSpeak3/webspeak3",
|
||||
"dialog.close": "关闭",
|
||||
"sounds.title": "声音",
|
||||
"sounds.subtitle": "配置事件提示音",
|
||||
@@ -633,7 +632,7 @@
|
||||
"restartNotice.ack": "知道了",
|
||||
"menu.extras.tos": "使用条款",
|
||||
"tos.title": "client.webspeak3.de 使用条款",
|
||||
"tos.rule1": "本客户端仅供通过浏览器私人、非商业使用 TeamSpeak / TeaSpeak / GreenTeaSpeak 服务器。",
|
||||
"tos.rule1": "本客户端仅供通过浏览器私人、非商业使用 TeamSpeak / TeaSpeak / VoySpeak 服务器。",
|
||||
"tos.rule2": "尤其禁止:任何违法行为、骚扰与仇恨言论、垃圾信息与刷屏、干扰服务运行,以及规避封禁。",
|
||||
"tos.rule3": "违规可能导致访问权限被无预警封禁;严重情况可能会上报相关部门。",
|
||||
"tos.rule4Pre": "出于运行安全和滥用检测的目的,连接信息(服务器地址、服务器名称、连接时间)会被记录,并在 90 天后自动删除 —— 详见",
|
||||
|
||||
@@ -2,7 +2,6 @@ import './storageFallback'
|
||||
import { StrictMode, useState, type FormEvent, type ReactNode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import './index.css'
|
||||
import './styles/greenteaspeak.css'
|
||||
import './App.css'
|
||||
import { LanguageProvider, useT } from './i18n'
|
||||
import { discardVault, hasVault, unlockVault } from './vault'
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,98 +0,0 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { useT } from "../../i18n";
|
||||
|
||||
export type ConnectionTabItem = {
|
||||
id: string;
|
||||
label: string;
|
||||
connected?: boolean;
|
||||
connecting?: boolean;
|
||||
};
|
||||
|
||||
export type GreenteaSpeakChromeProps = {
|
||||
/** @deprecated Prefer `tabs` + `activeTabId` for multi-join. */
|
||||
connected?: boolean;
|
||||
/** @deprecated Prefer `tabs`. */
|
||||
serverName?: string;
|
||||
tabs?: ConnectionTabItem[];
|
||||
activeTabId?: string | null;
|
||||
onSelectTab?: (id: string) => void;
|
||||
onCloseTab?: (id: string) => void;
|
||||
children?: ReactNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* GTS branding chrome: connection-tab strip (multi-join) + brand label when empty.
|
||||
* Renders children unchanged — WebSpeak keeps its own React state/handlers.
|
||||
*/
|
||||
export function GreenteaSpeakChrome({
|
||||
connected,
|
||||
serverName,
|
||||
tabs,
|
||||
activeTabId,
|
||||
onSelectTab,
|
||||
onCloseTab,
|
||||
children,
|
||||
}: GreenteaSpeakChromeProps) {
|
||||
const resolvedTabs: ConnectionTabItem[] =
|
||||
tabs ??
|
||||
(connected
|
||||
? [{ id: "legacy", label: (serverName ?? "").trim() || "GreenTeaSpeak", connected: true }]
|
||||
: []);
|
||||
|
||||
const hasTabs = resolvedTabs.length > 0;
|
||||
const t = useT();
|
||||
|
||||
return (
|
||||
<>
|
||||
{hasTabs ? (
|
||||
<div className="gts-connection-tabs" role="tablist" aria-label={t("tabs.connections")}>
|
||||
{resolvedTabs.map((tab) => {
|
||||
const isActive = tab.id === (activeTabId ?? resolvedTabs[0]?.id);
|
||||
return (
|
||||
<div
|
||||
key={tab.id}
|
||||
role="tab"
|
||||
aria-selected={isActive}
|
||||
className={`gts-connection-tab${isActive ? " gts-connection-tab-active" : ""}${
|
||||
tab.connecting ? " gts-connection-tab-connecting" : ""
|
||||
}`}
|
||||
onClick={() => onSelectTab?.(tab.id)}
|
||||
tabIndex={0}
|
||||
aria-keyshortcuts={onCloseTab ? "Delete" : undefined}
|
||||
onKeyDown={(e) => {
|
||||
if (e.target !== e.currentTarget) return;
|
||||
// The × below is mouse-only (a button can't sit inside a tab); Delete closes.
|
||||
if (e.key === "Delete" && onCloseTab) onCloseTab(tab.id);
|
||||
else if (e.key === "Enter" || e.key === " ") onSelectTab?.(tab.id);
|
||||
else return;
|
||||
e.preventDefault();
|
||||
}}
|
||||
title={tab.label}
|
||||
>
|
||||
<span className="gts-connection-tab-label">{tab.label}</span>
|
||||
{onCloseTab ? (
|
||||
<span
|
||||
className="gts-connection-tab-close"
|
||||
aria-hidden="true"
|
||||
title={t("tabs.disconnect")}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onCloseTab(tab.id);
|
||||
}}
|
||||
>
|
||||
×
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
) : (
|
||||
<div className="gts-connection-tabs gts-brand-strip">
|
||||
<span className="gts-brand-label">GreenTeaSpeak</span>
|
||||
</div>
|
||||
)}
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/**
|
||||
* Maps WebSpeak gateway WebSocket payloads to the shape the GreenTeaSpeak
|
||||
* shell expects. The browser UI still uses App.tsx state; this module is the
|
||||
* contract layer so GTS chrome never talks to Electron IPC.
|
||||
*/
|
||||
|
||||
export type GatewayServerType = "auto" | "teamspeak" | "teaspeak";
|
||||
|
||||
export type GatewayConnectPayload = {
|
||||
type: "connect";
|
||||
host: string;
|
||||
nickname: string;
|
||||
serverPassword?: string;
|
||||
channelPassword?: string;
|
||||
defaultChannel?: string;
|
||||
identity?: string;
|
||||
privilegeKey?: string;
|
||||
serverType?: GatewayServerType;
|
||||
};
|
||||
|
||||
export type GatewayOutboundAction =
|
||||
| GatewayConnectPayload
|
||||
| { type: "disconnect" }
|
||||
| { type: "switchChannel"; channelId: number }
|
||||
| { type: "sendChat"; message: string; target?: "channel" | "server" | number }
|
||||
| { type: string; [key: string]: unknown };
|
||||
|
||||
/** Build the connect message sent on the WebSpeak gateway socket. */
|
||||
export function buildGatewayConnect(input: {
|
||||
host: string;
|
||||
nickname: string;
|
||||
serverPassword?: string;
|
||||
channelPassword?: string;
|
||||
defaultChannel?: string;
|
||||
identity?: string;
|
||||
privilegeKey?: string;
|
||||
serverType?: GatewayServerType;
|
||||
}): GatewayConnectPayload {
|
||||
return {
|
||||
type: "connect",
|
||||
host: input.host.trim(),
|
||||
nickname: input.nickname.trim(),
|
||||
serverPassword: input.serverPassword?.trim() || undefined,
|
||||
channelPassword: input.channelPassword?.trim() || undefined,
|
||||
defaultChannel: input.defaultChannel?.trim() || undefined,
|
||||
identity: input.identity || undefined,
|
||||
privilegeKey: input.privilegeKey?.trim() || undefined,
|
||||
serverType: input.serverType || "auto",
|
||||
};
|
||||
}
|
||||
|
||||
export function sendGatewayAction(ws: WebSocket | null, action: GatewayOutboundAction): boolean {
|
||||
if (!ws || ws.readyState !== WebSocket.OPEN) return false;
|
||||
ws.send(JSON.stringify(action));
|
||||
return true;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
export const GREENTEASPEAK_THEME_ID = "greenteaspeak" as const;
|
||||
|
||||
export function isGreenteaSpeakTheme(theme: string): boolean {
|
||||
return theme === GREENTEASPEAK_THEME_ID;
|
||||
}
|
||||
|
||||
export {
|
||||
GreenteaSpeakChrome,
|
||||
type GreenteaSpeakChromeProps,
|
||||
type ConnectionTabItem,
|
||||
} from "./GreenteaSpeakChrome";
|
||||
|
||||
export {
|
||||
buildGatewayConnect,
|
||||
sendGatewayAction,
|
||||
type GatewayConnectPayload,
|
||||
type GatewayOutboundAction,
|
||||
type GatewayServerType,
|
||||
} from "./gatewayAdapter";
|
||||
Reference in new issue
Block a user