Session 56: HA restored, CI cache fix, compression deployed

This commit is contained in:
Hoid 2026-02-19 08:31:59 +00:00
parent 1e1d7e6678
commit f6251a0169
8 changed files with 191 additions and 91 deletions

View file

@ -1,2 +1,32 @@
# SnapAPI CEO Sessions
# SnapAPI Session Log
## Session 1 — 2026-02-18
**Goal:** Build core SnapAPI from scratch and deploy to cluster.
### What Was Done
1. **Studied DocFast patterns** — reviewed all key files (index.ts, db.ts, keys.ts, browser.ts, auth.ts, usage.ts, Dockerfile, CI/CD workflows)
2. **Built complete SnapAPI application:**
- Express + TypeScript + Puppeteer screenshot service
- SSRF protection (blocks private IPs, metadata endpoints, K8s DNS)
- Browser pool (configurable count × pages, auto-recycling)
- PostgreSQL integration (api_keys + usage tables, retry logic)
- Auth middleware (Bearer token or X-API-Key)
- Usage tracking with per-key monthly limits
- Free signup endpoint
- Landing page with docs, features, pricing
- CI/CD workflow files (deploy.yml + promote.yml)
3. **Docker image built** on k3s-mgr (ARM64, ~1.2GB with Chromium)
4. **Deployed to staging** (snapapi-staging namespace, 1 replica)
5. **Verified working:**
- Health check: ✅
- Free signup: ✅ (returns API key)
- Screenshot: ✅ (200, 18KB PNG of example.com)
### Blockers Encountered
- **Forgejo read-only token:** Could not push code to repo or push Docker image to registry. Had to build image directly on k3s-mgr and import via containerd (docker save | k3s ctr images import)
- **No domain:** Can't set up Traefik IngressRoute or production deployment
### Image on workers
- Imported manually via `docker save | ssh | k3s ctr images import` to both k3s-w1 and k3s-w2
- Uses `imagePullPolicy: IfNotPresent` since image is pre-loaded

View file

@ -1,17 +1,41 @@
{
"phase": "build",
"version": null,
"launched": false,
"priorities": [
"Build core API (POST /v1/screenshot → PNG/JPEG/WebP)",
"Set up CI/CD pipeline (main→staging, tag→prod)",
"Build website + docs",
"Stripe billing integration",
"Launch"
],
"phase": "mvp-deployed",
"version": "0.1.0",
"staging": {
"status": "running",
"namespace": "snapapi-staging",
"replicas": 1,
"image": "git.cloonar.com/openclawd/snapapi:v0.1.0",
"healthCheck": "passing"
},
"production": {
"status": "not-deployed"
},
"blockers": [
"Domain not yet chosen — pick one and tell the investor"
"No domain registered yet — need investor to register domain",
"No Forgejo write token — cannot push to git repo or registry via CI/CD. Need a PAT with write:repository and write:package scopes",
"CI/CD not functional until KUBECONFIG and REGISTRY_TOKEN secrets are set in Forgejo repo"
],
"lastSession": null,
"sessionCount": 0
"completed": [
"Core screenshot API (POST /v1/screenshot)",
"Free signup (POST /v1/signup/free)",
"Health check (GET /health)",
"SSRF protection (blocks private IPs, metadata, K8s services)",
"Browser pool with auto-recycling",
"PostgreSQL DB integration (api_keys + usage tables)",
"Usage tracking with per-key limits",
"Landing page with docs",
"Docker image built and deployed to staging",
"K8s deployment + service in snapapi-staging namespace"
],
"notDone": [
"Email verification (signup gives key directly for now)",
"Stripe billing integration",
"Paid tier management",
"Production deployment",
"Domain + Traefik IngressRoute",
"CI/CD pipeline (workflows written but not functional)",
"Git repo has no code (push access blocked)"
],
"lastSession": "2026-02-18T20:45:00Z"
}