Files
coolify/routes/webhooks.php
Andras BacsaiandClaude 8b90ae3428 feat: Add GitHub Actions self-hosted runner pool system
Implement backend infrastructure and initial UI for managing GitHub Actions
runners on user-owned servers, similar to Blacksmith.sh but self-hosted.

**Backend Implementation:**
- Database schema: github_runner_sources (pools), github_runner_servers (pivot), github_runners (instances)
- Models: GitHubRunnerSource, GitHubRunner with relationships to Server
- GitHub API helpers: JIT config generation, token management, webhook validation
- Webhook handler: Processes workflow_job events, matches labels, provisions runners
- Job queue: ProvisionGithubRunnerJob (server selection, Docker provisioning), CleanupGithubRunnerJob
- Ephemeral runners using JIT configuration for enhanced security

**Testing:**
- Unit tests: Helper functions, webhook validation, model methods
- Feature tests: Webhook flow, provisioning, server selection, relationships

**UI Foundation:**
- Runner Sources index page with source listing
- Routes configured for index, create, and detail views
- Integration into server management section

**How it works:**
1. User creates a GitHub Runner Source (GitHub App + custom label)
2. User adds multiple servers to the runner pool
3. GitHub Actions jobs with matching runs-on label trigger webhook
4. Coolify provisions ephemeral Docker runner on available server
5. Job executes, container auto-removes on completion

**Next steps:**
- Complete UI components (create, detail, server management)
- Add runner history and monitoring
- User documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 09:52:08 +01:00

25 lines
970 B
PHP

<?php
use App\Http\Controllers\Webhook\Bitbucket;
use App\Http\Controllers\Webhook\Gitea;
use App\Http\Controllers\Webhook\Github;
use App\Http\Controllers\Webhook\GithubRunner;
use App\Http\Controllers\Webhook\Gitlab;
use App\Http\Controllers\Webhook\Stripe;
use Illuminate\Support\Facades\Route;
Route::get('/source/github/redirect', [Github::class, 'redirect']);
Route::get('/source/github/install', [Github::class, 'install']);
Route::post('/source/github/events', [Github::class, 'normal']);
Route::post('/source/github/events/manual', [Github::class, 'manual']);
Route::post('/github-runner/{sourceId}', [GithubRunner::class, 'handle'])->name('webhooks.github-runner');
Route::post('/source/gitlab/events/manual', [Gitlab::class, 'manual']);
Route::post('/source/bitbucket/events/manual', [Bitbucket::class, 'manual']);
Route::post('/source/gitea/events/manual', [Gitea::class, 'manual']);
Route::post('/payments/stripe/events', [Stripe::class, 'events']);