feat: JSONC config + secrets.json split (Phase A) #4

Merged
kairee merged 1 commits from auto/config-jsonc-06aa into main 2026-11-02 13:21:08 +08:00

Summary

  • Business config switches to JSONC (// / /* */ comments + trailing commas). Loader: in-repo strip then stdlib json.loads (no new deps).
  • Default path prefers config.jsonc, falls back to legacy config.json. Explicit --config unchanged.
  • Credentials move to sibling secrets.json (pure JSON). auth only atomically writes secrets (+ .bak); JSONC comments are never wiped.
  • Examples renamed to .jsonc with real comments; secrets.example.json added; compose/Docker/docs/favsort/tools share the same loader. Dual-read for migration (monolithic config.json still loads; secrets overlay wins when present).

Out of scope (Phase A)

No DB migration for hot-read tunables. Future work can move analytics/discover/notify-style settings into DB for in-memory refresh without restart; schedule times / secrets / storage paths stay in files.

Test plan

  • tests/test_jsonc.py + test_config.py + test_auth.py + full offline suite (35 files) green
  • Deploy: copy config.example.jsonc → config.jsonc, secrets.example.json → secrets.json; migrate cookies out of old config.json if needed
  • python app.py auth --account read updates only secrets.json, leaves JSONC comments intact
## Summary - Business config switches to **JSONC** (`//` / `/* */` comments + trailing commas). Loader: in-repo strip then stdlib `json.loads` (no new deps). - Default path prefers `config.jsonc`, falls back to legacy `config.json`. Explicit `--config` unchanged. - Credentials move to sibling **`secrets.json`** (pure JSON). `auth` only atomically writes secrets (+ `.bak`); JSONC comments are never wiped. - Examples renamed to `.jsonc` with real comments; `secrets.example.json` added; compose/Docker/docs/favsort/tools share the same loader. Dual-read for migration (monolithic `config.json` still loads; secrets overlay wins when present). ## Out of scope (Phase A) No DB migration for hot-read tunables. Future work can move analytics/discover/notify-style settings into DB for in-memory refresh without restart; schedule times / secrets / storage paths stay in files. ## Test plan - [x] `tests/test_jsonc.py` + `test_config.py` + `test_auth.py` + full offline suite (35 files) green - [ ] Deploy: copy `config.example.jsonc` → `config.jsonc`, `secrets.example.json` → `secrets.json`; migrate cookies out of old `config.json` if needed - [ ] `python app.py auth --account read` updates only `secrets.json`, leaves JSONC comments intact
bot-ci Bot added 1 commit 2026-11-02 12:59:10 +08:00
Load business config as JSONC (comments + trailing commas) via an
in-repo stripper then stdlib json — no new deps. Default path prefers
config.jsonc, falls back to legacy config.json. Auth write-back targets
only sibling secrets.json so JSONC comments are never wiped; secrets
overlay merges on load. Examples, compose, Docker, docs, favsort and
tools all share the same loader. Phase A only — no DB settings migration.
kairee merged commit 8e7ead1669 into main 2026-11-02 13:21:08 +08:00
kairee deleted branch auto/config-jsonc-06aa 2026-11-02 13:21:10 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kcloud/re-xxm#4