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
updates
Andras Bacsaie4704fb7e64d
diff --git a/app/Http/Livewire/Destination/New/StandaloneDocker.php b/app/Http/Livewire/Destination/New/StandaloneDocker.phpindex d9d5565101..efe68e241e 100644--- a/app/Http/Livewire/Destination/New/StandaloneDocker.php+++ b/app/Http/Livewire/Destination/New/StandaloneDocker.php@@ -38,24 +38,29 @@ class StandaloneDocker extends Componentpublic function submit(){+$this->validate();- $found = ModelsStandaloneDocker::where('server_id', $this->server_id)->where('network', $this->network)->first();- if ($found) {- $this->addError('network', 'Network already added to this server.');- return;- }- $server = Server::find($this->server_id);- instant_remote_process(['docker network create --attachable ' . $this->network], $server, throwError: false);- instant_remote_process(["docker network connect $this->network coolify-proxy"], $server, throwError: false);+ try {+ $found = ModelsStandaloneDocker::where('server_id', $this->server_id)->where('network', $this->network)->first();+ if ($found) {+ $this->addError('network', 'Network already added to this server.');+ return;+ }+ $server = Server::find($this->server_id);- $docker = ModelsStandaloneDocker::create([- 'name' => $this->name,- 'network' => $this->network,- 'server_id' => $this->server_id,- 'team_id' => session('currentTeam')->id- ]);+ instant_remote_process(['docker network create --attachable ' . $this->network], $server);+ instant_remote_process(["docker network connect $this->network coolify-proxy"], $server);- return redirect()->route('destination.show', $docker->uuid);+ $docker = ModelsStandaloneDocker::create([+ 'name' => $this->name,+ 'network' => $this->network,+ 'server_id' => $this->server_id,+ 'team_id' => session('currentTeam')->id+ ]);+ return redirect()->route('destination.show', $docker->uuid);+ } catch (\Exception $e) {+ return general_error_handler(err: $e);+ }}}diff --git a/app/Models/Server.php b/app/Models/Server.phpindex bde034a86a..ac9e1c30ca 100644--- a/app/Models/Server.php+++ b/app/Models/Server.php@@ -33,7 +33,12 @@ class Server extends BaseModel{return $this->extra_attributes->modelScope();}-+ public function destinations()+ {+ $standalone_docker = $this->hasMany(StandaloneDocker::class)->get();+ $swarm_docker = $this->hasMany(SwarmDocker::class)->get();+ return $standalone_docker->concat($swarm_docker);+ }public function standaloneDockers(){return $this->hasMany(StandaloneDocker::class);diff --git a/resources/css/app.css b/resources/css/app.cssindex e6639945bc..e26a62460d 100644--- a/resources/css/app.css+++ b/resources/css/app.css@@ -38,7 +38,7 @@ textarea {@apply textarea placeholder:text-neutral-700 text-white rounded scrollbar;}select {- @apply select select-sm text-sm disabled:bg-coolgray-200 border-none disabled:opacity-50 font-normal placeholder:text-neutral-700 text-white rounded;+ @apply h-7 select select-sm text-sm disabled:bg-coolgray-200 border-none disabled:opacity-50 font-normal placeholder:text-neutral-700 text-white rounded;}.loading {@apply w-4 text-warning;@@ -67,7 +67,7 @@ a {}.main-navbar {- @apply fixed h-full overflow-hidden pt-14;+ @apply fixed h-full overflow-hidden pt-16;}.kbd-custom {@apply px-2 text-xs border border-dashed rounded border-neutral-700 text-warning;diff --git a/resources/js/components/MagicBar.vue b/resources/js/components/MagicBar.vueindex 1821dd4b72..b7b5594df8 100644--- a/resources/js/components/MagicBar.vue+++ b/resources/js/components/MagicBar.vue@@ -1,7 +1,7 @@<template><Transition name="fade"><div>- <div class="flex items-center p-1 px-2 overflow-hidden transition-all transform rounded cursor-pointer bg-coolgray-200"+ <div class="flex items-center p-1 px-2 mt-2 overflow-hidden transition-all transform rounded cursor-pointer bg-coolgray-200"@click="showCommandPalette = true"><svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 icon" viewBox="0 0 24 24" stroke-width="2"stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">@@ -319,36 +319,42 @@ const magicActions = [{},{id: 12,- name: 'Goto: Settings',+ name: 'Goto: Destinations',icon: 'goto',sequence: ['main', 'redirect']},{id: 13,- name: 'Goto: Command Center',+ name: 'Goto: Settings',icon: 'goto',sequence: ['main', 'redirect']},{id: 14,- name: 'Goto: Notifications',+ name: 'Goto: Command Center',icon: 'goto',sequence: ['main', 'redirect']},{id: 15,- name: 'Goto: Profile',+ name: 'Goto: Notifications',icon: 'goto',sequence: ['main', 'redirect']},{id: 16,- name: 'Goto: Teams',+ name: 'Goto: Profile',icon: 'goto',sequence: ['main', 'redirect']},{id: 17,+ name: 'Goto: Teams',+ icon: 'goto',+ sequence: ['main', 'redirect']+},+{+ id: 18,name: 'Goto: Switch Teams',icon: 'goto',sequence: ['main', 'redirect']@@ -545,23 +551,26 @@ async function redirect() {targetUrl.pathname = `/sources`break;case 12:- targetUrl.pathname = `/settings`+ targetUrl.pathname = `/destinations`break;case 13:- targetUrl.pathname = `/command-center`+ targetUrl.pathname = `/settings`break;case 14:- targetUrl.pathname = `/profile/team/notifications`+ targetUrl.pathname = `/command-center`break;case 15:- targetUrl.pathname = `/profile`+ targetUrl.pathname = `/profile/team/notifications`break;case 16:- targetUrl.pathname = `/profile/team`+ targetUrl.pathname = `/profile`break;case 17:targetUrl.pathname = `/profile/team`break;+ case 18:+ targetUrl.pathname = `/profile/team`+ break;}window.location.href = targetUrl;}diff --git a/resources/views/components/forms/select.blade.php b/resources/views/components/forms/select.blade.phpindex 324b7e0389..f19845fdac 100644--- a/resources/views/components/forms/select.blade.php+++ b/resources/views/components/forms/select.blade.php@@ -32,7 +32,7 @@</span></label>@endif- <select class="select-xs h-7" {{ $attributes }}+ <select {{ $attributes }}@if ($id) name={{ $id }} wire:model.defer={{ $id }} @endif>{{ $slot }}</select>diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.phpindex c5a7b6760c..f392d5256f 100644--- a/resources/views/components/navbar.blade.php+++ b/resources/views/components/navbar.blade.php@@ -70,7 +70,7 @@@endif</ul></nav>- <div class="fixed top-0 right-0 p-2">+ <div class="fixed right-0 p-2 top-1"><div class="group"><label tabindex="0"class="absolute top-0 right-0 p-2 m-2 cursor-pointer hover:bg-transparent hover:text-warning">diff --git a/resources/views/destination/all.blade.php b/resources/views/destination/all.blade.phpnew file mode 100644index 0000000000..11e1735081--- /dev/null+++ b/resources/views/destination/all.blade.php@@ -0,0 +1,30 @@+<x-layout>+ <h1>Destinations</h1>+ <div class="pt-2 pb-10 text-sm">All Destinations</div>+ <div class="grid grid-cols-2 gap-2">+ @forelse ($destinations as $destination)+ @if ($destination->getMorphClass() === 'App\Models\StandaloneDocker')+ <a class="flex gap-4 text-center hover:no-underline box group"+ href="{{ route('destination.show', ['destination_uuid' => data_get($destination, 'uuid')]) }}">+ <div class="group-hover:text-white">+ <div>{{ $destination->name }}</div>+ </div>+ </a>+ @endif+ @if ($destination->getMorphClass() === 'App\Models\SwarmDocker')+ <a class="flex gap-4 text-center hover:no-underline box group"+ href="{{ route('destination.show', ['destination_uuid' => data_get($destination, 'uuid')]) }}">++ <div class="group-hover:text-white">+ <div>{{ $destination->name }}</div>+ </div>+ </a>+ @endif+ @empty+ <div>+ <div>No destinations found.</div>+ <x-use-magic-bar />+ </div>+ @endforelse+ </div>+</x-layout>diff --git a/resources/views/destination/show.blade.php b/resources/views/destination/show.blade.phpindex 7430b8e8b1..ce87114a32 100644--- a/resources/views/destination/show.blade.php+++ b/resources/views/destination/show.blade.php@@ -1,4 +1,3 @@<x-layout>- <h1>Destination</h1><livewire:destination.form :destination="$destination" /></x-layout>diff --git a/resources/views/livewire/activity-monitor.blade.php b/resources/views/livewire/activity-monitor.blade.phpindex f900a4ae27..1a13db61ae 100644--- a/resources/views/livewire/activity-monitor.blade.php+++ b/resources/views/livewire/activity-monitor.blade.php@@ -2,7 +2,7 @@@if ($this->activity)@if ($header)<div class="flex gap-2 pb-2">- <h2>Logs</h2>+ <h3>Logs</h3>@if ($isPollingActive)<x-loading />@endifdiff --git a/resources/views/livewire/destination/form.blade.php b/resources/views/livewire/destination/form.blade.phpindex e94b935ecb..120ec75532 100644--- a/resources/views/livewire/destination/form.blade.php+++ b/resources/views/livewire/destination/form.blade.php@@ -1,18 +1,27 @@<div x-data="{ deleteDestination: false }"><x-naked-modal show="deleteDestination" message='Are you sure you would like to delete this destination?' />- <form class="flex flex-col gap-4" wire:submit.prevent='submit'>- <x-forms.input id="destination.name" label="Name" />- <x-forms.input id="destination.server.ip" label="Server IP" readonly />- @if ($destination->getMorphClass() === 'App\Models\StandaloneDocker')- <x-forms.input id="destination.network" label="Docker Network" readonly />- @endif- <div>- <x-forms.button type="submit">+ <form class="flex flex-col">+ <div class="flex items-center gap-2">+ <h1>Destination</h1>+ <x-forms.button wire:click.prevent='submit' type="submit">Save</x-forms.button><x-forms.button x-on:click.prevent="deleteDestination = true">Delete</x-forms.button></div>++ @if ($destination->getMorphClass() === 'App\Models\StandaloneDocker')+ <div class="pt-2 pb-10 text-sm">Your standalone docker network.</div>+ @else+ <div class="pt-2 pb-10 text-sm">Your swarm docker network.</div>+ @endif+ <div class="flex gap-2">+ <x-forms.input id="destination.name" label="Name" />+ <x-forms.input id="destination.server.ip" label="Server IP" readonly />+ @if ($destination->getMorphClass() === 'App\Models\StandaloneDocker')+ <x-forms.input id="destination.network" label="Docker Network" readonly />+ @endif+ </div></form></div>diff --git a/resources/views/livewire/server/new/by-ip.blade.php b/resources/views/livewire/server/new/by-ip.blade.phpindex 5c19ae8861..04623b8a0f 100644--- a/resources/views/livewire/server/new/by-ip.blade.php+++ b/resources/views/livewire/server/new/by-ip.blade.php@@ -25,7 +25,7 @@<x-forms.checkbox class="pb-8" disabled instantSave noDirty id="is_part_of_swarm"label="Is it part of a Swarm cluster?" /><x-forms.button type="submit">- Save Server+ Save New Server</x-forms.button></form></div>diff --git a/resources/views/livewire/server/proxy.blade.php b/resources/views/livewire/server/proxy.blade.phpindex c64d4a5ede..c634d9088d 100644--- a/resources/views/livewire/server/proxy.blade.php+++ b/resources/views/livewire/server/proxy.blade.php@@ -7,6 +7,7 @@<div wire:loading wire:target="checkProxySettingsInSync"><x-loading /></div>+@isset($proxy_settings)@if ($selectedProxy->value === 'TRAEFIK_V2')<form wire:submit.prevent='saveConfiguration({{ $server }})'>@@ -25,6 +26,9 @@<div class="text-sm text-red-500">Configuration out of sync. Restart to get the new configs.</div>@endif+ <div class="container w-full py-4 mx-auto">+ <livewire:activity-monitor :header="true" />+ </div><div class="flex flex-col gap-2"><x-forms.textarea label="Configuration file: traefik.conf" class="text-xs" noDirtyname="proxy_settings" wire:model.defer="proxy_settings" rows="30" />@@ -54,9 +58,6 @@</div></div>@endif- <div class="container w-full pt-4 mx-auto">- <livewire:activity-monitor :header="true" />- </div>@else<div class="text-sm">Server is not validated. Validate first.</div>@endifdiff --git a/resources/views/livewire/server/proxy/deploy.blade.php b/resources/views/livewire/server/proxy/deploy.blade.phpindex 16720ea1db..d4783ec20b 100644--- a/resources/views/livewire/server/proxy/deploy.blade.php+++ b/resources/views/livewire/server/proxy/deploy.blade.php@@ -56,12 +56,13 @@</div></div>@else- <x-forms.button wire:click='deploy'> <svg xmlns="http://www.w3.org/2000/svg" class="icon" width="44"- height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"- stroke-linecap="round" stroke-linejoin="round">+ <button wire:click='deploy' class="flex items-center gap-2 text-sm cursor-pointer hover:text-white"> <svg+ xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 24 24" stroke-width="1.5"+ stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none" /><path d="M7 4v16l13 -8z" />- </svg>Start Proxy</x-forms.button>+ </svg>Start Proxy+ </button>@endif@endif</div>diff --git a/resources/views/livewire/source/github/create.blade.php b/resources/views/livewire/source/github/create.blade.phpindex f54825f792..c1127d1db1 100644--- a/resources/views/livewire/source/github/create.blade.php+++ b/resources/views/livewire/source/github/create.blade.php@@ -15,8 +15,8 @@<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 isHighlighted type="submit">- Create New Source+ <x-forms.button type="submit">+ Save New Source</x-forms.button></form></div>diff --git a/resources/views/source/gitlab/show.blade.php b/resources/views/source/gitlab/show.blade.phpindex a80bb1938b..51f1937b62 100644--- a/resources/views/source/gitlab/show.blade.php+++ b/resources/views/source/gitlab/show.blade.php@@ -1,3 +1,3 @@<x-layout>- GitLab WIP+ WIP</x-layout>diff --git a/routes/web.php b/routes/web.phpindex 9ea0a9f5dd..e52d18eb8b 100644--- a/routes/web.php+++ b/routes/web.php@@ -126,6 +126,16 @@ Route::middleware(['auth'])->group(function () {});Route::middleware(['auth'])->group(function () {+ Route::get('/destinations', function () {+ $servers = Server::all();+ $destinations = collect([]);+ foreach ($servers as $server) {+ $destinations = $destinations->merge($server->destinations());+ }+ return view('destination.all', [+ 'destinations' => $destinations,+ ]);+ })->name('destination.all');Route::get('/destination/new', function () {$servers = Server::validated()->get();$pre_selected_server_uuid = data_get(request()->query(), 'server');