Commit Graph
38 Commits
Author SHA1 Message Date
debpalash 3ec43b3894 Merge #3670: fix(security): make content mutations admin-only (@DeryFerd) 2026-11-08 09:55:13 +05:30
debpalash 83da6c911a fix(api): preserve consumer reads while guarding content writes 2026-11-03 12:42:31 +05:30
debpalash 2906a52fdd test(api): keep gallery requests outside assertions 2026-11-03 12:24:04 +05:30
debpalash 2f5d30ac2b test(api): cover session-authenticated design previews 2026-11-03 12:22:05 +05:30
jonathanwxh-cell 047d29677c docs(docker): explain recovery from a lost share PIN (#3006) 2026-10-27 09:47:35 +05:30
debpalash da2b461734 feat(docker): opt-in share-PIN skip for the host's own browser
OMNIVOICE_TRUST_HOST_LOOPBACK=1 (server mode only) lets requests whose
socket address is exactly the container's default gateway skip the share
PIN on the main port. Forwarded headers are never read for the check, the
LAN-share listener never qualifies, and it grants PIN-tier consumption
rights only, never the API key or admin tier. Default unchanged.
2026-10-26 00:13:29 +05:30
velixio daa7024489 feat!: remove remote devices and remote workers (moved to VoiceStudio Pro)
Remote devices, remote workers and GPU sharing are now part of VoiceStudio
Pro and are no longer in the open-source app.

Removed: backend/worker/** and the workers API, the Workers and inbound-node
settings, compute-target and remote-runtime UI, the worker CI job, the
worker docs and ADR, and the grpcio, grpcio-tools and protobuf direct
dependencies (the protobuf security floor stays as a constraint).

Kept: local generation, dub, audiobook, batch, model install and GPU use on
this machine; network sharing; the remote backend that Intel Macs use.

Compatibility: existing databases keep their remote_workers,
remote_worker_enrollments and remote_tasks tables and migration 0010; they
are ignored. A saved worker target falls back to local. Model install and
licence plans with a non-local target now return HTTP 400.
2026-10-11 17:14:36 +05:30
debpalash b4bd8810a0 fix(api): accept media GETs from an allowed UI origin by Referer; clarify refusal messages
Split UI/API deployments (OMNIVOICE_PUBLIC_API_BASE) load video previews
and downloads with GETs that carry no Origin, only Sec-Fetch-Site, so they
were refused even with the UI origin in OMNIVOICE_ALLOWED_ORIGINS. Without
an Origin, a request whose Referer origin is on the same allowlist now
passes; a missing or foreign Referer is still refused.

The private-address URL import message now says where desktop users set
OMNIVOICE_ALLOW_PRIVATE_URL_IMPORTS (shared with the host-name message) and
that VPN or proxy apps in TUN/fake-IP mode can cause it.

The #2618 offload tests stub torch.cuda so a CUDA host with free VRAM no
longer changes their result.

Docs: reverse proxies in OMNIVOICE_TRUSTED_NETWORKS need their host name in
OMNIVOICE_ALLOWED_HOSTS, split deployments list the UI origin, LAN guests
open the share link by IP, and engine folders are set in the env file.

Changelog: cite #2419 for work that shipped through it, add upgrade steps,
the Windows ARM64 installer row and the #2609 credit, and split the URL
import entry.
2026-10-07 13:42:42 +05:30
debpalash 286ec7e22d fix(api): keep host checks for share-PIN requests from this machine 2026-10-04 23:06:29 +05:30
debpalash ff2d72ac1b fix(api): accept container host aliases and credentialed loopback proxies in the host check
Docker Desktop and Podman reach the desktop backend as a loopback peer
addressed by host.docker.internal / host.containers.internal, and a reverse
proxy on the same machine forwards the client's Host with its API key.
Both were refused by the host check. Allow the reserved .internal container
aliases by default, and skip the host check for any peer that presents a
valid API key, admin session, WebSocket ticket or share PIN; requests
without a valid credential stay host-checked.

The refusal now names the user env file for desktop installs. Dub stem,
segment and preview downloads, Ogg/Opus encoding, profile-image search,
storage rescans, HF token checks and Tailscale status also refuse
cross-site GETs. Docs list the guarded routes and where to set
OMNIVOICE_ALLOWED_HOSTS.
2026-10-04 22:41:41 +05:30
debpalash b2e9f82c57 Merge branch 'fix/sec-worker-hardening' into release/sec-combined
# Conflicts:
#	CHANGELOG.md
#	backend/api/routers/gallery.py
#	backend/api/routers/generation.py
#	tests/test_changelog_style.py
2026-10-04 22:03:55 +05:30
debpalash 4871658e66 fix(api): require a desktop authorization for engine install folders 2026-10-04 22:02:49 +05:30
debpalash 9f81168ea9 fix(api): reject cross-site browser requests and private URL import targets
- Refuse state-changing requests and WebSocket handshakes whose Origin or
  Sec-Fetch-Site marks another site, for every auth configuration; GET
  routes that start work refuse cross-site fetch metadata too.
- Require an allowed Host name for requests authorized only by network
  position (OMNIVOICE_ALLOWED_HOSTS adds names); credentialed requests and
  the public UI shell are exempt.
- Validate URL imports: http(s) only, public destinations only unless
  OMNIVOICE_ALLOW_PRIVATE_URL_IMPORTS=1, enforced again at connect time
  inside yt-dlp and on resolved media URLs; pass URLs after "--".
- Accept media extensions only for gallery and dubbing uploads, stop
  returning server paths from gallery imports, and limit ws/tts emo_audio
  to the app's voices and outputs folders.
- Apply the same checks in the Electron dev backend proxy.
2026-10-04 21:46:35 +05:30
Palash Debnath c4d63ef207 fix(app): align Electron, backend, packaging and documentation (#2578)
Align maintained Electron setup, docs, model licence descriptions, contact details, and CI syntax checks with the current application.
2026-10-03 06:24:59 +05:30
Palash Debnath 0834c8be28 feat(studio): consolidate community fixes and composer UI (#2419)
Consolidate community engine, workflow, dictation, and setup fixes with the Electron composer, sidebar, and voice UI.

Fix review findings in engine residency, remote exports, backup cleanup, bounded compressed-audio decoding, and reference preprocessing. Preserve contributor credits in CHANGELOG.md and leave the app version unchanged.

Supersedes #2325, #2338, #2368, #2377, #2379, #2380, #2383, #2384, #2387, #2390, #2391, #2392, #2393, #2395, #2400, #2401, #2402, #2409, #2410, and #2412.
2026-09-29 21:15:25 +05:30
debpalash 389e643944 docs: clarify LAN transport risks and logout reload timing 2026-09-27 14:10:06 +05:30
debpalash 54b26a7e6b fix(auth): revoke unsaved test sessions at their bound backend 2026-09-27 13:56:32 +05:30
debpalash c573fd800e fix(auth): discard tested remote sessions when returning local 2026-09-27 13:51:53 +05:30
debpalash 32afec8dbe fix(auth): persist bounded remote admin sessions 2026-09-27 06:14:13 +05:30
debpalashandClaude Opus 5.5 ddf5e3386f fix(api): OpenAI SDK and Agents SDK compatibility for the /v1 speech routes (#2290)
* fix(api): make /v1 audio routes work with the openai and Agents SDKs

- Alias every OpenAI TTS model id (gpt-4o-mini-tts, dated snapshots) and
  current voice name to the active engine; real engine ids still win.
- Map OpenAI `instructions` to the engine instruct (explicit instruct wins;
  OmniVoice keeps only its voice-design tags so prose can't fail a request).
- pcm is 24 kHz int16 LE mono; mp3/opus/aac are encoded by ffmpeg with a
  matching Content-Type, or a clear 400 before any GPU work; add
  stream_format audio/sse and the {"id": ...} voice object.
- Add GET /v1/models(/{id}) and POST /v1/audio/translations.
- Transcriptions forward language/prompt/temperature to backends whose
  transcribe() declares them (Whisper family, isolated sidecar, remote
  OpenAI-compatible ASR), report the detected language, and return OpenAI
  segments plus words for timestamp_granularities[]=word.
- /v1 errors use OpenAI's {"error": {...}} shape (detail kept), 400 for
  validation failures.
- Electron: OpenAI Agents integration page shows a copyable VoicePipeline
  snippet for the live backend.
- Contract test drives every route through the real openai SDK.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs(changelog): reference #2290

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(api): honour advertised STT ids and make the Agents LLM explicit

Review follow-ups (Greptile, #2290):
- /v1/models lists only the active ASR engine for STT; a transcription or
  translation naming another VoiceStudio ASR engine id gets a 400
  model_not_active instead of being silently served by the active one.
- The OpenAI Agents snippet configures the agent's LLM explicitly from
  AGENT_LLM_BASE_URL / AGENT_LLM_MODEL (a local OpenAI-compatible server)
  and fails fast when unset, so it never falls back to a hosted model.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(api): explain best-effort temp cleanup (CodeQL empty-except)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(api): refuse translation on transcription-only Whisper checkpoints

Whisper large-v3-turbo (and Distil / .en checkpoints) ignore
task=translate and return the source language, which /v1/audio/translations
would have labelled English with a 200 (CodeRabbit, #2290). Backends now
report supports_translation() from their loaded checkpoint and the route
returns 400 unsupported_task before inference.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 03:45:21 +05:30
Matt Van Horn 999345de41 feat(dub): realtime dub preview (#1769)
Opt-in live preview for dub segments: edits debounce into a streamed /ws/tts synthesis played through the chunk player, with cancellation preserved through buffered playback. Maintainer fixes: /ws/tts added to the backend ticket allowlist (feature was dead off-loopback), handshake failures surface a toast, loopback-only plaintext refusal reverted to keep the documented remote-GPU setup working, PCM16 decode hardened. Thanks @mvanhorn!
2026-09-03 18:27:07 +05:30
Palash Debnath bfdb8dc7f5 docs: add private production API deployment (#1723)
* docs: add private production API deployment

* docs: harden private API deployment guidance

* docs: make proxy trust configuration executable

* docs: clarify private API trust boundaries

* docs: persist private service application data
2026-08-30 21:29:14 +05:30
Paolo Antinori 871d68a6ff fix(auth): offer API-key login on server-mode admin 403s (#1569)
Fix server-mode admin authentication recovery without trapping PIN-only deployments, and prevent stale 403 responses from clearing or superseding newly issued sessions. Includes backend/frontend regression coverage, docs, and changelog credit for @paoloantinori.
2026-08-20 00:03:37 +00:00
19ae20111a fix(security): replace persistent admin keys with scoped sessions (#1528)
* fix(security): replace persistent admin keys with sessions

Exchange the remote administrator key once for bounded, revocable credentials. Canonicalize backend principals, enforce cookie CSRF and exact origins, and use path-bound one-use WebSocket tickets.

Migrate the bundled UI away from durable master-key storage and credential-bearing URLs. Add unit, integration, static-hygiene, and production-browser regressions plus synchronized operator documentation.

* docs: link session hardening to PR 1528

* fix(security): key session indexes with process pepper

Use HMAC-SHA-256 instead of an unkeyed digest for in-memory session and WebSocket-ticket indexes. This preserves constant-size lookup identifiers, makes copied records unusable without the process pepper, and resolves CodeQL's weak sensitive-data hash finding.

* fix(auth): align empty bearer migration precedence

Centralize the Authorization-channel presence decision with canonical principal parsing. Bearer followed only by spaces now remains an empty channel during legacy cookie migration, while unsupported or invalid explicit credentials stay authoritative and fail closed.

* fix(security): harden admin session review boundaries

* fix(security): derive key generations with HKDF

* fix(auth): anchor the admin-session store so module reloads cannot fork it

test_master_exchange_does_not_bypass_pin_on_normal_routes failed in full-suite
runs: test_mcp_bindings' client fixture purges the services.* tree from
sys.modules and reloads main, so api.routers.auth re-imported a fresh
services.admin_sessions (new AdminSessionStore) while core.auth kept its
import-time reference to the old one — the exchange issued the cookie into
one store and the middleware resolved it against another, turning the
expected "PIN required" into "API key required".

Root cause is the class of bug, not the one test: a process-global auth
store defined as a bare module-level singleton forks under importlib.reload
or purge-and-reimport. Fix at the source: admin_session_store now resolves
through a synthetic sys.modules anchor (_omnivoice_admin_session_store_anchor)
that reloads never re-execute and package-prefix purges never match, so every
copy of the module shares the one per-process store. No consumer or behavior
changes.

Regression test reproduces both fork vectors (in-place reload and
sys.modules purge + fresh import) and asserts previously issued sessions
still resolve and the store identity is preserved; it fails before this fix
and passes after.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(auth): honor X-Forwarded-Proto for CSRF origin and Secure cookies behind TLS proxies

Behind Tailscale Serve (docs/remote-gpu.md) or any TLS-terminating proxy,
the browser talks https while the backend hop stays http, so exact-origin
CSRF compared an https Origin against an http expectation and rejected
every legitimate request, and the session cookie shipped without Secure.
uvicorn's ProxyHeadersMiddleware only rewrites the scope for loopback
peers, which misses Docker and any non-loopback proxy topology.

New core.csrf.effective_scheme derives the client-facing scheme: resolved
scope first (uvicorn's trusted-proxy rewrite wins), then an upgrade-only
read of X-Forwarded-Proto's first value — https/wss promotes http to
https, everything else is ignored, and a genuine TLS hop can never be
downgraded. Used by both the destination-origin comparison and
auth._secure_cookie so the WS-ticket/logout CSRF paths and the cookie
Secure flag agree. Spoofing gains nothing: the host:port half of the
origin tuple is untouched, browsers cannot attach the header cross-site
without a preflight this API never grants, and forging it on plain http
only adds Secure (the browser then drops the cookie — self-harm only).

Regression tests: proxied https origin accepted (origin check, Secure
flag, logout), comma-separated chains, scope-fallback path, spoofed
header still rejects cross-origin, cannot downgrade real https, junk
values ignored.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(auth): consume the stored admin key only after a successful exchange

A remote-backend user upgrading with their backend unreachable lost the
only stored copy of OMNIVOICE_API_KEY: every migration path deleted the
durable ov_api_key BEFORE the session exchange settled, stranding them
until they recovered the key from the server box. Close the whole class:

- client.ts bootstrap: read the legacy key, exchange first, and remove
  the durable copy only after the exchange succeeds; on failure the key
  stays so the next launch retries the migration (auth gate still rises).
- authSession.ts exchangeApiKey: move removeLegacyMaster from before the
  fetch to the cookie/bearer success paths — the key never coexists with
  a live session, but a rejected or hung exchange no longer consumes it.
- remoteBackendProbe.ts configuredRemoteBackend: stop wiping the key on
  every app mount.
- RemoteBackendPanel: a connection test or an aborted save no longer
  wipes the pending key; only disabling the remote backend discards it.
- prefKeys.js: ov_api_key moves from PREF_KEYS to PRESERVED_KEYS —
  factory reset preserves the pending connection credential exactly like
  ov_backend_url; the successful migration is what deletes it.

Tighten the credential-hygiene static guard to match: it accepted
sessionStorage.setItem('ov_api_key', …) — the exact class it exists to
close. The guard now flags .setItem(<master key>) on any storage
receiver, quote style, or injected-store alias, with a self-test pinning
what it catches and what stays legal.

Fail-before/pass-after regression tests: backend unreachable retains the
key and the next bootstrap retries it; a successful exchange removes it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* perf(auth): make session validation occupancy-independent

* test(auth): catch optional master-key storage calls

* feat(docs): add PR control document for bultodepapas in VoiceStudio

* docs: keep the PR tracking board in the fork; credit the changelog line

The pr-control document is excellent process discipline, but it is the
contributor's own operational board (their inventory, their update
commands) — it lives naturally in their fork, and docs/agents/ here is
context every repo agent loads. Removed with appreciation; the changelog
line gains its contributor credit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: debpalash <4178343+debpalash@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 20:46:24 +00:00
Giuseppe Rojas cd54113173 fix(security): close server-mode admin bypasses (#1525)
* fix(security): require keys for remote admin actions

* fix(frontend): guard unavailable scrollIntoView

* docs: link changelog to PR 1525

* fix(security): align PIN-only discovery policy

* fix(security): preserve strict sidecar boundary

* fix(security): normalize remote API keys

* fix(auth): normalize credential fallback order
2026-08-13 05:04:29 +00:00
debpalash aeda504a03 fix(security): authorize export filesystem sinks 2026-08-10 07:32:50 +00:00
debpalash c2b9951f28 Merge remote-tracking branch 'origin/main' into fix/ghas-path-boundary
# Conflicts:
#	CHANGELOG.md
#	backend/core/path_authorization.py
#	frontend/src-tauri/src/commands.rs
#	tests/test_network_share.py
2026-08-10 04:32:23 +00:00
Palash Debnath ae46f187d0 fix(security): move host-path authority into the desktop shell (#1448)
Close unauthenticated remote mutation paths and keep filesystem destinations behind one-shot Tauri capabilities. CodeRabbit and Greptile findings were fixed on-branch; all review threads are resolved. Full CI, Security, Rust, and cross-platform smoke checks are green.
2026-08-09 21:55:43 +00:00
debpalash 74511db595 fix(security): redact share PIN from remote discovery 2026-08-09 21:30:02 +00:00
debpalash fa3ba2f366 fix(security): authorize host paths through native IPC 2026-08-09 21:23:00 +00:00
debpalash 7abc07e7f3 fix(security): keep host paths desktop-only 2026-08-09 21:10:51 +00:00
debpalash f8eeb5a963 fix(security): require API key for remote admin writes 2026-08-09 21:01:14 +00:00
Palash Debnath 5cab8e0149 feat: rename the product to VoiceStudio (previously OmniVoice-Studio)
Renames what users see. The app, the installers, the window title, the
docs and all 21 locales now say VoiceStudio, with "(previously
OmniVoice-Studio)" noted near the title of each doc surface so people
recognise it.

Deliberately NOT renamed, because renaming any of them silently breaks
an existing install — there is no legacy-path fallback anywhere in this
codebase:

  - bundle identifier com.debpalash.omnivoice-studio (MSI UpgradeCode,
    macOS TCC grants, managed venv, WebView localStorage, the
    single-instance lock)
  - data directories OmniVoice / .omnivoice and omnivoice.db
  - the ~150 OMNIVOICE_* environment variables
  - the X-OmniVoice-* HTTP headers (a wire protocol)
  - the published Docker image paths
  - the OmniVoice ENGINE, which is a model name and not this product

tests/test_identity_paths_survive_the_rename.py pins every one of those
so a future well-meaning sweep cannot orphan a user's library.

Linux .deb users install a new package name and should apt remove
omnivoice-studio; that note is in the changelog.
2026-08-07 01:30:58 +05:30
Palash Debnath eeffe6c2d1 fix(gguf): a source-built runtime must actually run (#1348) (#1384)
A meticulous report from an LXC/CPU-only source install surfaced three real defects: the build script deleted the libggml shared libraries a dynamically-linked build needs (first spawn died with exit 127), the hardcoded 120s per-spawn kill switch reaped legitimate CPU-only renders, and OMNIVOICE_ALLOWED_ORIGINS — the only fix for cross-origin browser access — was documented nowhere.

All platform branches of scripts/build-omnivoice-tts.sh now copy the shared libs next to the binary, the CI artifact glob uploads them, and the backend puts bin/ on the loader path for every spawn of the engine binary. The timeout defaults to 600s (above the pool guard's well-diagnosed 300s deadline), is tunable via OMNIVOICE_GGUF_GENERATE_TIMEOUT_S with non-finite values rejected, and the timeout error names the knob. CORS documented in api-auth.md with a pointer from remote-gpu.md. Regression tests pin the spawn-env rule, the per-branch copy rule, the artifact glob, and the timeout behavior.
2026-08-06 04:32:40 +05:30
debpalash f3c2d745c0 Merge #1212: PIN + API-key auth guide for the local API
# Conflicts:
#	docs/api-auth.md
2026-07-20 23:04:13 +05:30
debpalash 204eff2be1 fix(security): #1213 review — the share PIN must not gate RCE-class admin
CodeRabbit: the 6-digit share PIN is brute-forceable (10^6, no lockout), so
letting it unlock admin over the network was still weak. Admin now requires the
API key (a long operator secret) or loopback; the PIN is consumption-only and
never gates /system/* or /api/settings/*. A PIN-only deployment keeps admin
loopback-only. Docs (api-auth.md, remote-gpu.md) aligned with the conditional
gate (no credential -> admin open; API key -> admin) and the PIN exclusion.
Test inverted: presenting the PIN over the network is now 403 on admin.
2026-07-20 22:57:31 +05:30
debpalashandClaude Opus 4.8 3b879f298e fix(auth): keep admin gate independent of trusted-network trust under server mode (#1213)
OMNIVOICE_SERVER_MODE=1 made require_loopback an unconditional no-op, so with
OMNIVOICE_TRUSTED_NETWORKS also set a trusted-CIDR client — a consumption-only
exemption that bypasses the PIN/API-key middleware via is_local_host — could
reach the RCE-class admin surface (/system/set-env, /api/settings/*) with no
credential. That collapsed the documented two-tier privilege model
(consumption trust != admin trust) in exactly the "lock the backend with a key,
exempt a LAN proxy for TTS" configuration.

Server mode still can't require true loopback (Docker NAT, #261), but it now
applies the credential rule to admin routes: open only when NO credential is
configured; otherwise the request must present the API key or share PIN.
Trusted-network membership alone never satisfies it. Loopback, credential
holders, and no-credential Docker deployments are unchanged; consumption
routes (require_local / middleware) keep exempting trusted networks.

Regression tests cover the server-mode x trusted-network x credential matrix
(fail-before/pass-after). Docs: new docs/api-auth.md two-tier model + quick
reference; docs/remote-gpu.md corrected (previously documented the hole as
accepted behavior).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 22:22:08 +05:30
debpalashandClaude Opus 4.8 668962133a docs(api): PIN + API-key auth guide for the local API (#1210)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 20:36:35 +05:30