Files
firefrost-services/services/arbiter-3.0/.env.example
Claude Code bca31bf677 Task #101: AI-Powered Modpack Server Installer (REQ-2026-04-16-modpack-installer)
Full modpack installer integrated into Trinity Console. Architecture locked
via 4-round Gemini consultation.

Migrations:
- 143: server_config modpack columns (provider, version tracking, RAM, hibernation, spawn_verified)
- 144: install_history table (UUID PK, JSONB log_output, FK to server_config)

Provider API clients (src/services/providerApi/):
- curseforge.js: search, pack details, version list, download URL resolution
- modrinth.js: search, pack details, version list, download URL
- ftb.js: stub (+ ATLauncher, Technic, VoidsWrath aliases)
- index.js: provider registry with getProvider() + listProviders()

Job queue:
- pg-boss ^10.1.5 added to package.json
- index.js: initializes pg-boss, registers modpack-installs worker (concurrency 2)
- modpackInstaller.js: 11-step install pipeline (preflight → Pterodactyl create →
  download → DNS → Discord → server_config seed → power on). Each step logged to
  install_history.log_output JSONB for live status streaming.

Admin routes (src/routes/admin/modpack-installer.js):
- GET /admin/modpack-installer — main page (provider select → search → configure → install)
- GET /search — HTMX pack search partial
- GET /pack/:provider/:id — HTMX pack details + install form
- POST /install — enqueue pg-boss job, redirect to status
- GET /status/:id — live status page (polls /status/:id/json every 3s)
- GET /history — install history table
- GET /pending-spawns — Holly's spawn verification queue
- POST /verify-spawn/:id — mark spawn verified

Views (6 EJS files):
- index.ejs: 3-step flow (provider cards → search with MC version filter → pack details + form)
- _pack_list.ejs: search results grid partial
- _pack_details.ejs: pack info + install config form (version, name, short_name, node, RAM, spawn type)
- status.ejs: live log viewer with 3s polling, color-coded steps
- history.ejs: filterable job history table
- pending-spawns.ejs: Holly's queue with Mark Verified buttons

Also: sidebar nav link, .env.example (CURSEFORGE_API_KEY, BITCH_BOT_SCHEMATIC_*, CLOUDFLARE_ZONE_ID)

All 8 JS files pass node --check. All 7 EJS files pass ejs.compile().
2026-04-16 00:24:48 -05:00

46 lines
1.5 KiB
Plaintext

# Discord Core
DISCORD_BOT_TOKEN=your_bot_token
GUILD_ID=your_guild_id
DISCORD_CLIENT_ID=your_client_id
DISCORD_CLIENT_SECRET=your_client_secret
# OAuth & Admin
REDIRECT_URI=https://discord-bot.firefrostgaming.com/auth/discord/callback
ADMIN_USERS=discord_id_1,discord_id_2
SESSION_SECRET=your_secure_session_secret
PORT=3500
NODE_ENV=production
# PostgreSQL Database
DB_USER=arbiter
DB_HOST=127.0.0.1
DB_NAME=arbiter_db
DB_PASSWORD=your_secure_password
DB_PORT=5432
# Pterodactyl Integration
PANEL_URL=https://panel.firefrostgaming.com
PANEL_CLIENT_KEY=ptlc_...
PANEL_APPLICATION_KEY=ptla_...
MINECRAFT_NEST_IDS=1,6,7
# Stripe Integration
STRIPE_SECRET_KEY=sk_test_... # or sk_live_... for production
STRIPE_WEBHOOK_SECRET=whsec_... # Get from Stripe Dashboard webhook settings
BASE_URL=https://discord-bot.firefrostgaming.com # For checkout redirect URLs
# Wiki.js Subscriber Wiki (subscribers.firefrostgaming.com)
# Generate key in Wiki.js Admin → API Access. Groups (Awakened thru Sovereign)
# must be pre-created in Wiki.js admin panel before syncing.
WIKIJS_URL=https://subscribers.firefrostgaming.com
WIKIJS_API_KEY=
# Modpack Installer (Task #101)
CURSEFORGE_API_KEY= # From https://console.curseforge.com
BITCH_BOT_SCHEMATIC_URL=https://downloads.firefrostgaming.com/Firefrost-Schematics/firefrost-spawn-v1.schem
BITCH_BOT_SCHEMATIC_HASH= # SHA-256 of schematic file (placeholder until Holly exports)
CLOUDFLARE_ZONE_ID=7604c173d802f154035f7e998018c1a9
# Discord Webhooks (optional — silent-skip if unset)
DISCORD_ISSUE_WEBHOOK_URL=