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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
feat: delete gh app
Andras Bacsaidb92dc3636c3
diff --git a/app/Http/Livewire/Source/Github/Change.php b/app/Http/Livewire/Source/Github/Change.phpindex 430ea99992..f7267d80b3 100644--- a/app/Http/Livewire/Source/Github/Change.php+++ b/app/Http/Livewire/Source/Github/Change.php@@ -58,46 +58,13 @@ class Change extends Component$this->parameters = getParameters();$this->is_system_wide = $this->github_app->is_system_wide;}- public function createGithubApp()+ public function delete(){- $settings = InstanceSettings::first();- $fqdn = $settings->fqdn;- if (!$fqdn) {- $fqdn = $this->host;- }- if ($this->github_app->organization) {- $url = 'organizations/' . $this->github_app->organization . '/settings/apps/new';- } else {- $url = 'settings/apps/new';+ try {+ $this->github_app->delete();+ redirect()->route('dashboard');+ } catch (\Exception $e) {+ return generalErrorHandlerLivewire($e, $this);}- $name = Str::kebab('coolify' . $this->github_app->name);- $data = [- "name" => $name,- "url" => $fqdn,- "hook_attributes" => [- "url" => "$fqdn/webhooks/github/events"- ],- "redirect_url" => "$fqdn/webhooks/github",- "callback_url" => [- "$fqdn/login/github/app",- ],- "public" => false,- "request_oauth_on_install" => false,- "setup_url" => "$fqdn/webhooks/github/install?source_id=" . $this->github_app->uuid,- "setup_on_update" => true,- "default_permissions" => [- "contents" => 'read',- "metadata" => 'read',- "pull_requests" => 'read',- "emails" => 'read'- ],- "default_events" => ['pull_request', 'push']- ];- $response = Http::asForm()->post("{$this->github_app->html_url}/{$url}?state={$this->github_app->uuid}", [- 'id' => 'manifest',- 'name' => 'manifest',- 'data' => json_encode($data),- ]);- dd($response);}}diff --git a/resources/views/livewire/destination/form.blade.php b/resources/views/livewire/destination/form.blade.phpindex 0dbf68aa0f..57f1faddef 100644--- a/resources/views/livewire/destination/form.blade.php+++ b/resources/views/livewire/destination/form.blade.php@@ -10,7 +10,7 @@<x-inputs.button>Submit</x-inputs.button>- <x-inputs.button isWarning x-on:click="deleteDestination = true">+ <x-inputs.button isWarning x-on:click.prevent="deleteDestination = true">Delete</x-inputs.button></div>diff --git a/resources/views/livewire/private-key/change.blade.php b/resources/views/livewire/private-key/change.blade.phpindex cec141247a..931a82c865 100644--- a/resources/views/livewire/private-key/change.blade.php+++ b/resources/views/livewire/private-key/change.blade.php@@ -7,7 +7,7 @@<x-inputs.button type="submit">Submit</x-inputs.button>- <x-inputs.button isWarning x-on:click="deletePrivateKey = true">+ <x-inputs.button isWarning x-on:click.prevent="deletePrivateKey = true">Delete</x-inputs.button></form>diff --git a/resources/views/livewire/project/application/deploy.blade.php b/resources/views/livewire/project/application/deploy.blade.phpindex 03be4d2dbe..fcb0ca71bf 100644--- a/resources/views/livewire/project/application/deploy.blade.php+++ b/resources/views/livewire/project/application/deploy.blade.php@@ -8,7 +8,7 @@<x-inputs.button wire:click='start'>Start</x-inputs.button><x-inputs.button wire:click='forceRebuild'>Start (no cache)</x-inputs.button>@endif- <x-inputs.button isWarning x-on:click="deleteApplication = true">+ <x-inputs.button isWarning x-on:click.prevent="deleteApplication = true">Delete</x-inputs.button><span wire:poll.5000ms='pollingStatus'>@if ($application->status === 'running')diff --git a/resources/views/livewire/project/application/environment-variable/show.blade.php b/resources/views/livewire/project/application/environment-variable/show.blade.phpindex 6e38b98816..7d5f9b9718 100644--- a/resources/views/livewire/project/application/environment-variable/show.blade.php+++ b/resources/views/livewire/project/application/environment-variable/show.blade.php@@ -10,7 +10,7 @@<x-inputs.button type="submit">Update</x-inputs.button>- <x-inputs.button x-on:click="deleteEnvironment = true" isWarning>+ <x-inputs.button x-on:click.prevent="deleteEnvironment = true" isWarning>Delete</x-inputs.button></form>diff --git a/resources/views/livewire/project/application/storages/show.blade.php b/resources/views/livewire/project/application/storages/show.blade.phpindex 1f234e3305..fa2138f94b 100644--- a/resources/views/livewire/project/application/storages/show.blade.php+++ b/resources/views/livewire/project/application/storages/show.blade.php@@ -7,7 +7,7 @@<x-inputs.button type="submit">Update</x-inputs.button>- <x-inputs.button x-on:click="deleteStorage = true" isWarning>+ <x-inputs.button x-on:click.prevent="deleteStorage = true" isWarning>Delete</x-inputs.button></form>diff --git a/resources/views/livewire/server/form.blade.php b/resources/views/livewire/server/form.blade.phpindex a48159a4b4..ddf6b5564a 100644--- a/resources/views/livewire/server/form.blade.php+++ b/resources/views/livewire/server/form.blade.php@@ -22,7 +22,7 @@<x-inputs.button type="submit">Submit</x-inputs.button><x-inputs.button wire:click.prevent='checkServer'>Check Server</x-inputs.button><x-inputs.button wire:click.prevent='installDocker'>Install Docker</x-inputs.button>- <x-inputs.button isWarning x-on:click="deleteServer = true">+ <x-inputs.button isWarning x-on:click.prevent="deleteServer = true">Delete</x-inputs.button></div>diff --git a/resources/views/livewire/source/github/change.blade.php b/resources/views/livewire/source/github/change.blade.phpindex 652efd8f38..3e73a115b2 100644--- a/resources/views/livewire/source/github/change.blade.php+++ b/resources/views/livewire/source/github/change.blade.php@@ -1,4 +1,5 @@-<div>+<div x-data="{ deleteSource: false }">+ <x-naked-modal show="deleteSource" message='Are you sure you would like to delete this source?' /><h3>Change Github App</h3><form wire:submit.prevent='submit'><x-inputs.input id="github_app.name" label="App Name" required />@@ -23,6 +24,9 @@@else<div class="py-2"><x-inputs.button type="submit">Save</x-inputs.button>+ <x-inputs.button isWarning x-on:click.prevent="deleteSource = true">+ Delete+ </x-inputs.button></div>@endif</form>