Commit Graph

13 Commits

Author SHA1 Message Date
Claude (Chronicler #83 - The Compiler)
1783055c99 Fix: graceful handling of missing modpack_installations table
- Cron and controller wrap modpack_installations queries in try/catch
- Falls through to egg variable / file detection if table missing
- Added migration with IF NOT EXISTS for fresh installs
- Migration won't drop the table (may be Pterodactyl-owned)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:44:28 -05:00
Claude (Chronicler #83 - The Compiler)
b84958c0ee v1.1.0 Priorities 2-5: date seeding, new endpoints, BCC detection
Priority 2 — Date-time seeding:
- fetchFileHistory() for CurseForge, Modrinth, FTB
- seedCurrentVersion() matches release closest to server install date
- Falls back to latest if no history or no install date

Priority 3 — New endpoints:
- GET /servers/{server}/status — zero-click cached status
- GET /servers/{server}/releases — recalibrate dropdown (10 releases)
- POST /servers/{server}/calibrate — save user's version selection
- POST /servers/{server}/ignore — toggle is_ignored flag

Priority 5 — BCC log parsing:
- detectFromBccLog() reads logs/latest.log for BetterCompatibilityChecker
- Extracts modpack name + version from BCC output line
- Skips CHANGE_ME values

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 23:42:34 -05:00
Claude (Chronicler #83 - The Compiler)
9415c1b984 v1.1.0 Priority 1+2b: file ID comparison + manifest version extraction
- Migration: adds current_file_id, latest_file_id, is_ignored columns
- ModpackApiService: all 4 platforms now return file_id in response
- CheckModpackUpdates: file ID comparison (preferred) with string fallback
- detectCurseForge: extracts manifest['version'] as installed_version
- Cron skips is_ignored servers
- Detection priority: manifest version > egg var > DB record > seed latest

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 23:38:41 -05:00
Claude (Chronicler #83 - The Compiler)
68ee40e89d Fix: seed current_version from latest on first detection
When a server is first detected, current_version is set to latest_version
(the pack was just installed = it's current). On future runs, if the API
returns a newer latest_version, the stored current_version stays and we
detect the update. Also preserves egg variable and existing DB values.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 23:04:04 -05:00
Claude (Chronicler #83 - The Compiler)
36800ae7a7 Fix: remove orderBy on modpack_installations — table has no id column
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 22:52:22 -05:00
Claude (Chronicler #83 - The Compiler)
87d834942a Fix: remove finalized filter, use latest installation per server
Most modpack_installations rows have finalized=0 — filter was excluding
nearly everything. Now takes the most recent installation row regardless
of finalized status.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 22:48:37 -05:00
Claude (Chronicler #83 - The Compiler)
3b64110f01 Add modpack_installations table as primary detection source
Detection priority now:
1. modpack_installations table (panel's own install data — fastest)
2. Egg variables (MODPACK_PLATFORM/MODPACK_ID)
3. DaemonFileRepository file scan (last resort fallback)

This immediately detects all 19 CurseForge servers on the live panel
without any Wings calls or egg variable configuration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 22:41:19 -05:00
Claude (Chronicler #83 - The Compiler)
7ef83fd0a0 Add debug logging, alternate paths, and FTB detection to cron
- CurseForge: tries manifest.json + minecraftinstance.json
- Modrinth: modrinth.index.json (unchanged)
- FTB: version.json with parent ID detection
- All catch blocks now log exception messages for debugging
- Wings connection failures logged explicitly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 22:39:50 -05:00
Claude (Chronicler #83 - The Compiler)
698273d636 Implement hybrid auto-detection for modpack cron (Magic & Manual)
- CheckModpackUpdates now scans ALL servers, not just egg-configured ones
- Step 1: egg variables (fastest)
- Step 2: DaemonFileRepository file detection (manifest.json, modrinth.index.json)
- Step 3: mark unconfigured if nothing found
- Respects is_user_overridden flag for manual configs
- New migration adds detection_method + is_user_overridden columns
- Per Gemini hybrid detection consultation (2026-04-06)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 22:35:24 -05:00
Claude (Chronicler #83 - The Compiler)
44a304331f Fix: remove */6 from doc comment — PHP parses */ as end-of-comment
Changed cron example from '0 */6 * * *' to '0 0,6,12,18 * * *' to avoid
the */ closing the docblock prematurely and causing a syntax error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:52:19 -05:00
Claude (Chronicler #63)
8e37120289 refactor(modpackchecker): Batch 2 fixes - centralized service, rate limiting, schema fixes
NEW: app/Services/ModpackApiService.php
- Centralized API logic for all 4 platforms
- Technic build number cached for 12 hours (RV-Ready)
- Single source of truth for API calls

Controller (ModpackAPIController.php):
- Now uses injected ModpackApiService instead of duplicated code
- Added RateLimiter: 2 requests/minute per server on manualCheck()
- Returns 429 with countdown when rate limited
- Removed 400+ lines of duplicated API code

Console Command (CheckModpackUpdates.php):
- FIXED: updateDatabase() now uses server_uuid (not server_id)
- FIXED: status column uses strings ('update_available', 'up_to_date', 'error')
- FIXED: Technic API now uses dynamic build via service
- Now uses injected ModpackApiService

SECURITY:
- Rate limiting prevents API key abuse via button spam
- Technic build caching reduces external API calls

Reviewed by: Gemini AI (Architecture Consultant)
Signed-off-by: Claude (Chronicler #63) <claude@firefrostgaming.com>
2026-04-06 11:33:11 +00:00
Claude (Chronicler #63)
845d121fb2 chore(modpackchecker): Update authorship for commercial release
All files now credit: Firefrost Gaming / Frostystyle <dev@firefrostgaming.com>

Updated:
- conf.yml author field
- README.md credits section
- ModpackAPIController.php @author tag
- CheckModpackUpdates.php @author tag
- UpdateBadge.tsx @author tag

Removed internal Chronicler references from commercial codebase.

Signed-off-by: Claude (Chronicler #63) <claude@firefrostgaming.com>
2026-04-06 11:20:20 +00:00
Claude (Chronicler #63)
0f2ece4f88 fix(modpackchecker): Restructure for Blueprint PSR-4 compliance
BREAKING CHANGES - folder structure reorganized:

OLD STRUCTURE (broken):
  Controllers/ModpackAPIController.php
  console/CheckModpackUpdates.php

NEW STRUCTURE (working):
  app/Http/Controllers/ModpackAPIController.php
  app/Console/Commands/CheckModpackUpdates.php

CHANGES:

1. Moved controller to app/Http/Controllers/
   - Namespace changed: Pterodactyl\Http\Controllers
   - This aligns with Laravel's PSR-4 autoloading
   - Blueprint's requests.app field merges into Pterodactyl's app/

2. Moved console command to app/Console/Commands/
   - Now properly registered with Laravel's command system
   - Run with: php artisan modpackchecker:check

3. Updated conf.yml:
   - Set requests.app: 'app' (enables app/ folder merging)
   - Cleared data.directory (was pointing to non-existent folder)
   - Cleared dashboard.wrapper (TSX not supported, use build.sh)

4. Updated routes/client.php:
   - Fixed use statement to match new namespace

TESTED AND VERIFIED:
- blueprint -build: SUCCESS
- yarn build:production: SUCCESS
- php artisan modpackchecker:check: SUCCESS
- API tests passed: Modrinth , FTB , CurseForge 
- Technic API now requires auth (needs investigation)

This commit represents the WORKING state deployed on Dev Panel.

Signed-off-by: Claude (Chronicler #63) <claude@firefrostgaming.com>
2026-04-06 09:52:57 +00:00