From 833a4b93674323a8930bd7e981ab42c6fe8e4ef5 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 27 Mar 2024 18:41:19 +0100 Subject: [PATCH 1/4] Update dynamic configuration setup and version number --- app/Console/Commands/Init.php | 12 +++++++----- config/sentry.php | 2 +- config/version.php | 2 +- versions.json | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Console/Commands/Init.php b/app/Console/Commands/Init.php index 66a4f1aff..acdff5b35 100644 --- a/app/Console/Commands/Init.php +++ b/app/Console/Commands/Init.php @@ -34,11 +34,13 @@ public function handle() $this->cleanup_stucked_helper_containers(); $this->call('cleanup:queue'); $this->call('cleanup:stucked-resources'); - try { - $server = Server::find(0)->first(); - $server->setupDynamicProxyConfiguration(); - } catch (\Throwable $e) { - echo "Could not setup dynamic configuration: {$e->getMessage()}\n"; + if (!isCloud()) { + try { + $server = Server::find(0)->first(); + $server->setupDynamicProxyConfiguration(); + } catch (\Throwable $e) { + echo "Could not setup dynamic configuration: {$e->getMessage()}\n"; + } } $settings = InstanceSettings::get(); diff --git a/config/sentry.php b/config/sentry.php index 0958a5e3c..89345d082 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.247', + 'release' => '4.0.0-beta.248', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index c5f90b65a..642ee812d 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ Date: Wed, 27 Mar 2024 18:54:42 +0100 Subject: [PATCH 2/4] fix: ui for cftunnels --- resources/views/livewire/server/form.blade.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/views/livewire/server/form.blade.php b/resources/views/livewire/server/form.blade.php index 0265a1098..7f4a12272 100644 --- a/resources/views/livewire/server/form.blade.php +++ b/resources/views/livewire/server/form.blade.php @@ -81,8 +81,7 @@ class="w-full mt-8 mb-4 font-bold box-without-bg bg-coollabs hover:bg-coollabs-1 helper="If you are using Cloudflare Tunnels, enable this. It will proxy all SSH requests to your server through Cloudflare.
Coolify does not install or set up Cloudflare (cloudflared) on your server." /> {{-- @if ($server->settings->is_cloudflare_tunnel) --}} - + {{-- @endif --}} {{-- @@ -112,8 +111,13 @@ class="w-full mt-8 mb-4 font-bold box-without-bg bg-coollabs hover:bg-coollabs-1 @endif @endif @else - +
+

Cloudflare Tunnels +

+ +
+ @endif From c0a4a5c2f527a94e9f6579858431822a3c954248 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 27 Mar 2024 21:09:42 +0100 Subject: [PATCH 3/4] Add SSH domain field and save server IP in ConfigureCloudflareTunnels.php --- .../Server/ConfigureCloudflareTunnels.php | 3 +++ .../configure-cloudflare-tunnels.blade.php | 6 +++--- .../views/livewire/server/form.blade.php | 21 ++++++++++++------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/app/Livewire/Server/ConfigureCloudflareTunnels.php b/app/Livewire/Server/ConfigureCloudflareTunnels.php index 7a07a4d04..03a48c3e1 100644 --- a/app/Livewire/Server/ConfigureCloudflareTunnels.php +++ b/app/Livewire/Server/ConfigureCloudflareTunnels.php @@ -10,6 +10,7 @@ class ConfigureCloudflareTunnels extends Component { public $server_id; public string $cloudflare_token; + public string $ssh_domain; public function alreadyConfigured() { try { @@ -28,6 +29,8 @@ public function submit() $server = Server::ownedByCurrentTeam()->where('id', $this->server_id)->firstOrFail(); ConfigureCloudflared::run($server, $this->cloudflare_token); $server->settings->is_cloudflare_tunnel = true; + $server->ip = $this->ssh_domain; + $server->save(); $server->settings->save(); $this->dispatch('success', 'Cloudflare Tunnels configured successfully.'); $this->dispatch('serverInstalled'); diff --git a/resources/views/livewire/server/configure-cloudflare-tunnels.blade.php b/resources/views/livewire/server/configure-cloudflare-tunnels.blade.php index 92811b929..4f8ebc741 100644 --- a/resources/views/livewire/server/configure-cloudflare-tunnels.blade.php +++ b/resources/views/livewire/server/configure-cloudflare-tunnels.blade.php @@ -1,9 +1,9 @@
- Configure + helper="The SSH Domain you configured in Cloudflare" /> + Configure

Or

- I already configured the tunnel + I already configured the tunnel manually on the server diff --git a/resources/views/livewire/server/form.blade.php b/resources/views/livewire/server/form.blade.php index 7f4a12272..48c00d6f9 100644 --- a/resources/views/livewire/server/form.blade.php +++ b/resources/views/livewire/server/form.blade.php @@ -80,12 +80,13 @@ class="w-full mt-8 mb-4 font-bold box-without-bg bg-coollabs hover:bg-coollabs-1 - {{-- @if ($server->settings->is_cloudflare_tunnel) --}} - - {{-- @endif --}} - {{-- - - --}} + @if ($server->settings->is_cloudflare_tunnel) + + @else + + + + @endif

Swarm (experimental)

Read the docs here. @@ -117,7 +118,13 @@ class="w-full mt-8 mb-4 font-bold box-without-bg bg-coollabs hover:bg-coollabs-1
- + @if ($server->settings->is_cloudflare_tunnel) + + @else + + + + @endif @endif From 9cd15645a260bb893465fb363fd55b835212fa94 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 27 Mar 2024 21:11:28 +0100 Subject: [PATCH 4/4] Update Cloudflare tunnel configuration form --- .../livewire/server/configure-cloudflare-tunnels.blade.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/views/livewire/server/configure-cloudflare-tunnels.blade.php b/resources/views/livewire/server/configure-cloudflare-tunnels.blade.php index 4f8ebc741..4aaf9203f 100644 --- a/resources/views/livewire/server/configure-cloudflare-tunnels.blade.php +++ b/resources/views/livewire/server/configure-cloudflare-tunnels.blade.php @@ -2,8 +2,7 @@ - Configure + Automated Configuration (experimental)

Or

- I already configured the tunnel - manually on the server + I have already set up the tunnel manually on the server.