diff --git a/.dockerignore b/.dockerignore index a77b85d..c202dcf 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ -# Build context for docker/*.Dockerfile and crates/tsc-gateway/Dockerfile: +# Build context for docker/*.Dockerfile and crates/voelin-gateway/Dockerfile: # the sources only. Builds keep target/ in cache mounts, never in the context. .git .claude diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa1b858..79645ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: # XTEST input) run instead of skipping. - name: Test (Linux, Xvfb) if: runner.os == 'Linux' - run: xvfb-run -a bash -c 'TSC_X11_TEST_DISPLAY="$DISPLAY" cargo test --workspace --locked' + run: xvfb-run -a bash -c 'VOELIN_X11_TEST_DISPLAY="$DISPLAY" cargo test --workspace --locked' - name: Test if: runner.os != 'Linux' run: cargo test --workspace --locked @@ -74,7 +74,7 @@ jobs: with: key: release - name: Build - run: cargo build --release --locked -p tsc-ui -p tsctl -p tsc-gateway + run: cargo build --release --locked -p voelin-ui -p voelin-gateway # dpkg-shlibdeps works out the .deb's dependencies. - name: Package (.tar.gz, .deb) run: | @@ -82,7 +82,7 @@ jobs: scripts/package.sh linux dist - uses: actions/upload-artifact@v4 with: - name: tsc-linux-x86_64 + name: voelin-linux-x86_64 path: dist/ if-no-files-found: error @@ -98,7 +98,7 @@ jobs: with: key: release - name: Build - run: cargo build --release --locked -p tsc-ui -p tsctl -p tsc-gateway + run: cargo build --release --locked -p voelin-ui # The installer is required here: install NSIS when the image lacks it. - name: NSIS shell: pwsh @@ -115,12 +115,12 @@ jobs: run: scripts/package.sh windows dist - uses: actions/upload-artifact@v4 with: - name: tsc-windows-x86_64 + name: voelin-windows-x86_64 path: dist/ if-no-files-found: error # Flatpak bundle from packaging/flatpak (install with - # `flatpak install --user tsc-desktop.flatpak`). flatpak-builder builds + # `flatpak install --user voelin.flatpak`). flatpak-builder builds # offline, from the crates that flatpak-cargo-generator lists. package-flatpak: name: package (Flatpak) @@ -143,17 +143,17 @@ jobs: /tmp/venv/bin/python /tmp/flatpak-cargo-generator.py Cargo.lock -o packaging/flatpak/cargo-sources.json - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 with: - bundle: tsc-desktop.flatpak - manifest-path: packaging/flatpak/io.github.faumaray.TsClient.yml + bundle: voelin.flatpak + manifest-path: packaging/flatpak/io.github.faumaray.Voelin.yml cache-key: flatpak-builder-${{ hashFiles('Cargo.lock') }} upload-artifact: false - uses: actions/upload-artifact@v4 with: - name: tsc-flatpak-x86_64 - path: tsc-desktop.flatpak + name: voelin-flatpak-x86_64 + path: voelin.flatpak if-no-files-found: error - # The gateway's container image (crates/tsc-gateway/Dockerfile), saved as a + # The gateway's container image (crates/voelin-gateway/Dockerfile), saved as a # file: `docker load -i tsgw-image.tar.gz`. package-gateway-image: name: package (gateway image) @@ -162,8 +162,8 @@ jobs: - uses: actions/checkout@v4 - name: Build and save run: | - version=$(sed -n 's/^version = "\(.*\)"$/\1/p' crates/tsc-gateway/Cargo.toml | head -n 1) - docker build -f crates/tsc-gateway/Dockerfile -t "tsgw:$version" -t tsgw:latest . + version=$(sed -n 's/^version = "\(.*\)"$/\1/p' crates/voelin-gateway/Cargo.toml | head -n 1) + docker build -f crates/voelin-gateway/Dockerfile -t "tsgw:$version" -t tsgw:latest . mkdir -p dist docker save "tsgw:$version" tsgw:latest | gzip > dist/tsgw-image.tar.gz (cd dist && sha256sum tsgw-image.tar.gz > SHA256SUMS-gateway) @@ -209,33 +209,33 @@ jobs: run: cargo install cargo-ndk --locked --version 4.1.2 - name: clippy (Android target, deny warnings) run: | - cargo ndk -t arm64-v8a --platform 29 clippy --locked -p tsc-android -p tsc-ui --no-deps -- -D warnings - cargo ndk -t arm64-v8a --platform 29 clippy --locked -p tsc-media --no-default-features --no-deps -- -D warnings + cargo ndk -t arm64-v8a --platform 29 clippy --locked -p voelin-android -p voelin-ui --no-deps -- -D warnings + cargo ndk -t arm64-v8a --platform 29 clippy --locked -p voelin-media --no-default-features --no-deps -- -D warnings - name: Debug APK working-directory: android - run: ./gradlew --no-daemon assembleDebug -Ptsc.abis=arm64-v8a,x86_64 + run: ./gradlew --no-daemon assembleDebug -Pvoelin.abis=arm64-v8a,x86_64 # Only with the signing secrets; an unsigned release APK is not installable. - name: Release APK (signed) working-directory: android env: KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} - TSC_SIGNING_STORE_PASSWORD: ${{ secrets.TSC_SIGNING_STORE_PASSWORD }} - TSC_SIGNING_KEY_ALIAS: ${{ secrets.TSC_SIGNING_KEY_ALIAS }} - TSC_SIGNING_KEY_PASSWORD: ${{ secrets.TSC_SIGNING_KEY_PASSWORD }} + VOELIN_SIGNING_STORE_PASSWORD: ${{ secrets.VOELIN_SIGNING_STORE_PASSWORD }} + VOELIN_SIGNING_KEY_ALIAS: ${{ secrets.VOELIN_SIGNING_KEY_ALIAS }} + VOELIN_SIGNING_KEY_PASSWORD: ${{ secrets.VOELIN_SIGNING_KEY_PASSWORD }} run: | if [ -z "$KEYSTORE_BASE64" ]; then echo "::notice::No ANDROID_KEYSTORE_BASE64 secret: skipping the release APK" exit 0 fi - export TSC_SIGNING_STORE_FILE="$RUNNER_TEMP/release.jks" - echo "$KEYSTORE_BASE64" | base64 -d > "$TSC_SIGNING_STORE_FILE" - ./gradlew --no-daemon assembleRelease -Ptsc.abis=arm64-v8a,x86_64 - rm -f "$TSC_SIGNING_STORE_FILE" + export VOELIN_SIGNING_STORE_FILE="$RUNNER_TEMP/release.jks" + echo "$KEYSTORE_BASE64" | base64 -d > "$VOELIN_SIGNING_STORE_FILE" + ./gradlew --no-daemon assembleRelease -Pvoelin.abis=arm64-v8a,x86_64 + rm -f "$VOELIN_SIGNING_STORE_FILE" - name: Package run: scripts/package.sh android dist - uses: actions/upload-artifact@v4 with: - name: tsc-android + name: voelin-android path: dist/ if-no-files-found: error @@ -296,7 +296,7 @@ jobs: - name: Check THIRD_PARTY_NOTICES.md run: scripts/notices.sh --check - # tsctl, the gateway, the engine and tsc-stream against real TS3 and TS6 + # voelinctl, the gateway, the engine and voelin-stream against real TS3 and TS6 # servers, including a synthetic VP8 + Opus stream through the TS6 server # (scripts/it-smoke.sh). smoke: @@ -331,7 +331,7 @@ jobs: # reported on the job but does not fail the workflow, since it depends on # a browser download and the runner's network interfaces. browser-interop: - name: browser interop (tsc-stream, Chromium) + name: browser interop (voelin-stream, Chromium) runs-on: ubuntu-24.04 needs: test continue-on-error: true @@ -358,4 +358,4 @@ jobs: npm install -g "playwright@$PLAYWRIGHT_VERSION" playwright install --with-deps chromium - name: Browser interop test - run: TSC_INTEROP=1 cargo test --locked -p tsc-stream --test browser_interop -- --nocapture + run: VOELIN_INTEROP=1 cargo test --locked -p voelin-stream --test browser_interop -- --nocapture diff --git a/Cargo.lock b/Cargo.lock index 724fb71..4525066 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8668,235 +8668,6 @@ dependencies = [ "tsproto-types", ] -[[package]] -name = "tsc-android" -version = "0.1.0" -dependencies = [ - "anyhow", - "jni 0.22.4", - "rustls-platform-verifier", - "slint", - "tokio", - "tracing", - "tracing-subscriber", - "tsc-core", - "tsc-media", - "tsc-model", - "tsc-platform", - "tsc-store", - "tsc-ui", -] - -[[package]] -name = "tsc-audio" -version = "0.1.0" -dependencies = [ - "cpal", - "hound", - "opus2", - "rtrb", - "rubato", - "serde", - "serde_json", - "sonora", - "sonora-agc2", - "sonora-simd", - "thiserror 2.0.21", - "tracing", - "tsclientlib", - "tsproto-packets", -] - -[[package]] -name = "tsc-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "futures", - "serde_json", - "thiserror 2.0.21", - "tokio", - "tokio-tungstenite 0.30.0", - "tracing", - "tsc-audio", - "tsc-gateway-proto", - "tsc-media", - "tsc-model", - "tsc-observer", - "tsc-query", - "tsc-stream", - "tsclientlib", - "tsproto-packets", -] - -[[package]] -name = "tsc-gateway" -version = "0.1.0" -dependencies = [ - "anyhow", - "axum", - "base64 0.22.1", - "clap", - "futures", - "rand 0.10.3", - "rusqlite", - "serde", - "serde_json", - "sha2 0.10.9", - "thiserror 2.0.21", - "tokio", - "tokio-tungstenite 0.30.0", - "toml", - "tracing", - "tracing-subscriber", - "tsc-gateway-proto", - "tsc-model", - "tsc-observer", - "tsc-query", -] - -[[package]] -name = "tsc-gateway-proto" -version = "0.1.0" -dependencies = [ - "base64 0.22.1", - "serde", - "serde_json", - "sha-1", - "sha2 0.10.9", - "thiserror 2.0.21", - "tsc-model", - "tsproto", - "tsproto-types", -] - -[[package]] -name = "tsc-media" -version = "0.1.0" -dependencies = [ - "ashpd", - "bzip2", - "dav1d", - "libvpx-native-sys", - "memmap2", - "ndk 0.9.0", - "openh264", - "pipewire", - "reqwest", - "rustix 1.1.5", - "sha2 0.10.9", - "str0m", - "thiserror 2.0.21", - "tokio", - "tracing", - "wasapi", - "windows-capture", - "x11rb", - "yuv", -] - -[[package]] -name = "tsc-model" -version = "0.1.0" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "tsc-observer" -version = "0.1.0" -dependencies = [ - "thiserror 2.0.21", - "tokio", - "tracing", - "tsc-model", - "tsc-query", -] - -[[package]] -name = "tsc-platform" -version = "0.1.0" -dependencies = [ - "ashpd", - "dirs", - "futures-util", - "notify-rust", - "serde", - "serde_json", - "thiserror 2.0.21", - "tokio", - "tracing", - "windows 0.62.2", - "x11rb", -] - -[[package]] -name = "tsc-query" -version = "0.1.0" -dependencies = [ - "reqwest", - "russh", - "serde", - "serde_json", - "thiserror 2.0.21", - "tokio", - "tracing", -] - -[[package]] -name = "tsc-store" -version = "0.1.0" -dependencies = [ - "keyring", - "rusqlite", - "serde", - "serde_json", - "thiserror 2.0.21", - "tsclientlib", -] - -[[package]] -name = "tsc-stream" -version = "0.1.0" -dependencies = [ - "anyhow", - "futures", - "serde", - "serde_json", - "str0m", - "thiserror 2.0.21", - "tokio", - "tracing", - "tracing-subscriber", - "tsclientlib", - "tsproto-packets", -] - -[[package]] -name = "tsc-ui" -version = "0.1.0" -dependencies = [ - "anyhow", - "chrono", - "dirs", - "png", - "serde", - "serde_json", - "slint", - "slint-build", - "tokio", - "tracing", - "tracing-subscriber", - "tsc-audio", - "tsc-core", - "tsc-model", - "tsc-platform", - "tsc-query", - "tsc-store", - "tsclientlib", -] - [[package]] name = "tsclientlib" version = "0.2.0" @@ -8931,33 +8702,6 @@ dependencies = [ "url", ] -[[package]] -name = "tsctl" -version = "0.1.0" -dependencies = [ - "anyhow", - "base64 0.22.1", - "clap", - "dirs", - "futures", - "futures-util", - "png", - "serde_json", - "tokio", - "tokio-tungstenite 0.30.0", - "tracing", - "tracing-subscriber", - "tsc-audio", - "tsc-core", - "tsc-gateway-proto", - "tsc-model", - "tsc-observer", - "tsc-query", - "tsc-stream", - "tsclientlib", - "tsproto-packets", -] - [[package]] name = "tsproto" version = "0.2.0" @@ -9309,6 +9053,262 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "voelin-android" +version = "0.1.0" +dependencies = [ + "anyhow", + "jni 0.22.4", + "rustls-platform-verifier", + "slint", + "tokio", + "tracing", + "tracing-subscriber", + "voelin-core", + "voelin-media", + "voelin-model", + "voelin-platform", + "voelin-store", + "voelin-ui", +] + +[[package]] +name = "voelin-audio" +version = "0.1.0" +dependencies = [ + "cpal", + "hound", + "opus2", + "rtrb", + "rubato", + "serde", + "serde_json", + "sonora", + "sonora-agc2", + "sonora-simd", + "thiserror 2.0.21", + "tracing", + "tsclientlib", + "tsproto-packets", +] + +[[package]] +name = "voelin-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "futures", + "serde_json", + "thiserror 2.0.21", + "tokio", + "tokio-tungstenite 0.30.0", + "tracing", + "tsclientlib", + "tsproto-packets", + "voelin-audio", + "voelin-gateway-proto", + "voelin-media", + "voelin-model", + "voelin-observer", + "voelin-query", + "voelin-stream", +] + +[[package]] +name = "voelin-gateway" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum", + "base64 0.22.1", + "clap", + "futures", + "rand 0.10.3", + "rusqlite", + "serde", + "serde_json", + "sha2 0.10.9", + "thiserror 2.0.21", + "tokio", + "tokio-tungstenite 0.30.0", + "toml", + "tracing", + "tracing-subscriber", + "voelin-gateway-proto", + "voelin-model", + "voelin-observer", + "voelin-query", +] + +[[package]] +name = "voelin-gateway-proto" +version = "0.1.0" +dependencies = [ + "base64 0.22.1", + "serde", + "serde_json", + "sha-1", + "sha2 0.10.9", + "thiserror 2.0.21", + "tsproto", + "tsproto-types", + "voelin-model", +] + +[[package]] +name = "voelin-media" +version = "0.1.0" +dependencies = [ + "ashpd", + "bzip2", + "dav1d", + "libvpx-native-sys", + "memmap2", + "ndk 0.9.0", + "openh264", + "pipewire", + "reqwest", + "rustix 1.1.5", + "sha2 0.10.9", + "str0m", + "thiserror 2.0.21", + "tokio", + "tracing", + "wasapi", + "windows-capture", + "x11rb", + "yuv", +] + +[[package]] +name = "voelin-model" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "voelin-observer" +version = "0.1.0" +dependencies = [ + "thiserror 2.0.21", + "tokio", + "tracing", + "voelin-model", + "voelin-query", +] + +[[package]] +name = "voelin-platform" +version = "0.1.0" +dependencies = [ + "ashpd", + "dirs", + "futures-util", + "notify-rust", + "serde", + "serde_json", + "thiserror 2.0.21", + "tokio", + "tracing", + "windows 0.62.2", + "x11rb", +] + +[[package]] +name = "voelin-query" +version = "0.1.0" +dependencies = [ + "reqwest", + "russh", + "serde", + "serde_json", + "thiserror 2.0.21", + "tokio", + "tracing", +] + +[[package]] +name = "voelin-store" +version = "0.1.0" +dependencies = [ + "keyring", + "rusqlite", + "serde", + "serde_json", + "thiserror 2.0.21", + "tsclientlib", +] + +[[package]] +name = "voelin-stream" +version = "0.1.0" +dependencies = [ + "anyhow", + "futures", + "serde", + "serde_json", + "str0m", + "thiserror 2.0.21", + "tokio", + "tracing", + "tracing-subscriber", + "tsclientlib", + "tsproto-packets", +] + +[[package]] +name = "voelin-ui" +version = "0.1.0" +dependencies = [ + "anyhow", + "chrono", + "dirs", + "png", + "serde", + "serde_json", + "slint", + "slint-build", + "tokio", + "tracing", + "tracing-subscriber", + "tsclientlib", + "voelin-audio", + "voelin-core", + "voelin-model", + "voelin-platform", + "voelin-query", + "voelin-store", +] + +[[package]] +name = "voelinctl" +version = "0.1.0" +dependencies = [ + "anyhow", + "base64 0.22.1", + "clap", + "dirs", + "futures", + "futures-util", + "png", + "serde_json", + "tokio", + "tokio-tungstenite 0.30.0", + "tracing", + "tracing-subscriber", + "tsclientlib", + "tsproto-packets", + "voelin-audio", + "voelin-core", + "voelin-gateway-proto", + "voelin-model", + "voelin-observer", + "voelin-query", + "voelin-stream", +] + [[package]] name = "vtable" version = "0.5.0" diff --git a/Cargo.toml b/Cargo.toml index 7359176..285276e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,20 +8,20 @@ members = [ "crates/proto/tsproto", "crates/proto/ts-bookkeeping", "crates/proto/tsclientlib", - "crates/tsc-android", - "crates/tsc-audio", - "crates/tsc-core", - "crates/tsc-gateway", - "crates/tsc-gateway-proto", - "crates/tsc-media", - "crates/tsc-model", - "crates/tsc-observer", - "crates/tsc-platform", - "crates/tsc-query", - "crates/tsc-store", - "crates/tsc-stream", - "crates/tsc-ui", - "tools/tsctl", + "crates/voelin-android", + "crates/voelin-audio", + "crates/voelin-core", + "crates/voelin-gateway", + "crates/voelin-gateway-proto", + "crates/voelin-media", + "crates/voelin-model", + "crates/voelin-observer", + "crates/voelin-platform", + "crates/voelin-query", + "crates/voelin-store", + "crates/voelin-stream", + "crates/voelin-ui", + "tools/voelinctl", ] default-members = [ "crates/proto/tsproto-types", @@ -30,18 +30,18 @@ default-members = [ "crates/proto/tsproto", "crates/proto/ts-bookkeeping", "crates/proto/tsclientlib", - "crates/tsc-audio", - "crates/tsc-core", - "crates/tsc-gateway", - "crates/tsc-gateway-proto", - "crates/tsc-model", - "crates/tsc-observer", - "crates/tsc-platform", - "crates/tsc-query", - "crates/tsc-store", - "crates/tsc-stream", - "crates/tsc-ui", - "tools/tsctl", + "crates/voelin-audio", + "crates/voelin-core", + "crates/voelin-gateway", + "crates/voelin-gateway-proto", + "crates/voelin-model", + "crates/voelin-observer", + "crates/voelin-platform", + "crates/voelin-query", + "crates/voelin-store", + "crates/voelin-stream", + "crates/voelin-ui", + "tools/voelinctl", ] [workspace.package] diff --git a/README.md b/README.md index d8423f9..6e083c3 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# teamspeak_client_rs +# Voelin -A TeamSpeak 3 / TeamSpeak 6 compatible voice client written in Rust, for desktop +Voelin is a TeamSpeak 3 / TeamSpeak 6 compatible voice client written in Rust, for desktop (Linux Wayland/X11, Windows, later macOS) and mobile (Android, later iOS). It speaks the TeamSpeak client protocol itself (no official SDK). The protocol layer is a vendored fork of [ReSpeak/tsclientlib](https://github.com/ReSpeak/tsclientlib). > Not affiliated with or endorsed by TeamSpeak Systems GmbH. "TeamSpeak" is a -> trademark of its owner; the product name of this client is still to be decided. +> trademark of its owner. ## Goals @@ -28,30 +28,30 @@ Done so far (milestones M0–M4 and the first part of M5 of [the plan](docs/arch - `crates/proto/`: vendored tsclientlib, modernised (TS6 fields and stream messages, faster off-thread Init1 puzzle, `curve25519-dalek` 4, fuzzing fixes; see [UPSTREAM.md](crates/proto/UPSTREAM.md)) -- `crates/tsc-model`: server flavor detection (TS3 / TS6) and capabilities -- `crates/tsc-audio`: Opus voice encoding, framing, resampling, WAV, jitter buffer/mixer, cpal devices -- `crates/tsc-store`: SQLite store for identities, bookmarks, settings and chat history; keyring secrets -- `crates/tsc-query`: ServerQuery client over raw TCP, SSH and HTTP WebQuery (events, rate limiting, keepalive) -- `crates/tsc-observer`: invisible presence (events or polling) and channel-chat relays over ServerQuery -- `crates/tsc-gateway` (`tsgw`) + `tsc-gateway-proto`: companion gateway for server admins. Users log in +- `crates/voelin-model`: server flavor detection (TS3 / TS6) and capabilities +- `crates/voelin-audio`: Opus voice encoding, framing, resampling, WAV, jitter buffer/mixer, cpal devices +- `crates/voelin-store`: SQLite store for identities, bookmarks, settings and chat history; keyring secrets +- `crates/voelin-query`: ServerQuery client over raw TCP, SSH and HTTP WebQuery (events, rate limiting, keepalive) +- `crates/voelin-observer`: invisible presence (events or polling) and channel-chat relays over ServerQuery +- `crates/voelin-gateway` (`tsgw`) + `voelin-gateway-proto`: companion gateway for server admins. Users log in with their TeamSpeak identity and get presence, channel chat and history without joining voice, limited by their server permissions ([admin guide](docs/gateway-admin.md)) -- `crates/tsc-core`: client engine; sessions merge voice, gateway and query sources, route chat, run audio; +- `crates/voelin-core`: client engine; sessions merge voice, gateway and query sources, route chat, run audio; the media pipeline for streams (capture → VP8 + Opus → stream, stream → decoder) -- `crates/tsc-ui` (`tsc-desktop`): Slint desktop app: servers, channel tree with talking indicators, +- `crates/voelin-ui` (`voelin`): Slint desktop app: servers, channel tree with talking indicators, chat tabs (own channel via voice, other channels via relay), connect / observe invisibly, mute, push-to-talk (in the window and as a global hotkey), audio settings with a level meter, per-client volume, and on TeamSpeak 6 streams: watch in a viewer, share the screen with sound -- `crates/tsc-stream`: TeamSpeak 6 streams: stream commands and notifications, JSON signalling, +- `crates/voelin-stream`: TeamSpeak 6 streams: stream commands and notifications, JSON signalling, WebRTC peers (str0m) with host and STUN candidates. A live test streams VP8 + Opus between two clients through a TS6 server -- `tools/tsctl`: headless CLI: channel tree, chat, voice send/record, raw commands, stream events, +- `tools/voelinctl`: headless CLI: channel tree, chat, voice send/record, raw commands, stream events, `query`, `observe` (invisible presence), `relay` (channel chat without joining) and `gateway` - `dev/`: TeamSpeak 3.13 and TeamSpeak 6 (6.0.0-beta13.1) servers; `scripts/it-smoke.sh` checks tree, server chat, channel chat, a voice tone round-trip, invisible presence, relay chat and the gateway on both - `fuzz/`: cargo-fuzz targets for packets, commands and the license chain -- `android/` + `crates/tsc-android`: the Android app (the same Slint UI in a NativeActivity, +- `android/` + `crates/voelin-android`: the Android app (the same Slint UI in a NativeActivity, voice in a foreground service, screen sharing through MediaProjection, MediaCodec, Keystore passwords). It builds; it has not run on a device yet ([docs/android.md](docs/android.md)) @@ -68,39 +68,39 @@ interop with the official TeamSpeak 6 client is not verified yet. ```sh # Desktop app -cargo run -p tsc-ui --bin tsc-desktop +cargo run -p voelin-ui --bin voelin # Local servers (use REGISTRY=mirror.gcr.io if Docker Hub rate-limits you) docker compose -f dev/docker-compose.yml up -d -cargo run -p tsctl -- connect 127.0.0.1:9987 tree # TeamSpeak 3 -cargo run -p tsctl -- connect 127.0.0.1:9988 tree # TeamSpeak 6 -cargo run -p tsctl -- connect 127.0.0.1:9988 --nick me repl # interactive chat -cargo run -p tsctl -- connect 127.0.0.1:9988 --nick me voice send --tone 440 -cargo run -p tsctl -- connect 127.0.0.1:9988 --nick ear voice record out.wav +cargo run -p voelinctl -- connect 127.0.0.1:9987 tree # TeamSpeak 3 +cargo run -p voelinctl -- connect 127.0.0.1:9988 tree # TeamSpeak 6 +cargo run -p voelinctl -- connect 127.0.0.1:9988 --nick me repl # interactive chat +cargo run -p voelinctl -- connect 127.0.0.1:9988 --nick me voice send --tone 440 +cargo run -p voelinctl -- connect 127.0.0.1:9988 --nick ear voice record out.wav # Streams (TeamSpeak 6): share the test pattern (or --source x11), watch and decode it -cargo run -p tsctl -- connect 127.0.0.1:9988 --nick eye stream watch --save-frame shot.png & -cargo run -p tsctl -- connect 127.0.0.1:9988 --nick me stream start --synthetic --auto-accept +cargo run -p voelinctl -- connect 127.0.0.1:9988 --nick eye stream watch --save-frame shot.png & +cargo run -p voelinctl -- connect 127.0.0.1:9988 --nick me stream start --synthetic --auto-accept -# ServerQuery (dev password tsc-dev-admin): invisible presence and relay chat -cargo run -p tsctl -- observe ssh 127.0.0.1:10022 --secret tsc-dev-admin --allowlisted -cargo run -p tsctl -- relay ssh 127.0.0.1:10022 --secret tsc-dev-admin --allowlisted --channel 1 +# ServerQuery (dev password voelin-dev-admin): invisible presence and relay chat +cargo run -p voelinctl -- observe ssh 127.0.0.1:10022 --secret voelin-dev-admin --allowlisted +cargo run -p voelinctl -- relay ssh 127.0.0.1:10022 --secret voelin-dev-admin --allowlisted --channel 1 # Gateway: users without voice, logging in with their identity -cargo run -p tsc-gateway -- --config dev/tsgw-ts6.toml & -cargo run -p tsctl -- gateway ws://127.0.0.1:7788/v1 --identity --presence --open channel:1 +cargo run -p voelin-gateway -- --config dev/tsgw-ts6.toml & +cargo run -p voelinctl -- gateway ws://127.0.0.1:7788/v1 --identity --presence --open channel:1 scripts/it-smoke.sh # all of the above, on both servers ``` -Other commands: `tsctl identity new`, `tsctl versions`, `tsctl connect listen|chat|raw`. -`tsctl --help` lists all options. +Other commands: `voelinctl identity new`, `voelinctl versions`, `voelinctl connect listen|chat|raw`. +`voelinctl --help` lists all options. -Development switches of the desktop app (environment variables): `TSC_DATA_DIR` (database), -`TSC_AUTOCONNECT=voice|observe`, `TSC_SCREENSHOT=` (with `TSC_SCREENSHOT_DELAY`), -`TSC_DEMO_STREAM=1` (a local test stream in the viewer, no server needed), -`TSC_OPEN=share|settings[:]|about|client`, `TSC_AUTOWATCH=1`, `TSC_AUTOSHARE=test-pattern`. +Development switches of the desktop app (environment variables): `VOELIN_DATA_DIR` (database), +`VOELIN_AUTOCONNECT=voice|observe`, `VOELIN_SCREENSHOT=` (with `VOELIN_SCREENSHOT_DELAY`), +`VOELIN_DEMO_STREAM=1` (a local test stream in the viewer, no server needed), +`VOELIN_OPEN=share|settings[:]|about|client`, `VOELIN_AUTOWATCH=1`, `VOELIN_AUTOSHARE=test-pattern`. Ready-made packages (Linux `.tar.gz`/`.deb`/Flatpak, Windows zip and installer, Android APK) come from every CI run, and `scripts/docker-build.sh` builds the same ones locally in Docker: diff --git a/SECURITY.md b/SECURITY.md index 7e2d34b..1126cea 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,7 +8,7 @@ https://github.com/Faumaray/teamspeak_client_rs (private vulnerability reporting). Do not open a public issue for them. If private reporting is not available, open an issue asking for a contact, without details. -Include what is affected (desktop app, Android app, `tsgw` gateway, `tsctl`), +Include what is affected (desktop app, Android app, `tsgw` gateway, `voelinctl`), the version or commit, and how to reproduce. You should get an answer within a week. Fixes are released as soon as they are ready and credited in the changelog unless you prefer otherwise. @@ -26,10 +26,10 @@ us. | What | Where | Protection | |---|---|---| -| Identities (TeamSpeak private keys) | SQLite database `client.db` in the data directory (`~/.local/share/tsc`, Flatpak `~/.var/app//data/tsc`, `%APPDATA%\tsc`, Android app storage) | File permissions of the user account only; not encrypted. An identity is the account on every server that knows it: back it up, do not share the file | -| Server and ServerQuery passwords | OS keyring (Secret Service, Windows Credential Manager, Android Keystore), service `tsc-client` | Keyring; kept in memory for the session only when there is no keyring | +| Identities (TeamSpeak private keys) | SQLite database `client.db` in the data directory (`~/.local/share/voelin`, Flatpak `~/.var/app//data/voelin`, `%APPDATA%\voelin`, Android app storage) | File permissions of the user account only; not encrypted. An identity is the account on every server that knows it: back it up, do not share the file | +| Server and ServerQuery passwords | OS keyring (Secret Service, Windows Credential Manager, Android Keystore), service `voelin` | Keyring; kept in memory for the session only when there is no keyring | | Bookmarks, settings, chat history | `client.db` | File permissions; history stays until deleted | -| Crash reports (opt-in) | `crash-reports` in the state directory (`~/.local/state/tsc`, `%LOCALAPPDATA%\tsc`) | Local only, never uploaded. They contain the panic message and a backtrace, which may include server addresses or names; review before attaching one to an issue | +| Crash reports (opt-in) | `crash-reports` in the state directory (`~/.local/state/voelin`, `%LOCALAPPDATA%\voelin`) | Local only, never uploaded. They contain the panic message and a backtrace, which may include server addresses or names; review before attaching one to an issue | | OpenH264 (opt-in) | Downloaded from Cisco into the app's directories | Loaded only if its SHA-256 matches a known Cisco build | ## What others can see diff --git a/about.toml b/about.toml index 13c2234..896b84a 100644 --- a/about.toml +++ b/about.toml @@ -21,7 +21,7 @@ accepted = [ # Slint: GPL-3.0-only OR royalty-free OR commercial. We use the royalty-free # license, which requires the AboutSlint widget in the About page. "LicenseRef-Slint-Royalty-free-2.0", - # libbz2-rs-sys (unpacks Cisco's OpenH264 download in tsc-media). + # libbz2-rs-sys (unpacks Cisco's OpenH264 download in voelin-media). "bzip2-1.0.6", ] @@ -73,7 +73,7 @@ path = "opus/COPYING" license = "BSD-3-Clause" checksum = "01e1167d54a096d123cf6dfbbeb19587278845c6481d2d66d545669846079551" -# Only the bindings are compiled (tsc-media loads Cisco's binary at runtime), +# Only the bindings are compiled (voelin-media loads Cisco's binary at runtime), # but without this every header of the vendored OpenH264 sources would be # listed. upstream/LICENSE is also the license of Cisco's binary. [openh264-sys2.clarify] @@ -155,7 +155,7 @@ path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md" license = "LicenseRef-Slint-Royalty-free-2.0-text" checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe" -# Android (tsc-android). +# Android (voelin-android). [i-slint-backend-android-activity.clarify] license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0" [[i-slint-backend-android-activity.clarify.files]] diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 6305ff6..19f4bae 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -8,8 +8,8 @@ plugins { /** The Cargo workspace the native library comes from. */ val workspace: File = rootDir.parentFile -/** `version` of crates/tsc-android, which is the app's version (docs/release.md). */ -val crateVersion: String = workspace.resolve("crates/tsc-android/Cargo.toml").readLines() +/** `version` of crates/voelin-android, which is the app's version (docs/release.md). */ +val crateVersion: String = workspace.resolve("crates/voelin-android/Cargo.toml").readLines() .first { it.startsWith("version = ") } .substringAfter('"').substringBefore('"') @@ -29,17 +29,17 @@ fun lockedVersion(crate: String): String { fun signing(property: String, env: String): String? = providers.gradleProperty(property).orElse(providers.environmentVariable(env)).orNull -val releaseStoreFile = signing("tsc.signing.storeFile", "TSC_SIGNING_STORE_FILE") +val releaseStoreFile = signing("voelin.signing.storeFile", "VOELIN_SIGNING_STORE_FILE") android { - namespace = "io.github.faumaray.tsc" + namespace = "io.github.faumaray.voelin" compileSdk = 36 ndkVersion = "27.3.13750724" defaultConfig { - // Placeholder like the desktop app id (packaging/README.md); it cannot - // change after the first upload to Google Play. - applicationId = "io.github.faumaray.TsClient" + // The desktop app id (packaging/README.md); it cannot change after + // the first upload to Google Play. + applicationId = "io.github.faumaray.Voelin" minSdk = 29 targetSdk = 36 versionName = crateVersion @@ -52,9 +52,9 @@ android { if (releaseStoreFile != null) { create("release") { storeFile = file(releaseStoreFile) - storePassword = signing("tsc.signing.storePassword", "TSC_SIGNING_STORE_PASSWORD") - keyAlias = signing("tsc.signing.keyAlias", "TSC_SIGNING_KEY_ALIAS") - keyPassword = signing("tsc.signing.keyPassword", "TSC_SIGNING_KEY_PASSWORD") + storePassword = signing("voelin.signing.storePassword", "VOELIN_SIGNING_STORE_PASSWORD") + keyAlias = signing("voelin.signing.keyAlias", "VOELIN_SIGNING_KEY_ALIAS") + keyPassword = signing("voelin.signing.keyPassword", "VOELIN_SIGNING_KEY_PASSWORD") } } } @@ -90,12 +90,12 @@ dependencies { implementation("org.rustls:rustls-platform-verifier:${lockedVersion("rustls-platform-verifier-android")}") } -// libtsc_android.so, built with cargo-ndk into build/rust/// -// before the JNI libraries are merged. -Ptsc.skipCargo=true uses what is +// libvoelin_android.so, built with cargo-ndk into build/rust/// +// before the JNI libraries are merged. -Pvoelin.skipCargo=true uses what is // there (e.g. built by CI in an earlier step). -val abis = providers.gradleProperty("tsc.abis").getOrElse("arm64-v8a,x86_64") +val abis = providers.gradleProperty("voelin.abis").getOrElse("arm64-v8a,x86_64") .split(',').map(String::trim).filter(String::isNotEmpty) -val skipCargo = providers.gradleProperty("tsc.skipCargo").map(String::toBoolean).getOrElse(false) +val skipCargo = providers.gradleProperty("voelin.skipCargo").map(String::toBoolean).getOrElse(false) for ((buildType, release) in listOf("debug" to false, "release" to true)) { val out = layout.buildDirectory.dir("rust/$buildType") @@ -106,7 +106,7 @@ for ((buildType, release) in listOf("debug" to false, "release" to true)) { workingDir = workspace val command = mutableListOf("cargo", "ndk", "--platform", "29", "-o", out.get().asFile.path) abis.forEach { command += listOf("-t", it) } - command += listOf("build", "-p", "tsc-android") + command += listOf("build", "-p", "voelin-android") if (release) command += "--release" commandLine(command) val ndk = android.ndkDirectory.path diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 17078d2..72a8f55 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -1,7 +1,7 @@ # Called from Rust through JNI by name. --keep class io.github.faumaray.tsc.Bridge { *; } --keep class io.github.faumaray.tsc.Native { *; } --keep class io.github.faumaray.tsc.TscApp { *; } +-keep class io.github.faumaray.voelin.Bridge { *; } +-keep class io.github.faumaray.voelin.Native { *; } +-keep class io.github.faumaray.voelin.VoelinApp { *; } # rustls-platform-verifier's Kotlin component, also called from Rust. -keep class org.rustls.platformverifier.** { *; } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4c842ac..3004993 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -20,12 +20,12 @@ restored on another device anyway. --> + android:theme="@style/Theme.Voelin"> - - TS Client + Voelin Voice connection Screen sharing Connected to voice diff --git a/android/app/src/main/res/values/themes.xml b/android/app/src/main/res/values/themes.xml index db390b8..4820ca0 100644 --- a/android/app/src/main/res/values/themes.xml +++ b/android/app/src/main/res/values/themes.xml @@ -1,7 +1,7 @@ - diff --git a/android/gradle.properties b/android/gradle.properties index 27d1956..eaa02fd 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -3,5 +3,5 @@ android.useAndroidX=false android.nonTransitiveRClass=true kotlin.code.style=official # ABIs the Rust library is built for (cargo-ndk names), e.g. only -# -Ptsc.abis=arm64-v8a for a phone. -tsc.abis=arm64-v8a,x86_64 +# -Pvoelin.abis=arm64-v8a for a phone. +voelin.abis=arm64-v8a,x86_64 diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 78cb6e1..6c458a2 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,7 +2,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531 distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip -networkTimeout=10000 +networkTimeout=60000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index 9d519fe..99ad4d6 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -20,5 +20,5 @@ dependencyResolutionManagement { } } -rootProject.name = "tsc" +rootProject.name = "voelin" include(":app") diff --git a/crates/tsc-android/Cargo.toml b/crates/voelin-android/Cargo.toml similarity index 67% rename from crates/tsc-android/Cargo.toml rename to crates/voelin-android/Cargo.toml index a2a044a..4bca1ef 100644 --- a/crates/tsc-android/Cargo.toml +++ b/crates/voelin-android/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-android" +name = "voelin-android" version = "0.1.0" description = "Android app library: native activity entry point, engine kept for the whole process, JNI bridge to the Kotlin services (voice, screen share), Android Keystore secrets." edition.workspace = true @@ -9,15 +9,15 @@ repository.workspace = true publish.workspace = true [lib] -name = "tsc_android" -# cdylib: libtsc_android.so, loaded by the app's NativeActivity. rlib: tests +name = "voelin_android" +# cdylib: libvoelin_android.so, loaded by the app's NativeActivity. rlib: tests # and type checks on the host. crate-type = ["cdylib", "rlib"] [dependencies] tokio = { version = "1.53.1", features = ["rt-multi-thread", "macros", "sync", "time"] } tracing = "0.1.44" -tsc-core = { path = "../tsc-core" } +voelin-core = { path = "../voelin-core" } [target.'cfg(target_os = "android")'.dependencies] anyhow = "1.0.104" @@ -25,13 +25,13 @@ jni = "0.22.4" rustls-platform-verifier = "0.7.1" slint = { version = "1.18", default-features = false, features = ["std", "compat-1-2", "backend-android-activity-06"] } tracing-subscriber = { version = "0.3.23", features = ["env-filter"] } -tsc-media = { path = "../tsc-media", default-features = false } -tsc-platform = { path = "../tsc-platform", default-features = false } -tsc-store = { path = "../tsc-store" } -tsc-ui = { path = "../tsc-ui" } +voelin-media = { path = "../voelin-media", default-features = false } +voelin-platform = { path = "../voelin-platform", default-features = false } +voelin-store = { path = "../voelin-store" } +voelin-ui = { path = "../voelin-ui" } [dev-dependencies] -tsc-model = { path = "../tsc-model" } +voelin-model = { path = "../voelin-model" } [lints] workspace = true diff --git a/crates/tsc-android/src/app.rs b/crates/voelin-android/src/app.rs similarity index 92% rename from crates/tsc-android/src/app.rs rename to crates/voelin-android/src/app.rs index 3961f9d..53904e0 100644 --- a/crates/tsc-android/src/app.rs +++ b/crates/voelin-android/src/app.rs @@ -10,7 +10,7 @@ use std::sync::{Mutex, Once, OnceLock, PoisonError}; use anyhow::Context as _; use slint::android::AndroidApp; use tracing::{error, info, warn}; -use tsc_core::Command; +use voelin_core::Command; use crate::foreground::Foreground; use crate::host::EngineHost; @@ -82,10 +82,10 @@ fn run(app: AndroidApp) -> anyhow::Result<()> { slint::android::init(app).context("Slint Android backend")?; let attached = host.attach(); - tsc_ui::run(tsc_ui::RunOptions { + voelin_ui::run(voelin_ui::RunOptions { data_dir: Some(data_dir), secrets: Some(Box::new(secrets::KeystoreSecrets)), - engine: Some(tsc_ui::HostedEngine { + engine: Some(voelin_ui::HostedEngine { engine: attached.engine, runtime: attached.runtime, events: attached.events, @@ -96,12 +96,12 @@ fn run(app: AndroidApp) -> anyhow::Result<()> { /// Local crash reports in `/crash-reports`, recorded only if the /// user opted in (off by default). fn install_crash_reports(data_dir: &Path) { - tsc_platform::crash::set_app_version(env!("CARGO_PKG_VERSION")); - let enabled = tsc_store::Store::open(&data_dir.join("client.db")) + voelin_platform::crash::set_app_version(env!("CARGO_PKG_VERSION")); + let enabled = voelin_store::Store::open(&data_dir.join("client.db")) .ok() .and_then(|store| store.setting::(CRASH_REPORTS_SETTING).ok().flatten()) .unwrap_or(false); - tsc_platform::crash::install(data_dir.join(tsc_platform::crash::DIR_NAME), enabled); + voelin_platform::crash::install(data_dir.join(voelin_platform::crash::DIR_NAME), enabled); } /// Keep the voice foreground service in step with the voice connections. diff --git a/crates/tsc-android/src/bridge.rs b/crates/voelin-android/src/bridge.rs similarity index 93% rename from crates/tsc-android/src/bridge.rs rename to crates/voelin-android/src/bridge.rs index 56e92d1..8b5d065 100644 --- a/crates/tsc-android/src/bridge.rs +++ b/crates/voelin-android/src/bridge.rs @@ -1,9 +1,9 @@ //! JNI glue with the app's Kotlin side (`android/app/src/main/java/...`). //! -//! - Rust → Kotlin: static methods of `io.github.faumaray.tsc.Bridge`, called +//! - Rust → Kotlin: static methods of `io.github.faumaray.voelin.Bridge`, called //! from any thread (the class is looked up once on the `android_main` //! thread, whose class loader sees the app's classes). -//! - Kotlin → Rust: the `external` methods of `io.github.faumaray.tsc.Native`, +//! - Kotlin → Rust: the `external` methods of `io.github.faumaray.voelin.Native`, //! exported below with `native_method!` (panics and errors become Java //! exceptions instead of crossing the FFI boundary). @@ -22,7 +22,7 @@ static BRIDGE: OnceLock>> = OnceLock::new(); /// Look up `Bridge` (on the `android_main` thread). pub fn init(env: &mut Env) -> Result<()> { if BRIDGE.get().is_none() { - let class = env.load_class(jni_str!("io.github.faumaray.tsc.Bridge"))?; + let class = env.load_class(jni_str!("io.github.faumaray.voelin.Bridge"))?; let _ = BRIDGE.set(env.new_global_ref(class)?); } Ok(()) @@ -32,7 +32,7 @@ pub fn init(env: &mut Env) -> Result<()> { fn with_bridge(f: impl FnOnce(&mut Env, &Global>) -> Result) -> Result { let class = BRIDGE .get() - .ok_or_else(|| Error::ClassNotFound { name: "io.github.faumaray.tsc.Bridge".into() })?; + .ok_or_else(|| Error::ClassNotFound { name: "io.github.faumaray.voelin.Bridge".into() })?; JavaVM::singleton()?.attach_current_thread(|env| f(env, class)) } @@ -40,7 +40,7 @@ fn with_bridge(f: impl FnOnce(&mut Env, &Global>) -> Result(env: &mut Env<'local>) -> Result> { let class = BRIDGE .get() - .ok_or_else(|| Error::ClassNotFound { name: "io.github.faumaray.tsc.Bridge".into() })?; + .ok_or_else(|| Error::ClassNotFound { name: "io.github.faumaray.voelin.Bridge".into() })?; env.call_static_method( class, jni_str!("context"), @@ -160,7 +160,7 @@ pub fn secret_delete(key: &str) -> Result<()> { // Native methods of `Native` (Kotlin `object` with `@JvmStatic external`). const _: jni::NativeMethod = native_method! { - java_type = "io.github.faumaray.tsc.Native", + java_type = "io.github.faumaray.voelin.Native", static extern fn on_screen_capture_result(granted: jboolean, error: JString), }; @@ -176,7 +176,7 @@ fn on_screen_capture_result<'local>( } const _: jni::NativeMethod = native_method! { - java_type = "io.github.faumaray.tsc.Native", + java_type = "io.github.faumaray.voelin.Native", static extern fn on_screen_frame( pixels: JByteBuffer, width: jint, @@ -219,7 +219,7 @@ fn on_screen_frame<'local>( } const _: jni::NativeMethod = native_method! { - java_type = "io.github.faumaray.tsc.Native", + java_type = "io.github.faumaray.voelin.Native", static extern fn on_screen_capture_stopped(), }; @@ -229,7 +229,7 @@ fn on_screen_capture_stopped<'local>(_env: &mut Env<'local>, _class: JClass<'loc } const _: jni::NativeMethod = native_method! { - java_type = "io.github.faumaray.tsc.Native", + java_type = "io.github.faumaray.voelin.Native", static extern fn on_system_audio(samples: jfloat[], count: jint, channels: jint, timestamp_ns: jlong) -> jboolean, }; @@ -251,7 +251,7 @@ fn on_system_audio<'local>( } const _: jni::NativeMethod = native_method! { - java_type = "io.github.faumaray.tsc.Native", + java_type = "io.github.faumaray.voelin.Native", static extern fn on_disconnect_voice(), }; @@ -262,7 +262,7 @@ fn on_disconnect_voice<'local>(_env: &mut Env<'local>, _class: JClass<'local>) - } const _: jni::NativeMethod = native_method! { - java_type = "io.github.faumaray.tsc.Native", + java_type = "io.github.faumaray.voelin.Native", static extern fn on_toggle_mute(), }; diff --git a/crates/tsc-android/src/capture.rs b/crates/voelin-android/src/capture.rs similarity index 93% rename from crates/tsc-android/src/capture.rs rename to crates/voelin-android/src/capture.rs index a73caa3..9a2a298 100644 --- a/crates/tsc-android/src/capture.rs +++ b/crates/voelin-android/src/capture.rs @@ -1,7 +1,7 @@ //! Screen and system-audio capture through MediaProjection. //! -//! Registered as `tsc_media` capture providers, so stream code captures with -//! `tsc_media::capture::default_screen_capture()` as on desktop. Starting +//! Registered as `voelin_media` capture providers, so stream code captures with +//! `voelin_media::capture::default_screen_capture()` as on desktop. Starting //! asks the Kotlin side for the user's consent; on consent it runs //! `ScreenCaptureService` (a `mediaProjection` foreground service) whose //! `ImageReader` hands RGBA frames to [`on_frame`]. System audio @@ -12,9 +12,9 @@ use std::time::Duration; use tokio::sync::oneshot; use tracing::warn; -use tsc_media::capture::external::{self, AudioProvider, ScreenProvider}; -use tsc_media::capture::{BoxFuture, CaptureOptions, CaptureSource, SourceId}; -use tsc_media::{AudioBuffer, Error, FrameSender, Result, VideoFrame}; +use voelin_media::capture::external::{self, AudioProvider, ScreenProvider}; +use voelin_media::capture::{BoxFuture, CaptureOptions, CaptureSource, SourceId}; +use voelin_media::{AudioBuffer, Error, FrameSender, Result, VideoFrame}; use crate::bridge; diff --git a/crates/tsc-android/src/foreground.rs b/crates/voelin-android/src/foreground.rs similarity index 96% rename from crates/tsc-android/src/foreground.rs rename to crates/voelin-android/src/foreground.rs index a1c376c..bd6bc1f 100644 --- a/crates/tsc-android/src/foreground.rs +++ b/crates/voelin-android/src/foreground.rs @@ -7,7 +7,7 @@ use std::collections::BTreeMap; -use tsc_core::{Event, SessionId, VoiceState}; +use voelin_core::{Event, SessionId, VoiceState}; /// What the voice notification shows. #[derive(Clone, Debug, PartialEq, Eq)] @@ -78,8 +78,8 @@ impl Foreground { #[cfg(test)] mod tests { - use tsc_core::SessionState; - use tsc_model::{Capabilities, ServerFlavor}; + use voelin_core::SessionState; + use voelin_model::{Capabilities, ServerFlavor}; use super::*; diff --git a/crates/tsc-android/src/host.rs b/crates/voelin-android/src/host.rs similarity index 96% rename from crates/tsc-android/src/host.rs rename to crates/voelin-android/src/host.rs index a2117b5..d773d99 100644 --- a/crates/tsc-android/src/host.rs +++ b/crates/voelin-android/src/host.rs @@ -11,7 +11,7 @@ use std::sync::{Arc, Mutex, MutexGuard, PoisonError}; use tokio::runtime::{Handle, Runtime}; use tokio::sync::{broadcast, mpsc}; -use tsc_core::{Engine, Event, SessionId, StreamState, WatchState}; +use voelin_core::{Engine, Event, SessionId, StreamState, WatchState}; /// Chat messages per session a new window gets back. pub const CHAT_BACKLOG: usize = 300; @@ -162,7 +162,7 @@ pub struct EngineHost { fanout: Fanout, } -/// What a window needs: see `tsc_ui::HostedEngine`. +/// What a window needs: see `voelin_ui::HostedEngine`. pub struct Attached { pub engine: Engine, pub runtime: Handle, @@ -173,7 +173,7 @@ impl EngineHost { pub fn start() -> std::io::Result { let runtime = tokio::runtime::Builder::new_multi_thread() .enable_all() - .thread_name("tsc-engine") + .thread_name("voelin-engine") .build()?; let engine = runtime.block_on(async { Engine::start() }); let fanout = Fanout::default(); @@ -203,8 +203,8 @@ impl EngineHost { mod tests { use std::sync::Arc as StdArc; - use tsc_core::{SessionState, VoiceState}; - use tsc_model::{ChatMessage, ChatTarget, Presence}; + use voelin_core::{SessionState, VoiceState}; + use voelin_model::{ChatMessage, ChatTarget, Presence}; use super::*; @@ -266,7 +266,7 @@ mod tests { replay.record(&Event::WatchState { session: 2, stream_id: "s2".into(), - state: WatchState::Ended(tsc_core::stream::EndReason::Local), + state: WatchState::Ended(voelin_core::stream::EndReason::Local), }); let events = describe(&replay.events()); diff --git a/crates/tsc-android/src/lib.rs b/crates/voelin-android/src/lib.rs similarity index 82% rename from crates/tsc-android/src/lib.rs rename to crates/voelin-android/src/lib.rs index dcd1198..bfa0911 100644 --- a/crates/tsc-android/src/lib.rs +++ b/crates/voelin-android/src/lib.rs @@ -1,7 +1,7 @@ -//! The Android app's native library (`libtsc_android.so`). +//! The Android app's native library (`libvoelin_android.so`). //! //! The APK (`android/`) starts a `NativeActivity` subclass that loads this -//! library; `android_main` then runs the shared Slint UI (`tsc_ui`) on +//! library; `android_main` then runs the shared Slint UI (`voelin_ui`) on //! Slint's Android backend. The pieces around it: //! //! - [`host`]: one engine per process, so voice survives the activity being @@ -12,7 +12,7 @@ //! - `bridge` (Android): JNI calls into the Kotlin side (`Bridge`) and the //! native methods it calls back (`Native`) //! - `capture` (Android): screen and system-audio capture through -//! MediaProjection, registered as `tsc_media` capture providers +//! MediaProjection, registered as `voelin_media` capture providers //! - `secrets` (Android): passwords encrypted with an Android Keystore key //! //! Only [`host`] and [`foreground`] build on other platforms, for tests. diff --git a/crates/tsc-android/src/secrets.rs b/crates/voelin-android/src/secrets.rs similarity index 94% rename from crates/tsc-android/src/secrets.rs rename to crates/voelin-android/src/secrets.rs index ccdb032..4b37b81 100644 --- a/crates/tsc-android/src/secrets.rs +++ b/crates/voelin-android/src/secrets.rs @@ -4,7 +4,7 @@ //! lives in the Android Keystore (hardware-backed where the device has it) //! and keeps the ciphertext in the app's private preferences. -use tsc_store::{Error, Result, Secrets}; +use voelin_store::{Error, Result, Secrets}; use crate::bridge; diff --git a/crates/tsc-audio/Cargo.toml b/crates/voelin-audio/Cargo.toml similarity index 97% rename from crates/tsc-audio/Cargo.toml rename to crates/voelin-audio/Cargo.toml index 44bb56f..ddb22f0 100644 --- a/crates/tsc-audio/Cargo.toml +++ b/crates/voelin-audio/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-audio" +name = "voelin-audio" version = "0.1.0" description = "Voice pipeline: Opus encoding, framing, resampling, jitter buffer/mixer and audio devices." edition.workspace = true diff --git a/crates/tsc-audio/src/device.rs b/crates/voelin-audio/src/device.rs similarity index 100% rename from crates/tsc-audio/src/device.rs rename to crates/voelin-audio/src/device.rs diff --git a/crates/tsc-audio/src/encode.rs b/crates/voelin-audio/src/encode.rs similarity index 100% rename from crates/tsc-audio/src/encode.rs rename to crates/voelin-audio/src/encode.rs diff --git a/crates/tsc-audio/src/framer.rs b/crates/voelin-audio/src/framer.rs similarity index 100% rename from crates/tsc-audio/src/framer.rs rename to crates/voelin-audio/src/framer.rs diff --git a/crates/tsc-audio/src/lib.rs b/crates/voelin-audio/src/lib.rs similarity index 100% rename from crates/tsc-audio/src/lib.rs rename to crates/voelin-audio/src/lib.rs diff --git a/crates/tsc-audio/src/mixer.rs b/crates/voelin-audio/src/mixer.rs similarity index 100% rename from crates/tsc-audio/src/mixer.rs rename to crates/voelin-audio/src/mixer.rs diff --git a/crates/tsc-audio/src/pcm.rs b/crates/voelin-audio/src/pcm.rs similarity index 100% rename from crates/tsc-audio/src/pcm.rs rename to crates/voelin-audio/src/pcm.rs diff --git a/crates/tsc-audio/src/process.rs b/crates/voelin-audio/src/process.rs similarity index 100% rename from crates/tsc-audio/src/process.rs rename to crates/voelin-audio/src/process.rs diff --git a/crates/tsc-audio/src/resample.rs b/crates/voelin-audio/src/resample.rs similarity index 100% rename from crates/tsc-audio/src/resample.rs rename to crates/voelin-audio/src/resample.rs diff --git a/crates/tsc-audio/src/settings.rs b/crates/voelin-audio/src/settings.rs similarity index 96% rename from crates/tsc-audio/src/settings.rs rename to crates/voelin-audio/src/settings.rs index 450195a..3bf52c8 100644 --- a/crates/tsc-audio/src/settings.rs +++ b/crates/voelin-audio/src/settings.rs @@ -1,5 +1,5 @@ //! All user audio settings in one serde struct, e.g. for -//! `tsc_store::Store::set_setting("audio", &settings)`. Missing fields take +//! `voelin_store::Store::set_setting("audio", &settings)`. Missing fields take //! their defaults, so stored settings survive new options. use serde::{Deserialize, Serialize}; diff --git a/crates/tsc-audio/src/vad.rs b/crates/voelin-audio/src/vad.rs similarity index 100% rename from crates/tsc-audio/src/vad.rs rename to crates/voelin-audio/src/vad.rs diff --git a/crates/tsc-audio/src/wav.rs b/crates/voelin-audio/src/wav.rs similarity index 94% rename from crates/tsc-audio/src/wav.rs rename to crates/voelin-audio/src/wav.rs index 13cab33..f2bd435 100644 --- a/crates/tsc-audio/src/wav.rs +++ b/crates/voelin-audio/src/wav.rs @@ -52,7 +52,7 @@ mod tests { #[test] fn roundtrip() { - let path = std::env::temp_dir().join(format!("tsc-audio-{}.wav", std::process::id())); + let path = std::env::temp_dir().join(format!("voelin-audio-{}.wav", std::process::id())); let clip = Clip { samples: vec![0.0, 0.5, -0.5, 0.25], channels: 2, rate: 48_000 }; write(&path, &clip).unwrap(); let back = read(&path).unwrap(); diff --git a/crates/tsc-audio/tests/drift.rs b/crates/voelin-audio/tests/drift.rs similarity index 97% rename from crates/tsc-audio/tests/drift.rs rename to crates/voelin-audio/tests/drift.rs index 306c5d6..c2b51c6 100644 --- a/crates/tsc-audio/tests/drift.rs +++ b/crates/voelin-audio/tests/drift.rs @@ -7,10 +7,10 @@ //! loss. Every 30 s it sends a loud marker frame instead of the quiet one; //! the latency is the time from generating a marker to it leaving the mixer. -use tsc_audio::pcm::{FRAME_SAMPLES, SAMPLE_RATE, energy, sine, white_noise}; -use tsc_audio::{Mixer, VoiceCodec, VoiceEncoder}; use tsclientlib::ClientId; use tsproto_packets::packets::{AudioData, CodecType, Direction, InAudioBuf, OutAudio}; +use voelin_audio::pcm::{FRAME_SAMPLES, SAMPLE_RATE, energy, sine, white_noise}; +use voelin_audio::{Mixer, VoiceCodec, VoiceEncoder}; /// The receiver pulls 10 ms at a time, like a playback loop. const PULL: usize = SAMPLE_RATE as usize / 100; diff --git a/crates/tsc-core/Cargo.toml b/crates/voelin-core/Cargo.toml similarity index 58% rename from crates/tsc-core/Cargo.toml rename to crates/voelin-core/Cargo.toml index 3271e8c..29d8ce3 100644 --- a/crates/tsc-core/Cargo.toml +++ b/crates/voelin-core/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-core" +name = "voelin-core" version = "0.1.0" description = "Client engine: server sessions merging voice, gateway and query sources; the API the UI drives." edition.workspace = true @@ -11,15 +11,15 @@ publish.workspace = true [features] default = ["audio-device"] # Capture and play audio through the system's devices. -audio-device = ["tsc-audio/device"] +audio-device = ["voelin-audio/device"] # The `media` module: capture and video codecs for streams, with whatever -# tsc-media backends are enabled (e.g. MediaCodec and a registered capture +# voelin-media backends are enabled (e.g. MediaCodec and a registered capture # source on Android). -media = ["dep:tsc-media"] -# `media` with tsc-media's desktop backends: libvpx, OpenH264 loaded at +media = ["dep:voelin-media"] +# `media` with voelin-media's desktop backends: libvpx, OpenH264 loaded at # runtime, X11 and PipeWire on Linux. Not for Android (libvpx does not # cross-compile there). -media-desktop = ["media", "tsc-media/default"] +media-desktop = ["media", "voelin-media/default"] [dependencies] anyhow = "1" @@ -29,13 +29,13 @@ thiserror = "2" tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync", "time"] } tokio-tungstenite = "0.30" tracing = "0.1" -tsc-audio = { path = "../tsc-audio", default-features = false } -tsc-gateway-proto = { path = "../tsc-gateway-proto" } -tsc-media = { path = "../tsc-media", default-features = false, features = ["str0m"], optional = true } -tsc-model = { path = "../tsc-model" } -tsc-observer = { path = "../tsc-observer" } -tsc-query = { path = "../tsc-query" } -tsc-stream = { path = "../tsc-stream" } +voelin-audio = { path = "../voelin-audio", default-features = false } +voelin-gateway-proto = { path = "../voelin-gateway-proto" } +voelin-media = { path = "../voelin-media", default-features = false, features = ["str0m"], optional = true } +voelin-model = { path = "../voelin-model" } +voelin-observer = { path = "../voelin-observer" } +voelin-query = { path = "../voelin-query" } +voelin-stream = { path = "../voelin-stream" } tsclientlib = { path = "../proto/tsclientlib" } tsproto-packets = { path = "../proto/tsproto-packets" } diff --git a/crates/tsc-core/src/audio.rs b/crates/voelin-core/src/audio.rs similarity index 97% rename from crates/tsc-core/src/audio.rs rename to crates/voelin-core/src/audio.rs index ef3dd75..0bc55d2 100644 --- a/crates/tsc-core/src/audio.rs +++ b/crates/voelin-core/src/audio.rs @@ -16,12 +16,12 @@ use std::time::{Duration, Instant}; use tokio::sync::mpsc; use tracing::{debug, warn}; -use tsc_audio::pcm::{self, FRAME_SAMPLES}; -use tsc_audio::settings::TransmitMode; -use tsc_audio::vad::SILENCE_DB; -use tsc_audio::{AudioSettings, Framer, Mixer, Processor, Vad, VoiceCodec, VoiceEncoder}; use tsclientlib::ClientId; use tsproto_packets::packets::{AudioData, CodecType, Direction, InAudioBuf, OutAudio, OutPacket}; +use voelin_audio::pcm::{self, FRAME_SAMPLES}; +use voelin_audio::settings::TransmitMode; +use voelin_audio::vad::SILENCE_DB; +use voelin_audio::{AudioSettings, Framer, Mixer, Processor, Vad, VoiceCodec, VoiceEncoder}; pub(crate) enum AudioIn { Packet(InAudioBuf), @@ -113,7 +113,7 @@ pub(crate) fn spawn( ) -> AudioHandle { let (tx, rx) = std_mpsc::channel(); thread::Builder::new() - .name("tsc-audio".into()) + .name("voelin-audio".into()) .spawn(move || run(rx, outgoing, events, settings)) .expect("spawn audio thread"); AudioHandle { tx } @@ -151,7 +151,7 @@ struct Pipeline { } impl Pipeline { - fn new(settings: AudioSettings) -> tsc_audio::Result { + fn new(settings: AudioSettings) -> voelin_audio::Result { let settings = sanitize(settings); Ok(Self { encoder: VoiceEncoder::new(VoiceCodec::Voice)?, @@ -420,11 +420,11 @@ fn run( #[cfg(feature = "audio-device")] mod devices { use tracing::debug; - use tsc_audio::AudioSettings; - use tsc_audio::device::{Capture, DeviceEvent, Managed, Playback}; - use tsc_audio::pcm::{self, FRAME_SAMPLES, SAMPLE_RATE}; - use tsc_audio::resample::Linear; use tsproto_packets::packets::OutPacket; + use voelin_audio::AudioSettings; + use voelin_audio::device::{Capture, DeviceEvent, Managed, Playback}; + use voelin_audio::pcm::{self, FRAME_SAMPLES, SAMPLE_RATE}; + use voelin_audio::resample::Linear; use super::{DEVICE_LATENCY_MS, PLAYBACK_CAPACITY_MS, Pipeline}; @@ -531,8 +531,8 @@ mod devices { #[cfg(test)] mod tests { - use tsc_audio::pcm::{SAMPLE_RATE, energy, sine, white_noise}; - use tsc_audio::{ProcessingSettings, VadSettings}; + use voelin_audio::pcm::{SAMPLE_RATE, energy, sine, white_noise}; + use voelin_audio::{ProcessingSettings, VadSettings}; use super::*; diff --git a/crates/tsc-core/src/gateway.rs b/crates/voelin-core/src/gateway.rs similarity index 88% rename from crates/tsc-core/src/gateway.rs rename to crates/voelin-core/src/gateway.rs index af822be..1b0b74d 100644 --- a/crates/tsc-core/src/gateway.rs +++ b/crates/voelin-core/src/gateway.rs @@ -5,8 +5,8 @@ use tokio::sync::mpsc; use tokio_tungstenite::tungstenite::Message; use tokio_tungstenite::tungstenite::client::IntoClientRequest; use tracing::info; -use tsc_gateway_proto::{ClientMsg, Envelope, ServerMsg, sign_challenge}; -use tsc_model::{ChatMessage, ChatTarget, Presence}; +use voelin_gateway_proto::{ClientMsg, Envelope, ServerMsg, sign_challenge}; +use voelin_model::{ChatMessage, ChatTarget, Presence}; pub(crate) enum GatewayCmd { OpenChat(ChatTarget), @@ -41,7 +41,9 @@ async fn run_inner( events: &mpsc::UnboundedSender, ) -> anyhow::Result<()> { let mut request = url.into_client_request()?; - request.headers_mut().insert("Sec-WebSocket-Protocol", tsc_gateway_proto::SUBPROTOCOL.parse()?); + request + .headers_mut() + .insert("Sec-WebSocket-Protocol", voelin_gateway_proto::SUBPROTOCOL.parse()?); let (mut ws, _) = tokio_tungstenite::connect_async(request).await?; let mut next_id = 1u64; let mut presence = Presence::default(); @@ -98,10 +100,10 @@ async fn run_inner( let _ = events.send(GatewayEvent::Error(format!("{code:?}: {message}"))); if matches!( code, - tsc_gateway_proto::ErrorCode::AuthFailed - | tsc_gateway_proto::ErrorCode::UnknownIdentity - | tsc_gateway_proto::ErrorCode::LevelTooLow - | tsc_gateway_proto::ErrorCode::Banned + voelin_gateway_proto::ErrorCode::AuthFailed + | voelin_gateway_proto::ErrorCode::UnknownIdentity + | voelin_gateway_proto::ErrorCode::LevelTooLow + | voelin_gateway_proto::ErrorCode::Banned ) { anyhow::bail!("gateway refused login: {message}"); } diff --git a/crates/tsc-core/src/lib.rs b/crates/voelin-core/src/lib.rs similarity index 97% rename from crates/tsc-core/src/lib.rs rename to crates/voelin-core/src/lib.rs index 74daa13..5c07021 100644 --- a/crates/tsc-core/src/lib.rs +++ b/crates/voelin-core/src/lib.rs @@ -32,14 +32,14 @@ use std::collections::HashMap; use std::sync::Arc; use tokio::sync::{broadcast, mpsc}; -pub use tsc_audio::settings::TransmitMode; -pub use tsc_audio::{AudioSettings, ProcessingSettings, VadSettings}; -use tsc_model::{Capabilities, ChannelId, ChatMessage, ChatTarget, Presence, ServerFlavor}; +pub use voelin_audio::settings::TransmitMode; +pub use voelin_audio::{AudioSettings, ProcessingSettings, VadSettings}; +use voelin_model::{Capabilities, ChannelId, ChatMessage, ChatTarget, Presence, ServerFlavor}; use crate::audio::{AudioEvent, AudioHandle, AudioIn}; pub use route::{ChatRoute, Dedup, route_chat}; pub use stream::{StreamFrame, StreamSink, StreamState, WatchState}; -use tsc_stream::{EncodedFrame, StreamInfo, StreamSetup, ViewerInfo}; +use voelin_stream::{EncodedFrame, StreamInfo, StreamSetup, ViewerInfo}; pub use voice::VoiceOptions; pub type SessionId = u64; @@ -63,7 +63,7 @@ pub enum Command { /// Invisible presence and relay chat with own ServerQuery credentials. ObserveQuery { session: SessionId, - connect: Box, + connect: Box, }, StopObserving { session: SessionId, diff --git a/crates/tsc-core/src/media.rs b/crates/voelin-core/src/media.rs similarity index 95% rename from crates/tsc-core/src/media.rs rename to crates/voelin-core/src/media.rs index fd4e8f8..7bff8eb 100644 --- a/crates/tsc-core/src/media.rs +++ b/crates/voelin-core/src/media.rs @@ -6,7 +6,7 @@ //! VP8 by default) at the bitrate of the stream setup, and the audio with //! Opus (48 kHz stereo, 20 ms). It hands the frames to a [`MediaSink`]: //! the [`StreamSink`] of a live stream, or an [`EncodedSource`] for code -//! that drives `tsc_stream::Streams` itself. Keyframe requests of viewers +//! that drives `voelin_stream::Streams` itself. Keyframe requests of viewers //! are honoured. //! - [`VideoPipeline`] decodes the video of a watched stream on its own //! thread and hands every picture to a callback. After lost frames or @@ -17,8 +17,8 @@ //! - [`Latest`] hands the newest picture to a slower consumer such as a UI. //! - [`LocalPreview`] runs capture → encoder → decoder without a server. //! -//! [`tsc_media`] is re-exported for sources, codecs and pixel conversion. -//! Codecs are chosen through `tsc_media::Codecs`, so whatever backends the +//! [`voelin_media`] is re-exported for sources, codecs and pixel conversion. +//! Codecs are chosen through `voelin_media::Codecs`, so whatever backends the //! build has are used (libvpx and OpenH264 with feature `media-desktop`, //! MediaCodec on Android). @@ -30,16 +30,16 @@ use std::thread::JoinHandle; use std::time::{Duration, Instant}; use tracing::{debug, warn}; -use tsc_audio::{VoiceCodec, VoiceEncoder}; -pub use tsc_media; -use tsc_media::capture::synthetic::{SineSource, SyntheticScreen}; -use tsc_media::capture::{ +use voelin_audio::{VoiceCodec, VoiceEncoder}; +pub use voelin_media; +use voelin_media::capture::synthetic::{SineSource, SyntheticScreen}; +use voelin_media::capture::{ self, AudioCapture, CaptureOptions, CaptureSource, ScreenCapture, SourceId, }; -use tsc_media::{ +use voelin_media::{ AudioBuffer, Codec, Codecs, ContentHint, EncoderConfig, FrameReceiver, VideoEncoder, VideoFrame, }; -use tsc_stream::{ +use voelin_stream::{ EncodedFrame, FrameSource, Frequency, MediaFrame, MediaKind, MediaTime, PeerConfig, VideoCodec, }; @@ -60,9 +60,9 @@ const KEYFRAME_RETRY: Duration = Duration::from_millis(500); #[derive(Debug, thiserror::Error)] pub enum MediaError { #[error(transparent)] - Media(#[from] tsc_media::Error), + Media(#[from] voelin_media::Error), #[error("Opus: {0}")] - Opus(#[from] tsc_audio::Error), + Opus(#[from] voelin_audio::Error), } fn lock(m: &Mutex) -> MutexGuard<'_, T> { @@ -76,7 +76,7 @@ fn spawn(name: &str, f: impl FnOnce() + Send + 'static) -> Result .map_err(|e| MediaError::Media(e.into())) } -/// The `tsc_media` codec of a negotiated video codec. +/// The `voelin_media` codec of a negotiated video codec. pub fn media_codec(codec: VideoCodec) -> Codec { match codec { VideoCodec::Vp8 => Codec::Vp8, @@ -86,7 +86,7 @@ pub fn media_codec(codec: VideoCodec) -> Codec { } } -/// The negotiable video codec of a `tsc_media` codec. +/// The negotiable video codec of a `voelin_media` codec. pub fn video_codec(codec: Codec) -> VideoCodec { match codec { Codec::Vp8 => VideoCodec::Vp8, @@ -275,7 +275,7 @@ impl Streamer { } #[cfg(all(target_os = "linux", feature = "media-desktop"))] SourceId::Portal => { - use tsc_media::capture::portal::PortalCapture; + use voelin_media::capture::portal::PortalCapture; let mut portal = PortalCapture::with_restore_token(config.restore_token.clone()); let frames = portal.start(&SourceId::Portal, &options).await?; let token = portal.restore_token().map(str::to_owned); @@ -285,10 +285,10 @@ impl Streamer { let mut screen = match config.backend { CaptureBackend::Auto => capture::default_screen_capture()?, #[cfg(all(target_os = "linux", feature = "media-desktop"))] - CaptureBackend::X11 => Box::new(tsc_media::capture::x11::X11Capture::new()), + CaptureBackend::X11 => Box::new(voelin_media::capture::x11::X11Capture::new()), #[cfg(not(all(target_os = "linux", feature = "media-desktop")))] CaptureBackend::X11 => { - return Err(tsc_media::Error::CaptureUnavailable { + return Err(voelin_media::Error::CaptureUnavailable { backend: "x11", reason: "X11 capture is only in Linux desktop builds".into(), } @@ -311,7 +311,7 @@ impl Streamer { restore_token, audio_error: None, }; - streamer.threads.push(spawn("tsc-stream-video", { + streamer.threads.push(spawn("voelin-stream-video", { let shared = shared.clone(); move || video_loop(&shared, frames, encoder) })?); @@ -319,7 +319,7 @@ impl Streamer { match start_audio(&config.source) { Ok((capture, buffers, encoder)) => { streamer.audio = Some(capture); - streamer.threads.push(spawn("tsc-stream-audio", move || { + streamer.threads.push(spawn("voelin-stream-audio", move || { audio_loop(&shared, buffers, encoder) })?); } @@ -528,7 +528,7 @@ impl MediaSink for ChannelSink { } /// A [`Streamer`] as a [`FrameSource`], for code that runs -/// `tsc_stream::Streams` itself (e.g. tsctl). +/// `voelin_stream::Streams` itself (e.g. voelinctl). pub struct EncodedSource { streamer: Streamer, frames: std_mpsc::Receiver, @@ -701,7 +701,7 @@ impl VideoPipeline { ) -> Self { let queue = Arc::new(DecodeQueue::default()); let thread = std::thread::Builder::new() - .name("tsc-stream-decode".into()) + .name("voelin-stream-decode".into()) .spawn({ let queue = queue.clone(); move || decode_loop(&queue, &codecs, on_frame, request_keyframe) @@ -741,7 +741,7 @@ fn decode_loop( mut on_frame: impl FnMut(VideoFrame), request_keyframe: impl Fn(), ) { - let mut decoder: Option<(Codec, Box)> = None; + let mut decoder: Option<(Codec, Box)> = None; // Start at a keyframe; the streamer sends one when a viewer connects. let mut waiting = true; let mut last_request: Option = None; @@ -909,7 +909,7 @@ impl Latest { /// Feeds a [`Streamer`]'s video straight into a [`VideoPipeline`]. struct PipelineSink { input: FrameInput, - codec: tsc_stream::Codec, + codec: voelin_stream::Codec, keyframe: Arc, } @@ -932,7 +932,7 @@ impl MediaSink for PipelineSink { } /// Capture → encoder → decoder without a server, e.g. to preview a share or -/// to develop the viewer (`TSC_DEMO_STREAM` in the desktop app). +/// to develop the viewer (`VOELIN_DEMO_STREAM` in the desktop app). pub struct LocalPreview { // Dropped first: no more frames into the pipeline. streamer: Streamer, @@ -974,9 +974,9 @@ impl LocalPreview { /// the background. #[cfg(all(test, feature = "media-desktop"))] pub(crate) fn rectangle_span(picture: &VideoFrame) -> (u32, u32) { - use tsc_media::capture::synthetic::{BACKGROUND, RECT_COLOR}; + use voelin_media::capture::synthetic::{BACKGROUND, RECT_COLOR}; - let rgba = tsc_media::convert::to_rgba_vec(picture).unwrap(); + let rgba = voelin_media::convert::to_rgba_vec(picture).unwrap(); let y = picture.height / 2; let pixel = |x: u32| { let i = ((y * picture.width + x) * 4) as usize; @@ -1001,8 +1001,8 @@ mod tests { #[test] fn keyframe_detection() { - // VP8: the 1x1 keyframe of tsc-stream's synthetic source. - assert!(is_keyframe(Codec::Vp8, &tsc_stream::source::VP8_KEYFRAME_1X1)); + // VP8: the 1x1 keyframe of voelin-stream's synthetic source. + assert!(is_keyframe(Codec::Vp8, &voelin_stream::source::VP8_KEYFRAME_1X1)); assert!(!is_keyframe(Codec::Vp8, &[0x31, 0x00])); // VP9 profile 0: marker 10, profile 00, show_existing 0, frame_type 0/1. assert!(is_keyframe(Codec::Vp9, &[0b1000_0000])); diff --git a/crates/tsc-core/src/query.rs b/crates/voelin-core/src/query.rs similarity index 89% rename from crates/tsc-core/src/query.rs rename to crates/voelin-core/src/query.rs index bee41e0..8b66d98 100644 --- a/crates/tsc-core/src/query.rs +++ b/crates/voelin-core/src/query.rs @@ -1,8 +1,10 @@ //! The query source: own ServerQuery credentials, in-process observer and relays. use tokio::sync::{broadcast, mpsc}; -use tsc_model::{ChatMessage, ChatTarget, Presence}; -use tsc_observer::{Observer, ObserverConfig, ObserverEvent, RelayConfig, RelayEvent, RelayPool}; +use voelin_model::{ChatMessage, ChatTarget, Presence}; +use voelin_observer::{ + Observer, ObserverConfig, ObserverEvent, RelayConfig, RelayEvent, RelayPool, +}; pub(crate) enum QueryCmd { OpenChat(ChatTarget), @@ -19,7 +21,7 @@ pub(crate) enum QueryEvent { } pub(crate) async fn run( - connect: tsc_query::Connect, + connect: voelin_query::Connect, mut commands: mpsc::UnboundedReceiver, events: mpsc::UnboundedSender, ) { @@ -74,7 +76,7 @@ pub(crate) async fn run( Some(QueryCmd::SendChat { target, nick, text }) => { let result = match &target { ChatTarget::Channel(cid) => relays.send(*cid, &nick, &text).await, - _ => Err(tsc_query::Error::Unsupported("only channel chat is relayed with own credentials")), + _ => Err(voelin_query::Error::Unsupported("only channel chat is relayed with own credentials")), }; if let Err(e) = result { let _ = events.send(QueryEvent::Error(e.to_string())); diff --git a/crates/tsc-core/src/route.rs b/crates/voelin-core/src/route.rs similarity index 98% rename from crates/tsc-core/src/route.rs rename to crates/voelin-core/src/route.rs index 9531204..27ae3aa 100644 --- a/crates/tsc-core/src/route.rs +++ b/crates/voelin-core/src/route.rs @@ -2,7 +2,7 @@ use std::collections::VecDeque; -use tsc_model::{ChannelId, ChatMessage, ChatTarget}; +use voelin_model::{ChannelId, ChatMessage, ChatTarget}; /// Which source carries a chat. #[derive(Clone, Debug, PartialEq, Eq)] diff --git a/crates/tsc-core/src/session.rs b/crates/voelin-core/src/session.rs similarity index 99% rename from crates/tsc-core/src/session.rs rename to crates/voelin-core/src/session.rs index 0702bb9..69f5400 100644 --- a/crates/tsc-core/src/session.rs +++ b/crates/voelin-core/src/session.rs @@ -5,9 +5,9 @@ use std::sync::Arc; use tokio::sync::{broadcast, mpsc}; use tracing::debug; -use tsc_audio::AudioSettings; -use tsc_model::{ChatMessage, ChatTarget, Presence}; use tsclientlib::ClientId; +use voelin_audio::AudioSettings; +use voelin_model::{ChatMessage, ChatTarget, Presence}; use crate::audio::{self, AudioEvent, AudioHandle, AudioIn}; use crate::gateway::{self, GatewayCmd, GatewayEvent}; diff --git a/crates/tsc-core/src/stream.rs b/crates/voelin-core/src/stream.rs similarity index 98% rename from crates/tsc-core/src/stream.rs rename to crates/voelin-core/src/stream.rs index b820d9e..1612953 100644 --- a/crates/tsc-core/src/stream.rs +++ b/crates/voelin-core/src/stream.rs @@ -1,5 +1,5 @@ //! TeamSpeak 6 streams of a session: a task that runs the stream sessions -//! ([`tsc_stream::Streams`]) of the voice connection. +//! ([`voelin_stream::Streams`]) of the voice connection. //! //! The voice task forwards stream notifications here and sends the resulting //! commands. Only started for TeamSpeak 6 servers. @@ -11,16 +11,16 @@ use std::sync::atomic::{AtomicBool, Ordering}; use tokio::sync::{broadcast, mpsc}; use tracing::debug; -pub use tsc_stream::{ +use tsclientlib::ClientId; +pub use voelin_stream::{ Codec, EncodedFrame, EndReason, FrameSource, Frequency, LeaveReason, MediaFrame, MediaKind, MediaTime, PeerConfig, StreamInfo, StreamKind, StreamSetup, SyntheticSource, VideoCodec, ViewerInfo, ViewerState, }; -use tsc_stream::{ +use voelin_stream::{ Output, Request, StreamEvent, StreamNotification, StreamerEvent, StreamerOptions, Streams, WatchEvent, }; -use tsclientlib::ClientId; use crate::audio::{AudioHandle, AudioIn}; use crate::voice::VoiceCmd; @@ -355,7 +355,7 @@ mod tests { use std::time::{Duration, Instant}; use tokio::time::timeout; - use tsc_stream::{FrameSource, SyntheticSource}; + use voelin_stream::{FrameSource, SyntheticSource}; use super::*; @@ -592,8 +592,8 @@ mod tests { async fn test_pattern_through_stream_tasks() { use std::sync::mpsc as std_mpsc; - use tsc_media::capture::SourceId; - use tsc_media::{Codec, Codecs}; + use voelin_media::capture::SourceId; + use voelin_media::{Codec, Codecs}; use crate::media::{Streamer, StreamerConfig, VideoPipeline, rectangle_span}; diff --git a/crates/tsc-core/src/voice.rs b/crates/voelin-core/src/voice.rs similarity index 99% rename from crates/tsc-core/src/voice.rs rename to crates/voelin-core/src/voice.rs index c1c1723..c671236 100644 --- a/crates/tsc-core/src/voice.rs +++ b/crates/voelin-core/src/voice.rs @@ -7,10 +7,6 @@ use futures::prelude::*; use tokio::sync::mpsc; use tokio::time::{Instant, timeout}; use tracing::{info, warn}; -use tsc_model::{ - ChannelId, ChannelInfo, ChatMessage, ChatTarget, ClientInfo, Presence, ServerFlavor, -}; -use tsc_stream::{PeerConfig, Request, StreamNotification}; use tsclientlib::data; use tsclientlib::events::Event as BookEvent; use tsclientlib::prelude::*; @@ -19,6 +15,10 @@ use tsclientlib::{ StreamItem, Version, }; use tsproto_packets::packets::{AudioData, InAudioBuf, OutPacket}; +use voelin_model::{ + ChannelId, ChannelInfo, ChatMessage, ChatTarget, ClientInfo, Presence, ServerFlavor, +}; +use voelin_stream::{PeerConfig, Request, StreamNotification}; #[derive(Clone, Debug)] pub struct VoiceOptions { diff --git a/crates/tsc-core/tests/live.rs b/crates/voelin-core/tests/live.rs similarity index 80% rename from crates/tsc-core/tests/live.rs rename to crates/voelin-core/tests/live.rs index 73f715a..c4c5276 100644 --- a/crates/tsc-core/tests/live.rs +++ b/crates/voelin-core/tests/live.rs @@ -1,15 +1,15 @@ //! Engine against the development servers (dev/docker-compose.yml). -//! Runs only with `TSC_LIVE=1`; `scripts/it-smoke.sh` sets it. +//! Runs only with `VOELIN_LIVE=1`; `scripts/it-smoke.sh` sets it. use std::time::Duration; use tokio::sync::broadcast::Receiver; use tokio::time::{Instant, timeout_at}; -use tsc_core::{Command, Engine, Event, ObserveState, Source, VoiceOptions, VoiceState}; -use tsc_model::ChatTarget; +use voelin_core::{Command, Engine, Event, ObserveState, Source, VoiceOptions, VoiceState}; +use voelin_model::ChatTarget; fn live() -> bool { - std::env::var("TSC_LIVE").is_ok_and(|v| v == "1") + std::env::var("VOELIN_LIVE").is_ok_and(|v| v == "1") } /// Wait for an event matching `f`, failing after 20 s. @@ -29,7 +29,7 @@ async fn wait_for( } } -async fn engine_roundtrip(voice_addr: &str, query: tsc_query::Connect) { +async fn engine_roundtrip(voice_addr: &str, query: voelin_query::Connect) { let engine = Engine::start(); let mut events = engine.subscribe(); let nick = format!("engine-{}", std::process::id() % 10_000); @@ -93,15 +93,15 @@ async fn engine_roundtrip(voice_addr: &str, query: tsc_query::Connect) { tokio::time::sleep(Duration::from_millis(500)).await; } -fn query(transport: tsc_query::Transport, addr: &str) -> tsc_query::Connect { - tsc_query::Connect { +fn query(transport: voelin_query::Transport, addr: &str) -> voelin_query::Connect { + voelin_query::Connect { transport, addr: addr.into(), user: "serveradmin".into(), - secret: Some("tsc-dev-admin".into()), + secret: Some("voelin-dev-admin".into()), server_port: Some(9987), server_id: None, - line: tsc_query::LineOptions { rate_limit: None, ..Default::default() }, + line: voelin_query::LineOptions { rate_limit: None, ..Default::default() }, } } @@ -110,7 +110,8 @@ async fn ts6_engine() { if !live() { return; } - engine_roundtrip("127.0.0.1:9988", query(tsc_query::Transport::Ssh, "127.0.0.1:10022")).await; + engine_roundtrip("127.0.0.1:9988", query(voelin_query::Transport::Ssh, "127.0.0.1:10022")) + .await; } #[tokio::test(flavor = "multi_thread")] @@ -118,5 +119,6 @@ async fn ts3_engine() { if !live() { return; } - engine_roundtrip("127.0.0.1:9987", query(tsc_query::Transport::Raw, "127.0.0.1:10011")).await; + engine_roundtrip("127.0.0.1:9987", query(voelin_query::Transport::Raw, "127.0.0.1:10011")) + .await; } diff --git a/crates/tsc-core/tests/media_live.rs b/crates/voelin-core/tests/media_live.rs similarity index 89% rename from crates/tsc-core/tests/media_live.rs rename to crates/voelin-core/tests/media_live.rs index 585fd13..a4519db 100644 --- a/crates/tsc-core/tests/media_live.rs +++ b/crates/voelin-core/tests/media_live.rs @@ -1,6 +1,6 @@ //! The media pipeline through the engine and the TeamSpeak 6 development //! server (dev/docker-compose.yml): one session streams the test pattern -//! (VP8 + Opus), another decodes it. Runs only with `TSC_LIVE=1`. +//! (VP8 + Opus), another decodes it. Runs only with `VOELIN_LIVE=1`. #![cfg(feature = "media-desktop")] @@ -10,15 +10,15 @@ use std::time::Duration; use tokio::sync::broadcast::Receiver; use tokio::time::timeout; -use tsc_core::media::tsc_media::capture::SourceId; -use tsc_core::media::tsc_media::capture::synthetic::RECT_COLOR; -use tsc_core::media::tsc_media::{Codec, Codecs, convert}; -use tsc_core::media::{Streamer, StreamerConfig, Viewer, peer_config, stream_codec}; -use tsc_core::stream::{PeerConfig, StreamSetup}; -use tsc_core::{Command, Engine, Event, StreamState, VoiceOptions, VoiceState, WatchState}; +use voelin_core::media::voelin_media::capture::SourceId; +use voelin_core::media::voelin_media::capture::synthetic::RECT_COLOR; +use voelin_core::media::voelin_media::{Codec, Codecs, convert}; +use voelin_core::media::{Streamer, StreamerConfig, Viewer, peer_config, stream_codec}; +use voelin_core::stream::{PeerConfig, StreamSetup}; +use voelin_core::{Command, Engine, Event, StreamState, VoiceOptions, VoiceState, WatchState}; fn live() -> bool { - std::env::var("TSC_LIVE").is_ok_and(|v| v == "1") + std::env::var("VOELIN_LIVE").is_ok_and(|v| v == "1") } /// Wait for an event matching `f`, failing after 20 s. @@ -73,7 +73,7 @@ async fn connect( #[tokio::test(flavor = "multi_thread")] async fn ts6_test_pattern_decoded() { if !live() { - eprintln!("skipped: set TSC_LIVE=1 with the dev servers running"); + eprintln!("skipped: set VOELIN_LIVE=1 with the dev servers running"); return; } let engine = Engine::start(); diff --git a/crates/tsc-core/tests/stream_live.rs b/crates/voelin-core/tests/stream_live.rs similarity index 94% rename from crates/tsc-core/tests/stream_live.rs rename to crates/voelin-core/tests/stream_live.rs index 25e1824..486e876 100644 --- a/crates/tsc-core/tests/stream_live.rs +++ b/crates/voelin-core/tests/stream_live.rs @@ -1,19 +1,19 @@ //! Streams through the engine against the development servers //! (dev/docker-compose.yml): one session streams synthetic frames, another -//! watches. Runs only with `TSC_LIVE=1`. +//! watches. Runs only with `VOELIN_LIVE=1`. use std::time::{Duration, Instant}; use tokio::sync::broadcast::Receiver; use tokio::time::timeout; -use tsc_core::stream::{ +use voelin_core::stream::{ EndReason, FrameSource, LeaveReason, MediaKind, PeerConfig, StreamSetup, SyntheticSource, ViewerState, }; -use tsc_core::{Command, Engine, Event, StreamState, VoiceOptions, VoiceState, WatchState}; +use voelin_core::{Command, Engine, Event, StreamState, VoiceOptions, VoiceState, WatchState}; fn live() -> bool { - std::env::var("TSC_LIVE").is_ok_and(|v| v == "1") + std::env::var("VOELIN_LIVE").is_ok_and(|v| v == "1") } /// Wait for an event matching `f`, failing after 20 s. @@ -90,7 +90,7 @@ async fn connect( #[tokio::test(flavor = "multi_thread")] async fn ts6_stream_between_sessions() { if !live() { - eprintln!("skipped: set TSC_LIVE=1 with the dev servers running"); + eprintln!("skipped: set VOELIN_LIVE=1 with the dev servers running"); return; } let engine = Engine::start(); @@ -220,9 +220,9 @@ async fn ts6_stream_between_sessions() { }, ) .await; - assert!(!sink.send(tsc_core::stream::EncodedFrame { + assert!(!sink.send(voelin_core::stream::EncodedFrame { kind: MediaKind::Audio, - time: tsc_core::stream::MediaTime::from_90khz(0), + time: voelin_core::stream::MediaTime::from_90khz(0), data: vec![0].into(), })); feeder.await.unwrap(); diff --git a/crates/tsc-gateway-proto/Cargo.toml b/crates/voelin-gateway-proto/Cargo.toml similarity index 88% rename from crates/tsc-gateway-proto/Cargo.toml rename to crates/voelin-gateway-proto/Cargo.toml index 0bad230..32e96e7 100644 --- a/crates/tsc-gateway-proto/Cargo.toml +++ b/crates/voelin-gateway-proto/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-gateway-proto" +name = "voelin-gateway-proto" version = "0.1.0" description = "Wire protocol and identity-challenge authentication of the tsgw gateway." edition.workspace = true @@ -15,7 +15,7 @@ serde_json = "1" sha1 = { package = "sha-1", version = "0.10" } sha2 = "0.10" thiserror = "2" -tsc-model = { path = "../tsc-model" } +voelin-model = { path = "../voelin-model" } tsproto-types = { path = "../proto/tsproto-types" } [lints] diff --git a/crates/tsc-gateway-proto/src/auth.rs b/crates/voelin-gateway-proto/src/auth.rs similarity index 100% rename from crates/tsc-gateway-proto/src/auth.rs rename to crates/voelin-gateway-proto/src/auth.rs diff --git a/crates/tsc-gateway-proto/src/lib.rs b/crates/voelin-gateway-proto/src/lib.rs similarity index 100% rename from crates/tsc-gateway-proto/src/lib.rs rename to crates/voelin-gateway-proto/src/lib.rs diff --git a/crates/tsc-gateway-proto/src/messages.rs b/crates/voelin-gateway-proto/src/messages.rs similarity index 98% rename from crates/tsc-gateway-proto/src/messages.rs rename to crates/voelin-gateway-proto/src/messages.rs index 017e3bd..9b8c8f0 100644 --- a/crates/tsc-gateway-proto/src/messages.rs +++ b/crates/voelin-gateway-proto/src/messages.rs @@ -1,7 +1,7 @@ //! Messages in both directions. use serde::{Deserialize, Serialize}; -use tsc_model::{ChatMessage, ChatTarget, PresenceDelta, PresenceSnapshot}; +use voelin_model::{ChatMessage, ChatTarget, PresenceDelta, PresenceSnapshot}; /// Every frame: `{"v":1,"id":7,"type":"send_chat","data":{...}}`. /// diff --git a/crates/tsc-gateway/Cargo.toml b/crates/voelin-gateway/Cargo.toml similarity index 80% rename from crates/tsc-gateway/Cargo.toml rename to crates/voelin-gateway/Cargo.toml index 38f1160..0fe726c 100644 --- a/crates/tsc-gateway/Cargo.toml +++ b/crates/voelin-gateway/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-gateway" +name = "voelin-gateway" version = "0.1.0" description = "tsgw: companion gateway giving app users invisible presence and channel chat over ServerQuery." edition.workspace = true @@ -28,10 +28,10 @@ tokio = { version = "1.53.1", features = ["full"] } toml = "1.1.6" tracing = "0.1.44" tracing-subscriber = { version = "0.3.23", features = ["env-filter"] } -tsc-gateway-proto = { path = "../tsc-gateway-proto" } -tsc-model = { path = "../tsc-model" } -tsc-observer = { path = "../tsc-observer" } -tsc-query = { path = "../tsc-query" } +voelin-gateway-proto = { path = "../voelin-gateway-proto" } +voelin-model = { path = "../voelin-model" } +voelin-observer = { path = "../voelin-observer" } +voelin-query = { path = "../voelin-query" } [lints] workspace = true diff --git a/crates/tsc-gateway/Dockerfile b/crates/voelin-gateway/Dockerfile similarity index 74% rename from crates/tsc-gateway/Dockerfile rename to crates/voelin-gateway/Dockerfile index ce58ca0..1a997f4 100644 --- a/crates/tsc-gateway/Dockerfile +++ b/crates/voelin-gateway/Dockerfile @@ -1,10 +1,10 @@ -# Build: docker build -f crates/tsc-gateway/Dockerfile -t tsgw . +# Build: docker build -f crates/voelin-gateway/Dockerfile -t tsgw . # Run: docker run -v ./tsgw.toml:/etc/tsgw/tsgw.toml -p 7788:7788 tsgw FROM rust:1.94-bookworm AS build WORKDIR /src RUN apt-get update && apt-get install -y --no-install-recommends cmake libasound2-dev && rm -rf /var/lib/apt/lists/* COPY . . -RUN cargo build --release --locked -p tsc-gateway && cp target/release/tsgw /tsgw +RUN cargo build --release --locked -p voelin-gateway && cp target/release/tsgw /tsgw FROM gcr.io/distroless/cc-debian12:nonroot COPY --from=build /tsgw /usr/local/bin/tsgw diff --git a/crates/tsc-gateway/src/config.rs b/crates/voelin-gateway/src/config.rs similarity index 96% rename from crates/tsc-gateway/src/config.rs rename to crates/voelin-gateway/src/config.rs index 693e38b..739f98b 100644 --- a/crates/tsc-gateway/src/config.rs +++ b/crates/voelin-gateway/src/config.rs @@ -5,7 +5,7 @@ use std::path::{Path, PathBuf}; use anyhow::{Context, Result, bail}; use serde::Deserialize; -use tsc_query::Transport; +use voelin_query::Transport; #[derive(Clone, Debug, Deserialize)] #[serde(deny_unknown_fields)] @@ -199,19 +199,19 @@ impl Config { .unwrap_or_else(|| format!("tsgw@{}", self.query.addr)) } - pub fn query_connect(&self) -> tsc_query::Connect { - tsc_query::Connect { + pub fn query_connect(&self) -> voelin_query::Connect { + voelin_query::Connect { transport: self.query.transport, addr: self.query.addr.clone(), user: self.query.user.clone(), secret: self.query.password.clone(), server_port: Some(self.server.voice_port), server_id: None, - line: tsc_query::LineOptions { + line: voelin_query::LineOptions { rate_limit: if self.query.allowlisted { None } else { - tsc_query::LineOptions::default().rate_limit + voelin_query::LineOptions::default().rate_limit }, ..Default::default() }, diff --git a/crates/tsc-gateway/src/db.rs b/crates/voelin-gateway/src/db.rs similarity index 99% rename from crates/tsc-gateway/src/db.rs rename to crates/voelin-gateway/src/db.rs index b6530fc..4712273 100644 --- a/crates/tsc-gateway/src/db.rs +++ b/crates/voelin-gateway/src/db.rs @@ -4,7 +4,7 @@ use std::path::Path; use std::sync::Mutex; use rusqlite::{Connection, OptionalExtension, params}; -use tsc_model::{ChatMessage, ChatTarget}; +use voelin_model::{ChatMessage, ChatTarget}; pub struct Db(Mutex); diff --git a/crates/tsc-gateway/src/hub.rs b/crates/voelin-gateway/src/hub.rs similarity index 96% rename from crates/tsc-gateway/src/hub.rs rename to crates/voelin-gateway/src/hub.rs index 82cf9f5..5e14f7b 100644 --- a/crates/tsc-gateway/src/hub.rs +++ b/crates/voelin-gateway/src/hub.rs @@ -11,10 +11,12 @@ use rand::RngExt; use sha2::{Digest, Sha256}; use tokio::sync::broadcast; use tracing::{info, warn}; -use tsc_gateway_proto::{ErrorCode, UniqueIds, identity_level, verify_auth}; -use tsc_model::{ChannelId, ChatMessage, ChatTarget, Presence, ServerFlavor, relay_text}; -use tsc_observer::{Observer, ObserverConfig, ObserverEvent, RelayConfig, RelayEvent, RelayPool}; -use tsc_query::{Command, QueryClient}; +use voelin_gateway_proto::{ErrorCode, UniqueIds, identity_level, verify_auth}; +use voelin_model::{ChannelId, ChatMessage, ChatTarget, Presence, ServerFlavor, relay_text}; +use voelin_observer::{ + Observer, ObserverConfig, ObserverEvent, RelayConfig, RelayEvent, RelayPool, +}; +use voelin_query::{Command, QueryClient}; use crate::config::Config; use crate::db::{Db, TokenInfo}; @@ -53,8 +55,8 @@ impl Denied { } } -impl From for Denied { - fn from(e: tsc_query::Error) -> Self { +impl From for Denied { + fn from(e: voelin_query::Error) -> Self { Denied::new(ErrorCode::Unavailable, e.to_string()) } } @@ -414,7 +416,7 @@ impl Hub { return Err(Denied::new(ErrorCode::Forbidden, "no permission for server chat")); } let msg = relay_text(&self.config.relay.format, &user.nickname, text); - for part in tsc_model::split_message(&msg, 1024) { + for part in voelin_model::split_message(&msg, 1024) { self.lookup .send( &Command::new("sendtextmessage").arg("targetmode", 3).arg("msg", part), diff --git a/crates/tsc-gateway/src/main.rs b/crates/voelin-gateway/src/main.rs similarity index 92% rename from crates/tsc-gateway/src/main.rs rename to crates/voelin-gateway/src/main.rs index 053fc84..0cff9dd 100644 --- a/crates/tsc-gateway/src/main.rs +++ b/crates/voelin-gateway/src/main.rs @@ -2,7 +2,7 @@ //! //! Gives app users invisible presence (who is in which channel) and channel //! chat without joining voice, through ServerQuery. See -//! docs/gateway-admin.md and the protocol in `tsc-gateway-proto`. +//! docs/gateway-admin.md and the protocol in `voelin-gateway-proto`. mod config; mod db; @@ -55,7 +55,7 @@ async fn main() -> Result<()> { async fn ws(State(hub): State>, upgrade: WebSocketUpgrade) -> impl IntoResponse { upgrade - .protocols([tsc_gateway_proto::SUBPROTOCOL]) + .protocols([voelin_gateway_proto::SUBPROTOCOL]) .on_upgrade(move |socket| session::run(hub, socket)) } diff --git a/crates/tsc-gateway/src/perms.rs b/crates/voelin-gateway/src/perms.rs similarity index 95% rename from crates/tsc-gateway/src/perms.rs rename to crates/voelin-gateway/src/perms.rs index b529325..c7de711 100644 --- a/crates/tsc-gateway/src/perms.rs +++ b/crates/voelin-gateway/src/perms.rs @@ -9,7 +9,7 @@ use std::collections::HashMap; use std::sync::Mutex; use std::time::{Duration, Instant}; -use tsc_query::{Command, QueryClient, Row}; +use voelin_query::{Command, QueryClient, Row}; const CACHE_TTL: Duration = Duration::from_secs(60); @@ -81,7 +81,7 @@ pub struct PermIds { } impl PermIds { - pub async fn load(client: &QueryClient) -> tsc_query::Result { + pub async fn load(client: &QueryClient) -> voelin_query::Result { let names = [ "i_channel_join_power", "i_channel_needed_join_power", @@ -93,10 +93,9 @@ impl PermIds { let mut ids = [0u32; 6]; for (i, name) in names.iter().enumerate() { let rows = client.send(&Command::new("permidgetbyname").arg("permsid", name)).await?; - ids[i] = rows - .first() - .and_then(|r| r.parse("permid")) - .ok_or_else(|| tsc_query::Error::Protocol(format!("unknown permission {name}")))?; + ids[i] = rows.first().and_then(|r| r.parse("permid")).ok_or_else(|| { + voelin_query::Error::Protocol(format!("unknown permission {name}")) + })?; } Ok(Self { join_power: ids[0], @@ -148,7 +147,7 @@ impl PermResolver { client: &QueryClient, cldbid: u64, cid: u64, - ) -> tsc_query::Result> { + ) -> voelin_query::Result> { if let Some((at, entries)) = self.cache.lock().unwrap().get(&(cldbid, cid)) && at.elapsed() < CACHE_TTL { diff --git a/crates/tsc-gateway/src/session.rs b/crates/voelin-gateway/src/session.rs similarity index 96% rename from crates/tsc-gateway/src/session.rs rename to crates/voelin-gateway/src/session.rs index c21a1b3..861b832 100644 --- a/crates/tsc-gateway/src/session.rs +++ b/crates/voelin-gateway/src/session.rs @@ -9,9 +9,9 @@ use base64::prelude::*; use rand::RngExt; use tokio::sync::broadcast::error::RecvError; use tracing::{debug, info}; -use tsc_gateway_proto::{ClientMsg, Envelope, ErrorCode, HistoryEntry, ServerMsg}; -use tsc_model::{ChatTarget, Presence}; -use tsc_observer::ObserverEvent; +use voelin_gateway_proto::{ClientMsg, Envelope, ErrorCode, HistoryEntry, ServerMsg}; +use voelin_model::{ChatTarget, Presence}; +use voelin_observer::ObserverEvent; use crate::hub::{Denied, Hub, User}; @@ -97,7 +97,7 @@ pub async fn run(hub: Arc, mut socket: WebSocket) { } async fn send(socket: &mut WebSocket, id: Option, msg: ServerMsg) -> Result<(), axum::Error> { - let env = Envelope { v: tsc_gateway_proto::VERSION, id, msg }; + let env = Envelope { v: voelin_gateway_proto::VERSION, id, msg }; let text = serde_json::to_string(&env).expect("messages serialize"); socket.send(Message::Text(text.into())).await } diff --git a/crates/tsc-gateway/tsgw.example.toml b/crates/voelin-gateway/tsgw.example.toml similarity index 100% rename from crates/tsc-gateway/tsgw.example.toml rename to crates/voelin-gateway/tsgw.example.toml diff --git a/crates/tsc-media/Cargo.toml b/crates/voelin-media/Cargo.toml similarity index 99% rename from crates/tsc-media/Cargo.toml rename to crates/voelin-media/Cargo.toml index 427736f..103ffbb 100644 --- a/crates/tsc-media/Cargo.toml +++ b/crates/voelin-media/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-media" +name = "voelin-media" version = "0.1.0" description = "Video frames, pixel conversion, video codecs (VP8/VP9, H.264, AV1) and screen / system-audio capture for streams." edition.workspace = true diff --git a/crates/tsc-media/src/capture/external.rs b/crates/voelin-media/src/capture/external.rs similarity index 100% rename from crates/tsc-media/src/capture/external.rs rename to crates/voelin-media/src/capture/external.rs diff --git a/crates/tsc-media/src/capture/mod.rs b/crates/voelin-media/src/capture/mod.rs similarity index 100% rename from crates/tsc-media/src/capture/mod.rs rename to crates/voelin-media/src/capture/mod.rs diff --git a/crates/tsc-media/src/capture/pipewire_audio.rs b/crates/voelin-media/src/capture/pipewire_audio.rs similarity index 97% rename from crates/tsc-media/src/capture/pipewire_audio.rs rename to crates/voelin-media/src/capture/pipewire_audio.rs index a81f102..994f476 100644 --- a/crates/tsc-media/src/capture/pipewire_audio.rs +++ b/crates/voelin-media/src/capture/pipewire_audio.rs @@ -26,7 +26,7 @@ use crate::{Error, Result}; const BACKEND: &str = "pipewire"; /// Name of our capture node in PipeWire. -pub const NODE_NAME: &str = "tsc-system-audio"; +pub const NODE_NAME: &str = "voelin-system-audio"; /// Captures the default sink's monitor through PipeWire. #[derive(Default)] @@ -49,7 +49,7 @@ impl AudioCapture for PipeWireAudioCapture { self.stop(); // Half a second at PipeWire's usual 10-20 ms quantum. let (tx, rx) = frame_channel(50); - let thread = PwThread::spawn("tsc-pipewire-audio", None, move |core, mainloop| { + let thread = PwThread::spawn("voelin-pipewire-audio", None, move |core, mainloop| { audio_stream(core, mainloop, tx) }) .map_err(|reason| Error::CaptureUnavailable { backend: BACKEND, reason })?; diff --git a/crates/tsc-media/src/capture/portal.rs b/crates/voelin-media/src/capture/portal.rs similarity index 97% rename from crates/tsc-media/src/capture/portal.rs rename to crates/voelin-media/src/capture/portal.rs index 883a7cf..c4f19ba 100644 --- a/crates/tsc-media/src/capture/portal.rs +++ b/crates/voelin-media/src/capture/portal.rs @@ -159,10 +159,11 @@ impl ScreenCapture for PortalCapture { let (fd, node) = self.open(&options).await?; let (tx, rx) = frame_channel(options.queue); let fps = options.fps.max(1); - let thread = PwThread::spawn("tsc-portal-capture", Some(fd), move |core, mainloop| { - video_stream(core, mainloop, node, fps, tx) - }) - .map_err(|e| Error::Capture { backend: BACKEND, message: e })?; + let thread = + PwThread::spawn("voelin-portal-capture", Some(fd), move |core, mainloop| { + video_stream(core, mainloop, node, fps, tx) + }) + .map_err(|e| Error::Capture { backend: BACKEND, message: e })?; self.thread = Some(thread); Ok(rx) }) @@ -210,7 +211,7 @@ fn video_stream( *pw::keys::MEDIA_CATEGORY => "Capture", *pw::keys::MEDIA_ROLE => "Screen", }; - let stream = pw::stream::StreamRc::new(core.clone(), "tsc-screen-capture", props) + let stream = pw::stream::StreamRc::new(core.clone(), "voelin-screen-capture", props) .map_err(|e| format!("PipeWire stream: {e}"))?; let state = VideoState { tx, diff --git a/crates/tsc-media/src/capture/pw.rs b/crates/voelin-media/src/capture/pw.rs similarity index 100% rename from crates/tsc-media/src/capture/pw.rs rename to crates/voelin-media/src/capture/pw.rs diff --git a/crates/tsc-media/src/capture/synthetic.rs b/crates/voelin-media/src/capture/synthetic.rs similarity index 98% rename from crates/tsc-media/src/capture/synthetic.rs rename to crates/voelin-media/src/capture/synthetic.rs index e96e39f..63f8618 100644 --- a/crates/tsc-media/src/capture/synthetic.rs +++ b/crates/voelin-media/src/capture/synthetic.rs @@ -124,7 +124,7 @@ impl ScreenCapture for SyntheticScreen { let (tx, rx) = frame_channel(options.queue); let pattern = SyntheticScreen::new(self.width, self.height); let fps = options.fps; - self.worker = Some(Worker::spawn("tsc-synthetic-video", move |stop| { + self.worker = Some(Worker::spawn("voelin-synthetic-video", move |stop| { let mut ticker = Ticker::new(fps); let mut n = 0; while tx.send(pattern.frame(n, fps)) && ticker.wait(&stop) { @@ -179,7 +179,7 @@ impl AudioCapture for SineSource { // Half a second of audio before the oldest is dropped. let (tx, rx) = frame_channel(50); let tone = SineSource::new(self.frequency, self.amplitude); - self.worker = Some(Worker::spawn("tsc-synthetic-audio", move |stop| { + self.worker = Some(Worker::spawn("voelin-synthetic-audio", move |stop| { let mut ticker = Ticker::new(100); let mut n = 0; while tx.send(tone.buffer(n)) && ticker.wait(&stop) { diff --git a/crates/tsc-media/src/capture/windows.rs b/crates/voelin-media/src/capture/windows.rs similarity index 99% rename from crates/tsc-media/src/capture/windows.rs rename to crates/voelin-media/src/capture/windows.rs index d1f91a2..1940b34 100644 --- a/crates/tsc-media/src/capture/windows.rs +++ b/crates/voelin-media/src/capture/windows.rs @@ -207,7 +207,7 @@ impl AudioCapture for WasapiLoopback { self.stop(); let (tx, rx) = frame_channel(50); let (init_tx, init_rx) = std::sync::mpsc::channel(); - self.worker = Some(Worker::spawn("tsc-wasapi-loopback", move |stop| { + self.worker = Some(Worker::spawn("voelin-wasapi-loopback", move |stop| { if let Err(e) = loopback(&tx, &stop, &init_tx) { // After a successful start the receiver just sees the end. let _ = init_tx.send(Err(e.clone())); diff --git a/crates/tsc-media/src/capture/x11.rs b/crates/voelin-media/src/capture/x11.rs similarity index 99% rename from crates/tsc-media/src/capture/x11.rs rename to crates/voelin-media/src/capture/x11.rs index b72bbfa..66aea30 100644 --- a/crates/tsc-media/src/capture/x11.rs +++ b/crates/voelin-media/src/capture/x11.rs @@ -111,7 +111,7 @@ impl ScreenCapture for X11Capture { x.region(&source)?; let (tx, rx) = frame_channel(options.queue); let use_shm = self.use_shm; - self.worker = Some(Worker::spawn("tsc-x11-capture", move |stop| { + self.worker = Some(Worker::spawn("voelin-x11-capture", move |stop| { let mut grabber = Grabber::new(&x, use_shm); let cursor = options.cursor && x.xfixes; let started = Instant::now(); @@ -475,7 +475,7 @@ impl Grabber { } fn attach(x: &Display11, size: usize) -> Result { - let fd = rustix::fs::memfd_create("tsc-x11-capture", rustix::fs::MemfdFlags::CLOEXEC) + let fd = rustix::fs::memfd_create("voelin-x11-capture", rustix::fs::MemfdFlags::CLOEXEC) .map_err(|e| failed(format!("memfd_create: {e}")))?; let file = std::fs::File::from(fd); file.set_len(size as u64)?; diff --git a/crates/tsc-media/src/capture/x11/shm.rs b/crates/voelin-media/src/capture/x11/shm.rs similarity index 100% rename from crates/tsc-media/src/capture/x11/shm.rs rename to crates/voelin-media/src/capture/x11/shm.rs diff --git a/crates/tsc-media/src/codec/av1.rs b/crates/voelin-media/src/codec/av1.rs similarity index 100% rename from crates/tsc-media/src/codec/av1.rs rename to crates/voelin-media/src/codec/av1.rs diff --git a/crates/tsc-media/src/codec/h264.rs b/crates/voelin-media/src/codec/h264.rs similarity index 98% rename from crates/tsc-media/src/codec/h264.rs rename to crates/voelin-media/src/codec/h264.rs index 320e29d..d9fd168 100644 --- a/crates/tsc-media/src/codec/h264.rs +++ b/crates/voelin-media/src/codec/h264.rs @@ -386,13 +386,14 @@ mod tests { assert!(matches!(err, Error::CodecUnavailable { codec: Codec::H264, .. }), "{err}"); assert!(err.to_string().contains("not found"), "{err}"); - let dir = std::env::temp_dir().join(format!("tsc-media-h264-{}", std::process::id())); + let dir = std::env::temp_dir().join(format!("voelin-media-h264-{}", std::process::id())); assert!(OpenH264::find_in(&dir).is_err()); } #[test] fn unknown_file_is_rejected() { - let dir = std::env::temp_dir().join(format!("tsc-media-h264-bad-{}", std::process::id())); + let dir = + std::env::temp_dir().join(format!("voelin-media-h264-bad-{}", std::process::id())); std::fs::create_dir_all(&dir).unwrap(); let fake = dir.join(platform_library_name().unwrap_or("libopenh264.so")); std::fs::write(&fake, b"not a library").unwrap(); diff --git a/crates/tsc-media/src/codec/hw.rs b/crates/voelin-media/src/codec/hw.rs similarity index 100% rename from crates/tsc-media/src/codec/hw.rs rename to crates/voelin-media/src/codec/hw.rs diff --git a/crates/tsc-media/src/codec/image_layout.rs b/crates/voelin-media/src/codec/image_layout.rs similarity index 100% rename from crates/tsc-media/src/codec/image_layout.rs rename to crates/voelin-media/src/codec/image_layout.rs diff --git a/crates/tsc-media/src/codec/mediacodec.rs b/crates/voelin-media/src/codec/mediacodec.rs similarity index 99% rename from crates/tsc-media/src/codec/mediacodec.rs rename to crates/voelin-media/src/codec/mediacodec.rs index 864fff0..f5f941b 100644 --- a/crates/tsc-media/src/codec/mediacodec.rs +++ b/crates/voelin-media/src/codec/mediacodec.rs @@ -8,7 +8,7 @@ //! VP9 and H.264 (`c2.android.*`). //! //! H.264 is encoded as High profile without B-frames (the Constrained High -//! stream TeamSpeak negotiates, see `tsc-stream`), SPS/PPS in front of every +//! stream TeamSpeak negotiates, see `voelin-stream`), SPS/PPS in front of every //! keyframe. // AMediaCodec handles are used from one thread at a time (`&mut self`), which diff --git a/crates/tsc-media/src/codec/mod.rs b/crates/voelin-media/src/codec/mod.rs similarity index 99% rename from crates/tsc-media/src/codec/mod.rs rename to crates/voelin-media/src/codec/mod.rs index 48e7d9e..488c590 100644 --- a/crates/tsc-media/src/codec/mod.rs +++ b/crates/voelin-media/src/codec/mod.rs @@ -162,7 +162,7 @@ impl EncoderConfig { } } -/// One encoded frame, ready for `tsc_stream::Peer::write`. +/// One encoded frame, ready for `voelin_stream::Peer::write`. #[derive(Clone, Debug, PartialEq, Eq)] pub struct EncodedFrame { pub data: Vec, diff --git a/crates/tsc-media/src/codec/vpx.rs b/crates/voelin-media/src/codec/vpx.rs similarity index 100% rename from crates/tsc-media/src/codec/vpx.rs rename to crates/voelin-media/src/codec/vpx.rs diff --git a/crates/tsc-media/src/codec/vpx/raw.rs b/crates/voelin-media/src/codec/vpx/raw.rs similarity index 100% rename from crates/tsc-media/src/codec/vpx/raw.rs rename to crates/voelin-media/src/codec/vpx/raw.rs diff --git a/crates/tsc-media/src/convert.rs b/crates/voelin-media/src/convert.rs similarity index 100% rename from crates/tsc-media/src/convert.rs rename to crates/voelin-media/src/convert.rs diff --git a/crates/tsc-media/src/frame.rs b/crates/voelin-media/src/frame.rs similarity index 100% rename from crates/tsc-media/src/frame.rs rename to crates/voelin-media/src/frame.rs diff --git a/crates/tsc-media/src/lib.rs b/crates/voelin-media/src/lib.rs similarity index 97% rename from crates/tsc-media/src/lib.rs rename to crates/voelin-media/src/lib.rs index ef42629..9577a2e 100644 --- a/crates/tsc-media/src/lib.rs +++ b/crates/voelin-media/src/lib.rs @@ -15,7 +15,7 @@ //! plus WASAPI loopback on Windows //! - [`queue`]: the bounded, drop-oldest channel capture backends deliver on //! -//! Encoded frames go to `tsc_stream::Peer::write` with an RTP time of +//! Encoded frames go to `voelin_stream::Peer::write` with an RTP time of //! [`EncodedFrame::pts_90khz`] (90 kHz clock); received `MediaFrame`s go to //! [`VideoDecoder::decode`]. diff --git a/crates/tsc-media/src/queue.rs b/crates/voelin-media/src/queue.rs similarity index 100% rename from crates/tsc-media/src/queue.rs rename to crates/voelin-media/src/queue.rs diff --git a/crates/tsc-media/tests/codec_roundtrip.rs b/crates/voelin-media/tests/codec_roundtrip.rs similarity index 97% rename from crates/tsc-media/tests/codec_roundtrip.rs rename to crates/voelin-media/tests/codec_roundtrip.rs index 552b8ca..c92561d 100644 --- a/crates/tsc-media/tests/codec_roundtrip.rs +++ b/crates/voelin-media/tests/codec_roundtrip.rs @@ -3,8 +3,8 @@ use std::time::Duration; -use tsc_media::capture::synthetic::{BACKGROUND, RECT_COLOR, SyntheticScreen, TEXT_COLOR}; -use tsc_media::{ +use voelin_media::capture::synthetic::{BACKGROUND, RECT_COLOR, SyntheticScreen, TEXT_COLOR}; +use voelin_media::{ CaptureOptions, Codec, Codecs, EncoderBackend, EncoderConfig, ScreenCapture, SourceId, VideoFrame, convert, }; diff --git a/crates/tsc-media/tests/openh264.rs b/crates/voelin-media/tests/openh264.rs similarity index 84% rename from crates/tsc-media/tests/openh264.rs rename to crates/voelin-media/tests/openh264.rs index 8ca686b..d89cc0f 100644 --- a/crates/tsc-media/tests/openh264.rs +++ b/crates/voelin-media/tests/openh264.rs @@ -1,16 +1,16 @@ //! H.264 through Cisco's OpenH264, loaded at runtime. //! //! Without the library only the "unavailable" paths run. To test encoding -//! and decoding, point `TSC_OPENH264_LIB` at Cisco's library (for example the +//! and decoding, point `VOELIN_OPENH264_LIB` at Cisco's library (for example the //! file the ignored `download_and_roundtrip` test fetches: -//! `cargo test -p tsc-media --test openh264 -- --ignored`). +//! `cargo test -p voelin-media --test openh264 -- --ignored`). #![cfg(feature = "openh264")] use std::path::PathBuf; -use tsc_media::capture::synthetic::{RECT_COLOR, SyntheticScreen}; -use tsc_media::codec::h264::{H264Profile, OpenH264}; -use tsc_media::{ +use voelin_media::capture::synthetic::{RECT_COLOR, SyntheticScreen}; +use voelin_media::codec::h264::{H264Profile, OpenH264}; +use voelin_media::{ Codec, Codecs, EncoderBackend, EncoderConfig, Error, VideoEncoder, VideoFrame, convert, }; @@ -100,8 +100,8 @@ fn roundtrip(library: OpenH264) { #[test] fn roundtrip_with_library_from_env() { - let Some(path) = std::env::var_os("TSC_OPENH264_LIB") else { - eprintln!("skipped: TSC_OPENH264_LIB is not set"); + let Some(path) = std::env::var_os("VOELIN_OPENH264_LIB") else { + eprintln!("skipped: VOELIN_OPENH264_LIB is not set"); return; }; roundtrip(OpenH264::load(PathBuf::from(path)).unwrap()); @@ -112,14 +112,14 @@ fn roundtrip_with_library_from_env() { #[tokio::test] #[ignore = "downloads from ciscobinary.openh264.org"] async fn download_and_roundtrip() { - if tsc_media::codec::h264::platform_library_name().is_none() { + if voelin_media::codec::h264::platform_library_name().is_none() { return; } - let dir = std::env::temp_dir().join(format!("tsc-media-openh264-{}", std::process::id())); - let library = tsc_media::codec::h264::download_openh264(&dir).await.unwrap(); + let dir = std::env::temp_dir().join(format!("voelin-media-openh264-{}", std::process::id())); + let library = voelin_media::codec::h264::download_openh264(&dir).await.unwrap(); assert!(library.path().starts_with(&dir)); // A second call reuses the verified file. - let again = tsc_media::codec::h264::download_openh264(&dir).await.unwrap(); + let again = voelin_media::codec::h264::download_openh264(&dir).await.unwrap(); assert_eq!(again, library); tokio::task::spawn_blocking(move || roundtrip(library)).await.unwrap(); std::fs::remove_dir_all(&dir).unwrap(); diff --git a/crates/tsc-media/tests/x11_capture.rs b/crates/voelin-media/tests/x11_capture.rs similarity index 97% rename from crates/tsc-media/tests/x11_capture.rs rename to crates/voelin-media/tests/x11_capture.rs index d0898d1..fd01de2 100644 --- a/crates/tsc-media/tests/x11_capture.rs +++ b/crates/voelin-media/tests/x11_capture.rs @@ -3,13 +3,13 @@ //! VP8 and back. //! //! Needs `DISPLAY` (e.g. `Xvfb :101 -screen 0 1280x720x24 & DISPLAY=:101 -//! cargo test -p tsc-media --test x11_capture`); skipped without it. +//! cargo test -p voelin-media --test x11_capture`); skipped without it. #![cfg(all(target_os = "linux", feature = "x11", feature = "vpx"))] use std::time::Duration; -use tsc_media::capture::x11::X11Capture; -use tsc_media::{ +use voelin_media::capture::x11::X11Capture; +use voelin_media::{ CaptureOptions, Codec, Codecs, EncoderConfig, FrameReceiver, ScreenCapture, SourceId, VideoFrame, convert, }; @@ -20,7 +20,7 @@ use x11rb::protocol::xproto::{ use x11rb::rust_connection::RustConnection; use x11rb::wrapper::ConnectionExt as _; -const TITLE: &str = "tsc-media-x11-test"; +const TITLE: &str = "voelin-media-x11-test"; const BACKGROUND: u32 = 0x202020; const WINDOW: u32 = 0x3060c0; const INNER: u32 = 0xf08020; diff --git a/crates/tsc-model/Cargo.toml b/crates/voelin-model/Cargo.toml similarity index 94% rename from crates/tsc-model/Cargo.toml rename to crates/voelin-model/Cargo.toml index f4bda65..d78b175 100644 --- a/crates/tsc-model/Cargo.toml +++ b/crates/voelin-model/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-model" +name = "voelin-model" version = "0.1.0" description = "UI-facing domain model shared by the client engine, gateway and UI (no IO)." edition.workspace = true diff --git a/crates/tsc-model/src/chat.rs b/crates/voelin-model/src/chat.rs similarity index 100% rename from crates/tsc-model/src/chat.rs rename to crates/voelin-model/src/chat.rs diff --git a/crates/tsc-model/src/lib.rs b/crates/voelin-model/src/lib.rs similarity index 100% rename from crates/tsc-model/src/lib.rs rename to crates/voelin-model/src/lib.rs diff --git a/crates/tsc-model/src/presence.rs b/crates/voelin-model/src/presence.rs similarity index 100% rename from crates/tsc-model/src/presence.rs rename to crates/voelin-model/src/presence.rs diff --git a/crates/tsc-model/src/server.rs b/crates/voelin-model/src/server.rs similarity index 100% rename from crates/tsc-model/src/server.rs rename to crates/voelin-model/src/server.rs diff --git a/crates/tsc-model/src/tree.rs b/crates/voelin-model/src/tree.rs similarity index 100% rename from crates/tsc-model/src/tree.rs rename to crates/voelin-model/src/tree.rs diff --git a/crates/tsc-observer/Cargo.toml b/crates/voelin-observer/Cargo.toml similarity index 81% rename from crates/tsc-observer/Cargo.toml rename to crates/voelin-observer/Cargo.toml index f9a9f62..67bf4c5 100644 --- a/crates/tsc-observer/Cargo.toml +++ b/crates/voelin-observer/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-observer" +name = "voelin-observer" version = "0.1.0" description = "Invisible presence and channel-chat relays over ServerQuery." edition.workspace = true @@ -12,8 +12,8 @@ publish.workspace = true thiserror = "2" tokio = { version = "1", features = ["macros", "rt", "sync", "time"] } tracing = "0.1" -tsc-model = { path = "../tsc-model" } -tsc-query = { path = "../tsc-query" } +voelin-model = { path = "../voelin-model" } +voelin-query = { path = "../voelin-query" } [dev-dependencies] tokio = { version = "1", features = ["macros", "rt-multi-thread", "test-util"] } diff --git a/crates/tsc-observer/src/convert.rs b/crates/voelin-observer/src/convert.rs similarity index 96% rename from crates/tsc-observer/src/convert.rs rename to crates/voelin-observer/src/convert.rs index b74e3c6..d1cb412 100644 --- a/crates/tsc-observer/src/convert.rs +++ b/crates/voelin-observer/src/convert.rs @@ -1,7 +1,7 @@ //! Query rows and events to model types. -use tsc_model::{ChannelInfo, ChatMessage, ChatTarget, ClientInfo, PresenceDelta}; -use tsc_query::{Notification, Row}; +use voelin_model::{ChannelInfo, ChatMessage, ChatTarget, ClientInfo, PresenceDelta}; +use voelin_query::{Notification, Row}; /// From a `channellist -topic -flags -voice -limits` row, or the fields of /// `notifychannelcreated`. @@ -135,7 +135,7 @@ pub fn is_text_message(n: &Notification, now_ms: i64) -> Option { #[cfg(test)] mod tests { - use tsc_query::{Line, parse_line}; + use voelin_query::{Line, parse_line}; use super::*; @@ -149,7 +149,7 @@ mod tests { #[test] fn clientlist_row() { // Captured from TeamSpeak 6.0.0-beta13.1 (clientlist -uid -away -voice -groups -country). - let row = &tsc_query::parse_rows( + let row = &voelin_query::parse_rows( "clid=7 cid=1 client_database_id=4 client_nickname=sample client_type=0 client_away=0 \ client_away_message client_flag_talking=0 client_input_muted=1 client_output_muted=0 \ client_unique_identifier=hSC9DusMo3MJwDuA8MuvZBaHfb\\/h77N9WZtYskAFlG0= \ @@ -166,7 +166,7 @@ mod tests { #[test] fn channellist_row() { - let row = &tsc_query::parse_rows( + let row = &voelin_query::parse_rows( "cid=1 pid=0 channel_order=0 channel_name=Default\\sChannel channel_topic=t \ channel_flag_default=1 channel_flag_password=0 channel_maxclients=-1 \ channel_needed_subscribe_power=0 channel_needed_talk_power=5", diff --git a/crates/tsc-observer/src/lib.rs b/crates/voelin-observer/src/lib.rs similarity index 89% rename from crates/tsc-observer/src/lib.rs rename to crates/voelin-observer/src/lib.rs index 2cb1510..efe1e70 100644 --- a/crates/tsc-observer/src/lib.rs +++ b/crates/voelin-observer/src/lib.rs @@ -1,7 +1,7 @@ //! Invisible presence and channel-chat relays over ServerQuery. //! //! Query clients do not show up in normal clients' channel trees. The -//! [`Observer`] keeps a live [`Presence`](tsc_model::Presence) of a server +//! [`Observer`] keeps a live [`Presence`](voelin_model::Presence) of a server //! from one query session. A [`RelayPool`] puts one query session into each //! channel whose chat someone wants to read or write without joining it. //! diff --git a/crates/tsc-observer/src/observer.rs b/crates/voelin-observer/src/observer.rs similarity index 96% rename from crates/tsc-observer/src/observer.rs rename to crates/voelin-observer/src/observer.rs index 5b6f589..2dcb7c7 100644 --- a/crates/tsc-observer/src/observer.rs +++ b/crates/voelin-observer/src/observer.rs @@ -6,8 +6,8 @@ use std::time::Duration; use tokio::sync::{broadcast, watch}; use tokio::time::{Instant, sleep, sleep_until}; use tracing::{debug, info, warn}; -use tsc_model::{ChatMessage, Presence, PresenceDelta, PresenceSnapshot}; -use tsc_query::{Command, Connect, Notification, QueryClient}; +use voelin_model::{ChatMessage, Presence, PresenceDelta, PresenceSnapshot}; +use voelin_query::{Command, Connect, Notification, QueryClient}; use crate::convert::{ channel_from_row, client_from_row, delta_from_notification, is_text_message, update_channel, @@ -102,7 +102,7 @@ async fn run( } /// Read the full state. -async fn load(client: &QueryClient) -> tsc_query::Result { +async fn load(client: &QueryClient) -> voelin_query::Result { let info = client.send(&Command::new("serverinfo")).await?; let channels = client .send(&Command::new("channellist").flag("topic").flag("flags").flag("voice").flag("limits")) @@ -139,7 +139,7 @@ async fn session( config: &ObserverConfig, presence: &RwLock, events: &broadcast::Sender, -) -> tsc_query::Result<()> { +) -> voelin_query::Result<()> { let (client, mut notifications) = QueryClient::connect(&config.connect).await?; if notifications.is_some() { for event in ["server", "channel"] { diff --git a/crates/tsc-observer/src/relay.rs b/crates/voelin-observer/src/relay.rs similarity index 89% rename from crates/tsc-observer/src/relay.rs rename to crates/voelin-observer/src/relay.rs index edf23cc..c980869 100644 --- a/crates/tsc-observer/src/relay.rs +++ b/crates/voelin-observer/src/relay.rs @@ -11,8 +11,8 @@ use std::sync::Arc; use tokio::sync::{Mutex, broadcast, mpsc}; use tokio::task::JoinHandle; use tracing::{debug, info, warn}; -use tsc_model::{ChannelId, ChatMessage, ChatTarget, relay_text, split_message}; -use tsc_query::{Command, Connect, Notification, QueryClient}; +use voelin_model::{ChannelId, ChatMessage, ChatTarget, relay_text, split_message}; +use voelin_query::{Command, Connect, Notification, QueryClient}; use crate::convert::is_text_message; @@ -82,21 +82,21 @@ impl RelayPool { } /// Start relaying a channel (no-op if already open). - pub async fn open(&self, channel: ChannelId) -> tsc_query::Result<()> { + pub async fn open(&self, channel: ChannelId) -> voelin_query::Result<()> { let mut sessions = self.sessions.lock().await; if sessions.get(&channel).is_some_and(|s| !s.task.is_finished()) { return Ok(()); } let (client, notifications) = QueryClient::connect(&self.config.connect).await?; let Some(notifications) = notifications else { - return Err(tsc_query::Error::Unsupported("relays need a transport with events")); + return Err(voelin_query::Error::Unsupported("relays need a transport with events")); }; let own_id = client.own_client_id().await?; set_nickname(&client, &format!("{} {channel}", self.config.nickname)).await; match client.send(&Command::new("clientmove").arg("clid", own_id).arg("cid", channel)).await { // Query clients start in the default channel. - Err(tsc_query::Error::Query(e)) if e.id == ERR_ALREADY_MEMBER => {} + Err(voelin_query::Error::Query(e)) if e.id == ERR_ALREADY_MEMBER => {} other => { other?; } @@ -127,11 +127,16 @@ impl RelayPool { } /// Post `text` in `channel` on behalf of `nick`, opening a relay if needed. - pub async fn send(&self, channel: ChannelId, nick: &str, text: &str) -> tsc_query::Result<()> { + pub async fn send( + &self, + channel: ChannelId, + nick: &str, + text: &str, + ) -> voelin_query::Result<()> { self.open(channel).await?; let client = match self.sessions.lock().await.get(&channel) { Some(s) => s.client.clone(), - None => return Err(tsc_query::Error::Closed), + None => return Err(voelin_query::Error::Closed), }; let full = relay_text(&self.config.format, nick, text); for part in split_message(&full, MAX_MESSAGE_BYTES) { @@ -155,7 +160,7 @@ async fn set_nickname(client: &QueryClient, base: &str) { let nickname = if attempt == 1 { base.to_string() } else { format!("{base} ({attempt})") }; match client.send(&Command::new("clientupdate").arg("client_nickname", &nickname)).await { Ok(_) => return, - Err(tsc_query::Error::Query(e)) if e.id == ERR_NICKNAME_IN_USE => continue, + Err(voelin_query::Error::Query(e)) if e.id == ERR_NICKNAME_IN_USE => continue, Err(e) => { warn!(%e, %nickname, "could not set relay nickname"); return; diff --git a/crates/tsc-platform/Cargo.toml b/crates/voelin-platform/Cargo.toml similarity index 98% rename from crates/tsc-platform/Cargo.toml rename to crates/voelin-platform/Cargo.toml index be42d8a..d55c6cc 100644 --- a/crates/tsc-platform/Cargo.toml +++ b/crates/voelin-platform/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-platform" +name = "voelin-platform" version = "0.1.0" description = "Desktop integration: global push-to-talk hotkeys, notifications, app directories, crash reports and third-party notices." edition.workspace = true diff --git a/crates/tsc-platform/src/crash.rs b/crates/voelin-platform/src/crash.rs similarity index 95% rename from crates/tsc-platform/src/crash.rs rename to crates/voelin-platform/src/crash.rs index 2a70a27..ac87c8b 100644 --- a/crates/tsc-platform/src/crash.rs +++ b/crates/voelin-platform/src/crash.rs @@ -12,10 +12,10 @@ //! includes (e.g. a server address); they stay on the device. //! //! ```no_run -//! let dir = tsc_platform::crash::default_dir(); -//! tsc_platform::crash::set_app_version(env!("CARGO_PKG_VERSION")); -//! tsc_platform::crash::install(&dir, true); // the user's opt-in setting -//! for report in tsc_platform::crash::pending_reports()? { +//! let dir = voelin_platform::crash::default_dir(); +//! voelin_platform::crash::set_app_version(env!("CARGO_PKG_VERSION")); +//! voelin_platform::crash::install(&dir, true); // the user's opt-in setting +//! for report in voelin_platform::crash::pending_reports()? { //! println!("{}: {}", report.path.display(), report.summary); //! } //! # Ok::<(), std::io::Error>(()) @@ -41,8 +41,8 @@ pub const DEFAULT_KEEP: usize = 10; const PREFIX: &str = "crash-"; const SUFFIX: &str = ".txt"; -/// `/crash-reports` (`%LOCALAPPDATA%\tsc\crash-reports` on -/// Windows, `~/.local/state/tsc/crash-reports` on Linux). +/// `/crash-reports` (`%LOCALAPPDATA%\voelin\crash-reports` on +/// Windows, `~/.local/state/voelin/crash-reports` on Linux). pub fn default_dir() -> PathBuf { paths::state_dir().join(DIR_NAME) } @@ -101,12 +101,12 @@ pub fn install(dir: impl Into, enabled: bool) { }); } -/// Panic if the `TSC_TEST_CRASH` environment variable is set, so testers can +/// Panic if the `VOELIN_TEST_CRASH` environment variable is set, so testers can /// check crash reports with a release build (docs/testing/manual-matrix.md). /// Call right after [`install`]. pub fn test_crash_if_requested() { - if std::env::var_os("TSC_TEST_CRASH").is_some_and(|v| !v.is_empty()) { - panic!("test crash requested with TSC_TEST_CRASH"); + if std::env::var_os("VOELIN_TEST_CRASH").is_some_and(|v| !v.is_empty()) { + panic!("test crash requested with VOELIN_TEST_CRASH"); } } @@ -449,7 +449,7 @@ mod tests { #[test] fn missing_dir_has_no_reports() { - let dir = std::env::temp_dir().join(format!("tsc-crash-missing-{}", std::process::id())); + let dir = std::env::temp_dir().join(format!("voelin-crash-missing-{}", std::process::id())); assert!(reports_in(&dir).unwrap().is_empty()); assert_eq!(clear_in(&dir).unwrap(), 0); } diff --git a/crates/tsc-platform/src/hotkey/key.rs b/crates/voelin-platform/src/hotkey/key.rs similarity index 100% rename from crates/tsc-platform/src/hotkey/key.rs rename to crates/voelin-platform/src/hotkey/key.rs diff --git a/crates/tsc-platform/src/hotkey/mod.rs b/crates/voelin-platform/src/hotkey/mod.rs similarity index 100% rename from crates/tsc-platform/src/hotkey/mod.rs rename to crates/voelin-platform/src/hotkey/mod.rs diff --git a/crates/tsc-platform/src/hotkey/portal.rs b/crates/voelin-platform/src/hotkey/portal.rs similarity index 100% rename from crates/tsc-platform/src/hotkey/portal.rs rename to crates/voelin-platform/src/hotkey/portal.rs diff --git a/crates/tsc-platform/src/hotkey/tracker.rs b/crates/voelin-platform/src/hotkey/tracker.rs similarity index 100% rename from crates/tsc-platform/src/hotkey/tracker.rs rename to crates/voelin-platform/src/hotkey/tracker.rs diff --git a/crates/tsc-platform/src/hotkey/windows.rs b/crates/voelin-platform/src/hotkey/windows.rs similarity index 99% rename from crates/tsc-platform/src/hotkey/windows.rs rename to crates/voelin-platform/src/hotkey/windows.rs index 4ec8591..1f41e5d 100644 --- a/crates/tsc-platform/src/hotkey/windows.rs +++ b/crates/voelin-platform/src/hotkey/windows.rs @@ -149,7 +149,7 @@ impl HookBackend { { let tracker = tracker.clone(); thread::Builder::new() - .name("tsc-hotkeys-hook".into()) + .name("voelin-hotkeys-hook".into()) .spawn(move || hook_thread(tracker, ready_tx)) .map_err(|e| Error::Backend(format!("keyboard hook: {e}")))?; } diff --git a/crates/tsc-platform/src/hotkey/x11.rs b/crates/voelin-platform/src/hotkey/x11.rs similarity index 99% rename from crates/tsc-platform/src/hotkey/x11.rs rename to crates/voelin-platform/src/hotkey/x11.rs index e587ae4..3f07da2 100644 --- a/crates/tsc-platform/src/hotkey/x11.rs +++ b/crates/voelin-platform/src/hotkey/x11.rs @@ -122,7 +122,7 @@ impl X11Backend { { let (conn, tracker, stop) = (conn.clone(), tracker.clone(), stop.clone()); thread::Builder::new() - .name("tsc-hotkeys-x11".into()) + .name("voelin-hotkeys-x11".into()) .spawn(move || event_loop(&conn, keymap, &tracker, &stop)) .map_err(|e| Error::Backend(format!("X11: {e}")))?; } diff --git a/crates/tsc-platform/src/lib.rs b/crates/voelin-platform/src/lib.rs similarity index 76% rename from crates/tsc-platform/src/lib.rs rename to crates/voelin-platform/src/lib.rs index a2a5468..aa406ff 100644 --- a/crates/tsc-platform/src/lib.rs +++ b/crates/voelin-platform/src/lib.rs @@ -17,11 +17,11 @@ pub mod paths; pub use hotkey::{BackendKind, Hotkey, HotkeyEvent, HotkeyEvents, HotkeyManager, Key, Modifiers}; pub use notify::{Notification, notify}; -/// Application id: desktop file, icon, portal registrations. A placeholder -/// until the product has a name. -pub const APP_ID: &str = "io.github.faumaray.TsClient"; -/// Name shown in notifications. A placeholder until the product has a name. -pub const APP_NAME: &str = "TS Client"; +/// Application id: desktop file, icon, portal registrations. It cannot change +/// once published on Flathub or Google Play. +pub const APP_ID: &str = "io.github.faumaray.Voelin"; +/// Name shown in notifications and window titles. +pub const APP_NAME: &str = "Voelin"; #[derive(Debug, thiserror::Error)] pub enum Error { diff --git a/crates/tsc-platform/src/notices.rs b/crates/voelin-platform/src/notices.rs similarity index 94% rename from crates/tsc-platform/src/notices.rs rename to crates/voelin-platform/src/notices.rs index 53f43a7..b590c92 100644 --- a/crates/tsc-platform/src/notices.rs +++ b/crates/voelin-platform/src/notices.rs @@ -13,7 +13,7 @@ pub fn text() -> &'static str { } /// Attribution the OpenH264 license asks for wherever H.264 can be enabled -/// (the same text as `tsc_media::codec::h264::OPENH264_ATTRIBUTION`). +/// (the same text as `voelin_media::codec::h264::OPENH264_ATTRIBUTION`). pub const OPENH264_ATTRIBUTION: &str = "OpenH264 Video Codec provided by Cisco Systems, Inc."; #[cfg(test)] diff --git a/crates/tsc-platform/src/notify.rs b/crates/voelin-platform/src/notify.rs similarity index 100% rename from crates/tsc-platform/src/notify.rs rename to crates/voelin-platform/src/notify.rs diff --git a/crates/tsc-platform/src/paths.rs b/crates/voelin-platform/src/paths.rs similarity index 71% rename from crates/tsc-platform/src/paths.rs rename to crates/voelin-platform/src/paths.rs index 1ceac52..f24612e 100644 --- a/crates/tsc-platform/src/paths.rs +++ b/crates/voelin-platform/src/paths.rs @@ -1,6 +1,6 @@ //! Where the app keeps its files. //! -//! `/tsc` for the platform's data, config, cache and state bases (XDG +//! `/voelin` for the platform's data, config, cache and state bases (XDG //! on Linux, where Flatpak points them into `~/.var/app//`; Known //! Folders on Windows: `%APPDATA%` for data and config, `%LOCALAPPDATA%` for //! cache and state). Each can be overridden with an environment variable, @@ -9,8 +9,8 @@ use std::path::{Path, PathBuf}; /// Directory name under each base; the desktop app's store already lives in -/// `/tsc`. -pub const APP_DIR: &str = "tsc"; +/// `/voelin`. +pub const APP_DIR: &str = "voelin"; fn resolve(var: &str, base: Option) -> PathBuf { match std::env::var_os(var).filter(|v| !v.is_empty()) { @@ -19,24 +19,24 @@ fn resolve(var: &str, base: Option) -> PathBuf { } } -/// Identities, bookmarks, chat history. `TSC_DATA_DIR` overrides. +/// Identities, bookmarks, chat history. `VOELIN_DATA_DIR` overrides. pub fn data_dir() -> PathBuf { - resolve("TSC_DATA_DIR", dirs::data_dir()) + resolve("VOELIN_DATA_DIR", dirs::data_dir()) } -/// Settings files. `TSC_CONFIG_DIR` overrides. +/// Settings files. `VOELIN_CONFIG_DIR` overrides. pub fn config_dir() -> PathBuf { - resolve("TSC_CONFIG_DIR", dirs::config_dir()) + resolve("VOELIN_CONFIG_DIR", dirs::config_dir()) } -/// Disposable files (avatars, downloaded codecs). `TSC_CACHE_DIR` overrides. +/// Disposable files (avatars, downloaded codecs). `VOELIN_CACHE_DIR` overrides. pub fn cache_dir() -> PathBuf { - resolve("TSC_CACHE_DIR", dirs::cache_dir()) + resolve("VOELIN_CACHE_DIR", dirs::cache_dir()) } -/// Logs and crash reports. `TSC_STATE_DIR` overrides. +/// Logs and crash reports. `VOELIN_STATE_DIR` overrides. pub fn state_dir() -> PathBuf { - resolve("TSC_STATE_DIR", dirs::state_dir().or_else(dirs::data_local_dir)) + resolve("VOELIN_STATE_DIR", dirs::state_dir().or_else(dirs::data_local_dir)) } /// Create `dir` and its parents if needed. @@ -86,10 +86,10 @@ mod tests { assert!(dir.is_absolute() || dir.starts_with("."), "{}", dir.display()); } assert_eq!( - resolve("TSC_TEST_UNSET_VARIABLE", Some("/base".into())), - Path::new("/base/tsc") + resolve("VOELIN_TEST_UNSET_VARIABLE", Some("/base".into())), + Path::new("/base/voelin") ); - assert_eq!(resolve("TSC_TEST_UNSET_VARIABLE", None), Path::new("./tsc")); + assert_eq!(resolve("VOELIN_TEST_UNSET_VARIABLE", None), Path::new("./voelin")); // PATH is always set: stands in for an override. let path = std::env::var_os("PATH").unwrap(); assert_eq!(resolve("PATH", Some("/base".into())), PathBuf::from(path)); @@ -98,7 +98,7 @@ mod tests { #[test] fn ensure_creates() { let dir = - std::env::temp_dir().join(format!("tsc-platform-{}", std::process::id())).join("a"); + std::env::temp_dir().join(format!("voelin-platform-{}", std::process::id())).join("a"); assert_eq!(ensure(&dir).unwrap(), dir); assert!(dir.is_dir()); std::fs::remove_dir_all(dir.parent().unwrap()).unwrap(); diff --git a/crates/tsc-platform/tests/crash.rs b/crates/voelin-platform/tests/crash.rs similarity index 90% rename from crates/tsc-platform/tests/crash.rs rename to crates/voelin-platform/tests/crash.rs index 739cd60..67a26eb 100644 --- a/crates/tsc-platform/tests/crash.rs +++ b/crates/voelin-platform/tests/crash.rs @@ -4,10 +4,10 @@ use std::path::PathBuf; use std::thread; -use tsc_platform::crash; +use voelin_platform::crash; fn temp_dir(name: &str) -> PathBuf { - let dir = std::env::temp_dir().join(format!("tsc-crash-{name}-{}", std::process::id())); + let dir = std::env::temp_dir().join(format!("voelin-crash-{name}-{}", std::process::id())); let _ = std::fs::remove_dir_all(&dir); dir } @@ -85,14 +85,14 @@ fn panic_hook_writes_reports() { } /// Runs only as the child of `test_crash_in_child_process`: a start with -/// `TSC_TEST_CRASH` set, as a tester would do with the app. +/// `VOELIN_TEST_CRASH` set, as a tester would do with the app. #[test] fn child_process_crash() { - let Some(dir) = std::env::var_os("TSC_CRASH_CHILD_DIR") else { return }; + let Some(dir) = std::env::var_os("VOELIN_CRASH_CHILD_DIR") else { return }; crash::set_app_version("child"); crash::install(PathBuf::from(dir), true); crash::test_crash_if_requested(); - unreachable!("TSC_TEST_CRASH is set"); + unreachable!("VOELIN_TEST_CRASH is set"); } #[test] @@ -101,8 +101,8 @@ fn test_crash_in_child_process() { // Captured: the child's "FAILED" would look like a failure of this run. let output = std::process::Command::new(std::env::current_exe().unwrap()) .args(["--exact", "child_process_crash", "--test-threads=1"]) - .env("TSC_CRASH_CHILD_DIR", &dir) - .env("TSC_TEST_CRASH", "1") + .env("VOELIN_CRASH_CHILD_DIR", &dir) + .env("VOELIN_TEST_CRASH", "1") .output() .unwrap(); let log = String::from_utf8_lossy(&output.stderr); @@ -110,7 +110,7 @@ fn test_crash_in_child_process() { // The next start finds the report. let reports = crash::reports_in(&dir).unwrap(); assert_eq!(reports.len(), 1, "{reports:?}"); - assert_eq!(reports[0].summary, "test crash requested with TSC_TEST_CRASH"); + assert_eq!(reports[0].summary, "test crash requested with VOELIN_TEST_CRASH"); let text = std::fs::read_to_string(&reports[0].path).unwrap(); assert!(text.contains("Version: child"), "{text}"); std::fs::remove_dir_all(&dir).unwrap(); diff --git a/crates/tsc-platform/tests/x11.rs b/crates/voelin-platform/tests/x11.rs similarity index 93% rename from crates/tsc-platform/tests/x11.rs rename to crates/voelin-platform/tests/x11.rs index 15d12d9..9a74d7d 100644 --- a/crates/tsc-platform/tests/x11.rs +++ b/crates/voelin-platform/tests/x11.rs @@ -1,6 +1,6 @@ //! Global hotkeys against a real X server, typing through XTEST. //! -//! Needs `TSC_X11_TEST_DISPLAY` naming a display to use (e.g. an Xvfb +//! Needs `VOELIN_X11_TEST_DISPLAY` naming a display to use (e.g. an Xvfb //! started for the test, as CI does); skipped otherwise. #![cfg(all(unix, not(target_os = "macos"), feature = "x11"))] @@ -8,7 +8,7 @@ use std::time::Duration; use tokio::time::timeout; -use tsc_platform::{HotkeyEvent, HotkeyEvents, HotkeyManager}; +use voelin_platform::{HotkeyEvent, HotkeyEvents, HotkeyManager}; use x11rb::connection::Connection; use x11rb::protocol::xproto::{ BUTTON_PRESS_EVENT, BUTTON_RELEASE_EVENT, ConnectionExt as _, KEY_PRESS_EVENT, @@ -68,8 +68,8 @@ const XK_A: u32 = 0x61; #[tokio::test] async fn xinput2_press_and_release() { - let Ok(display) = std::env::var("TSC_X11_TEST_DISPLAY") else { - eprintln!("TSC_X11_TEST_DISPLAY not set, skipping"); + let Ok(display) = std::env::var("VOELIN_X11_TEST_DISPLAY") else { + eprintln!("VOELIN_X11_TEST_DISPLAY not set, skipping"); return; }; let mut manager = HotkeyManager::x11(&display).unwrap(); diff --git a/crates/tsc-query/Cargo.toml b/crates/voelin-query/Cargo.toml similarity index 97% rename from crates/tsc-query/Cargo.toml rename to crates/voelin-query/Cargo.toml index 37dcdb3..ab03299 100644 --- a/crates/tsc-query/Cargo.toml +++ b/crates/voelin-query/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-query" +name = "voelin-query" version = "0.1.0" description = "TeamSpeak ServerQuery client: raw TCP, SSH and HTTP WebQuery transports." edition.workspace = true diff --git a/crates/tsc-query/src/client.rs b/crates/voelin-query/src/client.rs similarity index 100% rename from crates/tsc-query/src/client.rs rename to crates/voelin-query/src/client.rs diff --git a/crates/tsc-query/src/codec.rs b/crates/voelin-query/src/codec.rs similarity index 99% rename from crates/tsc-query/src/codec.rs rename to crates/voelin-query/src/codec.rs index ee25ba6..3f21244 100644 --- a/crates/tsc-query/src/codec.rs +++ b/crates/voelin-query/src/codec.rs @@ -185,7 +185,7 @@ pub fn parse_line(line: &str) -> Line { /// A command to send, built with escaping applied. /// /// ``` -/// use tsc_query::Command; +/// use voelin_query::Command; /// let cmd = Command::new("sendtextmessage").arg("targetmode", 3).arg("msg", "hi there"); /// assert_eq!(cmd.to_line(), "sendtextmessage targetmode=3 msg=hi\\sthere"); /// ``` diff --git a/crates/tsc-query/src/http.rs b/crates/voelin-query/src/http.rs similarity index 100% rename from crates/tsc-query/src/http.rs rename to crates/voelin-query/src/http.rs diff --git a/crates/tsc-query/src/lib.rs b/crates/voelin-query/src/lib.rs similarity index 100% rename from crates/tsc-query/src/lib.rs rename to crates/voelin-query/src/lib.rs diff --git a/crates/tsc-query/src/line.rs b/crates/voelin-query/src/line.rs similarity index 100% rename from crates/tsc-query/src/line.rs rename to crates/voelin-query/src/line.rs diff --git a/crates/tsc-query/src/ssh.rs b/crates/voelin-query/src/ssh.rs similarity index 100% rename from crates/tsc-query/src/ssh.rs rename to crates/voelin-query/src/ssh.rs diff --git a/crates/tsc-store/Cargo.toml b/crates/voelin-store/Cargo.toml similarity index 96% rename from crates/tsc-store/Cargo.toml rename to crates/voelin-store/Cargo.toml index 24fb376..94f9b2b 100644 --- a/crates/tsc-store/Cargo.toml +++ b/crates/voelin-store/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-store" +name = "voelin-store" version = "0.1.0" description = "Local persistence: identities, bookmarks, settings, chat cache and secrets." edition.workspace = true diff --git a/crates/tsc-store/src/lib.rs b/crates/voelin-store/src/lib.rs similarity index 100% rename from crates/tsc-store/src/lib.rs rename to crates/voelin-store/src/lib.rs diff --git a/crates/tsc-store/src/secrets.rs b/crates/voelin-store/src/secrets.rs similarity index 100% rename from crates/tsc-store/src/secrets.rs rename to crates/voelin-store/src/secrets.rs diff --git a/crates/tsc-store/src/store.rs b/crates/voelin-store/src/store.rs similarity index 98% rename from crates/tsc-store/src/store.rs rename to crates/voelin-store/src/store.rs index 8b43bc2..10a6c17 100644 --- a/crates/tsc-store/src/store.rs +++ b/crates/voelin-store/src/store.rs @@ -89,7 +89,7 @@ pub struct Bookmark { pub gateway_url: Option, /// Own ServerQuery credentials (the password is kept in [`crate::Secrets`]). pub query: Option, - /// Signed client version to present (`tsctl versions` spec), `None` for the default. + /// Signed client version to present (`voelinctl versions` spec), `None` for the default. pub client_version: Option, } @@ -432,7 +432,7 @@ mod tests { #[test] fn reopen_keeps_data_and_schema() { - let dir = std::env::temp_dir().join(format!("tsc-store-{}", std::process::id())); + let dir = std::env::temp_dir().join(format!("voelin-store-{}", std::process::id())); let path = dir.join("client.db"); { let store = Store::open(&path).unwrap(); diff --git a/crates/tsc-stream/Cargo.toml b/crates/voelin-stream/Cargo.toml similarity index 97% rename from crates/tsc-stream/Cargo.toml rename to crates/voelin-stream/Cargo.toml index 1464d8b..04b5e1d 100644 --- a/crates/tsc-stream/Cargo.toml +++ b/crates/voelin-stream/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-stream" +name = "voelin-stream" version = "0.1.0" description = "TeamSpeak 6 streams: signalling commands, JSON signal messages and WebRTC peers (str0m)." edition.workspace = true diff --git a/crates/tsc-stream/src/lib.rs b/crates/voelin-stream/src/lib.rs similarity index 100% rename from crates/tsc-stream/src/lib.rs rename to crates/voelin-stream/src/lib.rs diff --git a/crates/tsc-stream/src/peer.rs b/crates/voelin-stream/src/peer.rs similarity index 100% rename from crates/tsc-stream/src/peer.rs rename to crates/voelin-stream/src/peer.rs diff --git a/crates/tsc-stream/src/proto.rs b/crates/voelin-stream/src/proto.rs similarity index 100% rename from crates/tsc-stream/src/proto.rs rename to crates/voelin-stream/src/proto.rs diff --git a/crates/tsc-stream/src/session.rs b/crates/voelin-stream/src/session.rs similarity index 100% rename from crates/tsc-stream/src/session.rs rename to crates/voelin-stream/src/session.rs diff --git a/crates/tsc-stream/src/signal.rs b/crates/voelin-stream/src/signal.rs similarity index 100% rename from crates/tsc-stream/src/signal.rs rename to crates/voelin-stream/src/signal.rs diff --git a/crates/tsc-stream/src/source.rs b/crates/voelin-stream/src/source.rs similarity index 96% rename from crates/tsc-stream/src/source.rs rename to crates/voelin-stream/src/source.rs index 23bb948..69caa57 100644 --- a/crates/tsc-stream/src/source.rs +++ b/crates/voelin-stream/src/source.rs @@ -1,8 +1,8 @@ //! Where a streamer's encoded frames come from. //! -//! [`FrameSource`] is the seam between capture/encoding (`tsc-media`) and the +//! [`FrameSource`] is the seam between capture/encoding (`voelin-media`) and the //! stream sessions. [`SyntheticSource`] produces decodable placeholder media -//! without any encoder, for tests and `tsctl stream start --synthetic`. +//! without any encoder, for tests and `voelinctl stream start --synthetic`. use std::sync::Arc; use std::time::{Duration, Instant}; diff --git a/crates/tsc-stream/src/stun.rs b/crates/voelin-stream/src/stun.rs similarity index 100% rename from crates/tsc-stream/src/stun.rs rename to crates/voelin-stream/src/stun.rs diff --git a/crates/tsc-stream/tests/browser_interop.rs b/crates/voelin-stream/tests/browser_interop.rs similarity index 95% rename from crates/tsc-stream/tests/browser_interop.rs rename to crates/voelin-stream/tests/browser_interop.rs index 2d0cf13..43a58eb 100644 --- a/crates/tsc-stream/tests/browser_interop.rs +++ b/crates/voelin-stream/tests/browser_interop.rs @@ -2,7 +2,7 @@ //! other peer, driven by `tests/interop/browser-peer.cjs` over stdin/stdout. //! No TeamSpeak server is involved; SDP goes straight between the peers. //! -//! Runs only with `TSC_INTEROP=1` (see `tests/interop/README.md`). +//! Runs only with `VOELIN_INTEROP=1` (see `tests/interop/README.md`). use std::path::PathBuf; use std::process::Stdio; @@ -12,12 +12,12 @@ use serde_json::{Value, json}; use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader, Lines}; use tokio::process::{Child, ChildStdin, ChildStdout, Command}; use tokio::time::timeout; -use tsc_stream::{ +use voelin_stream::{ Codec, FrameSource, MediaKind, Peer, PeerConfig, PeerEvent, Signal, SyntheticSource, }; fn enabled() -> bool { - std::env::var("TSC_INTEROP").is_ok_and(|v| v == "1") + std::env::var("VOELIN_INTEROP").is_ok_and(|v| v == "1") } /// The Node.js side (headless Chromium). @@ -33,7 +33,7 @@ impl Browser { .join("../../tests/interop/browser-peer.cjs") .canonicalize() .expect("tests/interop/browser-peer.cjs"); - let node = std::env::var("TSC_NODE").unwrap_or_else(|_| "node".into()); + let node = std::env::var("VOELIN_NODE").unwrap_or_else(|_| "node".into()); let mut command = Command::new(node); command .arg(script) @@ -47,7 +47,7 @@ impl Browser { { command.env("NODE_PATH", String::from_utf8_lossy(&out.stdout).trim()); } - let mut child = command.spawn().expect("cannot start node (set TSC_NODE)"); + let mut child = command.spawn().expect("cannot start node (set VOELIN_NODE)"); let stdin = child.stdin.take().unwrap(); let stdout = BufReader::new(child.stdout.take().unwrap()).lines(); let mut browser = Self { _child: child, stdin, stdout }; @@ -99,7 +99,7 @@ async fn wait_connected(peer: &mut Peer) { #[tokio::test(flavor = "multi_thread")] async fn rust_streams_to_browser() { if !enabled() { - eprintln!("skipped: set TSC_INTEROP=1 (needs node, Playwright and Chromium)"); + eprintln!("skipped: set VOELIN_INTEROP=1 (needs node, Playwright and Chromium)"); return; } let _ = tracing_subscriber::fmt().with_env_filter("warn").with_test_writer().try_init(); @@ -173,7 +173,7 @@ async fn fake_stun_server() -> std::net::SocketAddr { #[tokio::test(flavor = "multi_thread")] async fn trickled_candidates_reach_browser() { if !enabled() { - eprintln!("skipped: set TSC_INTEROP=1 (needs node, Playwright and Chromium)"); + eprintln!("skipped: set VOELIN_INTEROP=1 (needs node, Playwright and Chromium)"); return; } let mut browser = Browser::start().await; @@ -270,7 +270,7 @@ async fn receive(peer: &mut Peer, limit: Duration, enough: usize) -> Received { #[tokio::test(flavor = "multi_thread")] async fn browser_streams_to_rust() { if !enabled() { - eprintln!("skipped: set TSC_INTEROP=1 (needs node, Playwright and Chromium)"); + eprintln!("skipped: set VOELIN_INTEROP=1 (needs node, Playwright and Chromium)"); return; } let _ = tracing_subscriber::fmt().with_env_filter("warn").with_test_writer().try_init(); diff --git a/crates/tsc-stream/tests/live_ts6.rs b/crates/voelin-stream/tests/live_ts6.rs similarity index 96% rename from crates/tsc-stream/tests/live_ts6.rs rename to crates/voelin-stream/tests/live_ts6.rs index f285632..a84ce81 100644 --- a/crates/tsc-stream/tests/live_ts6.rs +++ b/crates/voelin-stream/tests/live_ts6.rs @@ -1,27 +1,27 @@ //! A full stream between two clients through the TeamSpeak 6 dev server //! (dev/docker-compose.yml): `setupstream`, `joinstreamrequest`, //! `respondjoinstreamrequest` with our offer, `streamsignaling` with the answer, -//! then media over loopback. Runs only with `TSC_LIVE=1`. +//! then media over loopback. Runs only with `VOELIN_LIVE=1`. use std::time::Duration; use futures::prelude::*; use tokio::sync::{mpsc, oneshot}; use tokio::time::timeout; -use tsc_stream::{ - Frequency, LeaveReason, MediaKind, MediaTime, Peer, PeerConfig, PeerEvent, Signal, - StreamNotification, StreamSetup, proto, -}; use tsclientlib::prelude::*; use tsclientlib::{ClientId, Connection, DisconnectOptions, MessageHandle, StreamItem}; use tsproto_packets::packets::OutCommand; +use voelin_stream::{ + Frequency, LeaveReason, MediaKind, MediaTime, Peer, PeerConfig, PeerEvent, Signal, + StreamNotification, StreamSetup, proto, +}; fn live() -> bool { - std::env::var("TSC_LIVE").is_ok_and(|v| v == "1") + std::env::var("VOELIN_LIVE").is_ok_and(|v| v == "1") } fn ts6_addr() -> String { - std::env::var("TSC_TS6_ADDR").unwrap_or_else(|_| "127.0.0.1:9988".into()) + std::env::var("VOELIN_TS6_ADDR").unwrap_or_else(|_| "127.0.0.1:9988".into()) } type Reply = oneshot::Sender>; @@ -114,7 +114,7 @@ impl Client { #[tokio::test(flavor = "multi_thread")] async fn stream_through_ts6_server() { if !live() { - eprintln!("skipped: set TSC_LIVE=1 with the dev servers running"); + eprintln!("skipped: set VOELIN_LIVE=1 with the dev servers running"); return; } let _ = tracing_subscriber::fmt().with_env_filter("warn").with_test_writer().try_init(); diff --git a/crates/tsc-stream/tests/loopback.rs b/crates/voelin-stream/tests/loopback.rs similarity index 92% rename from crates/tsc-stream/tests/loopback.rs rename to crates/voelin-stream/tests/loopback.rs index f7dce8b..ab3aa3c 100644 --- a/crates/tsc-stream/tests/loopback.rs +++ b/crates/voelin-stream/tests/loopback.rs @@ -3,7 +3,7 @@ use std::time::Duration; use tokio::time::timeout; -use tsc_stream::{MediaKind, MediaTime, Peer, PeerConfig, PeerEvent}; +use voelin_stream::{MediaKind, MediaTime, Peer, PeerConfig, PeerEvent}; /// Bytes that look like a VP8 keyframe (frame tag + start code), then filler. pub fn fake_vp8_keyframe(seq: u8, len: usize) -> Vec { @@ -48,7 +48,7 @@ async fn media_flows_over_loopback() { let n = i * 2 + j; streamer.write( MediaKind::Audio, - MediaTime::new(n * 960, tsc_stream::Frequency::FORTY_EIGHT_KHZ), + MediaTime::new(n * 960, voelin_stream::Frequency::FORTY_EIGHT_KHZ), vec![0xfc, n as u8, 1, 2, 3], ); } @@ -63,7 +63,7 @@ async fn media_flows_over_loopback() { if let PeerEvent::Media(frame) = event { match frame.kind { MediaKind::Video => { - assert_eq!(frame.codec, tsc_stream::Codec::Vp8); + assert_eq!(frame.codec, voelin_stream::Codec::Vp8); assert_eq!(frame.data.len(), 3010, "whole frame reassembled"); video += 1; } diff --git a/crates/tsc-stream/tests/sessions.rs b/crates/voelin-stream/tests/sessions.rs similarity index 99% rename from crates/tsc-stream/tests/sessions.rs rename to crates/voelin-stream/tests/sessions.rs index acba1ab..c316695 100644 --- a/crates/tsc-stream/tests/sessions.rs +++ b/crates/voelin-stream/tests/sessions.rs @@ -6,12 +6,12 @@ use std::collections::HashMap; use std::time::{Duration, Instant}; use tokio::time::timeout; -use tsc_stream::{ +use tsclientlib::ClientId; +use voelin_stream::{ EndReason, FrameSource, LeaveReason, MediaKind, Output, PeerConfig, Request, StreamEvent, StreamInfo, StreamKind, StreamNotification, StreamSetup, StreamerEvent, StreamerOptions, Streams, SyntheticSource, ViewerState, WatchEvent, }; -use tsclientlib::ClientId; const STREAMER: usize = 0; const VIEWER: usize = 1; diff --git a/crates/tsc-ui/Cargo.toml b/crates/voelin-ui/Cargo.toml similarity index 64% rename from crates/tsc-ui/Cargo.toml rename to crates/voelin-ui/Cargo.toml index 1932522..eae00d1 100644 --- a/crates/tsc-ui/Cargo.toml +++ b/crates/voelin-ui/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-ui" +name = "voelin-ui" version = "0.1.0" description = "Slint user interface and the desktop binary." edition.workspace = true @@ -9,11 +9,11 @@ repository.workspace = true publish.workspace = true [lib] -name = "tsc_ui" +name = "voelin_ui" path = "src/lib.rs" [[bin]] -name = "tsc-desktop" +name = "voelin" path = "src/main.rs" [dependencies] @@ -25,29 +25,29 @@ serde = { version = "1", features = ["derive"] } tokio = { version = "1.53.1", features = ["rt-multi-thread", "macros", "time", "sync"] } tracing = "0.1.44" tracing-subscriber = { version = "0.3.23", features = ["env-filter"] } -tsc-audio = { path = "../tsc-audio" } -tsc-core = { path = "../tsc-core", default-features = false, features = ["audio-device"] } -tsc-model = { path = "../tsc-model" } +voelin-audio = { path = "../voelin-audio" } +voelin-core = { path = "../voelin-core", default-features = false, features = ["audio-device"] } +voelin-model = { path = "../voelin-model" } # Crash reports and notices everywhere; hotkey backends on desktop (below). -tsc-platform = { path = "../tsc-platform", default-features = false } -tsc-query = { path = "../tsc-query" } -tsc-store = { path = "../tsc-store" } +voelin-platform = { path = "../voelin-platform", default-features = false } +voelin-query = { path = "../voelin-query" } +voelin-store = { path = "../voelin-store" } tsclientlib = { path = "../proto/tsclientlib" } # Desktop: the keyring for passwords, stream media with libvpx, OpenH264, X11 # and PipeWire, global hotkeys through the portal and X11. [target.'cfg(not(target_os = "android"))'.dependencies] slint = { version = "1.18", features = ["renderer-software"] } -tsc-core = { path = "../tsc-core", default-features = false, features = ["media-desktop"] } -tsc-platform = { path = "../tsc-platform" } -tsc-store = { path = "../tsc-store", features = ["keyring"] } +voelin-core = { path = "../voelin-core", default-features = false, features = ["media-desktop"] } +voelin-platform = { path = "../voelin-platform" } +voelin-store = { path = "../voelin-store", features = ["keyring"] } -# Android (tsc-android): no keyring backend (the app passes Keystore-backed +# Android (voelin-android): no keyring backend (the app passes Keystore-backed # secrets), no winit/femtovg (the app picks Slint's Android backend), stream # media through MediaCodec and the app's capture source. [target.'cfg(target_os = "android")'.dependencies] slint = { version = "1.18", default-features = false, features = ["std", "compat-1-2", "renderer-software"] } -tsc-core = { path = "../tsc-core", default-features = false, features = ["media"] } +voelin-core = { path = "../voelin-core", default-features = false, features = ["media"] } [dev-dependencies] serde_json = "1" diff --git a/crates/tsc-ui/build.rs b/crates/voelin-ui/build.rs similarity index 100% rename from crates/tsc-ui/build.rs rename to crates/voelin-ui/build.rs diff --git a/crates/tsc-ui/src/app.rs b/crates/voelin-ui/src/app.rs similarity index 93% rename from crates/tsc-ui/src/app.rs rename to crates/voelin-ui/src/app.rs index fc460e4..199cf54 100644 --- a/crates/tsc-ui/src/app.rs +++ b/crates/voelin-ui/src/app.rs @@ -14,14 +14,16 @@ use anyhow::{Context, Result}; use slint::{ComponentHandle, ModelRc, SharedString, VecModel}; use tokio::runtime::Runtime; use tracing::warn; -use tsc_core::stream::StreamInfo; -use tsc_core::{ +use voelin_core::stream::StreamInfo; +use voelin_core::{ AudioSettings, Command, Engine, Event, ObserveState, SessionState, Source, VoiceOptions, VoiceState, }; -use tsc_model::{Capabilities, ChannelId, ChatMessage, ChatTarget, Presence, TreeRow, tree_rows}; -use tsc_platform::{crash, notices}; -use tsc_store::{Bookmark, MemorySecrets, QueryConfig, QueryTransport, Secrets, Store}; +use voelin_model::{ + Capabilities, ChannelId, ChatMessage, ChatTarget, Presence, TreeRow, tree_rows, +}; +use voelin_platform::{crash, notices}; +use voelin_store::{Bookmark, MemorySecrets, QueryConfig, QueryTransport, Secrets, Store}; use crate::hotkey::GlobalPtt; use crate::settings::{ @@ -37,7 +39,7 @@ slint::include_modules!(); /// Linux without a Secret Service). #[cfg(not(target_os = "android"))] struct FallbackSecrets { - keyring: tsc_store::KeyringSecrets, + keyring: voelin_store::KeyringSecrets, memory: MemorySecrets, } @@ -46,7 +48,7 @@ struct FallbackSecrets { fn default_secrets() -> Box { #[cfg(not(target_os = "android"))] return Box::new(FallbackSecrets { - keyring: tsc_store::KeyringSecrets::new("tsc-client"), + keyring: voelin_store::KeyringSecrets::new("voelin"), memory: MemorySecrets::default(), }); #[cfg(target_os = "android")] @@ -55,14 +57,14 @@ fn default_secrets() -> Box { #[cfg(not(target_os = "android"))] impl Secrets for FallbackSecrets { - fn get(&self, key: &str) -> tsc_store::Result> { + fn get(&self, key: &str) -> voelin_store::Result> { match self.memory.get(key)? { Some(v) => Ok(Some(v)), None => Ok(self.keyring.get(key).unwrap_or(None)), } } - fn set(&self, key: &str, value: &str) -> tsc_store::Result<()> { + fn set(&self, key: &str, value: &str) -> voelin_store::Result<()> { if let Err(error) = self.keyring.set(key, value) { warn!(%error, "keyring unavailable, keeping the secret for this session only"); return self.memory.set(key, value); @@ -70,7 +72,7 @@ impl Secrets for FallbackSecrets { Ok(()) } - fn delete(&self, key: &str) -> tsc_store::Result<()> { + fn delete(&self, key: &str) -> voelin_store::Result<()> { let _ = self.keyring.delete(key); self.memory.delete(key) } @@ -168,11 +170,11 @@ pub(crate) struct App { pub watch: Option, /// Stream volume in percent, kept between streams. pub stream_volume: f32, - /// `TSC_DEMO_STREAM`: the viewer shows a local test stream. + /// `VOELIN_DEMO_STREAM`: the viewer shows a local test stream. pub demo: bool, - /// `TSC_AUTOSHARE=test-pattern`: share the test pattern once streams work. + /// `VOELIN_AUTOSHARE=test-pattern`: share the test pattern once streams work. pub autoshare: bool, - /// `TSC_OPEN=client`: open the volume dialog of the first other client. + /// `VOELIN_OPEN=client`: open the volume dialog of the first other client. open_client_pending: bool, /// The notices are in the About page's model. notices_loaded: bool, @@ -196,8 +198,8 @@ pub(crate) fn later(f: impl FnOnce(&mut App) + Send + 'static) { /// Start options for [`run`]. #[derive(Default)] pub struct RunOptions { - /// Where the client database lives. Default: `TSC_DATA_DIR`, else - /// `/tsc`. Mobile platforms pass their app storage directory. + /// Where the client database lives. Default: `VOELIN_DATA_DIR`, else + /// `/voelin`. Mobile platforms pass their app storage directory. pub data_dir: Option, /// Where passwords are kept. Default: the OS keyring, in memory when it /// is unavailable. @@ -268,18 +270,18 @@ pub fn run(options: RunOptions) -> Result<()> { }; let HostedEngine { engine, runtime, mut events } = hosted; - // Development switches: TSC_DATA_DIR isolates the database, - // TSC_AUTOCONNECT=voice|observe connects the first bookmark on start, - // TSC_SCREENSHOT= saves the window after TSC_SCREENSHOT_DELAY seconds and exits, - // TSC_DEMO_STREAM=1 shows a local test stream in the viewer, - // TSC_OPEN=share|settings[:]|about|client opens that on start (client: the - // volume dialog of the first other client once connected), TSC_AUTOWATCH=1 - // watches the first stream that shows up, TSC_AUTOSHARE=test-pattern shares + // Development switches: VOELIN_DATA_DIR isolates the database, + // VOELIN_AUTOCONNECT=voice|observe connects the first bookmark on start, + // VOELIN_SCREENSHOT= saves the window after VOELIN_SCREENSHOT_DELAY seconds and exits, + // VOELIN_DEMO_STREAM=1 shows a local test stream in the viewer, + // VOELIN_OPEN=share|settings[:]|about|client opens that on start (client: the + // volume dialog of the first other client once connected), VOELIN_AUTOWATCH=1 + // watches the first stream that shows up, VOELIN_AUTOSHARE=test-pattern shares // the test pattern (accepting everyone) once connected to a TeamSpeak 6 server. - let dir: PathBuf = match (options.data_dir, std::env::var_os("TSC_DATA_DIR")) { + let dir: PathBuf = match (options.data_dir, std::env::var_os("VOELIN_DATA_DIR")) { (Some(dir), _) => dir, (None, Some(dir)) => dir.into(), - (None, None) => dirs::data_dir().unwrap_or_else(|| ".".into()).join("tsc"), + (None, None) => dirs::data_dir().unwrap_or_else(|| ".".into()).join("voelin"), }; let store = Store::open(&dir.join("client.db")).context("failed to open the client database")?; @@ -301,9 +303,11 @@ pub fn run(options: RunOptions) -> Result<()> { engine.send(Command::SetAudioSettings(Box::new(audio.clone()))); let ui = MainWindow::new()?; + ui.global::().set_app_name(voelin_platform::APP_NAME.into()); + ui.global::().set_app_version(env!("CARGO_PKG_VERSION").into()); // Wayland and X11 find the desktop file (and icon) by this id. #[cfg(not(target_os = "android"))] - if let Err(e) = slint::set_xdg_app_id(tsc_platform::APP_ID) { + if let Err(e) = slint::set_xdg_app_id(voelin_platform::APP_ID) { warn!("cannot set the app id: {e}"); } let bookmarks = store.bookmarks()?; @@ -316,7 +320,7 @@ pub fn run(options: RunOptions) -> Result<()> { ptt.set(Some(settings.ptt_key.clone())); } let video = Video::new(&dir, settings.openh264); - let demo = std::env::var("TSC_DEMO_STREAM").is_ok_and(|v| v == "1"); + let demo = std::env::var("VOELIN_DEMO_STREAM").is_ok_and(|v| v == "1"); let app = App { ui: ui.as_weak(), store, @@ -343,8 +347,8 @@ pub fn run(options: RunOptions) -> Result<()> { watch: None, stream_volume: 100.0, demo, - autoshare: std::env::var("TSC_AUTOSHARE").is_ok_and(|v| v == "test-pattern"), - open_client_pending: std::env::var("TSC_OPEN").is_ok_and(|v| v == "client"), + autoshare: std::env::var("VOELIN_AUTOSHARE").is_ok_and(|v| v == "test-pattern"), + open_client_pending: std::env::var("VOELIN_OPEN").is_ok_and(|v| v == "client"), notices_loaded: false, }; APP.with(|a| *a.borrow_mut() = Some(app)); @@ -375,7 +379,7 @@ pub fn run(options: RunOptions) -> Result<()> { with_app(|app| app.tick()); }); - match std::env::var("TSC_AUTOCONNECT").as_deref() { + match std::env::var("VOELIN_AUTOCONNECT").as_deref() { Ok("voice") => { with_app(|app| app.connect_voice()); } @@ -384,7 +388,7 @@ pub fn run(options: RunOptions) -> Result<()> { } _ => {} } - match std::env::var("TSC_OPEN").as_deref() { + match std::env::var("VOELIN_OPEN").as_deref() { Ok("share") => ui.invoke_open_share_dialog(), Ok("about") => { with_app(|app| app.load_notices()); @@ -398,9 +402,9 @@ pub fn run(options: RunOptions) -> Result<()> { } _ => {} } - let _screenshot_timer = std::env::var_os("TSC_SCREENSHOT").map(|path| { + let _screenshot_timer = std::env::var_os("VOELIN_SCREENSHOT").map(|path| { let delay = - std::env::var("TSC_SCREENSHOT_DELAY").ok().and_then(|d| d.parse().ok()).unwrap_or(4); + std::env::var("VOELIN_SCREENSHOT_DELAY").ok().and_then(|d| d.parse().ok()).unwrap_or(4); let weak = ui.as_weak(); let timer = slint::Timer::default(); timer.start(slint::TimerMode::SingleShot, Duration::from_secs(delay), move || { @@ -704,11 +708,11 @@ impl App { } else if let Some(q) = &b.query { let secret = self.secrets.get(&b.query_password_key()).ok().flatten(); let transport = match q.transport { - QueryTransport::Raw => tsc_query::Transport::Raw, - QueryTransport::Ssh => tsc_query::Transport::Ssh, - QueryTransport::Http => tsc_query::Transport::Http, + QueryTransport::Raw => voelin_query::Transport::Raw, + QueryTransport::Ssh => voelin_query::Transport::Ssh, + QueryTransport::Http => voelin_query::Transport::Http, }; - let connect = tsc_query::Connect { + let connect = voelin_query::Connect { transport, addr: format!("{}:{}", q.host, q.port), user: q.user.clone(), @@ -928,9 +932,9 @@ impl App { self.sessions.entry(session as i64).or_default().capabilities = capabilities; if self.current == Some(session as i64) { let kind = match flavor { - tsc_model::ServerFlavor::Ts3(v) => format!("TeamSpeak 3 {v}"), - tsc_model::ServerFlavor::Ts6(v) => format!("TeamSpeak 6 {v}"), - tsc_model::ServerFlavor::Unknown(v) => v, + voelin_model::ServerFlavor::Ts3(v) => format!("TeamSpeak 3 {v}"), + voelin_model::ServerFlavor::Ts6(v) => format!("TeamSpeak 6 {v}"), + voelin_model::ServerFlavor::Unknown(v) => v, }; self.set_status(format!("Connected to {name} ({kind})")); } @@ -1176,7 +1180,8 @@ impl App { // Settings page. fn open_settings(&mut self) { - let list = |devices: tsc_audio::Result>, input: bool| { + let list = |devices: voelin_audio::Result>, + input: bool| { let devices = devices.unwrap_or_else(|e| { warn!("cannot list audio devices: {e}"); Vec::new() @@ -1189,8 +1194,8 @@ impl App { }) .collect::>() }; - let inputs = list(tsc_audio::device::input_devices(), true); - let outputs = list(tsc_audio::device::output_devices(), false); + let inputs = list(voelin_audio::device::input_devices(), true); + let outputs = list(voelin_audio::device::output_devices(), false); self.inputs = DeviceChoices::new(&inputs, self.audio.input_device.as_deref()); self.outputs = DeviceChoices::new(&outputs, self.audio.output_device.as_deref()); let Some(ui) = self.ui.upgrade() else { return }; @@ -1374,7 +1379,7 @@ impl App { self.refresh_tree(); } - /// `TSC_OPEN=client`: the volume dialog of the first client that is not us. + /// `VOELIN_OPEN=client`: the volume dialog of the first client that is not us. fn open_first_client(&mut self) { let Some(view) = self.view().filter(|v| v.state.own_client.is_some()) else { return }; let own = view.state.own_client; diff --git a/crates/tsc-ui/src/hotkey.rs b/crates/voelin-ui/src/hotkey.rs similarity index 95% rename from crates/tsc-ui/src/hotkey.rs rename to crates/voelin-ui/src/hotkey.rs index c888cb1..2f1a6d3 100644 --- a/crates/tsc-ui/src/hotkey.rs +++ b/crates/voelin-ui/src/hotkey.rs @@ -1,4 +1,4 @@ -//! Global push-to-talk: a task owns the `tsc_platform::HotkeyManager` +//! Global push-to-talk: a task owns the `voelin_platform::HotkeyManager` //! (portal on Wayland, XInput2 on X11, a hook on Windows) and reports //! presses and releases. @@ -53,7 +53,7 @@ async fn run( status: impl Fn(String), transmit: impl Fn(bool), ) { - use tsc_platform::{BackendKind, Hotkey, HotkeyEvent, HotkeyEvents, HotkeyManager}; + use voelin_platform::{BackendKind, Hotkey, HotkeyEvent, HotkeyEvents, HotkeyManager}; async fn next(events: &mut Option) -> Option { match events { diff --git a/crates/tsc-ui/src/lib.rs b/crates/voelin-ui/src/lib.rs similarity index 100% rename from crates/tsc-ui/src/lib.rs rename to crates/voelin-ui/src/lib.rs diff --git a/crates/tsc-ui/src/main.rs b/crates/voelin-ui/src/main.rs similarity index 89% rename from crates/tsc-ui/src/main.rs rename to crates/voelin-ui/src/main.rs index 19a9ac3..d08419f 100644 --- a/crates/tsc-ui/src/main.rs +++ b/crates/voelin-ui/src/main.rs @@ -13,5 +13,5 @@ fn main() -> Result<()> { EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("warn")), ) .init(); - tsc_ui::run(tsc_ui::RunOptions::default()) + voelin_ui::run(voelin_ui::RunOptions::default()) } diff --git a/crates/tsc-ui/src/settings.rs b/crates/voelin-ui/src/settings.rs similarity index 98% rename from crates/tsc-ui/src/settings.rs rename to crates/voelin-ui/src/settings.rs index d2b3473..7fb69af 100644 --- a/crates/tsc-ui/src/settings.rs +++ b/crates/voelin-ui/src/settings.rs @@ -4,8 +4,8 @@ use std::collections::BTreeMap; use serde::{Deserialize, Serialize}; -use tsc_audio::process::NoiseLevel; -use tsc_core::{AudioSettings, TransmitMode}; +use voelin_audio::process::NoiseLevel; +use voelin_core::{AudioSettings, TransmitMode}; use crate::app::AudioForm; @@ -23,7 +23,7 @@ pub const BITRATE_CHOICES: [u32; 4] = [2500, 4608, 8000, 10_000]; pub struct UiSettings { /// Global push-to-talk hotkey (besides the button in the window). pub global_ptt: bool, - /// E.g. `Ctrl+Shift+T` (`tsc_platform::Hotkey` syntax). + /// E.g. `Ctrl+Shift+T` (`voelin_platform::Hotkey` syntax). pub ptt_key: String, /// H.264 through Cisco's OpenH264, downloaded on request. pub openh264: bool, diff --git a/crates/tsc-ui/src/streams.rs b/crates/voelin-ui/src/streams.rs similarity index 97% rename from crates/tsc-ui/src/streams.rs rename to crates/voelin-ui/src/streams.rs index 7ab31e1..bfc8d1d 100644 --- a/crates/tsc-ui/src/streams.rs +++ b/crates/voelin-ui/src/streams.rs @@ -3,8 +3,8 @@ //! encodes and decodes. use slint::{ComponentHandle, Model}; -use tsc_core::stream::{EndReason, LeaveReason, StreamSetup, ViewerInfo, ViewerState}; -use tsc_core::{Command, Event, StreamState, WatchState}; +use voelin_core::stream::{EndReason, LeaveReason, StreamSetup, ViewerInfo, ViewerState}; +use voelin_core::{Command, Event, StreamState, WatchState}; use crate::app::{App, Bridge, ShareForm, SourceItem, StreamItem, ViewerItem, later, model}; use crate::settings::{BITRATE_CHOICES, FPS_CHOICES, ShareDefaults}; @@ -65,7 +65,7 @@ impl App { Event::StreamsChanged { session, streams } => { let view = self.sessions.entry(session as i64).or_default(); // Development switch: watch the first stream that shows up. - let autowatch = std::env::var("TSC_AUTOWATCH").is_ok_and(|v| v == "1") + let autowatch = std::env::var("VOELIN_AUTOWATCH").is_ok_and(|v| v == "1") && self.watch.is_none() && self.current == Some(session as i64); let first = streams @@ -308,7 +308,7 @@ impl App { pub(crate) fn open_share(&mut self) -> ShareForm { let test_pattern = cfg!(debug_assertions) || self.demo - || std::env::var("TSC_TEST_PATTERN").is_ok_and(|v| v == "1"); + || std::env::var("VOELIN_TEST_PATTERN").is_ok_and(|v| v == "1"); let sources = match self.video.sources(test_pattern) { Ok(sources) => { if self.share.is_none() { @@ -344,7 +344,7 @@ impl App { } } - /// Development switch `TSC_AUTOSHARE`: share the test pattern once. + /// Development switch `VOELIN_AUTOSHARE`: share the test pattern once. pub(crate) fn autoshare(&mut self) { if !self.autoshare || !self.view().is_some_and(|v| v.streams_available()) { return; @@ -502,7 +502,7 @@ impl App { self.refresh_streams(); } - /// The local test stream in the viewer (`TSC_DEMO_STREAM`). + /// The local test stream in the viewer (`VOELIN_DEMO_STREAM`). pub(crate) fn start_demo(&mut self) { self.leave_stream(); self.watch = Some(Watch { diff --git a/crates/tsc-ui/src/video.rs b/crates/voelin-ui/src/video.rs similarity index 97% rename from crates/tsc-ui/src/video.rs rename to crates/voelin-ui/src/video.rs index 021d7c5..35632e1 100644 --- a/crates/tsc-ui/src/video.rs +++ b/crates/voelin-ui/src/video.rs @@ -10,13 +10,13 @@ use std::sync::Arc; use slint::{Image, Rgba8Pixel, SharedPixelBuffer}; use tokio::runtime::Handle; use tracing::warn; -use tsc_core::media::tsc_media::capture::SourceId; -use tsc_core::media::tsc_media::{Codecs, VideoFrame, convert}; -use tsc_core::media::{ +use voelin_core::media::voelin_media::capture::SourceId; +use voelin_core::media::voelin_media::{Codecs, VideoFrame, convert}; +use voelin_core::media::{ self, Latest, LocalPreview, Streamer, StreamerConfig, Viewer, peer_config, stream_codec, }; -use tsc_core::stream::PeerConfig; -use tsc_core::{Engine, StreamSink}; +use voelin_core::stream::PeerConfig; +use voelin_core::{Engine, StreamSink}; /// Whether this build can share and decode video. pub const AVAILABLE: bool = true; @@ -31,7 +31,7 @@ fn size_text(width: u32, height: u32) -> String { /// Cisco's OpenH264, downloaded on the user's request. #[cfg(not(target_os = "android"))] mod openh264 { - pub use tsc_core::media::tsc_media::codec::h264::{ + pub use voelin_core::media::voelin_media::codec::h264::{ OPENH264_VERSION, OpenH264, download_openh264, }; @@ -255,7 +255,7 @@ impl Video { } /// The test pattern through the encoder and decoder, without a server - /// (`TSC_DEMO_STREAM`). + /// (`VOELIN_DEMO_STREAM`). pub fn demo( &self, runtime: &Handle, diff --git a/crates/tsc-ui/ui/app.slint b/crates/voelin-ui/ui/app.slint similarity index 99% rename from crates/tsc-ui/ui/app.slint rename to crates/voelin-ui/ui/app.slint index 2c958e8..a3afb12 100644 --- a/crates/tsc-ui/ui/app.slint +++ b/crates/voelin-ui/ui/app.slint @@ -184,6 +184,9 @@ export global Bridge { in property h264-busy; in property h264-status; in property h264-attribution; + // The product name (voelin_platform::APP_NAME, not translated) and version. + in property app-name: "Voelin"; + in property app-version; in-out property client-audio; // Opt-in local crash reports, and a notice about reports on disk. in-out property crash-reports; @@ -1400,7 +1403,7 @@ component AboutDialog inherits Dialog { dismissed => { done(); } VerticalBox { Text { - text: @tr("About"); + text: Bridge.app-name + " " + Bridge.app-version; font-size: 18px; font-weight: 700; } @@ -1448,7 +1451,7 @@ component AboutDialog inherits Dialog { } export component MainWindow inherits Window { - title: @tr("TS Client"); + title: Bridge.app-name; preferred-width: 1200px; preferred-height: 760px; min-width: 360px; diff --git a/deny.toml b/deny.toml index 415b1c6..b121807 100644 --- a/deny.toml +++ b/deny.toml @@ -35,7 +35,7 @@ allow = [ # app's About page and the README. "LicenseRef-Slint-Royalty-free-2.0", # Permissive BSD-style license of bzip2, kept by its pure Rust port - # (libbz2-rs-sys), which tsc-media uses to unpack Cisco's OpenH264 download. + # (libbz2-rs-sys), which voelin-media uses to unpack Cisco's OpenH264 download. "bzip2-1.0.6", ] confidence-threshold = 0.9 diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index 40554cf..514d88b 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -7,7 +7,7 @@ # start; the smoke test reads it from there. `down -v` resets the servers. # # ServerQuery: every interface is enabled with the fixed development password -# `tsc-dev-admin` for the `serveradmin` login (TS3: raw 10011, SSH 10023, +# `voelin-dev-admin` for the `serveradmin` login (TS3: raw 10011, SSH 10023, # HTTP 10081; TS6: SSH 10022, HTTP 10080). Never use these settings in production. # # query_ip_allowlist.txt allowlists private ranges: clients reach the servers @@ -16,7 +16,7 @@ # # Images are pinned by digest; bump by pulling the new tag and copying its digest. # If Docker Hub rate-limits you, use its mirror: REGISTRY=mirror.gcr.io -name: tsc-dev +name: voelin-dev services: ts3: @@ -25,7 +25,7 @@ services: environment: TS3SERVER_LICENSE: accept TS3SERVER_IP_ALLOWLIST: /etc/ts3server/query_ip_allowlist.txt - TS3SERVER_SERVERADMIN_PASSWORD: tsc-dev-admin + TS3SERVER_SERVERADMIN_PASSWORD: voelin-dev-admin TS3SERVER_QUERY_PROTOCOLS: raw,ssh,http ports: - "9987:9987/udp" # voice @@ -42,7 +42,7 @@ services: image: ${REGISTRY:-docker.io}/teamspeaksystems/teamspeak6-server@sha256:d845f803aecf842c2df034c959c23ff2462357bacafb3807500885c5ec170fa1 environment: TSSERVER_LICENSE_ACCEPTED: accept - TSSERVER_QUERY_ADMIN_PASSWORD: tsc-dev-admin + TSSERVER_QUERY_ADMIN_PASSWORD: voelin-dev-admin TSSERVER_QUERY_SSH_ENABLED: 1 TSSERVER_QUERY_HTTP_ENABLED: 1 TSSERVER_QUERY_ALLOW_LIST: /etc/tsserver/query_ip_allowlist.txt diff --git a/dev/tsgw-ts3.toml b/dev/tsgw-ts3.toml index a54999f..68495eb 100644 --- a/dev/tsgw-ts3.toml +++ b/dev/tsgw-ts3.toml @@ -1,5 +1,5 @@ # Gateway for the ts3 development server (dev/docker-compose.yml). -# cargo run -p tsc-gateway -- --config dev/tsgw-ts3.toml +# cargo run -p voelin-gateway -- --config dev/tsgw-ts3.toml [server] # Inside the container the voice port is always 9987. @@ -9,7 +9,7 @@ voice_port = 9987 transport = "raw" addr = "127.0.0.1:10011" user = "serveradmin" -password = "tsc-dev-admin" +password = "voelin-dev-admin" allowlisted = true [listen] diff --git a/dev/tsgw-ts6.toml b/dev/tsgw-ts6.toml index a2816e3..e33d2d7 100644 --- a/dev/tsgw-ts6.toml +++ b/dev/tsgw-ts6.toml @@ -1,5 +1,5 @@ # Gateway for the ts6 development server (dev/docker-compose.yml). -# cargo run -p tsc-gateway -- --config dev/tsgw-ts6.toml +# cargo run -p voelin-gateway -- --config dev/tsgw-ts6.toml [server] # Inside the container the voice port is always 9987. @@ -9,7 +9,7 @@ voice_port = 9987 transport = "ssh" addr = "127.0.0.1:10022" user = "serveradmin" -password = "tsc-dev-admin" +password = "voelin-dev-admin" allowlisted = true [listen] diff --git a/docker/android.Dockerfile b/docker/android.Dockerfile index 55f4473..7c7f421 100644 --- a/docker/android.Dockerfile +++ b/docker/android.Dockerfile @@ -13,8 +13,8 @@ # --secret id=keystore,src=release.jks --secret id=signing,src=signing.env \ # -o dist/android . # -# signing.env holds TSC_SIGNING_STORE_PASSWORD, TSC_SIGNING_KEY_ALIAS and -# TSC_SIGNING_KEY_PASSWORD lines (NAME=value). Without them a release APK is +# signing.env holds VOELIN_SIGNING_STORE_PASSWORD, VOELIN_SIGNING_KEY_ALIAS and +# VOELIN_SIGNING_KEY_PASSWORD lines (NAME=value). Without them a release APK is # unsigned. FROM ubuntu:24.04 AS toolchain @@ -80,20 +80,20 @@ ARG ABIS=arm64-v8a,x86_64 ARG APK=debug WORKDIR /src COPY . . -RUN --mount=type=cache,id=tsc-cargo-registry,target=/usr/local/cargo/registry \ - --mount=type=cache,id=tsc-target-android,target=/src/target \ - --mount=type=cache,id=tsc-gradle,target=/root/.gradle \ +RUN --mount=type=cache,id=voelin-cargo-registry,target=/usr/local/cargo/registry \ + --mount=type=cache,id=voelin-target-android,target=/src/target \ + --mount=type=cache,id=voelin-gradle,target=/root/.gradle \ --mount=type=secret,id=keystore,required=false \ --mount=type=secret,id=signing,required=false \ set -e; \ if [ "$APK" = release ] && [ -f /run/secrets/keystore ]; then \ - export TSC_SIGNING_STORE_FILE=/run/secrets/keystore; \ + export VOELIN_SIGNING_STORE_FILE=/run/secrets/keystore; \ set -a; . /run/secrets/signing; set +a; \ fi; \ proxy="$(java-proxy-opts)"; \ export GRADLE_OPTS="$proxy"; \ task="assemble$(echo "$APK" | sed 's/./\U&/')"; \ - (cd android && ./gradlew --no-daemon $proxy "$task" -Ptsc.abis="$ABIS") \ + (cd android && ./gradlew --no-daemon $proxy "$task" -Pvoelin.abis="$ABIS") \ && scripts/package.sh android /out FROM scratch AS artifacts diff --git a/docker/linux.Dockerfile b/docker/linux.Dockerfile index 5ad0221..efb3e92 100644 --- a/docker/linux.Dockerfile +++ b/docker/linux.Dockerfile @@ -1,8 +1,9 @@ # syntax=docker/dockerfile:1 # -# Linux packages (docs/building.md): tsc--linux-x86_64.tar.gz with -# tsc-desktop, tsctl and tsgw, and tsc-desktop__amd64.deb for -# Ubuntu 24.04 and newer. +# Linux packages (docs/building.md), for Ubuntu 24.04 and newer: the app as +# voelin--linux-x86_64.tar.gz and voelin__amd64.deb, the +# gateway (servers) as tsgw--linux-x86_64.tar.gz and +# tsgw__amd64.deb. # # docker build -f docker/linux.Dockerfile -o dist/linux . # @@ -37,9 +38,9 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ FROM toolchain AS build WORKDIR /src COPY . . -RUN --mount=type=cache,id=tsc-cargo-registry,target=/usr/local/cargo/registry \ - --mount=type=cache,id=tsc-target-linux,target=/src/target \ - cargo build --release --locked -p tsc-ui -p tsctl -p tsc-gateway \ +RUN --mount=type=cache,id=voelin-cargo-registry,target=/usr/local/cargo/registry \ + --mount=type=cache,id=voelin-target-linux,target=/src/target \ + cargo build --release --locked -p voelin-ui -p voelin-gateway \ && scripts/package.sh linux /out FROM scratch AS artifacts diff --git a/docker/windows.Dockerfile b/docker/windows.Dockerfile index 9e6fca9..3233179 100644 --- a/docker/windows.Dockerfile +++ b/docker/windows.Dockerfile @@ -1,8 +1,8 @@ # syntax=docker/dockerfile:1 # # Windows packages, cross-compiled on Linux (docs/building.md): -# tsc--windows-x86_64.zip with tsc-desktop.exe, tsctl.exe and -# tsgw.exe, and the NSIS installer tsc-desktop--setup.exe. +# voelin--windows-x86_64.zip with voelin.exe, and the NSIS installer +# voelin--setup.exe. # # docker build -f docker/windows.Dockerfile -o dist/windows . # @@ -59,9 +59,9 @@ ENV VPX_LIB_DIR=/opt/libvpx/lib VPX_INCLUDE_DIR=/opt/libvpx/include \ VPX_VERSION=$LIBVPX_VERSION VPX_STATIC=1 WORKDIR /src COPY . . -RUN --mount=type=cache,id=tsc-cargo-registry,target=/usr/local/cargo/registry \ - --mount=type=cache,id=tsc-target-windows,target=/src/target \ - cargo build --release --locked --target x86_64-pc-windows-gnu -p tsc-ui -p tsctl -p tsc-gateway \ +RUN --mount=type=cache,id=voelin-cargo-registry,target=/usr/local/cargo/registry \ + --mount=type=cache,id=voelin-target-windows,target=/src/target \ + cargo build --release --locked --target x86_64-pc-windows-gnu -p voelin-ui \ && WINDOWS_TARGET=x86_64-pc-windows-gnu scripts/package.sh windows /out FROM scratch AS artifacts diff --git a/docs/android.md b/docs/android.md index 4e04426..1e3d28a 100644 --- a/docs/android.md +++ b/docs/android.md @@ -1,14 +1,14 @@ # Android app -The Android app is the desktop UI (`tsc-ui`, Slint) running in a +The Android app is the desktop UI (`voelin-ui`, Slint) running in a `NativeActivity`, plus a thin Kotlin layer for what only Java APIs can do: foreground services, the screen-capture consent, the Keystore. ``` android/ Gradle project (AGP 8.13, Kotlin 2.3, Gradle 8.14.3 wrapper) - app/src/main/java/.../tsc/ MainActivity (NativeActivity), Bridge, Native, + app/src/main/java/.../voelin/ MainActivity (NativeActivity), Bridge, Native, VoiceService, ScreenCaptureService, SecretStore -crates/tsc-android/ libtsc_android.so: android_main, engine host, +crates/voelin-android/ libvoelin_android.so: android_main, engine host, JNI glue, capture providers, Keystore secrets ``` @@ -29,16 +29,16 @@ Requirements: ```sh cd android ./gradlew assembleDebug # arm64-v8a + x86_64 (emulator) -./gradlew assembleDebug -Ptsc.abis=arm64-v8a # phones only, half the build +./gradlew assembleDebug -Pvoelin.abis=arm64-v8a # phones only, half the build adb install -r app/build/outputs/apk/debug/app-debug.apk adb logcat -s RustStdoutStderr ScreenCaptureService VoiceService SecretStore ``` -`assemble` runs `cargo ndk ... build -p tsc-android` (with +`assemble` runs `cargo ndk ... build -p voelin-android` (with `--release` for release) into `app/build/rust///` before the -native libraries are merged; `-Ptsc.skipCargo=true` packages what is there +native libraries are merged; `-Pvoelin.skipCargo=true` packages what is there (for CI steps that built the library already). The app's `versionName` is the -version of `crates/tsc-android`, and `versionCode` is derived from it +version of `crates/voelin-android`, and `versionCode` is derived from it (docs/release.md). The Kotlin half of `rustls-platform-verifier` comes from its Maven archive in the version `Cargo.lock` pins. @@ -48,14 +48,14 @@ environment variables; nothing of it lives in the repository: | Gradle property | Environment variable | |---|---| -| `tsc.signing.storeFile` | `TSC_SIGNING_STORE_FILE` | -| `tsc.signing.storePassword` | `TSC_SIGNING_STORE_PASSWORD` | -| `tsc.signing.keyAlias` | `TSC_SIGNING_KEY_ALIAS` | -| `tsc.signing.keyPassword` | `TSC_SIGNING_KEY_PASSWORD` | +| `voelin.signing.storeFile` | `VOELIN_SIGNING_STORE_FILE` | +| `voelin.signing.storePassword` | `VOELIN_SIGNING_STORE_PASSWORD` | +| `voelin.signing.keyAlias` | `VOELIN_SIGNING_KEY_ALIAS` | +| `voelin.signing.keyPassword` | `VOELIN_SIGNING_KEY_PASSWORD` | ```sh -TSC_SIGNING_STORE_FILE=~/keys/tsc-release.jks TSC_SIGNING_STORE_PASSWORD=... \ -TSC_SIGNING_KEY_ALIAS=tsc TSC_SIGNING_KEY_PASSWORD=... ./gradlew assembleRelease bundleRelease +VOELIN_SIGNING_STORE_FILE=~/keys/voelin-release.jks VOELIN_SIGNING_STORE_PASSWORD=... \ +VOELIN_SIGNING_KEY_ALIAS=voelin VOELIN_SIGNING_KEY_PASSWORD=... ./gradlew assembleRelease bundleRelease ``` minSdk is 29 (Android 10: MediaProjection foreground service type, playback @@ -63,19 +63,19 @@ capture, NDK MediaCodec format queries); targetSdk and compileSdk 36. ## How it fits together -- **Entry**: the activity loads `libtsc_android.so` (`android.app.lib_name`); +- **Entry**: the activity loads `libvoelin_android.so` (`android.app.lib_name`); android-activity calls `android_main` on a new thread for every activity instance. It installs crash reports (opt-in, `crash_reports` setting, `/crash-reports`), looks up the Kotlin `Bridge` class, initialises `rustls-platform-verifier` (HTTPS certificate checks against the system trust store), asks for the microphone and notification permissions, sets - Slint's Android backend and runs `tsc_ui::run` with the app's files + Slint's Android backend and runs `voelin_ui::run` with the app's files directory, Keystore secrets and the process's engine. - **Engine for the process** (`host.rs`): one tokio runtime and `Engine` per process. The activity may be destroyed while voice goes on; a new window attaches and first receives events that rebuild the current state (server info, state, presence, the last 300 chat messages per session, - streams), then live events (`tsc_ui::HostedEngine`). Back moves the task + streams), then live events (`voelin_ui::HostedEngine`). Back moves the task to the background instead of finishing the activity; configuration changes do not recreate it. - **Voice in the background**: while any session has a voice connection, @@ -83,7 +83,7 @@ capture, NDK MediaCodec format queries); targetSdk and compileSdk 36. notification ("In voice on …", Mute or Unmute, Disconnect). Rust drives it from engine events (`foreground.rs`, `Bridge.setVoiceNotification`). Audio itself is cpal on AAudio, as on desktop. -- **Sharing the screen**: `tsc_media::capture::default_screen_capture()` +- **Sharing the screen**: `voelin_media::capture::default_screen_capture()` returns the MediaProjection provider (`capture.rs`) registered at start. Starting shows the system consent dialog; on consent `ScreenCaptureService` (type `mediaProjection`) mirrors the display into an `ImageReader` at the @@ -92,7 +92,7 @@ capture, NDK MediaCodec format queries); targetSdk and compileSdk 36. `AudioPlaybackCapture` of media, game and unknown usages, 48 kHz stereo float, only while the projection runs. Ending the projection from the status bar or the notification closes the capture channels. -- **Watching and encoding**: `tsc_media::Codecs` uses the device's +- **Watching and encoding**: `voelin_media::Codecs` uses the device's MediaCodec encoders (hardware first) and decoders on Android ([media.md](media.md)). - **Secrets**: `SecretStore` encrypts each password with AES-256-GCM under a @@ -113,17 +113,17 @@ Permissions: `INTERNET`, `ACCESS_NETWORK_STATE`, `RECORD_AUDIO`, | What | How | Status | |---|---|---| -| `libtsc_android.so` for `aarch64-linux-android` (Slint Android backend with Skia, AAudio, AWS-LC, SQLite, libopus) | `cargo ndk -t arm64-v8a build -p tsc-android` | builds; exports `android_main` and the `Native` methods | -| Debug APK | `./gradlew assembleDebug -Ptsc.abis=arm64-v8a` | builds | -| Engine host replay, voice service policy | unit tests (`cargo test -p tsc-android`) | tested | -| External capture providers, MediaCodec buffer layouts | `tsc-media` unit tests | tested | +| `libvoelin_android.so` for `aarch64-linux-android` (Slint Android backend with Skia, AAudio, AWS-LC, SQLite, libopus) | `cargo ndk -t arm64-v8a build -p voelin-android` | builds; exports `android_main` and the `Native` methods | +| Debug APK | `./gradlew assembleDebug -Pvoelin.abis=arm64-v8a` | builds | +| Engine host replay, voice service policy | unit tests (`cargo test -p voelin-android`) | tested | +| External capture providers, MediaCodec buffer layouts | `voelin-media` unit tests | tested | | The app on a device: UI, voice in the background, screen sharing, watching, Keystore | manual matrix row IN3 and the Android rows | not run yet (no device or emulator in this environment) | Known gaps: -- The streams panel of the UI and the stream media pipeline of `tsc-core` +- The streams panel of the UI and the stream media pipeline of `voelin-core` must build without the desktop media backends on Android (libvpx, X11, - PipeWire): `tsc-media` with `default-features = false` there, so that + PipeWire): `voelin-media` with `default-features = false` there, so that `Codecs` uses MediaCodec. - Rotating the device while sharing letterboxes the picture (the virtual display keeps its size). diff --git a/docs/architecture.md b/docs/architecture.md index e94d147..5b0b1c3 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -16,9 +16,9 @@ facts constrain it, how the code is organised, and the milestone order. `respondjoinstreamrequest`, `streamsignaling`, `notifystream*`, ...). See [protocol-notes/ts6-streaming.md](protocol-notes/ts6-streaming.md). - `clientinit` must carry a `client_version_sign` signed by TeamSpeak, so the - client reuses known version/signature pairs (`tsctl versions`). + client reuses known version/signature pairs (`voelinctl versions`). - TeamSpeak 6 servers still accept the TeamSpeak 3 client protocol; verified with - `tsctl` against 6.0.0-beta13.1. + `voelinctl` against 6.0.0-beta13.1. ### What "invisible" means for query clients (verified on 3.13.8 and 6.0.0-beta13.1) @@ -41,18 +41,18 @@ the admin grants them to the guest query group. | Feature | Mechanism | |---|---| | Server chat | Voice connection: `targetmode=3`. Without one: gateway or own query session (`servernotifyregister event=textserver`) | -| Channel chat without joining | Relay pool (`tsc-observer`): invisible query sessions sit in channels and relay both ways; posts appear as `[Nick] text` | +| Channel chat without joining | Relay pool (`voelin-observer`): invisible query sessions sit in channels and relay both ways; posts appear as `[Nick] text` | | Voice | tsproto UDP transport, Opus (`opus2`), echo cancellation / noise suppression (sonora), own jitter buffer, cpal / AAudio | | Invisible presence | Gateway presence stream (snapshot + deltas from query events) or direct query; `channelsubscribeall` when voice-connected | -| Screen share with sound | TS6 stream signalling (`tsc-stream`), str0m WebRTC, per-platform capture and codecs (`tsc-media`) | +| Screen share with sound | TS6 stream signalling (`voelin-stream`), str0m WebRTC, per-platform capture and codecs (`voelin-media`) | ## Workspace layout ``` crates/proto/ vendored tsclientlib (tsproto, tsproto-packets, tsproto-types, tsproto-structs + declarations, ts-bookkeeping, tsclientlib) -crates/ our crates (table below) -tools/tsctl headless CLI +crates/ our crates (table below) +tools/voelinctl headless CLI dev/ docker-compose TS3 + TS6 servers, gateway configs scripts/ it-smoke.sh, own-crates.sh fuzz/ cargo-fuzz targets @@ -60,18 +60,18 @@ fuzz/ cargo-fuzz targets | Crate | Responsibility | State | |---|---|---| -| `tsc-model` | UI-facing domain model (servers, channels, clients, chat, capabilities), no IO | done | -| `tsc-query` | ServerQuery codec and transports: raw TCP, SSH (russh), HTTP WebQuery | done | -| `tsc-observer` | Presence tracker + chat relay pool over `tsc-query` | done | -| `tsc-gateway-proto`, `tsc-gateway` (`tsgw`) | Companion service for server admins: identity-challenge auth, permission-mirroring authorization, presence stream, chat relay, SQLite history, WebSocket + JSON (`tsgw.v1+json`) | done | -| `tsc-store` | Identities, bookmarks, settings, chat cache, secrets (keyring / Android Keystore) | done | -| `tsc-audio` | Capture/playback, Opus, echo cancellation, resampling, jitter buffer, mixer, VAD/push-to-talk | v0 (no AEC yet) | -| `tsc-stream` | TS6 stream commands, JSON signalling, str0m peer connections, host/STUN candidates, streamer/viewer sessions, frame-source seam | sessions + transport | -| `tsc-core` | Engine: runtime, per-server sessions, merge of voice/gateway/query sources, event bus, command API, audio settings and volumes, streams on TS6; `media` module (capture → encoder → stream, stream → decoder) | done | -| `tsc-ui` | Slint UI and the desktop binary: streams panel, viewer, share dialog, audio / hotkey / codec settings | done (desktop) | -| `tsc-media` | Screen and system-audio capture backends (PipeWire portal, X11, Windows Graphics Capture, Android MediaProjection), video codecs | done (desktop hardware encoders planned; MediaCodec not run on a device yet) | -| `tsc-platform` | Global hotkeys, notifications, paths, crash reports, notices | done | -| `tsc-android` + `android/` | Android library + Gradle/Kotlin app (foreground services for voice and screen capture); see [android.md](android.md) | builds, not yet run on a device | +| `voelin-model` | UI-facing domain model (servers, channels, clients, chat, capabilities), no IO | done | +| `voelin-query` | ServerQuery codec and transports: raw TCP, SSH (russh), HTTP WebQuery | done | +| `voelin-observer` | Presence tracker + chat relay pool over `voelin-query` | done | +| `voelin-gateway-proto`, `voelin-gateway` (`tsgw`) | Companion service for server admins: identity-challenge auth, permission-mirroring authorization, presence stream, chat relay, SQLite history, WebSocket + JSON (`tsgw.v1+json`) | done | +| `voelin-store` | Identities, bookmarks, settings, chat cache, secrets (keyring / Android Keystore) | done | +| `voelin-audio` | Capture/playback, Opus, echo cancellation, resampling, jitter buffer, mixer, VAD/push-to-talk | v0 (no AEC yet) | +| `voelin-stream` | TS6 stream commands, JSON signalling, str0m peer connections, host/STUN candidates, streamer/viewer sessions, frame-source seam | sessions + transport | +| `voelin-core` | Engine: runtime, per-server sessions, merge of voice/gateway/query sources, event bus, command API, audio settings and volumes, streams on TS6; `media` module (capture → encoder → stream, stream → decoder) | done | +| `voelin-ui` | Slint UI and the desktop binary: streams panel, viewer, share dialog, audio / hotkey / codec settings | done (desktop) | +| `voelin-media` | Screen and system-audio capture backends (PipeWire portal, X11, Windows Graphics Capture, Android MediaProjection), video codecs | done (desktop hardware encoders planned; MediaCodec not run on a device yet) | +| `voelin-platform` | Global hotkeys, notifications, paths, crash reports, notices | done | +| `voelin-android` + `android/` | Android library + Gradle/Kotlin app (foreground services for voice and screen capture); see [android.md](android.md) | builds, not yet run on a device | ## Merging sources @@ -84,7 +84,7 @@ gateway, otherwise a local query relay. UI states: `Offline`, ## Streams -`tsc-stream::Streams` holds the stream state of one TS6 connection without +`voelin-stream::Streams` holds the stream state of one TS6 connection without doing connection IO: it is fed stream notifications (and failed commands) and the app's decisions, owns the str0m peers, and queues requests to send plus events. Inside it, `StreamerSession` runs our stream (one peer per viewer, our @@ -92,34 +92,34 @@ offer in `respondjoinstreamrequest`), `ViewerSession` one watched stream (answer through `streamsignaling`), and `StreamDirectory` the streams of our channel. Its tests drive two instances through a fake relay server. -In `tsc-core` a stream task per voice connection runs `Streams`; the voice task +In `voelin-core` a stream task per voice connection runs `Streams`; the voice task forwards `MessageEvent`s and sends the requests. Encoders push frames through the `StreamSink` of `StreamState::Live`; received frames of watched streams go to `Engine::subscribe_frames`, not the event bus. The audio of watched streams goes straight to the session's audio thread, which mixes it like a talker with its own volume (`Command::SetStreamVolume`). -`tsc-core::media` (feature `media`) connects this to `tsc-media`: +`voelin-core::media` (feature `media`) connects this to `voelin-media`: `Streamer` captures (screen, window, portal or the test pattern, plus system audio), encodes with the codec of our offer (VP8 by default; the offer carries only the codec we encode, since every viewer gets the same frames) and Opus, and feeds the `StreamSink`, honouring keyframe requests. `Viewer` decodes a watched stream on its own thread (skipping to the next keyframe after losses and asking for one) and hands pictures to the UI, which keeps only the newest -(`Latest`). `EncodedSource` wraps a `Streamer` as a `tsc-stream::FrameSource` -for `tsctl stream start`; `SyntheticSource` (fake VP8 bytes) remains for -tsc-stream's own tests. +(`Latest`). `EncodedSource` wraps a `Streamer` as a `voelin-stream::FrameSource` +for `voelinctl stream start`; `SyntheticSource` (fake VP8 bytes) remains for +voelin-stream's own tests. ## Milestones | | Scope | Exit criteria | |---|---|---| -| **M0** | Vendoring, workspace, `tsctl`, dev servers, CI | Builds on Linux + Windows; smoke test passes on TS3 and TS6 | +| **M0** | Vendoring, workspace, `voelinctl`, dev servers, CI | Builds on Linux + Windows; smoke test passes on TS3 and TS6 | | M1 | Protocol modernisation: edition 2024, dependency updates, puzzle rewrite (off-thread, progress, cancel), TS6 declarations (`client_is_streaming`, stream commands), fuzzing | Tests green on both servers, clippy clean | -| M2 | Identities/bookmarks store, audio v0 (Opus, jitter buffer), `tsctl voice` | Tone round-trips between two clients on both servers | -| M3 | `tsc-query` (raw/SSH/HTTP) + observer | Invisible presence and relay chat verified | +| M2 | Identities/bookmarks store, audio v0 (Opus, jitter buffer), `voelinctl voice` | Tone round-trips between two clients on both servers | +| M3 | `voelin-query` (raw/SSH/HTTP) + observer | Invisible presence and relay chat verified | | M4 | Gateway v1 | Presence + channel chat without appearing in the client list, permission denials tested | -| M5 | `tsc-core` + Slint desktop UI (Linux) | Daily use on GNOME, KDE, X11 | +| M5 | `voelin-core` + Slint desktop UI (Linux) | Daily use on GNOME, KDE, X11 | | M6 | Audio quality, global push-to-talk, Windows parity and packaging | One-hour call without drift or echo | | M7 | TS6 stream viewer | Watch an official TS6 client's stream | | M8 | Streamer: capture, system audio, encoders | Official TS6 client watches our 1080p30 stream with sound | diff --git a/docs/audio.md b/docs/audio.md index af035c3..5af6f5e 100644 --- a/docs/audio.md +++ b/docs/audio.md @@ -9,8 +9,8 @@ voice connection ─ Mixer (jitter buffer, Opus decode, per-client volume/mute) └─ Processor::render (echo canceller reference) ``` -The audio thread lives in `tsc-core/src/audio.rs`; the building blocks are in -`tsc-audio`. All user settings are one serde struct, `tsc_audio::AudioSettings`. +The audio thread lives in `voelin-core/src/audio.rs`; the building blocks are in +`voelin-audio`. All user settings are one serde struct, `voelin_audio::AudioSettings`. ## Echo cancellation, noise suppression, gain control @@ -57,7 +57,7 @@ frame, and the talker is dropped after three in a row), and when the smallest queue length over the last 255 packets exceeds its spread, it drops every 100th sample (1 % faster) until the surplus is gone; queues above 0.5 s are truncated. -`crates/tsc-audio/tests/drift.rs` simulates one hour of continuous speech with +`crates/voelin-audio/tests/drift.rs` simulates one hour of continuous speech with 20–60 ms network jitter, reordering and 0.5 % loss, with the sender clock at +200 and -200 ppm (720 ms of disagreement per hour). Marker frames every 30 s measure the end-to-end latency: @@ -88,7 +88,7 @@ Watched streams play through the same mixer under made-up client ids (counting down from 65535) with their own volume (`SetStreamVolume`). Push-to-talk works with the button in the window and a global hotkey -(`tsc_platform::HotkeyManager`: the portal on Wayland, XInput2 on X11, a hook on +(`voelin_platform::HotkeyManager`: the portal on Wayland, XInput2 on X11, a hook on Windows), configurable as e.g. `Ctrl+Shift+T`. ## Devices diff --git a/docs/building.md b/docs/building.md index 3be6850..de533b4 100644 --- a/docs/building.md +++ b/docs/building.md @@ -4,30 +4,36 @@ Every platform has installable packages. CI builds them on each run, and the Dockerfiles in `docker/` build the same kinds of packages on any machine with Docker. Both use `scripts/package.sh`, so file names and contents match. +The packages hold the app, Voelin. The gateway `tsgw` runs on servers and is +packaged for Linux only, separately. `voelinctl` is a development tool and is +in no package (`cargo run -p voelinctl`). + | Platform | Files | Install | |---|---|---| -| Linux x86_64 | `tsc--linux-x86_64.tar.gz` | unpack; `bin/` has `tsc-desktop`, `tsctl`, `tsgw` (prefix layout: `tar -xzf … --strip-components=1 -C ~/.local`) | -| | `tsc-desktop__amd64.deb` | `sudo apt install ./tsc-desktop__amd64.deb` (Ubuntu 24.04+, Debian 13+) | -| | `tsc-desktop.flatpak` (CI only) | `flatpak install --user tsc-desktop.flatpak` | -| Windows x86_64 | `tsc--windows-x86_64.zip` | unpack; `tsc-desktop.exe`, `tsctl.exe`, `tsgw.exe` | -| | `tsc-desktop--setup.exe` | run it (per-machine install, uninstaller in Settings → Apps) | -| Android | `tsc--android-debug.apk` | `adb install …` or open it on the phone (arm64-v8a and x86_64) | -| | `tsc--android-release.apk` | only with signing configured ([release.md](release.md#android-apk-signing)) | +| Linux x86_64 | `voelin--linux-x86_64.tar.gz` | unpack; `bin/voelin` plus desktop file and icon (prefix layout: `tar -xzf … --strip-components=1 -C ~/.local`) | +| | `voelin__amd64.deb` | `sudo apt install ./voelin__amd64.deb` (Ubuntu 24.04+, Debian 13+) | +| | `voelin.flatpak` (CI only) | `flatpak install --user voelin.flatpak` | +| Linux server | `tsgw__amd64.deb` | `sudo apt install ./tsgw__amd64.deb`, then configure and start it ([gateway-admin.md](gateway-admin.md#install)) | +| | `tsgw--linux-x86_64.tar.gz` | unpack; `bin/tsgw`, the systemd unit and the example config | +| | `tsgw-image.tar.gz` (CI only) | `docker load -i tsgw-image.tar.gz` | +| Windows x86_64 | `voelin--windows-x86_64.zip` | unpack; `voelin.exe` | +| | `voelin--setup.exe` | run it (per-machine install, uninstaller in Settings → Apps) | +| Android | `voelin--android-debug.apk` | `adb install …` or open it on the phone (arm64-v8a and x86_64) | +| | `voelin--android-release.apk` | only with signing configured ([release.md](release.md#android-apk-signing)) | Each package run also writes `SHA256SUMS-`. Nothing is code-signed yet: Windows SmartScreen warns about the installer, and the debug APK is signed with a debug key (fine for testing, not for the Play Store). -The gateway also runs as a container ([gateway-admin.md](gateway-admin.md)): -CI uploads the image as `tsgw-image.tar.gz` (`docker load -i tsgw-image.tar.gz`, -then `docker run … tsgw:`), or build it with -`docker build -f crates/tsc-gateway/Dockerfile -t tsgw .`. +The gateway's image can also be built directly: +`docker build -f crates/voelin-gateway/Dockerfile -t tsgw .`. ## From CI `.github/workflows/ci.yml` uploads one artifact per platform on every run: -`tsc-linux-x86_64`, `tsc-windows-x86_64`, `tsc-flatpak-x86_64`, -`tsc-android` and `tsgw-image`. Download them from the run's page (Actions → the run → +`voelin-linux-x86_64` (the app's and the gateway's Linux packages), +`voelin-windows-x86_64`, `voelin-flatpak-x86_64`, `voelin-android` and +`tsgw-image`. Download them from the run's page (Actions → the run → Artifacts), or with the GitHub CLI: ```sh @@ -43,8 +49,8 @@ to a **draft** GitHub release, which you review and publish by hand The Windows packages from CI use the MSVC toolchain and libvpx from vcpkg. The Android job builds a signed release APK only when the repository has the -signing secrets (`ANDROID_KEYSTORE_BASE64`, `TSC_SIGNING_STORE_PASSWORD`, -`TSC_SIGNING_KEY_ALIAS`, `TSC_SIGNING_KEY_PASSWORD`). +signing secrets (`ANDROID_KEYSTORE_BASE64`, `VOELIN_SIGNING_STORE_PASSWORD`, +`VOELIN_SIGNING_KEY_ALIAS`, `VOELIN_SIGNING_KEY_PASSWORD`). `.github/workflows/docker.yml` builds the Docker files below weekly, by hand (Actions → Docker builds → Run workflow) and when they change, and uploads @@ -68,7 +74,7 @@ BuildKit cache mounts (`docker builder prune` frees them). | Dockerfile | Builds | Notes | |---|---|---| -| `docker/linux.Dockerfile` | `.tar.gz` and `.deb` on Ubuntu 24.04 | the binaries need glibc 2.39+ and the libraries the `.deb` lists | +| `docker/linux.Dockerfile` | the app's and the gateway's `.tar.gz` and `.deb` on Ubuntu 24.04 | the binaries need glibc 2.39+ and the libraries the `.deb` lists | | `docker/windows.Dockerfile` | `.zip` and the NSIS installer | cross-compiled for `x86_64-pc-windows-gnu` with mingw-w64 and a static libvpx; works on Windows 10 and 11 | | `docker/android.Dockerfile` | debug APK | SDK, NDK and cargo-ndk as in CI; `--build-arg ABIS=arm64-v8a,x86_64,armeabi-v7a` picks the ABIs | @@ -80,8 +86,8 @@ scripts/docker-build.sh android --build-arg APK=release \ --secret id=keystore,src=release.jks --secret id=signing,src=signing.env ``` -For the signed release APK, `signing.env` holds `TSC_SIGNING_STORE_PASSWORD=…`, -`TSC_SIGNING_KEY_ALIAS=…` and `TSC_SIGNING_KEY_PASSWORD=…`. Secrets are not +For the signed release APK, `signing.env` holds `VOELIN_SIGNING_STORE_PASSWORD=…`, +`VOELIN_SIGNING_KEY_ALIAS=…` and `VOELIN_SIGNING_KEY_PASSWORD=…`. Secrets are not stored in the image or the build cache. **Behind a proxy:** `scripts/docker-build.sh` passes `HTTPS_PROXY`, @@ -93,7 +99,7 @@ the proxy is on localhost. If the proxy inspects TLS, set - **Linux:** the packages from the table above need `sudo apt install libasound2-dev libfontconfig1-dev libxkbcommon-dev libvpx-dev libdav1d-dev libpipewire-0.3-dev libspa-0.2-dev libclang-dev cmake dpkg-dev`, - then `cargo build --release --locked -p tsc-ui -p tsctl -p tsc-gateway` + then `cargo build --release --locked -p voelin-ui -p voelin-gateway` and `scripts/package.sh linux`. - **Windows:** [packaging/windows/README.md](../packaging/windows/README.md) (MSVC, vcpkg libvpx, NSIS), then `bash scripts/package.sh windows` from Git Bash. diff --git a/docs/gateway-admin.md b/docs/gateway-admin.md index 2d51139..34f5878 100644 --- a/docs/gateway-admin.md +++ b/docs/gateway-admin.md @@ -1,9 +1,9 @@ # Running the tsgw gateway -`tsgw` lets users of this client see who is in which channel and read and +`tsgw` lets users of Voelin see who is in which channel and read and write channel chat **without joining voice**, on a server you administer. It holds ServerQuery sessions (invisible to normal users of the official clients) -and serves users over a WebSocket (`tsgw.v1+json`, see `crates/tsc-gateway-proto`). +and serves users over a WebSocket (`tsgw.v1+json`, see `crates/voelin-gateway-proto`). ## What users get @@ -56,17 +56,52 @@ is written to the audit table. `relay.max_channel_relays` below the server's per-IP connection limit. Relays count toward a channel's max clients unless their group has `b_channel_join_ignore_maxclients`. -5. Copy `crates/tsc-gateway/tsgw.example.toml` to `tsgw.toml`, set the query - address and credentials (`TSGW_QUERY_PASSWORD` or `password_file`). +5. Install tsgw ([below](#install)), copy the example config to + `/etc/tsgw/tsgw.toml` and set the query address and credentials + (`TSGW_QUERY_PASSWORD` or `password_file`). 6. Run it behind TLS (Caddy, nginx) and give users the `wss://…/v1` URL. +## Install + +tsgw is packaged for Linux servers, separately from the app +([building.md](building.md)): every CI run uploads the packages in the +`voelin-linux-x86_64` artifact and the image as `tsgw-image`, and +`scripts/docker-build.sh linux` builds them locally. + +**Debian/Ubuntu** (`tsgw__amd64.deb`, Ubuntu 24.04+ / Debian 13+). +It installs `/usr/bin/tsgw` and a systemd unit that is not started until +there is a config: + ```sh -cargo run --release -p tsc-gateway -- --config tsgw.toml -# or -docker build -f crates/tsc-gateway/Dockerfile -t tsgw . -docker run -v $PWD/tsgw.toml:/etc/tsgw/tsgw.toml -p 7788:7788 tsgw +sudo apt install ./tsgw__amd64.deb +sudo install -d -m 755 /etc/tsgw +sudo cp /usr/share/doc/tsgw/examples/tsgw.example.toml /etc/tsgw/tsgw.toml +sudoedit /etc/tsgw/tsgw.toml +# The query password, readable by root only (systemd reads it before +# starting tsgw as an unprivileged dynamic user). +echo 'TSGW_QUERY_PASSWORD=…' | sudo install -m 600 /dev/stdin /etc/tsgw/tsgw.env +sudo systemctl enable --now tsgw +journalctl -u tsgw -f ``` +The audit database (`path = "tsgw.db"`) ends up in `/var/lib/tsgw`. The unit +(`packaging/linux/tsgw.service`) runs tsgw sandboxed: no write access outside +that directory, network only. + +**Other distributions** (`tsgw--linux-x86_64.tar.gz`): `bin/tsgw`, +the same unit in `lib/systemd/system/` and the example config in +`share/doc/tsgw/`. Copy the binary to `/usr/bin` (or change `ExecStart`) and +the unit to `/etc/systemd/system/`. + +**Container** (`tsgw-image.tar.gz`, or build it): + +```sh +docker load -i tsgw-image.tar.gz # or: docker build -f crates/voelin-gateway/Dockerfile -t tsgw . +docker run -v $PWD/tsgw.toml:/etc/tsgw/tsgw.toml -e TSGW_QUERY_PASSWORD=… -p 7788:7788 tsgw +``` + +**From source:** `cargo run --release -p voelin-gateway -- --config tsgw.toml`. + ## Visibility Query clients are not hidden by the server; official clients hide them from diff --git a/docs/i18n.md b/docs/i18n.md index 460d7de..5eb0161 100644 --- a/docs/i18n.md +++ b/docs/i18n.md @@ -51,14 +51,14 @@ translated sentence; they stay in English. ## Files ``` -crates/tsc-ui/lang/ - tsc-ui.pot template, generated - de/LC_MESSAGES/tsc-ui.po one directory per language (gettext locale name) - pt_BR/LC_MESSAGES/tsc-ui.po +crates/voelin-ui/lang/ + voelin-ui.pot template, generated + de/LC_MESSAGES/voelin-ui.po one directory per language (gettext locale name) + pt_BR/LC_MESSAGES/voelin-ui.po ``` The file name is the translation domain, which is the crate name -(`tsc-ui`); Slint's build looks for `lang//LC_MESSAGES/.po`. +(`voelin-ui`); Slint's build looks for `lang//LC_MESSAGES/.po`. ## Workflow @@ -68,21 +68,21 @@ MSYS2 or Git for Windows' bundled tools). ```sh # 1. Extract the template after changing strings -slint-tr-extractor --package-name tsc-ui crates/tsc-ui/ui/*.slint -o crates/tsc-ui/lang/tsc-ui.pot +slint-tr-extractor --package-name voelin-ui crates/voelin-ui/ui/*.slint -o crates/voelin-ui/lang/voelin-ui.pot # 2. Update every translation (new strings empty, changed ones fuzzy) -for po in crates/tsc-ui/lang/*/LC_MESSAGES/tsc-ui.po; do - msgmerge --update --backup=none "$po" crates/tsc-ui/lang/tsc-ui.pot +for po in crates/voelin-ui/lang/*/LC_MESSAGES/voelin-ui.po; do + msgmerge --update --backup=none "$po" crates/voelin-ui/lang/voelin-ui.pot done # 3. Start a new language -mkdir -p crates/tsc-ui/lang/de/LC_MESSAGES -msginit --no-translator --locale=de --input=crates/tsc-ui/lang/tsc-ui.pot \ - --output-file=crates/tsc-ui/lang/de/LC_MESSAGES/tsc-ui.po +mkdir -p crates/voelin-ui/lang/de/LC_MESSAGES +msginit --no-translator --locale=de --input=crates/voelin-ui/lang/voelin-ui.pot \ + --output-file=crates/voelin-ui/lang/de/LC_MESSAGES/voelin-ui.po ``` Translators edit the `.po` files (Poedit, Lokalize, or a hosted service -such as Weblate pointed at `crates/tsc-ui/lang`). Fuzzy and untranslated +such as Weblate pointed at `crates/voelin-ui/lang`). Fuzzy and untranslated entries fall back to English. Run the extraction when strings change and before each release (string freeze, see [release.md](release.md)). The template carries a creation date and source line numbers, so CI does not @@ -91,7 +91,7 @@ translatable yet. ## Bundling and language selection -`crates/tsc-ui/build.rs` compiles the translations into the binary: +`crates/voelin-ui/build.rs` compiles the translations into the binary: ```rust slint_build::compile_with_config( @@ -113,7 +113,7 @@ calls `slint::select_bundled_translation("de")` after the window has been created; `""` or `"en"` selects English. Changing it takes effect immediately for all `@tr` strings. -The desktop app (tsc-ui) and the Android app share the `.slint` files and +The desktop app (voelin-ui) and the Android app share the `.slint` files and therefore the translations. Texts outside Slint need their own mechanism: - Android system texts (foreground service notification, permission diff --git a/docs/media.md b/docs/media.md index a4f1045..0142556 100644 --- a/docs/media.md +++ b/docs/media.md @@ -1,8 +1,8 @@ -# Media: frames, codecs and capture (`tsc-media`) +# Media: frames, codecs and capture (`voelin-media`) -`crates/tsc-media` turns screens and system audio into frames, encodes and +`crates/voelin-media` turns screens and system audio into frames, encodes and decodes video, and converts pixels for rendering. It does no networking: -`tsc-stream` carries the encoded frames (`Peer::write(MediaKind::Video, +`voelin-stream` carries the encoded frames (`Peer::write(MediaKind::Video, MediaTime::new(frame.pts_90khz, Frequency::NINETY_KHZ), data)`), and received `MediaFrame`s go to `VideoDecoder::decode`. @@ -27,7 +27,7 @@ MediaTime::new(frame.pts_90khz, Frequency::NINETY_KHZ), data)`), and received ```rust let codecs = Codecs::new().with_openh264(OpenH264::find_in(&data_dir)?); // H.264 optional -let mut capture = tsc_media::capture::default_screen_capture()?; +let mut capture = voelin_media::capture::default_screen_capture()?; let mut frames = capture.start(&SourceId::Monitor(0), &CaptureOptions::default()).await?; let codec = codecs.pick_encoder(&viewer_codecs).unwrap(); let mut encoder = codecs.new_encoder(codec, EncoderConfig::default())?; @@ -38,12 +38,12 @@ while let Some(frame) = frames.recv().await { } ``` -## The pipeline in `tsc-core` (`media` module) +## The pipeline in `voelin-core` (`media` module) -Feature `media` of tsc-core builds the module with whatever tsc-media backends +Feature `media` of voelin-core builds the module with whatever voelin-media backends are enabled (on Android: MediaCodec and the app's capture source); -`media-desktop` adds tsc-media's default backends (libvpx, OpenH264, X11, -PipeWire). The desktop app and tsctl use `media-desktop`, the Android app +`media-desktop` adds voelin-media's default backends (libvpx, OpenH264, X11, +PipeWire). The desktop app and voelinctl use `media-desktop`, the Android app `media`. Codecs are always chosen through `Codecs`, so each build uses its own. ``` @@ -72,7 +72,7 @@ viewer: Engine::subscribe_frames ─ VideoPipeline (thread) ─ VideoDecoder sequence header OBU). - `Viewer` feeds a `VideoPipeline` from the engine and sends `RequestStreamKeyframe`; `LocalPreview` runs capture → encoder → decoder - without a server (the desktop app's `TSC_DEMO_STREAM`). + without a server (the desktop app's `VOELIN_DEMO_STREAM`). - The audio of watched streams does not go through this module: the session hands the Opus frames to its audio thread, which plays them through the jitter buffer and mixer under a made-up client id, with its own volume. @@ -167,7 +167,7 @@ Notes: our memfd (`capture/x11/shm.rs`). - Portal: `start` needs a tokio runtime (zbus runs on it) and may show the desktop's picker. Choices persist with `PersistMode::ExplicitlyRevoked`: store - `PortalCapture::restore_token()` (e.g. in `tsc-store` settings) and pass it to + `PortalCapture::restore_token()` (e.g. in `voelin-store` settings) and pass it to `PortalCapture::with_restore_token` next time. The cursor is embedded when the portal supports it. Only shared-memory buffers (BGRx/BGRA/RGBx/RGBA) are negotiated; DMA-BUF import is a TODO. Without a session bus or portal, @@ -188,12 +188,12 @@ Linux (Debian/Ubuntu packages): `libvpx-dev` (feature `vpx`), PipeWire bindings run bindgen), `pkg-config`, and `libdav1d-dev` for `--features av1`. X11 capture is pure Rust (x11rb) and needs no packages. Tests of X11 capture need an X server: `xvfb`, run with `xvfb-run -a cargo -test -p tsc-media` (skipped without `DISPLAY`). +test -p voelin-media` (skipped without `DISPLAY`). Windows: libvpx is not found through pkg-config there. Install it (e.g. `vcpkg install libvpx:x64-windows`) and set `VPX_LIB_DIR`, `VPX_INCLUDE_DIR` and `VPX_VERSION`, or build without the `vpx` feature. The Windows capture -code is type-checked on Linux (`cargo clippy -p tsc-media --target +code is type-checked on Linux (`cargo clippy -p voelin-media --target x86_64-pc-windows-gnu --no-default-features --features openh264`) but has not run on Windows yet. @@ -218,7 +218,7 @@ run on Windows yet. |---|---|---| | Frame validation, YUV ↔ RGB (values, NV12, odd sizes, strides) | unit tests | tested | | VP8 / VP9 encode → decode (PSNR > 30 dB, rectangle colour, forced keyframes, bitrate change, resolution change) | unit tests, `tests/codec_roundtrip.rs` | tested | -| H.264 with Cisco's 2.6.0 library (PSNR, Constrained High `profile_idc` 100, Baseline 66) | `tests/openh264.rs` with `TSC_OPENH264_LIB` | tested locally, skipped without the library | +| H.264 with Cisco's 2.6.0 library (PSNR, Constrained High `profile_idc` 100, Baseline 66) | `tests/openh264.rs` with `VOELIN_OPENH264_LIB` | tested locally, skipped without the library | | OpenH264 download, SHA-256 check, reuse | `tests/openh264.rs -- --ignored` | tested locally (network) | | H.264 library missing / unknown file | unit + integration tests | tested | | AV1 decoder construction, garbage input | unit test (`--features av1`) | tested; no AV1 stream decoded (no encoder available) | @@ -227,12 +227,12 @@ run on Windows yet. | Portal capture, PipeWire video and audio streams | – | compiles only (no portal or PipeWire daemon here) | | Windows Graphics Capture, WASAPI | – | type-checked for `x86_64-pc-windows-gnu` only | | Hardware encoders | – | stubs | -| Test pattern → VP8 → decoder, rectangle position and colour | `tsc-core` `media::tests::local_preview_decodes_the_pattern` | tested | -| Test pattern → two engine stream tasks → str0m peers on loopback → decoder | `tsc-core` `stream::tests::test_pattern_through_stream_tasks` | tested | -| Stream audio (RTP time → jitter buffer ids, volume, end) | `tsc-core` `audio::tests::stream_audio_with_volume`, stream task test | tested | -| The same through the TeamSpeak 6 server | `tsc-core/tests/media_live.rs` (`TSC_LIVE=1`), `tsctl stream start --synthetic` / `watch --expect-frames` | tested against 6.0.0-beta13.1 | -| X11 monitor capture → VP8 → server → decoder | `tsctl stream start --source x11` under Xvfb | tested manually (debug build: about 8 fps at 1400×900) | -| Desktop app watching and sharing | Xvfb, `TSC_AUTOWATCH` / `TSC_AUTOSHARE` against tsctl, screenshots | tested manually | +| Test pattern → VP8 → decoder, rectangle position and colour | `voelin-core` `media::tests::local_preview_decodes_the_pattern` | tested | +| Test pattern → two engine stream tasks → str0m peers on loopback → decoder | `voelin-core` `stream::tests::test_pattern_through_stream_tasks` | tested | +| Stream audio (RTP time → jitter buffer ids, volume, end) | `voelin-core` `audio::tests::stream_audio_with_volume`, stream task test | tested | +| The same through the TeamSpeak 6 server | `voelin-core/tests/media_live.rs` (`VOELIN_LIVE=1`), `voelinctl stream start --synthetic` / `watch --expect-frames` | tested against 6.0.0-beta13.1 | +| X11 monitor capture → VP8 → server → decoder | `voelinctl stream start --source x11` under Xvfb | tested manually (debug build: about 8 fps at 1400×900) | +| Desktop app watching and sharing | Xvfb, `VOELIN_AUTOWATCH` / `VOELIN_AUTOSHARE` against voelinctl, screenshots | tested manually | | External capture providers (start, refusal, end of capture, default selection) | unit tests | tested | | MediaCodec buffer layouts (I420, NV12 with padding, `MediaImage2` NV21, crop) | unit tests (`codec::image_layout`) | tested | | MediaCodec encoders and decoders | – | compiles for `aarch64-linux-android` only (no device or emulator here) | diff --git a/docs/protocol-notes/ts6-streaming.md b/docs/protocol-notes/ts6-streaming.md index fe4b56a..8a253a6 100644 --- a/docs/protocol-notes/ts6-streaming.md +++ b/docs/protocol-notes/ts6-streaming.md @@ -7,7 +7,7 @@ capture teaches something new. ## Legacy protocol on TS6 servers -- **Confirmed** (tsctl, 6.0.0-beta13.1, 2026-09-25): the TS3 client protocol +- **Confirmed** (voelinctl, 6.0.0-beta13.1, 2026-09-25): the TS3 client protocol connects (`initivexpand2` license chain with the TS5-server block type), channel tree, server chat and channel chat work. Client version: the vendored default `Windows_3_X_X__1`. @@ -19,7 +19,7 @@ capture teaches something new. (28 characters), TeamSpeak 6 uses `base64(SHA256(omega))` (44 characters), where omega is the base64 public key string. The same identity therefore has a different `client_unique_identifier` on each server generation - (`tsc-gateway-proto::UniqueIds`). + (`voelin-gateway-proto::UniqueIds`). - **Confirmed**: TS6 has no raw ServerQuery port; SSH query on 10022 and HTTP WebQuery on 10080 (HTTPS 10443). - **Reported**: beta13 made the Init1 puzzle difficulty adaptive to the server's @@ -64,7 +64,7 @@ candidates come back through `streamsignaling` / `notifystreamsignaling`. ### Probe results (confirmed, 6.0.0-beta13.1, default permissions, 2026-09-25) -Sent with `tsctl connect 127.0.0.1:9988 raw ''` as a plain guest: +Sent with `voelinctl connect 127.0.0.1:9988 raw ''` as a plain guest: | Command | Result | |---|---| @@ -104,7 +104,7 @@ server binary against a live stream (`is_remove` matches the ### End-to-end stream (confirmed, 6.0.0-beta13.1, 2026-09-25) -`crates/tsc-stream/tests/live_ts6.rs` runs a whole stream between two of our +`crates/voelin-stream/tests/live_ts6.rs` runs a whole stream between two of our clients through the server, with str0m on both ends: ``` @@ -177,18 +177,18 @@ cannot discover the ids of unknown streams), `updatestream` (`stream_id`, `initserver` and `notifycliententerview` carry `client_is_streaming`, but no stream id, and the server does not send `notifystreamstarted` for running -streams to a client that connects later: a `tsctl stream list` started while +streams to a client that connects later: a `voelinctl stream list` started while the desktop app streamed printed only "id not announced", while one connected before the stream started got the id. Entering the channel later was not -probed separately. `tsctl stream list` shows such streamers as "id not -announced"; `tsctl stream watch --id ` can still join when the streamer +probed separately. `voelinctl stream list` shows such streamers as "id not +announced"; `voelinctl stream watch --id ` can still join when the streamer is known (`--streamer-nick`, or the only other client streaming). The desktop app lists them as streaming but not watchable. The smoke test starts the viewer first. How the official client learns these ids is open. ### WebRTC interop with Chromium (confirmed, Chromium 141, 2026-09-26) -`crates/tsc-stream/tests/browser_interop.rs` (`TSC_INTEROP=1`, see +`crates/voelin-stream/tests/browser_interop.rs` (`VOELIN_INTEROP=1`, see `tests/interop/README.md`) runs our str0m peers against headless Chromium's libwebrtc, the stack the official client is built on: diff --git a/docs/release.md b/docs/release.md index 37b9119..9685dd5 100644 --- a/docs/release.md +++ b/docs/release.md @@ -1,19 +1,18 @@ # Releasing -How a release is versioned, built, signed and checked. The product name and -app id are still placeholders (see [packaging/README.md](../packaging/README.md)); -rename them before the first public release, since the app id cannot change -afterwards on Flathub or Google Play. +How a release is versioned, built, signed and checked. The app id +`io.github.faumaray.Voelin` ([packaging/README.md](../packaging/README.md)) +cannot change after the first release on Flathub or Google Play. ## Versioning -- One version for the apps: `version` of `crates/tsc-ui` (desktop; the - installer and the About page read it), `crates/tsc-android` and the +- One version for the apps: `version` of `crates/voelin-ui` (desktop; the + installer and the About page read it), `crates/voelin-android` and the Android app's `versionName`. Semantic versioning; before 1.0 a minor bump may break settings or the gateway protocol, and the changelog says so. - Android `versionCode` must grow with every upload: `major * 1000000 + minor * 1000 + patch` (0.2.3 is 2003). -- The gateway `tsgw` (`crates/tsc-gateway`) is versioned on its own, since +- The gateway `tsgw` (`crates/voelin-gateway`) is versioned on its own, since server admins update it separately. Its wire protocol is versioned in the WebSocket subprotocol (`tsgw.v1+json`); a breaking change needs `v2` and a period in which the gateway serves both. @@ -28,7 +27,7 @@ afterwards on Flathub or Google Play. change a user or server admin notices adds a line under `Unreleased` (Added / Changed / Fixed / Removed / Security). At release the section gets the version and date, and its highlights also go into the `` entry -of `packaging/linux/io.github.faumaray.TsClient.metainfo.xml` (shown by +of `packaging/linux/io.github.faumaray.Voelin.metainfo.xml` (shown by software centers and Flathub). Release notes also state the TeamSpeak server versions the release was tested against (TS3 and TS6 from `dev/docker-compose.yml`). @@ -36,7 +35,7 @@ versions the release was tested against (TS3 and TS6 from ## Third-party notices `THIRD_PARTY_NOTICES.md` lists the licenses of everything compiled into the -apps. It is shown in the About page (`tsc_platform::notices::text()`) and +apps. It is shown in the About page (`voelin_platform::notices::text()`) and shipped in every package. It is generated, never edited: ```sh @@ -74,7 +73,7 @@ are written to `$RUNNER_TEMP` in the job and deleted at its end. ### Windows (Authenticode) Unsigned executables trigger SmartScreen warnings; signed ones build -reputation with the publisher's certificate. Sign `tsc-desktop.exe` first, +reputation with the publisher's certificate. Sign `voelin.exe` first, then build the installer with `/DSIGN=...`, which signs the installer and the uninstaller it writes (see [packaging/windows/README.md](../packaging/windows/README.md)). Always timestamp (`/tr ... /td SHA256`), so signatures stay valid after the @@ -92,7 +91,7 @@ Options for the certificate: # metadata.json: {"Endpoint": "https://.codesigning.azure.net", # "CodeSigningAccountName": "", "CertificateProfileName": ""} signtool sign /v /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 ` - /dlib Azure.CodeSigning.Dlib.dll /dmdf metadata.json target\release\tsc-desktop.exe + /dlib Azure.CodeSigning.Dlib.dll /dmdf metadata.json target\release\voelin.exe ``` In GitHub Actions, `azure/trusted-signing-action` does the same with a @@ -116,7 +115,7 @@ the installer and `uninstall.exe` after installing. and `... repo`, `appstreamcli validate` on the metainfo, add screenshots and the release entry to the metainfo. Flathub reviews names and branding: the app must not look like an official TeamSpeak product. -- For our own releases (GitHub): a tarball of `tsc-desktop` with the desktop +- For our own releases (GitHub): a tarball of `voelin` with the desktop file, metainfo, icon and notices, and optionally a Flatpak bundle (`flatpak build-bundle --gpg-sign= ...`). Publish `SHA256SUMS` and sign it (`gpg --detach-sign` or minisign) with a key whose fingerprint is @@ -128,20 +127,20 @@ APKs and app bundles are signed with a keystore kept outside the repository; losing it means existing installs can no longer be updated. - Create it once: - `keytool -genkeypair -v -keystore tsc-release.jks -alias tsc -keyalg RSA -keysize 4096 -validity 10000`, + `keytool -genkeypair -v -keystore voelin-release.jks -alias voelin -keyalg RSA -keysize 4096 -validity 10000`, and back it up (two offline copies, password in a password manager). - The Gradle build reads the keystore path, alias and passwords from Gradle properties or environment variables (`~/.gradle/gradle.properties`, CI - secrets), never from files in the repository: `tsc.signing.storeFile`, - `tsc.signing.storePassword`, `tsc.signing.keyAlias`, - `tsc.signing.keyPassword`, or `TSC_SIGNING_STORE_FILE`, - `TSC_SIGNING_STORE_PASSWORD`, `TSC_SIGNING_KEY_ALIAS`, - `TSC_SIGNING_KEY_PASSWORD` ([android.md](android.md)). Without them it + secrets), never from files in the repository: `voelin.signing.storeFile`, + `voelin.signing.storePassword`, `voelin.signing.keyAlias`, + `voelin.signing.keyPassword`, or `VOELIN_SIGNING_STORE_FILE`, + `VOELIN_SIGNING_STORE_PASSWORD`, `VOELIN_SIGNING_KEY_ALIAS`, + `VOELIN_SIGNING_KEY_PASSWORD` ([android.md](android.md)). Without them it builds unsigned or debug-signed artifacts only. - CI: the `android` job signs a release APK when the repository has the - secrets `ANDROID_KEYSTORE_BASE64` (`base64 -w0 tsc-release.jks`), - `TSC_SIGNING_STORE_PASSWORD`, `TSC_SIGNING_KEY_ALIAS` and - `TSC_SIGNING_KEY_PASSWORD`; the keystore is decoded to `$RUNNER_TEMP` and + secrets `ANDROID_KEYSTORE_BASE64` (`base64 -w0 voelin-release.jks`), + `VOELIN_SIGNING_STORE_PASSWORD`, `VOELIN_SIGNING_KEY_ALIAS` and + `VOELIN_SIGNING_KEY_PASSWORD`; the keystore is decoded to `$RUNNER_TEMP` and removed afterwards. Check with `apksigner verify --print-certs app-release.apk`. - Google Play: use Play App Signing; our keystore is then the upload key (it can be reset through Play support if lost). F-Droid builds and signs @@ -163,16 +162,17 @@ Before tagging: version, results committed; failures are fixed or listed as known issues. 5. Translations: `.pot` regenerated and `.po` files merged ([i18n.md](i18n.md)); string freeze announced a week before. -6. Versions bumped (`crates/tsc-ui`, `crates/tsc-android`, Android - `versionName` / `versionCode`, `tsc-gateway` if it changed), +6. Versions bumped (`crates/voelin-ui`, `crates/voelin-android`, Android + `versionName` / `versionCode`, `voelin-gateway` if it changed), `Cargo.lock` updated, changelog and metainfo `` written. Release: 7. Tag `v` (signed) on the release commit and push it. -8. The tag's CI run builds every package ([building.md](building.md)): Linux - tarball and `.deb`, Flatpak bundle, Windows zip and installer, Android APKs - (signed when the secrets are set), the gateway image; its `release` job +8. The tag's CI run builds every package ([building.md](building.md)): the + app's Linux tarball and `.deb`, Flatpak bundle, Windows zip and installer + and Android APKs (signed when the secrets are set), and the gateway's + Linux tarball, `.deb` and image; its `release` job attaches them with a `SHA256SUMS` to a draft GitHub release. Sign the Windows executable and installer, and an AAB for Google Play, by hand until CI has the certificates. diff --git a/docs/testing/manual-matrix.md b/docs/testing/manual-matrix.md index 37d864a..005e20b 100644 --- a/docs/testing/manual-matrix.md +++ b/docs/testing/manual-matrix.md @@ -159,7 +159,7 @@ noted. no Rust toolchain): SmartScreen and UAC show the publisher of the signature, the app starts from the Start menu, an update over the previous version keeps the settings, uninstall from Settings > Apps - removes the files, shortcut and registry key and keeps `%APPDATA%\tsc`; + removes the files, shortcut and registry key and keeps `%APPDATA%\voelin`; `uninstall.exe /S` works too. - **IN3** Android APK: install, update over the previous version (same signature, data kept), uninstall. @@ -177,11 +177,11 @@ noted. - **GE1** About page: the AboutSlint widget, the OpenH264 attribution and the full third-party notices (scrollable) are shown. - **GE2** Crash reports: with reports enabled, start the app with - `TSC_TEST_CRASH=1`: it exits with a panic and, on the next start, offers + `VOELIN_TEST_CRASH=1`: it exits with a panic and, on the next start, offers the report (open folder, delete). With reports disabled nothing is - written. Reports are in `~/.local/state/tsc/crash-reports` (Flatpak: - `~/.var/app//.local/state/tsc/crash-reports`) or - `%LOCALAPPDATA%\tsc\crash-reports`. + written. Reports are in `~/.local/state/voelin/crash-reports` (Flatpak: + `~/.var/app//.local/state/voelin/crash-reports`) or + `%LOCALAPPDATA%\voelin\crash-reports`. - **GE3** Saved passwords survive a restart (GNOME Keyring, KWallet, Windows Credential Manager, Android Keystore); without a keyring the app warns and keeps them for the session only. diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 226c4d9..4f628ab 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -1268,16 +1268,6 @@ dependencies = [ "tsproto-types", ] -[[package]] -name = "tsc-fuzz" -version = "0.0.0" -dependencies = [ - "libfuzzer-sys", - "ts-bookkeeping", - "tsproto", - "tsproto-packets", -] - [[package]] name = "tsproto" version = "0.2.0" @@ -1377,6 +1367,16 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "voelin-fuzz" +version = "0.0.0" +dependencies = [ + "libfuzzer-sys", + "ts-bookkeeping", + "tsproto", + "tsproto-packets", +] + [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index ed88ccc..b137d41 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsc-fuzz" +name = "voelin-fuzz" version = "0.0.0" publish = false edition = "2024" diff --git a/packaging/README.md b/packaging/README.md index 8b92189..a7f6e93 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -1,19 +1,24 @@ # Packaging -The product name is not decided yet: `TS Client` and the app id -`io.github.faumaray.TsClient` are placeholders (also in -`tsc_platform::{APP_NAME, APP_ID}`); rename them everywhere together. +The product is **Voelin**, with the app id `io.github.faumaray.Voelin` (also in +`voelin_platform::{APP_NAME, APP_ID}`). The app id names the desktop file, +metainfo, icon, Flatpak and Android app, and cannot change once published. | Path | What | |---|---| -| `linux/` | Desktop file, AppStream metainfo and a placeholder icon, named by app id | -| `flatpak/io.github.faumaray.TsClient.yml` | Flatpak manifest | +| `linux/` | Desktop file, AppStream metainfo and icon, named by app id; `tsgw.service`, the gateway's systemd unit ([gateway-admin.md](../docs/gateway-admin.md#install)) | +| `flatpak/io.github.faumaray.Voelin.yml` | Flatpak manifest | | `windows/` | NSIS installer and how to build and sign on Windows ([README](windows/README.md)) | +`scripts/package.sh` builds the packages from these ([docs/building.md](../docs/building.md)): +the app for Linux, Windows and Android, and the gateway `tsgw` for Linux servers +only, as its own package. + Every package also carries `THIRD_PARTY_NOTICES.md` (generated by `scripts/notices.sh`, see [docs/release.md](../docs/release.md)): Flatpak in `/app/share/licenses//`, the Windows installer next to the executable, -the CI artifacts in the archive. The app shows the same text in its About page. +the `.deb` files in `/usr/share/doc//`, the archives in `share/doc/`. +The app shows the same text in its About page. ## Flatpak @@ -27,8 +32,8 @@ python3 flatpak-cargo-generator.py Cargo.lock -o packaging/flatpak/cargo-sources flatpak install flathub org.freedesktop.Platform//25.08 org.freedesktop.Sdk//25.08 \ org.freedesktop.Sdk.Extension.rust-stable//25.08 org.freedesktop.Sdk.Extension.llvm20//25.08 -flatpak-builder --user --install --force-clean build-flatpak packaging/flatpak/io.github.faumaray.TsClient.yml -flatpak run io.github.faumaray.TsClient +flatpak-builder --user --install --force-clean build-flatpak packaging/flatpak/io.github.faumaray.Voelin.yml +flatpak run io.github.faumaray.Voelin ``` Regenerate `cargo-sources.json` whenever `Cargo.lock` changes. Inside the build @@ -44,5 +49,6 @@ notifications and the Secret Service. Push-to-talk (GlobalShortcuts) and screen capture (ScreenCast) go through portals and need no permission. Desktops match windows to the desktop file (taskbar icon, portal permissions) by -X11 `WM_CLASS`, which is the binary name `tsc-desktop` (hence `StartupWMClass`), -and on Wayland by the window's app id, which the app should set to the app id. +the window's app id on Wayland and its X11 `WM_CLASS` class. The app sets both +to the app id (`slint::set_xdg_app_id`), which is the desktop file's name and +its `StartupWMClass`. diff --git a/packaging/flatpak/io.github.faumaray.TsClient.yml b/packaging/flatpak/io.github.faumaray.Voelin.yml similarity index 71% rename from packaging/flatpak/io.github.faumaray.TsClient.yml rename to packaging/flatpak/io.github.faumaray.Voelin.yml index 32cf1bd..f2e7b31 100644 --- a/packaging/flatpak/io.github.faumaray.TsClient.yml +++ b/packaging/flatpak/io.github.faumaray.Voelin.yml @@ -1,6 +1,6 @@ # Flatpak manifest for the desktop app. See packaging/README.md for how to -# build it. The app id is a placeholder until the product has a name. -id: io.github.faumaray.TsClient +# build it. +id: io.github.faumaray.Voelin runtime: org.freedesktop.Platform runtime-version: "25.08" sdk: org.freedesktop.Sdk @@ -8,7 +8,7 @@ sdk-extensions: - org.freedesktop.Sdk.Extension.rust-stable # libclang for bindgen (the PipeWire bindings); the SDK has none. - org.freedesktop.Sdk.Extension.llvm20 -command: tsc-desktop +command: voelin finish-args: - --share=network @@ -35,21 +35,21 @@ build-options: append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm20/bin prepend-ld-library-path: /usr/lib/sdk/llvm20/lib env: - CARGO_HOME: /run/build/tsc/cargo + CARGO_HOME: /run/build/voelin/cargo CARGO_NET_OFFLINE: "true" LIBCLANG_PATH: /usr/lib/sdk/llvm20/lib modules: - - name: tsc + - name: voelin buildsystem: simple build-commands: - - cargo --offline build --release --locked -p tsc-ui - - install -Dm755 target/release/tsc-desktop -t /app/bin/ - - install -Dm644 packaging/linux/io.github.faumaray.TsClient.desktop -t /app/share/applications/ - - install -Dm644 packaging/linux/io.github.faumaray.TsClient.metainfo.xml -t /app/share/metainfo/ - - install -Dm644 packaging/linux/io.github.faumaray.TsClient.svg -t /app/share/icons/hicolor/scalable/apps/ + - cargo --offline build --release --locked -p voelin-ui + - install -Dm755 target/release/voelin -t /app/bin/ + - install -Dm644 packaging/linux/io.github.faumaray.Voelin.desktop -t /app/share/applications/ + - install -Dm644 packaging/linux/io.github.faumaray.Voelin.metainfo.xml -t /app/share/metainfo/ + - install -Dm644 packaging/linux/io.github.faumaray.Voelin.svg -t /app/share/icons/hicolor/scalable/apps/ # Also shown in the app's About page. - - install -Dm644 THIRD_PARTY_NOTICES.md -t /app/share/licenses/io.github.faumaray.TsClient/ + - install -Dm644 THIRD_PARTY_NOTICES.md -t /app/share/licenses/io.github.faumaray.Voelin/ sources: - type: dir path: ../.. diff --git a/packaging/linux/io.github.faumaray.TsClient.desktop b/packaging/linux/io.github.faumaray.Voelin.desktop similarity index 68% rename from packaging/linux/io.github.faumaray.TsClient.desktop rename to packaging/linux/io.github.faumaray.Voelin.desktop index 37c44ae..77ced54 100644 --- a/packaging/linux/io.github.faumaray.TsClient.desktop +++ b/packaging/linux/io.github.faumaray.Voelin.desktop @@ -1,11 +1,11 @@ [Desktop Entry] Type=Application -Name=TS Client +Name=Voelin Comment=Voice chat, text chat and screen sharing -Exec=tsc-desktop -Icon=io.github.faumaray.TsClient +Exec=voelin +Icon=io.github.faumaray.Voelin Terminal=false Categories=Network;Chat;InstantMessaging;AudioVideo; Keywords=voice;chat;voip;push-to-talk; StartupNotify=true -StartupWMClass=tsc-desktop +StartupWMClass=io.github.faumaray.Voelin diff --git a/packaging/linux/io.github.faumaray.TsClient.metainfo.xml b/packaging/linux/io.github.faumaray.Voelin.metainfo.xml similarity index 83% rename from packaging/linux/io.github.faumaray.TsClient.metainfo.xml rename to packaging/linux/io.github.faumaray.Voelin.metainfo.xml index 0a08f0b..c2c23d4 100644 --- a/packaging/linux/io.github.faumaray.TsClient.metainfo.xml +++ b/packaging/linux/io.github.faumaray.Voelin.metainfo.xml @@ -1,11 +1,10 @@ - + - io.github.faumaray.TsClient + io.github.faumaray.Voelin CC0-1.0 MIT OR Apache-2.0 - TS Client + Voelin Voice chat, text chat and screen sharing

@@ -19,9 +18,9 @@

  • Per-user volume
  • - io.github.faumaray.TsClient.desktop + io.github.faumaray.Voelin.desktop - tsc-desktop + voelin https://github.com/Faumaray/teamspeak_client_rs https://github.com/Faumaray/teamspeak_client_rs/issues diff --git a/packaging/linux/io.github.faumaray.TsClient.svg b/packaging/linux/io.github.faumaray.Voelin.svg similarity index 100% rename from packaging/linux/io.github.faumaray.TsClient.svg rename to packaging/linux/io.github.faumaray.Voelin.svg diff --git a/packaging/linux/tsgw.service b/packaging/linux/tsgw.service new file mode 100644 index 0000000..b1ea15f --- /dev/null +++ b/packaging/linux/tsgw.service @@ -0,0 +1,45 @@ +# systemd unit for tsgw, the Voelin gateway (docs/gateway-admin.md). +# +# Write /etc/tsgw/tsgw.toml (example in /usr/share/doc/tsgw/examples), put the +# query password in /etc/tsgw/tsgw.env as TSGW_QUERY_PASSWORD=… (mode 600), +# then: systemctl enable --now tsgw. State (tsgw.db) is kept in /var/lib/tsgw. +[Unit] +Description=tsgw, the Voelin gateway for TeamSpeak servers +Documentation=https://github.com/Faumaray/teamspeak_client_rs/blob/main/docs/gateway-admin.md +After=network-online.target +Wants=network-online.target +ConditionPathExists=/etc/tsgw/tsgw.toml + +[Service] +ExecStart=/usr/bin/tsgw --config /etc/tsgw/tsgw.toml +# Read by systemd before dropping privileges, so it can stay root-only. +EnvironmentFile=-/etc/tsgw/tsgw.env +DynamicUser=yes +StateDirectory=tsgw +WorkingDirectory=/var/lib/tsgw +Restart=on-failure +RestartSec=5 + +NoNewPrivileges=yes +ProtectSystem=strict +ProtectHome=yes +PrivateTmp=yes +PrivateDevices=yes +ProtectKernelTunables=yes +ProtectKernelModules=yes +ProtectKernelLogs=yes +ProtectControlGroups=yes +ProtectClock=yes +ProtectHostname=yes +RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX +RestrictNamespaces=yes +RestrictRealtime=yes +LockPersonality=yes +MemoryDenyWriteExecute=yes +SystemCallArchitectures=native +SystemCallFilter=@system-service +CapabilityBoundingSet= +UMask=0077 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/windows/README.md b/packaging/windows/README.md index 29f8276..c371367 100644 --- a/packaging/windows/README.md +++ b/packaging/windows/README.md @@ -1,15 +1,16 @@ # Windows build and installer -CI (`package-windows` in `.github/workflows/ci.yml`) builds `tsc-desktop.exe`, -`tsctl.exe` and `tsgw.exe` on `windows-2025` and uploads the zip and the -installer as the `tsc-windows-x86_64` artifact. Nothing is signed there. +CI (`package-windows` in `.github/workflows/ci.yml`) builds `voelin.exe` on +`windows-2025` and uploads the zip and the installer as the +`voelin-windows-x86_64` artifact. Nothing is signed there. The gateway `tsgw` +is for servers and packaged for Linux only. `docker/windows.Dockerfile` cross-compiles the same packages on Linux ([docs/building.md](../../docs/building.md)). ## Build Needs the MSVC build tools, CMake (bundled libopus), NASM (assembly of -`aws-lc-sys`, used by the WebRTC stack) and libvpx (video, `tsc-media`): +`aws-lc-sys`, used by the WebRTC stack) and libvpx (video, `voelin-media`): ```powershell winget install NASM.NASM Kitware.CMake NSIS.NSIS @@ -21,14 +22,14 @@ $env:VPX_INCLUDE_DIR = "$vpx\include" $env:VPX_VERSION = "1.15.2" # what `vcpkg list libvpx` shows $env:VPX_STATIC = "1" -cargo build --release --locked -p tsc-ui +cargo build --release --locked -p voelin-ui makensis /DVERSION=0.1.0 packaging\windows\installer.nsi ``` -This gives `target\release\tsc-desktop.exe` and -`packaging\windows\tsc-desktop-0.1.0-setup.exe`. The installer puts the app in -`Program Files\TS Client`, adds a Start menu shortcut and an uninstaller; user -data stays in `%APPDATA%\tsc`. +This gives `target\release\voelin.exe` and +`packaging\windows\voelin-0.1.0-setup.exe`. The installer puts the app in +`Program Files\Voelin`, adds a Start menu shortcut and an uninstaller; user +data stays in `%APPDATA%\voelin`. The executable uses the dynamic MSVC runtime (`VCRUNTIME140.dll`, present on most systems). To drop that dependency build with @@ -42,7 +43,7 @@ it, then the installer and the uninstaller it writes (NSIS 3.08+ runs the `SIGN` command on both): ```powershell -signtool sign /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 /f cert.pfx /p $env:CERT_PASSWORD target\release\tsc-desktop.exe +signtool sign /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 /f cert.pfx /p $env:CERT_PASSWORD target\release\voelin.exe makensis /DVERSION=0.1.0 "/DSIGN=signtool sign /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 /f cert.pfx /p $env:CERT_PASSWORD %1" packaging\windows\installer.nsi ``` diff --git a/packaging/windows/installer.nsi b/packaging/windows/installer.nsi index c4d4bca..d3f89e0 100644 --- a/packaging/windows/installer.nsi +++ b/packaging/windows/installer.nsi @@ -1,14 +1,13 @@ -; NSIS installer for the desktop app (tsc-desktop.exe). See README.md. +; NSIS installer for the desktop app (voelin.exe). See README.md. ; ; makensis /DVERSION=0.1.0 packaging\windows\installer.nsi ; ; Paths are relative to this file. Optional defines: -; BINARY the executable (default ..\..\target\release\tsc-desktop.exe) +; BINARY the executable (default ..\..\target\release\voelin.exe) ; OUTDIR where the installer goes (default: next to this file) ; SIGN a signing command; "%1" is replaced by the file to sign, e.g. ; /DSIGN="signtool sign /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 /a %1" ; -; The product name and app id are placeholders until the product has a name. Unicode true SetCompressor /SOLID lzma @@ -17,16 +16,16 @@ SetCompressor /SOLID lzma !define VERSION "0.1.0" !endif !ifndef BINARY - !define BINARY "..\..\target\release\tsc-desktop.exe" + !define BINARY "..\..\target\release\voelin.exe" !endif !ifndef OUTDIR !define OUTDIR "." !endif -!define APP_NAME "TS Client" -!define APP_ID "io.github.faumaray.TsClient" +!define APP_NAME "Voelin" +!define APP_ID "io.github.faumaray.Voelin" !define PUBLISHER "Faumaray" -!define EXE "tsc-desktop.exe" +!define EXE "voelin.exe" !define UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_ID}" !ifdef SIGN @@ -36,7 +35,7 @@ SetCompressor /SOLID lzma !endif Name "${APP_NAME}" -OutFile "${OUTDIR}\tsc-desktop-${VERSION}-setup.exe" +OutFile "${OUTDIR}\voelin-${VERSION}-setup.exe" InstallDir "$PROGRAMFILES64\${APP_NAME}" InstallDirRegKey HKLM "${UNINSTALL_KEY}" "InstallLocation" RequestExecutionLevel admin @@ -79,7 +78,7 @@ Section "Install" SectionEnd Section "Uninstall" - ; User data in %APPDATA%\tsc (identities, bookmarks, history) is kept. + ; User data in %APPDATA%\voelin (identities, bookmarks, history) is kept. Delete "$INSTDIR\${EXE}" Delete "$INSTDIR\THIRD_PARTY_NOTICES.md" Delete "$INSTDIR\uninstall.exe" diff --git a/scripts/it-smoke.sh b/scripts/it-smoke.sh index dbfcf51..1971110 100755 --- a/scripts/it-smoke.sh +++ b/scripts/it-smoke.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Integration smoke test: tsctl against the TS3 and TS6 servers from +# Integration smoke test: voelinctl against the TS3 and TS6 servers from # dev/docker-compose.yml. # # For each server it checks: @@ -14,7 +14,7 @@ # 8. stream (TeamSpeak 6 only): a viewer watches a synthetic VP8 + Opus stream # # Usage: scripts/it-smoke.sh [ts3|ts6]... (default: both) -# Env: TSCTL=path/to/tsctl (default: builds target/debug/tsctl) +# Env: VOELINCTL=path/to/voelinctl (default: builds target/debug/voelinctl) # COMPOSE_FILE=dev/docker-compose.yml set -euo pipefail @@ -27,9 +27,9 @@ mkdir -p "$STATE_DIR" # Never leave background clients behind. trap 'kill $(jobs -p) 2>/dev/null || true' EXIT -if [[ -z "${TSCTL:-}" ]]; then - cargo build --quiet -p tsctl -p tsc-gateway - TSCTL=target/debug/tsctl +if [[ -z "${VOELINCTL:-}" ]]; then + cargo build --quiet -p voelinctl -p voelin-gateway + VOELINCTL=target/debug/voelinctl fi TSGW="${TSGW:-target/debug/tsgw}" @@ -37,7 +37,7 @@ declare -A PORTS=([ts3]=9987 [ts6]=9988) # ServerQuery transport and address per server (dev/docker-compose.yml). declare -A QUERY=([ts3]="raw 127.0.0.1:10011" [ts6]="ssh 127.0.0.1:10022") declare -A GATEWAY=([ts3]=7787 [ts6]=7788) -QUERY_SECRET=tsc-dev-admin +QUERY_SECRET=voelin-dev-admin SERVERS=("$@") [[ ${#SERVERS[@]} -eq 0 ]] && SERVERS=(ts3 ts6) @@ -63,15 +63,15 @@ privilege_key() { admin_args() { local svc=$1 addr=$2 id="$STATE_DIR/$svc-admin.json" if [[ ! -f "$id" ]]; then - "$TSCTL" identity new --out "$id.tmp" --force >/dev/null - if ! "$TSCTL" connect "$addr" --identity "$id.tmp" --nick admin \ + "$VOELINCTL" identity new --out "$id.tmp" --force >/dev/null + if ! "$VOELINCTL" connect "$addr" --identity "$id.tmp" --nick admin \ --privilege-key "$(privilege_key "$svc")" tree >/dev/null; then fail "could not redeem the $svc privilege key (already used?). Reset the servers: docker compose -f $COMPOSE_FILE down -v && docker compose -f $COMPOSE_FILE up -d && rm -rf $STATE_DIR" fi mv "$id.tmp" "$id" # The rapid test connections would trip the per-IP anti-flood ban. - "$TSCTL" connect "$addr" --identity "$id" --nick admin raw \ + "$VOELINCTL" connect "$addr" --identity "$id" --nick admin raw \ "serveredit virtualserver_antiflood_points_needed_ip_block=100000 virtualserver_antiflood_points_needed_command_block=100000" >/dev/null fi echo "--identity $id" @@ -81,12 +81,12 @@ admin_args() { chat_roundtrip() { local addr=$1 kind=$2 sender_args=$3 local token="smoke-$kind-$RANDOM$RANDOM" out="$STATE_DIR/listen.log" - "$TSCTL" connect "$addr" --nick listener listen --expect "$token" --timeout 20 >"$out" 2>&1 & + "$VOELINCTL" connect "$addr" --nick listener listen --expect "$token" --timeout 20 >"$out" 2>&1 & local listener=$! # Give the listener time to connect before sending. for _ in $(seq 1 40); do grep -q "listener" "$out" 2>/dev/null && break; sleep 0.25; done # shellcheck disable=SC2086 - "$TSCTL" connect "$addr" --nick sender $sender_args chat "$kind" "$token" + "$VOELINCTL" connect "$addr" --nick sender $sender_args chat "$kind" "$token" if ! wait "$listener"; then cat "$out" fail "$kind chat message not received" @@ -97,11 +97,11 @@ chat_roundtrip() { # One client records while another sends a tone; Goertzel checks the result. voice_roundtrip() { local addr=$1 out="$STATE_DIR/voice.log" - "$TSCTL" connect "$addr" --nick recorder voice record "$STATE_DIR/voice.wav" \ + "$VOELINCTL" connect "$addr" --nick recorder voice record "$STATE_DIR/voice.wav" \ --seconds 6 --expect-tone 1000 >"$out" 2>&1 & local recorder=$! sleep 2 - "$TSCTL" connect "$addr" --nick talker voice send --tone 1000 --seconds 2 >/dev/null + "$VOELINCTL" connect "$addr" --nick talker voice send --tone 1000 --seconds 2 >/dev/null if ! wait "$recorder"; then cat "$out" fail "voice tone not received" @@ -114,11 +114,11 @@ stream_check() { local addr=$1 out="$STATE_DIR/stream-watch.log" streamer_out="$STATE_DIR/stream-start.log" # Unique nicknames: other clients may stream on the same server. local streamer="streamer-$$-$RANDOM" - "$TSCTL" connect "$addr" --nick "viewer-$$" stream --loopback watch --streamer-nick "$streamer" \ + "$VOELINCTL" connect "$addr" --nick "viewer-$$" stream --loopback watch --streamer-nick "$streamer" \ --expect-frames 60 --timeout 30 >"$out" 2>&1 & local viewer=$! sleep 2 - if ! "$TSCTL" connect "$addr" --nick "$streamer" stream --loopback start --synthetic \ + if ! "$VOELINCTL" connect "$addr" --nick "$streamer" stream --loopback start --synthetic \ --auto-accept --seconds 10 >"$streamer_out" 2>&1; then cat "$streamer_out" "$out" fail "streamer failed" @@ -134,11 +134,11 @@ stream_check() { presence_check() { local addr=$1 query=$2 out="$STATE_DIR/observe.log" # shellcheck disable=SC2086 - "$TSCTL" observe $query --secret "$QUERY_SECRET" --allowlisted --poll 2 \ + "$VOELINCTL" observe $query --secret "$QUERY_SECRET" --allowlisted --poll 2 \ --seconds 20 --expect-client presence-probe >"$out" 2>&1 & local observer=$! sleep 2 - "$TSCTL" connect "$addr" --nick presence-probe listen --timeout 4 >/dev/null 2>&1 || true + "$VOELINCTL" connect "$addr" --nick presence-probe listen --timeout 4 >/dev/null 2>&1 || true if ! wait "$observer"; then cat "$out" fail "observer did not see the voice client" @@ -151,16 +151,16 @@ relay_check() { local addr=$1 query=$2 out="$STATE_DIR/relay.log" heard="$STATE_DIR/relay-heard.log" local token="relay-$RANDOM$RANDOM" # shellcheck disable=SC2086 - "$TSCTL" relay $query --secret "$QUERY_SECRET" --allowlisted --channel 1 \ + "$VOELINCTL" relay $query --secret "$QUERY_SECRET" --allowlisted --channel 1 \ --expect "to-relay-$token" --seconds 20 >"$out" 2>&1 & local relay=$! - "$TSCTL" connect "$addr" --nick relay-listener listen --expect "from-relay-$token" \ + "$VOELINCTL" connect "$addr" --nick relay-listener listen --expect "from-relay-$token" \ --timeout 20 >"$heard" 2>&1 & local listener=$! sleep 4 - "$TSCTL" connect "$addr" --nick relay-talker chat channel "to-relay-$token" + "$VOELINCTL" connect "$addr" --nick relay-talker chat channel "to-relay-$token" # shellcheck disable=SC2086 - "$TSCTL" relay $query --secret "$QUERY_SECRET" --allowlisted --channel 1 --nick Alice \ + "$VOELINCTL" relay $query --secret "$QUERY_SECRET" --allowlisted --channel 1 --nick Alice \ --send "from-relay-$token" --seconds 1 >/dev/null if ! wait "$relay"; then cat "$out" @@ -187,22 +187,22 @@ gateway_check() { # The gateway only knows identities that connected with voice once. local user="$STATE_DIR/$svc-gateway-user.json" stranger="$STATE_DIR/stranger.json" - [[ -f "$user" ]] || "$TSCTL" identity new --out "$user" >/dev/null - "$TSCTL" connect "$addr" --identity "$user" --nick gateway-user tree >/dev/null - "$TSCTL" identity new --out "$stranger" --force >/dev/null - if "$TSCTL" gateway "$url" --identity "$stranger" --seconds 3 >/dev/null 2>&1; then + [[ -f "$user" ]] || "$VOELINCTL" identity new --out "$user" >/dev/null + "$VOELINCTL" connect "$addr" --identity "$user" --nick gateway-user tree >/dev/null + "$VOELINCTL" identity new --out "$stranger" --force >/dev/null + if "$VOELINCTL" gateway "$url" --identity "$stranger" --seconds 3 >/dev/null 2>&1; then fail "gateway accepted an identity the server does not know" fi - "$TSCTL" gateway "$url" --identity "$user" --presence --open channel:1 \ + "$VOELINCTL" gateway "$url" --identity "$user" --presence --open channel:1 \ --expect "to-gateway-$token" --seconds 20 >"$out" 2>&1 & local reader=$! - "$TSCTL" connect "$addr" --nick gateway-listener listen --expect "from-gateway-$token" \ + "$VOELINCTL" connect "$addr" --nick gateway-listener listen --expect "from-gateway-$token" \ --timeout 20 >"$STATE_DIR/gateway-heard.log" 2>&1 & local listener=$! sleep 4 - "$TSCTL" connect "$addr" --nick gateway-talker chat channel "to-gateway-$token" - "$TSCTL" gateway "$url" --identity "$user" --send "channel:1=from-gateway-$token" --seconds 3 >/dev/null + "$VOELINCTL" connect "$addr" --nick gateway-talker chat channel "to-gateway-$token" + "$VOELINCTL" gateway "$url" --identity "$user" --send "channel:1=from-gateway-$token" --seconds 3 >/dev/null if ! wait "$reader"; then cat "$out" "$STATE_DIR/tsgw-$svc.log" fail "gateway user did not receive the channel message" @@ -224,7 +224,7 @@ for svc in "${SERVERS[@]}"; do admin=$(admin_args "$svc" "$addr") - tree=$("$TSCTL" connect "$addr" --nick tree-check tree) + tree=$("$VOELINCTL" connect "$addr" --nick tree-check tree) echo "$tree" grep -q "tree-check" <<<"$tree" || fail "own client missing from tree" @@ -240,10 +240,10 @@ for svc in "${SERVERS[@]}"; do fi done -log "engine (tsc-core) against both servers, media pipeline through TS6" -TSC_LIVE=1 cargo test --quiet -p tsc-core --features media-desktop --test live --test stream_live --test media_live 2>&1 | grep -E "test result|panicked|timed out" || fail "engine tests failed" +log "engine (voelin-core) against both servers, media pipeline through TS6" +VOELIN_LIVE=1 cargo test --quiet -p voelin-core --features media-desktop --test live --test stream_live --test media_live 2>&1 | grep -E "test result|panicked|timed out" || fail "engine tests failed" -log "stream (tsc-stream) through the TeamSpeak 6 server" -TSC_LIVE=1 cargo test --quiet -p tsc-stream --test live_ts6 2>&1 | grep -E "test result|panicked|timed out" || fail "stream test failed" +log "stream (voelin-stream) through the TeamSpeak 6 server" +VOELIN_LIVE=1 cargo test --quiet -p voelin-stream --test live_ts6 2>&1 | grep -E "test result|panicked|timed out" || fail "stream test failed" log "all smoke tests passed" diff --git a/scripts/notices.sh b/scripts/notices.sh index 22c740b..945755d 100755 --- a/scripts/notices.sh +++ b/scripts/notices.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Regenerate THIRD_PARTY_NOTICES.md from Cargo.lock with cargo-about # (about.toml, about.hbs). The app shows the file in its About page -# (tsc_platform::notices::text()), so it is committed; run this after changing +# (voelin_platform::notices::text()), so it is committed; run this after changing # dependencies. # # Usage: scripts/notices.sh regenerate THIRD_PARTY_NOTICES.md diff --git a/scripts/package.sh b/scripts/package.sh index 3d04da0..6a63927 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -2,14 +2,18 @@ # Package release builds into the files CI uploads and the Docker builds # produce (docs/building.md). Build first, then: # -# scripts/package.sh linux [out-dir] tsc--linux-.tar.gz and -# tsc-desktop__.deb -# from target/release -# scripts/package.sh windows [out-dir] tsc--windows-x86_64.zip and -# tsc-desktop--setup.exe (NSIS) +# scripts/package.sh linux [out-dir] from target/release: +# voelin--linux-.tar.gz, +# voelin__.deb (the app), +# tsgw--linux-.tar.gz, +# tsgw__.deb (the gateway, +# for servers) +# scripts/package.sh windows [out-dir] voelin--windows-x86_64.zip and +# voelin--setup.exe (NSIS) # scripts/package.sh android [out-dir] the APKs Gradle built, renamed # # out-dir defaults to dist/. Each run also writes SHA256SUMS- there. +# voelinctl (a development tool) is in no package. # # Environment: # CARGO_TARGET_DIR cargo's target directory (default: target) @@ -32,91 +36,118 @@ target_dir=${CARGO_TARGET_DIR:-target} # The version of a crate, from its manifest. crate_version() { - sed -n 's/^version = "\(.*\)"$/\1/p' "$1/Cargo.toml" | head -n 1 + local v + v=$(sed -n 's/^version = "\(.*\)"$/\1/p' "$1/Cargo.toml" | head -n 1) + [[ -n $v ]] || { echo "no version in $1/Cargo.toml" >&2; exit 1; } + printf '%s\n' "$v" } -version=$(crate_version crates/tsc-ui) -[[ -n $version ]] || { echo "no version in crates/tsc-ui/Cargo.toml" >&2; exit 1; } +version=$(crate_version crates/voelin-ui) -app_id=io.github.faumaray.TsClient -bins=(tsc-desktop tsctl tsgw) +app_id=io.github.faumaray.Voelin +homepage=https://github.com/Faumaray/teamspeak_client_rs tmp=$(mktemp -d) trap 'rm -rf "$tmp"' EXIT files=() -package_linux() { - local bin=$target_dir/release arch name stage pkg deb_arch depends - arch=$(uname -m) - name=tsc-$version-linux-$arch +# make_deb : builds +# __.deb from the tree in $tmp/debian/, with +# Depends from its /usr/bin binaries (dpkg-shlibdeps) plus . +# Extra control fields can be passed in $deb_extra. +make_deb() { + local pkg=$1 ver=$2 extra_depends=$3 root=$tmp/debian/$1 deb_arch depends bins + shift 3 + deb_arch=$(dpkg --print-architecture) + mkdir -p "$tmp/debian" + printf 'Source: %s\n\nPackage: %s\nArchitecture: any\n' "$pkg" "$pkg" >"$tmp/debian/control" + bins=("$root"/usr/bin/*) + depends=$(cd "$tmp" && dpkg-shlibdeps -O "${bins[@]#"$tmp/"}" | sed -n 's/^shlibs:Depends=//p') + depends=${depends:+$depends${extra_depends:+, }}$extra_depends + cat >"$root/usr/share/doc/$pkg/copyright" <<-EOF + Upstream: $homepage + License: MIT OR Apache-2.0 + Third-party licenses: /usr/share/doc/$pkg/THIRD_PARTY_NOTICES.md + EOF + mkdir -p "$root/DEBIAN" + { + printf 'Package: %s\nVersion: %s\nArchitecture: %s\n' "$pkg" "$ver" "$deb_arch" + printf 'Maintainer: Faumaray <23194470+Faumaray@users.noreply.github.com>\n' + printf 'Section: net\nPriority: optional\nHomepage: %s\n' "$homepage" + printf 'Depends: %s\n' "$depends" + [[ -z ${deb_extra:-} ]] || printf '%s\n' "$deb_extra" + printf 'Description: %s\n' "$1" + shift + printf ' %s\n' "$@" + } >"$root/DEBIAN/control" + dpkg-deb --root-owner-group --build "$root" "$out/${pkg}_${ver}_$deb_arch.deb" >/dev/null + files+=("${pkg}_${ver}_$deb_arch.deb") +} - # Archive: a prefix layout, e.g. `tar -xzf … --strip-components=1 -C ~/.local`. +package_linux() { + local bin=$target_dir/release arch name stage root gw_version + arch=$(uname -m) + gw_version=$(crate_version crates/voelin-gateway) + + # The app. Archives use a prefix layout, e.g. + # `tar -xzf … --strip-components=1 -C ~/.local`. + name=voelin-$version-linux-$arch stage=$tmp/$name - for b in "${bins[@]}"; do - install -Dm755 "$bin/$b" -t "$stage/bin" - done + install -Dm755 "$bin/voelin" -t "$stage/bin" install -Dm644 packaging/linux/$app_id.desktop -t "$stage/share/applications" install -Dm644 packaging/linux/$app_id.metainfo.xml -t "$stage/share/metainfo" install -Dm644 packaging/linux/$app_id.svg -t "$stage/share/icons/hicolor/scalable/apps" - install -Dm644 THIRD_PARTY_NOTICES.md crates/tsc-gateway/tsgw.example.toml -t "$stage/share/doc/tsc" + install -Dm644 THIRD_PARTY_NOTICES.md -t "$stage/share/doc/voelin" tar -C "$tmp" -czf "$out/$name.tar.gz" "$name" files+=("$name.tar.gz") - # Debian package, with dependencies from the binaries' shared libraries. - command -v dpkg-deb >/dev/null || { echo "dpkg-deb not found: skipping the .deb" >&2; return; } - pkg=$tmp/debian/tsc-desktop - for b in "${bins[@]}"; do - install -Dm755 "$bin/$b" -t "$pkg/usr/bin" - done - install -Dm644 packaging/linux/$app_id.desktop -t "$pkg/usr/share/applications" - install -Dm644 packaging/linux/$app_id.metainfo.xml -t "$pkg/usr/share/metainfo" - install -Dm644 packaging/linux/$app_id.svg -t "$pkg/usr/share/icons/hicolor/scalable/apps" - install -Dm644 THIRD_PARTY_NOTICES.md -t "$pkg/usr/share/doc/tsc-desktop" - install -Dm644 crates/tsc-gateway/tsgw.example.toml -t "$pkg/usr/share/doc/tsc-desktop/examples" - cat >"$pkg/usr/share/doc/tsc-desktop/copyright" <<-EOF - Upstream: https://github.com/Faumaray/teamspeak_client_rs - License: MIT OR Apache-2.0 - Third-party licenses: /usr/share/doc/tsc-desktop/THIRD_PARTY_NOTICES.md - EOF - deb_arch=$(dpkg --print-architecture) - mkdir -p "$tmp/debian" - printf 'Source: tsc-desktop\n\nPackage: tsc-desktop\nArchitecture: any\n' >"$tmp/debian/control" - depends=$(cd "$tmp" && dpkg-shlibdeps -O "${bins[@]/#/debian/tsc-desktop/usr/bin/}" | - sed -n 's/^shlibs:Depends=//p') - # Loaded at run time (dlopen), so dpkg-shlibdeps cannot see them: the - # keyboard, then Wayland or X11 and EGL for the window. - depends=${depends:+$depends, }libxkbcommon0 - mkdir -p "$pkg/DEBIAN" - cat >"$pkg/DEBIAN/control" <<-EOF - Package: tsc-desktop - Version: $version - Architecture: $deb_arch - Maintainer: Faumaray <23194470+Faumaray@users.noreply.github.com> - Section: net - Priority: optional - Homepage: https://github.com/Faumaray/teamspeak_client_rs - Depends: $depends - Recommends: libwayland-client0, libwayland-cursor0, libxkbcommon-x11-0, libx11-xcb1, libxcursor1, libxi6, libxrandr2, libegl1 - Description: TeamSpeak 3 and 6 client - Desktop client for TeamSpeak 3 and TeamSpeak 6 servers (tsc-desktop), with - the tsctl command line client and the tsgw companion gateway. - EOF - dpkg-deb --root-owner-group --build "$pkg" "$out/tsc-desktop_${version}_$deb_arch.deb" >/dev/null - files+=("tsc-desktop_${version}_$deb_arch.deb") + # The gateway, for servers: nothing of the app, no GUI libraries. + name=tsgw-$gw_version-linux-$arch + stage=$tmp/$name + install -Dm755 "$bin/tsgw" -t "$stage/bin" + install -Dm644 packaging/linux/tsgw.service -t "$stage/lib/systemd/system" + install -Dm644 THIRD_PARTY_NOTICES.md crates/voelin-gateway/tsgw.example.toml -t "$stage/share/doc/tsgw" + tar -C "$tmp" -czf "$out/$name.tar.gz" "$name" + files+=("$name.tar.gz") + + command -v dpkg-deb >/dev/null || { echo "dpkg-deb not found: skipping the .deb files" >&2; return; } + + root=$tmp/debian/voelin + install -Dm755 "$bin/voelin" -t "$root/usr/bin" + install -Dm644 packaging/linux/$app_id.desktop -t "$root/usr/share/applications" + install -Dm644 packaging/linux/$app_id.metainfo.xml -t "$root/usr/share/metainfo" + install -Dm644 packaging/linux/$app_id.svg -t "$root/usr/share/icons/hicolor/scalable/apps" + install -Dm644 THIRD_PARTY_NOTICES.md -t "$root/usr/share/doc/voelin" + # libxkbcommon, Wayland/X11 and EGL are loaded at run time (dlopen), so + # dpkg-shlibdeps cannot see them. + deb_extra="Recommends: libwayland-client0, libwayland-cursor0, libxkbcommon-x11-0, libx11-xcb1, libxcursor1, libxi6, libxrandr2, libegl1" \ + make_deb voelin "$version" libxkbcommon0 \ + "Voelin, a TeamSpeak 3 and 6 client" \ + "Desktop client for TeamSpeak 3 and TeamSpeak 6 servers: voice, chat," \ + "screen sharing and invisible presence through a tsgw gateway." + + root=$tmp/debian/tsgw + install -Dm755 "$bin/tsgw" -t "$root/usr/bin" + install -Dm644 packaging/linux/tsgw.service -t "$root/usr/lib/systemd/system" + install -Dm644 THIRD_PARTY_NOTICES.md -t "$root/usr/share/doc/tsgw" + install -Dm644 crates/voelin-gateway/tsgw.example.toml -t "$root/usr/share/doc/tsgw/examples" + make_deb tsgw "$gw_version" "" \ + "Voelin gateway for TeamSpeak servers" \ + "Runs next to a TeamSpeak 3 or 6 server and gives Voelin users invisible" \ + "presence and channel chat over ServerQuery. Configure /etc/tsgw/tsgw.toml" \ + "(example in /usr/share/doc/tsgw/examples), then systemctl enable --now tsgw." } -# A path makensis.exe understands when running on Windows (Git Bash). +# A path Windows programs understand when running on Windows (Git Bash): +# backslashes, since makensis's File finds nothing through "D:/a/…" paths. native_path() { - if command -v cygpath >/dev/null; then cygpath -m "$1"; else printf '%s\n' "$1"; fi + if command -v cygpath >/dev/null; then cygpath -w "$1"; else printf '%s\n' "$1"; fi } package_windows() { local bin=$target_dir/${WINDOWS_TARGET:+$WINDOWS_TARGET/}release name stage makensis - name=tsc-$version-windows-x86_64 + name=voelin-$version-windows-x86_64 stage=$tmp/$name mkdir -p "$stage" - for b in "${bins[@]}"; do - cp "$bin/$b.exe" "$stage/" - done - cp THIRD_PARTY_NOTICES.md crates/tsc-gateway/tsgw.example.toml "$stage/" + cp "$bin/voelin.exe" THIRD_PARTY_NOTICES.md "$stage/" if command -v zip >/dev/null; then (cd "$tmp" && zip -qr "$out/$name.zip" "$name") elif command -v 7z >/dev/null; then @@ -137,21 +168,20 @@ package_windows() { fi # Absolute paths: makensis changes into the script's directory. "$makensis" -V2 -DVERSION="$version" -DOUTDIR="$(native_path "$out")" \ - -DBINARY="$(native_path "$(cd "$bin" && pwd)/tsc-desktop.exe")" packaging/windows/installer.nsi - files+=("tsc-desktop-$version-setup.exe") + -DBINARY="$(native_path "$(cd "$bin" && pwd)/voelin.exe")" packaging/windows/installer.nsi + files+=("voelin-$version-setup.exe") } package_android() { - local apk android_version found=0 - android_version=$(crate_version crates/tsc-android) + local apk android_version variant found=0 + android_version=$(crate_version crates/voelin-android) for apk in android/app/build/outputs/apk/*/*.apk; do [[ -e $apk ]] || continue # app-debug.apk, app-release.apk, app-release-unsigned.apk - local variant variant=$(basename "$apk" .apk) variant=${variant#app-} - cp "$apk" "$out/tsc-$android_version-android-$variant.apk" - files+=("tsc-$android_version-android-$variant.apk") + cp "$apk" "$out/voelin-$android_version-android-$variant.apk" + files+=("voelin-$android_version-android-$variant.apk") found=1 done ((found)) || { echo "no APKs in android/app/build/outputs/apk: build with Gradle first" >&2; exit 1; } diff --git a/tests/interop/README.md b/tests/interop/README.md index 4f7a0a2..06647e0 100644 --- a/tests/interop/README.md +++ b/tests/interop/README.md @@ -1,6 +1,6 @@ # Browser interop test -`crates/tsc-stream/tests/browser_interop.rs` checks our str0m peers against +`crates/voelin-stream/tests/browser_interop.rs` checks our str0m peers against the WebRTC stack of Chromium (libwebrtc, the same stack as the official TeamSpeak 6 client). `browser-peer.cjs` runs headless Chromium through Playwright and exchanges SDP and candidates with the Rust test as JSON lines @@ -19,11 +19,11 @@ chromium` on a new machine; `PLAYWRIGHT_BROWSERS_PATH` if the browsers live elsewhere). ```sh -TSC_INTEROP=1 cargo test -p tsc-stream --test browser_interop -- --nocapture +VOELIN_INTEROP=1 cargo test -p voelin-stream --test browser_interop -- --nocapture ``` -Without `TSC_INTEROP=1` the tests return immediately, so `cargo test` passes on -machines without a browser. `TSC_NODE` selects the node binary; `NODE_PATH` +Without `VOELIN_INTEROP=1` the tests return immediately, so `cargo test` passes on +machines without a browser. `VOELIN_NODE` selects the node binary; `NODE_PATH` defaults to `npm root -g` so a global Playwright is found. Chromium is started with `--disable-features=WebRtcHideLocalIpsWithMdns`: diff --git a/tests/interop/browser-peer.cjs b/tests/interop/browser-peer.cjs index 1dd052e..7808301 100644 --- a/tests/interop/browser-peer.cjs +++ b/tests/interop/browser-peer.cjs @@ -1,5 +1,5 @@ // Headless Chromium as the remote WebRTC peer for -// crates/tsc-stream/tests/browser_interop.rs (see README.md here). +// crates/voelin-stream/tests/browser_interop.rs (see README.md here). // // Reads one JSON command per line on stdin and writes one JSON reply per line // on stdout; logs go to stderr. Commands (`op`): diff --git a/tools/tsctl/Cargo.toml b/tools/voelinctl/Cargo.toml similarity index 64% rename from tools/tsctl/Cargo.toml rename to tools/voelinctl/Cargo.toml index aa44919..5edf9c1 100644 --- a/tools/tsctl/Cargo.toml +++ b/tools/voelinctl/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tsctl" +name = "voelinctl" version = "0.1.0" description = "Headless command-line client for TeamSpeak 3/6 servers, used for development and integration tests." edition.workspace = true @@ -21,16 +21,16 @@ tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } tsclientlib = { path = "../../crates/proto/tsclientlib" } tsproto-packets = { path = "../../crates/proto/tsproto-packets" } -tsc-model = { path = "../../crates/tsc-model" } -tsc-query = { path = "../../crates/tsc-query" } -tsc-observer = { path = "../../crates/tsc-observer" } -tsc-audio = { path = "../../crates/tsc-audio", default-features = false } +voelin-model = { path = "../../crates/voelin-model" } +voelin-query = { path = "../../crates/voelin-query" } +voelin-observer = { path = "../../crates/voelin-observer" } +voelin-audio = { path = "../../crates/voelin-audio", default-features = false } # The stream media pipeline (capture, VP8, decoding), without audio devices. -tsc-core = { path = "../../crates/tsc-core", default-features = false, features = ["media-desktop"] } -tsc-stream = { path = "../../crates/tsc-stream" } +voelin-core = { path = "../../crates/voelin-core", default-features = false, features = ["media-desktop"] } +voelin-stream = { path = "../../crates/voelin-stream" } tokio-tungstenite = "0.30" futures-util = "0.3.34" -tsc-gateway-proto = { path = "../../crates/tsc-gateway-proto" } +voelin-gateway-proto = { path = "../../crates/voelin-gateway-proto" } [lints] workspace = true diff --git a/tools/tsctl/src/gateway.rs b/tools/voelinctl/src/gateway.rs similarity index 94% rename from tools/tsctl/src/gateway.rs rename to tools/voelinctl/src/gateway.rs index decfcba..c23bf6d 100644 --- a/tools/tsctl/src/gateway.rs +++ b/tools/voelinctl/src/gateway.rs @@ -1,4 +1,4 @@ -//! `tsctl gateway`: talk to a tsgw gateway as a user. +//! `voelinctl gateway`: talk to a tsgw gateway as a user. use std::path::PathBuf; use std::time::Duration; @@ -9,15 +9,15 @@ use futures_util::{SinkExt, StreamExt}; use tokio::time::{Instant, timeout_at}; use tokio_tungstenite::tungstenite::Message; use tokio_tungstenite::tungstenite::client::IntoClientRequest; -use tsc_gateway_proto::{ClientMsg, Envelope, ServerMsg, sign_challenge}; -use tsc_model::{ChatTarget, Presence}; +use voelin_gateway_proto::{ClientMsg, Envelope, ServerMsg, sign_challenge}; +use voelin_model::{ChatTarget, Presence}; #[derive(Args, Debug, Clone)] pub struct GatewayArgs { /// Gateway URL, e.g. ws://127.0.0.1:7788/v1. pub url: String, /// Identity file (must have connected to the server with voice once). - #[arg(long, env = "TSCTL_IDENTITY")] + #[arg(long, env = "VOELINCTL_IDENTITY")] pub identity: PathBuf, /// Receive presence and print the tree. #[arg(long)] @@ -53,7 +53,9 @@ fn parse_target(s: &str) -> Result { pub async fn run(args: GatewayArgs) -> Result<()> { let identity = crate::identity::load(&args.identity)?; let mut request = args.url.as_str().into_client_request()?; - request.headers_mut().insert("Sec-WebSocket-Protocol", tsc_gateway_proto::SUBPROTOCOL.parse()?); + request + .headers_mut() + .insert("Sec-WebSocket-Protocol", voelin_gateway_proto::SUBPROTOCOL.parse()?); let (mut ws, _) = tokio_tungstenite::connect_async(request) .await .with_context(|| format!("failed to connect to {}", args.url))?; diff --git a/tools/tsctl/src/identity.rs b/tools/voelinctl/src/identity.rs similarity index 92% rename from tools/tsctl/src/identity.rs rename to tools/voelinctl/src/identity.rs index a4fb091..cceea17 100644 --- a/tools/tsctl/src/identity.rs +++ b/tools/voelinctl/src/identity.rs @@ -7,7 +7,7 @@ use anyhow::{Context, Result}; use tsclientlib::Identity; pub fn default_path() -> PathBuf { - dirs::config_dir().unwrap_or_else(|| PathBuf::from(".")).join("tsctl").join("identity.json") + dirs::config_dir().unwrap_or_else(|| PathBuf::from(".")).join("voelinctl").join("identity.json") } pub fn load(path: &Path) -> Result { @@ -45,7 +45,7 @@ mod tests { #[test] fn roundtrip() { - let dir = std::env::temp_dir().join(format!("tsctl-id-test-{}", std::process::id())); + let dir = std::env::temp_dir().join(format!("voelinctl-id-test-{}", std::process::id())); let path = dir.join("id.json"); let identity = create(8); assert!(identity.level() >= 8); diff --git a/tools/tsctl/src/main.rs b/tools/voelinctl/src/main.rs similarity index 94% rename from tools/tsctl/src/main.rs rename to tools/voelinctl/src/main.rs index 2381af6..b23cef5 100644 --- a/tools/tsctl/src/main.rs +++ b/tools/voelinctl/src/main.rs @@ -1,4 +1,4 @@ -//! `tsctl`: headless TeamSpeak 3/6 client for development and integration tests. +//! `voelinctl`: headless TeamSpeak 3/6 client for development and integration tests. mod gateway; mod identity; @@ -55,7 +55,7 @@ enum IdentityCommand { /// Minimum security level (hash cash). Servers commonly require 8. #[arg(long, default_value_t = 8)] level: u8, - /// Where to store the identity [default: /tsctl/identity.json]. + /// Where to store the identity [default: /voelinctl/identity.json]. #[arg(long)] out: Option, /// Overwrite an existing file. @@ -74,19 +74,19 @@ pub struct ConnectArgs { /// Server address: host, host:port, or a TeamSpeak server nickname. address: String, /// Nickname to use. - #[arg(long, default_value = "tsctl")] + #[arg(long, default_value = "voelinctl")] nick: String, /// Identity file. Without it a temporary identity is generated. - #[arg(long, env = "TSCTL_IDENTITY")] + #[arg(long, env = "VOELINCTL_IDENTITY")] identity: Option, - /// Signed client version: `default`, an index or `@` from `tsctl versions`. + /// Signed client version: `default`, an index or `@` from `voelinctl versions`. #[arg(long, default_value = "default")] client_version: String, /// Server password. - #[arg(long, env = "TSCTL_SERVER_PASSWORD")] + #[arg(long, env = "VOELINCTL_SERVER_PASSWORD")] server_password: Option, /// Privilege key (token) to redeem after connecting, e.g. the ServerAdmin key a new server prints. - #[arg(long, env = "TSCTL_PRIVILEGE_KEY")] + #[arg(long, env = "VOELINCTL_PRIVILEGE_KEY")] privilege_key: Option, /// Channel to join, as a path like `Lobby/Sub`. #[arg(long)] diff --git a/tools/tsctl/src/observe.rs b/tools/voelinctl/src/observe.rs similarity index 95% rename from tools/tsctl/src/observe.rs rename to tools/voelinctl/src/observe.rs index 22e407f..4d054a2 100644 --- a/tools/tsctl/src/observe.rs +++ b/tools/voelinctl/src/observe.rs @@ -1,4 +1,4 @@ -//! `tsctl observe` and `tsctl relay`: invisible presence and channel chat. +//! `voelinctl observe` and `voelinctl relay`: invisible presence and channel chat. use std::time::Duration; @@ -6,8 +6,10 @@ use anyhow::{Result, bail}; use clap::Args; use tokio::sync::broadcast::error::RecvError; use tokio::time::{Instant, timeout_at}; -use tsc_model::{ChatMessage, ChatTarget, Presence, PresenceDelta}; -use tsc_observer::{Observer, ObserverConfig, ObserverEvent, RelayConfig, RelayEvent, RelayPool}; +use voelin_model::{ChatMessage, ChatTarget, Presence, PresenceDelta}; +use voelin_observer::{ + Observer, ObserverConfig, ObserverEvent, RelayConfig, RelayEvent, RelayPool, +}; use crate::query::QueryConnArgs; @@ -40,7 +42,7 @@ pub struct RelayArgs { #[arg(long)] pub send: Option, /// Name shown in relayed posts. - #[arg(long, default_value = "tsctl")] + #[arg(long, default_value = "voelinctl")] pub nick: String, /// Stop after this many seconds (default: until Ctrl-C). #[arg(long)] diff --git a/tools/tsctl/src/query.rs b/tools/voelinctl/src/query.rs similarity index 93% rename from tools/tsctl/src/query.rs rename to tools/voelinctl/src/query.rs index d5c5516..5e7dec8 100644 --- a/tools/tsctl/src/query.rs +++ b/tools/voelinctl/src/query.rs @@ -1,11 +1,11 @@ -//! `tsctl query`: ServerQuery commands and events. +//! `voelinctl query`: ServerQuery commands and events. use std::time::Duration; use anyhow::{Context, Result, bail}; use clap::Args; use tokio::io::{AsyncBufReadExt, BufReader}; -use tsc_query::{Command, Connect, LineOptions, QueryClient, Row, Transport}; +use voelin_query::{Command, Connect, LineOptions, QueryClient, Row, Transport}; /// How to reach and log into a ServerQuery interface. #[derive(Args, Debug, Clone)] @@ -19,7 +19,7 @@ pub struct QueryConnArgs { #[arg(long, default_value = "serveradmin")] pub user: String, /// Password (raw/SSH) or API key (HTTP). Without it, HTTP runs as guest. - #[arg(long, env = "TSCTL_QUERY_SECRET", hide_env_values = true)] + #[arg(long, env = "VOELINCTL_QUERY_SECRET", hide_env_values = true)] pub secret: Option, /// Select the virtual server by its voice port instead of id 1. #[arg(long)] diff --git a/tools/tsctl/src/session.rs b/tools/voelinctl/src/session.rs similarity index 100% rename from tools/tsctl/src/session.rs rename to tools/voelinctl/src/session.rs diff --git a/tools/tsctl/src/stream.rs b/tools/voelinctl/src/stream.rs similarity index 98% rename from tools/tsctl/src/stream.rs rename to tools/voelinctl/src/stream.rs index 797f6f1..6f4ad04 100644 --- a/tools/tsctl/src/stream.rs +++ b/tools/voelinctl/src/stream.rs @@ -1,4 +1,4 @@ -//! `tsctl connect ... stream start|list|watch`: TeamSpeak 6 streams. +//! `voelinctl connect ... stream start|list|watch`: TeamSpeak 6 streams. use std::collections::HashMap; use std::path::{Path, PathBuf}; @@ -11,20 +11,20 @@ use clap::{Args, Subcommand}; use futures::prelude::*; use tokio::io::{AsyncBufReadExt, BufReader, Lines, Stdin}; use tokio::time::{Instant, Interval, sleep_until}; -use tsc_core::media::tsc_media::capture::SourceId; -use tsc_core::media::tsc_media::{Codecs, VideoFrame, convert}; -use tsc_core::media::{ - CaptureBackend, EncodedSource, Latest, Streamer, StreamerConfig, VideoPipeline, peer_config, - stream_codec, -}; -use tsc_model::ServerFlavor; -use tsc_stream::{ - EndReason, FrameSource, MediaKind, Output, PeerConfig, Request, StreamEvent, StreamInfo, - StreamNotification, StreamSetup, StreamerEvent, StreamerOptions, Streams, WatchEvent, -}; use tsclientlib::events::{Event, PropertyId}; use tsclientlib::prelude::*; use tsclientlib::{ClientId, Connection, MessageHandle, StreamItem}; +use voelin_core::media::voelin_media::capture::SourceId; +use voelin_core::media::voelin_media::{Codecs, VideoFrame, convert}; +use voelin_core::media::{ + CaptureBackend, EncodedSource, Latest, Streamer, StreamerConfig, VideoPipeline, peer_config, + stream_codec, +}; +use voelin_model::ServerFlavor; +use voelin_stream::{ + EndReason, FrameSource, MediaKind, Output, PeerConfig, Request, StreamEvent, StreamInfo, + StreamNotification, StreamSetup, StreamerEvent, StreamerOptions, Streams, WatchEvent, +}; #[derive(Args, Debug, Clone)] pub struct StreamArgs { @@ -48,7 +48,7 @@ pub enum StreamCommand { /// `, `deny `, `kick `, `stop`. Start { /// Stream name. - #[arg(long, default_value = "tsctl")] + #[arg(long, default_value = "voelinctl")] name: String, /// What to capture: `synthetic` (a moving test pattern and a tone), /// `x11[:]`, `screen[:]` (this session's backend), diff --git a/tools/tsctl/src/tree.rs b/tools/voelinctl/src/tree.rs similarity index 99% rename from tools/tsctl/src/tree.rs rename to tools/voelinctl/src/tree.rs index e29b0b1..ce0df3f 100644 --- a/tools/tsctl/src/tree.rs +++ b/tools/voelinctl/src/tree.rs @@ -3,9 +3,9 @@ use std::collections::HashMap; use std::fmt::Write; -use tsc_model::ServerFlavor; use tsclientlib::data; use tsclientlib::{ChannelId, ClientType}; +use voelin_model::ServerFlavor; /// Minimal channel view, so the ordering logic can be tested without a connection. #[derive(Clone, Debug)] diff --git a/tools/tsctl/src/versions.rs b/tools/voelinctl/src/versions.rs similarity index 94% rename from tools/tsctl/src/versions.rs rename to tools/voelinctl/src/versions.rs index 4590f11..698f628 100644 --- a/tools/tsctl/src/versions.rs +++ b/tools/voelinctl/src/versions.rs @@ -51,7 +51,7 @@ pub fn known_versions() -> Vec { /// Resolve a `--client-version` argument. /// /// Accepts `default` (the library default), an index into [`known_versions`], -/// or `@` with the exact strings from `tsctl versions`. +/// or `@` with the exact strings from `voelinctl versions`. pub fn resolve(spec: &str) -> Result> { if spec == "default" { return Ok(None); @@ -68,7 +68,7 @@ pub fn resolve(spec: &str) -> Result> { }; match versions.iter().find(|v| v.platform == platform && v.version == version) { Some(v) => v.to_version().map(Some), - None => bail!("unknown client version {spec:?}, see `tsctl versions`"), + None => bail!("unknown client version {spec:?}, see `voelinctl versions`"), } } diff --git a/tools/tsctl/src/voice.rs b/tools/voelinctl/src/voice.rs similarity index 95% rename from tools/tsctl/src/voice.rs rename to tools/voelinctl/src/voice.rs index aaa9521..bffb48c 100644 --- a/tools/tsctl/src/voice.rs +++ b/tools/voelinctl/src/voice.rs @@ -1,13 +1,13 @@ -//! `tsctl connect ... voice send|record`. +//! `voelinctl connect ... voice send|record`. use std::time::Duration; use anyhow::{Context, Result, bail}; use tokio::time::Instant; -use tsc_audio::pcm::{self, FRAME_SAMPLES, SAMPLE_RATE}; -use tsc_audio::{Framer, Mixer, VoiceCodec, VoiceEncoder, resample, wav}; use tsclientlib::{ClientId, Connection, StreamItem}; use tsproto_packets::packets::AudioData; +use voelin_audio::pcm::{self, FRAME_SAMPLES, SAMPLE_RATE}; +use voelin_audio::{Framer, Mixer, VoiceCodec, VoiceEncoder, resample, wav}; use crate::VoiceCommand; use crate::session::{Flow, PumpEnd, pump};