4.1 KB70 lines
Blame
1# Grove Audit — 2026-02-22
2
3Full audit of codebase + production server. Working through items top to bottom.
4
5---
6
7## Critical Infrastructure
8
9- [x] **Disk cleanup** — Pruned 164GB Docker build cache. Server now at 16% (183GB free).
10- [x] **Backups** — Daily backup script at `/opt/grove/backup.sh`, cron at 4am UTC, 7-day retention. Covers SQLite DBs, blobstore, Mononoke config, TLS certs, compose config.
11- [x] **Firewall** — UFW enabled. SSH restricted to admin IP, HTTP/S and Mononoke ports open to all.
12
13## Code Review (Diffs)
14
15- [x] **Test the diff workflow end-to-end** — Found: no "New Diff" button in UI, API queries broken for org-owned repos.
16- [x] **Fix whatever is blocking diff creation** — Added "New Diff" button + `/diffs/new` page with branch picker. Fixed all diffs.ts queries to use `repos_with_owner` view instead of broken `JOIN users o ON r.owner_id` pattern.
17
18## Dead Code & Redundancy
19
20- [x] **Hub-api tables audit** — No dead tables. `merge_requests` was renamed to `diffs` via migration. All tables actively used.
21- [ ] **Clarify repos ownership** — hub-api has `repos` table (1 row), grove-api has `repos` table (5 rows). Which is canonical? Probably grove-api — clean up hub-api's.
22- [ ] **Consolidate API clients** — Three separate implementations: `web/lib/api.ts`, CLI's client, VS Code extension's `client.ts`. Consider a shared package.
23- [ ] **Finish Ring** — Planned feature, not dead code. Log ingestion API works, UI exists. Needs integration (Canopy → Ring logging, instance reporting).
24- [ ] **Remove or finish CLI CI stubs** — `ci runs`, `ci status`, `ci logs`, `ci trigger`, `ci cancel` are partially wired.
25- [x] **api/src/routes/auth.ts** — Does not exist. Auth handled entirely by hub-api. No vestigial code.
26- [ ] **Audit addons/ directory** — ISL, isl-server, shared, components, vscode extension. ~44k files, mostly extracted from Sapling. Decide what's actually used.
27
28## Documentation
29
30- [x] **Update GROVE.md** — Rewritten to reflect current state: WebAuthn auth, Hub API + Grove API split, Canopy CI/CD, Ring, CLI, production deployment, database schemas.
31
32## Quality & Reliability
33
34- [ ] **Add API tests** — Zero test files in api/, hub-api/, or cli/. At minimum: auth flow, repo CRUD, diff CRUD.
35- [ ] **Standardize error responses** — Inconsistent between hub-api and grove-api (mix of 401/404/500, different shapes).
36- [ ] **Type safety** — Many `any` types in route handlers. Fastify request decorators not fully typed.
37- [ ] **Database migration cleanup** — `api/src/services/database.ts` is 650 lines with complex table-rebuild migration logic and legacy table refs.
38
39## Security
40
41- [ ] **JWT in localStorage** — XSS risk. Should migrate to HttpOnly cookies.
42- [ ] **Docker socket exposure** — grove-api has `/var/run/docker.sock` mounted for Canopy CI. Known risk, needs sandboxing strategy.
43- [ ] **Rate limiting** — No rate limiting on any API endpoint.
44
45## Strategic Decisions (Deferred)
46
47- [ ] **Hub API vs Grove API merge** — With one instance running, the split adds complexity (separate DBs, JWT signing ceremony, user sync). May want to merge.
48- [ ] **ISL integration** — Embedding smartlog in web UI was planned in GROVE.md Phase 6. Addons directory is mostly ISL. Decide if still pursuing.
49- [ ] **VS Code extension** — Significant code in addons/vscode/. Decide priority.
50- [ ] **Code search** — Not started. Eventually needed for a GitHub-like experience.
51- [ ] **Monitoring** — No Prometheus, no health dashboards, no alerting.
52
53---
54
55## Production Server Reference
56
57| Property | Value |
58|----------|-------|
59| IP | 178.156.247.203 |
60| Domains | grove.host, canopy.grove.host, ring.grove.host |
61| OS | Ubuntu, Linux 6.8.0-52-generic |
62| CPU | 8-core AMD EPYC-Milan |
63| RAM | 30GB (2.1GB used) |
64| Disk | 226GB total, 34GB used (16%) after cleanup |
65| Containers | 8 (Caddy, registry, hub-api, grove-api, grove-web, mononoke-slapi, mononoke-git, grove-bridge) |
66| Data | 2 users, 3 orgs, 5 repos, 191 CI runs |
67| Compose | /opt/grove/docker-compose.yml |
68| Data dir | /data/grove/ |
69| TLS | Let's Encrypt (Caddy) + self-signed CA (Mononoke mTLS) |
70