Laravel 13 + Filament 5 admin panel and REST API for a non-profit developer collective, backed by the Pireon OAuth identity server. The public site is a separate, server-rendered application consuming /api/public/v1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
114 lines
3.6 KiB
PHP
114 lines
3.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Services\Git\GiteaProvider;
|
|
use App\Services\Git\GitHubProvider;
|
|
|
|
return [
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Repository hosting providers
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Each entry maps a provider key to the driver that talks to it. Adding
|
|
| another (GitLab, say) means writing one class implementing
|
|
| App\Services\Git\Contracts\RepositoryProvider and registering it here —
|
|
| nothing else in the application changes.
|
|
|
|
|
*/
|
|
|
|
'default' => env('GIT_PROVIDER', 'gitea'),
|
|
|
|
'providers' => [
|
|
|
|
/*
|
|
| Self-hosted Gitea — the collective's own instance.
|
|
*/
|
|
'gitea' => [
|
|
'driver' => GiteaProvider::class,
|
|
|
|
/*
|
|
| Instance root, without /api/v1 — the driver appends it.
|
|
| e.g. https://git.pireon.dev
|
|
*/
|
|
'url' => env('GITEA_URL'),
|
|
|
|
/*
|
|
| Access token from Settings → Applications in Gitea. Only needed
|
|
| for private repositories, or if the instance requires sign-in to
|
|
| read. Give it the narrowest scope that works: read:repository
|
|
| and read:issue.
|
|
*/
|
|
'token' => env('GITEA_TOKEN'),
|
|
|
|
/*
|
|
| Organisation used when a repository is entered as a bare name
|
|
| rather than "owner/repo".
|
|
*/
|
|
'default_owner' => env('GITEA_ORG'),
|
|
],
|
|
|
|
/*
|
|
| Kept available for mirrors or the occasional repository hosted
|
|
| elsewhere. Without a token the GitHub API allows 60 requests/hour.
|
|
*/
|
|
'github' => [
|
|
'driver' => GitHubProvider::class,
|
|
'api_url' => env('GITHUB_API_URL', 'https://api.github.com'),
|
|
'token' => env('GITHUB_TOKEN'),
|
|
'default_owner' => env('GITHUB_ORG'),
|
|
],
|
|
|
|
],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Issue mirroring
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Labels that mark an issue as worth showing on the public site. Matching
|
|
| is case-insensitive, and label sets vary between repositories, so several
|
|
| spellings of the same idea are listed.
|
|
|
|
|
*/
|
|
|
|
'labels' => [
|
|
'good_first_issue' => [
|
|
'good first issue', 'good-first-issue', 'first-timers-only',
|
|
'buena primera tarea', 'starter',
|
|
],
|
|
'help_wanted' => [
|
|
'help wanted', 'help-wanted', 'se busca ayuda', 'contributions welcome',
|
|
],
|
|
],
|
|
|
|
/*
|
|
| Cap on issues mirrored per repository. These exist to give a newcomer a
|
|
| way in, not to be a full issue tracker.
|
|
*/
|
|
'max_issues_per_repository' => (int) env('GIT_MAX_ISSUES', 25),
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Sync
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
|
|
// How often the scheduler refreshes every repository.
|
|
'sync_cron' => env('GIT_SYNC_CRON', 'hourly'),
|
|
|
|
// Repositories synced more recently than this are skipped by the scheduled
|
|
// run, so a manual sync is not immediately redone.
|
|
'sync_ttl_minutes' => (int) env('GIT_SYNC_TTL', 55),
|
|
|
|
'http_timeout' => (int) env('GIT_HTTP_TIMEOUT', 15),
|
|
|
|
/*
|
|
| After this many consecutive failures the repository is flagged in the
|
|
| panel. Deleted or renamed repositories are the usual cause.
|
|
*/
|
|
'failure_threshold' => 3,
|
|
];
|