Files
ten31-database/start9/0.4
Keysat aec2b7775b Harden privacy boundary and asset serving (v0.1.0:74)
Fixes from the 2026-06-12 full-eval (P0 + two P1s); code-only, no schema
change. Without these the "private CRM" premise was breachable on the LAN:

- P0: the /assets/ route joined the request path onto FRONTEND_DIR without
  normalizing '..' (get_path/urlparse pass it through), so an unauthenticated
  GET /assets/../../data/crm.db read any file the process could — the LP DB,
  the JWT signing secret (-> admin-token forgery), the Gmail key. Add a realpath
  containment check that 404s anything resolving outside FRONTEND_ROOT.
- P1: the LP-outreach drafter built its redaction Boundary with no ner_fn, so
  unknown people/firms in raw email bodies reached Claude in the clear. Pass the
  local-Qwen NER backstop (ner_fn=_ner_local), matching architect_grounding;
  fails closed via the existing scrub_unavailable path if the local model is down.
- P1: get-by-id handlers leaked soft-deleted records by direct ID. Add
  deleted_at IS NULL to every get-by-id path — contacts, organizations,
  opportunities, lp_profiles — and to the nested related-data sub-selects in
  the contact/opportunity detail payloads, matching the list-handler convention.

Bumps the package to v0.1.0:74 (utils.ts + versions/v0.1.0.74.ts + graph).
Full report in EVALUATION.md; remaining P2/P3 triaged in AGENTS.md Current state.
2026-06-12 18:01:48 -05:00
..

Ten31 Database — StartOS 0.4 wrapper (x86_64)

This directory is the self-contained StartOS 0.4 service package for Ten31 Database. It is the x86_64 successor to the 0.3.5 (aarch64) wrapper in ../0.3.5/. Both packages share the same package id (ten-database) and the same /data volume layout so data can be preserved across the migration.

Start here

Read DEPLOY_040.md first. It covers:

  1. How the image-seed data-preservation mechanism works.
  2. How to refresh the seed with live production data from the 0.3.5 host (via ./refresh_seed.sh or manual scp).
  3. How to install the build prerequisites (Node, Docker, start-cli).
  4. How to build the x86_64 .s9pk.
  5. How to sideload onto the StartOS 0.4 beta node.
  6. A rollback plan and a post-install verification checklist.

Quick cheat sheet

# From this directory:
./refresh_seed.sh embassy@embassy.local   # pull live prod data into seed/
make clean
make x86
make install                              # uses ~/.startos/config.yaml

Data layout (unchanged from 0.3.5)

Inside the container:

  • /data/crm.db — SQLite database
  • /data/backups/ — app-level JSON exports
  • /data/.crm-secret — JWT signing key (created on first boot if absent)

The entrypoint seeds an empty volume from the image's baked-in snapshot on first boot, and is a no-op for every later boot. Existing volumes are never overwritten.

Status

  • Source scaffold: complete and tsc --noEmit clean against @start9labs/start-sdk 0.4.0.
  • Dockerfile: self-contained under start9/0.4/ with no cross-folder references to start9/0.3.5/.
  • Seed snapshot: present at seed/data/ (repo dev DB — replace with live prod data before building).
  • Not yet built into a .s9pk here; build on a machine with Docker + start-cli per DEPLOY_040.md.