From 41832dcb4f5f8942d1a74b0340a2aa97aa85ed45 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 23 Jun 2023 12:08:14 +0200 Subject: [PATCH 1/9] Testing dev build --- .env.development.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.development.example b/.env.development.example index e4508405b..e73b8c1dd 100644 --- a/.env.development.example +++ b/.env.development.example @@ -6,7 +6,7 @@ USERID= GROUPID= ############################################################################################################ - +APP_ID=development APP_ENV=local APP_KEY= APP_DEBUG=true From d74ba03cd926f5cfe2a7063adc25f86ac065d140 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 23 Jun 2023 13:05:23 +0200 Subject: [PATCH 2/9] remove unnecessary data from migration --- .../2023_03_20_112814_create_instance_settings_table.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/database/migrations/2023_03_20_112814_create_instance_settings_table.php b/database/migrations/2023_03_20_112814_create_instance_settings_table.php index a90c740fc..51b156ccb 100644 --- a/database/migrations/2023_03_20_112814_create_instance_settings_table.php +++ b/database/migrations/2023_03_20_112814_create_instance_settings_table.php @@ -24,8 +24,6 @@ return new class extends Migration $table->boolean('is_auto_update_enabled')->default(true); $table->boolean('is_registration_enabled')->default(true); $table->schemalessAttributes('smtp'); - // $table->string('custom_dns_servers')->default('1.1.1.1,8.8.8.8'); - // $table->boolean('is_dns_check_enabled')->default(true); $table->timestamps(); }); } From 1dc3c77bc9d184f0976c9f73618561f4d7cb0afe Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 23 Jun 2023 13:13:02 +0200 Subject: [PATCH 3/9] Next channel updates --- app/Actions/Server/UpdateCoolify.php | 12 +++++--- app/Http/Livewire/Settings/Configuration.php | 10 ++++--- config/version.php | 2 +- ...2023_06_23_110548_next_channel_updates.php | 28 +++++++++++++++++++ .../livewire/settings/configuration.blade.php | 5 ++-- versions.json | 2 +- 6 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 database/migrations/2023_06_23_110548_next_channel_updates.php diff --git a/app/Actions/Server/UpdateCoolify.php b/app/Actions/Server/UpdateCoolify.php index 7c1036b55..047a06e81 100644 --- a/app/Actions/Server/UpdateCoolify.php +++ b/app/Actions/Server/UpdateCoolify.php @@ -14,6 +14,7 @@ class UpdateCoolify public function __invoke(bool $force) { try { + $settings = InstanceSettings::get(); ray('Running InstanceAutoUpdateJob'); $localhost_name = 'localhost'; if (isDev()) { @@ -23,12 +24,15 @@ class UpdateCoolify $this->latest_version = get_latest_version_of_coolify(); $this->current_version = config('version'); ray('latest version:' . $this->latest_version . " current version: " . $this->current_version . ' force: ' . $force); + if ($settings->next_channel) { + ray('next channel enabled'); + $force = true; + $this->latest_version = 'next'; + } if ($force) { $this->update(); } else { - $instance_settings = InstanceSettings::get(); - ray($instance_settings); - if (!$instance_settings->is_auto_update_enabled) { + if (!$settings->is_auto_update_enabled) { throw new \Exception('Auto update is disabled'); } if ($this->latest_version === $this->current_version) { @@ -49,7 +53,7 @@ class UpdateCoolify private function update() { if (isDev()) { - ray('Running update on local docker container'); + ray("Running update on local docker container. Updating to $this->latest_version"); remote_process([ "sleep 10" ], $this->server); diff --git a/app/Http/Livewire/Settings/Configuration.php b/app/Http/Livewire/Settings/Configuration.php index 9e901519d..4746cf299 100644 --- a/app/Http/Livewire/Settings/Configuration.php +++ b/app/Http/Livewire/Settings/Configuration.php @@ -12,9 +12,10 @@ use Symfony\Component\Yaml\Yaml; class Configuration extends Component { public ModelsInstanceSettings $settings; - public $do_not_track; - public $is_auto_update_enabled; - public $is_registration_enabled; + public bool $do_not_track; + public bool $is_auto_update_enabled; + public bool $is_registration_enabled; + public bool $next_channel; protected string $dynamic_config_path = '/data/coolify/proxy/dynamic'; protected Server $server; @@ -32,16 +33,17 @@ class Configuration extends Component ]; public function mount() { - ray($this->settings); $this->do_not_track = $this->settings->do_not_track; $this->is_auto_update_enabled = $this->settings->is_auto_update_enabled; $this->is_registration_enabled = $this->settings->is_registration_enabled; + $this->next_channel = $this->settings->next_channel; } public function instantSave() { $this->settings->do_not_track = $this->do_not_track; $this->settings->is_auto_update_enabled = $this->is_auto_update_enabled; $this->settings->is_registration_enabled = $this->is_registration_enabled; + $this->settings->next_channel = $this->next_channel; $this->settings->save(); $this->emit('success', 'Settings updated!'); } diff --git a/config/version.php b/config/version.php index ad294318a..54ed072be 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ boolean('next_channel')->default(false); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('instance_settings', function (Blueprint $table) { + $table->dropColumn('next_channel'); + }); + } +}; diff --git a/resources/views/livewire/settings/configuration.blade.php b/resources/views/livewire/settings/configuration.blade.php index d17435699..32f05272a 100644 --- a/resources/views/livewire/settings/configuration.blade.php +++ b/resources/views/livewire/settings/configuration.blade.php @@ -18,10 +18,11 @@ --}} - -
+

Advanced

+
+
diff --git a/versions.json b/versions.json index 162dc9a54..c8927753c 100644 --- a/versions.json +++ b/versions.json @@ -4,7 +4,7 @@ "version": "3.12.32" }, "v4": { - "version": "4.0.0-beta.11" + "version": "4.0.0-beta.12" } } } \ No newline at end of file From bc89483d471e419448b788a7811575542181db29 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 23 Jun 2023 13:22:29 +0200 Subject: [PATCH 4/9] always show upgrade on next channel --- app/Http/Livewire/Upgrade.php | 5 +++++ scripts/install.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/app/Http/Livewire/Upgrade.php b/app/Http/Livewire/Upgrade.php index 8d3930bc4..f3bd8b1d3 100644 --- a/app/Http/Livewire/Upgrade.php +++ b/app/Http/Livewire/Upgrade.php @@ -3,6 +3,7 @@ namespace App\Http\Livewire; use App\Actions\Server\UpdateCoolify; +use App\Models\InstanceSettings; use Masmerise\Toaster\Toaster; use Livewire\Component; @@ -20,6 +21,10 @@ class Upgrade extends Component if (isDev()) { $this->isUpgradeAvailable = true; } + $settings = InstanceSettings::get(); + if ($settings->next_channel) { + $this->isUpgradeAvailable = true; + } } public function upgrade() { diff --git a/scripts/install.sh b/scripts/install.sh index 629a89cfa..72d788ee1 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -23,6 +23,11 @@ if [ $OS_TYPE != "ubuntu" ] && [ $OS_TYPE != "debian" ]; then exit fi +# Ovewrite LATEST_VERSION if user pass a version number +if [ "$1" != "" ]; then + LATEST_VERSION=$1 +fi + echo -e "-------------" echo -e "Welcome to Coolify v4 beta installer!" echo -e "This script will install everything for you." From 9c97690edd5bbafe22c899ec257324e52751bb29 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 23 Jun 2023 13:26:18 +0200 Subject: [PATCH 5/9] Helper to next channel --- resources/views/livewire/settings/configuration.blade.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/views/livewire/settings/configuration.blade.php b/resources/views/livewire/settings/configuration.blade.php index 32f05272a..eefc27c8f 100644 --- a/resources/views/livewire/settings/configuration.blade.php +++ b/resources/views/livewire/settings/configuration.blade.php @@ -23,6 +23,7 @@ - + From 78e78414794919eec669b07e5f25de960ffcb52f Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 23 Jun 2023 13:26:58 +0200 Subject: [PATCH 6/9] Fix latest version on next channel --- app/Http/Livewire/Upgrade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Http/Livewire/Upgrade.php b/app/Http/Livewire/Upgrade.php index f3bd8b1d3..5b6b5db3f 100644 --- a/app/Http/Livewire/Upgrade.php +++ b/app/Http/Livewire/Upgrade.php @@ -24,6 +24,7 @@ class Upgrade extends Component $settings = InstanceSettings::get(); if ($settings->next_channel) { $this->isUpgradeAvailable = true; + $this->latestVersion = 'next'; } } public function upgrade() From c43b4038206db08a087c05f42804ae259f48d928 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 23 Jun 2023 13:27:45 +0200 Subject: [PATCH 7/9] Fix css --- resources/views/livewire/settings/configuration.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/livewire/settings/configuration.blade.php b/resources/views/livewire/settings/configuration.blade.php index eefc27c8f..fa2736e1e 100644 --- a/resources/views/livewire/settings/configuration.blade.php +++ b/resources/views/livewire/settings/configuration.blade.php @@ -19,7 +19,7 @@

Advanced

-
+
From 2165528640b4fac61ae7977281fca879bee2324d Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 23 Jun 2023 13:44:04 +0200 Subject: [PATCH 8/9] fix env variable value length --- ..._23_114131_change_env_var_value_length.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 database/migrations/2023_06_23_114131_change_env_var_value_length.php diff --git a/database/migrations/2023_06_23_114131_change_env_var_value_length.php b/database/migrations/2023_06_23_114131_change_env_var_value_length.php new file mode 100644 index 000000000..ca8bd1e0c --- /dev/null +++ b/database/migrations/2023_06_23_114131_change_env_var_value_length.php @@ -0,0 +1,28 @@ +text('value')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('environment_variables', function (Blueprint $table) { + $table->string('value')->nullable()->change(); + }); + } +}; From a830e0f59cc3ae96f2730a9d2725c3f80e101db0 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 23 Jun 2023 13:44:27 +0200 Subject: [PATCH 9/9] version++ --- config/version.php | 2 +- versions.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/version.php b/config/version.php index 54ed072be..300506ef5 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@