lthn.io/routes/console.php
Claude 77cc45dd83
feat: lthn.io CorePHP app — TLD website + blockchain services
Modules:
- Chain: daemon RPC client (DaemonRpc singleton, cached queries)
- Explorer: block browser, tx viewer, alias directory, search, stats API
- Names: .lthn TLD registrar portal (availability check, lookup, directory)
- Trade: scaffold (DEX frontend + API)
- Pool: scaffold (mining pool dashboard)

Replaces 5 Node.js containers (5.9GB) with one FrankenPHP app.
Built on CorePHP framework pattern from host.uk.com.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-03 16:13:55 +01:00

160 lines
5.1 KiB
PHP

<?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schedule;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
// Process expired account deletion requests daily at 3am
Schedule::command('accounts:process-deletions')
->daily()
->at('03:00')
->withoutOverlapping()
->runInBackground();
// Refresh stale user stats every hour
Schedule::command('users:refresh-stats')
->hourly()
->withoutOverlapping()
->runInBackground();
// ============================================
// Trees for Agents
// ============================================
// Process oldest queued tree planting daily at midnight
Schedule::command('trees:process-queue')
->dailyAt('00:00')
->timezone('Europe/London')
->withoutOverlapping()
->runInBackground();
// Plant monthly trees for active subscribers (1st of each month)
Schedule::command('trees:subscriber-monthly')
->monthlyOn(1, '00:00')
->timezone('Europe/London')
->withoutOverlapping()
->runInBackground();
// Batch confirmed trees for monthly TFTF donation (28th of each month)
Schedule::command('trees:donate')
->monthlyOn(28, '00:00')
->timezone('Europe/London')
->withoutOverlapping()
->runInBackground();
// ============================================
// Content Module - Scheduled Publishing
// ============================================
// Auto-publish content items with publish_at in the past
Schedule::command('content:publish-scheduled')
->everyMinute()
->withoutOverlapping()
->runInBackground();
// Process pending webhook retries with exponential backoff
// Backoff intervals: 1m, 5m, 15m, 1h, 4h (max 5 retries)
Schedule::command('content:process-webhooks')
->everyMinute()
->withoutOverlapping()
->runInBackground();
// ============================================
// API Module - Key Maintenance
// ============================================
// Clean up API keys with expired grace periods hourly
Schedule::command('api:cleanup-grace-periods')
->hourly()
->withoutOverlapping()
->runInBackground();
// ============================================
// MCP Module - Log Cleanup
// ============================================
// Clean up old MCP tool call logs and API request logs daily at 4am UK time
Schedule::command('mcp:cleanup-logs')
->dailyAt('04:00')
->timezone('Europe/London')
->withoutOverlapping()
->runInBackground();
// ============================================
// Commerce - Billing & Dunning
// ============================================
// Process failed payment retries and dunning workflow
Schedule::command('commerce:process-dunning')
->dailyAt('06:00')
->timezone('Europe/London')
->withoutOverlapping()
->runInBackground()
->onFailure(function () {
\Illuminate\Support\Facades\Log::error('Commerce dunning processing failed');
});
// Send upcoming renewal reminders (7 days before)
Schedule::command('commerce:renewal-reminders')
->dailyAt('09:00')
->timezone('Europe/London')
->withoutOverlapping()
->runInBackground();
// Clean up expired pending orders hourly
Schedule::command('commerce:cleanup-orders')
->hourly()
->withoutOverlapping()
->runInBackground();
// ============================================
// Uptelligence - Vendor Update Checks
// ============================================
// Check vendors and assets for upstream updates weekly on Sundays at 6am UK time
Schedule::command('uptelligence:check-updates --assets')
->weeklyOn(0, '06:00')
->timezone('Europe/London')
->withoutOverlapping()
->runInBackground();
// Send daily digest emails at 9am UK time
Schedule::command('uptelligence:send-digests --frequency=daily')
->dailyAt('09:00')
->timezone('Europe/London')
->withoutOverlapping()
->runInBackground();
// Send weekly digest emails on Mondays at 9am UK time
Schedule::command('uptelligence:send-digests --frequency=weekly')
->weeklyOn(1, '09:00')
->timezone('Europe/London')
->withoutOverlapping()
->runInBackground();
// Send monthly digest emails on the 1st at 9am UK time
Schedule::command('uptelligence:send-digests --frequency=monthly')
->monthlyOn(1, '09:00')
->timezone('Europe/London')
->withoutOverlapping()
->runInBackground();
// ============================================
// LEM - Training Scoring Queue
// ============================================
// Process pending LEM training scoring jobs from InfluxDB every minute
Schedule::command('lem:process-scoring-queue')
->everyMinute()
->withoutOverlapping()
->runInBackground();
// ============================================
// Tenant - Billing Cycle Management
// ============================================
// Reset billing cycle counters and expire cycle-bound boosts daily at 1am UK time
Schedule::command('tenant:reset-billing-cycles')
->dailyAt('01:00')
->timezone('Europe/London')
->withoutOverlapping()
->runInBackground()
->onFailure(function () {
\Illuminate\Support\Facades\Log::error('Tenant billing cycle reset failed');
});