Skip to content

fix(server): open the viewer store read-only and authenticate a non-loopback bind - #1676

Merged
ajianaz merged 1 commit into
developfrom
fix/viewer-read-only-bind-auth-1667
Nov 4, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/viewer-read-only-bind-auth-1667

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

What

  • New Uteke::open_read_only / Store::open_read_only in core: SQLITE_OPEN_READ_ONLY, query_only, no WAL pragma, no init_schema, no vector-index file, no embedding cache. A missing store or a schema other than the current one is refused; an older one with a message to run any normal uteke command once.
  • uteke view (uteke-serve --viewer) uses it instead of open_with_backend.
  • Non-loopback bind: still needs the server auth token, which is now also required on every request as Authorization: Bearer on top of the launch token (the bearer slot stops being a launch-token source on that bind). One-line warning that the viewer is plain HTTP and TLS must be terminated in front. The printed launch URL uses 127.0.0.1 / [::1] for a wildcard bind and brackets IPv6.
  • docs/viewer.md and CHANGELOG updated. The viewer is unreleased, so no compatibility shim.

Why

"Read-only by construction" should hold below the router too: the old open set WAL and migrated an older store from the viewer, contending with the API server. And the bind guard read like authentication but did not authenticate.

Closes #1667

Testing

  • core: open_read_only leaves an older-schema file byte-identical and creates no files, refuses a missing store without creating it, and its handle rejects writes; Uteke::open_read_only creates no index/cache file.
  • server: a non-loopback bind without the token is refused (run returns 1); with it, a request lacking the bearer, or with a wrong one, gets 401; the launch token alone, or the auth token alone, is not enough; launch URL host cases; the read routes still answer on a read-only handle.
  • cargo fmt --check, cargo clippy -D warnings, cargo test -p uteke-server viewer.

…oopback bind (#1667)

Uteke::open_read_only opens SQLITE_OPEN_READ_ONLY with no WAL pragma, no
migration and no index or cache file. A non-loopback bind requires the server
auth token as a bearer on every request on top of the launch token, warns
that the viewer is plain HTTP, and prints a usable launch URL host.
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 5bfe78a into develop Nov 4, 2026
15 checks passed
@ajianaz
ajianaz deleted the fix/viewer-read-only-bind-auth-1667 branch November 4, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(server): uteke view opens the store read-write, and its bind guard does not check the auth token

1 participant