Skip to content

Task 004: Remove db-config.json ceremony - #9

Merged
Igloczek merged 1 commit into
masterfrom
task/004-simplify-db-config
Jun 30, 2026
Merged

Igloczek merged 1 commit into
masterfrom
task/004-simplify-db-config

Conversation

@Igloczek

@Igloczek Igloczek commented Jun 30, 2026 •

Copy link
Copy Markdown
Collaborator

Implements tasks/004-simplify-db-config.md from the ponytail audit backlog.

Goal

Stop persisting a JSON file that always contains { "type": "sqlite" } and branch on a field that never varies.

Scope

  • Use a fixed SQLite path: path.join(dataDir, "kuma.db") (or existing Database.sqlitePath).
  • Remove readDBConfig, writeDBConfig, and Database.dbConfig.type branching in src/server/database.ts.
  • Migrate existing installs: if db-config.json exists, ignore or delete it on startup (document behavior in code comment only).
  • Update any scripts/tests that write or read db-config.json.

Acceptance criteria

  • No runtime code reads or writes db-config.json.
  • Fresh install connects to SQLite without creating db-config.json.
  • Existing data dirs with kuma.db still open correctly.
  • bun run test:backend passes (including schema.test.ts, upgrade.test.ts).
  • bun run build succeeds.

Depends on

Nothing (do before Task 005).

Verification

bun run test:backend
bun run build
rg "db-config\\.json" src scripts test

Audit reference

Finding #12 — db-config.json multi-backend config.

@Igloczek

Copy link
Copy Markdown
Collaborator Author

/ponytail-review

Removed db-config.json ceremony for SQLite-only runtime. No replacement config layer added.

Lean already. Ship.

6 files changed, 19 insertions(+), 99 deletions(-)

SQLite is the only supported backend; stop reading/writing db-config.json
and branch on a type field that never varies.

- Connect directly via Database.sqlitePath
- Delete legacy db-config.json on startup
- Simplify setup-database flow and test helpers
- Remove dbConfig.type branching in jobs and client info
@Igloczek
Igloczek force-pushed the task/004-simplify-db-config branch from 70ce852 to eb7a4d1 Compare June 30, 2026 11:44
@Igloczek
Igloczek merged commit 6ed0ff9 into master Jun 30, 2026
1 check passed
@Igloczek
Igloczek deleted the task/004-simplify-db-config branch June 30, 2026 12:58
Igloczek added a commit that referenced this pull request Aug 8, 2026
Task 004: Remove db-config.json ceremony
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.

1 participant