Deployment Infrastructure
Summary
ToneForge runs on Advin VPS (208.84.101.84) as a Docker service named toneforge-server, co-located with GoLiveBro on the same host. The runtime is Python 3.12 slim with spaCy and the en_core_web_sm model (~50MB) served by gunicorn at 2 sync workers. Port 8378 is internal-only; Cloudflare proxies all public traffic to api.toneforge.io via an origin rule that rewrites to 8378. UFW restricts direct TCP 8378 access to Cloudflare IP ranges only.
The database is PostgreSQL in the shared glb-postgres container, with a separate toneforge database and credentials stored at /opt/toneforge/secrets/. The schema covers the full monetization stack: tiers (free 5/mo, pro 1000/mo, enterprise), hashed/prefixed API keys with soft delete, per-key usage logging, and two v2 tables (writing_evidence, voice_substrate) that are currently empty. The toneforge-admin CLI handles key lifecycle without direct DB access.
The implementation plan (2026-04-11-monetization-implementation.md) breaks work into 6 phases totaling ~40 hours: audit remediation (~2hr), package split (~6hr), API hardening (~8hr), deployment (~4hr), monetization infra (~12hr), and launch prep (~8hr). Tier structure may change if the v2 research plan shifts the model from paid API to sponsorship.
Timeline
- 2026-04-11: Monetization design finalized. Tier structure (free/pro/enterprise), schema, and 6-phase implementation plan documented.
- 2026-04-11: Implementation plan written with phase-level hour estimates and deployment architecture locked.
Current State
The deployment architecture is designed but not confirmed as fully deployed. The 6-phase implementation plan is the active execution guide. Phase 4 (deployment, ~4hr) covers the actual server standup. Check deploy/ for current Docker and compose configs. The v2 writing_evidence and voice_substrate tables exist in schema but hold no data — they activate in a future substrate compiler milestone.
Key Decisions
- 2026-04-11: Shared Advin VPS with GoLiveBro — cost efficiency. Requires 512MB+ free RAM after GoLiveBro; fallback to 1 gunicorn worker if RAM is tight.
- 2026-04-11: Cloudflare orange-cloud proxy with UFW Cloudflare-only restriction — hides origin IP, TLS termination handled by Cloudflare, no direct exposure of 8378.
- 2026-04-11: Shared
glb-postgrescontainer with separate DB and credentials — avoids a second Postgres instance, maintains isolation via credentials and DB-level separation. - 2026-04-11:
toneforge-adminCLI for key management — keeps admin operations out of the API surface and requires server-local execution.
Gotchas & Known Issues
- Resource contention: GoLiveBro and ToneForge share the same VPS. No hard limits set yet; need Docker resource constraints to prevent mutual starvation under load.
- Tier structure in schema (free/pro/enterprise) may not match final monetization model if v2 research plan switches to sponsorship. Schema migration would be required.
en_core_web_smdownload (~50MB) happens at Docker build time. Build will fail without network access at image build.
Open Questions
- Has Phase 4 (deployment) been executed? Confirm
toneforge-serveris live on Advin VPS. - Will the v2 research plan change tiers from free/pro/enterprise to a sponsorship model? If so, schema migration scope needs scoping.
- Are Docker resource limits configured for
toneforge-serverto prevent GoLiveBro starvation?