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
fix
Andras Bacsaicbfc490d955f
diff --git a/app/Actions/Server/InstallDocker.php b/app/Actions/Server/InstallDocker.phpindex 77471c07ef..28c9e12267 100644--- a/app/Actions/Server/InstallDocker.php+++ b/app/Actions/Server/InstallDocker.php@@ -2,21 +2,28 @@namespace App\Actions\Server;-use App\Enums\ActivityTypes;use App\Models\Server;class InstallDocker{public function __invoke(Server $server){+ $dockerVersion = '23.0';$config = base64_encode('{ "live-restore": true }');$activity = remote_process([- "echo Installing Docker...",- "curl https://releases.rancher.com/install-docker/23.0.sh | sh",- "echo Configuring Docker...",- "echo '{$config}' | base64 -d > /etc/docker/daemon.json",- "echo Restarting Docker...",- "systemctl restart docker"+ "echo ####### Installing Prerequisites...",+ "command -v jq >/dev/null || apt-get update",+ "command -v jq >/dev/null || apt install -y jq",+ "echo ####### Installing/updating Docker Engine...",+ "curl https://releases.rancher.com/install-docker/{$dockerVersion}.sh | sh",+ "echo ####### Configuring Docker Engine (merging existing configuration with the required)...",+ "test -s /etc/docker/daemon.json && cp /etc/docker/daemon.json \"/etc/docker/daemon.json.original-`date +\"%Y%m%d-%H%M%S\"`\" || echo '{$config}' | base64 -d > /etc/docker/daemon.json",+ "echo '{$config}' | base64 -d > /etc/docker/daemon.json.coolify",+ "cat <<< $(jq . /etc/docker/daemon.json.coolify) > /etc/docker/daemon.json.coolify",+ "cat <<< $(jq -s '.[0] * .[1]' /etc/docker/daemon.json /etc/docker/daemon.json.coolify) > /etc/docker/daemon.json",+ "echo ####### Restarting Docker Engine...",+ "systemctl restart docker",+ "echo ####### Done!"], $server);return $activity;diff --git a/app/Http/Livewire/Server/Form.php b/app/Http/Livewire/Server/Form.phpindex 6680042a24..71e0ceafb5 100644--- a/app/Http/Livewire/Server/Form.php+++ b/app/Http/Livewire/Server/Form.php@@ -39,16 +39,15 @@ class Form extends Componentif (!$this->uptime) {$this->uptime = 'Server not reachable.';throw new \Exception('Server not reachable.');- } else {- if (!$this->server->settings->is_validated) {- $this->server->settings->is_validated = true;- $this->server->settings->save();- $this->emit('serverValidated');- }}$this->dockerVersion = instant_remote_process(['docker version|head -2|grep -i version'], $this->server, false);if (!$this->dockerVersion) {$this->dockerVersion = 'Not installed.';+ } else {+ $this->server->settings->is_docker_installed = true;+ $this->server->settings->is_validated = true;+ $this->server->settings->save();+ $this->emit('serverValidated');}$this->dockerComposeVersion = instant_remote_process(['docker compose version|head -2|grep -i version'], $this->server, false);if (!$this->dockerComposeVersion) {diff --git a/app/Jobs/CoolifyTask.php b/app/Jobs/CoolifyTask.phpindex 56914a2163..d87468efc9 100755--- a/app/Jobs/CoolifyTask.php+++ b/app/Jobs/CoolifyTask.php@@ -35,6 +35,5 @@ class CoolifyTask implements ShouldQueue]);$remote_process();- // @TODO: Remove file at $this->activity->getExtraProperty('private_key_location') after process is finished}}diff --git a/app/Models/LocalPersistentVolume.php b/app/Models/LocalPersistentVolume.phpindex a8bb991f1a..96b5509696 100644--- a/app/Models/LocalPersistentVolume.php+++ b/app/Models/LocalPersistentVolume.php@@ -3,9 +3,10 @@namespace App\Models;use Illuminate\Database\Eloquent\Casts\Attribute;+use Illuminate\Database\Eloquent\Model;use Illuminate\Support\Str;-class LocalPersistentVolume extends BaseModel+class LocalPersistentVolume extends Model{protected $fillable = ['name',diff --git a/app/Models/ServerSetting.php b/app/Models/ServerSetting.phpindex 43a4f2e642..02c8e183e3 100644--- a/app/Models/ServerSetting.php+++ b/app/Models/ServerSetting.php@@ -7,7 +7,8 @@ use Illuminate\Database\Eloquent\Model;class ServerSetting extends Model{protected $fillable = [- 'server_id'+ 'server_id',+ 'is_docker_installed',];public function server(){diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.phpindex c488fb4f3a..31ddf87205 100644--- a/database/factories/UserFactory.php+++ b/database/factories/UserFactory.php@@ -18,7 +18,6 @@ class UserFactory extends Factorypublic function definition(): array{return [- 'uuid' => Str::uuid(),'email' => fake()->unique()->safeEmail(),'email_verified_at' => now(),'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // passworddiff --git a/database/migrations/2023_03_24_140712_create_server_settings_table.php b/database/migrations/2023_03_24_140712_create_server_settings_table.phpindex 8b5f432fa8..bb5bcb2710 100644--- a/database/migrations/2023_03_24_140712_create_server_settings_table.php+++ b/database/migrations/2023_03_24_140712_create_server_settings_table.php@@ -17,6 +17,7 @@ return new class extends Migration$table->boolean('is_jump_server')->default(false);$table->boolean('is_build_server')->default(false);$table->boolean('is_validated')->default(false);+ $table->boolean('is_docker_installed')->default(false);$table->foreignId('server_id');$table->timestamps();});diff --git a/resources/views/errors/404.blade.php b/resources/views/errors/404.blade.phpindex 254df5756f..95db58ffcb 100644--- a/resources/views/errors/404.blade.php+++ b/resources/views/errors/404.blade.php@@ -1,16 +1,21 @@<x-layout>- <main class="grid min-h-full px-6 place-items-center lg:px-8">- <div class="text-center">- <p class="text-6xl font-semibold text-warning">404</p>- <h1 class="mt-4 text-3xl font-bold tracking-tight text-white sm:text-5xl">Page not found</h1>- <p class="mt-6 text-base leading-7 text-neutral-300">Sorry, we couldn’t find the page you’re looking for.</p>- <div class="flex items-center justify-center mt-10 gap-x-6">- <a href="/"- class="rounded-md bg-coollabs px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-coollabs-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 hover:no-underline">Go- back home</a>- <a href="https://docs.coollabs.io/contact.html" class="text-sm font-semibold text-white">Contact support- <span aria-hidden="true">→</span></a>+ <div class="min-h-screen hero">+ <div class="text-center hero-content">+ <div class="">+ <p class="font-mono text-6xl font-semibold text-warning">404</p>+ <h1 class="mt-4 font-bold tracking-tight text-white">How did you got here?</h1>+ <p class="mt-6 text-base leading-7 text-neutral-300">Sorry, we couldn’t find the page you’re looking for.+ </p>+ <div class="flex items-center justify-center mt-10 gap-x-6">+ <a href="/">+ <x-forms.button isHighlighted>Go back home</x-forms.button>+ </a>+ <a target="_blank" class="text-xs" href="https://docs.coollabs.io/contact.html">Contact+ support+ <x-external-link />+ </a>+ </div></div></div>- </main>+ </div></x-layout>diff --git a/resources/views/errors/419.blade.php b/resources/views/errors/419.blade.phpindex c09216e212..fce7c2a372 100644--- a/resources/views/errors/419.blade.php+++ b/resources/views/errors/419.blade.php@@ -1,5 +1,20 @@-@extends('errors::minimal')--@section('title', __('Page Expired'))-@section('code', '419')-@section('message', __('Page Expired'))+<x-layout>+ <div class="min-h-screen hero">+ <div class="text-center hero-content">+ <div class="">+ <p class="font-mono text-6xl font-semibold text-warning">419</p>+ <h1 class="mt-4 font-bold tracking-tight text-white">This page is definitely old</h1>+ <p class="mt-6 text-base leading-7 text-neutral-300">Sorry, we couldn’t find the page you’re looking for.+ </p>+ <div class="flex items-center justify-center mt-10 gap-x-6">+ <a href="/"+ class="rounded-md bg-coollabs px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-coollabs-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 hover:no-underline">Go+ back home</a>+ <a href="https://docs.coollabs.io/contact.html" class="text-sm font-semibold text-white">Contact+ support+ <span aria-hidden="true">→</span></a>+ </div>+ </div>+ </div>+ </div>+</x-layout>diff --git a/resources/views/livewire/server/form.blade.php b/resources/views/livewire/server/form.blade.phpindex aa0d24ce83..aa2c7ad0b8 100644--- a/resources/views/livewire/server/form.blade.php+++ b/resources/views/livewire/server/form.blade.php@@ -49,20 +49,30 @@<h3 class="pt-8 pb-4">Quick Actions</h3><div class="flex items-center gap-2"><x-forms.button wire:click.prevent='validateServer'>- Check Connection+ Check Server Details+ </x-forms.button>+ <x-forms.button wire:click.prevent='installDocker'>+ @if ($server->settings->is_docker_installed)+ Reconfigure Docker Engine+ @else+ Install Docker Engine+ @endif</x-forms.button>{{-- <x-forms.button wire:click.prevent='installDocker'>Install Docker</x-forms.button> --}}</div>@endif+ <div class="container w-full py-4 mx-auto">+ <livewire:activity-monitor :header="true" />+ </div>@isset($uptime)- <h3 class="py-3">Server Info</h3>+ <h3 class="pb-3">Server Info</h3><div class="text-sm"><p>Uptime: {{ $uptime }}</p>@isset($dockerVersion)<p>Docker Engine {{ $dockerVersion }}</p>@endisset@isset($dockerComposeVersion)- <p>{{ $dockerComposeVersion }}</p>+ <p>Compose: {{ $dockerComposeVersion }}</p>@endisset</div>@endissetdiff --git a/resources/views/livewire/server/proxy/status.blade.php b/resources/views/livewire/server/proxy/status.blade.phpindex e2a509ccb8..d72cdc92de 100644--- a/resources/views/livewire/server/proxy/status.blade.php+++ b/resources/views/livewire/server/proxy/status.blade.php@@ -1,6 +1,6 @@<div>@if ($server->settings->is_validated)- <div wire:poll.10000ms="proxyStatus">+ <div wire:poll.10000ms="proxyStatus" x-init="$wire.proxyStatus">@if ($server->extra_attributes->proxy_status === 'running')<x-status.running />@elseif ($server->extra_attributes->proxy_status === 'restarting')diff --git a/scripts/install-docker.sh b/scripts/install-docker.shdeleted file mode 100644index 292995fa1a..0000000000--- a/scripts/install-docker.sh+++ /dev/null@@ -1,5 +0,0 @@-#!/bin/bash-curl https://releases.rancher.com/install-docker/23.0.sh | sh-echo "Docker installed successfully"-echo '{ "live-restore": true }' >/etc/docker/daemon.json-systemctl restart docker