Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix

Andras Bacsai767824f2f78a
diff --git a/app/Http/Livewire/Source/Github/Change.php b/app/Http/Livewire/Source/Github/Change.php
index 995428e1a9..9fd00d84b7 100644
--- a/app/Http/Livewire/Source/Github/Change.php
+++ b/app/Http/Livewire/Source/Github/Change.php
@@ -14,7 +14,6 @@ class Change extends Component
public string|null $fqdn;
public $parameters;
public GithubApp $github_app;
- public string $installation_url;
public string $name;
public bool $is_system_wide;
diff --git a/bootstrap/helpers/github.php b/bootstrap/helpers/github.php
index 7ba4ac076f..f282ee6f12 100644
--- a/bootstrap/helpers/github.php
+++ b/bootstrap/helpers/github.php
@@ -2,7 +2,7 @@
use App\Models\GithubApp;
use App\Models\GitlabApp;
-use Illuminate\Support\Collection;
+use Illuminate\Support\Str;
use Illuminate\Support\Facades\Http;
use Lcobucci\JWT\Encoding\ChainedFormatter;
use Lcobucci\JWT\Encoding\JoseEncoder;
@@ -71,3 +71,10 @@ function git_api(GithubApp|GitlabApp $source, string $endpoint, string $method =
'data' => collect($json)
];
}
+function get_installation_path(GithubApp $source)
+{
+ $github = GithubApp::where('uuid', $source->uuid)->first();
+ $name = Str::of(Str::kebab($github->name));
+ $installation_path = $github->html_url === 'https://github.com' ? 'apps' : 'github-apps';
+ return "$github->html_url/$installation_path/$name/installations/new";
+}
diff --git a/resources/views/livewire/project/application/source.blade.php b/resources/views/livewire/project/application/source.blade.php
index 0b2dd384f4..24fc44e089 100644
--- a/resources/views/livewire/project/application/source.blade.php
+++ b/resources/views/livewire/project/application/source.blade.php
@@ -5,15 +5,23 @@
<x-forms.button type="submit">Save</x-forms.button>
<a target="_blank" class="hover:no-underline" href="{{ $application?->gitBranchLocation }}">
<x-forms.button>
- <x-git-icon git="{{ $application->source?->getMorphClass() }}" />Open Repository on Git
+ Open Repository
<x-external-link />
</x-forms.button>
</a>
+ @if (!$application->source->is_public)
+ <a target="_blank" class="hover:no-underline" href="{{ get_installation_path($application->source) }}">
+ <x-forms.button>
+ Open Git App
+ <x-external-link />
+ </x-forms.button>
+ </a>
+ @endif
</div>
<div class="text-sm">Code source of your application.</div>
<x-forms.input placeholder="coollabsio/coolify-example" id="application.git_repository" label="Repository" />
<x-forms.input placeholder="main" id="application.git_branch" label="Branch" />
- <div class="flex items-end gap-2 w-96">
+ <div class="flex items-end gap-2">
<x-forms.input placeholder="HEAD" id="application.git_commit_sha" placeholder="HEAD" label="Commit SHA" />
<a target="_blank" class="flex hover:no-underline" href="{{ $application?->gitCommits }}">
<x-forms.button><svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24"
diff --git a/resources/views/livewire/source/github/change.blade.php b/resources/views/livewire/source/github/change.blade.php
index 243ad5d062..1007772791 100644
--- a/resources/views/livewire/source/github/change.blade.php
+++ b/resources/views/livewire/source/github/change.blade.php
@@ -9,7 +9,7 @@
<x-forms.button x-on:click.prevent="deleteSource = true">
Delete
</x-forms.button>
- <a href="{{ $installation_url }}">
+ <a href="{{ get_installation_path($github_app) }}">
<x-forms.button>
@if ($github_app->installation_id)
Update Repositories
diff --git a/resources/views/source/github/show.blade.php b/resources/views/source/github/show.blade.php
index 6cbba2911e..488319f0ff 100644
--- a/resources/views/source/github/show.blade.php
+++ b/resources/views/source/github/show.blade.php
@@ -1,4 +1,4 @@
<x-layout>
- <livewire:source.github.change :github_app="$github_app" :installation_url="$installation_url" :name="$name" :ipv4="$ipv4"
- :ipv6="$ipv6" :fqdn="$fqdn" />
+ <livewire:source.github.change :github_app="$github_app" :name="$name" :ipv4="$ipv4" :ipv6="$ipv6"
+ :fqdn="$fqdn" />
</x-layout>
diff --git a/routes/web.php b/routes/web.php
index 38ae861f34..3d07c7d25e 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -103,8 +103,6 @@ Route::middleware(['auth'])->group(function () {
$github_app = GithubApp::where('uuid', request()->github_app_uuid)->first();
$settings = InstanceSettings::get();
$name = Str::of(Str::kebab($github_app->name));
- $installation_path = $github_app->html_url === 'https://github.com' ? 'apps' : 'github-apps';
- $installation_url = "$github_app->html_url/$installation_path/$name/installations/new";
if ($settings->public_ipv4) {
$ipv4 = 'http://' . $settings->public_ipv4 . ':' . config('app.port');
}
@@ -117,7 +115,6 @@ Route::middleware(['auth'])->group(function () {
'ipv4' => $ipv4 ?? null,
'ipv6' => $ipv6 ?? null,
'fqdn' => $settings->fqdn,
- 'installation_url' => $installation_url,
]);
})->name('source.github.show');