From 64ae2f0255fadd4861dfc4a033a3f28d8f2c6c18 Mon Sep 17 00:00:00 2001 From: "hh.(SII)" Date: Sat, 19 Sep 2026 13:58:22 +0800 Subject: [PATCH 1/2] refactor(brand): rename scilaxy-relay to liyanlabs-relay Rebrand the relay workspace to Liyan Labs: - Crate + binary names: scilaxy-relay-*/scilaxy-* -> liyanlabs-relay-*/liyanlabs-* - Env var prefix: SCILAXY_* -> LIYANLABS_* - Image prefix: ghcr.io/scienceol/scilaxy-relay -> ghcr.io/scienceol/liyanlabs-relay - Domain: scilaxy.ai -> liyanlabs.com - Swift FFI callback: SciLaxyNalCallback -> LiyanLabsNalCallback Co-Authored-By: Claude Opus 5 --- .github/workflows/release.yaml | 20 +- Cargo.lock | 268 ++++++++++---------- Cargo.toml | 2 +- Dockerfile | 30 +-- README.md | 8 +- crates/capturer/Cargo.toml | 6 +- crates/capturer/src/main.rs | 22 +- crates/common/Cargo.toml | 2 +- crates/common/src/lib.rs | 2 +- crates/control/Cargo.toml | 6 +- crates/control/src/http.rs | 2 +- crates/control/src/main.rs | 16 +- crates/mac-capturer/Cargo.toml | 6 +- crates/mac-capturer/examples/dump.rs | 4 +- crates/mac-capturer/src/lib.rs | 42 +-- crates/mac-capturer/swift/MacCapturer.swift | 86 +++---- crates/proto/Cargo.toml | 2 +- crates/relay/Cargo.toml | 6 +- crates/relay/src/main.rs | 10 +- crates/rendezvous/Cargo.toml | 8 +- crates/rendezvous/src/main.rs | 14 +- crates/rendezvous/src/registry.rs | 2 +- crates/rendezvous/src/server.rs | 6 +- crates/stream/Cargo.toml | 4 +- crates/stream/src/main.rs | 10 +- crates/win-capturer/Cargo.toml | 6 +- crates/win-capturer/src/display.rs | 2 +- crates/win-capturer/src/lib.rs | 4 +- crates/win-capturer/src/publisher.rs | 2 +- scripts/dump_view.py | 4 +- scripts/smoke_control.sh | 10 +- scripts/smoke_stream.py | 6 +- scripts/smoke_ws_register.py | 4 +- scripts/smoke_ws_via_nginx.py | 10 +- web-test/index.html | 4 +- web-test/viewer.html | 2 +- 36 files changed, 319 insertions(+), 319 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6f0dfa2..698744f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,17 +1,17 @@ -# Build and publish scilaxy-relay server-side images to ghcr.io. +# Build and publish liyanlabs-relay server-side images to ghcr.io. # # Triggers: # - push to main → push :main + :sha tags # - tag v* → push :sha + :v* + :latest tags # - workflow_dispatch → manual run # -# We deliberately publish under ghcr.io/scienceol/scilaxy-relay-* so +# We deliberately publish under ghcr.io/scienceol/liyanlabs-relay-* so # any cluster (or any developer) can `docker pull` without auth — the # repo itself is public. The k8s manifests pin to a specific :sha or # :v* tag so a "latest" rolling deploy never happens by accident. # # What's NOT here: the desktop-side capturer (mac-capturer + capturer -# crates). Those compile only on macOS and ship inside the Scilaxy +# crates). Those compile only on macOS and ship inside the LiyanLabs # runner binary via the runner repo's own release pipeline. name: release @@ -33,7 +33,7 @@ permissions: env: REGISTRY: ghcr.io - IMAGE_PREFIX: ghcr.io/scienceol/scilaxy-relay + IMAGE_PREFIX: ghcr.io/scienceol/liyanlabs-relay jobs: test: @@ -51,8 +51,8 @@ jobs: # missing Apple frameworks. run: | cargo check --workspace \ - --exclude scilaxy-relay-mac-capturer \ - --exclude scilaxy-relay-capturer + --exclude liyanlabs-relay-mac-capturer \ + --exclude liyanlabs-relay-capturer - name: cargo clippy (informational) # Run clippy purely for visibility — never gate the pipeline # on it. Real lint cleanup happens in standalone PRs once @@ -61,13 +61,13 @@ jobs: continue-on-error: true run: | cargo clippy --workspace \ - --exclude scilaxy-relay-mac-capturer \ - --exclude scilaxy-relay-capturer || true + --exclude liyanlabs-relay-mac-capturer \ + --exclude liyanlabs-relay-capturer || true - name: cargo test run: | cargo test --workspace \ - --exclude scilaxy-relay-mac-capturer \ - --exclude scilaxy-relay-capturer + --exclude liyanlabs-relay-mac-capturer \ + --exclude liyanlabs-relay-capturer build-and-push: name: build ${{ matrix.bin }} diff --git a/Cargo.lock b/Cargo.lock index 380801d..f33b9c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1134,6 +1134,140 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" +[[package]] +name = "liyanlabs-relay-capturer" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "env_logger", + "futures-util", + "liyanlabs-relay-mac-capturer", + "log", + "tokio", + "tokio-tungstenite", + "url", +] + +[[package]] +name = "liyanlabs-relay-common" +version = "0.1.0" +dependencies = [ + "log", + "serde", + "thiserror 2.0.18", +] + +[[package]] +name = "liyanlabs-relay-control" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum", + "chrono", + "clap", + "liyanlabs-relay-common", + "rand 0.8.6", + "serde", + "serde_json", + "sqlx", + "thiserror 2.0.18", + "tokio", + "tower-http", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "liyanlabs-relay-mac-capturer" +version = "0.1.0" +dependencies = [ + "log", + "serde", + "serde_json", +] + +[[package]] +name = "liyanlabs-relay-proto" +version = "0.1.0" +dependencies = [ + "bytes", + "prost", + "prost-build", + "protox", + "tokio-util", +] + +[[package]] +name = "liyanlabs-relay-rendezvous" +version = "0.1.0" +dependencies = [ + "anyhow", + "bytes", + "clap", + "env_logger", + "futures-util", + "liyanlabs-relay-common", + "liyanlabs-relay-proto", + "log", + "prost", + "reqwest", + "serde", + "serde_json", + "tokio", + "tokio-tungstenite", + "tokio-util", +] + +[[package]] +name = "liyanlabs-relay-server" +version = "0.1.0" +dependencies = [ + "anyhow", + "bytes", + "clap", + "env_logger", + "futures-util", + "liyanlabs-relay-proto", + "log", + "prost", + "tokio", + "tokio-tungstenite", + "tokio-util", +] + +[[package]] +name = "liyanlabs-relay-stream" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum", + "bytes", + "clap", + "env_logger", + "futures-util", + "log", + "serde", + "serde_json", + "tokio", + "tokio-tungstenite", + "tower-http", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "liyanlabs-relay-win-capturer" +version = "0.1.0" +dependencies = [ + "log", + "serde", + "serde_json", + "thiserror 2.0.18", + "windows 0.58.0", + "windows-capture", +] + [[package]] name = "lock_api" version = "0.4.14" @@ -1908,140 +2042,6 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" -[[package]] -name = "scilaxy-relay-capturer" -version = "0.1.0" -dependencies = [ - "anyhow", - "clap", - "env_logger", - "futures-util", - "log", - "scilaxy-relay-mac-capturer", - "tokio", - "tokio-tungstenite", - "url", -] - -[[package]] -name = "scilaxy-relay-common" -version = "0.1.0" -dependencies = [ - "log", - "serde", - "thiserror 2.0.18", -] - -[[package]] -name = "scilaxy-relay-control" -version = "0.1.0" -dependencies = [ - "anyhow", - "axum", - "chrono", - "clap", - "rand 0.8.6", - "scilaxy-relay-common", - "serde", - "serde_json", - "sqlx", - "thiserror 2.0.18", - "tokio", - "tower-http", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "scilaxy-relay-mac-capturer" -version = "0.1.0" -dependencies = [ - "log", - "serde", - "serde_json", -] - -[[package]] -name = "scilaxy-relay-proto" -version = "0.1.0" -dependencies = [ - "bytes", - "prost", - "prost-build", - "protox", - "tokio-util", -] - -[[package]] -name = "scilaxy-relay-rendezvous" -version = "0.1.0" -dependencies = [ - "anyhow", - "bytes", - "clap", - "env_logger", - "futures-util", - "log", - "prost", - "reqwest", - "scilaxy-relay-common", - "scilaxy-relay-proto", - "serde", - "serde_json", - "tokio", - "tokio-tungstenite", - "tokio-util", -] - -[[package]] -name = "scilaxy-relay-server" -version = "0.1.0" -dependencies = [ - "anyhow", - "bytes", - "clap", - "env_logger", - "futures-util", - "log", - "prost", - "scilaxy-relay-proto", - "tokio", - "tokio-tungstenite", - "tokio-util", -] - -[[package]] -name = "scilaxy-relay-stream" -version = "0.1.0" -dependencies = [ - "anyhow", - "axum", - "bytes", - "clap", - "env_logger", - "futures-util", - "log", - "serde", - "serde_json", - "tokio", - "tokio-tungstenite", - "tower-http", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "scilaxy-relay-win-capturer" -version = "0.1.0" -dependencies = [ - "log", - "serde", - "serde_json", - "thiserror 2.0.18", - "windows 0.58.0", - "windows-capture", -] - [[package]] name = "scopeguard" version = "1.2.0" diff --git a/Cargo.toml b/Cargo.toml index 7128e3f..352fba5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ members = [ version = "0.1.0" edition = "2021" license = "AGPL-3.0-or-later" -repository = "https://github.com/scienceol/scilaxy-relay" +repository = "https://github.com/scienceol/liyanlabs-relay" [workspace.dependencies] tokio = { version = "1", features = ["full"] } diff --git a/Dockerfile b/Dockerfile index 6cce37f..668c3c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ # syntax=docker/dockerfile:1.7 # -# Build all scilaxy-relay binaries in one shared cargo-chef pass, then +# Build all liyanlabs-relay binaries in one shared cargo-chef pass, then # split into per-binary runtime images via the `BIN` build-arg. The # alternative — four independent Dockerfiles — would re-download the # entire dependency graph four times in CI; this layout shares the # `cargo chef cook` cache across all four targets. # # Build: -# docker build --build-arg BIN=stream -t scilaxy-relay-stream:dev . -# docker build --build-arg BIN=control -t scilaxy-relay-control:dev . -# docker build --build-arg BIN=rendezvous -t scilaxy-relay-rendezvous:dev . -# docker build --build-arg BIN=relay -t scilaxy-relay-relay:dev . +# docker build --build-arg BIN=stream -t liyanlabs-relay-stream:dev . +# docker build --build-arg BIN=control -t liyanlabs-relay-control:dev . +# docker build --build-arg BIN=rendezvous -t liyanlabs-relay-rendezvous:dev . +# docker build --build-arg BIN=relay -t liyanlabs-relay-relay:dev . # # Each binary is a self-contained statically-linked-ish binary (libc # only) that listens on a single port — see crate-specific README for @@ -55,10 +55,10 @@ RUN cargo chef cook --release --recipe-path recipe.json # in the relay's k8s pods. COPY . . RUN cargo build --release \ - --bin scilaxy-stream \ - --bin scilaxy-control \ - --bin scilaxy-rendezvous \ - --bin scilaxy-relay + --bin liyanlabs-stream \ + --bin liyanlabs-control \ + --bin liyanlabs-rendezvous \ + --bin liyanlabs-relay # ─── Runtime: select one binary per image via the BIN build arg ─── FROM debian:bookworm-slim AS runtime @@ -67,15 +67,15 @@ ENV BIN=${BIN} RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ && rm -rf /var/lib/apt/lists/* \ - && groupadd --system --gid 1000 scilaxy \ - && useradd --system --uid 1000 --gid 1000 --shell /usr/sbin/nologin scilaxy + && groupadd --system --gid 1000 liyanlabs \ + && useradd --system --uid 1000 --gid 1000 --shell /usr/sbin/nologin liyanlabs # Map the BIN arg to the actual cargo target name. Cargo binaries are -# `scilaxy-{stream,control,rendezvous,relay}` and we copy whichever the +# `liyanlabs-{stream,control,rendezvous,relay}` and we copy whichever the # caller asked for. -COPY --from=builder /app/target/release/scilaxy-${BIN} /usr/local/bin/scilaxy-server -USER scilaxy +COPY --from=builder /app/target/release/liyanlabs-${BIN} /usr/local/bin/liyanlabs-server +USER liyanlabs # Each binary reads its bind config from CLI flags / env. We don't # pin a port via EXPOSE because the four binaries listen on different # ports — k8s Service handles port mapping anyway. -ENTRYPOINT ["/usr/local/bin/scilaxy-server"] +ENTRYPOINT ["/usr/local/bin/liyanlabs-server"] diff --git a/README.md b/README.md index c22b08c..1ffa10e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# scilaxy-relay +# liyanlabs-relay A self-hosted RustDesk-compatible rendezvous + relay server, written from scratch and licensed AGPL-3.0-or-later. Designed to back the remote-desktop -feature for advanced users of [Scilaxy](https://scilaxy.ai). +feature for advanced users of [LiyanLabs](https://liyanlabs.com). ## Status @@ -28,5 +28,5 @@ This project is **AGPL-3.0-or-later**. RustDesk's wire protocol definitions network-accessible service is required by §13 to make the corresponding source available to its users. -The Scilaxy product itself is **not** a derivative of this code: it talks to -`scilaxy-relay` only over a network API. +The LiyanLabs product itself is **not** a derivative of this code: it talks to +`liyanlabs-relay` only over a network API. diff --git a/crates/capturer/Cargo.toml b/crates/capturer/Cargo.toml index 1344400..2d24382 100644 --- a/crates/capturer/Cargo.toml +++ b/crates/capturer/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "scilaxy-relay-capturer" +name = "liyanlabs-relay-capturer" version.workspace = true edition.workspace = true license.workspace = true [[bin]] -name = "scilaxy-capturer" +name = "liyanlabs-capturer" path = "src/main.rs" [dependencies] @@ -19,4 +19,4 @@ env_logger.workspace = true url = "2" [target.'cfg(target_os = "macos")'.dependencies] -scilaxy-relay-mac-capturer = { path = "../mac-capturer" } +liyanlabs-relay-mac-capturer = { path = "../mac-capturer" } diff --git a/crates/capturer/src/main.rs b/crates/capturer/src/main.rs index 477244f..0b5d001 100644 --- a/crates/capturer/src/main.rs +++ b/crates/capturer/src/main.rs @@ -1,6 +1,6 @@ -//! `scilaxy-capturer`: native screen-capture publisher. +//! `liyanlabs-capturer`: native screen-capture publisher. //! -//! v1: ScreenCaptureKit + VideoToolbox via `scilaxy-relay-mac-capturer` +//! v1: ScreenCaptureKit + VideoToolbox via `liyanlabs-relay-mac-capturer` //! (macOS only). Each HEVC NAL unit is forwarded as a single Binary //! WebSocket frame to the stream server. //! @@ -14,16 +14,16 @@ use futures_util::SinkExt; use tokio_tungstenite::tungstenite::Message; #[derive(Debug, Parser)] -#[command(name = "scilaxy-capturer", about = "screen → HEVC → scilaxy-stream WS")] +#[command(name = "liyanlabs-capturer", about = "screen → HEVC → liyanlabs-stream WS")] struct Args { - /// Stream peer id (the room name on scilaxy-stream). - #[arg(long, env = "SCILAXY_PEER_ID")] + /// Stream peer id (the room name on liyanlabs-stream). + #[arg(long, env = "LIYANLABS_PEER_ID")] peer_id: String, - /// scilaxy-stream publisher URL. Path part is auto-suffixed with the peer id. + /// liyanlabs-stream publisher URL. Path part is auto-suffixed with the peer id. #[arg( long, - env = "SCILAXY_STREAM_URL", + env = "LIYANLABS_STREAM_URL", default_value = "ws://127.0.0.1:21130/ws/stream" )] stream_url: String, @@ -105,12 +105,12 @@ fn start_native( height: u32, fps: u32, bitrate_kbps: u32, -) -> Result> { +) -> Result> { // display_id=0 selects the primary display, matching mac-capturer's // convention. The standalone capturer binary is a PoC and doesn't - // expose a picker — production runners go through scilaxy-runner's + // expose a picker — production runners go through liyanlabs-runner's // executor::stream which threads the user-selected display through. - scilaxy_relay_mac_capturer::start(width, height, fps, bitrate_kbps, 0) + liyanlabs_relay_mac_capturer::start(width, height, fps, bitrate_kbps, 0) .map_err(|e| anyhow::anyhow!("{e}")) } @@ -121,7 +121,7 @@ fn start_native( _fps: u32, _b: u32, ) -> Result> { - anyhow::bail!("scilaxy-capturer: only macOS is supported in v1"); + anyhow::bail!("liyanlabs-capturer: only macOS is supported in v1"); } #[cfg(not(target_os = "macos"))] diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index c364715..3c0bc71 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "scilaxy-relay-common" +name = "liyanlabs-relay-common" version.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs index 0acb2bb..a852c11 100644 --- a/crates/common/src/lib.rs +++ b/crates/common/src/lib.rs @@ -1,4 +1,4 @@ -//! Shared types and helpers across scilaxy-relay crates. +//! Shared types and helpers across liyanlabs-relay crates. use serde::{Deserialize, Serialize}; diff --git a/crates/control/Cargo.toml b/crates/control/Cargo.toml index bdf9ccc..14b3d80 100644 --- a/crates/control/Cargo.toml +++ b/crates/control/Cargo.toml @@ -1,15 +1,15 @@ [package] -name = "scilaxy-relay-control" +name = "liyanlabs-relay-control" version.workspace = true edition.workspace = true license.workspace = true [[bin]] -name = "scilaxy-control" +name = "liyanlabs-control" path = "src/main.rs" [dependencies] -scilaxy-relay-common = { path = "../common" } +liyanlabs-relay-common = { path = "../common" } tokio.workspace = true axum.workspace = true sqlx.workspace = true diff --git a/crates/control/src/http.rs b/crates/control/src/http.rs index 8411edf..94dce44 100644 --- a/crates/control/src/http.rs +++ b/crates/control/src/http.rs @@ -35,7 +35,7 @@ pub async fn serve(port: u16, token: String, pool: SqlitePool) -> Result<()> { let listener = tokio::net::TcpListener::bind(bind) .await .with_context(|| format!("bind {bind}"))?; - tracing::info!("scilaxy-control listening on {bind}"); + tracing::info!("liyanlabs-control listening on {bind}"); axum::serve(listener, app).await?; Ok(()) } diff --git a/crates/control/src/main.rs b/crates/control/src/main.rs index 6bb419b..809739e 100644 --- a/crates/control/src/main.rs +++ b/crates/control/src/main.rs @@ -1,11 +1,11 @@ -//! `scilaxy-control`: HTTP control plane for scilaxy-relay. +//! `liyanlabs-control`: HTTP control plane for liyanlabs-relay. //! //! Single-binary v1: hosts the rendezvous + relay listeners alongside an //! HTTP API. We split to separate processes (and swap sqlite → postgres) //! when we need to scale horizontally. //! //! Authentication: every protected route requires a bearer token matching -//! `--token` / `SCILAXY_CONTROL_TOKEN`. Scilaxy's backend holds this secret; +//! `--token` / `LIYANLABS_CONTROL_TOKEN`. LiyanLabs's backend holds this secret; //! end users never see it. mod audit; @@ -18,24 +18,24 @@ use clap::Parser; #[derive(Debug, Parser)] #[command( - name = "scilaxy-control", + name = "liyanlabs-control", version, - about = "scilaxy-relay control plane" + about = "liyanlabs-relay control plane" )] struct Args { /// Bind port for the HTTP control API. - #[arg(long, env = "SCILAXY_CONTROL_PORT", default_value_t = 21120)] + #[arg(long, env = "LIYANLABS_CONTROL_PORT", default_value_t = 21120)] port: u16, /// Shared bearer token clients must present. - #[arg(long, env = "SCILAXY_CONTROL_TOKEN")] + #[arg(long, env = "LIYANLABS_CONTROL_TOKEN")] token: String, /// Path to the SQLite database file. #[arg( long, - env = "SCILAXY_CONTROL_DB", - default_value = "scilaxy-control.sqlite" + env = "LIYANLABS_CONTROL_DB", + default_value = "liyanlabs-control.sqlite" )] db: String, } diff --git a/crates/mac-capturer/Cargo.toml b/crates/mac-capturer/Cargo.toml index 1511e5e..1f60201 100644 --- a/crates/mac-capturer/Cargo.toml +++ b/crates/mac-capturer/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "scilaxy-relay-mac-capturer" +name = "liyanlabs-relay-mac-capturer" version.workspace = true edition.workspace = true # Dual-licensed: this crate contains only first-party code (no AGPL # upstream sources). MIT lets it be embedded into the MIT-licensed -# scilaxy-runner without spreading AGPL through the runner workspace; -# AGPL keeps it compatible with the rest of scilaxy-relay. +# liyanlabs-runner without spreading AGPL through the runner workspace; +# AGPL keeps it compatible with the rest of liyanlabs-relay. license = "MIT OR AGPL-3.0-or-later" [lib] diff --git a/crates/mac-capturer/examples/dump.rs b/crates/mac-capturer/examples/dump.rs index 89005e1..ddaf406 100644 --- a/crates/mac-capturer/examples/dump.rs +++ b/crates/mac-capturer/examples/dump.rs @@ -1,4 +1,4 @@ -//! `cargo run -p scilaxy-relay-mac-capturer --example dump > /tmp/native.h265` +//! `cargo run -p liyanlabs-relay-mac-capturer --example dump > /tmp/native.h265` //! //! Stream raw NAL bytes from the Swift capturer to stdout for ~3s, then exit. //! Use ffprobe to validate the output afterwards. @@ -12,7 +12,7 @@ use std::time::{Duration, Instant}; fn main() { eprintln!("starting native mac capturer (1920x1080 @30fps, 4 Mbps)"); let rx = - scilaxy_relay_mac_capturer::start(1920, 1080, 30, 4000, 0).expect("start mac-capturer"); + liyanlabs_relay_mac_capturer::start(1920, 1080, 30, 4000, 0).expect("start mac-capturer"); let stdout = io::stdout(); let mut out = stdout.lock(); let deadline = Instant::now() + Duration::from_secs(3); diff --git a/crates/mac-capturer/src/lib.rs b/crates/mac-capturer/src/lib.rs index 03e0b14..4992ad9 100644 --- a/crates/mac-capturer/src/lib.rs +++ b/crates/mac-capturer/src/lib.rs @@ -9,7 +9,7 @@ use std::os::raw::{c_int, c_void}; use std::sync::mpsc; extern "C" { - fn scilaxy_capturer_start( + fn liyanlabs_capturer_start( width: i32, height: i32, fps: i32, @@ -18,15 +18,15 @@ extern "C" { ctx: *mut c_void, cb: extern "C" fn(*mut c_void, *const u8, isize, i64), ) -> c_int; - fn scilaxy_capturer_select_display(display_id: u32) -> c_int; - fn scilaxy_capturer_active_display_id() -> u32; - fn scilaxy_capturer_list_displays_json(out: *mut u8, cap: isize) -> isize; - fn scilaxy_capturer_set_bitrate(kbps: i32) -> c_int; - fn scilaxy_capturer_bitrate_kbps() -> i32; - fn scilaxy_capturer_set_fps(fps: i32) -> c_int; - fn scilaxy_capturer_fps() -> i32; - fn scilaxy_capturer_set_resolution(width: i32, height: i32) -> c_int; - fn scilaxy_capturer_resolution() -> i32; + fn liyanlabs_capturer_select_display(display_id: u32) -> c_int; + fn liyanlabs_capturer_active_display_id() -> u32; + fn liyanlabs_capturer_list_displays_json(out: *mut u8, cap: isize) -> isize; + fn liyanlabs_capturer_set_bitrate(kbps: i32) -> c_int; + fn liyanlabs_capturer_bitrate_kbps() -> i32; + fn liyanlabs_capturer_set_fps(fps: i32) -> c_int; + fn liyanlabs_capturer_fps() -> i32; + fn liyanlabs_capturer_set_resolution(width: i32, height: i32) -> c_int; + fn liyanlabs_capturer_resolution() -> i32; } /// One HEVC NAL unit, with the 4-byte Annex-B start code already prepended. @@ -51,7 +51,7 @@ pub fn start( let ctx = Box::into_raw(boxed) as *mut c_void; let rc = unsafe { - scilaxy_capturer_start( + liyanlabs_capturer_start( width as i32, height as i32, fps as i32, @@ -63,7 +63,7 @@ pub fn start( }; if rc != 0 { unsafe { drop(Box::from_raw(ctx as *mut mpsc::Sender)) }; - return Err("scilaxy_capturer_start failed"); + return Err("liyanlabs_capturer_start failed"); } Ok(rx) } @@ -72,7 +72,7 @@ pub fn start( /// tear down the encoder or WS publisher; just swaps SCKit's content /// filter. The next encoded keyframe will reflect the new display. pub fn select_display(display_id: u32) -> Result<(), &'static str> { - let rc = unsafe { scilaxy_capturer_select_display(display_id) }; + let rc = unsafe { liyanlabs_capturer_select_display(display_id) }; match rc { 0 => Ok(()), 1 => Err("capturer not started"), @@ -82,13 +82,13 @@ pub fn select_display(display_id: u32) -> Result<(), &'static str> { /// Currently active display id, or `0` if no capturer is running. pub fn active_display_id() -> u32 { - unsafe { scilaxy_capturer_active_display_id() } + unsafe { liyanlabs_capturer_active_display_id() } } /// Set the encoder's average bitrate ceiling (kbps). Cheap — VT applies /// it on the next frame. pub fn set_bitrate_kbps(kbps: u32) -> Result<(), &'static str> { - let rc = unsafe { scilaxy_capturer_set_bitrate(kbps as i32) }; + let rc = unsafe { liyanlabs_capturer_set_bitrate(kbps as i32) }; match rc { 0 => Ok(()), 1 => Err("capturer not started"), @@ -98,7 +98,7 @@ pub fn set_bitrate_kbps(kbps: u32) -> Result<(), &'static str> { /// Currently configured bitrate (kbps), or 0 if no capturer running. pub fn bitrate_kbps() -> u32 { - let v = unsafe { scilaxy_capturer_bitrate_kbps() }; + let v = unsafe { liyanlabs_capturer_bitrate_kbps() }; if v < 0 { 0 } else { @@ -108,7 +108,7 @@ pub fn bitrate_kbps() -> u32 { /// Set the target framerate. Updates SCKit + VT in one shot. pub fn set_fps(fps: u32) -> Result<(), &'static str> { - let rc = unsafe { scilaxy_capturer_set_fps(fps as i32) }; + let rc = unsafe { liyanlabs_capturer_set_fps(fps as i32) }; match rc { 0 => Ok(()), 1 => Err("capturer not started"), @@ -117,7 +117,7 @@ pub fn set_fps(fps: u32) -> Result<(), &'static str> { } pub fn fps() -> u32 { - let v = unsafe { scilaxy_capturer_fps() }; + let v = unsafe { liyanlabs_capturer_fps() }; if v < 0 { 0 } else { @@ -128,7 +128,7 @@ pub fn fps() -> u32 { /// Switch output resolution. Briefly freezes the viewer (~200ms) while /// the encoder rebuilds. pub fn set_resolution(width: u32, height: u32) -> Result<(), &'static str> { - let rc = unsafe { scilaxy_capturer_set_resolution(width as i32, height as i32) }; + let rc = unsafe { liyanlabs_capturer_set_resolution(width as i32, height as i32) }; match rc { 0 => Ok(()), 1 => Err("capturer not started"), @@ -138,7 +138,7 @@ pub fn set_resolution(width: u32, height: u32) -> Result<(), &'static str> { /// Returns `(width, height)`, or `(0, 0)` if no capturer is running. pub fn resolution() -> (u32, u32) { - let v = unsafe { scilaxy_capturer_resolution() }; + let v = unsafe { liyanlabs_capturer_resolution() }; if v <= 0 { return (0, 0); } @@ -163,7 +163,7 @@ pub fn list_displays() -> Vec { // 8 KB is far more than enough for typical setups (a 12-monitor wall // would be ≈ 1 KB). let mut buf = vec![0u8; 8192]; - let n = unsafe { scilaxy_capturer_list_displays_json(buf.as_mut_ptr(), buf.len() as isize) }; + let n = unsafe { liyanlabs_capturer_list_displays_json(buf.as_mut_ptr(), buf.len() as isize) }; if n < 0 { return Vec::new(); } diff --git a/crates/mac-capturer/swift/MacCapturer.swift b/crates/mac-capturer/swift/MacCapturer.swift index 8b0f666..e44861d 100644 --- a/crates/mac-capturer/swift/MacCapturer.swift +++ b/crates/mac-capturer/swift/MacCapturer.swift @@ -1,6 +1,6 @@ // MacCapturer.swift // -// Native screen capture + HEVC encoding pipeline for scilaxy-capturer. +// Native screen capture + HEVC encoding pipeline for liyanlabs-capturer. // // ScreenCaptureKit (macOS 12.3+) → CVPixelBuffer // → VTCompressionSession (HEVC Main, 30fps, 1s GOP) @@ -8,7 +8,7 @@ // // The pipeline is intentionally synchronous on a single dispatch queue. // Rust receives a flat byte buffer per NAL unit (with 4-byte start code), -// which is exactly what scilaxy-capturer's WebSocket publisher expects. +// which is exactly what liyanlabs-capturer's WebSocket publisher expects. // // We expose a small C ABI so build.rs can `swiftc -emit-library` // and Rust can `extern "C"` it with `#[link]`. @@ -23,7 +23,7 @@ import CoreVideo /// One NAL unit, callback-delivered. The buffer is **not** owned by the /// callee — copy out before returning. -public typealias SciLaxyNalCallback = @convention(c) ( +public typealias LiyanLabsNalCallback = @convention(c) ( _ ctx: UnsafeMutableRawPointer?, _ data: UnsafePointer, _ length: Int, @@ -31,19 +31,19 @@ public typealias SciLaxyNalCallback = @convention(c) ( ) -> Void /// One-display-per-process singleton. We hold on to the running -/// MacCapturer so `scilaxy_capturer_select_display` can swap the SCStream's +/// MacCapturer so `liyanlabs_capturer_select_display` can swap the SCStream's /// content filter without tearing down the encoder + WS publisher. nonisolated(unsafe) private var sharedCapturer: MacCapturer? -@_cdecl("scilaxy_capturer_start") -public func scilaxy_capturer_start( +@_cdecl("liyanlabs_capturer_start") +public func liyanlabs_capturer_start( width: Int32, height: Int32, fps: Int32, bitrateKbps: Int32, displayId: UInt32, // 0 = default (first display) ctx: UnsafeMutableRawPointer?, - cb: SciLaxyNalCallback + cb: LiyanLabsNalCallback ) -> Int32 { let s = MacCapturer( width: Int(width), @@ -57,7 +57,7 @@ public func scilaxy_capturer_start( do { try s.start() } catch { - NSLog("scilaxy mac-capturer: start failed: \(error)") + NSLog("liyanlabs mac-capturer: start failed: \(error)") return 1 } sharedCapturer = s @@ -67,22 +67,22 @@ public func scilaxy_capturer_start( /// Switch the running capturer to a different display. Returns 0 on /// success, non-zero if no capturer is running or SCKit refused the /// new content filter. -@_cdecl("scilaxy_capturer_select_display") -public func scilaxy_capturer_select_display(displayId: UInt32) -> Int32 { +@_cdecl("liyanlabs_capturer_select_display") +public func liyanlabs_capturer_select_display(displayId: UInt32) -> Int32 { guard let s = sharedCapturer else { return 1 } do { try s.selectDisplay(CGDirectDisplayID(displayId)) return 0 } catch { - NSLog("scilaxy mac-capturer: select_display failed: \(error)") + NSLog("liyanlabs mac-capturer: select_display failed: \(error)") return 2 } } /// Snapshot of the currently active display (set after `start` / /// after a successful `select_display`). -@_cdecl("scilaxy_capturer_active_display_id") -public func scilaxy_capturer_active_display_id() -> UInt32 { +@_cdecl("liyanlabs_capturer_active_display_id") +public func liyanlabs_capturer_active_display_id() -> UInt32 { return sharedCapturer?.currentDisplayId ?? 0 } @@ -91,8 +91,8 @@ public func scilaxy_capturer_active_display_id() -> UInt32 { /// rebuild, no GOP boundary needed. /// /// Returns 0 on success, non-zero if the capturer isn't running. -@_cdecl("scilaxy_capturer_set_bitrate") -public func scilaxy_capturer_set_bitrate(kbps: Int32) -> Int32 { +@_cdecl("liyanlabs_capturer_set_bitrate") +public func liyanlabs_capturer_set_bitrate(kbps: Int32) -> Int32 { guard let s = sharedCapturer, let enc = s.encoderHandle else { return 1 } // Clamp to a sane range: 100 kbps floor (anything below that is // unusable for screens), 100 Mbps ceiling (above that there's no @@ -110,8 +110,8 @@ public func scilaxy_capturer_set_bitrate(kbps: Int32) -> Int32 { } /// Currently configured bitrate (kbps), or `0` if no capturer running. -@_cdecl("scilaxy_capturer_bitrate_kbps") -public func scilaxy_capturer_bitrate_kbps() -> Int32 { +@_cdecl("liyanlabs_capturer_bitrate_kbps") +public func liyanlabs_capturer_bitrate_kbps() -> Int32 { return Int32(sharedCapturer?.currentBitrateKbps ?? 0) } @@ -119,22 +119,22 @@ public func scilaxy_capturer_bitrate_kbps() -> Int32 { /// `minimumFrameInterval` and VT's `ExpectedFrameRate` / /// `MaxKeyFrameInterval` so the GOP cadence stays at 1 second. /// Returns 0 on success. -@_cdecl("scilaxy_capturer_set_fps") -public func scilaxy_capturer_set_fps(fps: Int32) -> Int32 { +@_cdecl("liyanlabs_capturer_set_fps") +public func liyanlabs_capturer_set_fps(fps: Int32) -> Int32 { guard let s = sharedCapturer else { return 1 } let clamped = max(5, min(120, Int(fps))) do { try s.setFps(clamped) return 0 } catch { - NSLog("scilaxy mac-capturer: setFps failed: \(error)") + NSLog("liyanlabs mac-capturer: setFps failed: \(error)") return 2 } } /// Currently configured fps, or `0` if no capturer running. -@_cdecl("scilaxy_capturer_fps") -public func scilaxy_capturer_fps() -> Int32 { +@_cdecl("liyanlabs_capturer_fps") +public func liyanlabs_capturer_fps() -> Int32 { return Int32(sharedCapturer?.currentFps ?? 0) } @@ -142,8 +142,8 @@ public func scilaxy_capturer_fps() -> Int32 { /// and brings up a new one at the new size; the SCStream stays running. /// Expect a brief (~100-200ms) freeze on the viewer side as the new /// SPS+PPS+IDR propagate. Returns 0 on success. -@_cdecl("scilaxy_capturer_set_resolution") -public func scilaxy_capturer_set_resolution(width: Int32, height: Int32) -> Int32 { +@_cdecl("liyanlabs_capturer_set_resolution") +public func liyanlabs_capturer_set_resolution(width: Int32, height: Int32) -> Int32 { guard let s = sharedCapturer else { return 1 } let w = max(160, min(7680, Int(width))) let h = max(120, min(4320, Int(height))) @@ -151,15 +151,15 @@ public func scilaxy_capturer_set_resolution(width: Int32, height: Int32) -> Int3 try s.setResolution(width: w, height: h) return 0 } catch { - NSLog("scilaxy mac-capturer: setResolution failed: \(error)") + NSLog("liyanlabs mac-capturer: setResolution failed: \(error)") return 2 } } /// Returns `width << 16 | height` packed into a single Int32 — caller /// extracts the two halves. Cheap to read; avoids a second FFI call. -@_cdecl("scilaxy_capturer_resolution") -public func scilaxy_capturer_resolution() -> Int32 { +@_cdecl("liyanlabs_capturer_resolution") +public func liyanlabs_capturer_resolution() -> Int32 { guard let s = sharedCapturer else { return 0 } let w = Int32(min(0xFFFF, s.currentWidth)) let h = Int32(min(0xFFFF, s.currentHeight)) @@ -170,8 +170,8 @@ public func scilaxy_capturer_resolution() -> Int32 { /// `[{"id":,"width":,"height":,"is_primary":}, …]`. /// Returns the number of bytes written, or `-1` if `out` is too small /// (caller should retry with `cap` doubled). -@_cdecl("scilaxy_capturer_list_displays_json") -public func scilaxy_capturer_list_displays_json( +@_cdecl("liyanlabs_capturer_list_displays_json") +public func liyanlabs_capturer_list_displays_json( out: UnsafeMutablePointer, cap: Int ) -> Int { @@ -203,10 +203,10 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked private var height: Int private var fps: Int private let ctx: UnsafeMutableRawPointer? - private let cb: SciLaxyNalCallback + private let cb: LiyanLabsNalCallback private var stream: SCStream? private var encoder: VTCompressionSession? - private let queue = DispatchQueue(label: "ai.scilaxy.capturer", qos: .userInteractive) + private let queue = DispatchQueue(label: "ai.liyanlabs.capturer", qos: .userInteractive) private var hasEmittedSpsPps = false /// Caller's preferred display, or `nil` to pick the first one returned @@ -216,8 +216,8 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked /// Display the SCStream is currently filtering on. Reset whenever /// `selectDisplay` swaps the content filter. var currentDisplayId: CGDirectDisplayID = 0 - /// Read-write so `scilaxy_capturer_set_bitrate` can mutate the live encoder. - /// Tracked here so callers can `scilaxy_capturer_bitrate_kbps()` it back + /// Read-write so `liyanlabs_capturer_set_bitrate` can mutate the live encoder. + /// Tracked here so callers can `liyanlabs_capturer_bitrate_kbps()` it back /// without re-poking VT. var currentBitrateKbps: Int = 0 /// Public accessor for the C ABI bridge — VT properties live on the @@ -226,7 +226,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked var encoderHandle: VTCompressionSession? { encoder } init(width: Int, height: Int, fps: Int, bitrateKbps: Int, - ctx: UnsafeMutableRawPointer?, cb: @escaping SciLaxyNalCallback, + ctx: UnsafeMutableRawPointer?, cb: @escaping LiyanLabsNalCallback, initialDisplayId: CGDirectDisplayID? = nil) { self.width = width self.height = height @@ -242,12 +242,12 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked var currentFps: Int { fps } func start() throws { - NSLog("scilaxy mac-capturer: start()") + NSLog("liyanlabs mac-capturer: start()") // Build the encoder before SCKit so we don't drop frames during init. try makeEncoder() - NSLog("scilaxy mac-capturer: encoder ready") + NSLog("liyanlabs mac-capturer: encoder ready") try startCapture() - NSLog("scilaxy mac-capturer: capture session started") + NSLog("liyanlabs mac-capturer: capture session started") } private func makeEncoder() throws { @@ -332,7 +332,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked throw NSError(domain: "MacCapturer", code: -1, userInfo: [NSLocalizedDescriptionKey: "no display"]) } - NSLog("scilaxy mac-capturer: got display id=%u %dx%d", + NSLog("liyanlabs mac-capturer: got display id=%u %dx%d", UInt32(display.displayID), display.width, display.height) self.currentDisplayId = display.displayID @@ -397,7 +397,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked } if let e = updateError { throw e } self.currentDisplayId = id - NSLog("scilaxy mac-capturer: switched to display id=%u %dx%d", + NSLog("liyanlabs mac-capturer: switched to display id=%u %dx%d", UInt32(id), display.width, display.height) } @@ -448,7 +448,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked value: NSNumber(value: newFps)) } self.fps = newFps - NSLog("scilaxy mac-capturer: fps -> %d", newFps) + NSLog("liyanlabs mac-capturer: fps -> %d", newFps) } /// Tear down the encoder, rebuild at the new size, and reconfigure @@ -497,7 +497,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked // 3) Build a fresh encoder at the new size with the *current* // bitrate/fps settings preserved. try makeEncoder() - NSLog("scilaxy mac-capturer: resolution -> %dx%d", newW, newH) + NSLog("liyanlabs mac-capturer: resolution -> %dx%d", newW, newH) } // MARK: SCStreamOutput @@ -527,7 +527,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked } func stream(_ stream: SCStream, didStopWithError error: Error) { - NSLog("scilaxy mac-capturer: stream stopped: \(error)") + NSLog("liyanlabs mac-capturer: stream stopped: \(error)") } // MARK: encode → annex-b @@ -680,7 +680,7 @@ private func listDisplaysSync() -> [DisplayInfo] { ) } } catch { - NSLog("scilaxy mac-capturer: listDisplaysSync failed: \(error)") + NSLog("liyanlabs mac-capturer: listDisplaysSync failed: \(error)") return [] } } diff --git a/crates/proto/Cargo.toml b/crates/proto/Cargo.toml index 9a9b71c..d05da03 100644 --- a/crates/proto/Cargo.toml +++ b/crates/proto/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "scilaxy-relay-proto" +name = "liyanlabs-relay-proto" version.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/relay/Cargo.toml b/crates/relay/Cargo.toml index a7a52fe..1be671a 100644 --- a/crates/relay/Cargo.toml +++ b/crates/relay/Cargo.toml @@ -1,15 +1,15 @@ [package] -name = "scilaxy-relay-server" +name = "liyanlabs-relay-server" version.workspace = true edition.workspace = true license.workspace = true [[bin]] -name = "scilaxy-relay" +name = "liyanlabs-relay" path = "src/main.rs" [dependencies] -scilaxy-relay-proto = { path = "../proto" } +liyanlabs-relay-proto = { path = "../proto" } tokio.workspace = true tokio-tungstenite.workspace = true tokio-util.workspace = true diff --git a/crates/relay/src/main.rs b/crates/relay/src/main.rs index 27aa34d..314d6ef 100644 --- a/crates/relay/src/main.rs +++ b/crates/relay/src/main.rs @@ -1,4 +1,4 @@ -//! `scilaxy-relay`: minimal hbbr replacement. +//! `liyanlabs-relay`: minimal hbbr replacement. //! //! PoC behaviour (parity with `rustdesk-server-demo`): pair the next two //! incoming TCP connections, switch both into raw passthrough, and @@ -27,16 +27,16 @@ use tokio_tungstenite::{tungstenite::Message as WsMessage, WebSocketStream}; #[derive(Debug, Parser)] #[command( - name = "scilaxy-relay", + name = "liyanlabs-relay", version, about = "RustDesk-compatible TCP relay" )] struct Args { /// Raw TCP relay port (RustDesk default 21117). - #[arg(long, env = "SCILAXY_RELAY_PORT", default_value_t = 21117)] + #[arg(long, env = "LIYANLABS_RELAY_PORT", default_value_t = 21117)] port: u16, /// WebSocket relay port (RustDesk default 21119, used by web/RN clients). - #[arg(long, env = "SCILAXY_RELAY_WS_PORT", default_value_t = 21119)] + #[arg(long, env = "LIYANLABS_RELAY_WS_PORT", default_value_t = 21119)] ws_port: u16, } @@ -60,7 +60,7 @@ async fn main() -> Result<()> { let ws = TcpListener::bind(&ws_bind) .await .with_context(|| format!("bind {ws_bind}"))?; - log::info!("scilaxy-relay listening on tcp {tcp_bind}, ws {ws_bind}"); + log::info!("liyanlabs-relay listening on tcp {tcp_bind}, ws {ws_bind}"); let waiting: WaitSlot = std::sync::Arc::new(Mutex::new(None)); diff --git a/crates/rendezvous/Cargo.toml b/crates/rendezvous/Cargo.toml index ec8f650..e4ee358 100644 --- a/crates/rendezvous/Cargo.toml +++ b/crates/rendezvous/Cargo.toml @@ -1,16 +1,16 @@ [package] -name = "scilaxy-relay-rendezvous" +name = "liyanlabs-relay-rendezvous" version.workspace = true edition.workspace = true license.workspace = true [[bin]] -name = "scilaxy-rendezvous" +name = "liyanlabs-rendezvous" path = "src/main.rs" [dependencies] -scilaxy-relay-proto = { path = "../proto" } -scilaxy-relay-common = { path = "../common" } +liyanlabs-relay-proto = { path = "../proto" } +liyanlabs-relay-common = { path = "../common" } tokio.workspace = true tokio-tungstenite.workspace = true reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] } diff --git a/crates/rendezvous/src/main.rs b/crates/rendezvous/src/main.rs index f900d91..aec7f0d 100644 --- a/crates/rendezvous/src/main.rs +++ b/crates/rendezvous/src/main.rs @@ -1,4 +1,4 @@ -//! `scilaxy-rendezvous`: minimal hbbs replacement. +//! `liyanlabs-rendezvous`: minimal hbbs replacement. //! //! First-milestone scope (matches `rustdesk-server-demo`): //! * UDP: respond to `RegisterPeer` and `RegisterPk`. @@ -17,31 +17,31 @@ use clap::Parser; #[derive(Debug, Parser)] #[command( - name = "scilaxy-rendezvous", + name = "liyanlabs-rendezvous", version, about = "RustDesk-compatible rendezvous server" )] struct Args { /// Public address handed to clients as their relay server. - #[arg(long, env = "SCILAXY_RELAY_ADDR", default_value = "127.0.0.1")] + #[arg(long, env = "LIYANLABS_RELAY_ADDR", default_value = "127.0.0.1")] relay_addr: String, /// Bind port for both UDP and TCP rendezvous (RustDesk default 21116). - #[arg(long, env = "SCILAXY_RDV_PORT", default_value_t = 21116)] + #[arg(long, env = "LIYANLABS_RDV_PORT", default_value_t = 21116)] port: u16, /// WebSocket port (RustDesk default 21118 — used by web/RN clients). - #[arg(long, env = "SCILAXY_RDV_WS_PORT", default_value_t = 21118)] + #[arg(long, env = "LIYANLABS_RDV_WS_PORT", default_value_t = 21118)] ws_port: u16, /// Optional audit ingest URL on the control plane /// (e.g. http://127.0.0.1:21120/v1/_internal/audit). /// When unset, events are only logged. - #[arg(long, env = "SCILAXY_AUDIT_URL")] + #[arg(long, env = "LIYANLABS_AUDIT_URL")] audit_url: Option, /// Bearer token for the control-plane audit ingest endpoint. - #[arg(long, env = "SCILAXY_CONTROL_TOKEN")] + #[arg(long, env = "LIYANLABS_CONTROL_TOKEN")] audit_token: Option, } diff --git a/crates/rendezvous/src/registry.rs b/crates/rendezvous/src/registry.rs index 3a1830b..63d4d47 100644 --- a/crates/rendezvous/src/registry.rs +++ b/crates/rendezvous/src/registry.rs @@ -11,7 +11,7 @@ use std::time::Instant; use tokio::sync::{mpsc, RwLock}; -use scilaxy_relay_proto::hbb::RendezvousMessage; +use liyanlabs_relay_proto::hbb::RendezvousMessage; /// How we reach a registered peer to push them a server-initiated message. #[derive(Debug, Clone)] diff --git a/crates/rendezvous/src/server.rs b/crates/rendezvous/src/server.rs index 544aff2..6151b10 100644 --- a/crates/rendezvous/src/server.rs +++ b/crates/rendezvous/src/server.rs @@ -20,8 +20,8 @@ use tokio::sync::{mpsc, Mutex}; use tokio_tungstenite::tungstenite::Message as WsMessage; use tokio_util::codec::Framed; -use scilaxy_relay_proto::codec::RustDeskCodec; -use scilaxy_relay_proto::hbb::{ +use liyanlabs_relay_proto::codec::RustDeskCodec; +use liyanlabs_relay_proto::hbb::{ rendezvous_message::Union, RegisterPeerResponse, RegisterPkResponse, RelayResponse, RendezvousMessage, RequestRelay, }; @@ -48,7 +48,7 @@ pub async fn run(relay_addr: &str, port: u16, ws_port: u16, auditor: Auditor) -> .await .with_context(|| format!("bind WS {ws_bind}"))?; log::info!( - "scilaxy-rendezvous listening on udp+tcp {bind}, ws {ws_bind}, relay_addr={relay_addr}" + "liyanlabs-rendezvous listening on udp+tcp {bind}, ws {ws_bind}, relay_addr={relay_addr}" ); let registry = PeerRegistry::new(); diff --git a/crates/stream/Cargo.toml b/crates/stream/Cargo.toml index 74692a2..3927256 100644 --- a/crates/stream/Cargo.toml +++ b/crates/stream/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "scilaxy-relay-stream" +name = "liyanlabs-relay-stream" version.workspace = true edition.workspace = true license.workspace = true [[bin]] -name = "scilaxy-stream" +name = "liyanlabs-stream" path = "src/main.rs" [dependencies] diff --git a/crates/stream/src/main.rs b/crates/stream/src/main.rs index fc2d79f..100ef6e 100644 --- a/crates/stream/src/main.rs +++ b/crates/stream/src/main.rs @@ -1,4 +1,4 @@ -//! `scilaxy-stream`: ultra-thin video stream fan-out. +//! `liyanlabs-stream`: ultra-thin video stream fan-out. //! //! Two endpoints over WebSocket (axum): //! * `POST /ws/stream/:peer_id` — publisher. Pushes Binary frames. @@ -39,12 +39,12 @@ use tower_http::trace::TraceLayer; #[derive(Debug, Parser)] #[command( - name = "scilaxy-stream", + name = "liyanlabs-stream", version, - about = "binary stream fan-out for scilaxy" + about = "binary stream fan-out for liyanlabs" )] struct Args { - #[arg(long, env = "SCILAXY_STREAM_PORT", default_value_t = 21130)] + #[arg(long, env = "LIYANLABS_STREAM_PORT", default_value_t = 21130)] port: u16, } @@ -344,7 +344,7 @@ async fn main() -> Result<()> { let listener = tokio::net::TcpListener::bind(&bind) .await .with_context(|| format!("bind {bind}"))?; - tracing::info!("scilaxy-stream listening on {bind}"); + tracing::info!("liyanlabs-stream listening on {bind}"); axum::serve(listener, app).await?; Ok(()) } diff --git a/crates/win-capturer/Cargo.toml b/crates/win-capturer/Cargo.toml index edbdf71..e035124 100644 --- a/crates/win-capturer/Cargo.toml +++ b/crates/win-capturer/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "scilaxy-relay-win-capturer" +name = "liyanlabs-relay-win-capturer" version.workspace = true edition.workspace = true # Dual-licensed for the same reason as mac-capturer: this crate is -# embedded into the MIT-licensed scilaxy-runner via a Cargo path dep. -# AGPL keeps it consistent with the rest of scilaxy-relay's server-side +# embedded into the MIT-licensed liyanlabs-runner via a Cargo path dep. +# AGPL keeps it consistent with the rest of liyanlabs-relay's server-side # crates when imported into AGPL contexts. license = "MIT OR AGPL-3.0-or-later" diff --git a/crates/win-capturer/src/display.rs b/crates/win-capturer/src/display.rs index 16bb9be..be682ab 100644 --- a/crates/win-capturer/src/display.rs +++ b/crates/win-capturer/src/display.rs @@ -42,7 +42,7 @@ pub fn list_displays() -> Vec { }; Some(DisplayInfo { // 1-based id so 0 stays reserved for "default - // monitor" in scilaxy_capturer_start, matching the + // monitor" in liyanlabs_capturer_start, matching the // mac-capturer convention. id: (idx as u32) + 1, width, diff --git a/crates/win-capturer/src/lib.rs b/crates/win-capturer/src/lib.rs index b0c4c0d..aa0d50a 100644 --- a/crates/win-capturer/src/lib.rs +++ b/crates/win-capturer/src/lib.rs @@ -1,6 +1,6 @@ //! Windows-native screen capturer: WGC + MediaFoundation H264 encoder. //! -//! Mirror of `scilaxy-relay-mac-capturer`. Same public surface, same +//! Mirror of `liyanlabs-relay-mac-capturer`. Same public surface, same //! wire format on the WebSocket: per-NAL 8-byte big-endian wallclock-µs //! prefix + raw H264 Annex-B (00 00 00 01 + NAL bytes). Viewer code //! (`useH264Stream` in the web app) needs zero changes. @@ -43,7 +43,7 @@ pub use publisher::{ }; /// One H264 NAL unit, with the 4-byte Annex-B start code already prepended. -/// Keep the shape byte-identical to `scilaxy-relay-mac-capturer::Nal` so the +/// Keep the shape byte-identical to `liyanlabs-relay-mac-capturer::Nal` so the /// runner's stream module can use the same channel signature on both /// platforms with no per-OS plumbing. #[derive(Debug, Clone)] diff --git a/crates/win-capturer/src/publisher.rs b/crates/win-capturer/src/publisher.rs index cfab80c..531ec89 100644 --- a/crates/win-capturer/src/publisher.rs +++ b/crates/win-capturer/src/publisher.rs @@ -118,7 +118,7 @@ pub fn start( *sender_slot().lock().map_err(|_| "sender mutex poisoned")? = Some(tx); std::thread::Builder::new() - .name("scilaxy-win-capturer".into()) + .name("liyanlabs-win-capturer".into()) .spawn(move || { if let Err(e) = run_capture_thread() { log::warn!("[win-capturer] capture thread exited: {e:?}"); diff --git a/scripts/dump_view.py b/scripts/dump_view.py index 7df48df..364a05f 100644 --- a/scripts/dump_view.py +++ b/scripts/dump_view.py @@ -4,8 +4,8 @@ """ import os, sys, socket, struct, base64, time -HOST = os.environ.get("SCILAXY_HOST", "127.0.0.1") -PORT = int(os.environ.get("SCILAXY_STREAM_PORT", "21130")) +HOST = os.environ.get("LIYANLABS_HOST", "127.0.0.1") +PORT = int(os.environ.get("LIYANLABS_STREAM_PORT", "21130")) peer = sys.argv[1] if len(sys.argv) > 1 else "test123" secs = float(sys.argv[2]) if len(sys.argv) > 2 else 3.0 out_path = sys.argv[3] if len(sys.argv) > 3 else "/tmp/sample.h264" diff --git a/scripts/smoke_control.sh b/scripts/smoke_control.sh index c310f79..caa8401 100644 --- a/scripts/smoke_control.sh +++ b/scripts/smoke_control.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# End-to-end smoke test for scilaxy-relay-control. +# End-to-end smoke test for liyanlabs-relay-control. # # Verifies: # 1. POST /v1/peers binds a user_id to a fresh 9-digit peer_id @@ -9,13 +9,13 @@ # 5. GET /v1/audit shows the register event # 6. Bearer-token auth rejects unauthenticated calls # -# Requires: scilaxy-control on :21120, scilaxy-rendezvous on :21116, both wired -# with the same SCILAXY_CONTROL_TOKEN. +# Requires: liyanlabs-control on :21120, liyanlabs-rendezvous on :21116, both wired +# with the same LIYANLABS_CONTROL_TOKEN. set -euo pipefail -TOKEN="${SCILAXY_CONTROL_TOKEN:-dev-secret-test-token}" -CONTROL="${SCILAXY_CONTROL_URL:-http://127.0.0.1:21120}" +TOKEN="${LIYANLABS_CONTROL_TOKEN:-dev-secret-test-token}" +CONTROL="${LIYANLABS_CONTROL_URL:-http://127.0.0.1:21120}" red() { printf "\033[31m%s\033[0m\n" "$*"; } green() { printf "\033[32m%s\033[0m\n" "$*"; } diff --git a/scripts/smoke_stream.py b/scripts/smoke_stream.py index e4bff1d..bab9e5a 100644 --- a/scripts/smoke_stream.py +++ b/scripts/smoke_stream.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""End-to-end fan-out smoke test for scilaxy-stream. +"""End-to-end fan-out smoke test for liyanlabs-stream. Opens one publisher (ws /ws/stream/) and two viewers (ws /ws/view/), sends 5 binary frames from the publisher, expects each viewer to receive all 5 @@ -13,8 +13,8 @@ import threading import time -HOST = os.environ.get("SCILAXY_HOST", "127.0.0.1") -PORT = int(os.environ.get("SCILAXY_STREAM_PORT", "21130")) +HOST = os.environ.get("LIYANLABS_HOST", "127.0.0.1") +PORT = int(os.environ.get("LIYANLABS_STREAM_PORT", "21130")) def ws_connect(path: str): diff --git a/scripts/smoke_ws_register.py b/scripts/smoke_ws_register.py index f98cc2a..ecb4d77 100644 --- a/scripts/smoke_ws_register.py +++ b/scripts/smoke_ws_register.py @@ -13,8 +13,8 @@ import base64 import hashlib -HOST = os.environ.get("SCILAXY_HOST", "127.0.0.1") -PORT = int(os.environ.get("SCILAXY_RDV_WS_PORT", "21118")) +HOST = os.environ.get("LIYANLABS_HOST", "127.0.0.1") +PORT = int(os.environ.get("LIYANLABS_RDV_WS_PORT", "21118")) def varint(n: int) -> bytes: out = bytearray() diff --git a/scripts/smoke_ws_via_nginx.py b/scripts/smoke_ws_via_nginx.py index fa88e85..bf7114b 100644 --- a/scripts/smoke_ws_via_nginx.py +++ b/scripts/smoke_ws_via_nginx.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 -"""Verify that ws://localhost/ws/id reaches scilaxy-rendezvous via nginx.""" +"""Verify that ws://localhost/ws/id reaches liyanlabs-rendezvous via nginx.""" import os, socket, struct, sys, base64 -HOST = os.environ.get("SCILAXY_HOST", "127.0.0.1") -PORT = int(os.environ.get("SCILAXY_PORT", "80")) -PATH = os.environ.get("SCILAXY_PATH", "/ws/id") +HOST = os.environ.get("LIYANLABS_HOST", "127.0.0.1") +PORT = int(os.environ.get("LIYANLABS_PORT", "80")) +PATH = os.environ.get("LIYANLABS_PATH", "/ws/id") def varint(n): o = bytearray() @@ -70,7 +70,7 @@ def need(n): body = bytes(buf[cur:cur+n]) print(f"got {len(body)} bytes: {body.hex()}", file=sys.stderr) if body[:2] == b"\x3a\x00": - print("OK: nginx → scilaxy-rendezvous WebSocket path works", file=sys.stderr) + print("OK: nginx → liyanlabs-rendezvous WebSocket path works", file=sys.stderr) sys.exit(0) else: print(f"unexpected body: {body.hex()}", file=sys.stderr) diff --git a/web-test/index.html b/web-test/index.html index c8bea7f..43058b2 100644 --- a/web-test/index.html +++ b/web-test/index.html @@ -2,7 +2,7 @@ -scilaxy-relay · WebSocket smoke test +liyanlabs-relay · WebSocket smoke test