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** 💙🔥❄️