feat: Simplified Install for DBLab 4.2 (Simple/Expert modes + autodetection)

Closes #713 (closed)

What this changes for the user

New install flow. Configuration tab opens on a Simple tab: paste source URL + password, click Detect, review proposed config, click Apply. Engine handles provider detection (RDS / Aurora / Heroku / Supabase / etc.), Postgres image+tag, query-tuning whitelist, shared_buffers from host memory, shared_preload_libraries from source.

Expert tab for already-configured instances. Same fields as before but with the four source-connection fields collapsed into one URL field (parsed on save, reconstructed on load). Adds physical-mode UI for WAL-G and pgBackRest (the two tool: values the engine supports outside customTool): structured fields (backupName, stanza, delta) + a key/value editor for the envs map where storage backend, bucket, prefix, credentials live.

What this changes for the engine

  • POST /admin/probe-source returns a ProposedConfig: provider, image, tag, pg major, databases, shared_buffers, shared_preload_libraries, query-tuning params. Pure detection logic lives in engine/internal/retrieval/probe/; the existing tools/db.CheckSource is reused, not duplicated.
  • Projection writes (/admin/config) no longer reject physical-mode payloads. Replaced the blanket logical-only gate with guardModeFields, which only rejects cross-mode fields (logical-mode payload setting physicalTool etc., or physical-mode payload setting host / password). This protects hand-edited configs from being wiped by stale UI state in either direction.
  • testDBSource stays logical-only. Physical-mode test-connection is out of scope: no source password to send, storage credentials live in envs at restore time only.

Backwards compatibility

server.yml schema unchanged. URL is a UI affordance only. Hand-edited configs keep their separate host / port / username / dbname keys. Empty port is preserved across load -> URL -> save (omitPortOnSubmit), so configs that originally omitted port: stay that way.

Notable design choices

  • No new Go deps. URL parsing wraps pgconn.ParseConfig (transitive via pgx). Rejects URLs with embedded password to keep secrets out of logs and out of "edit before applying" flows.
  • Engine-side image resolution (pulled forward from 4.3). The UI catalog (configOptions.ts) still drives the Simple-mode preview; the engine now also resolves a glibc-aware image from the live registries (with offline fallback) for the dblab local-install CLI (probe/registry.go, probe/imageselect.go, images_fallback.json).
  • Mode default seeded lazily. Configuration tab default (Simple vs. Expert) is picked once when configData first loads, not recomputed on every render. Otherwise an Apply-triggered refetch would flip the tab mid-session.
  • Physical envs uniqueness in Yup, not parallel state. Two rows with the same key surface an inline error on both rows; formik.isValid gates submission. Whitespace-only keys are not duplicates. Yup .test() emits one ValidationError per duplicate row.
  • tuningParams sent as object, not string. updateConfig.ts spreads req.tuningParams into databaseConfigs.configs; sending it as a string spreads characters and writes {"0":"w", "1":"o", ...} instead. Both Simple and Expert flows now produce object-shaped tuningParams.

Out of scope (4.2)

Update: the dblab local-install CLI and engine-side image resolution were pulled forward from 4.3 and ship in this MR (engine/cmd/cli/commands/localinstall/, probe/registry.go). See docs/plans/completed/20260619-cli-connstrings-glibc.md.

  • RDS-refresh-tool detection.
  • Cloud one-click integrations (Supabase, etc).
  • customTool / pg_basebackup UI - stays YAML-only.
  • RDS IAM source UI - Simple mode is password-based, IAM sources stay Expert + YAML.

Tests

  • engine: make test + make test-ci-integration green. New probe-package tests (provider detection, tuning whitelist, memory probing), guardModeFields table-driven, requestedRetrievalMode table-driven, physical projection round-trip and PhysicalEnvs createKey table-driven.
  • ui: new coverage for SimpleMode probe+preview+Apply, PhysicalMode WAL-G/pgBackRest sub-forms, EnvsEditor including duplicate-key error, URL <-> fields parsing (including the empty-port omission rule), Configuration page gating + lazy mode-default + Header label.
  • no Playwright/Cypress yet. Manual UI verification still TODO (this is why the MR is Draft): physical-mode editability + Header label, SimpleMode Apply against a real source, envs-editor duplicate inline error.

Example

Fill the form

2026-05-26_16-01

Detection results

2026-05-26_17-04

Auto-refresh is completed

2026-05-27_17-41

Clone

2026-06-02_18-31

Edited by Maya P

Merge request reports

Loading
Loading