Move domain config from .env to a private SQLite store
Forges (multi-host) + tokens, project directories, and git identity now live in a private SQLite config store (internal/store, modernc.org/sqlite) on a /data named volume that is not bind-mounted or exposed, so credentials aren't reachable outside the container. New Settings page (/settings) + <settings-panel> with /api/config CRUD. Scanner reads roots fresh from the store each cycle; service resolves forges per-repo from the store and reapplies per-forge git auth on change. First run seeds the store from .env. Overturns the old no-datastore/.env-config laws (AGENT.md updated). Verified live end-to-end. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -261,6 +261,38 @@ Append-only running history of all changes (AGENT.md §9.1). Newest last.
|
||||
- **Affects:** `components/toast-host` (new), `components/repo-menu`,
|
||||
`components/pr-list`, `web/templates/index.html`.
|
||||
|
||||
## 2026-09-22 — Config store: move forges/dirs/identity from .env to a private DB
|
||||
- **What:** Domain config now lives in a **private SQLite store** (`internal/store`,
|
||||
modernc.org/sqlite, pure Go) instead of `.env`: **forge hosts + tokens**
|
||||
(multi‑host), the **project directories** to scan, and the **git identity**.
|
||||
New Settings page (`/settings`) + `<settings-panel>` component + `<toast-host>`
|
||||
there; `/api/config/{forges,project-dirs,identity}` CRUD endpoints. The scanner
|
||||
now reads its roots **fresh from the store each cycle** (add/remove dirs without
|
||||
a restart); the service resolves a repo → forge by matching remotes against the
|
||||
stored forges (client cached per host) and reapplies per‑forge git auth
|
||||
(`http.<url>.extraheader`) on change; git identity comes from the store. On first
|
||||
run with an empty DB, the store is **seeded from `.env`** (`GITEA_*`,
|
||||
`GIT_REPO_ROOTS`, `GIT_USER_*`), so existing deploys keep working. The DB lives
|
||||
on a **private named Docker volume `/data`** — not bind‑mounted, no port — so
|
||||
credentials aren't reachable outside the container.
|
||||
- **Why:** Support multiple repos/forges and project directories with credentials,
|
||||
managed at runtime, without hand‑editing `.env` (user request). Overturns the
|
||||
old "no datastore" / "config via .env" laws — AGENT.md §0/§1.3/§1.5/§2/§3/§8.4
|
||||
updated.
|
||||
- **Affects:** `internal/store` (new), `internal/config`, `internal/repos`
|
||||
(scanner now dynamic), `internal/service` (store‑backed forges + config CRUD +
|
||||
`ApplyGitConfig`), `cmd/server/main.go`, `components/settings-panel` (new),
|
||||
`web/templates/{settings,index,help}.html`, `docker-compose.yml` (private
|
||||
`gmdata` volume + `GITMANAGER_DB`), `.env.example`, `go.mod`.
|
||||
- **Verified live:** seeded on first run; forges/dirs/identity served from the DB
|
||||
(tokens never returned); repos still discovered (now both GitManager and
|
||||
app-template under /repos); forge PRs work from the stored token; add/validate/
|
||||
delete of project dirs works; DB is not present in the project directory; the
|
||||
Settings UI renders and manages all three.
|
||||
- **Notes:** tokens stored plaintext relying on volume isolation (encryption‑at‑
|
||||
rest is an open item); scan tuning (interval/depth/ignore/fetch) stays in `.env`
|
||||
for now; container can only scan paths under a mounted base (mount constraint).
|
||||
|
||||
## 2026-09-20 — Slice 13: repo search + filtering
|
||||
- **What:** `<repo-list>` gained a search box (name/path, case-insensitive) and
|
||||
"Dirty" / "Ahead/behind" filter chips with a "N of M" count. Filtering is
|
||||
|
||||
Reference in New Issue
Block a user