mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
Compare commits
92
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
803cefd653 | ||
|
|
01faa6593c | ||
|
|
e28e89bc60 | ||
|
|
8d8d942038 | ||
|
|
e28e18c88c | ||
|
|
2615904b1e | ||
|
|
5e7add6dc8 | ||
|
|
983ce1e105 | ||
|
|
7d14c3409e | ||
|
|
882265beae | ||
|
|
0aefd4198b | ||
|
|
3a91a8db07 | ||
|
|
51d7e107e5 | ||
|
|
1e71e43bd7 | ||
|
|
c2b52b323d | ||
|
|
bbb44b3eaa | ||
|
|
bda908029b | ||
|
|
45e4af026f | ||
|
|
ef0e3fad7d | ||
|
|
839e26e4a3 | ||
|
|
e37e090ab2 | ||
|
|
9b836d5830 | ||
|
|
d36b94a496 | ||
|
|
b84dc0faac | ||
|
|
4752971f31 | ||
|
|
93b809ff9a | ||
|
|
fa3fa2e4ad | ||
|
|
16e3cd8dd7 | ||
|
|
9d736dbfdd | ||
|
|
5268c8f57a | ||
|
|
deabfbff3c | ||
|
|
81107c659e | ||
|
|
bf4507ae9d | ||
|
|
12e482b223 | ||
|
|
23e61c86b3 | ||
|
|
d67053f2dd | ||
|
|
728c900bb2 | ||
|
|
4b245d69d3 | ||
|
|
7b3cb5ef09 | ||
|
|
c0778c8adb | ||
|
|
8e934c6646 | ||
|
|
a9f0586b88 | ||
|
|
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 |
No files matched your search
@@ -0,0 +1,133 @@
|
||||
"""Post a short release announcement to Bluesky.
|
||||
|
||||
Reads the release (tag, url, body) as JSON from stdin, e.g. from
|
||||
`gh release view <tag> --json tagName,url,body`. The post is the first
|
||||
paragraph of the release notes plus the link and a preview card. Notes containing
|
||||
<!-- no-social --> are skipped. DRY_RUN=true logs in (if credentials are set)
|
||||
and prints the post without publishing it.
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from datetime import datetime, timezone
|
||||
|
||||
BLUESKY_LIMIT = 300
|
||||
|
||||
|
||||
def build_post(release: dict) -> str | None:
|
||||
body = release.get("body") or ""
|
||||
if "<!-- no-social -->" in body:
|
||||
return None
|
||||
summary = body.strip().split("\n\n")[0].strip()
|
||||
if summary.startswith("#"):
|
||||
summary = ""
|
||||
summary = re.sub(r"\[([^\]]+)\]\([^)]+\)", r"\1", summary)
|
||||
summary = " ".join(re.sub(r"[`*_]", "", summary).split())
|
||||
head = f"WebSpeak3 {release['tagName']}"
|
||||
tail = f"\n\n{release['url']}"
|
||||
room = BLUESKY_LIMIT - len(head) - len(tail) - 2
|
||||
if len(summary) > room:
|
||||
# Prefer dropping whole sentences over cutting one off mid-word.
|
||||
cut = summary[:room].rfind(". ")
|
||||
summary = summary[: cut + 1] if cut > 0 else summary[: room - 1].rstrip() + "…"
|
||||
return f"{head}: {summary}{tail}" if summary else head + tail
|
||||
|
||||
|
||||
def xrpc(method: str, payload: dict | bytes, token: str | None = None, content_type: str = "application/json") -> dict:
|
||||
req = urllib.request.Request(
|
||||
f"https://bsky.social/xrpc/{method}",
|
||||
data=payload if isinstance(payload, bytes) else json.dumps(payload).encode(),
|
||||
headers={"Content-Type": content_type, **({"Authorization": f"Bearer {token}"} if token else {})},
|
||||
)
|
||||
with urllib.request.urlopen(req, timeout=30) as res:
|
||||
return json.load(res)
|
||||
|
||||
|
||||
def fetch(url: str, attempt: int = 1) -> tuple[bytes, str]:
|
||||
req = urllib.request.Request(url, headers={"User-Agent": "webspeak3-release-announcer"})
|
||||
try:
|
||||
with urllib.request.urlopen(req, timeout=30) as res:
|
||||
return res.read(), res.headers.get_content_type()
|
||||
except urllib.error.HTTPError as err:
|
||||
# GitHub's image service throttles right after a release, often for over a minute.
|
||||
# 15+30+45+60 s stays well inside the job's 5-minute timeout.
|
||||
if err.code != 429 or attempt > 4:
|
||||
raise
|
||||
wait = 15 * attempt
|
||||
retry_after = err.headers.get("Retry-After", "")
|
||||
if retry_after.isdigit():
|
||||
wait = min(int(retry_after), 60)
|
||||
print(f"Preview image throttled (429), retrying in {wait} s.")
|
||||
time.sleep(wait)
|
||||
return fetch(url, attempt + 1)
|
||||
|
||||
|
||||
def link_card(release: dict, text: str) -> dict:
|
||||
"""The preview card the Bluesky app would show for a pasted link. The API doesn't build one itself.
|
||||
The image is GitHub's own social preview for the release page. Its URL takes any cache-busting
|
||||
segment, so we don't have to scrape the release page (GitHub rate-limits that)."""
|
||||
url = release["url"]
|
||||
card = {"uri": url, "title": f"WebSpeak3 {release['tagName']}",
|
||||
"description": text.split("\n\n")[0].split(": ", 1)[-1]}
|
||||
path = url.removeprefix("https://github.com/")
|
||||
image, mime = fetch(f"https://opengraph.githubassets.com/{release['tagName']}/{path}")
|
||||
if len(image) <= 1_000_000: # Bluesky's blob limit for thumbnails
|
||||
card["image"] = (image, mime)
|
||||
return card
|
||||
|
||||
|
||||
def main() -> None:
|
||||
release = json.load(sys.stdin)
|
||||
text = build_post(release)
|
||||
if text is None:
|
||||
print("Release notes contain <!-- no-social -->, skipping.")
|
||||
return
|
||||
print(text)
|
||||
url = release["url"]
|
||||
try:
|
||||
card = link_card(release, text)
|
||||
print(f"Link card: {card['title']} (image: {len(card['image'][0]) if 'image' in card else 'none'} bytes)")
|
||||
except Exception as err: # a missing preview shouldn't cost us the post
|
||||
print(f"No link card: {err}")
|
||||
card = None
|
||||
|
||||
dry_run = os.environ.get("DRY_RUN") == "true"
|
||||
handle, password = os.environ.get("BLUESKY_HANDLE"), os.environ.get("BLUESKY_APP_PASSWORD")
|
||||
if not password:
|
||||
sys.exit(0 if dry_run else "BLUESKY_APP_PASSWORD is not set.")
|
||||
session = xrpc("com.atproto.server.createSession", {"identifier": handle, "password": password})
|
||||
print(f"Logged in as {session['handle']}.")
|
||||
if dry_run:
|
||||
print("Dry run, not posting.")
|
||||
return
|
||||
|
||||
# Bluesky doesn't auto-link URLs in API posts; the link needs a facet with UTF-8 byte offsets.
|
||||
start = len(text[: text.rindex(url)].encode())
|
||||
record = {
|
||||
"$type": "app.bsky.feed.post",
|
||||
"text": text,
|
||||
"langs": ["en"],
|
||||
"createdAt": datetime.now(timezone.utc).isoformat().replace("+00:00", "Z"),
|
||||
"facets": [{
|
||||
"index": {"byteStart": start, "byteEnd": start + len(url.encode())},
|
||||
"features": [{"$type": "app.bsky.richtext.facet#link", "uri": url}],
|
||||
}],
|
||||
}
|
||||
if card:
|
||||
external = {"uri": card["uri"], "title": card["title"], "description": card["description"]}
|
||||
if "image" in card:
|
||||
image, mime = card["image"]
|
||||
external["thumb"] = xrpc("com.atproto.repo.uploadBlob", image, session["accessJwt"], mime)["blob"]
|
||||
record["embed"] = {"$type": "app.bsky.embed.external", "external": external}
|
||||
post = xrpc("com.atproto.repo.createRecord",
|
||||
{"repo": session["did"], "collection": "app.bsky.feed.post", "record": record},
|
||||
session["accessJwt"])
|
||||
print(f"Posted: {post['uri']}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,39 @@
|
||||
name: Announce release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Release tag to announce
|
||||
required: true
|
||||
dry_run:
|
||||
description: Only log in and print the post, don't publish it
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
bluesky:
|
||||
name: Post to Bluesky
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
|
||||
|
||||
- name: Post release
|
||||
# Tag passed via env, never spliced into the script (user-controlled text).
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ github.event.release.tag_name || inputs.tag }}
|
||||
DRY_RUN: ${{ inputs.dry_run && 'true' || 'false' }}
|
||||
BLUESKY_HANDLE: moepchi.bsky.social
|
||||
BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }}
|
||||
run: |
|
||||
gh release view "$TAG" -R "$GITHUB_REPOSITORY" --json tagName,url,body \
|
||||
| python3 .github/scripts/announce-release.py
|
||||
@@ -20,33 +20,42 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4
|
||||
|
||||
- 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
|
||||
tags: ${{ steps.tags.outputs.tags }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
@@ -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
|
||||
|
||||
@@ -13,3 +13,6 @@ CLAUDE.md
|
||||
|
||||
# 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/
|
||||
+45
-11
@@ -1,26 +1,37 @@
|
||||
# --- Rust connector -----------------------------------------------------
|
||||
FROM rust:1-bookworm AS connector-builder
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends cmake && rm -rf /var/lib/apt/lists/*
|
||||
# Cross-compiled on the build machine for the target platform via xx, so an
|
||||
# arm64 image doesn't have to run rustc under QEMU. xx is copied into the
|
||||
# builder's root, hence pinned by digest rather than a movable tag.
|
||||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.9.0@sha256:c64defb9ed5a91eacb37f96ccc3d4cd72521c4bd18d5442905b95e2226b0e707 AS xx
|
||||
FROM --platform=$BUILDPLATFORM rust:1-bookworm AS connector-builder
|
||||
COPY --from=xx / /
|
||||
ARG TARGETPLATFORM
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends cmake clang && rm -rf /var/lib/apt/lists/*
|
||||
RUN xx-apt-get update && xx-apt-get install -y libc6-dev gcc g++ && rm -rf /var/lib/apt/lists/*
|
||||
RUN rustup target add $(xx-cargo --print-target-triple)
|
||||
WORKDIR /src
|
||||
COPY tsclientlib/ tsclientlib/
|
||||
COPY connector/ connector/
|
||||
WORKDIR /src/connector
|
||||
ENV CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
RUN cargo build --release
|
||||
RUN xx-cargo build --release
|
||||
|
||||
# --- Web frontend ---------------------------------------------------------
|
||||
FROM node:22-bookworm-slim AS web-builder
|
||||
# The bundle is plain JS/CSS, identical for every target platform - build it
|
||||
# natively on the build machine instead of under emulation.
|
||||
FROM --platform=$BUILDPLATFORM node:22-bookworm-slim AS web-builder
|
||||
WORKDIR /src/web
|
||||
COPY web/package*.json ./
|
||||
RUN npm ci
|
||||
# Vite 8 pulls in Rolldown, which ships its bundler as a platform-specific
|
||||
# optional dependency (@rolldown/binding-linux-x64-gnu here). `npm ci`
|
||||
# intermittently fails to install it due to a long-standing npm bug
|
||||
# optional dependency (@rolldown/binding-linux-<arch>-gnu, <arch> being
|
||||
# Node's process.arch). `npm ci` intermittently fails to install it due to a
|
||||
# long-standing npm bug
|
||||
# (https://github.com/npm/cli/issues/4828) without raising a non-zero exit
|
||||
# code, so `vite build` only fails later with a confusing MODULE_NOT_FOUND.
|
||||
# Verify the binding actually loaded and self-heal via the workaround from
|
||||
# npm's own error message before wasting a full build on a broken install.
|
||||
RUN node -e "require('@rolldown/binding-linux-x64-gnu')" \
|
||||
RUN node -e "require('@rolldown/binding-linux-' + process.arch + '-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).
|
||||
@@ -29,13 +40,25 @@ COPY web/ ./
|
||||
# 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 if [ "$DONATE_URL" = "keep" ]; then npx vite build; \
|
||||
else VITE_DONATE_URL="$DONATE_URL" npx vite build; fi
|
||||
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
|
||||
# tsc output is platform-independent too; only the runtime stage below
|
||||
# installs the (pure-JS) production deps for the target platform.
|
||||
FROM --platform=$BUILDPLATFORM node:22-bookworm-slim AS gateway-builder
|
||||
WORKDIR /src/gateway
|
||||
COPY gateway/package*.json ./
|
||||
RUN npm ci
|
||||
@@ -47,6 +70,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
|
||||
@@ -58,7 +86,7 @@ RUN npm ci --omit=dev \
|
||||
&& rm -rf /root/.npm /usr/local/lib/node_modules/npm \
|
||||
&& rm -f /usr/local/bin/npm /usr/local/bin/npx
|
||||
COPY --from=gateway-builder /src/gateway/dist ./dist
|
||||
COPY --from=connector-builder /src/connector/target/release/ts-connector /app/connector-bin/ts-connector
|
||||
COPY --from=connector-builder /src/connector/target/*/release/ts-connector /app/connector-bin/ts-connector
|
||||
COPY --from=web-builder /src/web/dist /app/web/dist
|
||||
|
||||
ENV PORT=8080
|
||||
@@ -66,6 +94,12 @@ 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/healthz').then(r => { if (!r.ok) process.exit(1) }).catch(() => process.exit(1))"]
|
||||
|
||||
|
||||
@@ -69,17 +69,20 @@ not need to be installed on the same machine, modified, or operated by you.
|
||||
| 🔊 **Custom audio output picker** | Route playback to any output device — works even in browsers without `AudioContext.setSinkId` |
|
||||
| 💬 **Full text chat** | Channel, server-wide, and private (1:1) chat, each in its own tab — Shift+Enter for a newline |
|
||||
| 🌳 **Live channel/client tree** | Correct ordering, status icons (channel commander, away, muted, deafened), country flags, click to switch channels |
|
||||
| 🖱️ **Right-click context menu** | Private chat, poke, copy name, and whisper-target toggle straight from a client's row |
|
||||
| 🖱️ **Right-click context menu** | Private chat, poke, copy name, whisper-target toggle, and a per-person volume slider straight from a client's row |
|
||||
| 🔎 **Tree search** | Filter channels and users by name; matches stay in place with their parent channels |
|
||||
| 🖼️ **Avatars** | Shows the TeamSpeak avatars people have set, in the tree, the speaking bar, and the info panel |
|
||||
| 📜 **Server log** | Join/leave/switch, channel-group, and channel/server-change events shown inline, like the native client |
|
||||
| 🔔 **Custom sound notifications** | Per-event sounds (connect, poke, messages, ...) with volume control and `.ts3soundpack` import |
|
||||
| 🪪 **Persistent identity** | Keeps the same client UID across sessions instead of generating a new one every connect |
|
||||
| 👉 **Poke & away status** | Poke clients with an optional message; set yourself away with presets or a custom status |
|
||||
| ⭐ **Favorites & reconnect** | Remembers your last server/nickname; switch servers without leaving your tab |
|
||||
| 📱 **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 |
|
||||
| 🌍 **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 |
|
||||
| 🔁 **Seamless reconnect** | Switch or add connections mid-session without tearing down unrelated tabs |
|
||||
| 🔁 **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 |
|
||||
| 🖥️ **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) |
|
||||
|
||||
@@ -172,7 +175,7 @@ services:
|
||||
|
||||
Then `docker compose up -d` and open `http://localhost:8080` (or whatever host port you chose).
|
||||
|
||||
Prefer to skip the build entirely? A prebuilt image is published on [Docker Hub](https://hub.docker.com/r/moepchi/webspeak3):
|
||||
Prefer to skip the build entirely? A prebuilt image for `linux/amd64` and `linux/arm64` (e.g. a Raspberry Pi 4/5 on a 64-bit OS) is published on [Docker Hub](https://hub.docker.com/r/moepchi/webspeak3):
|
||||
|
||||
```bash
|
||||
docker run -d -p 8080:8080 --name webspeak3 moepchi/webspeak3:latest
|
||||
@@ -180,6 +183,37 @@ 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`. These are the common ones - the full list (logging, feedback form, Design Store details, build-time variables) is on the wiki's [Configuration & Environment Variables](https://github.com/Moepchi/webspeak3/wiki/Configuration-and-Environment-Variables) page.
|
||||
|
||||
| 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. |
|
||||
| `DEFAULT_SERVER` / `DEFAULT_CHANNEL` | unset | Server (and optionally channel) every visitor auto-connects to — see [Bake in a default server](#2-bake-in-a-default-server). |
|
||||
| `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. An entry may carry a port (`ts.example.com:9988`): it still allows every port, but that's the address the connect dialog offers (see `SERVER_PICKER`). |
|
||||
| `SERVER_PICKER` | on | With `ALLOWED_SERVERS` set (and no `*.` entries in it), the connect dialog's address field becomes a dropdown of those servers, or a locked field if there's only one. Set to `0` for the plain text field instead. Only works when the gateway serves the web client itself (the Docker image does). |
|
||||
| `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. |
|
||||
| `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. |
|
||||
|
||||
> **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.
|
||||
|
||||
> **Stored in the browser:** identities (including their private keys), favorites with any passwords you typed into them, and settings live in the browser's `localStorage`, unencrypted - the same way the native client keeps them in its settings files. Anyone with access to your browser profile can read them; leave favorite password fields empty on shared machines and export identities you care about. Server banners load directly from the host the server admin configured; turn them off under Options → Application if you don't want that host to see your IP.
|
||||
|
||||
<details>
|
||||
<summary><b>🛠️ Manual installation (without Docker)</b></summary>
|
||||
|
||||
@@ -259,6 +293,51 @@ 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 server so **every** visitor auto-connects with zero parameters, no link needed. With the Docker image that's just two environment variables, no rebuild:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
- DEFAULT_SERVER=voice.example.com
|
||||
- DEFAULT_CHANNEL=Lobby
|
||||
```
|
||||
|
||||
The gateway hands them to the UI it serves itself, so this needs `WEB_STATIC` left on. Returning visitors' browsers keep the cached app (including its default) until the next image update, so a later change of these values reaches them only then — new visitors get it right away.
|
||||
|
||||
Building it yourself, you can bake the default in instead: `docker compose build --build-arg DEFAULT_SERVER=voice.example.com --build-arg DEFAULT_CHANNEL=Lobby` (the environment variables above win over these if both are set). 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.
|
||||
|
||||
+24
-10
@@ -10,11 +10,14 @@ This roadmap is intentionally outcome-focused. It does not promise fixed dates.
|
||||
|
||||
- Connect to any reachable TS3 or TS6 server through the WebSpeak3 gateway
|
||||
- Low-latency Opus voice, voice activation, whisper, and audio-device selection
|
||||
- Live channel/client tree with status updates and context actions
|
||||
- Live channel/client tree with status updates, search, avatars, and context actions
|
||||
- Per-person volume, remembered per user across sessions
|
||||
- Server, channel, and private text chat
|
||||
- Favorites, identities, contacts, pokes, away state, and reconnect
|
||||
- File transfers, local session recording, sound packs, and administration tools
|
||||
- Responsive desktop and mobile interfaces in German and English
|
||||
- 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, English, Simplified Chinese, and Persian (Beta)
|
||||
- Docker image and Compose-based self-hosting
|
||||
|
||||
## Experimental or still being validated
|
||||
@@ -25,13 +28,9 @@ This roadmap is intentionally outcome-focused. It does not promise fixed dates.
|
||||
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 currently switched off 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. The
|
||||
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 after
|
||||
the gateway has been updated.
|
||||
not implemented; only direct P2P works. Streaming needs a gateway from v0.11.0-beta.1
|
||||
on; since v0.15 the gateway announces its features when the browser connects,
|
||||
so newer features stay hidden behind an older gateway instead of hanging.
|
||||
- Safari and Mobile Safari audio/microphone behavior
|
||||
- Uncommon TeamSpeak permission combinations and large permission sets
|
||||
- Very large servers and long-running browser sessions
|
||||
@@ -44,9 +43,24 @@ 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
|
||||
|
||||
Basics are in place: the UI language sets the document's `lang`/`dir`,
|
||||
dialogs take focus on open, keep Tab inside, close on Escape, and hand focus
|
||||
back; toolbar icon and menu bar buttons are real, labelled buttons. The
|
||||
channel tree is an ARIA tree with one Tab stop: arrow keys walk it (selection
|
||||
follows focus), Left/Right collapse, expand and jump to parent or child,
|
||||
Enter joins a channel or opens a private chat, and the context-menu key or
|
||||
Shift+F10 opens the menu. Menus take focus on open, move with the arrow keys,
|
||||
and Escape hands focus back to the button that opened them. An axe-core scan
|
||||
of the connected UI is clean in every built-in design except for landmark
|
||||
best practices and GreenTeaSpeak's native selection colours. Still to do:
|
||||
|
||||
- Do a full screen-reader pass (NVDA/VoiceOver) through a real connect
|
||||
session to find what else is missing (e.g. announcing who is talking)
|
||||
|
||||
### 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"] }
|
||||
|
||||
+262
-22
@@ -35,6 +35,22 @@ use tsproto_packets::packets::{AudioData, CodecType, Direction, Flags, OutAudio,
|
||||
|
||||
/// 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;
|
||||
/// Uploads are capped the same way, independent of what the browser checks.
|
||||
const MAX_UPLOAD_BYTES: u64 = 24 << 20;
|
||||
/// File transfers cross the gateway in pieces of this size (raw bytes, a
|
||||
/// multiple of 3 so the base64 pieces can simply be concatenated). One huge
|
||||
/// line per file made the Node gateway hold several copies of it at once and
|
||||
/// run out of heap (2026-10-11).
|
||||
const TRANSFER_CHUNK_BYTES: usize = 192 << 10;
|
||||
/// Half-received chunked uploads per connection - each can hold up to
|
||||
/// MAX_UPLOAD_BYTES until it completes.
|
||||
const MAX_PARTIAL_UPLOADS: usize = 4;
|
||||
const MAX_ICON_BYTES: u64 = 512 << 10;
|
||||
/// Avatars are fetched for everyone in the user's channel without asking;
|
||||
/// TS3 servers default to a 300 KiB avatar size limit.
|
||||
const MAX_AVATAR_BYTES: u64 = 512 << 10;
|
||||
const OUT_CHANNELS: usize = 2;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
@@ -46,11 +62,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
|
||||
@@ -60,14 +78,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>,
|
||||
}
|
||||
|
||||
@@ -113,6 +131,9 @@ struct ClientInfo {
|
||||
/// 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,
|
||||
/// `client_flag_avatar`: MD5 of the client's avatar, empty without one. The
|
||||
/// file itself is `/avatar_<uid>` in channel 0, fetched by the browser.
|
||||
avatar_hash: String,
|
||||
}
|
||||
|
||||
/// Payload for the "streamsetup " stdin command - the `setupstream` args, which
|
||||
@@ -213,11 +234,11 @@ fn parse_codec_encryption_mode(s: &str) -> Option<CodecEncryptionMode> {
|
||||
/// Human-facing entries for the Server tab's log-style notifications
|
||||
/// (client join/leave/switch, channel group assignment, channel/server
|
||||
/// changes, own permission errors) - mirrors what the native TS3 client
|
||||
/// shows inline in the server chat. `rename_all = "camelCase"` covers both
|
||||
/// the `kind` tag values and field names, so this needs no remapping on the
|
||||
/// shows inline in the server chat. `rename_all` covers the `kind` tag values
|
||||
/// and `rename_all_fields` the field names, so this needs no remapping on the
|
||||
/// gateway side (unlike the snake_case variants below).
|
||||
#[derive(Serialize)]
|
||||
#[serde(tag = "kind", rename_all = "camelCase")]
|
||||
#[serde(tag = "kind", rename_all = "camelCase", rename_all_fields = "camelCase")]
|
||||
enum ServerLogEntry {
|
||||
ClientJoin { client: String, channel: String },
|
||||
ClientLeave { client: String },
|
||||
@@ -282,6 +303,12 @@ enum Event {
|
||||
Talkers { clients: Vec<u16> },
|
||||
#[serde(rename = "disconnected")]
|
||||
Disconnected { reason: String },
|
||||
/// Lost the server (timeout, server restart); tsclientlib is reconnecting
|
||||
/// on its own. Followed by "reconnected" once it is back.
|
||||
#[serde(rename = "reconnecting")]
|
||||
Reconnecting { reason: String },
|
||||
#[serde(rename = "reconnected")]
|
||||
Reconnected,
|
||||
#[serde(rename = "error")]
|
||||
Error { message: String },
|
||||
/// A "switch" to a password-protected channel was rejected because no (or
|
||||
@@ -368,12 +395,11 @@ enum Event {
|
||||
/// Reply to a "ftlist" request - one channel/path's directory listing.
|
||||
#[serde(rename = "fileList")]
|
||||
FileList { cid: u64, path: String, entries: Vec<FileListEntry> },
|
||||
/// A requested file download finished; `data` is the full file content,
|
||||
/// base64-encoded. Whole files are buffered in memory and sent as one
|
||||
/// event rather than streamed incrementally - fine for the file sizes a
|
||||
/// TS3 channel filebase realistically holds, not meant for huge transfers.
|
||||
#[serde(rename = "fileDownloadData")]
|
||||
FileDownloadData { cid: u64, path: String, data: String },
|
||||
/// One piece of a requested file download, base64-encoded. `offset` is
|
||||
/// the raw byte offset of this piece (0 starts a new download), `done`
|
||||
/// marks the last one. Pieces arrive in order.
|
||||
#[serde(rename = "fileDownloadChunk")]
|
||||
FileDownloadChunk { cid: u64, path: String, offset: u64, data: String, done: bool },
|
||||
/// A requested file upload finished successfully.
|
||||
#[serde(rename = "fileUploadDone")]
|
||||
FileUploadDone { cid: u64, path: String },
|
||||
@@ -472,6 +498,54 @@ struct FileListEntry {
|
||||
timestamp: String,
|
||||
}
|
||||
|
||||
/// Handles one `ftuploadchunk <cid>\t<offset>\t<total>\t<path>\t<base64>`
|
||||
/// line. Pieces come in order; offset 0 starts an upload. Returns the complete
|
||||
/// file once the piece that reaches <total> has arrived.
|
||||
fn take_upload_chunk(
|
||||
partials: &mut HashMap<(u64, String), (u64, Vec<u8>)>,
|
||||
rest: &str,
|
||||
) -> Result<Option<(u64, String, Vec<u8>)>, String> {
|
||||
let mut parts: Vec<&str> = rest.splitn(5, '\t').collect();
|
||||
// The stdin loop trims each line, which eats the trailing tab of an empty piece.
|
||||
if parts.len() == 4 {
|
||||
parts.push("");
|
||||
}
|
||||
let [cid, offset, total, path, data] = parts.as_slice() else {
|
||||
return Err("Invalid ftuploadchunk args".into());
|
||||
};
|
||||
let (Ok(cid), Ok(offset), Ok(total), Ok(bytes)) = (
|
||||
cid.trim().parse::<u64>(),
|
||||
offset.trim().parse::<u64>(),
|
||||
total.trim().parse::<u64>(),
|
||||
base64::engine::general_purpose::STANDARD.decode(data.trim()),
|
||||
) else {
|
||||
return Err("Invalid ftuploadchunk args".into());
|
||||
};
|
||||
let key = (cid, path.to_string());
|
||||
if offset == 0 {
|
||||
if total > MAX_UPLOAD_BYTES {
|
||||
return Err(format!("Upload refused: {path} is larger than {} KiB", MAX_UPLOAD_BYTES >> 10));
|
||||
}
|
||||
if !partials.contains_key(&key) && partials.len() >= MAX_PARTIAL_UPLOADS {
|
||||
return Err("Too many uploads at once".into());
|
||||
}
|
||||
partials.insert(key.clone(), (total, Vec::with_capacity(total as usize)));
|
||||
}
|
||||
let Some((expected, buf)) = partials.get_mut(&key) else {
|
||||
return Err(format!("Upload failed: {path} has no upload in progress"));
|
||||
};
|
||||
if buf.len() as u64 != offset || *expected != total || offset + bytes.len() as u64 > total {
|
||||
partials.remove(&key);
|
||||
return Err(format!("Upload failed: {path} arrived out of order"));
|
||||
}
|
||||
buf.extend_from_slice(&bytes);
|
||||
if (buf.len() as u64) < total {
|
||||
return Ok(None);
|
||||
}
|
||||
let (_, bytes) = partials.remove(&key).expect("present, checked above");
|
||||
Ok(Some((cid, key.1, bytes)))
|
||||
}
|
||||
|
||||
fn emit(event: &Event) {
|
||||
println!("{}", serde_json::to_string(event).unwrap());
|
||||
}
|
||||
@@ -567,6 +641,10 @@ fn log_book_event(con: &data::Connection, event: &BookEvent) {
|
||||
| PropertyId::ServerCodecEncryptionMode
|
||||
| PropertyId::ServerTempChannelDefaultDeleteDelay
|
||||
| PropertyId::ServerPrioritySpeakerDimmModificator,
|
||||
// Only notifyserveredited carries an invoker; the 20s
|
||||
// servergetvariables poll answers with notifyserverupdated, which
|
||||
// rewrites every field (changed or not) without one.
|
||||
invoker: Some(_),
|
||||
..
|
||||
} => {
|
||||
emit_server_log(ServerLogEntry::ServerEdited);
|
||||
@@ -664,6 +742,7 @@ fn snapshot(con: &data::Connection) -> Event {
|
||||
has_talk_power,
|
||||
is_query: matches!(c.client_type, ClientType::Query { .. }),
|
||||
is_streaming: c.is_streaming.unwrap_or(false),
|
||||
avatar_hash: c.avatar_hash.clone(),
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
@@ -835,6 +914,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}")
|
||||
@@ -965,6 +1050,10 @@ async fn run(args: Args) -> Result<()> {
|
||||
)?;
|
||||
let mut audio_handler = AudioHandler::<ClientId>::new();
|
||||
let mut talking: HashSet<u16> = HashSet::new();
|
||||
// Per-speaker playback volume set by the browser (`clientvolume`). Kept
|
||||
// outside the AudioHandler because its queues only live while someone
|
||||
// talks; a new queue picks its volume up from here.
|
||||
let mut client_volumes: HashMap<u16, f32> = HashMap::new();
|
||||
let mut audio_ticker = tokio::time::interval(tokio::time::Duration::from_millis(20));
|
||||
// Commands sent via `send()` fail silently if the server rejects them (e.g.
|
||||
// missing permission) - no reply is sent back without a return code. Using
|
||||
@@ -1024,6 +1113,8 @@ async fn run(args: Args) -> Result<()> {
|
||||
// request that stream belongs to.
|
||||
let mut pending_downloads: HashMap<u16, (u64, String)> = HashMap::new();
|
||||
let mut pending_uploads: HashMap<u16, (u64, String, Vec<u8>)> = HashMap::new();
|
||||
// Chunked uploads still arriving from the browser: (cid, path) -> (total size, bytes so far).
|
||||
let mut partial_uploads: HashMap<(u64, String), (u64, Vec<u8>)> = HashMap::new();
|
||||
// Set by "permissionlist" while waiting to emit the full permission
|
||||
// catalog (name-resolution reuses the same permission_names cache/fetch
|
||||
// as "permoverview" above).
|
||||
@@ -1038,6 +1129,7 @@ async fn run(args: Args) -> Result<()> {
|
||||
// TeaSpeak may reveal hidden channels after a group/permission change. Debounce
|
||||
// a channelsubscribeall so we pick up any channels the server only exposes then.
|
||||
let mut resubscribe_at: Option<tokio::time::Instant> = None;
|
||||
let mut ts_reconnecting = false;
|
||||
|
||||
enum LoopOutcome {
|
||||
StdinLine(std::io::Result<Option<String>>),
|
||||
@@ -1056,6 +1148,10 @@ async fn run(args: Args) -> Result<()> {
|
||||
loop {
|
||||
let mut events = con.events();
|
||||
let outcome = tokio::select! {
|
||||
// After a stall (e.g. CPU steal) the missed audio ticks fire in a burst.
|
||||
// Polling in order drains the queued packets first, otherwise a tick can
|
||||
// find an empty queue and play Opus loss concealment instead.
|
||||
biased;
|
||||
line = stdin_lines.next_line() => LoopOutcome::StdinLine(line),
|
||||
ev = events.next() => LoopOutcome::ConEvent(ev),
|
||||
_ = audio_ticker.tick() => LoopOutcome::AudioTick,
|
||||
@@ -1300,6 +1396,28 @@ async fn run(args: Args) -> Result<()> {
|
||||
if let Err(e) = part.send(&mut con) {
|
||||
emit(&Event::Error { message: e.to_string() });
|
||||
}
|
||||
} else if let Some(rest) = l.strip_prefix("clientvolume ") {
|
||||
// `clientvolume <clid> <factor>`, 1 = unchanged, 0 = silent.
|
||||
let mut parts = rest.split_whitespace();
|
||||
match (
|
||||
parts.next().and_then(|v| v.parse::<u16>().ok()),
|
||||
parts.next().and_then(|v| v.parse::<f32>().ok()).filter(|v| v.is_finite()),
|
||||
) {
|
||||
(Some(clid), Some(volume)) => {
|
||||
let volume = volume.clamp(0.0, 2.0);
|
||||
if volume == 1.0 {
|
||||
client_volumes.remove(&clid);
|
||||
} else {
|
||||
client_volumes.insert(clid, volume);
|
||||
}
|
||||
if let Some(queue) = audio_handler.get_mut_queues().get_mut(&ClientId(clid)) {
|
||||
queue.volume = volume;
|
||||
}
|
||||
}
|
||||
_ => emit(&Event::Error {
|
||||
message: format!("Malformed clientvolume command: {rest}"),
|
||||
}),
|
||||
}
|
||||
} else if let Some(rest) = l.strip_prefix("nickname ") {
|
||||
let part = con.get_state()?.client_update().set_name(rest.trim());
|
||||
if let Err(e) = part.send(&mut con) {
|
||||
@@ -2123,6 +2241,19 @@ async fn run(args: Args) -> Result<()> {
|
||||
}
|
||||
_ => emit(&Event::Error { message: "Invalid ftupload args".into() }),
|
||||
}
|
||||
} else if let Some(rest) = l.strip_prefix("ftuploadchunk ") {
|
||||
match take_upload_chunk(&mut partial_uploads, rest) {
|
||||
Ok(Some((cid, path, bytes))) => {
|
||||
match con.upload_file(ChannelId(cid), &path, None, bytes.len() as u64, true, false) {
|
||||
Ok(handle) => {
|
||||
pending_uploads.insert(handle.0, (cid, path, bytes));
|
||||
}
|
||||
Err(e) => emit(&Event::Error { message: format!("Upload failed: {e}") }),
|
||||
}
|
||||
}
|
||||
Ok(None) => {}
|
||||
Err(message) => emit(&Event::Error { message }),
|
||||
}
|
||||
} else if l == "permissionlist" {
|
||||
if pending_permission_list {
|
||||
// A catalog fetch is already in flight (triggered by an
|
||||
@@ -2393,6 +2524,13 @@ async fn run(args: Args) -> Result<()> {
|
||||
},
|
||||
LoopOutcome::ConEvent(ev) => match ev {
|
||||
Some(Ok(StreamItem::BookEvents(events))) => {
|
||||
if ts_reconnecting {
|
||||
// The new session starts unsubscribed, which would leave
|
||||
// everyone but us invisible.
|
||||
ts_reconnecting = false;
|
||||
resubscribe_at = Some(tokio::time::Instant::now());
|
||||
emit(&Event::Reconnected);
|
||||
}
|
||||
let own_id = con.get_state()?.own_client;
|
||||
for event in &events {
|
||||
if let BookEvent::Message { target, invoker, message } = event {
|
||||
@@ -2525,6 +2663,12 @@ async fn run(args: Args) -> Result<()> {
|
||||
};
|
||||
if let Some(from) = from {
|
||||
if let Ok(Some(new_talker)) = audio_handler.handle_packet(from, packet) {
|
||||
if let (Some(&volume), Some(queue)) = (
|
||||
client_volumes.get(&new_talker.0),
|
||||
audio_handler.get_mut_queues().get_mut(&new_talker),
|
||||
) {
|
||||
queue.volume = volume;
|
||||
}
|
||||
if talking.insert(new_talker.0) {
|
||||
emit(&Event::Talkers { clients: talking.iter().copied().collect() });
|
||||
}
|
||||
@@ -2905,15 +3049,61 @@ 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;
|
||||
// It goes out in TRANSFER_CHUNK_BYTES pieces but the browser
|
||||
// still assembles the whole file, so cap it - a server could
|
||||
// otherwise announce (or just send) gigabytes.
|
||||
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 = match path.as_str() {
|
||||
p if cid == 0 && p.starts_with("/icon_") => MAX_ICON_BYTES,
|
||||
p if cid == 0 && p.starts_with("/avatar_") => MAX_AVATAR_BYTES,
|
||||
_ => MAX_DOWNLOAD_BYTES,
|
||||
};
|
||||
tokio::spawn(async move {
|
||||
let mut buf = Vec::new();
|
||||
match stream.read_to_end(&mut buf).await {
|
||||
Ok(_) => {
|
||||
let data = base64::engine::general_purpose::STANDARD.encode(&buf);
|
||||
emit(&Event::FileDownloadData { cid, path, data });
|
||||
if announced_size > limit {
|
||||
emit(&Event::Error {
|
||||
message: format!("Download refused: {path} is larger than {} KiB", limit >> 10),
|
||||
});
|
||||
return;
|
||||
}
|
||||
let mut stream = stream.take(limit + 1);
|
||||
let mut buf = vec![0u8; TRANSFER_CHUNK_BYTES];
|
||||
let mut offset = 0u64;
|
||||
loop {
|
||||
// Fill the whole chunk (or hit EOF) so every piece but the
|
||||
// last is exactly TRANSFER_CHUNK_BYTES - see its comment.
|
||||
let mut filled = 0;
|
||||
let read = loop {
|
||||
match stream.read(&mut buf[filled..]).await {
|
||||
Ok(0) => break Ok(()),
|
||||
Ok(n) => {
|
||||
filled += n;
|
||||
if filled == buf.len() {
|
||||
break Ok(());
|
||||
}
|
||||
}
|
||||
Err(e) => break Err(e),
|
||||
}
|
||||
};
|
||||
if let Err(e) = read {
|
||||
emit(&Event::Error { message: format!("Download failed: {e}") });
|
||||
return;
|
||||
}
|
||||
Err(e) => emit(&Event::Error { message: format!("Download failed: {e}") }),
|
||||
if offset + filled as u64 > limit {
|
||||
emit(&Event::Error {
|
||||
message: format!("Download aborted: {path} is larger than {} KiB", limit >> 10),
|
||||
});
|
||||
return;
|
||||
}
|
||||
let done = filled < buf.len();
|
||||
let data = base64::engine::general_purpose::STANDARD.encode(&buf[..filled]);
|
||||
emit(&Event::FileDownloadChunk { cid, path: path.clone(), offset, data, done });
|
||||
if done {
|
||||
return;
|
||||
}
|
||||
offset += filled as u64;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2938,6 +3128,10 @@ async fn run(args: Args) -> Result<()> {
|
||||
emit(&Event::Error { message: format!("File transfer failed: {e}") });
|
||||
}
|
||||
}
|
||||
Some(Ok(StreamItem::DisconnectedTemporarily(reason))) => {
|
||||
ts_reconnecting = true;
|
||||
emit(&Event::Reconnecting { reason: format!("{reason:?}") });
|
||||
}
|
||||
Some(Ok(_)) => {}
|
||||
Some(Err(e)) => {
|
||||
emit(&Event::Disconnected { reason: e.to_string() });
|
||||
@@ -2959,7 +3153,9 @@ async fn run(args: Args) -> Result<()> {
|
||||
}
|
||||
}
|
||||
LoopOutcome::ServerVarsRefresh => {
|
||||
send_server_get_variables(&mut con);
|
||||
if !ts_reconnecting {
|
||||
send_server_get_variables(&mut con);
|
||||
}
|
||||
}
|
||||
LoopOutcome::AudioTick => {
|
||||
if !audio_handler.get_queues().is_empty() {
|
||||
@@ -2989,3 +3185,47 @@ async fn run(args: Args) -> Result<()> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
fn chunk(offset: u64, total: u64, data: &[u8]) -> String {
|
||||
format!("7\t{offset}\t{total}\t/a b.txt\t{}", base64::engine::general_purpose::STANDARD.encode(data))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn server_log_fields_are_camel_case() {
|
||||
let entry = ServerLogEntry::ClientChannelSwitch {
|
||||
client: "a".into(),
|
||||
from_channel: "b".into(),
|
||||
to_channel: "c".into(),
|
||||
};
|
||||
assert_eq!(
|
||||
serde_json::to_string(&entry).unwrap(),
|
||||
r#"{"kind":"clientChannelSwitch","client":"a","fromChannel":"b","toChannel":"c"}"#
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn upload_chunks_assemble_in_order_and_reject_gaps() {
|
||||
let mut partials = HashMap::new();
|
||||
assert_eq!(take_upload_chunk(&mut partials, &chunk(0, 5, b"abc")), Ok(None));
|
||||
assert_eq!(
|
||||
take_upload_chunk(&mut partials, &chunk(3, 5, b"de")),
|
||||
Ok(Some((7, "/a b.txt".to_string(), b"abcde".to_vec())))
|
||||
);
|
||||
assert!(partials.is_empty());
|
||||
|
||||
take_upload_chunk(&mut partials, &chunk(0, 5, b"abc")).unwrap();
|
||||
assert!(take_upload_chunk(&mut partials, &chunk(4, 5, b"e")).is_err());
|
||||
assert!(partials.is_empty(), "a gap drops the upload");
|
||||
assert!(take_upload_chunk(&mut partials, &chunk(0, MAX_UPLOAD_BYTES + 1, b"a")).is_err());
|
||||
|
||||
// An empty file's only piece reaches us with its trailing tab trimmed off.
|
||||
assert_eq!(
|
||||
take_upload_chunk(&mut partials, chunk(0, 0, b"").trim_end()),
|
||||
Ok(Some((7, "/a b.txt".to_string(), Vec::new())))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,16 @@ 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; behind your own
|
||||
# reverse proxy use TRUST_PROXY=1.
|
||||
- TRUST_PROXY=cloudflare
|
||||
# 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()}`);
|
||||
}
|
||||
}
|
||||
+407
-76
@@ -1,11 +1,15 @@
|
||||
import { createServer, type IncomingMessage, type ServerResponse } from "node:http";
|
||||
import { createServer as createSecureServer } from "node:https";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { readFile, appendFile, rename, stat } from "node:fs/promises";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { createHmac, 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"]);
|
||||
|
||||
@@ -22,13 +26,88 @@ function parsePrivilegeKey(msg: { privilegeKey?: unknown; token?: unknown }): st
|
||||
return trimmed || undefined;
|
||||
}
|
||||
|
||||
const PORT = Number(process.env.PORT ?? 8080);
|
||||
// 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);
|
||||
|
||||
// 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.
|
||||
const LOG_CONNECTIONS = process.env.LOG_CONNECTIONS === "1";
|
||||
// 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(stripPort(entry).slice(1));
|
||||
return target === stripPort(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>();
|
||||
// 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
|
||||
// through this gateway at several joins per second. Real clients (reconnect
|
||||
// backoff, restoring a handful of tabs) stay far below it.
|
||||
const CONNECT_RATE_LIMIT = Number(process.env.CONNECT_RATE_LIMIT ?? 30);
|
||||
const isConnectRateLimited = createRateLimiter(CONNECT_RATE_LIMIT, 60_000);
|
||||
|
||||
// Largest single WS message. Uploads now arrive in small "uploadFileChunk"
|
||||
// pieces; this size only stays for browsers still running a client from
|
||||
// before that, which send the whole file base64-encoded in one "uploadFile"
|
||||
// message (~4/3 of 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
|
||||
// is served from the same port as the WebSocket endpoint, so a single
|
||||
@@ -40,6 +119,46 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const WEB_DIST = process.env.WEB_DIST ?? path.resolve(__dirname, "../../web/dist");
|
||||
const SERVE_STATIC = process.env.WEB_STATIC !== "0";
|
||||
|
||||
// Sent to every browser in the "hello" message on socket open; see there.
|
||||
const GATEWAY_FEATURES = ["clientVolume", "keepalive", "chunkedUpload"];
|
||||
|
||||
// Optional TURN relay for screen streams, also handed out in "hello". With
|
||||
// TURN_SECRET (coturn's use-auth-secret) every socket gets its own credential,
|
||||
// valid for a day; TURN_USERNAME/TURN_CREDENTIAL are static and so readable by
|
||||
// every visitor. ponytail: a socket open longer than a day hands an expired
|
||||
// credential to a stream started after that; reconnecting fixes it.
|
||||
const TURN_URLS = (process.env.TURN_URLS ?? "").split(",").map((u) => u.trim()).filter(Boolean);
|
||||
function turnServers() {
|
||||
if (!TURN_URLS.length) return undefined;
|
||||
const secret = process.env.TURN_SECRET;
|
||||
if (!secret) {
|
||||
return [{ urls: TURN_URLS, username: process.env.TURN_USERNAME, credential: process.env.TURN_CREDENTIAL }];
|
||||
}
|
||||
const username = `${Math.floor(Date.now() / 1000) + 24 * 3600}:webspeak3`;
|
||||
return [{ urls: TURN_URLS, username, credential: createHmac("sha1", secret).update(username).digest("base64") }];
|
||||
}
|
||||
|
||||
// Runtime counterpart of the web build's VITE_DEFAULT_SERVER/_CHANNEL (GitHub
|
||||
// issue #12): set on the container, these end up in the served index.html as
|
||||
// <meta> tags the client reads at startup, so changing them needs no rebuild.
|
||||
// Meta tags rather than an inline script, which CONTENT_SECURITY_POLICY forbids.
|
||||
// The allowlist goes along so the client can offer it as a dropdown (or a
|
||||
// locked field for a single entry) instead of a free-text address; not with
|
||||
// wildcards, which can't be listed, nor with SERVER_PICKER=0.
|
||||
const SERVER_PICKER =
|
||||
process.env.SERVER_PICKER !== "0" && !ALLOWED_SERVERS.some((e) => e.startsWith("*."))
|
||||
? ALLOWED_SERVERS.join(",")
|
||||
: undefined;
|
||||
const RUNTIME_CONFIG_META = Object.entries({
|
||||
"webspeak3-default-server": process.env.DEFAULT_SERVER,
|
||||
"webspeak3-default-channel": process.env.DEFAULT_CHANNEL,
|
||||
"webspeak3-allowed-servers": SERVER_PICKER,
|
||||
})
|
||||
.flatMap(([name, value]) =>
|
||||
value ? [`<meta name="${name}" content="${value.replace(/[&"<>]/g, (c) => `&#${c.charCodeAt(0)};`)}">`] : [],
|
||||
)
|
||||
.join("");
|
||||
|
||||
const MIME_TYPES: Record<string, string> = {
|
||||
".html": "text/html",
|
||||
".js": "text/javascript",
|
||||
@@ -72,30 +191,85 @@ const FEEDBACK_ALLOWED_ORIGIN = process.env.FEEDBACK_ALLOWED_ORIGIN ?? "*";
|
||||
// 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";
|
||||
// Plain JSON-lines file, not a database - this is a low-volume inbox, not
|
||||
// analytics. 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;
|
||||
const FEEDBACK_CATEGORIES = new Set(["bug", "idea", "report", "other"]);
|
||||
const FEEDBACK_MESSAGE_MAX_LENGTH = 4000;
|
||||
|
||||
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);
|
||||
// --- 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
|
||||
@@ -104,33 +278,34 @@ async function rotateFeedbackLogIfNeeded(): Promise<void> {
|
||||
// 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 feedbackSubmissionTimes = new Map<string, number[]>();
|
||||
const isFeedbackRateLimited = createRateLimiter(FEEDBACK_RATE_LIMIT, FEEDBACK_RATE_WINDOW_MS);
|
||||
|
||||
function isFeedbackRateLimited(ip: string): boolean {
|
||||
const now = Date.now();
|
||||
const recent = (feedbackSubmissionTimes.get(ip) ?? []).filter((t) => now - t < FEEDBACK_RATE_WINDOW_MS);
|
||||
recent.push(now);
|
||||
feedbackSubmissionTimes.set(ip, recent);
|
||||
return recent.length > FEEDBACK_RATE_LIMIT;
|
||||
// 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");
|
||||
}
|
||||
|
||||
async function createGithubIssue(payload: {
|
||||
category: string;
|
||||
message: string;
|
||||
email?: string;
|
||||
}): Promise<string | undefined> {
|
||||
// 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 = `[Feedback/${payload.category}] ${payload.message.replace(/\s+/g, " ").trim().slice(0, 72)}`;
|
||||
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 = [
|
||||
payload.message,
|
||||
`${fence}text`,
|
||||
neutralizeMentions(payload.message),
|
||||
fence,
|
||||
"",
|
||||
"---",
|
||||
`Category: ${payload.category}`,
|
||||
payload.email ? `Contact: ${payload.email}` : undefined,
|
||||
"_Submitted via the in-client feedback form._",
|
||||
]
|
||||
.filter((line): line is string => Boolean(line))
|
||||
.join("\n");
|
||||
].join("\n");
|
||||
|
||||
const res = await fetch(`https://api.github.com/repos/${GITHUB_REPO}/issues`, {
|
||||
method: "POST",
|
||||
@@ -173,8 +348,7 @@ async function handleFeedback(req: IncomingMessage, res: ServerResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
const ip = (req.socket.remoteAddress ?? "unknown").replace(/^::ffff:/, "");
|
||||
if (isFeedbackRateLimited(ip)) {
|
||||
if (isFeedbackRateLimited(clientIp(req))) {
|
||||
res.writeHead(429, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: "rate_limited" }));
|
||||
return;
|
||||
@@ -221,18 +395,12 @@ async function handleFeedback(req: IncomingMessage, res: ServerResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await rotateFeedbackLogIfNeeded();
|
||||
const entry = { at: new Date().toISOString(), category, message, email };
|
||||
await appendFile(FEEDBACK_LOG_FILE, JSON.stringify(entry) + "\n", "utf-8");
|
||||
} catch (err) {
|
||||
console.error("[feedback] Failed to write feedback log:", err);
|
||||
}
|
||||
await logFeedback({ at: new Date().toISOString(), category, message, email });
|
||||
|
||||
let githubIssueUrl: string | undefined;
|
||||
if (publishAsIssue) {
|
||||
try {
|
||||
githubIssueUrl = await createGithubIssue({ category, message, email });
|
||||
githubIssueUrl = await createGithubIssue({ category, message });
|
||||
} catch (err) {
|
||||
console.error("[feedback] Failed to create GitHub issue:", err);
|
||||
}
|
||||
@@ -242,6 +410,9 @@ async function handleFeedback(req: IncomingMessage, res: ServerResponse) {
|
||||
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>
|
||||
@@ -270,7 +441,28 @@ const tlsOptions =
|
||||
? { 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 {
|
||||
const requestUrl = new URL(req.url ?? "/", "http://localhost");
|
||||
@@ -278,6 +470,24 @@ const requestHandler = (req: IncomingMessage, res: ServerResponse) => {
|
||||
await handleFeedback(req, res);
|
||||
return;
|
||||
}
|
||||
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
|
||||
@@ -300,7 +510,7 @@ const requestHandler = (req: IncomingMessage, res: ServerResponse) => {
|
||||
return;
|
||||
}
|
||||
let filePath = path.join(WEB_DIST, decodeURIComponent(requestUrl.pathname));
|
||||
if (!filePath.startsWith(WEB_DIST)) {
|
||||
if (filePath !== WEB_DIST && !filePath.startsWith(WEB_DIST + path.sep)) {
|
||||
res.writeHead(403);
|
||||
res.end();
|
||||
return;
|
||||
@@ -313,7 +523,15 @@ const requestHandler = (req: IncomingMessage, res: ServerResponse) => {
|
||||
filePath = path.join(WEB_DIST, "index.html");
|
||||
body = await readFile(filePath);
|
||||
}
|
||||
res.writeHead(200, { "Content-Type": MIME_TYPES[path.extname(filePath)] ?? "application/octet-stream" });
|
||||
if (RUNTIME_CONFIG_META && filePath === path.join(WEB_DIST, "index.html")) {
|
||||
// Function replacer: a string one would expand "$&" etc. in the values.
|
||||
body = Buffer.from(body.toString("utf8").replace("</head>", () => `${RUNTIME_CONFIG_META}</head>`));
|
||||
}
|
||||
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" });
|
||||
@@ -328,7 +546,24 @@ const server = tlsOptions
|
||||
? createSecureServer(tlsOptions, requestHandler)
|
||||
: createServer(requestHandler);
|
||||
|
||||
const wss = new WebSocketServer({ server, path: "/ws" });
|
||||
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);
|
||||
},
|
||||
});
|
||||
|
||||
// Heartbeat: a browser tab that loses its network mid-session (mobile
|
||||
// handover, Wi-Fi drop, backgrounded/frozen tab) often never sends a proper
|
||||
@@ -345,6 +580,17 @@ interface HeartbeatState {
|
||||
|
||||
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);
|
||||
@@ -355,6 +601,9 @@ const heartbeatTimer = setInterval(() => {
|
||||
}
|
||||
state.isAlive = false;
|
||||
socket.ping();
|
||||
// Protocol pings are invisible to browser JS; this lets the page notice
|
||||
// a dead network on its side too (KEEPALIVE_MESSAGE in web/src/App.tsx).
|
||||
socket.send('{"type":"keepalive"}');
|
||||
}
|
||||
}, HEARTBEAT_INTERVAL_MS);
|
||||
|
||||
@@ -365,16 +614,35 @@ wss.on("close", () => clearInterval(heartbeatTimer));
|
||||
// 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", () => {
|
||||
const payload = JSON.stringify({ type: "notice", messageKey: "restartNotice.body" });
|
||||
for (const socket of wss.clients) {
|
||||
try {
|
||||
socket.send(payload);
|
||||
} catch {
|
||||
/* socket already gone */
|
||||
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), shutting down`);
|
||||
setTimeout(() => process.exit(0), 500);
|
||||
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, () => {
|
||||
@@ -390,11 +658,20 @@ server.listen(PORT, () => {
|
||||
}
|
||||
});
|
||||
|
||||
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;
|
||||
|
||||
const ip = clientIp(req);
|
||||
connectionsPerIp.set(ip, (connectionsPerIp.get(ip) ?? 0) + 1);
|
||||
|
||||
// The hosted UI updates on every push, the gateway only when its image is
|
||||
// pulled, so the browser must not assume a feature exists just because it
|
||||
// knows about it. A gateway without "hello" (before v0.15) supports the
|
||||
// v0.14 feature set, streaming included; anything newer gets a name here.
|
||||
socket.send(JSON.stringify({ type: "hello", features: GATEWAY_FEATURES, iceServers: turnServers() }));
|
||||
|
||||
heartbeats.set(socket, { isAlive: true });
|
||||
socket.on("pong", () => {
|
||||
const state = heartbeats.get(socket);
|
||||
@@ -402,10 +679,50 @@ wss.on("connection", (socket: WebSocket) => {
|
||||
});
|
||||
|
||||
socket.on("message", async (raw) => {
|
||||
const msg = JSON.parse(raw.toString());
|
||||
// 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;
|
||||
}
|
||||
if (CONNECT_RATE_LIMIT > 0 && isConnectRateLimited(ip)) {
|
||||
console.warn(`[ratelimit] too many connects from one IP, target host=${msg.host}`);
|
||||
socket.send(
|
||||
JSON.stringify({ type: "error", message: "Too many connection attempts. Please wait a minute." }),
|
||||
);
|
||||
break;
|
||||
}
|
||||
// Replacing a connection on the same socket: tear down the previous
|
||||
// connector so we don't leak processes.
|
||||
if (connection) {
|
||||
@@ -414,6 +731,7 @@ wss.on("connection", (socket: WebSocket) => {
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
liveConnections.delete(connection);
|
||||
connection = undefined;
|
||||
}
|
||||
const options: Ts3ConnectOptions = {
|
||||
@@ -427,15 +745,13 @@ wss.on("connection", (socket: WebSocket) => {
|
||||
privilegeKey: parsePrivilegeKey(msg),
|
||||
};
|
||||
connection = new Ts3Connection(options);
|
||||
liveConnections.add(connection);
|
||||
connection.onEvent((event) => {
|
||||
if (LOG_CONNECTIONS) {
|
||||
if (event.type === "connected") {
|
||||
console.log(
|
||||
`[connections] connected host=${options.host} server=${event.serverName} at=${new Date().toISOString()}`
|
||||
);
|
||||
} else if (event.type === "disconnected") {
|
||||
console.log(`[connections] disconnected host=${options.host} at=${new Date().toISOString()}`);
|
||||
}
|
||||
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));
|
||||
});
|
||||
@@ -544,6 +860,10 @@ wss.on("connection", (socket: WebSocket) => {
|
||||
await connection?.setOutputMuted(msg.muted);
|
||||
break;
|
||||
}
|
||||
case "setClientVolume": {
|
||||
connection?.setClientVolume(Number(msg.clientId), Number(msg.volume));
|
||||
break;
|
||||
}
|
||||
case "setNickname": {
|
||||
await connection?.setNickname(msg.nickname);
|
||||
break;
|
||||
@@ -676,6 +996,10 @@ wss.on("connection", (socket: WebSocket) => {
|
||||
await connection?.uploadFile(msg.channelId, msg.path, msg.dataBase64);
|
||||
break;
|
||||
}
|
||||
case "uploadFileChunk": {
|
||||
await connection?.uploadFileChunk(msg.channelId, msg.path, msg.offset, msg.total, msg.data);
|
||||
break;
|
||||
}
|
||||
case "getPermissionCatalog": {
|
||||
await connection?.getPermissionCatalog();
|
||||
break;
|
||||
@@ -694,6 +1018,8 @@ wss.on("connection", (socket: WebSocket) => {
|
||||
}
|
||||
case "disconnect": {
|
||||
await connection?.disconnect(msg.message ?? "");
|
||||
if (connection) liveConnections.delete(connection);
|
||||
connection = undefined;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -701,10 +1027,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,40 @@
|
||||
import type { IncomingMessage } from "node:http";
|
||||
|
||||
// Behind a reverse proxy / tunnel every request arrives from the proxy's own
|
||||
// address, so per-IP limits would lump all users into one bucket. Only set
|
||||
// TRUST_PROXY when the gateway is reachable *solely* through that proxy:
|
||||
// - "cloudflare": CF-Connecting-IP, which Cloudflare always sets itself.
|
||||
// - "1": the last X-Forwarded-For entry, the one our own proxy appended;
|
||||
// anything before it came from the client and can be made up.
|
||||
const TRUST_PROXY = process.env.TRUST_PROXY;
|
||||
|
||||
export function clientIp(req: IncomingMessage): string {
|
||||
if (TRUST_PROXY === "cloudflare") {
|
||||
const cf = req.headers["cf-connecting-ip"];
|
||||
if (typeof cf === "string" && cf.trim()) return cf.trim();
|
||||
} else if (TRUST_PROXY === "1") {
|
||||
const last = String(req.headers["x-forwarded-for"] ?? "").split(",").at(-1)?.trim();
|
||||
if (last) return last;
|
||||
}
|
||||
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", "ide"]);
|
||||
|
||||
// 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" }));
|
||||
}
|
||||
+140
-68
@@ -59,6 +59,8 @@ export interface ClientInfo {
|
||||
isQuery: boolean;
|
||||
/** Broadcasting a TS6 Stream/Call. The stream id is fetched separately. */
|
||||
isStreaming: boolean;
|
||||
/** MD5 of the avatar (`client_flag_avatar`), empty without one. */
|
||||
avatarHash: string;
|
||||
}
|
||||
|
||||
export interface GroupEntry {
|
||||
@@ -152,6 +154,8 @@ export type Ts3ConnectionEvent =
|
||||
| { type: "audioOut"; pcm: string }
|
||||
| { type: "talkers"; clients: number[] }
|
||||
| { type: "disconnected"; reason: string }
|
||||
| { type: "reconnecting"; reason: string }
|
||||
| { type: "reconnected" }
|
||||
| { type: "error"; message: string }
|
||||
| { type: "channelPasswordRequired"; channelId: number }
|
||||
| ({ type: "serverLog" } & ServerLogEntry)
|
||||
@@ -201,7 +205,7 @@ export type Ts3ConnectionEvent =
|
||||
| { type: "serverGroupList"; entries: GroupEntry[] }
|
||||
| { type: "permissionOverview"; entries: PermissionOverviewEntry[] }
|
||||
| { type: "fileList"; cid: number; path: string; entries: FileListEntry[] }
|
||||
| { type: "fileDownloadData"; cid: number; path: string; data: string }
|
||||
| { type: "fileDownloadChunk"; cid: number; path: string; offset: number; data: string; done: boolean }
|
||||
| { type: "fileUploadDone"; cid: number; path: string }
|
||||
| { type: "permList"; scope: PermScope; id1: number; id2: number | null; entries: PermissionOverviewEntry[] }
|
||||
| { type: "permissionCatalog"; entries: PermissionCatalogEntry[] }
|
||||
@@ -237,6 +241,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) {}
|
||||
|
||||
@@ -248,15 +257,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 {
|
||||
@@ -278,6 +322,7 @@ export class Ts3Connection {
|
||||
has_talk_power: boolean;
|
||||
is_query?: boolean;
|
||||
is_streaming?: boolean;
|
||||
avatar_hash?: string;
|
||||
}
|
||||
|
||||
interface RawChannelInfo {
|
||||
@@ -319,6 +364,8 @@ export class Ts3Connection {
|
||||
| { type: "audioOut"; pcm: string }
|
||||
| { type: "talkers"; clients: number[] }
|
||||
| { type: "disconnected"; reason: string }
|
||||
| { type: "reconnecting"; reason: string }
|
||||
| { type: "reconnected" }
|
||||
| { type: "error"; message: string }
|
||||
| { type: "channelPasswordRequired"; channel_id: number }
|
||||
| ({ type: "serverLog" } & ServerLogEntry)
|
||||
@@ -404,7 +451,7 @@ export class Ts3Connection {
|
||||
entries: { name: string; description: string; value: number; negated: boolean; skip: boolean }[];
|
||||
}
|
||||
| { type: "fileList"; cid: number; path: string; entries: FileListEntry[] }
|
||||
| { type: "fileDownloadData"; cid: number; path: string; data: string }
|
||||
| { type: "fileDownloadChunk"; cid: number; path: string; offset: number; data: string; done: boolean }
|
||||
| { type: "fileUploadDone"; cid: number; path: string }
|
||||
| { type: "permList"; scope: PermScope; id1: number; id2: number | null; entries: PermissionOverviewEntry[] }
|
||||
| { type: "permissionCatalog"; entries: PermissionCatalogEntry[] }
|
||||
@@ -453,6 +500,7 @@ export class Ts3Connection {
|
||||
hasTalkPower: c.has_talk_power,
|
||||
isQuery: Boolean(c.is_query),
|
||||
isStreaming: Boolean(c.is_streaming),
|
||||
avatarHash: c.avatar_hash ?? "",
|
||||
})),
|
||||
ownClientId: event.own_client_id ?? 0,
|
||||
serverMaxClients: event.server_max_clients ?? 0,
|
||||
@@ -564,6 +612,7 @@ export class Ts3Connection {
|
||||
});
|
||||
|
||||
this.child.on("exit", (code) => {
|
||||
this.childGone = true;
|
||||
if (code !== 0) {
|
||||
this.emit({ type: "error", message: `Connector exited with code ${code}` });
|
||||
}
|
||||
@@ -576,7 +625,7 @@ export class Ts3Connection {
|
||||
// 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.child?.stdin.write(`switch ${id}${passwordArg}\n`);
|
||||
this.writeLine(`switch ${id}${passwordArg}`);
|
||||
}
|
||||
|
||||
async moveClient(clientId: number, channelId: number, channelPassword?: string): Promise<void> {
|
||||
@@ -584,30 +633,30 @@ export class Ts3Connection {
|
||||
const cid = Number(channelId);
|
||||
if (!Number.isFinite(clid) || !Number.isFinite(cid)) return;
|
||||
const passwordArg = channelPassword ? ` ${Buffer.from(channelPassword, "utf8").toString("base64")}` : "";
|
||||
this.child?.stdin.write(`moveclient ${clid} ${cid}${passwordArg}\n`);
|
||||
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
|
||||
@@ -631,95 +680,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
|
||||
@@ -736,73 +785,84 @@ 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}`);
|
||||
}
|
||||
|
||||
/** One piece of a chunked upload (see "chunkedUpload" in GATEWAY_FEATURES).
|
||||
* Pieces must arrive in order; offset 0 starts the upload and the piece
|
||||
* that reaches `total` sends it. Keeps every message small, unlike
|
||||
* uploadFile above, which only stays for clients from before the split. */
|
||||
async uploadFileChunk(channelId: number, path: string, offset: number, total: number, dataBase64: string): Promise<void> {
|
||||
if (![channelId, offset, total].every(Number.isSafeInteger)) return;
|
||||
if (typeof dataBase64 !== "string" || !/^[A-Za-z0-9+/]*={0,2}$/.test(dataBase64)) return;
|
||||
const sanitizedPath = path.replace(/[\r\n\t]+/g, " ").trim();
|
||||
this.writeLine(`ftuploadchunk ${channelId}\t${offset}\t${total}\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.child?.stdin.write(`streaminfo ${clientId}\n`);
|
||||
this.writeLine(`streaminfo ${clientId}`);
|
||||
}
|
||||
|
||||
/** Ask the client publishing a TS6 stream to let us watch. The answer comes
|
||||
@@ -811,12 +871,12 @@ export class Ts3Connection {
|
||||
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.child?.stdin.write(`streamjoin ${id} ${clientId} ${sanitized}\n`);
|
||||
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.child?.stdin.write(`streamleave ${id} ${clientId}\n`);
|
||||
if (id) this.writeLine(`streamleave ${id} ${clientId}`);
|
||||
}
|
||||
|
||||
/** Relays one signaling payload (SDP answer, ICE candidate) to a stream peer.
|
||||
@@ -826,7 +886,7 @@ export class Ts3Connection {
|
||||
* stdin protocol. */
|
||||
async sendStreamSignal(streamId: string, clientId: number, payload: unknown): Promise<void> {
|
||||
const id = streamId.replace(/[\s]+/g, "");
|
||||
if (id) this.child?.stdin.write(`streamsignal ${id} ${clientId} ${JSON.stringify(payload)}\n`);
|
||||
if (id) this.writeLine(`streamsignal ${id} ${clientId} ${JSON.stringify(payload)}`);
|
||||
}
|
||||
|
||||
/** Announces a stream we publish. The server assigns the id and reports it
|
||||
@@ -841,7 +901,7 @@ export class Ts3Connection {
|
||||
viewerLimit: options.viewerLimit,
|
||||
audio: options.audio,
|
||||
};
|
||||
this.child?.stdin.write(`streamsetup ${JSON.stringify(payload)}\n`);
|
||||
this.writeLine(`streamsetup ${JSON.stringify(payload)}`);
|
||||
}
|
||||
|
||||
/** Accepts or refuses a viewer that asked to watch our stream. On accept,
|
||||
@@ -863,49 +923,61 @@ export class Ts3Connection {
|
||||
offer,
|
||||
decision: accept ? 1 : 0,
|
||||
};
|
||||
this.child?.stdin.write(`streamrespond ${JSON.stringify(payload)}\n`);
|
||||
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.child?.stdin.write(`streamstop ${id} ${sanitized}\n`);
|
||||
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"}`);
|
||||
}
|
||||
|
||||
/** Playback volume for one speaker, mixed in the connector (1 = unchanged). */
|
||||
setClientVolume(clientId: number, volume: number): void {
|
||||
if (Number.isInteger(clientId) && Number.isFinite(volume)) this.writeLine(`clientvolume ${clientId} ${volume}`);
|
||||
}
|
||||
|
||||
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: 5914885e8a...2e7794928f.
Generated
+7
-96
@@ -8,6 +8,7 @@
|
||||
"name": "webspeak3-web",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@ennuicastr/webrtcaec3.js": "^0.3.0",
|
||||
"fflate": "^0.8.3",
|
||||
"react": "^19.2.7",
|
||||
"react-dom": "^19.2.7"
|
||||
@@ -1619,6 +1620,12 @@
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@ennuicastr/webrtcaec3.js": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@ennuicastr/webrtcaec3.js/-/webrtcaec3.js-0.3.0.tgz",
|
||||
"integrity": "sha512-ZfijX3Pzqr2zY2nTBE+APGB4X8q3up5vqQgmuolCvC2WTYYWvivf3GGVFZnTr6n/kZa9w3Y5P4ugwcrOmsqXZQ==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/@isaacs/cliui": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-9.0.0.tgz",
|
||||
@@ -1698,9 +1705,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1869,9 +1873,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1889,9 +1890,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1909,9 +1907,6 @@
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1929,9 +1924,6 @@
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1949,9 +1941,6 @@
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1969,9 +1958,6 @@
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1989,9 +1975,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2009,9 +1992,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2182,9 +2162,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2202,9 +2179,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2222,9 +2196,6 @@
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2242,9 +2213,6 @@
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2262,9 +2230,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2282,9 +2247,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2617,9 +2579,6 @@
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2634,9 +2593,6 @@
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2651,9 +2607,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2668,9 +2621,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2685,9 +2635,6 @@
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2702,9 +2649,6 @@
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2719,9 +2663,6 @@
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2736,9 +2677,6 @@
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2753,9 +2691,6 @@
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2770,9 +2705,6 @@
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2787,9 +2719,6 @@
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2804,9 +2733,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2821,9 +2747,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -4891,9 +4814,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -4915,9 +4835,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -4939,9 +4856,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -4963,9 +4877,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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`));
|
||||
+292
-20
@@ -12,7 +12,7 @@
|
||||
--border: #b7bcc3;
|
||||
--border-soft: #d3d7db;
|
||||
--text: #1a1a1a;
|
||||
--text-muted: #888;
|
||||
--text-muted: #6b6b6b;
|
||||
--accent: #2b4a6b;
|
||||
--input-bg: #ffffff;
|
||||
--input-text: #1a1a1a;
|
||||
@@ -74,7 +74,21 @@
|
||||
}
|
||||
|
||||
/* Nova: alternate design, independent of the light/dark toggle (always dark). */
|
||||
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap");
|
||||
/* Self-hosted (OFL) so no visitor IP goes to Google Fonts. */
|
||||
@font-face {
|
||||
font-family: "Manrope";
|
||||
font-weight: 500 800;
|
||||
font-display: swap;
|
||||
src: url("./assets/fonts/manrope-latin.woff2") format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Manrope";
|
||||
font-weight: 500 800;
|
||||
font-display: swap;
|
||||
src: url("./assets/fonts/manrope-latin-ext.woff2") format("woff2");
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
|
||||
:where(.ts-app.ts-design-nova) {
|
||||
--success: oklch(0.75 0.15 150);
|
||||
@@ -744,6 +758,19 @@
|
||||
color: var(--bg-toolbar-1);
|
||||
}
|
||||
|
||||
/* Nova moves the self/voice toolbar below the chat panel instead of above it
|
||||
(see the > .ts-toolbar reorder rule further up), which adds ~6.7rem of
|
||||
vertical footprint the fixed-position feedback/donate FABs don't know
|
||||
about - without this they land on top of the chat composer's send button. */
|
||||
.ts-app.ts-design-nova .ts-donate-fab,
|
||||
.ts-app.ts-design-nova .ts-feedback-fab-wrap {
|
||||
bottom: 12.25rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-feedback-fab-wrap-stacked {
|
||||
bottom: 15.25rem;
|
||||
}
|
||||
|
||||
/* Client avatar chips: colored initial squares, Nova-only (Standard theme
|
||||
keeps its plain icon + name row). */
|
||||
.ts-client-avatar {
|
||||
@@ -1404,6 +1431,33 @@
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.ts-avatar-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
.ts-info-avatar {
|
||||
display: block;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
object-fit: cover;
|
||||
border-radius: 6px;
|
||||
margin: 0.2rem 0 0.4rem;
|
||||
}
|
||||
|
||||
.ts-menu-volume input {
|
||||
flex: 1;
|
||||
min-width: 6rem;
|
||||
}
|
||||
|
||||
.ts-menu-volume-value {
|
||||
min-width: 2.6rem;
|
||||
text-align: right;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ts-menu-item-shortcut {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
@@ -1964,6 +2018,19 @@
|
||||
padding-left: 1.1rem;
|
||||
}
|
||||
|
||||
/* Double-clicking UI controls (channels, users, tabs, menus) must not select text.
|
||||
Chat, log and info panel stay selectable. */
|
||||
.ts-app :is(.ts-row, .ts-menubar, .ts-toolbar, .ts-chat-tabs, .gts-connection-tabs, .ts-speaking-now, button) {
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* Safari would otherwise block typing/selecting in inputs inside those areas */
|
||||
.ts-app :is(input, textarea) {
|
||||
-webkit-user-select: text;
|
||||
user-select: text;
|
||||
}
|
||||
|
||||
.ts-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1976,6 +2043,44 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ts-app .ts-row:focus-visible,
|
||||
.ts-plain-button:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
/* A real <button> that looks like the <span>/<li> text it replaced. :where()
|
||||
keeps this at zero specificity, so every theme rule still wins. */
|
||||
:where(.ts-plain-button) {
|
||||
font: inherit;
|
||||
color: inherit;
|
||||
background: none;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
cursor: inherit;
|
||||
text-align: inherit;
|
||||
}
|
||||
|
||||
:where(li > .ts-plain-button) {
|
||||
display: block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.ts-tree-search {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
margin: 0 0 0.3rem;
|
||||
background: var(--input-bg);
|
||||
color: var(--input-text);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 3px;
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ts-server-row {
|
||||
font-weight: 600;
|
||||
color: var(--accent);
|
||||
@@ -2315,6 +2420,8 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
/* without this the panel grows with its lines instead of scrolling them */
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.ts-chat-tabs {
|
||||
@@ -2372,6 +2479,55 @@
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.ts-chat-bubble a {
|
||||
color: var(--accent);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.ts-chat-bubble code {
|
||||
font-family: ui-monospace, monospace;
|
||||
font-size: 0.95em;
|
||||
padding: 0 0.25em;
|
||||
border: 1px solid var(--border-soft);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.ts-bb-list {
|
||||
margin: 0.15em 0;
|
||||
padding-left: 1.6em;
|
||||
}
|
||||
|
||||
.ts-bb-quote {
|
||||
margin: 0.15em 0;
|
||||
padding-left: 0.6em;
|
||||
border-left: 3px solid var(--border-soft);
|
||||
}
|
||||
|
||||
.ts-bb-hr {
|
||||
border: 0;
|
||||
border-top: 1px solid var(--border-soft);
|
||||
margin: 0.3em 0;
|
||||
}
|
||||
|
||||
.ts-bb-h {
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.ts-bb-h1 {
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
.ts-bb-h2 {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.ts-bb-img {
|
||||
max-width: 100%;
|
||||
max-height: 240px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.ts-chat-from {
|
||||
font-weight: 600;
|
||||
color: var(--accent);
|
||||
@@ -2466,7 +2622,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 15;
|
||||
z-index: 550;
|
||||
}
|
||||
|
||||
.ts-dialog {
|
||||
@@ -3365,28 +3521,142 @@
|
||||
background: conic-gradient(from 180deg, #7fb0e8, #ff8fab, #ffd166, #7fb0e8);
|
||||
}
|
||||
|
||||
.ts-design-theme-card-screenshot {
|
||||
width: 100%;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border-soft);
|
||||
object-fit: cover;
|
||||
max-height: 120px;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-rating {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.1rem;
|
||||
margin-top: 0.3rem;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-star {
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: var(--accent);
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-star:disabled {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-rating-count {
|
||||
margin-left: 0.3rem;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ts-design-theme-card-actions {
|
||||
display: flex;
|
||||
gap: 0.3rem;
|
||||
width: 100%;
|
||||
gap: 0.4rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-actions button {
|
||||
flex: 1;
|
||||
padding: 0.25rem 0;
|
||||
border: 1px solid var(--border-soft);
|
||||
border-radius: 3px;
|
||||
background: var(--input-bg);
|
||||
color: var(--text-muted);
|
||||
.ts-design-theme-card-actions button,
|
||||
.ts-design-store-card-actions button,
|
||||
.ts-design-store-publish-submit,
|
||||
.ts-design-custom-actions button {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
background: linear-gradient(to bottom, var(--button-bg-1), var(--button-bg-2));
|
||||
color: var(--text);
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-actions button:hover {
|
||||
color: var(--text);
|
||||
.ts-design-theme-card-actions button:hover:not(:disabled),
|
||||
.ts-design-store-card-actions button:hover:not(:disabled),
|
||||
.ts-design-store-publish-submit:hover:not(:disabled),
|
||||
.ts-design-custom-actions button:hover:not(:disabled) {
|
||||
background: linear-gradient(to bottom, var(--button-bg-hover-1), var(--button-bg-hover-2));
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.ts-design-theme-card-actions button:disabled,
|
||||
.ts-design-store-card-actions button:disabled,
|
||||
.ts-design-store-publish-submit:disabled,
|
||||
.ts-design-custom-actions button:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* Icon row (edit/duplicate/export/delete) - side by side, flex:1 so the four
|
||||
of them together always fill the card's full width. */
|
||||
.ts-design-theme-card-actions button {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 2.6rem;
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
/* Delete is destructive - always red, regardless of the active design's
|
||||
accent color. Selector nests one level deeper than the shared rules
|
||||
above so it reliably wins the cascade instead of relying on source order. */
|
||||
.ts-design-theme-card-actions .ts-design-theme-card-delete {
|
||||
background: linear-gradient(to bottom, #d64545, #b23a3a);
|
||||
border-color: #8f2c2c;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-actions .ts-design-theme-card-delete:hover:not(:disabled) {
|
||||
background: linear-gradient(to bottom, #e85d5d, #c94444);
|
||||
border-color: #e85d5d;
|
||||
}
|
||||
|
||||
.ts-design-store-card-actions {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.ts-design-store-card-actions button {
|
||||
width: 100%;
|
||||
padding: 0.5rem;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.ts-design-store-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.ts-design-store-header h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ts-design-store-back {
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: var(--accent);
|
||||
cursor: pointer;
|
||||
padding: 0.2rem 0;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.ts-design-store-publish-submit {
|
||||
display: block;
|
||||
margin-top: 0.75rem;
|
||||
padding: 0.5rem 1rem;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.ts-design-custom-actions button {
|
||||
padding: 0.5rem 1rem;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.ts-design-custom-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
@@ -3676,6 +3946,8 @@
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* No theme defines --panel-bg, so the update toast and the feedback bubble
|
||||
are always dark: their text colors are fixed, not the theme's. */
|
||||
.ts-update-toast {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
@@ -3686,7 +3958,7 @@
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
background: var(--panel-bg, #23262e);
|
||||
color: var(--text, #eee);
|
||||
color: #eee;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.5rem;
|
||||
padding: 0.6rem 0.7rem 0.6rem 0.9rem;
|
||||
@@ -3706,7 +3978,7 @@
|
||||
|
||||
.ts-update-toast-dismiss {
|
||||
background: transparent !important;
|
||||
color: var(--text-muted, #999) !important;
|
||||
color: #aaa !important;
|
||||
border: none !important;
|
||||
padding: 0 0.2rem !important;
|
||||
font-size: 12px;
|
||||
@@ -3764,7 +4036,7 @@
|
||||
padding: 0 0.85rem;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.18);
|
||||
background: #ff5e5b;
|
||||
background: #d6403d; /* Ko-fi red, darkened to 4.5:1 for the white label */
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
@@ -3776,7 +4048,7 @@
|
||||
}
|
||||
|
||||
.ts-donate-fab:hover {
|
||||
background: #ff4b47;
|
||||
background: #c4362f;
|
||||
transform: scale(1.06);
|
||||
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
@@ -3790,7 +4062,7 @@
|
||||
position: relative;
|
||||
max-width: 13rem;
|
||||
background: var(--panel-bg, #23262e);
|
||||
color: var(--text, #eee);
|
||||
color: #eee;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.6rem;
|
||||
padding: 0.5rem 0.7rem;
|
||||
@@ -3822,7 +4094,7 @@
|
||||
border-radius: 50%;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--panel-bg, #23262e);
|
||||
color: var(--text-muted, #999);
|
||||
color: #aaa;
|
||||
font-size: 10px;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
|
||||
+1651
-287
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);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
Copyright 2018 The Manrope Project Authors (https://github.com/googlefonts/manrope)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
@@ -0,0 +1,93 @@
|
||||
Copyright 2011, The VT323 Project Authors (peter.hull@oikoi.com)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+146
-12
@@ -39,7 +39,12 @@ interface DemoClient {
|
||||
const DEMO_CHANNELS: DemoChannel[] = [
|
||||
{ id: 1, parent: 0, order: 0, name: "Lobby", topic: "Welcome to the WebSpeak3 demo!", codec: "Opus Voice", maxClients: null, hasPassword: false },
|
||||
{ id: 2, parent: 0, order: 1, name: "Gaming", topic: "", codec: "Opus Voice", maxClients: 10, hasPassword: false },
|
||||
{ id: 3, parent: 0, order: 2, name: "AFK", topic: "", codec: "Opus Voice", maxClients: null, hasPassword: false },
|
||||
{ id: 4, parent: 2, order: 0, name: "Squad 1", topic: "", codec: "Opus Voice", maxClients: 5, hasPassword: false },
|
||||
{ id: 5, parent: 2, order: 1, name: "Squad 2", topic: "", codec: "Opus Voice", maxClients: 5, hasPassword: false },
|
||||
{ id: 6, parent: 0, order: 2, name: "Music", topic: "Requests in chat", codec: "Opus Music", maxClients: null, hasPassword: false },
|
||||
{ id: 7, parent: 0, order: 3, name: "Talk", topic: "", codec: "Opus Voice", maxClients: null, hasPassword: false },
|
||||
{ id: 8, parent: 7, order: 0, name: "Meeting Room", topic: "Password: ask an admin", codec: "Opus Voice", maxClients: 8, hasPassword: true },
|
||||
{ id: 3, parent: 0, order: 4, name: "AFK", topic: "", codec: "Opus Voice", maxClients: null, hasPassword: false },
|
||||
];
|
||||
|
||||
const DEMO_CHANNEL_GROUPS = [
|
||||
@@ -154,6 +159,30 @@ function demoPermKey(scope: string, id1: number, id2?: number): string {
|
||||
|
||||
const SELF_ID = 101;
|
||||
|
||||
// Random visitors that join, wander around, chat and leave again (see scriptServerLife).
|
||||
const DEMO_VISITOR_NAMES = ["Mia", "Noah", "Lena", "Kai", "Zoe", "Finn", "Ava", "Leo", "Ivy", "Max"];
|
||||
const DEMO_COUNTRIES = ["DE", "US", "GB", "FR", "NL", "PL", "SE", "CZ", ""];
|
||||
const DEMO_CHAT_LINES = [
|
||||
"hey all",
|
||||
"anyone up for a round later?",
|
||||
"brb, getting coffee",
|
||||
"lol",
|
||||
"can you hear me?",
|
||||
"gg",
|
||||
"my mic was muted, sorry",
|
||||
"back",
|
||||
"who's hosting tonight?",
|
||||
"check out https://github.com/Moepchi/webspeak3",
|
||||
];
|
||||
const DEMO_PM_LINES = [
|
||||
"hey, got a sec?",
|
||||
"you coming to Gaming later?",
|
||||
"thanks for the help earlier!",
|
||||
"can you move me to Gaming?",
|
||||
];
|
||||
|
||||
const pick = <T,>(items: T[]): T => items[Math.floor(Math.random() * items.length)];
|
||||
|
||||
/**
|
||||
* Drop-in stand-in for a real WebSocket. Implements the subset of the
|
||||
* WebSocket interface App.tsx actually uses (onopen/onmessage/onerror/
|
||||
@@ -170,8 +199,8 @@ export class DemoSocket {
|
||||
private closed = false;
|
||||
private timers: number[] = [];
|
||||
private selfChannel = 1;
|
||||
private selfChannelGroup = 4;
|
||||
private selfServerGroups = new Set<number>([4]);
|
||||
private selfChannelGroup = 1;
|
||||
private selfServerGroups = new Set<number>([1]);
|
||||
|
||||
constructor() {
|
||||
this.after(400, () => {
|
||||
@@ -206,6 +235,8 @@ export class DemoSocket {
|
||||
|
||||
private after(ms: number, fn: () => void) {
|
||||
const id = window.setTimeout(() => {
|
||||
// Drop fired ids so the looping talker script doesn't grow the list forever.
|
||||
this.timers = this.timers.filter((t) => t !== id);
|
||||
if (this.closed) return;
|
||||
fn();
|
||||
}, ms);
|
||||
@@ -234,6 +265,8 @@ export class DemoSocket {
|
||||
});
|
||||
this.after(150, () => this.sendChannels(nickname));
|
||||
this.scriptServerLog(nickname);
|
||||
this.scriptTalkers();
|
||||
this.after(6000, () => this.scriptServerLife());
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -258,7 +291,7 @@ export class DemoSocket {
|
||||
this.after(80, () => this.emit({ type: "serverMessage", from: this.lastNickname, message: msg.message }));
|
||||
break;
|
||||
case "sendPrivateMessage": {
|
||||
const partner = DEMO_NPCS.find((c) => c.id === msg.clientId);
|
||||
const partner = this.npcs().find((c) => c.id === msg.clientId);
|
||||
this.after(80, () =>
|
||||
this.emit({
|
||||
type: "privateMessage",
|
||||
@@ -268,10 +301,21 @@ export class DemoSocket {
|
||||
fromSelf: true,
|
||||
})
|
||||
);
|
||||
if (partner && !partner.away) {
|
||||
this.after(1500 + Math.random() * 2500, () =>
|
||||
this.emit({
|
||||
type: "privateMessage",
|
||||
partnerId: partner.id,
|
||||
partnerName: partner.name,
|
||||
message: pick(["ok 👍", "haha sure", "one sec", "sounds good", "yep"]),
|
||||
fromSelf: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "sendPoke": {
|
||||
const partner = DEMO_NPCS.find((c) => c.id === msg.clientId);
|
||||
const partner = this.npcs().find((c) => c.id === msg.clientId);
|
||||
this.after(400, () =>
|
||||
this.emit({ type: "poke", from: partner?.name ?? "Someone", message: "(demo poke - no reply expected)" })
|
||||
);
|
||||
@@ -284,7 +328,7 @@ export class DemoSocket {
|
||||
if (clientId === SELF_ID) {
|
||||
this.selfChannel = channelId;
|
||||
} else {
|
||||
const npc = DEMO_NPCS.find((c) => c.id === clientId);
|
||||
const npc = this.npcs().find((c) => c.id === clientId);
|
||||
if (npc) npc.channel = channelId;
|
||||
}
|
||||
this.after(120, () => this.sendChannels(this.lastNickname));
|
||||
@@ -442,14 +486,14 @@ export class DemoSocket {
|
||||
this.after(300, () => this.emit({ type: "serverGroupList", entries: DEMO_SERVER_GROUPS }));
|
||||
break;
|
||||
case "setChannelGroup": {
|
||||
const npc = DEMO_NPCS.find((c) => c.databaseId === msg.clientDbId);
|
||||
const npc = this.npcs().find((c) => c.databaseId === msg.clientDbId);
|
||||
if (npc) npc.channelGroup = msg.channelGroupId;
|
||||
else if (msg.clientDbId === 1) this.selfChannelGroup = msg.channelGroupId;
|
||||
this.after(200, () => this.sendChannels(this.lastNickname));
|
||||
break;
|
||||
}
|
||||
case "addServerGroup": {
|
||||
const npc = DEMO_NPCS.find((c) => c.databaseId === msg.clientDbId);
|
||||
const npc = this.npcs().find((c) => c.databaseId === msg.clientDbId);
|
||||
if (npc) {
|
||||
if (!npc.serverGroups.includes(msg.serverGroupId)) npc.serverGroups.push(msg.serverGroupId);
|
||||
} else if (msg.clientDbId === 1) {
|
||||
@@ -459,7 +503,7 @@ export class DemoSocket {
|
||||
break;
|
||||
}
|
||||
case "removeServerGroup": {
|
||||
const npc = DEMO_NPCS.find((c) => c.databaseId === msg.clientDbId);
|
||||
const npc = this.npcs().find((c) => c.databaseId === msg.clientDbId);
|
||||
if (npc) {
|
||||
npc.serverGroups = npc.serverGroups.filter((g) => g !== msg.serverGroupId);
|
||||
} else if (msg.clientDbId === 1) {
|
||||
@@ -611,11 +655,101 @@ export class DemoSocket {
|
||||
type: "serverLog",
|
||||
kind: "clientChannelGroupAssigned",
|
||||
client: nickname,
|
||||
group: "Guest",
|
||||
group: "Channel Admin",
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private visitors: DemoClient[] = [];
|
||||
private nextVisitorId = 200;
|
||||
|
||||
private npcs(): DemoClient[] {
|
||||
return [...DEMO_NPCS, ...this.visitors];
|
||||
}
|
||||
|
||||
/** Random voice activity so the talking indicators (tree, speaker cards) are
|
||||
* visible: every unmuted client in your channel talks now and then, sometimes
|
||||
* over each other. Like real TS, only your own channel is audible. */
|
||||
private scriptTalkers() {
|
||||
const audible = this.npcs()
|
||||
.filter(
|
||||
(c) =>
|
||||
c.channel === this.selfChannel &&
|
||||
c.hasTalkPower &&
|
||||
!c.inputMuted &&
|
||||
c.inputHardwareEnabled &&
|
||||
!c.away
|
||||
)
|
||||
.filter(() => Math.random() < 0.35)
|
||||
.map((c) => c.id);
|
||||
this.emit({ type: "talkers", clients: audible });
|
||||
this.after(1200 + Math.random() * 2300, () => this.scriptTalkers());
|
||||
}
|
||||
|
||||
/** One random server event every few seconds: visitors join, switch
|
||||
* channels and leave, people write in the channel or send you a PM. */
|
||||
private scriptServerLife() {
|
||||
const roll = Math.random();
|
||||
const freeNames = DEMO_VISITOR_NAMES.filter((n) => !this.visitors.some((v) => v.name === n));
|
||||
if (roll < 0.3 && this.visitors.length < 6 && freeNames.length > 0) {
|
||||
const id = this.nextVisitorId++;
|
||||
const visitor: DemoClient = {
|
||||
id,
|
||||
channel: pick(DEMO_CHANNELS.filter((c) => c.id !== 3 && !c.hasPassword)).id,
|
||||
name: pick(freeNames),
|
||||
inputMuted: Math.random() < 0.15,
|
||||
outputMuted: Math.random() < 0.1,
|
||||
inputHardwareEnabled: true,
|
||||
away: false,
|
||||
awayMessage: "",
|
||||
isChannelCommander: false,
|
||||
country: pick(DEMO_COUNTRIES),
|
||||
uid: `demo-uid-visitor-${id}`,
|
||||
databaseId: id,
|
||||
channelGroup: 3,
|
||||
serverGroups: [pick([3, 4, 4])],
|
||||
hasTalkPower: true,
|
||||
};
|
||||
this.visitors.push(visitor);
|
||||
this.emit({ type: "serverLog", kind: "clientJoin", client: visitor.name, channel: this.channelName(visitor.channel) });
|
||||
this.sendChannels(this.lastNickname);
|
||||
} else if (roll < 0.37 && this.visitors.length > 0) {
|
||||
const visitor = pick(this.visitors);
|
||||
this.visitors = this.visitors.filter((v) => v !== visitor);
|
||||
this.emit({ type: "serverLog", kind: "clientLeave", client: visitor.name });
|
||||
this.sendChannels(this.lastNickname);
|
||||
} else if (roll < 0.72) {
|
||||
// Anyone wanders, not just visitors - otherwise the tree looks frozen.
|
||||
const visitor = pick(this.npcs());
|
||||
const target = pick(DEMO_CHANNELS.filter((c) => c.id !== visitor.channel));
|
||||
this.emit({
|
||||
type: "serverLog",
|
||||
kind: "clientChannelSwitch",
|
||||
client: visitor.name,
|
||||
fromChannel: this.channelName(visitor.channel),
|
||||
toChannel: target.name,
|
||||
});
|
||||
visitor.channel = target.id;
|
||||
visitor.away = target.id === 3;
|
||||
this.sendChannels(this.lastNickname);
|
||||
} else if (roll < 0.92) {
|
||||
const here = this.npcs().filter((c) => c.channel === this.selfChannel && !c.away);
|
||||
if (here.length > 0) this.emit({ type: "chatMessage", from: pick(here).name, message: pick(DEMO_CHAT_LINES) });
|
||||
} else {
|
||||
const sender = pick(this.npcs().filter((c) => !c.away));
|
||||
if (sender) {
|
||||
this.emit({
|
||||
type: "privateMessage",
|
||||
partnerId: sender.id,
|
||||
partnerName: sender.name,
|
||||
message: pick(DEMO_PM_LINES),
|
||||
fromSelf: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
this.after(4000 + Math.random() * 6000, () => this.scriptServerLife());
|
||||
}
|
||||
|
||||
private sendChannels(nickname: string) {
|
||||
this.lastNickname = nickname;
|
||||
const self: DemoClient = {
|
||||
@@ -638,10 +772,10 @@ export class DemoSocket {
|
||||
this.emit({
|
||||
type: "channels",
|
||||
channels: DEMO_CHANNELS,
|
||||
clients: [self, ...DEMO_NPCS],
|
||||
clients: [self, ...this.npcs()],
|
||||
ownClientId: SELF_ID,
|
||||
serverMaxClients: 32,
|
||||
serverClientsOnline: 1 + DEMO_NPCS.length,
|
||||
serverClientsOnline: 1 + this.npcs().length,
|
||||
serverChannelsOnline: DEMO_CHANNELS.length,
|
||||
});
|
||||
}
|
||||
|
||||
+6
-2
@@ -1,10 +1,12 @@
|
||||
/* eslint-disable react/only-export-components -- provider and its hooks belong together; only costs fast refresh */
|
||||
import { createContext, useContext, useEffect, useState, type ReactNode } from "react";
|
||||
import de from "./locales/de.json";
|
||||
import en from "./locales/en.json";
|
||||
import zhCN from "./locales/zh-CN.json";
|
||||
import fa from "./locales/fa.json";
|
||||
import csCZ from "./locales/cs-CZ.json";
|
||||
|
||||
export type Lang = "de" | "en" | "zh-CN" | "fa";
|
||||
export type Lang = "de" | "en" | "zh-CN" | "fa" | "cs-CZ";
|
||||
const RTL_LANGS = new Set<Lang>(["fa"]);
|
||||
export type LangPref = "auto" | Lang;
|
||||
|
||||
@@ -21,6 +23,7 @@ const translations: Record<Lang, Record<string, string>> = {
|
||||
en,
|
||||
"zh-CN": zhCN,
|
||||
fa,
|
||||
"cs-CZ": csCZ,
|
||||
};
|
||||
|
||||
function detectSystemLang(): Lang {
|
||||
@@ -28,6 +31,7 @@ function detectSystemLang(): Lang {
|
||||
const normalized = nav?.toLowerCase() ?? "en";
|
||||
if (normalized.startsWith("zh")) return "zh-CN";
|
||||
if (normalized.startsWith("fa")) return "fa";
|
||||
if (normalized.startsWith("cs")) return "cs-CZ";
|
||||
return normalized.startsWith("de") ? "de" : "en";
|
||||
}
|
||||
|
||||
@@ -37,7 +41,7 @@ export function resolveLang(pref: LangPref): Lang {
|
||||
|
||||
export function loadLangPref(): LangPref {
|
||||
const raw = localStorage.getItem(LANGUAGE_KEY);
|
||||
return raw === "de" || raw === "en" || raw === "zh-CN" || raw === "fa" || raw === "auto" ? raw : "auto";
|
||||
return raw === "de" || raw === "en" || raw === "zh-CN" || raw === "fa" || raw === "cs-CZ" || raw === "auto" ? raw : "auto";
|
||||
}
|
||||
|
||||
export function saveLangPref(pref: LangPref) {
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
import { Fragment, type ReactNode } from "react";
|
||||
|
||||
// TeamSpeak chat text -> React elements (never HTML strings, so message text
|
||||
// can't inject markup). Understands the TS3/TS6 BBCode tags plus the basic
|
||||
// Markdown TS6 sends: Markdown is first rewritten into BBCode, then a single
|
||||
// parser renders both. Unknown tags stay literal, unclosed tags close at the end.
|
||||
// ponytail: no [table], nested Markdown lists/quotes, ==highlight==, ||spoiler||,
|
||||
// math or mermaid - add them once people actually send them.
|
||||
|
||||
const TAG_REGEX =
|
||||
/\[(\/?)(b|i|u|s|url|img|color|size|left|center|right|list|\*|hr|noparse|md-code|md-quote|md-h)(?:=([^\]]*))?\]/gi;
|
||||
const BLOCK_TAGS = new Set(["left", "center", "right", "list", "*", "hr", "md-quote", "md-h"]);
|
||||
export const BARE_URL_REGEX = /https?:\/\/[^\s<>"\[\]]+/g;
|
||||
const COLOR_REGEX = /^(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z]+)$/i;
|
||||
const LIST_STYLES: Record<string, string> = { "1": "decimal", a: "lower-alpha", A: "upper-alpha", i: "lower-roman", I: "upper-roman" };
|
||||
|
||||
// Spans Markdown must not touch: noparse, tagged links, inline code, Markdown
|
||||
// links/images, <autolinks>, bare URLs and backslash escapes.
|
||||
const MD_SPANS = new RegExp(
|
||||
[
|
||||
String.raw`\[noparse\][\s\S]*?\[\/noparse\]`,
|
||||
String.raw`\[(url|img)(?:=[^\]]*)?\][\s\S]*?\[\/\1\]`,
|
||||
String.raw`\x60([^\x60\n]+)\x60`,
|
||||
String.raw`(!?)\[([^\]\n]*)\]\(<?(https?:\/\/[^\s)>]+)>?(?:\s[^)\n]*)?\)`,
|
||||
String.raw`<(https?:\/\/[^\s>]+)>`,
|
||||
BARE_URL_REGEX.source,
|
||||
String.raw`\\([\\\x60*_{}\[\]()#+\-.!~>|=])`,
|
||||
].join("|"),
|
||||
"gi",
|
||||
);
|
||||
// Outgoing: an already-tagged link or Markdown span (left alone) or a bare URL (wrapped).
|
||||
const WRAP_REGEX = new RegExp(
|
||||
String.raw`(\[(url|img)(?:=[^\]]*)?\][\s\S]*?\[\/\2\]|!?\[[^\]\n]*\]\([^)\n]*\)|\x60[^\x60\n]*\x60|<https?:\/\/[^\s>]+>)|` +
|
||||
BARE_URL_REGEX.source,
|
||||
"gi",
|
||||
);
|
||||
|
||||
interface Node {
|
||||
tag: string;
|
||||
arg?: string;
|
||||
children: (Node | string)[];
|
||||
}
|
||||
|
||||
export interface RenderOptions {
|
||||
/** Load [img] /  inline. Off: they render as links, so no remote host sees the reader's IP. */
|
||||
images?: boolean;
|
||||
}
|
||||
|
||||
function emphasis(s: string): string {
|
||||
return s
|
||||
.replace(/\*\*(?=\S)([^\n]*?\S)\*\*/g, "[b]$1[/b]")
|
||||
.replace(/~~(?=\S)([^\n]*?\S)~~/g, "[s]$1[/s]")
|
||||
.replace(/\+\+(?=\S)([^\n]*?\S)\+\+/g, "[u]$1[/u]")
|
||||
.replace(/(^|[^\w*[])\*(?=[^\s\]])([^*\n]*?\S)\*(?![\w*])/g, "$1[i]$2[/i]")
|
||||
.replace(/(^|[^\w_[])_(?=[^\s\]])([^_\n]*?\S)_(?![\w_])/g, "$1[i]$2[/i]");
|
||||
}
|
||||
|
||||
function markdownInline(text: string): string {
|
||||
let out = "";
|
||||
let last = 0;
|
||||
for (const m of text.matchAll(MD_SPANS)) {
|
||||
out += emphasis(text.slice(last, m.index));
|
||||
last = m.index + m[0].length;
|
||||
if (m[2] !== undefined) out += `[md-code][noparse]${m[2]}[/noparse][/md-code]`;
|
||||
else if (m[5] !== undefined) out += m[3] ? `[img]${m[5]}[/img]` : `[url=${m[5]}]${m[4] || m[5]}[/url]`;
|
||||
else if (m[6] !== undefined) out += m[6];
|
||||
else if (m[7] !== undefined) out += `[noparse]${m[7]}[/noparse]`;
|
||||
else out += m[0];
|
||||
}
|
||||
return out + emphasis(text.slice(last));
|
||||
}
|
||||
|
||||
// Line-based Markdown blocks (TS6: one line is one paragraph): lists, quotes,
|
||||
// headings and rules. Consecutive list/quote lines are grouped.
|
||||
function markdownBlocks(text: string): string {
|
||||
const out: { block: boolean; s: string }[] = [];
|
||||
let group = null as { kind: string; items: string[] } | null;
|
||||
const flush = () => {
|
||||
if (!group) return;
|
||||
const s =
|
||||
group.kind === "quote"
|
||||
? `[md-quote]${group.items.join("\n")}[/md-quote]`
|
||||
: `[list${group.kind === "ol" ? "=1" : ""}]${group.items.map((i) => `[*]${i}`).join("")}[/list]`;
|
||||
out.push({ block: true, s });
|
||||
group = null;
|
||||
};
|
||||
for (const line of text.split("\n")) {
|
||||
const item = /^\s*([-*+]|\d+[.)])\s+(.*)$/.exec(line);
|
||||
const quote = /^>(?:\s(.*))?$/.exec(line);
|
||||
const kind = item ? (/\d/.test(item[1]) ? "ol" : "ul") : quote ? "quote" : null;
|
||||
if (kind) {
|
||||
if (group?.kind !== kind) flush();
|
||||
group ??= { kind, items: [] };
|
||||
group.items.push(item ? item[2] : (quote![1] ?? ""));
|
||||
continue;
|
||||
}
|
||||
flush();
|
||||
const heading = /^(#{1,3})\s+(.+)$/.exec(line);
|
||||
if (/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(line)) out.push({ block: true, s: "[hr]" });
|
||||
else if (heading) out.push({ block: true, s: `[md-h=${heading[1].length}]${heading[2]}[/md-h]` });
|
||||
else out.push({ block: false, s: line });
|
||||
}
|
||||
flush();
|
||||
return out.map((e, i) => (i > 0 && !e.block && !out[i - 1].block ? "\n" : "") + e.s).join("");
|
||||
}
|
||||
|
||||
function parse(text: string): Node {
|
||||
const root: Node = { tag: "", children: [] };
|
||||
const stack = [root];
|
||||
const re = new RegExp(TAG_REGEX.source, "gi");
|
||||
let last = 0;
|
||||
for (let m; (m = re.exec(text)); ) {
|
||||
const top = stack[stack.length - 1];
|
||||
if (m.index > last) top.children.push(text.slice(last, m.index));
|
||||
last = re.lastIndex;
|
||||
const tag = m[2].toLowerCase();
|
||||
if (m[1]) {
|
||||
const at = stack.findLastIndex((n) => n.tag === tag);
|
||||
if (at > 0) stack.length = at;
|
||||
else top.children.push(m[0]);
|
||||
} else if (tag === "noparse") {
|
||||
const end = text.toLowerCase().indexOf("[/noparse]", last);
|
||||
const stop = end < 0 ? text.length : end;
|
||||
top.children.push({ tag, children: [text.slice(last, stop)] });
|
||||
last = re.lastIndex = end < 0 ? stop : end + "[/noparse]".length;
|
||||
} else if (tag === "hr") {
|
||||
top.children.push({ tag, children: [] });
|
||||
} else if (tag === "*") {
|
||||
const at = stack.findLastIndex((n) => n.tag === "list");
|
||||
if (at > 0) {
|
||||
stack.length = at + 1;
|
||||
const li: Node = { tag, children: [] };
|
||||
stack[at].children.push(li);
|
||||
stack.push(li);
|
||||
} else top.children.push(m[0]);
|
||||
} else {
|
||||
const node: Node = { tag, arg: m[3], children: [] };
|
||||
top.children.push(node);
|
||||
stack.push(node);
|
||||
}
|
||||
}
|
||||
if (last < text.length) stack[stack.length - 1].children.push(text.slice(last));
|
||||
return root;
|
||||
}
|
||||
|
||||
function safeHref(raw: string): string | null {
|
||||
const url = raw.trim();
|
||||
return /^https?:\/\//i.test(url) ? url : /^www\./i.test(url) ? `https://${url}` : null;
|
||||
}
|
||||
|
||||
function link(href: string, children: ReactNode, key: number) {
|
||||
return (
|
||||
<a key={key} href={href} target="_blank" rel="noopener noreferrer">
|
||||
{children}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
function textNode(text: string, key: number, linkUrls = true): ReactNode {
|
||||
const parts: ReactNode[] = [];
|
||||
text.split("\n").forEach((line, li) => {
|
||||
if (li > 0) parts.push(<br key={`br${li}`} />);
|
||||
let last = 0;
|
||||
if (linkUrls) {
|
||||
for (const m of line.matchAll(BARE_URL_REGEX)) {
|
||||
if (m.index > last) parts.push(line.slice(last, m.index));
|
||||
parts.push(link(m[0], m[0], li * 10000 + m.index));
|
||||
last = m.index + m[0].length;
|
||||
}
|
||||
}
|
||||
if (last < line.length) parts.push(line.slice(last));
|
||||
});
|
||||
return parts.length === 1 && typeof parts[0] === "string" ? parts[0] : <Fragment key={key}>{parts}</Fragment>;
|
||||
}
|
||||
|
||||
function textOf(node: Node): string {
|
||||
return node.children.map((c) => (typeof c === "string" ? c : textOf(c))).join("");
|
||||
}
|
||||
|
||||
function fontSize(arg: string | undefined): string | undefined {
|
||||
const rel = /^([+-])(\d)$/.exec(arg ?? "");
|
||||
if (rel) return `${Math.min(2, Math.max(0.6, 1 + (rel[1] === "+" ? 1 : -1) * Number(rel[2]) * 0.2))}em`;
|
||||
return /^\d{1,3}$/.test(arg ?? "") ? `${Math.min(28, Math.max(6, Number(arg)))}pt` : undefined;
|
||||
}
|
||||
|
||||
function render(node: Node, key: number, opts: RenderOptions): ReactNode {
|
||||
const isBlock = (c: Node | string | undefined) => typeof c === "object" && BLOCK_TAGS.has(c.tag);
|
||||
const kids = () =>
|
||||
node.children.map((c, i, all) => {
|
||||
if (typeof c !== "string") return render(c, i, opts);
|
||||
// Line breaks around block elements are already breaks; drop them.
|
||||
let s = c;
|
||||
if (i === 0 ? isBlock(node) : isBlock(all[i - 1])) s = s.replace(/^\n/, "");
|
||||
if (i === all.length - 1 ? isBlock(node) : isBlock(all[i + 1])) s = s.replace(/\n$/, "");
|
||||
if (node.tag === "list" && !s.trim()) return null;
|
||||
return textNode(s, i);
|
||||
});
|
||||
switch (node.tag) {
|
||||
case "b":
|
||||
return <strong key={key}>{kids()}</strong>;
|
||||
case "i":
|
||||
return <em key={key}>{kids()}</em>;
|
||||
case "u":
|
||||
return <u key={key}>{kids()}</u>;
|
||||
case "s":
|
||||
return <s key={key}>{kids()}</s>;
|
||||
case "color":
|
||||
return (
|
||||
<span key={key} style={node.arg && COLOR_REGEX.test(node.arg) ? { color: node.arg } : undefined}>
|
||||
{kids()}
|
||||
</span>
|
||||
);
|
||||
case "size":
|
||||
return (
|
||||
<span key={key} style={{ fontSize: fontSize(node.arg) }}>
|
||||
{kids()}
|
||||
</span>
|
||||
);
|
||||
case "left":
|
||||
case "center":
|
||||
case "right":
|
||||
return (
|
||||
<div key={key} style={{ textAlign: node.tag }}>
|
||||
{kids()}
|
||||
</div>
|
||||
);
|
||||
case "list": {
|
||||
const style = node.arg ? LIST_STYLES[node.arg] : undefined;
|
||||
return style ? (
|
||||
<ol key={key} className="ts-bb-list" style={{ listStyleType: style }}>
|
||||
{kids()}
|
||||
</ol>
|
||||
) : (
|
||||
<ul key={key} className="ts-bb-list">
|
||||
{kids()}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
case "*":
|
||||
return <li key={key}>{kids()}</li>;
|
||||
case "hr":
|
||||
return <hr key={key} className="ts-bb-hr" />;
|
||||
case "noparse":
|
||||
return textNode(textOf(node), key, false);
|
||||
case "md-code":
|
||||
return <code key={key}>{kids()}</code>;
|
||||
case "md-quote":
|
||||
return (
|
||||
<blockquote key={key} className="ts-bb-quote">
|
||||
{kids()}
|
||||
</blockquote>
|
||||
);
|
||||
case "md-h":
|
||||
return (
|
||||
<div key={key} className={`ts-bb-h ts-bb-h${node.arg}`}>
|
||||
{kids()}
|
||||
</div>
|
||||
);
|
||||
case "url":
|
||||
case "img": {
|
||||
const href = safeHref(node.arg ?? textOf(node));
|
||||
// Plain-text label: a linkified URL or nested tag inside <a> would nest links.
|
||||
const label = textOf(node);
|
||||
if (!href) return <span key={key}>{label}</span>;
|
||||
if (node.tag === "img" && opts.images)
|
||||
return link(href, <img className="ts-bb-img" src={href} alt="" loading="lazy" referrerPolicy="no-referrer" />, key);
|
||||
return link(href, label, key);
|
||||
}
|
||||
default:
|
||||
return <Fragment key={key}>{kids()}</Fragment>;
|
||||
}
|
||||
}
|
||||
|
||||
export function renderBbcode(text: string, opts: RenderOptions = {}): ReactNode {
|
||||
return render(parse(markdownInline(markdownBlocks(text.replace(/\r\n?/g, "\n")))), 0, opts);
|
||||
}
|
||||
|
||||
// Outgoing: native clients send links as [URL]...[/URL] and only link those.
|
||||
export function wrapUrls(text: string): string {
|
||||
return text.replace(WRAP_REGEX, (m, kept) => (kept ? m : `[URL]${m}[/URL]`));
|
||||
}
|
||||
@@ -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,679 @@
|
||||
{
|
||||
"menu.connections": "Připojení",
|
||||
"menu.connections.connect": "Připojit",
|
||||
"menu.connections.disconnectCurrent": "Odpojit od aktuálního serveru",
|
||||
"menu.connections.disconnectAll": "Odpojit od všech serverů",
|
||||
"menu.favorites": "Záložky",
|
||||
"menu.favorites.add": "Přidat záložku",
|
||||
"menu.favorites.manage": "Spravovat záložky",
|
||||
"menu.self": "Já",
|
||||
"menu.rights": "Oprávnění",
|
||||
"menu.rights.serverGroups": "Upravit skupiny serveru...",
|
||||
"menu.rights.channelGroups": "Upravit skupiny kanálů...",
|
||||
"menu.rights.serverPermissions": "Upravit oprávnění serveru...",
|
||||
"menu.rights.channelPermissions": "Upravit oprávnění kanálu...",
|
||||
"menu.rights.overview": "Přehled oprávnění...",
|
||||
"menu.rights.myRights": "Zobrazit moje oprávnění",
|
||||
"menu.extras": "Nástroje",
|
||||
"menu.help": "Nápověda",
|
||||
"menu.help.about": "O WebSpeak3",
|
||||
"menu.help.github": "GitHub",
|
||||
"menu.help.changelog": "Seznam změn",
|
||||
"menu.help.translate": "Pomozte s překladem (Weblate)",
|
||||
"menu.extras.identities": "Identity",
|
||||
"menu.extras.contacts": "Kontakty",
|
||||
"menu.extras.collectedUrls": "Shromážděné URL",
|
||||
"menu.extras.inviteFriend": "Pozvat přítele",
|
||||
"menu.extras.whisperLists": "Seznamy šeptání",
|
||||
"menu.extras.whisperHistory": "Historie šeptání",
|
||||
"menu.extras.clientLog": "Protokol klienta",
|
||||
"menu.extras.banList": "Seznam zákazů",
|
||||
"menu.extras.complaintList": "Seznam stížností",
|
||||
"menu.extras.offlineMessages": "Offline zprávy",
|
||||
"menu.extras.serverQueryLogin": "Přihlášení ServerQuery",
|
||||
"menu.extras.serverLog": "Protokol serveru",
|
||||
"menu.extras.startRecording": "Spustit nahrávání",
|
||||
"menu.extras.startMultitrackRecording": "Spustit vícestopé nahrávání",
|
||||
"menu.extras.stopRecording": "Zastavit nahrávání",
|
||||
"menu.extras.options": "Možnosti",
|
||||
"menu.extras.feedback": "Odeslat zpětnou vazbu",
|
||||
"feedback.fab.nudge": "Co si myslíte o WebSpeak3? Vaše zpětná vazba je vítána!",
|
||||
"donate.label": "Přispět",
|
||||
"donate.title": "Podpořit WebSpeak3 na Ko-fi",
|
||||
"pwa.updateAvailable": "Je k dispozici nová verze",
|
||||
"pwa.reload": "Načíst znovu",
|
||||
"feedback.dialog.title": "Zpětná vazba",
|
||||
"feedback.dialog.intro": "Report bug or share idea to help improve WebSpeak3.",
|
||||
"feedback.dialog.category": "Kategorie",
|
||||
"feedback.dialog.category.bug": "Chyba",
|
||||
"feedback.dialog.category.idea": "Nápad",
|
||||
"feedback.dialog.category.report": "Nahlášení (porušení pravidel/zneužití)",
|
||||
"feedback.dialog.category.other": "Jiné",
|
||||
"feedback.dialog.reportHint": "Nahlášení zůstávají soukromá a nikdy nejsou zveřejněna jako problém na GitHubu. Klidně uveďte dotčený server.",
|
||||
"feedback.dialog.message": "Zpráva",
|
||||
"feedback.dialog.messagePlaceholder": "Co se stalo nebo co navrhujete?",
|
||||
"feedback.dialog.email": "E-mail (volitelné, pro další kontakt – zůstává soukromý a nikdy není zveřejněn)",
|
||||
"feedback.dialog.publishAsIssue": "Publikovat jako veřejný problém na GitHubu",
|
||||
"feedback.dialog.publishAsIssueHint": "Ponechte nezaškrtnuté, pokud chcete, aby vaše zpětná vazba zůstala soukromá a viditelná pouze správci.",
|
||||
"feedback.dialog.publishAsIssueHintBug": "Hlášení chyb jsou vždy zveřejněna jako veřejný problém na GitHubu.",
|
||||
"feedback.dialog.send": "Odeslat",
|
||||
"restartNotice.title": "Krátké přerušení",
|
||||
"restartNotice.body": "Server se za chvíli krátce restartuje. Vaše připojení bude na okamžik přerušeno.",
|
||||
"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.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",
|
||||
"tos.rule4Post": ".",
|
||||
"tos.privacyLinkText": "zásady ochrany soukromí",
|
||||
"tos.rule5Pre": "For abuse or complaints: see",
|
||||
"tos.rule5Post": ".",
|
||||
"tos.legalLinkText": "právní informace (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 rules change.",
|
||||
"tos.accept": "Přijmout",
|
||||
"tos.close": "Zavřít",
|
||||
"feedback.dialog.cancel": "Zrušit",
|
||||
"feedback.dialog.sending": "Odesílání…",
|
||||
"feedback.dialog.success": "Děkujeme za zpětnou vazbu!",
|
||||
"feedback.dialog.successWithIssue": "Děkujeme! Byl vytvořen problém:",
|
||||
"feedback.dialog.error": "Odeslání se nezdařilo. Zkuste to prosím později.",
|
||||
"toolbar.setAway": "Nastavit stav nepřítomen",
|
||||
"toolbar.backOnline": "Zpět online",
|
||||
"toolbar.awayOptions": "Možnosti nepřítomnosti",
|
||||
"toolbar.whisper": "Cíle šeptání",
|
||||
"whisper.channels": "Kanály",
|
||||
"whisper.clients": "Klienti",
|
||||
"whisper.clearAll": "Vymazat všechny cíle šeptání",
|
||||
"toolbar.micEnable": "Zapnout mikrofon",
|
||||
"toolbar.micMute": "Ztlumit mikrofon",
|
||||
"toolbar.micUnmute": "Zrušit ztlumení mikrofonu",
|
||||
"toolbar.vadSensitivity": "Citlivost aktivace hlasem",
|
||||
"tabAudio.start": "Sdílet zvuk karty nebo okna do hlasového kanálu (sluchátka zabrání ozvěně)",
|
||||
"tabAudio.stop": "Zastavit sdílení zvuku",
|
||||
"tabAudio.noAudio": "Nebyl sdílen žádný zvuk. Ve výběru zvolte kartu nebo okno a zapněte jeho zvuk.",
|
||||
"tabAudio.silent": "Ze sdíleného zvuku už 5 sekund nic nepřišlo. Systémový zvuk nefunguje na každém počítači s Windows; místo toho sdílejte kartu prohlížeče (např. Spotify na webu nebo YouTube) se zapnutou volbou „Sdílet zvuk karty“.",
|
||||
"toolbar.muteSound": "Ztlumit zvuk (ohluchit)",
|
||||
"toolbar.unmuteSound": "Zrušit ztlumení zvuku (odhluchit)",
|
||||
"toolbar.chooseOutputDevice": "Vybrat výstupní zařízení",
|
||||
"toolbar.toggleTheme": "Přepnout motiv",
|
||||
"away.setGlobal": "Nastavit globální stav nepřítomen",
|
||||
"away.setGlobalStatus": "Nastavit globální stav nepřítomnosti",
|
||||
"connect.title": "Připojit",
|
||||
"connect.novaSubtitle": "WebSpeak3 běží celý v prohlížeči — není potřeba nic stahovat",
|
||||
"connect.serverAddress": "Přezdívka nebo adresa serveru:",
|
||||
"connect.serverPassword": "Heslo serveru:",
|
||||
"connect.nickname": "Přezdívka:",
|
||||
"connect.phoneticNickname": "Fonetická přezdívka:",
|
||||
"connect.identity": "Identita:",
|
||||
"connect.defaultChannel": "Výchozí kanál:",
|
||||
"connect.recordingProfile": "Profil snímání:",
|
||||
"connect.channelPassword": "Heslo kanálu:",
|
||||
"connect.playbackProfile": "Profil přehrávání:",
|
||||
"connect.onetimeGrant": "Jednorázový klíč oprávnění:",
|
||||
"connect.serverType": "Typ serveru:",
|
||||
"connect.serverType.auto": "Automaticky",
|
||||
"connect.serverType.teamspeak": "TeamSpeak",
|
||||
"connect.serverType.teaspeak": "TeaSpeak",
|
||||
"connect.hotkeyProfile": "Profil klávesových zkratek:",
|
||||
"connect.soundPack": "Balíček zvuků:",
|
||||
"connect.more": "Více",
|
||||
"connect.less": "Méně",
|
||||
"connect.connect": "Připojit",
|
||||
"connect.connecting": "Připojování…",
|
||||
"connect.newTab": "V nové kartě",
|
||||
"connect.cancel": "Zrušit",
|
||||
"channelPasswordDialog.title": "Je vyžadováno heslo kanálu",
|
||||
"channelPasswordDialog.prompt": "Tento kanál je chráněný heslem. Zadejte prosím heslo:",
|
||||
"channelPasswordDialog.wrongPassword": "Nesprávné heslo, zkuste to prosím znovu:",
|
||||
"channelPasswordDialog.submit": "Připojit se",
|
||||
"channelPasswordDialog.cancel": "Zrušit",
|
||||
"collectedUrls.title": "Shromážděné URL",
|
||||
"collectedUrls.search": "Hledat:",
|
||||
"collectedUrls.url": "URL",
|
||||
"collectedUrls.count": "Počet",
|
||||
"collectedUrls.lastSeen": "Naposledy zmíněno",
|
||||
"collectedUrls.mentionedBy": "Zmínil",
|
||||
"collectedUrls.clearList": "Vymazat seznam",
|
||||
"inviteFriend.title": "Pozvat přítele",
|
||||
"inviteFriend.type": "Typ pozvánky",
|
||||
"inviteFriend.includeChannel": "Vložit aktuální kanál",
|
||||
"inviteFriend.link": "Odkaz",
|
||||
"inviteFriend.addPermissionKey": "Přidat klíč oprávnění",
|
||||
"inviteFriend.copyToClipboard": "Kopírovat do schránky",
|
||||
"inviteFriend.copied": "Zkopírováno!",
|
||||
"clientLog.title": "Protokol klienta",
|
||||
"clientLog.level.critical": "Kritické",
|
||||
"clientLog.level.error": "Chyby",
|
||||
"clientLog.level.warning": "Varování",
|
||||
"clientLog.level.info": "Informace",
|
||||
"clientLog.level.debug": "Ladění",
|
||||
"clientLog.search": "Hledat:",
|
||||
"clientLog.filter": "Filtr:",
|
||||
"clientLog.caseSensitive": "Rozlišovat velká a malá písmena",
|
||||
"clientLog.mark": "Označit",
|
||||
"whisperHistory.title": "Historie šeptání – {server}",
|
||||
"whisperHistory.empty": "Zatím žádná historie šeptání.",
|
||||
"whisperHistory.started": "Šeptání pro: {targets}",
|
||||
"whisperHistory.stopped": "Šeptání zastaveno",
|
||||
"whisperHistory.clear": "Vymazat",
|
||||
"whisperHistory.options": "Možnosti",
|
||||
"whisperLists.title": "Seznamy šeptání",
|
||||
"whisperLists.namePlaceholder": "Název seznamu",
|
||||
"whisperLists.saveCurrent": "Uložit aktuální výběr",
|
||||
"whisperLists.itemDetail": "{channels} kanálů, {clients} klientů",
|
||||
"whisperLists.activate": "Aktivovat",
|
||||
"whisperLists.delete": "Smazat",
|
||||
"whisperLists.empty": "Zatím nejsou uloženy žádné seznamy šeptání. Vyberte cíle šeptání a uložte je zde jako seznam.",
|
||||
"identities.title": "Identity",
|
||||
"identities.activate": "Aktivovat",
|
||||
"identities.add": "Nová identita",
|
||||
"identities.delete": "Smazat",
|
||||
"identities.newName": "Nová identita",
|
||||
"identities.generated": "Vygenerována",
|
||||
"identities.pending": "Vygeneruje se při příštím připojení",
|
||||
"identities.listLabel": "Lokální identity",
|
||||
"identities.name": "Název identity:",
|
||||
"identities.phoneticNickname": "Fonetická přezdívka:",
|
||||
"identities.uniqueId": "Jedinečné ID:",
|
||||
"identities.unknown": "Neznámé",
|
||||
"identities.setDefault": "Nastavit jako výchozí",
|
||||
"identities.isDefault": "Aktuálně používána jako výchozí",
|
||||
"identities.export": "Exportovat",
|
||||
"identities.import": "Importovat",
|
||||
"connectionInfo.clientTitle": "Informace o připojení – {name}",
|
||||
"connectionInfo.serverTitle": "Informace o připojení k serveru",
|
||||
"connectionInfo.loading": "Načítání…",
|
||||
"connectionInfo.unavailable": "Server neodpovídá (chybí oprávnění?).",
|
||||
"connectionInfo.ping": "Ping:",
|
||||
"connectionInfo.connectedSince": "Připojeno od:",
|
||||
"connectionInfo.uptime": "Doba běhu:",
|
||||
"connectionInfo.name": "Název:",
|
||||
"connectionInfo.avgPing": "Průměrný ping:",
|
||||
"connectionInfo.avgPacketLoss": "Průměrná ztráta paketů:",
|
||||
"connectionInfo.incoming": "Příchozí",
|
||||
"connectionInfo.outgoing": "Odchozí",
|
||||
"connectionInfo.packetsTransferred": "Přenesené pakety",
|
||||
"connectionInfo.bytesTransferred": "Přenesené bajty",
|
||||
"connectionInfo.bandwidthLastSecond": "Přenosová rychlost za poslední sekundu",
|
||||
"connectionInfo.bandwidthLastMinute": "Přenosová rychlost za poslední minutu",
|
||||
"connectionInfo.ftBandwidth": "Přenosová rychlost souborů",
|
||||
"connectionInfo.ftBytes": "Bajty přenosu souborů",
|
||||
"connectionInfo.ip": "IP adresa:",
|
||||
"connectionInfo.packetLoss": "Ztráta paketů:",
|
||||
"connectionInfo.packetsSent": "Odeslané pakety:",
|
||||
"connectionInfo.packetsReceived": "Přijaté pakety:",
|
||||
"connectionInfo.bytesSent": "Odeslaná data:",
|
||||
"connectionInfo.bytesReceived": "Přijatá data:",
|
||||
"connectionInfo.bandwidthSent": "Rychlost odesílání:",
|
||||
"connectionInfo.bandwidthReceived": "Rychlost přijímání:",
|
||||
"menu.self.recordingProfile": "Profil nahrávání",
|
||||
"menu.self.playbackProfile": "Profil přehrávání",
|
||||
"menu.self.hotkeyProfile": "Profil klávesových zkratek",
|
||||
"menu.self.soundPack": "Balíček zvuků",
|
||||
"menu.self.setAway": "Nastavit nepřítomnost",
|
||||
"menu.self.enableMic": "Zapnout mikrofon",
|
||||
"menu.self.disableMic": "Vypnout mikrofon",
|
||||
"menu.self.muteOutput": "Ztlumit reproduktory/sluchátka",
|
||||
"menu.self.unmuteOutput": "Zrušit ztlumení reproduktorů/sluchátek",
|
||||
"menu.self.changeNickname": "Změnit přezdívku",
|
||||
"menu.self.requestTalkPower": "Požádat o možnost mluvit",
|
||||
"menu.self.setAvatar": "Nastavit avatar",
|
||||
"menu.self.setPhoneticNickname": "Nastavit fonetickou přezdívku",
|
||||
"menu.self.connectionInfo": "Připojení Informace",
|
||||
"contacts.title": "Kontakty",
|
||||
"contacts.addOnlineClient": "Vybrat online klienta...",
|
||||
"contacts.add": "Přidat",
|
||||
"contacts.remove": "Odebrat",
|
||||
"contacts.empty": "Zatím žádné kontakty.",
|
||||
"contacts.customName": "Vlastní název:",
|
||||
"contacts.category.acquaintance": "Známý",
|
||||
"contacts.category.blocked": "Blokovaný",
|
||||
"contacts.category.friend": "Přítel",
|
||||
"contacts.phoneticName": "Fonetické jméno:",
|
||||
"contacts.show": "Zobrazit",
|
||||
"contacts.ignore": "Ignorovat",
|
||||
"contacts.unignore": "Přestat ignorovat",
|
||||
"contacts.whisper": "Šeptat",
|
||||
"contacts.preferences": "Předvolby",
|
||||
"favorites.title": "🔖 Záložky myTeamSpeak",
|
||||
"favorites.synced": "Synchronizované záložky",
|
||||
"favorites.notLoggedIn": "Nepřihlášen",
|
||||
"favorites.local": "Lokální záložky",
|
||||
"favorites.unnamed": "(bez názvu)",
|
||||
"favorites.bookmarkName": "Název záložky:",
|
||||
"favorites.newFavoriteName": "Nová záložka",
|
||||
"favorites.showServerQueryClients": "Zobrazit klienty ServerQuery",
|
||||
"favorites.connectOnStartup": "Připojit při spuštění",
|
||||
"favorites.new": "Nová záložka",
|
||||
"favorites.newFolder": "Nová složka",
|
||||
"favorites.remove": "Odebrat",
|
||||
"favorites.ok": "OK",
|
||||
"favorites.cancel": "Zrušit",
|
||||
"favorites.apply": "Použít",
|
||||
"away.dialog.title": "Nastavit zprávu při nepřítomnosti",
|
||||
"away.dialog.message": "Zpráva:",
|
||||
"away.dialog.template": "Šablona:",
|
||||
"away.dialog.none": "<Žádná>",
|
||||
"away.dialog.ok": "OK",
|
||||
"away.dialog.save": "Uložit",
|
||||
"away.dialog.cancel": "Zrušit",
|
||||
"options.title": "Možnosti",
|
||||
"options.ok": "OK",
|
||||
"options.cancel": "Zrušit",
|
||||
"options.notImplemented": "Toto nastavení zatím není implementováno.",
|
||||
"options.section.anwendung": "Aplikace",
|
||||
"options.section.wiedergabe": "Přehrávání",
|
||||
"options.section.aufnahme": "Snímání",
|
||||
"options.section.design": "Vzhled",
|
||||
"design.subtitle": "Zvolte vzhled aplikace.",
|
||||
"design.theme.standard": "Standardní",
|
||||
"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",
|
||||
"design.theme.ide.desc": "Technické, ploché rozvržení ve stylu IDE pro pokročilé uživatele.",
|
||||
"design.idePixelFont": "Pixelové terminálové písmo",
|
||||
"design.status.connected": "Připojeno",
|
||||
"design.custom.new": "+ Nový vzhled",
|
||||
"design.custom.import": "Importovat vzhled",
|
||||
"design.custom.edit": "Upravit",
|
||||
"design.custom.duplicate": "Duplikovat",
|
||||
"design.custom.export": "Exportovat",
|
||||
"design.custom.delete": "Smazat",
|
||||
"design.custom.deleteConfirm": "Opravdu chcete tento vzhled smazat?",
|
||||
"design.custom.newTitle": "Vytvořit nový vzhled",
|
||||
"design.custom.editTitle": "Upravit vzhled",
|
||||
"design.custom.name": "Název",
|
||||
"design.custom.base": "Základní rozvržení",
|
||||
"design.custom.css": "CSS",
|
||||
"design.custom.hint": "This CSS loads while design is active. Use .ts-app { ... } and 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 layout.",
|
||||
"design.custom.save": "Uložit",
|
||||
"design.custom.copyOf": "Kopie {name}",
|
||||
"design.custom.importError": "This file couldn't be read as WebSpeak3 design.",
|
||||
"design.store.open": "Obchod",
|
||||
"design.store.title": "Obchod s vzhledy",
|
||||
"design.store.back": "Zpět",
|
||||
"design.store.loading": "Načítání…",
|
||||
"design.store.unavailable": "Obchod s vzhledy není na tomto serveru dostupný.",
|
||||
"design.store.empty": "V obchodě zatím nejsou žádné vzhledy.",
|
||||
"design.store.install": "Nainstalovat",
|
||||
"design.store.installed": "Nainstalováno",
|
||||
"design.store.by": "od {author}",
|
||||
"design.store.screenshotAlt": "Snímek obrazovky {name}",
|
||||
"design.store.rating.rate": "Ohodnotit {stars} hvězdičkami",
|
||||
"design.store.rating.summary": "{average} ({count})",
|
||||
"design.store.rating.none": "Zatím bez hodnocení",
|
||||
"design.store.publishTitle": "Publikovat vzhled",
|
||||
"design.store.publish.select": "Vyberte jeden ze svých vzhledů",
|
||||
"design.store.publish.none": "Zatím nemáte žádný vlastní vzhled k publikování.",
|
||||
"design.store.publish.author": "Vaše jméno (volitelné)",
|
||||
"design.store.publish.authorPlaceholder": "Anonymně",
|
||||
"design.store.publish.description": "Popis (volitelné)",
|
||||
"design.store.publish.descriptionPlaceholder": "Čím je tento vzhled výjimečný?",
|
||||
"design.store.publish.screenshot": "Snímek obrazovky (volitelné)",
|
||||
"design.store.publish.screenshotTooLarge": "Tento obrázek je příliš velký. Použijte prosím menší snímek obrazovky.",
|
||||
"design.store.publish.adminToken": "Token správce (potřeba pouze pro vyhrazené názvy)",
|
||||
"design.store.publish.adminTokenPlaceholder": "Nechte prázdné, pokud nevíte, k čemu slouží",
|
||||
"design.store.publish.submit": "Publikovat do obchodu",
|
||||
"design.store.publish.success": "Vzhled byl publikován!",
|
||||
"design.store.publish.pending": "Děkujeme! Váš vzhled byl odeslán a po kontrole se objeví v obchodě.",
|
||||
"design.store.publish.error": "Publikování se nezdařilo.",
|
||||
"options.section.erweiterungen": "Doplňky",
|
||||
"options.section.hotkeys": "Klávesové zkratky",
|
||||
"options.section.whispern": "Šeptat",
|
||||
"options.section.downloads": "Stažené soubory",
|
||||
"options.section.chat": "Chat",
|
||||
"options.section.sicherheit": "Zabezpečení",
|
||||
"options.section.nachrichten": "Zprávy",
|
||||
"options.section.meldungen": "Oznámení",
|
||||
"options.section.sounds": "Zvuky",
|
||||
"app.title": "Aplikace",
|
||||
"app.subtitle": "Obecná nastavení aplikace",
|
||||
"app.language": "Jazyk",
|
||||
"app.language.auto": "Výchozí systému",
|
||||
"app.language.de": "Němčina",
|
||||
"app.language.en": "Angličtina",
|
||||
"app.language.zh-CN": "简体中文",
|
||||
"app.language.fa": "فارسی (بتا)",
|
||||
"app.language.cs-CZ": "Čeština",
|
||||
"app.language.helpTranslate": "Missing your language or spotted wrong translation? Help out on Weblate →",
|
||||
"app.serverBanner": "Zobrazovat bannery serveru",
|
||||
"app.serverBanner.hint": "Banner se načítá přímo z adresy nastavené administrátorem serveru a tento hostitel vidí vaši IP adresu.",
|
||||
"app.chatImages": "Načítat obrázky v chatu",
|
||||
"app.chatImages.hint": "Obrázky z tagů [img] a Markdownu se načítají přímo z adresy, kterou zvolil odesílatel, a tento hostitel vidí vaši IP adresu. Po vypnutí se zobrazí jako odkazy.",
|
||||
"playback.title": "Přehrávání",
|
||||
"playback.subtitle": "Změnit nastavení přehrávání",
|
||||
"playback.profile": "Profil",
|
||||
"playback.default": "Výchozí",
|
||||
"playback.device": "Výstupní zařízení:",
|
||||
"playback.systemDefault": "Výchozí systému",
|
||||
"playback.quiet": "Tiché",
|
||||
"playback.loud": "Hlasité",
|
||||
"playback.voiceVolume": "Hlasitost hlasu",
|
||||
"playback.playTestTone": "▶ Přehrát testovací zvuk",
|
||||
"playback.options": "Možnosti",
|
||||
"playback.autoVolume": "Automatická úprava hlasitosti",
|
||||
"playback.ownMicClicks": "Přehrávat zvuky mikrofonu vlastního klienta",
|
||||
"playback.otherMicClicks": "Přehrávat zvuky mikrofonu ostatních klientů",
|
||||
"recording.title": "Snímání",
|
||||
"recording.subtitle": "Změnit nastavení snímání",
|
||||
"recording.device": "Vstupní zařízení:",
|
||||
"recording.activation": "Aktivace",
|
||||
"recording.pushToTalk": "Stiskni a mluv",
|
||||
"recording.continuous": "Nepřetržitý přenos",
|
||||
"recording.voiceActivation": "Detekce aktivace hlasem",
|
||||
"recording.testStart": "Spustit test",
|
||||
"recording.testStop": "Zastavit test",
|
||||
"recording.hangoverDelay": "Zpoždění před deaktivací:",
|
||||
"recording.secondsUnit": "s",
|
||||
"recording.dsp": "Digitální zpracování signálu",
|
||||
"recording.typingAttenuation": "Útlum při psaní",
|
||||
"recording.echoCancellation": "Potlačení ozvěny",
|
||||
"recording.noiseSuppression": "Odstranit hluk na pozadí",
|
||||
"recording.autoGainControl": "Automatické řízení zesílení",
|
||||
"recording.aec3": "Pokročilé potlačení ozvěny (beta, vyšší zatížení CPU)",
|
||||
"info.address": "Adresa:",
|
||||
"info.version": "Verze:",
|
||||
"info.license": "Licence:",
|
||||
"info.currentClients": "Aktuální klienti:",
|
||||
"info.currentChannels": "Aktuální kanály:",
|
||||
"info.topic": "Téma:",
|
||||
"info.audioCodec": "Zvukový kodek:",
|
||||
"info.spacer": "Oddělovač:",
|
||||
"info.rawName": "Surový název:",
|
||||
"info.passwordProtected": "Chráněno heslem:",
|
||||
"info.clients": "Klienti:",
|
||||
"info.country": "Země:",
|
||||
"info.muted": "Mikrofon ztlumen:",
|
||||
"info.outputMuted": "Reproduktory ztlumeny:",
|
||||
"info.serverGroups": "Skupiny serveru:",
|
||||
"info.yes": "Ano",
|
||||
"info.no": "Ne",
|
||||
"tree.noMatches": "Žádné výsledky",
|
||||
"tree.search": "Hledat kanály a uživatele",
|
||||
"tree.label": "Kanály",
|
||||
"tree.notConnected": "Nepřipojeno",
|
||||
"tree.clickToSelect": "Kliknutím vyberete, dvojklikem se připojíte",
|
||||
"tree.clickToJoin": "Dvojklikem se připojíte",
|
||||
"tree.joinNotConnected": "Nepřipojeno — nelze přepnout kanál",
|
||||
"tree.passwordProtected": "Chráněno heslem",
|
||||
"tree.privateChatWith": "Soukromý chat s",
|
||||
"tree.poke": "Šťouchnout",
|
||||
"tree.channelCommander": "Velitel kanálu",
|
||||
"tree.away": "Nepřítomen",
|
||||
"tree.micMuted": "Mikrofon ztlumen",
|
||||
"tree.talking": "Mluví",
|
||||
"tree.noTalkPower": "V tomto kanálu nemáte právo mluvit",
|
||||
"tree.soundMuted": "Zvuk ztlumen (ohluchnutí)",
|
||||
"tree.streaming": "Vysílá stream",
|
||||
"publish.alpha": "Alfa",
|
||||
"publish.alphaTitle": "Alfa – nestabilní, může se kdykoli změnit nebo přestat fungovat",
|
||||
"publish.demoUnavailable": "Streamování není v demu dostupné – vyžaduje skutečný server TeamSpeak 6.",
|
||||
"publish.alphaNote": "Streamování je ve fázi alfa. Používá nezdokumentovaný protokol Stream/Call služby TeamSpeak 6, takže připojení, kvalita obrazu i práce s diváky mohou selhat nebo se bez upozornění změnit. Není určeno pro produkční použití.",
|
||||
"publish.start": "Sdílet obrazovku",
|
||||
"publish.stop": "Zastavit sdílení",
|
||||
"publish.title": "Vaše vysílání",
|
||||
"publish.screen": "Obrazovka",
|
||||
"publish.starting": "Spouštění…",
|
||||
"publish.viewers": "Sleduje {count} diváků",
|
||||
"publish.request.allow": "Povolit",
|
||||
"publish.request.deny": "Odmítnout",
|
||||
"publish.request.block": "Blokovat",
|
||||
"publish.request.blockHint": "Odmítnout a už se neptat",
|
||||
"publish.dialog.title": "Nastavení streamu",
|
||||
"publish.dialog.basic": "Základní nastavení",
|
||||
"publish.dialog.advanced": "Pokročilé nastavení",
|
||||
"publish.dialog.golive": "Spustit vysílání",
|
||||
"publish.dialog.cancel": "Zpět",
|
||||
"publish.preset": "Předvolba",
|
||||
"publish.preset.presentation": "Prezentace",
|
||||
"publish.audio": "Snímat zvuk",
|
||||
"publish.privacy": "Soukromí",
|
||||
"publish.privacy.public": "Veřejné",
|
||||
"publish.privacy.contacts": "Kontakty",
|
||||
"publish.privacy.private": "Soukromé",
|
||||
"publish.resolution": "Rozlišení",
|
||||
"publish.res.source": "Zdroj",
|
||||
"publish.fps": "FPS",
|
||||
"publish.bitrate": "Datový tok",
|
||||
"publish.audioBitrate": "Datový tok zvuku [Kbps]",
|
||||
"publish.viewerLimit": "Limit diváků",
|
||||
"publish.mode": "Režim připojení",
|
||||
"publish.mode.p2p": "P2P",
|
||||
"publish.mode.server": "Server",
|
||||
"publish.mode.serverUnavailable": "Režim serveru používá SFU služby TS6 a zatím není implementován.",
|
||||
"stream.untitled": "Stream",
|
||||
"stream.stop": "Zavřít stream",
|
||||
"stream.live": "Živě",
|
||||
"stream.state.new": "Čekání na nabídku…",
|
||||
"stream.state.connecting": "Připojování…",
|
||||
"stream.state.connected": "Živě",
|
||||
"stream.state.disconnected": "Připojení přerušeno",
|
||||
"stream.state.failed": "Připojení selhalo",
|
||||
"stream.state.closed": "Ukončeno",
|
||||
"chat.server": "Server",
|
||||
"chat.channel": "Kanál",
|
||||
"chat.notConnected": "Nepřipojeno",
|
||||
"chat.messageChannel": "Napsat zprávu do kanálu...",
|
||||
"chat.messageServer": "Napsat zprávu serveru...",
|
||||
"chat.messagePartner": "Napsat zprávu uživateli {name}...",
|
||||
"chat.send": "Odeslat",
|
||||
"chat.you": "Vy",
|
||||
"serverLog.clientJoin": "{client} vstoupil do kanálu „{channel}“",
|
||||
"serverLog.clientLeave": "{client} se odpojil (odešel)",
|
||||
"serverLog.clientChannelSwitch": "{client} se přesunul z kanálu „{fromChannel}“ do „{toChannel}“",
|
||||
"serverLog.clientChannelGroupAssigned": "Skupina kanálu „{group}“ byla přiřazena uživateli {client}",
|
||||
"serverLog.channelCreated": "Kanál „{channel}“ byl vytvořen",
|
||||
"serverLog.channelDeleted": "Kanál „{channel}“ byl smazán",
|
||||
"serverLog.channelEdited": "Kanál „{channel}“ byl upraven",
|
||||
"serverLog.serverEdited": "Nastavení serveru byla změněna",
|
||||
"serverLog.permissionError": "Chybí oprávnění: {action}",
|
||||
"poke.title": "Šťouchnout",
|
||||
"poke.optionalMessage": "Volitelná zpráva...",
|
||||
"poke.send": "Šťouchnout",
|
||||
"poke.cancel": "Zrušit",
|
||||
"poke.pokedYou": "vás šťouchnul",
|
||||
"poke.dismiss": "Zavřít",
|
||||
"kick.title": "Vykopnout:",
|
||||
"kick.reasonPlaceholder": "Důvod (volitelné)...",
|
||||
"kick.confirm": "Vykopnout",
|
||||
"kick.cancel": "Zrušit",
|
||||
"ban.title": "Zabanovat:",
|
||||
"ban.reasonPlaceholder": "Důvod (volitelné)...",
|
||||
"ban.duration": "Doba trvání:",
|
||||
"ban.durationPermanent": "Trvale",
|
||||
"ban.duration1h": "1 hodina",
|
||||
"ban.duration1d": "1 den",
|
||||
"ban.duration1w": "1 týden",
|
||||
"ban.confirm": "Zabanovat",
|
||||
"ban.cancel": "Zrušit",
|
||||
"serverEdit.title": "Upravit virtuální server",
|
||||
"serverEdit.tab.host": "Hostitel",
|
||||
"serverEdit.tab.misc": "Ostatní",
|
||||
"serverEdit.tab.transmission": "Přenos",
|
||||
"serverEdit.tab.antiflood": "Ochrana proti zahlcení",
|
||||
"serverEdit.tab.security": "Zabezpečení",
|
||||
"serverEdit.tab.log": "Protokol",
|
||||
"serverEdit.name": "Název serveru:",
|
||||
"serverEdit.welcomeMessage": "Uvítací zpráva:",
|
||||
"serverEdit.clearPassword": "Odstranit heslo serveru",
|
||||
"serverEdit.newPassword": "Nové heslo serveru:",
|
||||
"serverEdit.hostmessage": "Zpráva hostitele:",
|
||||
"serverEdit.hostmessageMode": "Režim zobrazení:",
|
||||
"serverEdit.hostmessageMode.none": "Nezobrazovat",
|
||||
"serverEdit.hostmessageMode.log": "Zobrazit v protokolu",
|
||||
"serverEdit.hostmessageMode.modal": "Zobrazit jako dialog",
|
||||
"serverEdit.hostmessageMode.modalquit": "Zobrazit jako dialog a odpojit",
|
||||
"serverEdit.hostbannerUrl": "URL banneru hostitele:",
|
||||
"serverEdit.hostbannerGfxUrl": "URL obrázku banneru hostitele:",
|
||||
"serverEdit.hostbannerGfxInterval": "Obnovení banneru (sekundy):",
|
||||
"serverEdit.hostbannerMode": "Přizpůsobení banneru:",
|
||||
"serverEdit.hostbannerMode.noadjust": "Neupravovat",
|
||||
"serverEdit.hostbannerMode.adjustignoreaspect": "Přizpůsobit (ignorovat poměr stran)",
|
||||
"serverEdit.hostbannerMode.adjustkeepaspect": "Přizpůsobit (zachovat poměr stran)",
|
||||
"serverEdit.hostbuttonTooltip": "Nápověda tlačítka hostitele:",
|
||||
"serverEdit.hostbuttonUrl": "URL tlačítka hostitele:",
|
||||
"serverEdit.hostbuttonGfxUrl": "URL obrázku tlačítka hostitele:",
|
||||
"serverEdit.maxClients": "Max. počet klientů:",
|
||||
"serverEdit.nickname": "Přezdívka serveru:",
|
||||
"serverEdit.phoneticName": "Fonetický název:",
|
||||
"serverEdit.codecEncryptionMode": "Šifrování hlasu:",
|
||||
"serverEdit.codecEncryptionMode.perchannel": "Nastavitelné pro každý kanál",
|
||||
"serverEdit.codecEncryptionMode.forcedoff": "Globálně vypnuto",
|
||||
"serverEdit.codecEncryptionMode.forcedon": "Globálně zapnuto",
|
||||
"serverEdit.unchanged": "Ponechat beze změny",
|
||||
"serverEdit.save": "Uložit",
|
||||
"serverEdit.cancel": "Zrušit",
|
||||
"serverProtocolLog.title": "Protokol serveru",
|
||||
"serverProtocolLog.empty": "Žádné položky protokolu.",
|
||||
"banList.title": "Seznam zákazů",
|
||||
"banList.empty": "Nebyly nalezeny žádné zákazy.",
|
||||
"banList.name": "Název",
|
||||
"banList.ip": "IP",
|
||||
"banList.created": "Vytvořeno",
|
||||
"banList.duration": "Doba trvání",
|
||||
"banList.invoker": "Od",
|
||||
"banList.reason": "Důvod",
|
||||
"banList.permanent": "Trvale",
|
||||
"banList.delete": "Smazat",
|
||||
"banList.deleteAll": "Smazat vše",
|
||||
"complainList.title": "Seznam stížností",
|
||||
"complainList.empty": "Nebyly nalezeny žádné stížnosti.",
|
||||
"complainList.target": "Cíl",
|
||||
"complainList.from": "Od",
|
||||
"complainList.message": "Zpráva",
|
||||
"complainList.timestamp": "Časové razítko",
|
||||
"offlineMessages.title": "Offline zprávy",
|
||||
"offlineMessages.empty": "Nebyly nalezeny žádné zprávy.",
|
||||
"offlineMessages.subject": "Předmět",
|
||||
"offlineMessages.from": "Od",
|
||||
"offlineMessages.timestamp": "Časové razítko",
|
||||
"offlineMessages.targetUid": "Cílové UID",
|
||||
"offlineMessages.message": "Zpráva",
|
||||
"offlineMessages.send": "Odeslat",
|
||||
"offlineMessages.new": "Nová zpráva",
|
||||
"offlineMessages.markRead": "Označit jako přečtené",
|
||||
"offlineMessages.backToList": "Zpět na seznam",
|
||||
"dialog.cancel": "Zrušit",
|
||||
"groupAssign.channelTitle": "Přiřadit skupinu kanálu",
|
||||
"groupAssign.serverTitle": "Přiřadit skupinu serveru",
|
||||
"groupAssign.empty": "Nebyly nalezeny žádné skupiny.",
|
||||
"groupAssign.clickToRemove": "Kliknutím odeberete",
|
||||
"serverQueryLogin.username": "Uživatelské jméno",
|
||||
"serverQueryLogin.password": "Heslo",
|
||||
"serverQueryLogin.login": "Přihlásit",
|
||||
"permissionOverview.title": "Moje oprávnění",
|
||||
"permissionOverview.empty": "Nebyla nalezena žádná oprávnění.",
|
||||
"permissionOverview.name": "Oprávnění",
|
||||
"permissionOverview.value": "Hodnota",
|
||||
"permissionOverview.negated": "Negováno",
|
||||
"permissionOverview.skip": "Přeskočit",
|
||||
"permsEditor.title": "Oprávnění",
|
||||
"permsEditor.tab.server": "Skupiny serveru",
|
||||
"permsEditor.tab.client": "Oprávnění klienta",
|
||||
"permsEditor.tab.channel": "Oprávnění kanálu",
|
||||
"permsEditor.tab.channelgroup": "Skupiny kanálu",
|
||||
"permsEditor.tab.channelclient": "Oprávnění klientů kanálu",
|
||||
"permsEditor.clientDbId": "Jedinečné DB ID klienta:",
|
||||
"permsEditor.load": "Načíst",
|
||||
"permsEditor.pickOnlineClient": "Nebo vyberte online klienta...",
|
||||
"permsEditor.pickTarget": "Vyberte skupinu/kanál vlevo nebo zadejte ID klienta.",
|
||||
"permsEditor.addPermission": "Přidat",
|
||||
"permsEditor.searchPermission": "Hledat oprávnění...",
|
||||
"dialog.ok": "OK",
|
||||
"channelContext.join": "Přepnout na kanál",
|
||||
"channelContext.files": "Soubory...",
|
||||
"fileBrowser.title": "Přenosy souborů",
|
||||
"fileBrowser.up": "Nahoru",
|
||||
"fileBrowser.tooLarge": "Soubor je příliš velký – nahrávání je omezeno na {mb} MiB.",
|
||||
"fileBrowser.refresh": "Obnovit",
|
||||
"fileBrowser.newFolder": "Nová složka",
|
||||
"fileBrowser.upload": "Nahrát",
|
||||
"fileBrowser.folderName": "Název složky",
|
||||
"fileBrowser.empty": "Tato složka je prázdná.",
|
||||
"fileBrowser.name": "Název",
|
||||
"fileBrowser.size": "Velikost",
|
||||
"fileBrowser.modified": "Změněno",
|
||||
"fileBrowser.download": "Stáhnout",
|
||||
"fileBrowser.rename": "Přejmenovat",
|
||||
"fileBrowser.delete": "Smazat",
|
||||
"fileBrowser.deleteConfirm": "Opravdu smazat?",
|
||||
"fileBrowser.uploading": "Nahrávání...",
|
||||
"fileBrowser.downloading": "Stahování...",
|
||||
"serverContext.icons": "Ikony serveru...",
|
||||
"serverIcons.title": "Správa ikon serveru",
|
||||
"serverIcons.upload": "Nahrát ikonu",
|
||||
"serverIcons.iconId": "ID ikony",
|
||||
"serverIcons.empty": "Nebyly nalezeny žádné ikony.",
|
||||
"clientContext.privateChat": "Soukromý chat",
|
||||
"clientContext.poke": "Šťouchnout",
|
||||
"clientContext.watchStream": "Sledovat stream",
|
||||
"clientContext.moveTo": "Přesunout do…",
|
||||
"clientContext.volume": "Hlasitost",
|
||||
"clientContext.volumeHint": "Pouze pro vás. Dvojklikem obnovíte 100 %.",
|
||||
"clientContext.copyName": "Kopírovat název",
|
||||
"clientContext.connectionInfo": "Zobrazit informace o připojení",
|
||||
"clientContext.addWhisperTarget": "Přidat jako cíl šeptání",
|
||||
"clientContext.removeWhisperTarget": "Odebrat jako cíl šeptání",
|
||||
"clientContext.assignChannelGroup": "Přiřadit skupinu kanálu",
|
||||
"clientContext.assignServerGroup": "Přiřadit skupinu serveru",
|
||||
"clientContext.kickChannel": "Vykopnout z kanálu",
|
||||
"clientContext.kick": "Vykopnout ze serveru",
|
||||
"clientContext.ban": "Zabanovat",
|
||||
"clientContext.notSupported": "Ve webovém klientovi zatím není podporováno",
|
||||
"moveClient.title": "Přesunout",
|
||||
"moveClient.empty": "Nejsou dostupné žádné kanály.",
|
||||
"moveClient.current": "Aktuální kanál",
|
||||
"moveClient.spacer": "Oddělovač",
|
||||
"serverContext.connectionInfo": "Informace o připojení k serveru",
|
||||
"serverContext.copyAddress": "Kopírovat adresu serveru",
|
||||
"serverContext.addFavorite": "Přidat do oblíbených",
|
||||
"serverContext.disconnect": "Odpojit",
|
||||
"connectError.dismiss": "Zavřít",
|
||||
"dialog.close": "Zavřít",
|
||||
"sounds.title": "Zvuky",
|
||||
"sounds.subtitle": "Nastavit zvuková upozornění na události",
|
||||
"sounds.enable": "Povolit zvuky",
|
||||
"sounds.volume": "Hlasitost",
|
||||
"sounds.eventEnable": "Povolit tento zvuk",
|
||||
"sounds.event.connect": "Připojeno",
|
||||
"sounds.event.disconnect": "Odpojeno",
|
||||
"sounds.event.clientJoin": "Klient se připojí",
|
||||
"sounds.event.clientLeave": "Klient odejde",
|
||||
"sounds.event.message": "Přijata zpráva",
|
||||
"sounds.event.poke": "Přijato šťouchnutí",
|
||||
"sounds.event.mute": "Přepnutí ztlumení",
|
||||
"sounds.default": "Výchozí",
|
||||
"sounds.custom": "Vlastní soubor: {name}",
|
||||
"sounds.test": "▶ Test",
|
||||
"sounds.upload": "Nahrát",
|
||||
"sounds.reset": "Obnovit",
|
||||
"sounds.importSoundpack": "Importovat balíček zvuků (.ts3soundpack)",
|
||||
"sounds.importResult": "Importováno zvuků: {matched}, nespárovaných souborů: {unmatched}",
|
||||
"nachrichten.title": "Zprávy",
|
||||
"nachrichten.subtitle": "Přizpůsobit zprávy",
|
||||
"nachrichten.disconnectMessage": "Odpojení:",
|
||||
"nachrichten.disconnectMessagePlaceholder": "odcházím",
|
||||
"nachrichten.presetsTitle": "Přednastavené zprávy",
|
||||
"nachrichten.type": "Typ",
|
||||
"nachrichten.type.away": "Nepřítomen",
|
||||
"nachrichten.templateName": "Název šablony",
|
||||
"nachrichten.message": "Zpráva",
|
||||
"nachrichten.add": "Přidat",
|
||||
"nachrichten.delete": "Smazat",
|
||||
"tabs.disconnect": "Odpojit",
|
||||
"identity.importInvalid": "„{file}“ není platný soubor identity.",
|
||||
"log.fileTransferFailed": "Přenos souboru selhal:",
|
||||
"log.serverReconnecting": "Spojení se serverem bylo ztraceno, obnovování připojení…",
|
||||
"log.serverReconnected": "Připojení k serveru bylo obnoveno",
|
||||
"log.fileTransferInvalidAddress": "Přenos souboru selhal (neplatná adresa)",
|
||||
"sounds.importFailed": "Balíček zvuků se nepodařilo načíst – je to platný soubor .ts3soundpack/ZIP?",
|
||||
"tabs.connections": "Připojení k serverům",
|
||||
"shortcut.ctrl": "Ctrl"
|
||||
}
|
||||
+59
-2
@@ -52,7 +52,7 @@
|
||||
"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)",
|
||||
"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.",
|
||||
@@ -90,6 +90,10 @@
|
||||
"toolbar.micMute": "Mikrofon stummschalten",
|
||||
"toolbar.micUnmute": "Mikrofon aktivieren (unmute)",
|
||||
"toolbar.vadSensitivity": "Empfindlichkeit der Sprachaktivierung",
|
||||
"tabAudio.start": "Ton eines Tabs oder Fensters in den Sprachkanal geben (mit Kopfhörer kein Echo)",
|
||||
"tabAudio.stop": "Ton-Freigabe beenden",
|
||||
"tabAudio.noAudio": "Es wurde kein Ton freigegeben. Im Auswahldialog einen Tab oder ein Fenster wählen und den Ton einschalten.",
|
||||
"tabAudio.silent": "Vom geteilten Ton kommt seit 5 Sekunden nichts an. Systemaudio liefert nicht auf jedem Windows-Rechner Ton. Teile stattdessen einen Browser-Tab, zum Beispiel Spotify im Web oder YouTube, mit eingeschaltetem „Tab-Audio teilen“.",
|
||||
"toolbar.muteSound": "Ton stummschalten (Ausgabe stumm)",
|
||||
"toolbar.unmuteSound": "Ton aktivieren (Ausgabe an)",
|
||||
"toolbar.chooseOutputDevice": "Wiedergabegerät wählen",
|
||||
@@ -272,6 +276,9 @@
|
||||
"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",
|
||||
"design.theme.ide.desc": "Technisches, flaches Layout im IDE-Stil für Power-User.",
|
||||
"design.idePixelFont": "Pixel-Terminal-Schrift",
|
||||
"design.status.connected": "Verbunden",
|
||||
"design.custom.new": "+ Neues Design",
|
||||
"design.custom.import": "Design importieren",
|
||||
@@ -289,6 +296,34 @@
|
||||
"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",
|
||||
@@ -306,7 +341,12 @@
|
||||
"app.language.en": "English",
|
||||
"app.language.zh-CN": "简体中文",
|
||||
"app.language.fa": "فارسی (بتا)",
|
||||
"app.language.cs-CZ": "Čeština",
|
||||
"app.language.helpTranslate": "Fehlt deine Sprache oder eine Übersetzung ist ungenau? Hilf mit auf Weblate →",
|
||||
"app.serverBanner": "Server-Banner anzeigen",
|
||||
"app.serverBanner.hint": "Das Banner lädt direkt von der Adresse, die der Serverbetreiber eingetragen hat. Dieser Host sieht dabei deine IP-Adresse.",
|
||||
"app.chatImages": "Bilder im Chat laden",
|
||||
"app.chatImages.hint": "Bilder aus [img]-Tags und Markdown laden direkt von der Adresse, die der Absender gewählt hat, und dieser Host sieht deine IP-Adresse. Ausgeschaltet erscheinen sie als Link.",
|
||||
"playback.title": "Wiedergabe",
|
||||
"playback.subtitle": "Ändern der Wiedergabeeinstellungen",
|
||||
"playback.profile": "Profile",
|
||||
@@ -337,6 +377,7 @@
|
||||
"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:",
|
||||
@@ -354,6 +395,9 @@
|
||||
"info.serverGroups": "Servergruppen:",
|
||||
"info.yes": "Ja",
|
||||
"info.no": "Nein",
|
||||
"tree.noMatches": "Keine Treffer",
|
||||
"tree.search": "Kanäle und Nutzer suchen",
|
||||
"tree.label": "Kanäle",
|
||||
"tree.notConnected": "Nicht verbunden",
|
||||
"tree.clickToSelect": "Klicken zum Auswählen, Doppelklick zum Beitreten",
|
||||
"tree.clickToJoin": "Doppelklick zum Beitreten",
|
||||
@@ -547,6 +591,7 @@
|
||||
"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",
|
||||
@@ -570,6 +615,8 @@
|
||||
"clientContext.poke": "Anstupsen",
|
||||
"clientContext.watchStream": "Stream ansehen",
|
||||
"clientContext.moveTo": "Verschieben in…",
|
||||
"clientContext.volume": "Lautstärke",
|
||||
"clientContext.volumeHint": "Nur für dich. Doppelklick setzt auf 100 % zurück.",
|
||||
"clientContext.copyName": "Namen kopieren",
|
||||
"clientContext.connectionInfo": "Verbindungsinformationen anzeigen",
|
||||
"clientContext.addWhisperTarget": "Als Whisper-Ziel hinzufügen",
|
||||
@@ -601,6 +648,7 @@
|
||||
"sounds.event.clientLeave": "Client geht",
|
||||
"sounds.event.message": "Nachricht empfangen",
|
||||
"sounds.event.poke": "Anstupsen erhalten",
|
||||
"sounds.event.mute": "Stummschaltung umgeschaltet",
|
||||
"sounds.default": "Standard",
|
||||
"sounds.custom": "Eigene Datei: {name}",
|
||||
"sounds.test": "▶ Testen",
|
||||
@@ -618,5 +666,14 @@
|
||||
"nachrichten.templateName": "Vorlagenname",
|
||||
"nachrichten.message": "Nachricht",
|
||||
"nachrichten.add": "Hinzufügen",
|
||||
"nachrichten.delete": "Löschen"
|
||||
"nachrichten.delete": "Löschen",
|
||||
"tabs.disconnect": "Verbindung trennen",
|
||||
"identity.importInvalid": "„{file}“ ist keine gültige Identitätsdatei.",
|
||||
"log.fileTransferFailed": "Dateiübertragung fehlgeschlagen:",
|
||||
"log.serverReconnecting": "Verbindung zum Server verloren, verbinde neu…",
|
||||
"log.serverReconnected": "Wieder mit dem Server verbunden",
|
||||
"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"
|
||||
}
|
||||
+59
-2
@@ -52,7 +52,7 @@
|
||||
"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)",
|
||||
"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.",
|
||||
@@ -90,6 +90,10 @@
|
||||
"toolbar.micMute": "Mute microphone",
|
||||
"toolbar.micUnmute": "Unmute microphone",
|
||||
"toolbar.vadSensitivity": "Voice activation sensitivity",
|
||||
"tabAudio.start": "Share tab or window audio into the voice channel (headphones avoid an echo)",
|
||||
"tabAudio.stop": "Stop sharing audio",
|
||||
"tabAudio.noAudio": "No audio was shared. In the picker, choose a tab or window and turn on its audio.",
|
||||
"tabAudio.silent": "Nothing has come through from the shared audio for 5 seconds. System audio doesn't deliver sound on every Windows machine; share a browser tab instead (e.g. Spotify on the web or YouTube) with \"Share tab audio\" turned on.",
|
||||
"toolbar.muteSound": "Mute sound (deafen)",
|
||||
"toolbar.unmuteSound": "Unmute sound (undeafen)",
|
||||
"toolbar.chooseOutputDevice": "Choose output device",
|
||||
@@ -272,6 +276,9 @@
|
||||
"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",
|
||||
"design.theme.ide.desc": "A technical, flat IDE-style layout for power users.",
|
||||
"design.idePixelFont": "Pixel terminal font",
|
||||
"design.status.connected": "Connected",
|
||||
"design.custom.new": "+ New design",
|
||||
"design.custom.import": "Import design",
|
||||
@@ -289,6 +296,34 @@
|
||||
"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",
|
||||
@@ -306,7 +341,12 @@
|
||||
"app.language.en": "English",
|
||||
"app.language.zh-CN": "简体中文",
|
||||
"app.language.fa": "فارسی (بتا)",
|
||||
"app.language.cs-CZ": "Čeština",
|
||||
"app.language.helpTranslate": "Missing your language or spotted a wrong translation? Help out on Weblate →",
|
||||
"app.serverBanner": "Show server banners",
|
||||
"app.serverBanner.hint": "The banner loads straight from the address the server admin set, and that host sees your IP address.",
|
||||
"app.chatImages": "Load images in chat",
|
||||
"app.chatImages.hint": "Images from [img] tags and Markdown load straight from the address the sender picked, and that host sees your IP address. When off, they show as links.",
|
||||
"playback.title": "Playback",
|
||||
"playback.subtitle": "Change your playback settings",
|
||||
"playback.profile": "Profile",
|
||||
@@ -337,6 +377,7 @@
|
||||
"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:",
|
||||
@@ -354,6 +395,9 @@
|
||||
"info.serverGroups": "Server groups:",
|
||||
"info.yes": "Yes",
|
||||
"info.no": "No",
|
||||
"tree.noMatches": "No matches",
|
||||
"tree.search": "Search channels and users",
|
||||
"tree.label": "Channels",
|
||||
"tree.notConnected": "Not connected",
|
||||
"tree.clickToSelect": "Click to select, double-click to join",
|
||||
"tree.clickToJoin": "Double-click to join",
|
||||
@@ -547,6 +591,7 @@
|
||||
"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",
|
||||
@@ -570,6 +615,8 @@
|
||||
"clientContext.poke": "Poke",
|
||||
"clientContext.watchStream": "Watch stream",
|
||||
"clientContext.moveTo": "Move to…",
|
||||
"clientContext.volume": "Volume",
|
||||
"clientContext.volumeHint": "Only for you. Double-click resets to 100%.",
|
||||
"clientContext.copyName": "Copy name",
|
||||
"clientContext.connectionInfo": "Show connection info",
|
||||
"clientContext.addWhisperTarget": "Add as whisper target",
|
||||
@@ -601,6 +648,7 @@
|
||||
"sounds.event.clientLeave": "Client leaves",
|
||||
"sounds.event.message": "Message received",
|
||||
"sounds.event.poke": "Poke received",
|
||||
"sounds.event.mute": "Mute toggled",
|
||||
"sounds.default": "Default",
|
||||
"sounds.custom": "Custom file: {name}",
|
||||
"sounds.test": "▶ Test",
|
||||
@@ -618,5 +666,14 @@
|
||||
"nachrichten.templateName": "Template name",
|
||||
"nachrichten.message": "Message",
|
||||
"nachrichten.add": "Add",
|
||||
"nachrichten.delete": "Delete"
|
||||
"nachrichten.delete": "Delete",
|
||||
"tabs.disconnect": "Disconnect",
|
||||
"identity.importInvalid": "\"{file}\" is not a valid identity file.",
|
||||
"log.fileTransferFailed": "File transfer failed:",
|
||||
"log.serverReconnecting": "Connection to the server lost, reconnecting…",
|
||||
"log.serverReconnected": "Reconnected to the server",
|
||||
"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"
|
||||
}
|
||||
+58
-2
@@ -52,7 +52,7 @@
|
||||
"feedback.dialog.reportHint": "گزارشها همیشه خصوصی میمانند و هرگز بهصورت Issue عمومی در گیتهاب منتشر نمیشوند. در صورت نیاز میتوانی نام سرور مربوطه را ذکر کنی.",
|
||||
"feedback.dialog.message": "پیام",
|
||||
"feedback.dialog.messagePlaceholder": "چه اتفاقی افتاد، یا چه پیشنهادی داری؟",
|
||||
"feedback.dialog.email": "ایمیل (اختیاری، برای پیگیری)",
|
||||
"feedback.dialog.email": "ایمیل (اختیاری، برای پیگیری – خصوصی میماند و هرگز منتشر نمیشود)",
|
||||
"feedback.dialog.publishAsIssue": "بهصورت Issue عمومی در گیتهاب منتشر شود",
|
||||
"feedback.dialog.publishAsIssueHint": "اگر تیک نزنی، بازخوردت خصوصی میماند و فقط برای مدیر پروژه قابل مشاهده است.",
|
||||
"feedback.dialog.publishAsIssueHintBug": "گزارش اشکالها همیشه بهصورت Issue عمومی در گیتهاب منتشر میشوند.",
|
||||
@@ -90,6 +90,10 @@
|
||||
"toolbar.micMute": "بیصدا کردن میکروفون",
|
||||
"toolbar.micUnmute": "فعال کردن صدای میکروفون",
|
||||
"toolbar.vadSensitivity": "حساسیت فعالسازی صوتی",
|
||||
"tabAudio.start": "صدای یک زبانه یا پنجره را در کانال صوتی پخش کن (با هدفون پژواک ایجاد نمیشود)",
|
||||
"tabAudio.stop": "توقف اشتراک صدا",
|
||||
"tabAudio.noAudio": "صدایی به اشتراک گذاشته نشد. در پنجره انتخاب، یک زبانه یا پنجره را انتخاب و صدای آن را روشن کنید.",
|
||||
"tabAudio.silent": "۵ ثانیه است که از صدای اشتراکگذاشتهشده چیزی نمیرسد. صدای سیستم روی همهٔ رایانههای ویندوزی صدا نمیدهد؛ بهجای آن یک زبانهٔ مرورگر (مثلاً Spotify وب یا YouTube) را با روشن بودن «اشتراک صدای زبانه» به اشتراک بگذارید.",
|
||||
"toolbar.muteSound": "بیصدا کردن صدا (کر کردن)",
|
||||
"toolbar.unmuteSound": "فعال کردن صدا",
|
||||
"toolbar.chooseOutputDevice": "انتخاب دستگاه خروجی",
|
||||
@@ -272,6 +276,9 @@
|
||||
"design.theme.greenteaspeak.desc": "چیدمان کلاسیک کلاینت GreenTeaSpeak با پنلهای تیره و نوار منوی طلایی.",
|
||||
"design.theme.pulse": "Pulse",
|
||||
"design.theme.pulse.desc": "چیدمان کارتی با نوار مسیر و رنگ تأکیدی.",
|
||||
"design.theme.ide": "Command Center",
|
||||
"design.theme.ide.desc": "چیدمانی فنی و تخت به سبک IDE برای کاربران حرفهای.",
|
||||
"design.idePixelFont": "فونت پیکسلی ترمینال",
|
||||
"design.status.connected": "متصل",
|
||||
"design.custom.new": "+ طراحی جدید",
|
||||
"design.custom.import": "وارد کردن طراحی",
|
||||
@@ -289,6 +296,34 @@
|
||||
"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": "نجوا",
|
||||
@@ -306,7 +341,12 @@
|
||||
"app.language.en": "English",
|
||||
"app.language.zh-CN": "简体中文",
|
||||
"app.language.fa": "فارسی (بتا)",
|
||||
"app.language.cs-CZ": "Čeština",
|
||||
"app.language.helpTranslate": "زبان شما موجود نیست یا ترجمهای اشتباه دیدید؟ در Weblate کمک کنید →",
|
||||
"app.serverBanner": "نمایش بنر سرور",
|
||||
"app.serverBanner.hint": "بنر مستقیماً از نشانیای بارگیری میشود که مدیر سرور تعیین کرده است و آن میزبان نشانی IP شما را میبیند.",
|
||||
"app.chatImages": "بارگیری تصاویر در گفتگو",
|
||||
"app.chatImages.hint": "تصاویر برچسبهای [img] و مارکداون مستقیماً از نشانیای که فرستنده انتخاب کرده بارگیری میشوند و آن میزبان نشانی IP شما را میبیند. در حالت خاموش بهصورت پیوند نمایش داده میشوند.",
|
||||
"playback.title": "پخش",
|
||||
"playback.subtitle": "تنظیمات پخش را تغییر بده",
|
||||
"playback.profile": "پروفایل",
|
||||
@@ -354,6 +394,9 @@
|
||||
"info.serverGroups": "گروههای سرور:",
|
||||
"info.yes": "بله",
|
||||
"info.no": "خیر",
|
||||
"tree.noMatches": "نتیجهای یافت نشد",
|
||||
"tree.search": "جستجوی کانالها و کاربران",
|
||||
"tree.label": "کانالها",
|
||||
"tree.notConnected": "متصل نیست",
|
||||
"tree.clickToSelect": "برای انتخاب کلیک کن، برای ورود دوبار کلیک کن",
|
||||
"tree.clickToJoin": "برای ورود دوبار کلیک کن",
|
||||
@@ -547,6 +590,7 @@
|
||||
"channelContext.files": "فایلها...",
|
||||
"fileBrowser.title": "انتقال فایل",
|
||||
"fileBrowser.up": "بالا",
|
||||
"fileBrowser.tooLarge": "فایل خیلی بزرگ است – حداکثر {mb} مگابایت برای هر آپلود.",
|
||||
"fileBrowser.refresh": "بارگذاری مجدد",
|
||||
"fileBrowser.newFolder": "پوشه جدید",
|
||||
"fileBrowser.upload": "بارگذاری",
|
||||
@@ -570,6 +614,8 @@
|
||||
"clientContext.poke": "سقلمه",
|
||||
"clientContext.watchStream": "تماشای پخش زنده",
|
||||
"clientContext.moveTo": "انتقال به…",
|
||||
"clientContext.volume": "بلندی صدا",
|
||||
"clientContext.volumeHint": "فقط برای شما. دوبار کلیک به ۱۰۰٪ برمیگرداند.",
|
||||
"clientContext.copyName": "کپی نام",
|
||||
"clientContext.connectionInfo": "نمایش اطلاعات اتصال",
|
||||
"clientContext.addWhisperTarget": "افزودن به مقصدهای نجوا",
|
||||
@@ -601,6 +647,7 @@
|
||||
"sounds.event.clientLeave": "خروج کاربر",
|
||||
"sounds.event.message": "پیام دریافت شد",
|
||||
"sounds.event.poke": "سقلمه دریافت شد",
|
||||
"sounds.event.mute": "تغییر حالت بیصدا",
|
||||
"sounds.default": "پیشفرض",
|
||||
"sounds.custom": "فایل سفارشی: {name}",
|
||||
"sounds.test": "▶ آزمایش",
|
||||
@@ -618,5 +665,14 @@
|
||||
"nachrichten.templateName": "نام الگو",
|
||||
"nachrichten.message": "پیام",
|
||||
"nachrichten.add": "افزودن",
|
||||
"nachrichten.delete": "حذف"
|
||||
"nachrichten.delete": "حذف",
|
||||
"tabs.disconnect": "قطع اتصال",
|
||||
"identity.importInvalid": "«{file}» یک فایل هویت معتبر نیست.",
|
||||
"log.fileTransferFailed": "انتقال فایل ناموفق بود:",
|
||||
"log.serverReconnecting": "اتصال به سرور قطع شد، در حال اتصال دوباره…",
|
||||
"log.serverReconnected": "دوباره به سرور متصل شد",
|
||||
"log.fileTransferInvalidAddress": "انتقال فایل ناموفق بود (نشانی نامعتبر)",
|
||||
"sounds.importFailed": "این بسته صدا خوانده نشد - آیا یک فایل .ts3soundpack/ZIP معتبر است؟",
|
||||
"tabs.connections": "اتصالهای سرور",
|
||||
"shortcut.ctrl": "Ctrl"
|
||||
}
|
||||
@@ -43,6 +43,10 @@
|
||||
"toolbar.micMute": "麦克风静音",
|
||||
"toolbar.micUnmute": "取消麦克风静音",
|
||||
"toolbar.vadSensitivity": "语音激活灵敏度",
|
||||
"tabAudio.start": "将标签页或窗口的声音共享到语音频道(戴耳机可避免回声)",
|
||||
"tabAudio.stop": "停止共享声音",
|
||||
"tabAudio.noAudio": "没有共享声音。请在选择窗口中选择标签页或窗口,并开启其声音。",
|
||||
"tabAudio.silent": "共享的声音已 5 秒没有任何内容。系统音频并非在每台 Windows 电脑上都有声音;请改为共享浏览器标签页(例如网页版 Spotify 或 YouTube),并开启“共享标签页音频”。",
|
||||
"toolbar.muteSound": "关闭声音(拒听)",
|
||||
"toolbar.unmuteSound": "开启声音(取消拒听)",
|
||||
"toolbar.chooseOutputDevice": "选择输出设备",
|
||||
@@ -219,6 +223,9 @@
|
||||
"design.theme.greenteaspeak.desc": "经典 GreenTeaSpeak 客户端布局:深色面板与金色菜单栏。",
|
||||
"design.theme.pulse": "Pulse",
|
||||
"design.theme.pulse.desc": "卡片式布局,带面包屑栏和彩色强调。",
|
||||
"design.theme.ide": "Command Center",
|
||||
"design.theme.ide.desc": "面向高级用户的扁平化 IDE 风格技术布局。",
|
||||
"design.idePixelFont": "像素终端字体",
|
||||
"design.status.connected": "已连接",
|
||||
"options.section.erweiterungen": "扩展",
|
||||
"options.section.hotkeys": "快捷键",
|
||||
@@ -237,7 +244,12 @@
|
||||
"app.language.en": "English",
|
||||
"app.language.zh-CN": "简体中文",
|
||||
"app.language.fa": "فارسی (بتا)",
|
||||
"app.language.cs-CZ": "Čeština",
|
||||
"app.language.helpTranslate": "没有你的语言,或发现翻译有误?欢迎到 Weblate 参与改进 →",
|
||||
"app.serverBanner": "显示服务器横幅",
|
||||
"app.serverBanner.hint": "横幅直接从服务器管理员设置的地址加载,该主机会看到你的 IP 地址。",
|
||||
"app.chatImages": "在聊天中加载图片",
|
||||
"app.chatImages.hint": "[img] 标签和 Markdown 中的图片直接从发送者指定的地址加载,该主机会看到你的 IP 地址。关闭时显示为链接。",
|
||||
"playback.title": "播放",
|
||||
"playback.subtitle": "更改播放设置",
|
||||
"playback.profile": "配置",
|
||||
@@ -284,6 +296,9 @@
|
||||
"info.serverGroups": "服务器组:",
|
||||
"info.yes": "是",
|
||||
"info.no": "否",
|
||||
"tree.noMatches": "无匹配结果",
|
||||
"tree.search": "搜索频道和用户",
|
||||
"tree.label": "频道",
|
||||
"tree.notConnected": "未连接",
|
||||
"tree.clickToSelect": "单击选择,双击加入",
|
||||
"tree.clickToJoin": "双击加入",
|
||||
@@ -431,6 +446,7 @@
|
||||
"channelContext.files": "文件...",
|
||||
"fileBrowser.title": "文件传输",
|
||||
"fileBrowser.up": "上一级",
|
||||
"fileBrowser.tooLarge": "文件过大——每次上传最多 {mb} MiB。",
|
||||
"fileBrowser.refresh": "刷新",
|
||||
"fileBrowser.newFolder": "新建文件夹",
|
||||
"fileBrowser.upload": "上传",
|
||||
@@ -453,6 +469,8 @@
|
||||
"clientContext.privateChat": "私聊",
|
||||
"clientContext.poke": "戳一戳",
|
||||
"clientContext.moveTo": "移动到…",
|
||||
"clientContext.volume": "音量",
|
||||
"clientContext.volumeHint": "仅对你生效。双击恢复为 100%。",
|
||||
"clientContext.copyName": "复制名称",
|
||||
"clientContext.connectionInfo": "查看连接信息",
|
||||
"clientContext.addWhisperTarget": "添加为悄悄话目标",
|
||||
@@ -484,6 +502,7 @@
|
||||
"sounds.event.clientLeave": "用户离开",
|
||||
"sounds.event.message": "收到消息",
|
||||
"sounds.event.poke": "收到戳一戳",
|
||||
"sounds.event.mute": "切换静音",
|
||||
"sounds.default": "默认",
|
||||
"sounds.custom": "自定义文件:{name}",
|
||||
"sounds.test": "▶ 测试",
|
||||
@@ -522,7 +541,7 @@
|
||||
"feedback.dialog.reportHint": "举报内容保持私密,不会作为 GitHub Issue 公开。如有需要可注明相关服务器。",
|
||||
"feedback.dialog.message": "消息",
|
||||
"feedback.dialog.messagePlaceholder": "发生了什么,或者你有什么建议?",
|
||||
"feedback.dialog.email": "邮箱(可选,用于回复)",
|
||||
"feedback.dialog.email": "邮箱(可选,用于回复——仅私下保存,绝不公开)",
|
||||
"feedback.dialog.publishAsIssue": "作为公开的 GitHub Issue 发布",
|
||||
"feedback.dialog.publishAsIssueHint": "不勾选则反馈保持私密,仅维护者可见。",
|
||||
"feedback.dialog.publishAsIssueHintBug": "错误报告将始终作为公开的 GitHub Issue 发布。",
|
||||
@@ -571,6 +590,34 @@
|
||||
"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": "内测",
|
||||
@@ -618,5 +665,14 @@
|
||||
"stream.state.disconnected": "连接中断",
|
||||
"stream.state.failed": "连接失败",
|
||||
"stream.state.closed": "已结束",
|
||||
"clientContext.watchStream": "观看直播"
|
||||
"clientContext.watchStream": "观看直播",
|
||||
"tabs.disconnect": "断开连接",
|
||||
"identity.importInvalid": "“{file}”不是有效的身份文件。",
|
||||
"log.fileTransferFailed": "文件传输失败:",
|
||||
"log.serverReconnecting": "与服务器的连接已断开,正在重新连接…",
|
||||
"log.serverReconnected": "已重新连接到服务器",
|
||||
"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'
|
||||
|
||||
+1
-7
@@ -15,7 +15,7 @@
|
||||
// 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";
|
||||
import { DEFAULT_ICE_SERVERS, 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.
|
||||
@@ -44,12 +44,6 @@ export const StreamMode = {
|
||||
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. */
|
||||
|
||||
@@ -23,6 +23,7 @@ const EVENT_KEYWORDS: Record<SoundEventId, string[]> = {
|
||||
clientLeave: ["userleftchannel", "userleftvisibility", "clientleftview", "userleave", "userleft", "leave"],
|
||||
message: ["textmessagereceived", "chatmessage", "newmessage", "message"],
|
||||
poke: ["gotpoked", "poke"],
|
||||
mute: ["micmuted", "microphonemuted", "micactivated", "microphoneactivated"],
|
||||
};
|
||||
|
||||
function normalize(filename: string): string {
|
||||
|
||||
+62
-10
@@ -1,6 +1,14 @@
|
||||
export type SoundEventId = "connect" | "disconnect" | "clientJoin" | "clientLeave" | "message" | "poke";
|
||||
export type SoundEventId = "connect" | "disconnect" | "clientJoin" | "clientLeave" | "message" | "poke" | "mute";
|
||||
|
||||
export const SOUND_EVENTS: SoundEventId[] = ["connect", "disconnect", "clientJoin", "clientLeave", "message", "poke"];
|
||||
export const SOUND_EVENTS: SoundEventId[] = ["connect", "disconnect", "clientJoin", "clientLeave", "message", "poke", "mute"];
|
||||
|
||||
/** "ide" swaps the default chimes for synthetic terminal blips (Command Center layout). */
|
||||
type SoundStyle = "classic" | "ide";
|
||||
let soundStyle: SoundStyle = "classic";
|
||||
|
||||
export function setSoundStyle(style: SoundStyle): void {
|
||||
soundStyle = style;
|
||||
}
|
||||
|
||||
const ENABLED_KEY = "webspeak3:sounds-enabled";
|
||||
const VOLUME_KEY = "webspeak3:sounds-volume";
|
||||
@@ -141,8 +149,8 @@ class NotificationSoundPlayer {
|
||||
const { context, destination } = this.ensure();
|
||||
if (context.state === "suspended") context.resume().catch(() => {});
|
||||
const now = context.currentTime;
|
||||
for (const note of synthNotes(event)) {
|
||||
this.playNote(context, destination, now + note.delay, note.freq, note.duration, volume * note.gain);
|
||||
for (const note of soundStyle === "ide" ? ideNotes(event) : synthNotes(event)) {
|
||||
this.playNote(context, destination, now + note.delay, volume * note.gain, note);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,13 +158,13 @@ class NotificationSoundPlayer {
|
||||
context: AudioContext,
|
||||
destination: AudioNode,
|
||||
startTime: number,
|
||||
freq: number,
|
||||
duration: number,
|
||||
peakGain: number
|
||||
peakGain: number,
|
||||
{ freq, endFreq, duration, type = "sine" }: SynthNote
|
||||
): void {
|
||||
const osc = context.createOscillator();
|
||||
osc.type = "sine";
|
||||
osc.frequency.value = freq;
|
||||
osc.type = type;
|
||||
osc.frequency.setValueAtTime(freq, startTime);
|
||||
if (endFreq) osc.frequency.exponentialRampToValueAtTime(endFreq, startTime + duration);
|
||||
const gain = context.createGain();
|
||||
gain.gain.setValueAtTime(0, startTime);
|
||||
gain.gain.linearRampToValueAtTime(peakGain, startTime + 0.02);
|
||||
@@ -169,7 +177,17 @@ class NotificationSoundPlayer {
|
||||
|
||||
/** Soft, modern two/three-note chimes - a sine-wave, quick-attack/exponential-decay
|
||||
* shape reads as gentle rather than the harsh square/saw beeps of classic UI sounds. */
|
||||
function synthNotes(event: SoundEventId): { delay: number; freq: number; duration: number; gain: number }[] {
|
||||
interface SynthNote {
|
||||
delay: number;
|
||||
freq: number;
|
||||
/** Glide to this frequency over the note's duration. */
|
||||
endFreq?: number;
|
||||
duration: number;
|
||||
gain: number;
|
||||
type?: OscillatorType;
|
||||
}
|
||||
|
||||
function synthNotes(event: SoundEventId): SynthNote[] {
|
||||
switch (event) {
|
||||
case "connect":
|
||||
return [
|
||||
@@ -195,6 +213,40 @@ function synthNotes(event: SoundEventId): { delay: number; freq: number; duratio
|
||||
{ delay: 0, freq: 987.77, duration: 0.1, gain: 0.5 },
|
||||
{ delay: 0.12, freq: 987.77, duration: 0.1, gain: 0.5 },
|
||||
];
|
||||
case "mute":
|
||||
return [{ delay: 0, freq: 660, duration: 0.06, gain: 0.3 }];
|
||||
}
|
||||
}
|
||||
|
||||
/** Command Center: short, dry, synthetic blips - square/triangle clicks and
|
||||
* quick arpeggios instead of soft chimes. Square waves are loud, so lower gains. */
|
||||
function ideNotes(event: SoundEventId): SynthNote[] {
|
||||
switch (event) {
|
||||
case "connect":
|
||||
return [
|
||||
{ delay: 0, freq: 440, duration: 0.1, gain: 0.3 },
|
||||
{ delay: 0.1, freq: 554.37, duration: 0.1, gain: 0.3 },
|
||||
{ delay: 0.2, freq: 659.25, duration: 0.14, gain: 0.3 },
|
||||
];
|
||||
case "disconnect":
|
||||
return [{ delay: 0, freq: 200, endFreq: 50, duration: 0.2, gain: 0.45, type: "triangle" }];
|
||||
case "clientJoin":
|
||||
return [
|
||||
{ delay: 0, freq: 800, duration: 0.07, gain: 0.18 },
|
||||
{ delay: 0.1, freq: 800, duration: 0.07, gain: 0.18 },
|
||||
];
|
||||
case "clientLeave":
|
||||
return [{ delay: 0, freq: 600, endFreq: 400, duration: 0.09, gain: 0.18 }];
|
||||
case "message":
|
||||
return [{ delay: 0, freq: 1200, duration: 0.04, gain: 0.12, type: "square" }];
|
||||
case "poke":
|
||||
return [
|
||||
{ delay: 0, freq: 1000, duration: 0.05, gain: 0.12, type: "square" },
|
||||
{ delay: 0.08, freq: 1000, duration: 0.05, gain: 0.12, type: "square" },
|
||||
{ delay: 0.16, freq: 1000, duration: 0.05, gain: 0.12, type: "square" },
|
||||
];
|
||||
case "mute":
|
||||
return [{ delay: 0, freq: 300, endFreq: 50, duration: 0.04, gain: 0.15, type: "square" }];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
+1
-1
@@ -62,7 +62,7 @@ export interface StreamViewerOptions {
|
||||
iceServers?: RTCIceServer[];
|
||||
}
|
||||
|
||||
const DEFAULT_ICE_SERVERS: RTCIceServer[] = [
|
||||
export const DEFAULT_ICE_SERVERS: RTCIceServer[] = [
|
||||
{ urls: "stun:turn.teamspeak.com:3478" },
|
||||
{ urls: "stun:turn2.teamspeak.com:3478" },
|
||||
{ urls: "stun:stun.l.google.com:19302" },
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
--gts-border: #1c1f24;
|
||||
--border-light: #3a4450;
|
||||
--gts-text: #d7dee6;
|
||||
--gts-text-muted: #7a8490;
|
||||
--gts-text-muted: #8a94a0; /* native #7a8490, lifted to 4.5:1 on the panel */
|
||||
--menu-text: #c8b882;
|
||||
--menu-hover: #c8b882;
|
||||
--menu-hover-text: #1a1a1a;
|
||||
@@ -34,7 +34,7 @@
|
||||
--error: #e62222;
|
||||
--selection: #4a5560;
|
||||
--selection-tree: #5a7ea0;
|
||||
--server-log-text: #7a8490;
|
||||
--server-log-text: #8a94a0;
|
||||
--chat-separator: #1c1f24;
|
||||
--chat-separator-selected: #4a5560;
|
||||
--tree-fg: #d1d1d1;
|
||||
@@ -375,7 +375,10 @@
|
||||
color: var(--gts-text);
|
||||
}
|
||||
|
||||
/* Multi-join tabs for Standard / Nova (same strip, slightly softer chrome) */
|
||||
/* Multi-join tabs for Standard / Nova (same strip, slightly softer chrome).
|
||||
Only GTS defines --bg-app/--bg-toolbar/--bg-panel, so this strip is always
|
||||
dark here: 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:not(.ts-design-greenteaspeak) .gts-connection-tabs {
|
||||
display: flex;
|
||||
gap: 1px;
|
||||
@@ -396,7 +399,7 @@
|
||||
background: var(--bg-toolbar, #2a2a2a);
|
||||
border: 1px solid var(--border, #444);
|
||||
border-bottom: none;
|
||||
color: var(--text-muted, #aaa);
|
||||
color: #aaa;
|
||||
padding: 0 4px 0 10px;
|
||||
max-width: 280px;
|
||||
height: 100%;
|
||||
@@ -408,7 +411,7 @@
|
||||
|
||||
.ts-app:not(.ts-design-greenteaspeak) .gts-connection-tab-active {
|
||||
background: var(--bg-panel, #333);
|
||||
color: var(--text, #eee);
|
||||
color: #eee;
|
||||
border-color: #b0b8c0;
|
||||
}
|
||||
|
||||
@@ -422,6 +425,7 @@
|
||||
|
||||
.ts-app:not(.ts-design-greenteaspeak) .gts-connection-tab-close {
|
||||
flex-shrink: 0;
|
||||
text-align: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
padding: 0;
|
||||
|
||||
@@ -0,0 +1,717 @@
|
||||
/* Command Center (IDE style): explorer | voice grid + terminal | inspector,
|
||||
flat zinc/emerald, always dark regardless of the light/dark toggle.
|
||||
Variables sit in :where() so custom themes can override them; component
|
||||
rules use .ts-app.ts-design-ide like Pulse does, so they beat App.css
|
||||
without !important. Imported right after App.css in App.tsx - the order
|
||||
matters for the zero-specificity block. */
|
||||
|
||||
/* Pixel terminal font, self-hosted (OFL) so no visitor IP goes to Google Fonts.
|
||||
The file only downloads once an element actually uses it. */
|
||||
@font-face {
|
||||
font-family: "VT323";
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url("../assets/fonts/vt323-latin.woff2") format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "VT323";
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url("../assets/fonts/vt323-latin-ext.woff2") format("woff2");
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
|
||||
:where(.ts-app.ts-design-ide) {
|
||||
/* VT323 has no bold cut; faux-bold smears the pixels. */
|
||||
font-synthesis-weight: none;
|
||||
--ide-mono: VT323, "Fira Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
|
||||
--ide-font: var(--ide-mono);
|
||||
--ide-panel: #18181b;
|
||||
--ide-faint: #71717a;
|
||||
--ide-accent-bg: rgba(16, 185, 129, 0.1);
|
||||
|
||||
font-family: var(--ide-font);
|
||||
/* VT323 has a tiny x-height and narrow glyphs: scale it up and space it out. */
|
||||
font-size-adjust: 0.55;
|
||||
letter-spacing: 0.05em;
|
||||
font-size: 13px;
|
||||
|
||||
--bg: #09090b;
|
||||
--bg-toolbar-1: #18181b;
|
||||
--bg-toolbar-2: #18181b;
|
||||
--border: #27272a;
|
||||
--border-soft: #27272a;
|
||||
--text: #e4e4e7;
|
||||
--text-muted: #a1a1aa;
|
||||
--text-faint: #71717a;
|
||||
--accent: #10b981;
|
||||
--success: #10b981;
|
||||
--input-bg: #09090b;
|
||||
--input-text: #e4e4e7;
|
||||
--button-bg-1: #18181b;
|
||||
--button-bg-2: #18181b;
|
||||
--button-bg-hover-1: #27272a;
|
||||
--button-bg-hover-2: #27272a;
|
||||
--row-hover: #27272a;
|
||||
--client-text: #a1a1aa;
|
||||
--self-text: #10b981;
|
||||
--log-bg: #09090b;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide ::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide ::-webkit-scrollbar-track {
|
||||
background: var(--bg);
|
||||
border-left: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide ::-webkit-scrollbar-thumb {
|
||||
background: #3f3f46;
|
||||
border: 2px solid var(--bg);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide *:focus-visible {
|
||||
outline: 1px solid var(--accent);
|
||||
outline-offset: -1px;
|
||||
}
|
||||
|
||||
/* Terminal font everywhere, beating base rules that pick their own family */
|
||||
.ts-app.ts-design-ide:not(.ts-ide-plain-font) :is(*, *::before, *::after) {
|
||||
font-family: var(--ide-font);
|
||||
}
|
||||
|
||||
/* Pixel font switched off in the design options: sans UI, regular mono for the terminal bits */
|
||||
.ts-app.ts-design-ide.ts-ide-plain-font {
|
||||
--ide-mono: "Fira Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
|
||||
--ide-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
||||
font-size-adjust: none;
|
||||
letter-spacing: normal;
|
||||
font-synthesis-weight: auto;
|
||||
}
|
||||
|
||||
/* Form controls reset size adjust and spacing in the UA sheet instead of inheriting them */
|
||||
.ts-app.ts-design-ide :is(button, input, select, textarea) {
|
||||
font-size-adjust: inherit;
|
||||
letter-spacing: inherit;
|
||||
}
|
||||
|
||||
/* ---------- Header: menubar + toolbar + connection tabs ---------- */
|
||||
|
||||
/* No own row for the menubar: the hamburger floats into the toolbar row */
|
||||
.ts-app.ts-design-ide > .ts-menubar {
|
||||
position: relative;
|
||||
z-index: 20;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide > .ts-menubar .ts-nova-menu-dropdown {
|
||||
position: absolute;
|
||||
top: 0.4rem;
|
||||
right: 0.5rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide > .ts-toolbar {
|
||||
padding-right: 3rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide > .ts-toolbar {
|
||||
background: var(--ide-panel);
|
||||
border-bottom: 1px solid var(--border);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-icon-button {
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
box-shadow: none;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-icon-button:hover {
|
||||
background: var(--row-hover);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .gts-connection-tabs {
|
||||
font-family: var(--ide-mono);
|
||||
background: var(--bg);
|
||||
border-bottom: 1px solid var(--border);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .gts-connection-tab {
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-right: 1px solid var(--border);
|
||||
border-radius: 0;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .gts-connection-tab-active {
|
||||
background: var(--ide-panel);
|
||||
color: var(--text);
|
||||
box-shadow: inset 0 2px 0 var(--accent);
|
||||
}
|
||||
|
||||
/* ---------- Body: explorer | center | inspector ---------- */
|
||||
|
||||
.ts-app.ts-design-ide > .ts-body {
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr) 18rem;
|
||||
grid-template-rows: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
/* Flatten the Standard "upper row" so tree and info panel become grid cells */
|
||||
.ts-app.ts-design-ide .ts-upper {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-resize-handle-vertical,
|
||||
.ts-app.ts-design-ide .ts-resize-handle-horizontal {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-tree-panel,
|
||||
.ts-app.ts-design-ide .ts-side-panel {
|
||||
grid-row: 1;
|
||||
overflow-y: auto;
|
||||
background: var(--ide-panel);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-tree-panel {
|
||||
font-family: var(--ide-mono);
|
||||
grid-column: 1;
|
||||
overflow-x: hidden;
|
||||
min-width: 16rem;
|
||||
padding: 0 0 0.5rem;
|
||||
border-right: 1px solid var(--border);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-side-panel {
|
||||
font-family: var(--ide-mono);
|
||||
grid-column: 3;
|
||||
border-left: 1px solid var(--border);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-panel {
|
||||
grid-column: 2;
|
||||
grid-row: 1;
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
/* Section headers like an IDE side bar */
|
||||
.ts-app.ts-design-ide .ts-tree-panel::before,
|
||||
.ts-app.ts-design-ide .ts-side-panel::before {
|
||||
font-family: var(--ide-mono);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
height: 2rem;
|
||||
padding: 0 1rem;
|
||||
margin-bottom: 0.4rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.15em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ide-faint);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-tree-panel::before {
|
||||
content: "Explorer";
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-side-panel::before {
|
||||
content: "Inspector";
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-tree-panel > * {
|
||||
margin-left: 0.5rem;
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-row {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-row-selected {
|
||||
background: var(--ide-accent-bg);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
/* Explorer tree as in the mockup: carets and dots instead of folder/server icons and orbs */
|
||||
.ts-app.ts-design-ide .ts-server-row > svg,
|
||||
.ts-app.ts-design-ide .ts-channel-row > svg {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-server-row {
|
||||
color: var(--text);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-server-row::before {
|
||||
content: "\25BE";
|
||||
color: var(--ide-faint);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-row {
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-channel-row {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-channel-row:has(+ .ts-tree-list .ts-self) {
|
||||
color: var(--text);
|
||||
background: rgba(39, 39, 42, 0.5);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-tree-expander span {
|
||||
border-top-color: var(--ide-faint);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-tree-expander-collapsed span {
|
||||
border-top-color: transparent;
|
||||
border-left-color: var(--ide-faint);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-client-row.ts-self {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-client-row.ts-talking {
|
||||
outline: 1px solid var(--accent);
|
||||
outline-offset: -1px;
|
||||
background: rgba(16, 185, 129, 0.05);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-talk-lamp-idle,
|
||||
.ts-app.ts-design-ide .ts-talk-lamp-talking {
|
||||
position: relative;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
margin: 0 4px;
|
||||
background: #52525b;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-talk-lamp-talking {
|
||||
background: var(--accent);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-talk-lamp-talking::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 50%;
|
||||
background: var(--accent);
|
||||
animation: ts-ide-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
|
||||
}
|
||||
|
||||
@keyframes ts-ide-ping {
|
||||
75%,
|
||||
100% {
|
||||
transform: scale(2.5);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* The narrow explorer must not squeeze the name away in favour of the away message */
|
||||
.ts-app.ts-design-ide .ts-client-row .ts-tree-label {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-client-away-message {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-talk-lamp-muted {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-tree-search {
|
||||
font-family: var(--ide-mono);
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* Inspector content */
|
||||
.ts-app.ts-design-ide .ts-info-panel {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-info-title {
|
||||
color: var(--text);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-info-row {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-info-connection-link {
|
||||
letter-spacing: 0.05em;
|
||||
color: var(--accent);
|
||||
text-transform: uppercase;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
/* ---------- Center: breadcrumb, voice grid, terminal ---------- */
|
||||
|
||||
.ts-app.ts-design-ide .ts-ide-breadcrumb {
|
||||
font-family: var(--ide-mono);
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.3rem;
|
||||
height: 2rem;
|
||||
padding: 0 1rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
font-size: 12px;
|
||||
color: var(--ide-faint);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-ide-breadcrumb span {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
|
||||
align-content: start;
|
||||
gap: 1rem;
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-tile {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
overflow: hidden;
|
||||
background: var(--ide-panel);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
opacity: 0.8;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-tile:hover,
|
||||
.ts-app.ts-design-ide .ts-speaking-now-tile-active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-tile-active {
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 1px var(--accent), 0 0 12px rgba(16, 185, 129, 0.35);
|
||||
}
|
||||
|
||||
/* Speaking glow along the top edge */
|
||||
.ts-app.ts-design-ide .ts-speaking-now-tile-active::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0 0 auto;
|
||||
height: 2px;
|
||||
background: var(--accent);
|
||||
box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-avatar {
|
||||
font-family: var(--ide-mono);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
overflow: hidden;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg);
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-avatar img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-name {
|
||||
min-width: 0;
|
||||
max-width: none;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-tile-active .ts-speaking-now-name {
|
||||
color: var(--text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-head .ts-talk-lamp-muted {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* Little audio visualizer for the speaker */
|
||||
.ts-app.ts-design-ide .ts-speaking-now-bars {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 2px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-bars i {
|
||||
width: 4px;
|
||||
height: 100%;
|
||||
background: var(--accent);
|
||||
animation: ts-ide-bar 0.8s ease-in-out infinite alternate;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-bars i:nth-child(2) {
|
||||
animation-delay: -0.3s;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-bars i:nth-child(3) {
|
||||
animation-delay: -0.55s;
|
||||
}
|
||||
|
||||
@keyframes ts-ide-bar {
|
||||
from {
|
||||
height: 25%;
|
||||
}
|
||||
to {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-groups {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.375rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-group {
|
||||
font-family: var(--ide-mono);
|
||||
padding: 0 0.25rem;
|
||||
border: 1px solid var(--group-color);
|
||||
background: color-mix(in srgb, var(--group-color) 10%, transparent);
|
||||
color: color-mix(in srgb, var(--group-color) 75%, #fff);
|
||||
font-size: 9px;
|
||||
line-height: 1.5;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-tile {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-tile-selected {
|
||||
border-color: var(--text-muted);
|
||||
background: #1f1f23;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Speaking wins over selected */
|
||||
.ts-app.ts-design-ide .ts-speaking-now-tile-selected.ts-speaking-now-tile-active {
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-speaking-now-status {
|
||||
font-family: var(--ide-mono);
|
||||
margin-top: 0.375rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 11px;
|
||||
color: var(--ide-faint);
|
||||
}
|
||||
|
||||
/* Terminal: fixed-height bottom pane once the voice grid is above it */
|
||||
.ts-app.ts-design-ide .ts-chat-panel:has(.ts-speaking-now) .ts-chat-messages {
|
||||
flex: 0 0 11rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-tabs {
|
||||
order: 1;
|
||||
gap: 1.5rem;
|
||||
padding: 0.5rem 1rem 0;
|
||||
background: var(--ide-panel);
|
||||
border-top: 1px solid var(--border);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-messages {
|
||||
font-family: var(--ide-mono);
|
||||
order: 2;
|
||||
padding: 1rem;
|
||||
background: var(--ide-panel);
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-tab {
|
||||
font-family: var(--ide-mono);
|
||||
padding: 0 0 0.5rem;
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 2px solid transparent;
|
||||
border-radius: 0;
|
||||
font-size: 11px;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ide-faint);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-tab:hover {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-tab-active {
|
||||
border-bottom-color: var(--accent);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-from {
|
||||
color: #d4d4d8;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-line-self .ts-chat-from {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-line-log {
|
||||
color: #60a5fa;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-bubble {
|
||||
background: none;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* Prompt-style input */
|
||||
.ts-app.ts-design-ide .ts-chat-input-row {
|
||||
font-family: var(--ide-mono);
|
||||
order: 3;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.3rem 1rem;
|
||||
background: var(--bg);
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-input-row::before {
|
||||
content: "➜ ~/channel";
|
||||
flex-shrink: 0;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
color: #60a5fa;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-input-row textarea,
|
||||
.ts-app.ts-design-ide .ts-chat-input-row input {
|
||||
font-family: var(--ide-mono);
|
||||
background: transparent;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
font-size: 12px;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-input-row button,
|
||||
.ts-app.ts-design-ide .ts-dialog button:not(.ts-icon-button) {
|
||||
letter-spacing: 0.05em;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: none;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* Client log strip at the very bottom */
|
||||
.ts-app.ts-design-ide > .ts-log {
|
||||
font-family: var(--ide-mono);
|
||||
background: var(--bg);
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
/* Narrow screens: stack instead of three columns */
|
||||
@media (max-width: 900px) {
|
||||
.ts-app.ts-design-ide > .ts-body {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-rows: auto minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-tree-panel {
|
||||
grid-column: 1;
|
||||
grid-row: 1;
|
||||
width: auto !important;
|
||||
max-height: 40vh;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-side-panel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-ide .ts-chat-panel {
|
||||
grid-column: 1;
|
||||
grid-row: 2;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.ts-app.ts-design-ide .ts-talk-lamp-talking::after,
|
||||
.ts-app.ts-design-ide .ts-speaking-now-bars i {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
@@ -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 (
|
||||
@@ -55,22 +57,31 @@ export function GreenteaSpeakChrome({
|
||||
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 ? (
|
||||
<button
|
||||
type="button"
|
||||
<span
|
||||
className="gts-connection-tab-close"
|
||||
title="Verbindung trennen"
|
||||
aria-label={`Tab schließen: ${tab.label}`}
|
||||
aria-hidden="true"
|
||||
title={t("tabs.disconnect")}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onCloseTab(tab.id);
|
||||
}}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
|
||||
+114
-11
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,6 +60,11 @@ export interface MicCaptureOptions {
|
||||
export class MicCapture {
|
||||
private stream: MediaStream | null = null;
|
||||
private source: MediaStreamAudioSourceNode | null = null;
|
||||
private merger: ChannelMergerNode | null = null;
|
||||
private extra: MediaStreamAudioSourceNode | null = null;
|
||||
private pendingExtra: number[] = [];
|
||||
/** Loudest extra-source sample since setExtraAudio(), to spot a silent share. */
|
||||
extraPeak = 0;
|
||||
private processor: ScriptProcessorNode | null = null;
|
||||
private silence: GainNode | null = null;
|
||||
private monitorTarget: AudioNode | null = null;
|
||||
@@ -67,6 +78,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 +95,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> {
|
||||
@@ -108,9 +122,24 @@ export class MicCapture {
|
||||
// before the AudioContext would otherwise be allowed to leave "suspended".
|
||||
if (this.context.state === "suspended") await this.context.resume();
|
||||
this.source = this.context.createMediaStreamSource(this.stream);
|
||||
this.processor = this.context.createScriptProcessor(2048, 1, 1);
|
||||
// Channel 0 is the mic, channel 1 the optional extra source (setExtraAudio).
|
||||
this.merger = this.context.createChannelMerger(2);
|
||||
this.processor = this.context.createScriptProcessor(2048, 2, 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];
|
||||
@@ -119,7 +148,8 @@ export class MicCapture {
|
||||
|
||||
const now = this.context.currentTime;
|
||||
if (rms >= this.threshold) this.activeUntil = now + this.hangoverSeconds;
|
||||
const shouldBeActive = now < this.activeUntil;
|
||||
// Shared audio (music, a video) has its own pauses; keep sending throughout.
|
||||
const shouldBeActive = this.extra !== null || now < this.activeUntil;
|
||||
if (shouldBeActive !== this.active) {
|
||||
this.active = shouldBeActive;
|
||||
this.onActivity?.(this.active);
|
||||
@@ -129,11 +159,28 @@ export class MicCapture {
|
||||
if (!this.active) return;
|
||||
|
||||
for (let i = 0; i < input.length; i++) this.pending.push(input[i]);
|
||||
// Mixed in per frame rather than per tick: AEC3 may hand back a block of
|
||||
// a different size than it got, and the extra source never went through
|
||||
// it (it isn't an echo of anything).
|
||||
if (this.extra) {
|
||||
const extra = event.inputBuffer.getChannelData(1);
|
||||
for (let i = 0; i < extra.length; i++) {
|
||||
this.pendingExtra.push(extra[i]);
|
||||
this.extraPeak = Math.max(this.extraPeak, Math.abs(extra[i]));
|
||||
}
|
||||
}
|
||||
// AEC3's blocks make the two queues jitter against each other. Padding
|
||||
// a short extra queue with silence clicks; skip it once instead, which
|
||||
// leaves it a frame ahead from then on. Cap the lead to bound latency.
|
||||
if (this.pendingExtra.length > 4 * FRAME_SAMPLES) this.pendingExtra.splice(0, this.pendingExtra.length - 2 * FRAME_SAMPLES);
|
||||
while (this.pending.length >= FRAME_SAMPLES) {
|
||||
const frame = this.pending.splice(0, FRAME_SAMPLES);
|
||||
const extra = this.pendingExtra.length >= FRAME_SAMPLES ? this.pendingExtra.splice(0, FRAME_SAMPLES) : [];
|
||||
const int16 = new Int16Array(FRAME_SAMPLES);
|
||||
for (let i = 0; i < FRAME_SAMPLES; i++) {
|
||||
const clamped = Math.max(-1, Math.min(1, frame[i]));
|
||||
// Shared music is mastered near full scale; at -6 dB it leaves room
|
||||
// for the voice on top instead of clipping.
|
||||
const clamped = Math.max(-1, Math.min(1, frame[i] + (extra[i] ?? 0) * 0.5));
|
||||
int16[i] = clamped < 0 ? clamped * 32768 : clamped * 32767;
|
||||
}
|
||||
this.onFrame(int16ToBase64(int16));
|
||||
@@ -143,35 +190,58 @@ export class MicCapture {
|
||||
// it through a muted gain node so we don't hear our own mic echoed back.
|
||||
this.silence = this.context.createGain();
|
||||
this.silence.gain.value = 0;
|
||||
this.source.connect(this.processor);
|
||||
this.source.connect(this.merger, 0, 0);
|
||||
this.merger.connect(this.processor);
|
||||
this.processor.connect(this.silence);
|
||||
this.silence.connect(this.context.destination);
|
||||
}
|
||||
|
||||
/** Mixes a second stream (e.g. a shared tab's audio) into what is sent, or
|
||||
* removes it with null. The caller keeps ownership of the stream. */
|
||||
setExtraAudio(stream: MediaStream | null): void {
|
||||
this.extra?.disconnect();
|
||||
this.extra = null;
|
||||
this.pendingExtra = [];
|
||||
this.extraPeak = 0;
|
||||
if (stream && this.merger) {
|
||||
this.extra = this.context.createMediaStreamSource(stream);
|
||||
this.extra.connect(this.merger, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/** The raw mic input node, e.g. to additionally route it into a recorder. */
|
||||
getSourceNode(): AudioNode | null {
|
||||
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();
|
||||
this.source?.disconnect();
|
||||
this.extra?.disconnect();
|
||||
this.merger?.disconnect();
|
||||
this.extra = null;
|
||||
this.merger = null;
|
||||
this.pendingExtra = [];
|
||||
this.stream?.getTracks().forEach((t) => t.stop());
|
||||
this.processor = null;
|
||||
this.silence = null;
|
||||
@@ -280,6 +350,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 +424,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 +468,7 @@ export class AudioPlayer {
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.detachAecRenderTap();
|
||||
this.element.pause();
|
||||
this.element.srcObject = null;
|
||||
this.element.remove();
|
||||
|
||||
@@ -95,6 +95,11 @@ export default defineConfig({
|
||||
// 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}'],
|
||||
// The SPA fallback answers every navigation with index.html — except
|
||||
// the gateway's own pages under /api/ (e.g. /api/store/admin), which
|
||||
// would otherwise open the client instead when UI and gateway share
|
||||
// an origin.
|
||||
navigateFallbackDenylist: [/^\/api\//],
|
||||
},
|
||||
}),
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user