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: do not show system wide git on cloud

Andras Bacsaibe1dad03bd0d
diff --git a/app/Http/Livewire/Source/Github/Create.php b/app/Http/Livewire/Source/Github/Create.php
index b5487bcc80..c607af4518 100644
--- a/app/Http/Livewire/Source/Github/Create.php
+++ b/app/Http/Livewire/Source/Github/Create.php
@@ -32,16 +32,19 @@ class Create extends Component
"custom_port" => 'required|int',
"is_system_wide" => 'required|bool',
]);
- $github_app = GithubApp::create([
+ $payload = [
'name' => $this->name,
'organization' => $this->organization,
'api_url' => $this->api_url,
'html_url' => $this->html_url,
'custom_user' => $this->custom_user,
'custom_port' => $this->custom_port,
- 'is_system_wide' => $this->is_system_wide,
'team_id' => currentTeam()->id,
- ]);
+ ];
+ if (isCloud()) {
+ $payload['is_system_wide'] = $this->is_system_wide;
+ }
+ $github_app = GithubApp::create($payload);
if (session('from')) {
session(['from' => session('from') + ['source_id' => $github_app->id]]);
}
diff --git a/resources/views/livewire/source/github/change.blade.php b/resources/views/livewire/source/github/change.blade.php
index 5b971c5f4b..ea3b1e82f1 100644
--- a/resources/views/livewire/source/github/change.blade.php
+++ b/resources/views/livewire/source/github/change.blade.php
@@ -43,40 +43,41 @@
Install Repositories on GitHub
</a>
@else
- <div class="w-48">
- <x-forms.checkbox label="System Wide?"
- helper="If checked, this GitHub App will be available for everyone in this Coolify instance."
- instantSave id="is_system_wide" />
- </div>
- <div class="flex gap-2">
- <x-forms.input id="github_app.name" label="App Name" disabled />
- <x-forms.input id="github_app.organization" label="Organization" disabled
- placeholder="If empty, personal user will be used" />
- </div>
- <div class="flex gap-2">
- <x-forms.input id="github_app.html_url" label="HTML Url" disabled />
- <x-forms.input id="github_app.api_url" label="API Url" disabled />
- </div>
- <div class="flex gap-2">
- @if ($github_app->html_url === 'https://github.com')
- <x-forms.input id="github_app.custom_user" label="User" disabled />
- <x-forms.input type="number" id="github_app.custom_port" label="Port" disabled />
- @else
- <x-forms.input id="github_app.custom_user" label="User" required />
- <x-forms.input type="number" id="github_app.custom_port" label="Port" required />
+ @if (!isCloud())
+ <div class="w-48">
+ <x-forms.checkbox label="System Wide?"
+ helper="If checked, this GitHub App will be available for everyone in this Coolify instance."
+ instantSave id="is_system_wide" />
+ </div>
@endif
- </div>
- <div class="flex gap-2">
- <x-forms.input type="number" id="github_app.app_id" label="App Id" disabled />
- <x-forms.input type="number" id="github_app.installation_id" label="Installation Id" disabled />
- </div>
- <div class="flex gap-2">
- <x-forms.input id="github_app.client_id" label="Client Id" type="password" disabled />
- <x-forms.input id="github_app.client_secret" label="Client Secret" type="password" />
- <x-forms.input id="github_app.webhook_secret" label="Webhook Secret" type="password" />
- </div>
+ <div class="flex gap-2">
+ <x-forms.input id="github_app.name" label="App Name" disabled />
+ <x-forms.input id="github_app.organization" label="Organization" disabled
+ placeholder="If empty, personal user will be used" />
+ </div>
+ <div class="flex gap-2">
+ <x-forms.input id="github_app.html_url" label="HTML Url" disabled />
+ <x-forms.input id="github_app.api_url" label="API Url" disabled />
+ </div>
+ <div class="flex gap-2">
+ @if ($github_app->html_url === 'https://github.com')
+ <x-forms.input id="github_app.custom_user" label="User" disabled />
+ <x-forms.input type="number" id="github_app.custom_port" label="Port" disabled />
+ @else
+ <x-forms.input id="github_app.custom_user" label="User" required />
+ <x-forms.input type="number" id="github_app.custom_port" label="Port" required />
+ @endif
+ </div>
+ <div class="flex gap-2">
+ <x-forms.input type="number" id="github_app.app_id" label="App Id" disabled />
+ <x-forms.input type="number" id="github_app.installation_id" label="Installation Id" disabled />
+ </div>
+ <div class="flex gap-2">
+ <x-forms.input id="github_app.client_id" label="Client Id" type="password" disabled />
+ <x-forms.input id="github_app.client_secret" label="Client Secret" type="password" />
+ <x-forms.input id="github_app.webhook_secret" label="Webhook Secret" type="password" />
+ </div>
@endif
-
@else
<div class="mb-10 rounded alert alert-warning">
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 stroke-current shrink-0" fill="none"
diff --git a/resources/views/livewire/source/github/create.blade.php b/resources/views/livewire/source/github/create.blade.php
index c1127d1db1..4d267a2c25 100644
--- a/resources/views/livewire/source/github/create.blade.php
+++ b/resources/views/livewire/source/github/create.blade.php
@@ -14,8 +14,10 @@
<x-forms.input id="custom_user" label="Custom Git User" required />
<x-forms.input id="custom_port" label="Custom Git Port" required />
</div>
- <x-forms.checkbox class="pt-2" id="is_system_wide" label="System Wide" />
- <x-forms.button type="submit">
+ @if (!isCloud())
+ <x-forms.checkbox class="pt-2" id="is_system_wide" label="System Wide" />
+ @endif
+ <x-forms.button class="mt-4" type="submit">
Save New Source
</x-forms.button>
</form>
diff --git a/resources/views/source/new.blade.php b/resources/views/source/new.blade.php
index 508c0e71c4..d91b3a9de8 100644
--- a/resources/views/source/new.blade.php
+++ b/resources/views/source/new.blade.php
@@ -1,8 +1,8 @@
<x-layout>
<h1>New Source</h1>
<div class="subtitle ">Add source providers for your applications.</div>
- <div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : '' }">
- <div class="flex justify-center h-full gap-2 pb-6">
+ <div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'github' }">
+ {{-- <div class="flex justify-center h-full gap-2 pb-6">
<a class="flex items-center justify-center w-1/2 p-2 transition-colors rounded-none min-h-12 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white hover:no-underline"
:class="activeTab === 'github' && 'bg-coollabs text-white'"
@click.prevent="activeTab = 'github'; window.location.hash = 'github'" href="#">GitHub
@@ -11,12 +11,12 @@
:class="activeTab === 'gitlab' && 'bg-coollabs text-white'"
@click.prevent="activeTab = 'gitlab'; window.location.hash = 'gitlab'" href="#">GitLab
</a>
- </div>
+ </div> --}}
<div x-cloak x-show="activeTab === 'github'" class="h-full">
<livewire:source.github.create />
</div>
- <div x-cloak x-show="activeTab === 'gitlab'" class="h-full">
+ {{-- <div x-cloak x-show="activeTab === 'gitlab'" class="h-full">
WIP
- </div>
+ </div> --}}
</div>
</x-layout>