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 Bacsai2c3ddfd36328
diff --git a/app/Actions/Server/UpdateCoolify.php b/app/Actions/Server/UpdateCoolify.phpindex 1234dd2311..7c1036b55e 100644--- a/app/Actions/Server/UpdateCoolify.php+++ b/app/Actions/Server/UpdateCoolify.php@@ -16,7 +16,7 @@ class UpdateCoolifytry {ray('Running InstanceAutoUpdateJob');$localhost_name = 'localhost';- if (config('app.env') === 'local') {+ if (isDev()) {$localhost_name = 'testing-local-docker-container';}$this->server = Server::where('name', $localhost_name)->firstOrFail();@@ -48,7 +48,7 @@ class UpdateCoolify}private function update(){- if (config('app.env') === 'local') {+ if (isDev()) {ray('Running update on local docker container');remote_process(["sleep 10"diff --git a/app/Console/Kernel.php b/app/Console/Kernel.phpindex 095a4c42cc..d8d5dabd52 100644--- a/app/Console/Kernel.php+++ b/app/Console/Kernel.php@@ -12,7 +12,7 @@ class Kernel extends ConsoleKernel{protected function schedule(Schedule $schedule): void{- if (config('app.env') === 'local') {+ if (isDev()) {$schedule->command('horizon:snapshot')->everyMinute();// $schedule->job(new InstanceDockerCleanupJob)->everyMinute();// $schedule->job(new InstanceAutoUpdateJob(true))->everyMinute();diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.phpindex 72fe1db9f0..3fc20bd25b 100644--- a/app/Exceptions/Handler.php+++ b/app/Exceptions/Handler.php@@ -47,7 +47,7 @@ class Handler extends ExceptionHandler{$this->reportable(function (Throwable $e) {$this->settings = InstanceSettings::get();- if ($this->settings->do_not_track || config('app.env') === 'local') {+ if ($this->settings->do_not_track || isDev()) {return;}Integration::captureUnhandledException($e);diff --git a/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php b/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.phpindex 3fd4b6f0bb..428d6d9816 100644--- a/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php+++ b/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php@@ -50,7 +50,7 @@ class GithubPrivateRepositoryDeployKey extends Component];public function mount(){- if (config('app.env') === 'local') {+ if (isDev()) {$this->repository_url = 'https://github.com/coollabsio/coolify-examples';}$this->parameters = getRouteParameters();diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.phpindex 6f97bc10f8..07c7392010 100644--- a/app/Http/Livewire/Project/New/PublicGitRepository.php+++ b/app/Http/Livewire/Project/New/PublicGitRepository.php@@ -39,7 +39,7 @@ class PublicGitRepository extends Component];public function mount(){- if (config('app.env') === 'local') {+ if (isDev()) {$this->repository_url = 'https://github.com/coollabsio/coolify-examples';$this->port = 3000;}diff --git a/app/Http/Livewire/Team/InviteLink.php b/app/Http/Livewire/Team/InviteLink.phpindex c57ed4b81d..e80e5338bd 100644--- a/app/Http/Livewire/Team/InviteLink.php+++ b/app/Http/Livewire/Team/InviteLink.php@@ -14,7 +14,7 @@ class InviteLink extends Componentpublic string $role = 'member';public function mount(){- $this->email = config('app.env') === 'local' ? '[email protected]' : '';+ $this->email = isDev() ? '[email protected]' : '';}public function viaEmail(){diff --git a/app/Http/Livewire/Upgrade.php b/app/Http/Livewire/Upgrade.phpindex 2c57b3ff4c..bd9cf43d18 100644--- a/app/Http/Livewire/Upgrade.php+++ b/app/Http/Livewire/Upgrade.php@@ -16,7 +16,7 @@ class Upgrade extends Component$latestVersion = get_latest_version_of_coolify();$currentVersion = config('version');version_compare($currentVersion, $latestVersion, '<') ? $this->isUpgradeAvailable = true : $this->isUpgradeAvailable = false;- if (config('app.env') === 'local') {+ if (isDev()) {$this->isUpgradeAvailable = true;}}diff --git a/bootstrap/helpers/proxy.php b/bootstrap/helpers/proxy.phpindex 788d854552..f9fc68d3f5 100644--- a/bootstrap/helpers/proxy.php+++ b/bootstrap/helpers/proxy.php@@ -7,7 +7,7 @@ if (!function_exists('getProxyConfiguration')) {function getProxyConfiguration(Server $server){$proxy_path = config('coolify.proxy_config_path');- if (config('app.env') === 'local') {+ if (isDev()) {$proxy_path = $proxy_path . '/testing-host-1/';}$networks = collect($server->standaloneDockers)->map(function ($docker) {@@ -77,7 +77,7 @@ if (!function_exists('getProxyConfiguration')) {],],];- if (config('app.env') === 'local') {+ 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 d23e66d110..b4b6ce0aff 100644--- a/bootstrap/helpers/shared.php+++ b/bootstrap/helpers/shared.php@@ -82,7 +82,7 @@ function set_transanctional_email_settings()]);}-function base_url()+function base_url(bool $withPort = true){$settings = InstanceSettings::get();if ($settings->fqdn) {@@ -90,10 +90,27 @@ function base_url()}$port = config('app.port');if ($settings->public_ipv4) {- return "http://{$settings->public_ipv4}:{$port}";+ if ($withPort) {+ if (isDev()) {+ return "http://localhost:{$port}";+ }+ return "http://{$settings->public_ipv4}:{$port}";+ }+ if (isDev()) {+ return "http://localhost";+ }+ return "http://{$settings->public_ipv4}";}if ($settings->public_ipv6) {- return "http://{$settings->public_ipv6}:{$port}";+ if ($withPort) {+ return "http://{$settings->public_ipv6}:{$port}";+ }+ return "http://{$settings->public_ipv6}";}return url('/');}++function isDev()+{+ return config('app.env') === 'local';+}diff --git a/config/version.php b/config/version.phpindex 7f44e7615a..1e9458f22b 100644--- a/config/version.php+++ b/config/version.php@@ -1,3 +1,3 @@<?php-return '4.0.0-nightly.15';+return '4.0.0-nightly.16';diff --git a/resources/views/components/applications/navbar.blade.php b/resources/views/components/applications/navbar.blade.phpindex 1f71f9df1f..63599a2a1a 100644--- a/resources/views/components/applications/navbar.blade.php+++ b/resources/views/components/applications/navbar.blade.php@@ -48,7 +48,7 @@@endif@if (data_get($application, 'ports_mappings_array'))@foreach ($application->ports_mappings_array as $port)- @if (config('app.env') === 'local')+ @if (isDev())<li><a class="text-xs text-white rounded-none hover:no-underline hover:bg-coollabs"target="_blank" href="http://localhost:{{ explode(':', $port)[0] }}">diff --git a/resources/views/livewire/destination/show.blade.php b/resources/views/livewire/destination/show.blade.phpindex f3bd74f0c4..7c03313ac4 100644--- a/resources/views/livewire/destination/show.blade.php+++ b/resources/views/livewire/destination/show.blade.php@@ -14,7 +14,7 @@<button class="text-white btn-link">{{ data_get($docker, 'network') }} </button></a>@empty- <div class="text-sm">No destinations added</div>+ <div class="text-sm">N\A</div>@endforelse</div><div class="grid gap-2 pt-2">diff --git a/resources/views/livewire/server/form.blade.php b/resources/views/livewire/server/form.blade.phpindex 497dc568ee..9e09038578 100644--- a/resources/views/livewire/server/form.blade.php+++ b/resources/views/livewire/server/form.blade.php@@ -4,7 +4,7 @@<div class="flex gap-2"><h2>General</h2><x-forms.button type="submit">Save</x-forms.button>- @if ($server->id !== 0 || config('app.env') === 'local')+ @if ($server->id !== 0 || isDev())<x-forms.button x-on:click.prevent="deleteServer = true">Delete</x-forms.button>diff --git a/resources/views/livewire/server/proxy/deploy.blade.php b/resources/views/livewire/server/proxy/deploy.blade.phpindex 7d07e317f9..7ca4ce54e0 100644--- a/resources/views/livewire/server/proxy/deploy.blade.php+++ b/resources/views/livewire/server/proxy/deploy.blade.php@@ -12,7 +12,7 @@<li><a target="_blank"class="text-xs text-white rounded-none hover:no-underline hover:bg-coollabs"- href="http://{{ request()->getHost() }}:8080">+ href="{{ base_url(withPort: false) }}:8080">Traefik Dashboard<x-external-link /></a>