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
show public key of generated private key
Andras Bacsaic21ce45d705b
diff --git a/app/Actions/License/CheckResaleLicense.php b/app/Actions/License/CheckResaleLicense.phpindex e7dcecdb6e..54f97c8348 100644--- a/app/Actions/License/CheckResaleLicense.php+++ b/app/Actions/License/CheckResaleLicense.php@@ -14,14 +14,14 @@ class CheckResaleLicense$settings->update(['is_resale_license_active' => false,]);- if (is_dev()) {+ if (isDev()) {return;}if (!$settings->resale_license) {return;}$base_url = config('coolify.license_url');- if (is_dev()) {+ if (isDev()) {$base_url = 'http://host.docker.internal:8787';}$instance_id = config('app.id');diff --git a/app/Actions/Server/InstallDocker.php b/app/Actions/Server/InstallDocker.phpindex 732d58d521..a26fadc055 100644--- a/app/Actions/Server/InstallDocker.php+++ b/app/Actions/Server/InstallDocker.php@@ -12,7 +12,7 @@ class InstallDocker{$dockerVersion = '23.0';$config = base64_encode('{ "live-restore": true }');- if (is_dev()) {+ if (isDev()) {$activity = remote_process(["echo ####### Installing Prerequisites...","echo ####### Installing/updating Docker Engine...",diff --git a/app/Actions/Server/UpdateCoolify.php b/app/Actions/Server/UpdateCoolify.phpindex fa0718d175..0be05894f3 100644--- a/app/Actions/Server/UpdateCoolify.php+++ b/app/Actions/Server/UpdateCoolify.php@@ -50,7 +50,7 @@ class UpdateCoolifyprivate function update(){- if (is_dev()) {+ if (isDev()) {ray("Running update on local docker container. Updating to $this->latest_version");remote_process(["sleep 10"diff --git a/app/Console/Kernel.php b/app/Console/Kernel.phpindex 047f037d76..0dc99ba8ac 100644--- a/app/Console/Kernel.php+++ b/app/Console/Kernel.php@@ -18,7 +18,7 @@ class Kernel extends ConsoleKernelprotected function schedule(Schedule $schedule): void{// $schedule->call(fn() => $this->check_scheduled_backups($schedule))->everyTenSeconds();- if (is_dev()) {+ if (isDev()) {$schedule->command('horizon:snapshot')->everyMinute();$schedule->job(new ResourceStatusJob)->everyMinute();$schedule->job(new ProxyCheckJob)->everyFiveMinutes();diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.phpindex b08c070124..9d9dabab60 100644--- a/app/Exceptions/Handler.php+++ b/app/Exceptions/Handler.php@@ -45,7 +45,7 @@ class Handler extends ExceptionHandler{$this->reportable(function (Throwable $e) {$this->settings = InstanceSettings::get();- if ($this->settings->do_not_track || is_dev()) {+ if ($this->settings->do_not_track || isDev()) {return;}Integration::captureUnhandledException($e);diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.phpindex a194c3ad9b..4fd9970552 100644--- a/app/Http/Controllers/Controller.php+++ b/app/Http/Controllers/Controller.php@@ -66,7 +66,7 @@ class Controller extends BaseController]);}public function boarding() {- if (currentTeam()->boarding || is_dev()) {+ if (currentTeam()->boarding || isDev()) {return view('boarding');} else {return redirect()->route('dashboard');diff --git a/app/Http/Livewire/Boarding.php b/app/Http/Livewire/Boarding.phpindex 524e9ff94d..7ec11a3bc6 100644--- a/app/Http/Livewire/Boarding.php+++ b/app/Http/Livewire/Boarding.php@@ -14,6 +14,7 @@ class Boarding extends Componentpublic ?string $privateKeyType = null;public ?string $privateKey = null;+ public ?string $publicKey = null;public ?string $privateKeyName = null;public ?string $privateKeyDescription = null;public ?PrivateKey $createdPrivateKey = null;@@ -31,7 +32,7 @@ class Boarding extends Component{$this->privateKeyName = generate_random_name();$this->remoteServerName = generate_random_name();- if (is_dev()) {+ if (isDev()) {$this->privateKey = '-----BEGIN OPENSSH PRIVATE KEY-----b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZWQyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevAAAAJi/QySHv0Mk@@ -77,6 +78,9 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==public function setPrivateKey(string $type){$this->privateKeyType = $type;+ if ($type === 'create' && !isDev()) {+ $this->createNewPrivateKey();+ }$this->currentState = 'create-private-key';}public function savePrivateKey()@@ -95,9 +99,6 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA=='remoteServerPort' => 'required','remoteServerUser' => 'required',]);- if ($this->privateKeyType === 'create') {- $this->createNewPrivateKey();- }$this->privateKey = formatPrivateKey($this->privateKey);$this->createdPrivateKey = PrivateKey::create(['name' => $this->privateKeyName,@@ -175,6 +176,6 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA=={$this->privateKeyName = generate_random_name();$this->privateKeyDescription = 'Created by Coolify';- ['private' => $this->privateKey] = generateSSHKey();+ ['private' => $this->privateKey, 'public'=> $this->publicKey] = generateSSHKey();}}diff --git a/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php b/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.phpindex 82d898149c..d18fe2541d 100644--- a/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php+++ b/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php@@ -50,7 +50,7 @@ class GithubPrivateRepositoryDeployKey extends Componentpublic function mount(){- if (is_dev()) {+ if (isDev()) {$this->repository_url = 'https://github.com/coollabsio/coolify-examples';}$this->parameters = get_route_parameters();diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.phpindex 7fd15cd345..6229a7fc65 100644--- a/app/Http/Livewire/Project/New/PublicGitRepository.php+++ b/app/Http/Livewire/Project/New/PublicGitRepository.php@@ -45,7 +45,7 @@ class PublicGitRepository extends Componentpublic function mount(){- if (is_dev()) {+ if (isDev()) {$this->repository_url = 'https://github.com/coollabsio/coolify-examples';$this->port = 3000;}diff --git a/app/Http/Livewire/Project/New/SimpleDockerfile.php b/app/Http/Livewire/Project/New/SimpleDockerfile.phpindex 6c47316580..e755c8c0fe 100644--- a/app/Http/Livewire/Project/New/SimpleDockerfile.php+++ b/app/Http/Livewire/Project/New/SimpleDockerfile.php@@ -19,7 +19,7 @@ class SimpleDockerfile extends Component{$this->parameters = get_route_parameters();$this->query = request()->query();- if (is_dev()) {+ if (isDev()) {$this->dockerfile = 'FROM nginxEXPOSE 80CMD ["nginx", "-g", "daemon off;"]diff --git a/app/Http/Livewire/Team/InviteLink.php b/app/Http/Livewire/Team/InviteLink.phpindex aaf22f0e8b..b554e6575b 100644--- a/app/Http/Livewire/Team/InviteLink.php+++ b/app/Http/Livewire/Team/InviteLink.php@@ -15,7 +15,7 @@ class InviteLink extends Componentpublic function mount(){- $this->email = is_dev() ? '[email protected]' : '';+ $this->email = isDev() ? '[email protected]' : '';}public function viaEmail()diff --git a/app/Http/Livewire/Team/Storage/Create.php b/app/Http/Livewire/Team/Storage/Create.phpindex 52ce3779d5..e1330784ae 100644--- a/app/Http/Livewire/Team/Storage/Create.php+++ b/app/Http/Livewire/Team/Storage/Create.php@@ -36,7 +36,7 @@ class Create extends Componentpublic function mount(){- if (is_dev()) {+ if (isDev()) {$this->name = 'Local MinIO';$this->description = 'Local MinIO';$this->key = 'minioadmin';diff --git a/app/Http/Livewire/Upgrade.php b/app/Http/Livewire/Upgrade.phpindex f46e37ff73..e79c73fb7e 100644--- a/app/Http/Livewire/Upgrade.php+++ b/app/Http/Livewire/Upgrade.php@@ -18,7 +18,7 @@ class Upgrade extends Component$this->latestVersion = get_latest_version_of_coolify();$currentVersion = config('version');version_compare($currentVersion, $this->latestVersion, '<') ? $this->isUpgradeAvailable = true : $this->isUpgradeAvailable = false;- if (is_dev()) {+ if (isDev()) {$this->isUpgradeAvailable = true;}$settings = InstanceSettings::get();diff --git a/app/Http/Livewire/Waitlist.php b/app/Http/Livewire/Waitlist.phpindex de633ceacf..d9b3b92ab3 100644--- a/app/Http/Livewire/Waitlist.php+++ b/app/Http/Livewire/Waitlist.php@@ -17,7 +17,7 @@ class Waitlist extends Component];public function mount(){- if (is_dev()) {+ if (isDev()) {$this->email = '[email protected]';}}diff --git a/app/Jobs/DockerCleanupJob.php b/app/Jobs/DockerCleanupJob.phpindex df6e1915bc..7a8571c00a 100644--- a/app/Jobs/DockerCleanupJob.php+++ b/app/Jobs/DockerCleanupJob.php@@ -32,7 +32,7 @@ class DockerCleanupJob implements ShouldQueuetry {$servers = Server::all();foreach ($servers as $server) {- if (is_dev()) {+ if (isDev()) {$docker_root_filesystem = "/";} else {$docker_root_filesystem = instant_remote_process(['stat --printf=%m $(docker info --format "{{json .DockerRootDir}}" |sed \'s/"//g\')'], $server);diff --git a/bootstrap/helpers/proxy.php b/bootstrap/helpers/proxy.phpindex 37049aaa3d..164c46e94c 100644--- a/bootstrap/helpers/proxy.php+++ b/bootstrap/helpers/proxy.php@@ -82,7 +82,7 @@ function generate_default_proxy_configuration(Server $server)],],];- if (is_dev()) {+ if (isDev()) {$config['services']['traefik']['command'][] = "--log.level=debug";}return Yaml::dump($config, 4, 2);diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.phpindex 367d806df5..f1670723e5 100644--- a/bootstrap/helpers/shared.php+++ b/bootstrap/helpers/shared.php@@ -163,7 +163,7 @@ function set_transanctional_email_settings(InstanceSettings | null $settings = nfunction base_ip(): string{- if (is_dev()) {+ if (isDev()) {return "localhost";}$settings = InstanceSettings::get();@@ -188,12 +188,12 @@ function base_url(bool $withPort = true): string$port = config('app.port');if ($settings->public_ipv4) {if ($withPort) {- if (is_dev()) {+ if (isDev()) {return "http://localhost:$port";}return "http://$settings->public_ipv4:$port";}- if (is_dev()) {+ if (isDev()) {return "http://localhost";}return "http://$settings->public_ipv4";@@ -207,7 +207,7 @@ function base_url(bool $withPort = true): stringreturn url('/');}-function is_dev(): bool+function isDev(): bool{return config('app.env') === 'local';}diff --git a/resources/views/components/applications/links.blade.php b/resources/views/components/applications/links.blade.phpindex 9d0a75c707..9e90c9b2bc 100644--- a/resources/views/components/applications/links.blade.php+++ b/resources/views/components/applications/links.blade.php@@ -55,7 +55,7 @@@endif@if (data_get($application, 'ports_mappings_array'))@foreach ($application->ports_mappings_array as $port)- @if (is_dev())+ @if (isDev())<li><a class="text-xs text-white rounded-none hover:no-underline hover:bg-coollabs hover:text-white"target="_blank" href="http://localhost:{{ explode(':', $port)[0] }}">diff --git a/resources/views/components/paddle.blade.php b/resources/views/components/paddle.blade.phpindex 095487a6da..5aa10b2004 100644--- a/resources/views/components/paddle.blade.php+++ b/resources/views/components/paddle.blade.php@@ -28,7 +28,7 @@<x-slot:other><script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script><script type="text/javascript">- Paddle.Environment.set("{{ is_dev() ? 'sandbox' : 'production' }}");+ Paddle.Environment.set("{{ isDev() ? 'sandbox' : 'production' }}");Paddle.Setup({seller: {{ config('subscription.paddle_vendor_id') }},checkout: {diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.phpindex 6dab46114b..4e83f41b39 100644--- a/resources/views/dashboard.blade.php+++ b/resources/views/dashboard.blade.php@@ -22,7 +22,7 @@<div class="stat-value">{{ $s3s->count() }}</div></div></div>- @if (is_dev())+ @if (isDev()){{-- <livewire:dev.s3-test /> --}}@endif</x-layout>diff --git a/resources/views/livewire/boarding.blade.php b/resources/views/livewire/boarding.blade.phpindex 29a114318f..c6482cbeb9 100644--- a/resources/views/livewire/boarding.blade.php+++ b/resources/views/livewire/boarding.blade.php@@ -47,7 +47,8 @@<x-slot:explanation><p>SSH Keys are used to connect to a remote server through a secure shell, called SSH.</p><p>You can use your own ssh private key, or you can let Coolify to create one for you.</p>- <p>In both ways, you need to add the public version of your ssh private key to the remote server's+ <p>In both ways, you need to add the public version of your ssh private key to the remote+ server's<code class="text-warning">~/.ssh/authorized_keys</code> file.</p></x-slot:explanation>@@ -66,6 +67,10 @@label="Description" id="privateKeyDescription" /><x-forms.textarea required placeholder="-----BEGIN OPENSSH PRIVATE KEY-----"label="Private Key" id="privateKey" />+ @if ($privateKeyType === 'create' && !isDev())+ <span class="font-bold text-warning">Copy this to your server's ~/.ssh/authorized_keys file.</span>+ <x-forms.textarea rows="7" readonly label="Public Key" id="publicKey" />+ @endif<x-forms.button type="submit">Save</x-forms.button></form></x-slot:actions>@@ -115,7 +120,8 @@Could not find Docker Engine on your server. Do you want me to install it for you?</x-slot:question><x-slot:actions>- <div class="justify-center box" wire:click="installDocker" onclick="installDocker.showModal()">Let's do+ <div class="justify-center box" wire:click="installDocker" onclick="installDocker.showModal()">+ Let's doit!</div></x-slot:actions><x-slot:explanation>diff --git a/resources/views/livewire/notifications/discord-settings.blade.php b/resources/views/livewire/notifications/discord-settings.blade.phpindex a5f7caf02e..6fd5d8d31e 100644--- a/resources/views/livewire/notifications/discord-settings.blade.php+++ b/resources/views/livewire/notifications/discord-settings.blade.php@@ -22,7 +22,7 @@@if (data_get($model, 'discord_enabled'))<h3 class="mt-4">Subscribe to events</h3><div class="w-64">- @if (is_dev())+ @if (isDev())<x-forms.checkbox instantSave="saveModel" id="model.discord_notifications_test" label="Test" />@endif<h4 class="mt-4">General</h4>diff --git a/resources/views/livewire/notifications/email-settings.blade.php b/resources/views/livewire/notifications/email-settings.blade.phpindex 5631f3349b..2de6ec2230 100644--- a/resources/views/livewire/notifications/email-settings.blade.php+++ b/resources/views/livewire/notifications/email-settings.blade.php@@ -59,7 +59,7 @@@if (data_get($model, 'smtp_enabled'))<h4 class="mt-4">Subscribe to events</h4><div class="w-64">- @if (is_dev())+ @if (isDev())<x-forms.checkbox instantSave="saveModel" id="model.smtp_notifications_test" label="Test" />@endif<h4 class="mt-4">General</h4>diff --git a/resources/views/livewire/server/form.blade.php b/resources/views/livewire/server/form.blade.phpindex 3bd4a288bd..ae0ac48c7a 100644--- a/resources/views/livewire/server/form.blade.php+++ b/resources/views/livewire/server/form.blade.php@@ -93,7 +93,7 @@<div class="pb-4">This will remove this server from Coolify. Beware! There is no comingback!</div>- @if ($server->id !== 0 || is_dev())+ @if ($server->id !== 0 || isDev())<x-forms.button isError isModal modalId="deleteServer">Delete</x-forms.button>