From 752ae4a110b090e73647a5508bc4a7af68415665 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Tue, 5 Nov 2024 13:23:03 +0000 Subject: [PATCH 1/4] add feedback on docker version check failure --- .../server/validate-and-install.blade.php | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/resources/views/livewire/server/validate-and-install.blade.php b/resources/views/livewire/server/validate-and-install.blade.php index fc499f98fc..0acc7972e2 100644 --- a/resources/views/livewire/server/validate-and-install.blade.php +++ b/resources/views/livewire/server/validate-and-install.blade.php @@ -86,16 +86,24 @@ @isset($docker_version) + @if($docker_version)
Minimum Docker version: + + + + +
+ @else +
Minimum Docker version: - - - - +
+ @endif @else
@endisset From 3fe636aab69946fafeefa9343acef3c8ef59f7a1 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Thu, 7 Nov 2024 21:50:53 +0000 Subject: [PATCH 2/4] update docker minimum version to 26 --- app/Livewire/Server/ValidateAndInstall.php | 2 +- bootstrap/helpers/docker.php | 3 ++- resources/views/livewire/boarding/index.blade.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Livewire/Server/ValidateAndInstall.php b/app/Livewire/Server/ValidateAndInstall.php index 8c5bc23ed4..700c317812 100644 --- a/app/Livewire/Server/ValidateAndInstall.php +++ b/app/Livewire/Server/ValidateAndInstall.php @@ -159,7 +159,7 @@ public function validateDockerVersion() $this->dispatch('refreshBoardingIndex'); $this->dispatch('success', 'Server validated.'); } else { - $this->error = 'Docker Engine version is not 22+. Please install Docker manually before continuing: documentation.'; + $this->error = 'Docker Engine version is not 25+. Please install Docker manually before continuing: documentation.'; $this->server->update([ 'validation_logs' => $this->error, ]); diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.php index 2e583b94d9..cd87fdb394 100644 --- a/bootstrap/helpers/docker.php +++ b/bootstrap/helpers/docker.php @@ -109,7 +109,8 @@ function format_docker_envs_to_json($rawOutput) function checkMinimumDockerEngineVersion($dockerVersion) { $majorDockerVersion = str($dockerVersion)->before('.')->value(); - if ($majorDockerVersion <= 22) { + $requiredDockerVersion = str(config('constants.docker_install_version'))->before('.')->value(); + if ($majorDockerVersion <= $requiredDockerVersion) { $dockerVersion = null; } diff --git a/resources/views/livewire/boarding/index.blade.php b/resources/views/livewire/boarding/index.blade.php index 5c5dc09a05..7095d6149d 100644 --- a/resources/views/livewire/boarding/index.blade.php +++ b/resources/views/livewire/boarding/index.blade.php @@ -323,7 +323,7 @@ class="text-left text-sm text-gray-600 dark:text-gray-300 hover:underline">

This will install the latest Docker Engine on your server, configure a few things to be able - to run optimal.

Minimum Docker Engine version is: 22

To manually install + to run optimal.

Minimum Docker Engine version is: 26

To manually install Docker Engine, check this From 770163d54cdfab6eaedf398d243bb23acdb562c4 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Sun, 10 Nov 2024 21:28:12 +0000 Subject: [PATCH 3/4] using docker version constant as user feedback --- app/Livewire/Boarding/Index.php | 4 ++++ app/Livewire/Server/ValidateAndInstall.php | 3 ++- resources/views/livewire/boarding/index.blade.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Livewire/Boarding/Index.php b/app/Livewire/Boarding/Index.php index c9c3092b32..3d18ee5ebc 100644 --- a/app/Livewire/Boarding/Index.php +++ b/app/Livewire/Boarding/Index.php @@ -66,11 +66,15 @@ class Index extends Component public bool $serverReachable = true; + public ?string $minDockerVersion = null; + public function mount() { if (auth()->user()?->isMember() && auth()->user()->currentTeam()->show_boarding === true) { return redirect()->route('dashboard'); } + + $this->minDockerVersion = str(config('constants.docker_install_version'))->before('.'); $this->privateKeyName = generate_random_name(); $this->remoteServerName = generate_random_name(); if (isDev()) { diff --git a/app/Livewire/Server/ValidateAndInstall.php b/app/Livewire/Server/ValidateAndInstall.php index 700c317812..eed368973d 100644 --- a/app/Livewire/Server/ValidateAndInstall.php +++ b/app/Livewire/Server/ValidateAndInstall.php @@ -159,7 +159,8 @@ public function validateDockerVersion() $this->dispatch('refreshBoardingIndex'); $this->dispatch('success', 'Server validated.'); } else { - $this->error = 'Docker Engine version is not 25+. Please install Docker manually before continuing: documentation.'; + $requiredDockerVersion = str(config('constants.docker_install_version'))->before('.'); + $this->error = 'Minimum Docker Engine version '.$requiredDockerVersion.' is not instaled. Please install Docker manually before continuing: documentation.'; $this->server->update([ 'validation_logs' => $this->error, ]); diff --git a/resources/views/livewire/boarding/index.blade.php b/resources/views/livewire/boarding/index.blade.php index 7095d6149d..f0f52aa8b9 100644 --- a/resources/views/livewire/boarding/index.blade.php +++ b/resources/views/livewire/boarding/index.blade.php @@ -323,7 +323,7 @@ class="text-left text-sm text-gray-600 dark:text-gray-300 hover:underline">

This will install the latest Docker Engine on your server, configure a few things to be able - to run optimal.

Minimum Docker Engine version is: 26

To manually install + to run optimal.

Minimum Docker Engine version is: {{ $minDockerVersion }}

To manually install Docker Engine, check this From ee2b95733b4354e0e24955dee03430f2179b7042 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Sun, 10 Nov 2024 22:08:48 +0000 Subject: [PATCH 4/4] validating minimum docker version with less that --- bootstrap/helpers/docker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.php index cd87fdb394..ec6be72114 100644 --- a/bootstrap/helpers/docker.php +++ b/bootstrap/helpers/docker.php @@ -110,7 +110,7 @@ function checkMinimumDockerEngineVersion($dockerVersion) { $majorDockerVersion = str($dockerVersion)->before('.')->value(); $requiredDockerVersion = str(config('constants.docker_install_version'))->before('.')->value(); - if ($majorDockerVersion <= $requiredDockerVersion) { + if ($majorDockerVersion < $requiredDockerVersion) { $dockerVersion = null; }