Next channel updates
This commit is contained in:
		@@ -14,6 +14,7 @@ class UpdateCoolify
 | 
				
			|||||||
    public function __invoke(bool $force)
 | 
					    public function __invoke(bool $force)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
 | 
					            $settings = InstanceSettings::get();
 | 
				
			||||||
            ray('Running InstanceAutoUpdateJob');
 | 
					            ray('Running InstanceAutoUpdateJob');
 | 
				
			||||||
            $localhost_name = 'localhost';
 | 
					            $localhost_name = 'localhost';
 | 
				
			||||||
            if (isDev()) {
 | 
					            if (isDev()) {
 | 
				
			||||||
@@ -23,12 +24,15 @@ class UpdateCoolify
 | 
				
			|||||||
            $this->latest_version = get_latest_version_of_coolify();
 | 
					            $this->latest_version = get_latest_version_of_coolify();
 | 
				
			||||||
            $this->current_version = config('version');
 | 
					            $this->current_version = config('version');
 | 
				
			||||||
            ray('latest version:' . $this->latest_version . " current version: " .  $this->current_version . ' force: ' . $force);
 | 
					            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) {
 | 
					            if ($force) {
 | 
				
			||||||
                $this->update();
 | 
					                $this->update();
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                $instance_settings = InstanceSettings::get();
 | 
					                if (!$settings->is_auto_update_enabled) {
 | 
				
			||||||
                ray($instance_settings);
 | 
					 | 
				
			||||||
                if (!$instance_settings->is_auto_update_enabled) {
 | 
					 | 
				
			||||||
                    throw new \Exception('Auto update is disabled');
 | 
					                    throw new \Exception('Auto update is disabled');
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                if ($this->latest_version === $this->current_version) {
 | 
					                if ($this->latest_version === $this->current_version) {
 | 
				
			||||||
@@ -49,7 +53,7 @@ class UpdateCoolify
 | 
				
			|||||||
    private function update()
 | 
					    private function update()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (isDev()) {
 | 
					        if (isDev()) {
 | 
				
			||||||
            ray('Running update on local docker container');
 | 
					            ray("Running update on local docker container. Updating to $this->latest_version");
 | 
				
			||||||
            remote_process([
 | 
					            remote_process([
 | 
				
			||||||
                "sleep 10"
 | 
					                "sleep 10"
 | 
				
			||||||
            ], $this->server);
 | 
					            ], $this->server);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,9 +12,10 @@ use Symfony\Component\Yaml\Yaml;
 | 
				
			|||||||
class Configuration extends Component
 | 
					class Configuration extends Component
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public ModelsInstanceSettings $settings;
 | 
					    public ModelsInstanceSettings $settings;
 | 
				
			||||||
    public $do_not_track;
 | 
					    public bool $do_not_track;
 | 
				
			||||||
    public $is_auto_update_enabled;
 | 
					    public bool $is_auto_update_enabled;
 | 
				
			||||||
    public $is_registration_enabled;
 | 
					    public bool $is_registration_enabled;
 | 
				
			||||||
 | 
					    public bool $next_channel;
 | 
				
			||||||
    protected string $dynamic_config_path = '/data/coolify/proxy/dynamic';
 | 
					    protected string $dynamic_config_path = '/data/coolify/proxy/dynamic';
 | 
				
			||||||
    protected Server $server;
 | 
					    protected Server $server;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -32,16 +33,17 @@ class Configuration extends Component
 | 
				
			|||||||
    ];
 | 
					    ];
 | 
				
			||||||
    public function mount()
 | 
					    public function mount()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        ray($this->settings);
 | 
					 | 
				
			||||||
        $this->do_not_track = $this->settings->do_not_track;
 | 
					        $this->do_not_track = $this->settings->do_not_track;
 | 
				
			||||||
        $this->is_auto_update_enabled = $this->settings->is_auto_update_enabled;
 | 
					        $this->is_auto_update_enabled = $this->settings->is_auto_update_enabled;
 | 
				
			||||||
        $this->is_registration_enabled = $this->settings->is_registration_enabled;
 | 
					        $this->is_registration_enabled = $this->settings->is_registration_enabled;
 | 
				
			||||||
 | 
					        $this->next_channel = $this->settings->next_channel;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public function instantSave()
 | 
					    public function instantSave()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $this->settings->do_not_track = $this->do_not_track;
 | 
					        $this->settings->do_not_track = $this->do_not_track;
 | 
				
			||||||
        $this->settings->is_auto_update_enabled = $this->is_auto_update_enabled;
 | 
					        $this->settings->is_auto_update_enabled = $this->is_auto_update_enabled;
 | 
				
			||||||
        $this->settings->is_registration_enabled = $this->is_registration_enabled;
 | 
					        $this->settings->is_registration_enabled = $this->is_registration_enabled;
 | 
				
			||||||
 | 
					        $this->settings->next_channel = $this->next_channel;
 | 
				
			||||||
        $this->settings->save();
 | 
					        $this->settings->save();
 | 
				
			||||||
        $this->emit('success', 'Settings updated!');
 | 
					        $this->emit('success', 'Settings updated!');
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,3 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
return '4.0.0-beta.11';
 | 
					return '4.0.0-beta.12';
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,28 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use Illuminate\Database\Migrations\Migration;
 | 
				
			||||||
 | 
					use Illuminate\Database\Schema\Blueprint;
 | 
				
			||||||
 | 
					use Illuminate\Support\Facades\Schema;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					return new class extends Migration
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Run the migrations.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function up(): void
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        Schema::table('instance_settings', function (Blueprint $table) {
 | 
				
			||||||
 | 
					            $table->boolean('next_channel')->default(false);
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Reverse the migrations.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function down(): void
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        Schema::table('instance_settings', function (Blueprint $table) {
 | 
				
			||||||
 | 
					            $table->dropColumn('next_channel');
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
@@ -18,10 +18,11 @@
 | 
				
			|||||||
            </div> --}}
 | 
					            </div> --}}
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </form>
 | 
					    </form>
 | 
				
			||||||
 | 
					    <h2 class="pt-6">Advanced</h2>
 | 
				
			||||||
    <div class="flex flex-col py-6 text-right w-52">
 | 
					    <div class="flex flex-col w-64 py-6 text-right">
 | 
				
			||||||
        <x-forms.checkbox instantSave id="is_auto_update_enabled" label="Auto Update Coolify" />
 | 
					        <x-forms.checkbox instantSave id="is_auto_update_enabled" label="Auto Update Coolify" />
 | 
				
			||||||
        <x-forms.checkbox instantSave id="is_registration_enabled" label="Registration Allowed" />
 | 
					        <x-forms.checkbox instantSave id="is_registration_enabled" label="Registration Allowed" />
 | 
				
			||||||
        <x-forms.checkbox instantSave id="do_not_track" label="Do Not Track" />
 | 
					        <x-forms.checkbox instantSave id="do_not_track" label="Do Not Track" />
 | 
				
			||||||
 | 
					        <x-forms.checkbox instantSave id="next_channel" label="Enable beta (early) updates" />
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,7 @@
 | 
				
			|||||||
            "version": "3.12.32"
 | 
					            "version": "3.12.32"
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "v4": {
 | 
					        "v4": {
 | 
				
			||||||
            "version": "4.0.0-beta.11"
 | 
					            "version": "4.0.0-beta.12"
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user