mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
v4.7 (#12478)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Co-authored-by: Aditya Tripathi <aditya@climactic.co>
This commit is contained in:
co-authored by
Claude Opus 5.5
peaklabs-dev
Aditya Tripathi
parent
b7dc2e435b
commit
033f0c84da
@@ -48,7 +48,7 @@ class Gitea extends Controller
|
||||
|
||||
// Only users who may administer the source can complete OAuth and store tokens.
|
||||
if (! $request->user()->can('update', $giteaApp)) {
|
||||
return redirect()->route('source.all')->with('error', 'You are not authorized to connect this Gitea App.');
|
||||
return redirect()->route('source.all')->with('error', 'You are not authorized to connect this Gitea / Forgejo App.');
|
||||
}
|
||||
|
||||
$baseUrl = rtrim($giteaApp->html_url, '/');
|
||||
@@ -85,7 +85,7 @@ class Gitea extends Controller
|
||||
{
|
||||
try {
|
||||
$return_payloads = collect([]);
|
||||
$x_gitea_event = Str::lower((string) $request->header('X-Gitea-Event'));
|
||||
$x_gitea_event = Str::lower((string) ($request->header('X-Gitea-Event') ?? $request->header('X-Forgejo-Event')));
|
||||
|
||||
if ($x_gitea_event === 'ping') {
|
||||
return response('pong');
|
||||
@@ -98,7 +98,7 @@ class Gitea extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
$signature = (string) $request->header('X-Gitea-Signature');
|
||||
$signature = (string) ($request->header('X-Gitea-Signature') ?? $request->header('X-Forgejo-Signature'));
|
||||
if ($signature === '') {
|
||||
$signature = Str::after((string) $request->header('X-Hub-Signature-256'), 'sha256=');
|
||||
}
|
||||
@@ -365,8 +365,8 @@ class Gitea extends Controller
|
||||
{
|
||||
try {
|
||||
$return_payloads = collect([]);
|
||||
$x_gitea_delivery = request()->header('X-Gitea-Delivery');
|
||||
$x_gitea_event = Str::lower((string) $request->header('X-Gitea-Event'));
|
||||
$x_gitea_delivery = $request->header('X-Gitea-Delivery') ?? $request->header('X-Forgejo-Delivery');
|
||||
$x_gitea_event = Str::lower((string) ($request->header('X-Gitea-Event') ?? $request->header('X-Forgejo-Event')));
|
||||
$x_hub_signature_256 = Str::after((string) $request->header('X-Hub-Signature-256'), 'sha256=');
|
||||
$content_type = $request->header('Content-Type');
|
||||
$payload = $request->collect();
|
||||
|
||||
@@ -878,6 +878,7 @@ class Github extends Controller
|
||||
$github_app = GithubApp::whereKey(data_get($payload, 'github_app_id'))
|
||||
->where('team_id', $team_id)
|
||||
->firstOrFail();
|
||||
abort_unless($request->user()->can('update', $github_app), 403);
|
||||
|
||||
if ($request->user()->currentTeam()?->id !== $team_id) {
|
||||
refreshSession($github_app->team);
|
||||
|
||||
Reference in New Issue
Block a user