From 3575972c43b286250d7785864c7e33682b475e90 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 May 2023 22:06:08 +0200 Subject: [PATCH] fixes --- app/Actions/Proxy/CheckProxySettingsInSync.php | 4 ++-- app/Http/Livewire/Server/Proxy.php | 2 +- app/Jobs/DeployApplicationJob.php | 5 ++++- resources/views/livewire/server/proxy.blade.php | 3 +++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/Actions/Proxy/CheckProxySettingsInSync.php b/app/Actions/Proxy/CheckProxySettingsInSync.php index 0ffbff74b..e4d565bc1 100644 --- a/app/Actions/Proxy/CheckProxySettingsInSync.php +++ b/app/Actions/Proxy/CheckProxySettingsInSync.php @@ -8,13 +8,13 @@ use Illuminate\Support\Str; class CheckProxySettingsInSync { - public function __invoke(Server $server) + public function __invoke(Server $server, bool $reset = false) { $proxy_path = config('coolify.proxy_config_path'); $output = instantRemoteProcess([ "cat $proxy_path/docker-compose.yml", ], $server, false); - if (is_null($output)) { + if (is_null($output) || $reset) { $final_output = Str::of(getProxyConfiguration($server))->trim()->value; } else { $final_output = Str::of($output)->trim()->value; diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.php index 94b331495..22d4e8496 100644 --- a/app/Http/Livewire/Server/Proxy.php +++ b/app/Http/Livewire/Server/Proxy.php @@ -65,7 +65,7 @@ class Proxy extends Component public function checkProxySettingsInSync() { try { - $this->proxy_settings = resolve(CheckProxySettingsInSync::class)($this->server); + $this->proxy_settings = resolve(CheckProxySettingsInSync::class)($this->server, true); } catch (\Exception $e) { return generalErrorHandler($e); } diff --git a/app/Jobs/DeployApplicationJob.php b/app/Jobs/DeployApplicationJob.php index 31159d2df..71c965fac 100644 --- a/app/Jobs/DeployApplicationJob.php +++ b/app/Jobs/DeployApplicationJob.php @@ -17,6 +17,7 @@ use Illuminate\Support\Facades\Storage; use Spatie\Activitylog\Models\Activity; use Symfony\Component\Yaml\Yaml; use Illuminate\Support\Str; +use Spatie\Url\Url; class DeployApplicationJob implements ShouldQueue { @@ -376,8 +377,10 @@ COPY --from={$this->application->uuid}:{$this->git_commit}-build /app/{$this->ap $labels[] = 'coolify.type=application'; $labels[] = 'coolify.name=' . $this->application->name; if ($this->application->fqdn) { + $url = Url::fromString($this->application->fqdn); + $host = $url->getHost(); $labels[] = 'traefik.enable=true'; - $labels[] = "traefik.http.routers.container.rule=Host(`{$this->application->fqdn}`)"; + $labels[] = "traefik.http.routers.container.rule=Host(`{$host}`)"; } return $labels; } diff --git a/resources/views/livewire/server/proxy.blade.php b/resources/views/livewire/server/proxy.blade.php index 3487b57e4..2ce8d85b8 100644 --- a/resources/views/livewire/server/proxy.blade.php +++ b/resources/views/livewire/server/proxy.blade.php @@ -41,6 +41,9 @@ wire:click.prevent="installProxy"> Apply + + Default + @endisset