Deleting a sync account now moves every row it owns, found through the schema's ON DELETE CASCADE keys, into <db>.held/<account>.db and its blob files beside it. The live tables keep nothing, so it stops syncing, counting toward storage and appearing to others at once. A login with "restore": true brings it back during the hold; a plain login starts an empty account and reports held_until. The retention job deletes holds after 30 days. Deleted records drop their content as the deletion arrives and cost nothing, and a deletion wins an equal-time mesh tie. Blobs can be moved to and from the trash with POST .../trash and .../restore: trashed blobs stay readable, cost nothing and are deleted after 30 days. Deploy backups are pruned at 28 days so no copy outlives the 30-day window.
2.4 KiB
2.4 KiB
Daochi Small Node Operations
Daochi should remain practical on modest machines and home nodes. These targets turn that value into an operational checklist.
Small Node Target
A small node is expected to run with:
- one Go server process;
- SQLite storage on local disk;
- a reverse proxy terminating TLS;
- no background job queue beyond Daochi's own sync workers;
- enough memory to run comfortably on a 1 GB VM or small home server.
Default Posture
- Keep
DAOCHI_ADDRbound to loopback behind a reverse proxy. - Set a stable
DAOCHI_TOKEN_SECRET_HEXbefore production use. - Set
DAOCHI_NODE_IDENTITY_KEY_FILEexplicitly so node identity survives process restarts and deploys. - Leave direct purchases, LAN discovery, and node sync disabled until the node operator intentionally enables them.
Resource Targets
- Idle CPU should be near zero when there are no active syncs, WebSockets, or background reconciliation tasks.
- SQLite is the primary state store; avoid adding external services for core sync paths.
- Batch limits should favor bounded memory over maximum throughput.
- Old protocol clients should remain compatible through the published window instead of forcing immediate upgrades.
Inspectability Checklist
Operators should be able to answer:
- Which node identity key is this process using?
- Which protocol versions are accepted?
- Which app registry authority is trusted?
- Which apps and collection prefixes are active?
- Which peers are paired or configured?
- Which data surfaces are server-readable by design?
Current endpoints that help answer those questions:
GET /api/v1/nodeGET /api/v1/node/peersGET /api/v1/appsGET /api/v1/apps/{app_id}GET /api/v1/sync/diagnosticsGET /metrics
Rollout Checks
Before exposing a node publicly:
GET /healthzreturns 200;GET /readyzreturns 200;GET /api/v1/nodeshows the expected node name and protocol bounds;/metricsis protected byX-Daochi-Adminwhen an admin token is set;- backups include the SQLite database and node identity key;
- the
<database>.blobsand<database>.heldfolders sit beside the database on the same filesystem: a deleted account is moved to.heldfor 30 days, and backups of deleted data must not outlive that. To delete a held account at once, set itspurge_afterinserver_account_holdsto 0; the hourly retention job removes it; - restore has been tested on a separate machine or directory.