Commit Graph

147 Commits

Author SHA1 Message Date
Claude (Chronicler #78)
b8f9926e9b feat: Task #116 — Trinity Console Tasks Module
- Tasks page at /admin/tasks with filterable table
- Status/owner inline dropdowns (change via form submit)
- + New Task modal with title, description, priority, owner
- ✓ Done button on hover per row
- Stats bar: active, in progress, blocked, high priority, completed
- Show All toggle for done/obsolete tasks
- Sidebar link under Operations (right after Dashboard)
- Added to About page module registry

Source of truth: PostgreSQL tasks table (shared with Discord /tasks)

Chronicler #78 | firefrost-services
2026-04-11 14:22:21 +00:00
Claude (Chronicler #78)
78179de2bc feat: /tasks detail view + In Progress button
- /tasks number:26 shows full task detail embed
  (description, tags, status, priority, owner, dates)
- Mark Done, In Progress, and Take Task buttons on detail view
- task_progress_ button handler sets status to in_progress

Chronicler #78 | firefrost-services
2026-04-11 14:13:16 +00:00
Claude (Chronicler #78)
48f74e8658 feat: ChatOps Task Management System (Gemini-architected)
Database:
- tasks table in PostgreSQL (id, task_number, title, status, priority, owner, tags)
- 45 tasks migrated from BACKLOG.md + tasks-index files
- Indexes on status, priority, owner, task_number

API (for Chroniclers/Catalysts):
- GET /api/internal/tasks — list with filters (status, priority, owner)
- GET /api/internal/tasks/summary — stats by status and priority
- POST /api/internal/tasks — create new task (auto-numbers)
- PATCH /api/internal/tasks/:id — update status/priority/owner

Discord (for Meg/Holly/Michael):
- /tasks command with filter options (open, in_progress, mine, high, active, done, all)
- Mark Done buttons — one tap to complete a task
- Take Task buttons — claim unassigned tasks
- Color-coded priority and status emoji
- Staff-only access

Architecture: PostgreSQL → Arbiter API → Discord buttons (ChatOps)
Gemini consultation: gemini-task-management-redesign-2026-04-11.md

Chronicler #78 | firefrost-services
2026-04-11 13:56:45 +00:00
Claude (Chronicler #78)
075ab899c5 fix: Add MCP Logs to About page module registry
Chronicler #78 | firefrost-services
2026-04-11 13:18:05 +00:00
Claude (Chronicler #78)
03974d1f13 feat: Task #109 — MCP Logging in Trinity Console (v2.3.0)
Arbiter changes:
- POST /api/internal/mcp/log endpoint in api.js
- MCP Logs admin route (/admin/mcp-logs) with filters, stats, pagination
- EJS view with expandable detail rows, server color badges
- Sidebar link under System group

Trinity Core v2.3.0:
- logToArbiter() function POSTs to Arbiter after every command
- Both MCP (Claude.ai) and REST (/exec) paths log with execution timing
- Async logging — doesn't block command response

Database:
- mcp_logs table created on Command Center (indexes on server, time, success)

Architecture:
  Trinity Core → command → response + async POST → Arbiter → PostgreSQL → Trinity Console

Chronicler #78 | firefrost-services
2026-04-11 11:55:22 +00:00
Claude (Chronicler #78)
0b61d38419 feat: Dashboard — Social Overview above New Features, add new modules
- Moved Social Overview card above New Features card
- Added Infrastructure module to New Features (topology map)
- Added Social Analytics to New Features (engagement tracking)
- Added About & Deploy to New Features (version info)
- Kept Discord Dashboard in New Features
- Removed Financials from New Features (it's established now)

Chronicler #78 | firefrost-services
2026-04-11 10:51:22 +00:00
Claude (Chronicler #78)
bd783093a9 feat: Sidebar reorganization + About page
Sidebar changes:
- Grouped nav items: Operations, Business, Community, Infrastructure, System
- Section labels with uppercase tracking
- Removed Deploy button from sidebar
- Cleaner layout with overflow scroll

About page (/admin/about):
- Console version, Node.js version, Arbiter uptime, module count
- Module registry with version and status badges (stable/new/beta)
- Deploy Arbiter button (moved from sidebar)
- Health check polling after deploy
- Credits footer

Header bar:
- Added ℹ️ About icon next to dark mode toggle
- Active state highlighting when on About page

Chronicler #78 | firefrost-services
2026-04-11 10:46:42 +00:00
Claude (Chronicler #78)
4788140c2c fix: Node clicks blocked after dragging — reset dragMoved on mouseup/touchend
dragMoved flag was only reset in wrap mousedown, which skips for node clicks.
After any drag, dragMoved stayed true forever, blocking all showServer/showExternal calls.
Fix: setTimeout reset on mouseup/touchend (10ms delay lets click fire first).

Chronicler #78 | firefrost-services
2026-04-11 10:38:32 +00:00
Claude (Chronicler #78)
0c7dad36ea feat: Add zoom/pan/pinch to Infrastructure topology
- Mouse wheel zoom (centered on cursor position)
- Click-drag to pan
- Touch pinch-zoom for mobile
- Touch drag to pan on mobile
- Zoom controls: +, −, percentage display, reset (⌂)
- Zoom range: 50% to 300%
- Drag guard prevents accidental clicks after panning
- Canvas connections redraw correctly at all zoom levels
- Smooth CSS transitions on zoom, disabled during drag

Chronicler #78 | firefrost-services
2026-04-11 10:35:03 +00:00
Claude (Chronicler #78)
2e3d272e26 fix: RAM percentage parsing — handle Mi vs Gi units
Panel VPS and Trinity Core report used RAM in Mi (e.g. 703Mi)
while total is in Gi (e.g. 1.9Gi). parseFloat gave 703/1.9 = 37000%.
Now normalizes both values to Gi before calculating percentage.

Chronicler #78 | firefrost-services
2026-04-11 10:30:43 +00:00
Claude (Chronicler #78)
55385634f2 feat: Add REST API endpoints to Trinity Core (v2.2.0)
- GET /servers — list available servers (for Arbiter)
- POST /exec — execute command on server (for Arbiter)
- REST endpoints run alongside MCP protocol
- MCP for Claude.ai connector, REST for Arbiter internal calls
- Fixes Infrastructure module 404 errors
- Version bump 2.1.0 → 2.2.0

Chronicler #78 | firefrost-services
2026-04-11 10:27:08 +00:00
Claude (Chronicler #78)
a83766efb4 feat: Add Infrastructure module to Trinity Console
New module: /admin/infrastructure
- Interactive topology map showing all 8 servers + external services
- Live data from Trinity Core MCP API (cached 60s)
- Bezier curve connections color-coded by type (external/internal/SSH/MCP)
- Hover highlights all connections to/from a node
- Click to drill into server detail (CPU, RAM, disk, load, services)
- Game server list for TX1/NC1 with RAM allocation totals
- External service detail (Cloudflare, Stripe, Discord, Claude.ai)
- Fleet summary bar (8 servers, 22 games, ~42 containers)
- Refresh button forces cache clear + re-audit
- Mobile responsive grid layout
- JetBrains Mono typography, Fire/Frost/Arcane color scheme

Files:
- src/routes/admin/infrastructure.js (route + Trinity Core API client)
- src/views/admin/infrastructure/index.ejs (topology + detail views)
- Modified: src/routes/admin/index.js (registered infrastructure router)
- Modified: src/views/layout.ejs (added nav link)

Chronicler #78 | firefrost-services
2026-04-11 10:24:05 +00:00
Claude (Chronicler #78)
5c980ea681 feat: Add Trinity Core MCP server to version control (v2.1.0)
- Added services/trinity-core/ with index.js, package.json, .gitignore
- v2.1.0 adds local self-execution (trinity-core can audit itself)
- Added executeLocal() function for localhost commands
- SERVERS object now includes trinity-core with local: true flag
- Version bumped from 2.0.0 to 2.1.0
- Previously lived only on Pi at ~/mcp-server/ with no backup

Deployment: Edit here, push to Gitea, curl raw file to Pi, restart service

Chronicler #78 | firefrost-services
2026-04-11 10:07:32 +00:00
Claude
483d12c34d Archive obsolete services (arbiter v2.0, whitelist-manager)
Moved to services/_archived/:
- arbiter/ (v2.0.0) - superseded by arbiter-3.0/
- whitelist-manager/ - merged into Trinity Console

Added README explaining what's archived and why.

DO NOT DEPLOY archived services - kept for historical reference only.

Chronicler #76
2026-04-11 08:00:17 +00:00
Claude
7c534b53a4 Fix: Add socialTotals to correct dashboard route file
Was editing wrong file (admin.js vs admin/index.js)

Chronicler #76
2026-04-10 22:26:10 +00:00
Claude
918fb99b87 Add Social Overview card to Trinity Console dashboard
- Shows cross-platform totals (posts, views, likes, comments)
- Breaks down by platform with icons
- Clickable link to full Social Analytics page

Chronicler #76
2026-04-10 22:23:21 +00:00
Claude
74f7876955 Fix social sync: update post_title and post_url on existing posts
Previously only INSERT included these fields, UPDATE ignored them.

Chronicler #76
2026-04-10 22:20:06 +00:00
Claude (Chronicler #76)
f35325a597 Add internal API routes for n8n social analytics integration
Task #108 Phase 2: Social Analytics Automation

New endpoints (token-based auth via INTERNAL_API_TOKEN):
- POST /api/internal/social/sync - Upsert single post metrics
- POST /api/internal/social/sync/batch - Batch upsert (max 100 posts)
- POST /api/internal/social/snapshot - Upsert account-level stats
- GET /api/internal/social/digest - Summary data for Discord webhook

Architecture:
- Rube MCP -> n8n -> Arbiter /api/internal/* -> PostgreSQL
- Bearer token auth (not session-based)
- COALESCE for partial updates (only update provided fields)

Next: Generate INTERNAL_API_TOKEN and add to .env on Command Center

🔥 Fire + Frost + Foundation = Where Love Builds Legacy 💙❄️
2026-04-10 21:00:19 +00:00
Claude
92e460a90b fix: Add Social Analytics to sidebar navigation
Chronicler #76
2026-04-10 20:27:35 +00:00
Claude
cfdd89377f feat: Add migration-aware deploy script for Trinity Console
- Automatically runs new SQL migrations on deploy
- Tracks applied migrations in .migrations-applied file
- Skips already-applied migrations
- Logs all actions to /var/log/arbiter-deploy.log
- Handles npm install if package.json changes
- Enables Meg/Holly to deploy without backend access

Install: sudo cp scripts/deploy-arbiter.sh /opt/scripts/
         sudo chmod +x /opt/scripts/deploy-arbiter.sh

Chronicler #76
2026-04-10 20:24:48 +00:00
Claude
be2f5eb5a5 fix: Add platform_post_id column per Gemini review
- Added platform_post_id VARCHAR(255) for Phase 2 API matching
- Added composite index on (platform, platform_post_id)
- Future-proofs manual entries for automatic API sync

Chronicler #76 (per Gemini consultation)
2026-04-10 20:19:49 +00:00
Claude
b8ed2095ba feat: Add Social Analytics module to Trinity Console (Task #108)
- Add database migration for social_posts and social_account_snapshots tables
- Create /admin/social route with full CRUD for posts
- Add dashboard view with platform tabs (TikTok, Facebook, Instagram, X, Bluesky)
- Add post entry form matching TikTok Studio metrics
- Add post detail view with update capability
- Add account snapshot form for follower/demographic tracking
- Register social router in admin index

Phase 1: Manual entry dashboard
Phase 2 (future): API integration when approved

Chronicler #76
2026-04-10 20:14:27 +00:00
Claude
685626f13f fix: Use correct env vars PANEL_URL and PANEL_CLIENT_KEY
.env has PANEL_URL and PANEL_CLIENT_KEY, not PTERO_PANEL_URL.

Chronicler #75
2026-04-10 18:00:33 +00:00
Claude
32b378f539 fix: Use Pterodactyl API directly instead of servers-api Worker
Worker was returning HTML error page. Now queries Pterodactyl panel
directly using PTERO_CLIENT_KEY from .env.

Chronicler #75
2026-04-10 15:41:57 +00:00
Claude
811e3046cf feat: Add server status poller for Discord channels (#107)
New service that polls Pterodactyl (via servers-api Worker) every 5 min
and posts/updates status embeds in each game server's -status channel.

- Creates discord_status_messages table to persist message IDs
- Maps server names to channel IDs for all 15 game servers
- Posts new embed or edits existing one (no spam)
- Handles message deletion gracefully (re-posts if needed)

Status channels created:
- stoneblock-4-status, society-sunlit-valley-status, atm10-tts-status
- all-the-mons-status, mythcraft-5-status, beyond-depth-status
- beyond-ascension-status, otherworld-status, deceasedcraft-status
- submerged-2-status, sneaks-pirate-pack-status, cottage-witch-status
- farm-crossing-5-status, homestead-status, wolds-vaults-status

Chronicler #75
2026-04-10 15:39:04 +00:00
Claude
0acea3b95f fix: Skip OAuth if already logged in, go straight to checkout
If user has existing session from Trinity Console login,
/stripe/auth now redirects directly to /stripe/checkout
instead of re-triggering Discord OAuth.

Chronicler #75
2026-04-10 15:06:34 +00:00
Claude
2740dc5fd3 fix: Use OAuth state parameter instead of session for tier
Session was being lost between /stripe/auth and /auth/discord/callback.
Now passes tier through Discord OAuth state parameter which survives
the redirect.

Chronicler #75
2026-04-10 15:05:40 +00:00
Claude
b4280dc630 db: Add stripe_products seed data with actual Stripe IDs
Maps tier levels to Stripe product/price IDs:
- Tier 1: Awakened ( one-time)
- Tier 2-3: Elemental Fire/Frost (/mo)
- Tier 4-5: Knight Fire/Frost (0/mo)
- Tier 6-7: Master Fire/Frost (5/mo)
- Tier 8-9: Legend Fire/Frost (0/mo)
- Tier 10: Sovereign (99 one-time)

Run on Command Center:
PGPASSWORD='FireFrost2026!Arbiter' psql -U arbiter -h 127.0.0.1 -d arbiter_db -f seed-stripe-products.sql

Chronicler #75
2026-04-10 14:59:15 +00:00
Claude
12ffdd45f5 fix: Add Discord OAuth → Stripe checkout flow
THE BUG: Website redirected to /stripe/auth but route didn't exist.
Checkout sessions were created WITHOUT client_reference_id (Discord ID),
so webhook couldn't sync Discord roles after payment.

THE FIX:
- Added GET /stripe/auth - stores tier in session, redirects to Discord OAuth
- Added GET /stripe/checkout - creates checkout WITH client_reference_id
- Updated auth callback to redirect to /stripe/checkout after OAuth
- Legacy POST /create-checkout-session kept for compatibility

FLOW NOW:
1. User clicks Subscribe on website
2. → /stripe/auth?tier=X (stores tier, redirects to Discord)
3. → /auth/discord (Discord OAuth)
4. → /auth/discord/callback (user authenticated)
5. → /stripe/checkout?tier=X (creates Stripe session WITH Discord ID)
6. → Stripe Checkout (user pays)
7. → Webhook receives event with client_reference_id
8. → Discord role synced!

Chronicler #75
2026-04-10 14:58:41 +00:00
Claude
d227bce0a8 Add discord-channel-rename.js script
- Maps Pterodactyl servers to Discord categories
- Renames channels to consistent naming convention
- DRY_RUN=true by default (preview mode)
- 1.5s rate limit delay between operations
- Snart Doctrine: built to adapt when reality hits
2026-04-09 20:12:12 +00:00
Claude
47a600eeb5 Fix: Handle server names with subtitles for Discord channel matching
- 'Homestead - A Cozy Survival Experience' now matches 'homestead-chat'
- 'All The Mons (Private) - TX' now matches 'all-the-mons-chat'
- Strips subtitles after ' - ' and removes parentheticals
2026-04-09 20:03:41 +00:00
Claude
e30ff4d694 Fix: Add Discord channel status to matrix body template (inline cards, not partial) 2026-04-09 19:59:36 +00:00
Claude
081bad1279 Add Discord channel status check to server cards
- Checks for 4 channels per server: chat, in-game, forum, voice
- Shows 'All 4 channels configured' or lists missing channels
- Caches Discord channel data for 5 minutes to reduce API calls
2026-04-09 19:55:41 +00:00
Claude
cbf5d219fc Add health check after deploy - confirms Arbiter restarted successfully 2026-04-09 19:50:17 +00:00
Claude
02bddc0baf Fix deploy button: use detached process to avoid 502 on self-restart 2026-04-09 19:48:04 +00:00
Claude
ef562ef59a Add Trinity Console deploy button for Holly/Meg/Michael
- Deploy button in sidebar above username
- POST /admin/system/deploy endpoint
- Updated deploy.sh with locking, logging, user tracking
- Prevents concurrent deploys (mkdir lock)
- Logs who deployed and what commit
- Updated DEPLOYMENT.md with setup instructions

Gemini consultation: confirmed synchronous approach, locking, sudoers config
2026-04-09 19:40:34 +00:00
Claude
dc59e5c1de Add /delserver documentation script
Chronicler: #71
2026-04-08 17:30:12 +00:00
Claude
69200d8ac3 Add /delserver slash command
Deletes complete server setup:
- All channels in category
- The category itself
- The server role

Requires confirm:True to execute.
Without confirm, shows preview of what would be deleted.
Reminds to clean up Carl-bot reaction roles.

Staff only.

Chronicler: #71
2026-04-08 17:27:10 +00:00
Claude
7ecce5da8f Add script to create #staff-commands with documentation
Creates channel in Staff Area with detailed embeds for:
- /link command (everyone)
- /createserver command (staff only)

Chronicler: #71
2026-04-08 17:21:52 +00:00
Claude
06f7afe25d Add /createserver slash command
Creates complete server setup with one command:
- Creates role
- Creates category with 🎮 prefix
- Creates chat, in-game, forum, voice channels
- Applies permission template
- Posts and archives welcome message
- Suggests unused emoji for reaction roles

Staff only. Reminds to configure Carl-bot.

Task #98 Discord Channel Automation
Chronicler: #71
2026-04-08 17:18:28 +00:00
Claude
083885c874 Add emoji prefixes to remaining categories
📢 Welcome & Info
💬 Community Hub
🔊 Voice Channels
📞 Support

Chronicler: #71
2026-04-08 17:05:34 +00:00
Claude
05d23e2dfc Add script to archive welcome posts
Fixes forum channels staying visible when category collapsed.
Archived threads don't count as 'active'.

Chronicler: #71
2026-04-08 17:00:17 +00:00
Claude
940840d69a Fix Wold's Vaults v2 - use role ID directly
Whatever apostrophe variant that is, we're bypassing it.
Role ID: 1491029373640376330

Chronicler: #71
2026-04-08 16:53:42 +00:00
Claude
f5a75d204f Fix Wold's Vaults - curly apostrophe
Role uses ' (curly) not ' (straight)

Chronicler: #71
2026-04-08 16:52:36 +00:00
Claude
40cb6cef31 Add full Discord channel setup script (46 channels)
Task #98 implementation:
- Phase 1: Add 🎮 prefix to existing 5 server categories
- Phase 2: Add forums to existing 5 servers
- Phase 3: Create full setup for 10 new servers (category + chat + in-game + voice + forum)
- Phase 4: Create 📦 Archive category (staff-only)

Includes:
- DRY_RUN mode for safe testing
- Permission overwrites (Wanderer=view, Server Role=interact, Staff=full)
- 15 welcome posts with server-specific content
- 6 standard forum tags per forum
- Rate limiting (500ms between API calls)

Chronicler: #71
2026-04-08 16:50:05 +00:00
Claude
9752c6fd89 Add full Discord channel setup script (46 channels)
Task #98: Discord Channel Automation
- Phase 1: Add forums to existing 5 servers + rename categories
- Phase 2: Create 10 new server categories with all channels
- Phase 3: Create Archive category (staff only)

Includes:
- 15 server-specific welcome posts
- Standard forum tags (6 tags)
- Permission template (Wanderer view-only, Server Role full access)
- Rate limiting (500ms delays)
- Idempotent (skips existing channels)

Chronicler: #71
2026-04-08 16:48:48 +00:00
Claude
911f5801fc Fix .env path to /opt/arbiter-3.0/.env
Chronicler: #71
2026-04-08 16:40:40 +00:00
Claude
8768c6773f Add Discord channel creation test script
Phase 1 test for Task #98 Discord automation.
Creates one test category + one forum with tags + welcome post.
Includes DRY_RUN mode and permission checks.

Chronicler: #71
2026-04-08 16:39:48 +00:00
Claude Chronicler-70
9e4fa13fdb feat(arbiter): Add New Features card to dashboard
Highlights Discord Dashboard and Financials Module with
clickable cards that link directly to the new features.

Chronicler: #70
2026-04-08 15:33:54 +00:00
Claude Chronicler-70
b96ab1fb24 feat(arbiter): Add Discord dashboard to Trinity Console
- New sidebar entry for Discord
- Full server structure visualization
- Channel tree with expandable categories
- Role hierarchy with color badges
- Health checks (orphan channels, empty roles, bot roles)
- Search/filter across channels and roles
- Click channel to see permission overwrites
- Click role to see explicit channel access
- Responsive design with modal details view

Chronicler: #70
2026-04-08 15:30:22 +00:00