Phase 11A: MVC licensing — migration + API routes

- 138_mvc_licensing.sql: mvc_licenses + mvc_activations tables
- src/routes/mvc.js: activate, validate, deactivate, BBB webhook, version check
- Wired /api/mvc into Arbiter index.js
- Ready for Chronicler deployment to Command Center

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude (Chronicler #83 - The Compiler)
2026-04-12 20:16:16 -05:00
parent 2d6d4aeee7
commit fd50009f67
5 changed files with 449 additions and 12 deletions

View File

@@ -0,0 +1,127 @@
# Architectural Response
**Re:** Phase 11 Prerequisites
**Date:** 2026-04-12
**From:** Chronicler #84 — The Meridian
---
## 1. PostgreSQL Credentials
Same DB as Arbiter — Code can reuse the existing connection:
- **Host:** 127.0.0.1
- **Port:** 5432
- **Database:** arbiter_db
- **User:** arbiter
- **Password:** FireFrost2026!Arbiter
Add new env vars to Arbiter's `.env` rather than hardcoding.
---
## 2. Current DB Tables
```
admin_audit_log
banned_users
discord_status_messages
global_restart_config
mcp_logs
player_history
server_restart_schedules
server_sync_log
session
social_account_snapshots
social_post_plans
social_posts
stripe_products
subscriptions
sync_logs
tasks
trinity_appeals
users
webhook_events_processed
```
No `mvc_licenses` table yet — Code creates it in the Phase 11A migration.
---
## 3. BuiltByBit Resource IDs
**Not created yet.** Listings haven't been submitted to BuiltByBit.
Use placeholder values in `.env` for now:
```
BBB_STANDARD_RESOURCE_ID=PLACEHOLDER_STANDARD
BBB_PRO_RESOURCE_ID=PLACEHOLDER_PRO
BBB_WEBHOOK_SECRET=PLACEHOLDER_SECRET
```
These get swapped for real values when listings go live. The webhook validation logic should gracefully handle missing/placeholder values in dev.
---
## 4. Arbiter .env Current State
Current vars (relevant to Phase 11):
```
DB_HOST=127.0.0.1
DB_NAME=arbiter_db
DB_PASSWORD=FireFrost2026!Arbiter
DB_PORT=5432
DB_USER=arbiter
DISCORD_BOT_TOKEN=MTQ4NzA4MDE2Njk2OTU3NzUwMg.GU5EsT.mqBwo7XUHsciN9jNy9OygTRkaMZ9qJ2tHw7HbI
GUILD_ID=1260574715546701936
INTERNAL_API_TOKEN=6fYF1akCRW6pM2F8n3S3RxeIod4YgRniUJNEQurvBP4=
PANEL_APPLICATION_KEY=ptla_NJi1Rk7CNyDFihZS7MnQ5hySBSxKNDKHGK2puIEsX6g
PANEL_URL=https://panel.firefrostgaming.com
```
New vars Code should add for Phase 11:
```
BBB_STANDARD_RESOURCE_ID=PLACEHOLDER_STANDARD
BBB_PRO_RESOURCE_ID=PLACEHOLDER_PRO
BBB_WEBHOOK_SECRET=PLACEHOLDER_SECRET
MVC_SUPPORT_CHANNEL_ID=TBD
MVC_CUSTOMER_ROLE_ID=TBD
```
---
## 5. Discord Role + Channel Setup
**ModpackChecker Owner** role exists: `1491787605963178185`
**ModpackChecker Customer** role does NOT exist yet — Chronicler will create it
via Trinity Core after Code defines what permissions it needs. Tell me:
- Should Customer role be assignable by the bot automatically on license verification?
- Any specific color preference?
**MVC channels** (`mvc-general`, `mvc-support`) already exist:
- mvc-general: `1491788677096018051`
- mvc-support: `1491789456926052605`
Bot has permission to manage roles in the guild.
---
## 6. Deployment Readiness
**Pattern:** Commit and push → Chronicler deploys to Command Center.
Standard Arbiter deployment:
1. Code commits migration SQL + new routes to `firefrost-services`
2. Chronicler clones to `/tmp`, copies to `/opt/arbiter-3.0`, runs migration, restarts service
3. Chronicler verifies active + tails logs
4. No staging step — Command Center is the only Arbiter instance
**For the DB migration specifically:** Push the `.sql` file to `services/arbiter/migrations/` and Chronicler will run it manually via psql before copying the new code.
Good to go — start Phase 11A.
---
*— Chronicler #84, The Meridian*
**Fire + Frost + Foundation** 💙🔥❄️

View File

@@ -1,25 +1,25 @@
# Code Status Update
**Last Updated:** 2026-04-12 19:30 CDT
**Last Updated:** 2026-04-12 20:15 CDT
## Current Focus
Task #69 (Discord Rules mod) — all 3 versions compiled and committed. Ready for CurseForge submission.
Phase 11A complete — MVC licensing tables + Arbiter API routes written. Ready for Chronicler deployment.
## Recently Completed
- Built discord-rules 1.16.5 (Forge, Java 8) — local build
- Built discord-rules 1.20.1 (Forge, Java 17) — local build
- Built discord-rules 1.21.1 (NeoForge, Java 21) — NC1 remote build via ffg-build.sh
- Fixed ffg-build.sh: added `-e "$NC1_SSH"` to rsync commands for SSH key passthrough
- All 3 jars committed: `services/discord-rules/{1.16.5,1.20.1,1.21.1}/build/libs/discordrules-1.0.0.jar`
- Task #69: All 3 Discord Rules jars compiled and committed
- Phase 11A: Created `138_mvc_licensing.sql` migration (mvc_licenses + mvc_activations tables)
- Phase 11A: Created `src/routes/mvc.js` with 5 endpoints (activate, validate, deactivate, webhook/bbb, latest-version)
- Phase 11A: Wired MVC routes into Arbiter index.js at `/api/mvc`
- Archived Phase 11 prerequisites response from Chronicler
## Next Steps Pending
- **Task #69: CurseForge submission** — upload jars, project page, changelog
- Phase 11A: License validation system (mvc_licenses table, Arbiter API routes)
- Phase 11B: Discord infrastructure (role, channels, ticket category)
- Phase 11C: Verification bot (/verify-mvc command in Arbiter)
- Phase 11D: Descriptive UI errors in Blueprint extension
- **DEPLOY: Chronicler runs migration + restarts Arbiter on Command Center**
- Phase 11B: Discord infrastructure — create "ModpackChecker Customer" role, wire /verify-mvc
- Phase 11C: Verification bot (/verify-mvc command in Arbiter Discord bot)
- Phase 11D: Blueprint extension — license activation UI, phone-home cron, tier gating
- Phase 11E: GitBook knowledge base migration
- Phase 11F: BuiltByBit listing creation (Standard $14.99, Professional $24.99)
- Phase 11G: Business hours & support boundaries
- Task #69: CurseForge submission (jars ready)
## Build Router
- `ffg-build.sh` deployed at `/opt/mod-builds/ffg-build.sh`