Skip to content

feat(web): add authenticated browser-hosted Tabularis UI - #676

Merged
NewtTheWolf merged 108 commits into
mainfrom
feat/web-ui
Oct 23, 2026
Merged

NewtTheWolf merged 108 commits into
mainfrom
feat/web-ui

Conversation

@debba

@debba debba commented Aug 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR introduces Tabularis Web, a browser-hosted mode that reuses the existing React UI and Rust application services while preserving the native Tauri desktop application.

Users can start a local authenticated browser session with:

tabularis web

The implementation adds a shared typed application boundary, an authenticated HTTP/WebSocket transport, browser-specific platform adapters, and broad desktop-to-browser feature parity. Running Tabularis without the web subcommand keeps the existing desktop behavior.

Why

Tabularis was previously coupled to the Tauri IPC and native-window runtime. This prevented the application from being operated through a browser, deployed as a headless service, or tested against a transport-independent application contract.

This change separates application services from transport concerns so that:

  • desktop and browser clients use the same backend services;
  • browser access does not expose Tauri internals or server filesystem paths;
  • local browser sessions remain authenticated by default;
  • remote deployments have explicit authentication and authorization boundaries;
  • frontend features can negotiate platform capabilities instead of relying on runtime assumptions.

Architecture

Shared frontend package

  • Moves the frontend into packages/web-ui as @tabularis/web-ui.
  • Keeps root-level compatibility scripts for existing development and desktop workflows.
  • Centralizes browser routes and supports direct navigation and refresh-safe SPA fallback.
  • Adds CI-enforced inventory and boundary checks for remaining Tauri imports and direct invokes.

Typed application client

  • Adds shared command, event, error, authorization, and operation contracts.
  • Introduces a root TabularisClientProvider used by application features.
  • Provides both Tauri and HTTP/WebSocket transports behind the same typed client API.
  • Includes a dual-transport contract suite to detect behavior and serialization drift.

Shared Rust application layer

  • Extracts runtime bootstrap, lifecycle, paths, secrets, state, and events from the desktop-only path.
  • Moves reusable business operations into src-tauri/src/application services.
  • Keeps Tauri commands as adapters while exposing the same services through versioned Web RPC.
  • Adds session-aware cancellation, cleanup, authorization, and operation tracking.

Web transport

  • Adds an Axum HTTP server with packaged SPA assets and graceful shutdown.
  • Exposes versioned authenticated RPC and session-scoped WebSocket events.
  • Supports replay, bounded queues, heartbeat/reconnect behavior, request IDs, deadlines, stable errors, and payload limits.
  • Adds opaque, purpose-bound, expiring upload/download tokens instead of accepting browser-provided server paths.

Feature coverage

The browser mode covers the main Tabularis workflows:

  • connection CRUD, groups, tags, drivers, icons, and active state;
  • SSH and Kubernetes profiles, tunnels, progress, and askpass flows;
  • metadata exploration, schemas, tables, views, routines, triggers, and users;
  • query execution, batches, counts, EXPLAIN, cancellation, and progress events;
  • record insert/update/delete, BLOB preview/upload/download, and data-grid workflows;
  • settings, themes, keybindings, editor preferences, and connection restore state;
  • saved queries, query history, notebooks, and secondary-window routes;
  • connection import/export, encrypted profile backups, scheduled database content backups, database dump/import, and generic exports;
  • AI generation, explanations, activity, sessions, and approval handling;
  • plugin registry/lifecycle, driver plugins, and UI extension assets;
  • logs, task manager operations, and local MCP host configuration.

Browser-only adaptations are capability-driven and provide explicit fallbacks for file dialogs, downloads, clipboard permissions, notifications, external links, secondary windows, plugin install links, and updater behavior.

Security model

Local mode

  • Binds to 127.0.0.1 by default.
  • Uses a high-entropy, single-use bootstrap token with a 60-second expiry.
  • Exchanges the bootstrap token for an opaque HttpOnly, SameSite=Strict session.
  • Validates Host, Origin, and CSRF state.
  • Redacts tokens, credentials, SQL text, request bodies, and result payloads from Web audit records.

Remote mode

Non-loopback deployment is rejected unless remote authentication is fully configured. Supported modes are:

  • password authentication through TABULARIS_WEB_PASSWORD;
  • trusted-proxy authentication through TABULARIS_WEB_PROXY_SECRET.

Remote deployments require an HTTPS public URL and explicit allowed origins. Forwarded client addresses are ignored by default; --trusted-proxy CIDR explicitly selects proxy source networks. Docker exposes this as TABULARIS_TRUSTED_PROXIES and Helm as trustedProxies. The proxy must append the real client address and the upstream listener must be firewalled. Sessions receive database-only permissions by default. Host-level operations remain denied unless the operator explicitly enables --allow-high-risk; MCP remains unavailable remotely.

Additional protections include login rate limiting, secure cookies, strict origin handling, bounded request/result sizes, session ownership checks, scoped transfer tokens, cleanup on expiry/logout/shutdown, and restricted plugin asset delivery with CSP headers.

CLI and deployment

New Web options include:

  • web (subcommand)
  • --host
  • --port
  • --no-open
  • --web-root
  • --auth
  • --public-url
  • --allowed-origin
  • --allow-high-risk

Packaged browser assets are verified for release artifacts. The operator documentation covers local use, reverse proxies, systemd, containers, credential storage, upgrades, rollback, troubleshooting, plugin trust, and browser limitations.

Testing and verification

Fresh local verification on 2026-10-22:

  • pnpm install --frozen-lockfile
  • pnpm lint (ESLint, Prettier, theme tokens), typecheck, frontend production build
  • Frontend: 7,148 tests passed in 456 files
  • @tabularis/create-plugin: 53 tests passed, build, driver smoke and theme smoke passed
  • Full cargo test completed, including library, binary, integration and documentation targets; desktop library: 2,177 passed / 13 ignored
  • Server-only Rust library: 2,123 passed / 12 ignored
  • Real-database browser matrix: 10/10 across Chromium and Firefox
  • API inventory, frontend Tauri boundaries, packaging, operator documentation, manual parity ledger, plugin API sync
  • Helm lint, deterministic rendering for default/explicit/existing/proxy secrets, missing proxy-secret rejection
  • Live HTTP: default proxy-header rejection, explicit trusted-proxy CIDRs, client lockouts, login/session/upload
  • Live scheduled-backup API: real SQLite dump restored into a clean database and row contents verified
  • Independent review: initial findings fixed, second round returned no findings

Regression tests cover session renewal across uploads/downloads/RPC, WebSocket sequence reset after a server restart, unsubscription during session refresh, explicit proxy trust, backup RPC authorization, configuration persistence, interrupted-backup cleanup, browser destination entry, and long-running backup deadlines.

The final container image is built from this branch with --no-default-features; its Docker smoke test passed 8/8, including secret-store persistence after restart. GitHub checks apply to the final pushed head; historical successful runs are not evidence for newer commits.

Follow-up security review

The carried-forward Kilo summary was checked against the current implementation. Three confirmed issues were fixed and regression-tested:

  • Generated secret keys are locked across concurrent starts and published atomically. Recovery is allowed only when the actual configured secret store is confirmed absent; missing, truncated or unreadable keys never replace a key protecting an existing store.
  • A full login-tracking table rejects untracked clients before password comparison, preserving existing lockouts without creating an overflow password oracle.
  • A full session store rejects new admission with HTTP 503 instead of evicting active clients; logout and expiry release capacity.

The other claims were rechecked independently: icon routes apply a script-free sandbox CSP; custom themes reach bounded typed legacy validation before writes; SSM testing is LocalAdmin-only; configured roots and existing ancestors are canonicalized; transfer filenames are sanitized before header creation; WebSocket expiry wraps the entire send/replay future; README links lose unsafe hrefs before DOM insertion. Database errors retain intended diagnostics, long database jobs remain concurrency-bounded, and bounded replay history remains an explicit documented limitation. No additional concrete defect was established in those claims.

The final focused review returned no actionable findings after the overflow path was corrected.

Documentation

  • web-ui-project/docs/WEB_MODE_OPERATIONS.md
  • web-ui-project/docs/WEB_REMOTE_SECURITY.md
  • web-ui-project/docs/WEB_PERFORMANCE_RESILIENCE.md
  • web-ui-project/docs/WEB_MANUAL_PARITY_AUDIT.md
  • web-ui-project/docs/WEB_MODE_UPGRADES.md
  • web-ui-project/docs/architecture/decisions/
  • web-ui-project/tasks/PROGRESS.md

Review guide

This is intentionally a large architectural change. The recommended review order is:

  1. ADRs and typed contracts.
  2. Runtime/application-service extraction.
  3. Web authentication, authorization, RPC, events, and transfer-token boundaries.
  4. Tauri and HTTP transport parity.
  5. Browser capability adapters and feature migrations.
  6. Contract, resilience, packaging, and E2E test suites.
  7. Operator/security documentation and release workflow changes.

Areas with the highest regression risk are shared runtime bootstrap, connection/query lifecycle, persistence, tunnels, plugin management, file transfers, and desktop/Web transport parity.

Compatibility and operational notes

  • Desktop remains the default process mode.
  • Existing driver plugins continue to run server-side over the existing JSON-RPC protocol.
  • Desktop and Web modes use the same runtime data and configuration locations for the process account.
  • Browser query pages and serialized responses are bounded; large datasets should use pagination or streamed export.
  • Browser assets and the server binary must come from the same revision/release.
  • UI extensions remain trusted same-page code and are not sandboxed.

Main-branch integration

The branch incorporates the formatting/import-alias migration and the newer history database filter, partial-export warnings, and scheduled content backups from main. The backup scheduler and manual operations use the shared runtime and dump pipeline in desktop and Web mode; the three backup RPCs require local-admin. Backup files are published atomically only after a successful dump.

Plugin-driver backup availability is determined by declared capabilities and SQL dialect, using the same dump pipeline as manual exports. Drivers without a SQL dialect, connectionless drivers, and folder-based drivers do not offer scheduled content backups.

Scope

This is a large architectural PR, including the frontend package move and the merged main-branch formatting changes. Reviewers should use rename-aware diffs where possible to distinguish relocated files from behavioral changes.

debba added 30 commits August 21, 2026 16:35
@NewtTheWolf
NewtTheWolf merged commit 833613d into main Oct 23, 2026
20 checks passed
@NewtTheWolf
NewtTheWolf deleted the feat/web-ui branch October 23, 2026 10:24
debba added a commit that referenced this pull request Oct 24, 2026
…scussion

The frontend moved to packages/web-ui in #676, so the discussion sync job
failed with ENOENT on src/i18n/locales.
Lym308758 added a commit to Lym308758/tabularis that referenced this pull request Oct 24, 2026
Adds "Export Selected Rows..." to the row context menu, with CSV and JSON
choices (issue TabularisDB#1154).

The exported rows are the ones the selected-row copy action acts on, read
once before the download starts: cancelling writes nothing, no query is
re-run and no further page is fetched, so only already loaded rows are
written. Formatting goes through the same helper the result export uses, so
a selected row is byte-identical to the same row exported with the whole
result (same NULL sentinel, same RFC 4180 quoting, same JSON shape).

Rebased on main after TabularisDB#1187 (NDJSON), TabularisDB#1233 (trailing newline), TabularisDB#1225
(partial-export warning) and TabularisDB#1247 (repo-wide Prettier pass):

- ResultExportFormat gains "ndjson", and the NDJSON branch now lives in
  formatRowsForExport next to JSON, with formatResultForExport left a thin
  wrapper that delegates to it.
- The JSON row object uses the shared rowToResultObject helper instead of
  duplicating its body.
- CSV records end with a newline, as TabularisDB#1233 made the loaded-rows export do
  and as the Rust streaming exporter's csv::Writer writes them.
- TabularisDB#1225's getLoadedRowsExportLimit is untouched: the selected-row export
  only ever writes rows the grid has already loaded, so it has no partial
  page to warn about.

Rebased again on main after TabularisDB#676 moved the frontend into packages/web-ui
and routed file saves through the platform layer:

- The selected-row export saves with downloadTextFile from
  @/utils/fileDownloads, the same helper Editor's loaded-rows export uses,
  instead of calling the Tauri dialog/fs plugins directly (main's eslint
  now rejects those imports outside the platform allowlist). It resolves
  false when the user cancels, so the cancel behaviour is unchanged.
- The DataGrid tests assert on the decoded contents of the
  usePlatformCapabilities downloadFile mock.

Closes TabularisDB#1154
Lym308758 added a commit to Lym308758/tabularis that referenced this pull request Oct 24, 2026
…lect

The Query History time-range select gains a "Custom range..." option, and the
From / To calendar dates only exist while it is selected. A preset therefore
never stacks on top of bounds the user can no longer see: leaving the mode
clears both dates.

Both bounds are inclusive and compared in the configured display timezone,
either side can be left open, and an inverted or unparseable range is rejected
with an explanation instead of being silently widened.

"custom" contributes no rolling window of its own - only the explicit bounds -
so it must not fall through to the 30-day window of last30Days.

Rebased on main after TabularisDB#1218 (database filter) and TabularisDB#1247 (repo-wide Prettier
pass):

- The custom range sits alongside the database filter rather than replacing
  it: isQueryHistoryFilterActive and filterQueryHistoryEntries take both, and
  the two combine with AND like every other filter.
- "Clear filters" (added here, since a custom range needs a way out) resets
  the database choice too.

Rebased again on main after TabularisDB#676 moved the frontend into packages/web-ui
(the files were only moved; git carried the changes over through rename
detection), folding in the two follow-ups from review:

- isQueryHistoryFilterActive no longer counts a bare "custom" selection as
  active: picking the mode without dates filters nothing, so the entry count
  and the "Clear filters" link stay quiet until a bound is set (rangeActive
  covers the filled-in case).
- The From / To pairs are labels wrapping their inputs, so a click on the
  text focuses the field too.

Closes TabularisDB#1149
markankamaransheogarat-sys added a commit to markankamaransheogarat-sys/tabularis that referenced this pull request Oct 24, 2026
…TabularisDB#1002)

- Rebase on upstream/main after application layer tunnel migration (TabularisDB#676)
- Wire SshForwardDestination and params_through_tunnel into application/tunnels.rs
- Add unix_socket capability to manifest.schema.json, tabularium-extensions, and PLUGIN_GUIDE.md
- Clear unix_socket_path when not in socketMode in NewConnectionModal
- Clear unix_socket_path in K8s and SSM tunnels
debba pushed a commit that referenced this pull request Oct 26, 2026
…lect (#1226)

The Query History time-range select gains a "Custom range..." option, and the
From / To calendar dates only exist while it is selected. A preset therefore
never stacks on top of bounds the user can no longer see: leaving the mode
clears both dates.

Both bounds are inclusive and compared in the configured display timezone,
either side can be left open, and an inverted or unparseable range is rejected
with an explanation instead of being silently widened.

"custom" contributes no rolling window of its own - only the explicit bounds -
so it must not fall through to the 30-day window of last30Days.

Rebased on main after #1218 (database filter) and #1247 (repo-wide Prettier
pass):

- The custom range sits alongside the database filter rather than replacing
  it: isQueryHistoryFilterActive and filterQueryHistoryEntries take both, and
  the two combine with AND like every other filter.
- "Clear filters" (added here, since a custom range needs a way out) resets
  the database choice too.

Rebased again on main after #676 moved the frontend into packages/web-ui
(the files were only moved; git carried the changes over through rename
detection), folding in the two follow-ups from review:

- isQueryHistoryFilterActive no longer counts a bare "custom" selection as
  active: picking the mode without dates filters nothing, so the entry count
  and the "Clear filters" link stay quiet until a bound is set (rangeActive
  covers the filled-in case).
- The From / To pairs are labels wrapping their inputs, so a click on the
  text focuses the field too.

Closes #1149
debba pushed a commit that referenced this pull request Oct 26, 2026
Adds "Export Selected Rows..." to the row context menu, with CSV and JSON
choices (issue #1154).

The exported rows are the ones the selected-row copy action acts on, read
once before the download starts: cancelling writes nothing, no query is
re-run and no further page is fetched, so only already loaded rows are
written. Formatting goes through the same helper the result export uses, so
a selected row is byte-identical to the same row exported with the whole
result (same NULL sentinel, same RFC 4180 quoting, same JSON shape).

Rebased on main after #1187 (NDJSON), #1233 (trailing newline), #1225
(partial-export warning) and #1247 (repo-wide Prettier pass):

- ResultExportFormat gains "ndjson", and the NDJSON branch now lives in
  formatRowsForExport next to JSON, with formatResultForExport left a thin
  wrapper that delegates to it.
- The JSON row object uses the shared rowToResultObject helper instead of
  duplicating its body.
- CSV records end with a newline, as #1233 made the loaded-rows export do
  and as the Rust streaming exporter's csv::Writer writes them.
- #1225's getLoadedRowsExportLimit is untouched: the selected-row export
  only ever writes rows the grid has already loaded, so it has no partial
  page to warn about.

Rebased again on main after #676 moved the frontend into packages/web-ui
and routed file saves through the platform layer:

- The selected-row export saves with downloadTextFile from
  @/utils/fileDownloads, the same helper Editor's loaded-rows export uses,
  instead of calling the Tauri dialog/fs plugins directly (main's eslint
  now rejects those imports outside the platform allowlist). It resolves
  false when the user cancels, so the cancel behaviour is unchanged.
- The DataGrid tests assert on the decoded contents of the
  usePlatformCapabilities downloadFile mock.

Closes #1154
markankamaransheogarat-sys added a commit to markankamaransheogarat-sys/tabularis that referenced this pull request Oct 29, 2026
…TabularisDB#1002)

- Rebase on upstream/main after application layer tunnel migration (TabularisDB#676)
- Wire SshForwardDestination and params_through_tunnel into application/tunnels.rs
- Add unix_socket capability to manifest.schema.json, tabularium-extensions, and PLUGIN_GUIDE.md
- Clear unix_socket_path when not in socketMode in NewConnectionModal
- Clear unix_socket_path in K8s and SSM tunnels
markankamaransheogarat-sys added a commit to markankamaransheogarat-sys/tabularis that referenced this pull request Nov 10, 2026
…TabularisDB#1002)

- Rebase on upstream/main after application layer tunnel migration (TabularisDB#676)
- Wire SshForwardDestination and params_through_tunnel into application/tunnels.rs
- Add unix_socket capability to manifest.schema.json, tabularium-extensions, and PLUGIN_GUIDE.md
- Clear unix_socket_path when not in socketMode in NewConnectionModal
- Clear unix_socket_path in K8s and SSM tunnels
markankamaransheogarat-sys added a commit to markankamaransheogarat-sys/tabularis that referenced this pull request Nov 14, 2026
…TabularisDB#1002)

- Rebase on upstream/main after application layer tunnel migration (TabularisDB#676)
- Wire SshForwardDestination and params_through_tunnel into application/tunnels.rs
- Add unix_socket capability to manifest.schema.json, tabularium-extensions, and PLUGIN_GUIDE.md
- Clear unix_socket_path when not in socketMode in NewConnectionModal
- Clear unix_socket_path in K8s and SSM tunnels
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.

3 participants