diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.php index 0861c6bcc..09a187f6a 100644 --- a/app/Jobs/DatabaseBackupJob.php +++ b/app/Jobs/DatabaseBackupJob.php @@ -495,12 +495,7 @@ private function upload_to_s3(): void } else { $commands[] = "docker run -d --network {$network} --name backup-of-{$this->backup->uuid} --rm -v $this->backup_location:$this->backup_location:ro {$fullImageName}"; } - if ($this->s3->isHetzner()) { - $endpointWithoutBucket = 'https://'.str($endpoint)->after('https://')->after('.')->value(); - $commands[] = "docker exec backup-of-{$this->backup->uuid} mc alias set --path=off --api=S3v4 temporary {$endpointWithoutBucket} $key $secret"; - } else { - $commands[] = "docker exec backup-of-{$this->backup->uuid} mc config host add temporary {$endpoint} $key $secret"; - } + $commands[] = "docker exec backup-of-{$this->backup->uuid} mc config host add temporary {$endpoint} $key $secret"; $commands[] = "docker exec backup-of-{$this->backup->uuid} mc cp $this->backup_location temporary/$bucket{$this->backup_dir}/"; instant_remote_process($commands, $this->server); diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.php index ca57a8e95..08fff38c6 100644 --- a/app/Livewire/Project/Application/General.php +++ b/app/Livewire/Project/Application/General.php @@ -187,6 +187,9 @@ public function instantSave() }); } } + if ($this->application->settings->is_container_label_readonly_enabled) { + $this->resetDefaultLabels(false); + } } public function loadComposeFile($isInit = false) diff --git a/app/Livewire/Server/ConfigureCloudflareTunnels.php b/app/Livewire/Server/ConfigureCloudflareTunnels.php index f58d7b6be..f27614aa4 100644 --- a/app/Livewire/Server/ConfigureCloudflareTunnels.php +++ b/app/Livewire/Server/ConfigureCloudflareTunnels.php @@ -41,7 +41,7 @@ public function submit() $server->ip = $this->ssh_domain; $server->save(); $server->settings->save(); - $this->dispatch('warning', 'Cloudflare Tunnels configuration started.'); + $this->dispatch('info', 'Cloudflare Tunnels configuration started.'); } catch (\Throwable $e) { return handleError($e, $this); } diff --git a/app/Livewire/Storage/Create.php b/app/Livewire/Storage/Create.php index c5250e1e3..1d60d6ac5 100644 --- a/app/Livewire/Storage/Create.php +++ b/app/Livewire/Storage/Create.php @@ -3,6 +3,7 @@ namespace App\Livewire\Storage; use App\Models\S3Storage; +use Illuminate\Support\Uri; use Livewire\Component; class Create extends Component @@ -45,15 +46,24 @@ class Create extends Component public function updatedEndpoint($value) { - if (! str($value)->startsWith('https://') && ! str($value)->startsWith('http://')) { - $this->endpoint = 'https://'.$value; - $value = $this->endpoint; - } + try { + if (empty($value)) { + return; + } + if (str($value)->contains('digitaloceanspaces.com')) { + $uri = Uri::of($value); + $host = $uri->host(); - if (str($value)->contains('your-objectstorage.com') && ! isset($this->bucket)) { - $this->bucket = str($value)->after('//')->before('.'); - } elseif (str($value)->contains('your-objectstorage.com')) { - $this->bucket = $this->bucket ?: str($value)->after('//')->before('.'); + if (preg_match('/^(.+)\.([^.]+\.digitaloceanspaces\.com)$/', $host, $matches)) { + $host = $matches[2]; + $value = "https://{$host}"; + } + } + } finally { + if (! str($value)->startsWith('https://') && ! str($value)->startsWith('http://')) { + $value = 'https://'.$value; + } + $this->endpoint = $value; } } diff --git a/app/Models/S3Storage.php b/app/Models/S3Storage.php index f1247e6f7..33f4fa37c 100644 --- a/app/Models/S3Storage.php +++ b/app/Models/S3Storage.php @@ -40,16 +40,6 @@ public function awsUrl() return "{$this->endpoint}/{$this->bucket}"; } - public function isHetzner() - { - return str($this->endpoint)->contains('your-objectstorage.com'); - } - - public function isDigitalOcean() - { - return str($this->endpoint)->contains('digitaloceanspaces.com'); - } - public function testConnection(bool $shouldSave = false) { try { diff --git a/bootstrap/helpers/databases.php b/bootstrap/helpers/databases.php index ee65a902f..f2c069ac4 100644 --- a/bootstrap/helpers/databases.php +++ b/bootstrap/helpers/databases.php @@ -208,7 +208,6 @@ function deleteBackupsS3(string|array|null $filenames, S3Storage $s3): void 'bucket' => $s3->bucket, 'endpoint' => $s3->endpoint, 'use_path_style_endpoint' => true, - 'bucket_endpoint' => $s3->isHetzner() || $s3->isDigitalOcean(), 'aws_url' => $s3->awsUrl(), ]); diff --git a/bootstrap/helpers/s3.php b/bootstrap/helpers/s3.php index 2ee7bf44a..7029377a4 100644 --- a/bootstrap/helpers/s3.php +++ b/bootstrap/helpers/s3.php @@ -4,8 +4,6 @@ function set_s3_target(S3Storage $s3) { - $is_digital_ocean = false; - config()->set('filesystems.disks.custom-s3', [ 'driver' => 's3', 'region' => $s3['region'], @@ -14,7 +12,6 @@ function set_s3_target(S3Storage $s3) 'bucket' => $s3['bucket'], 'endpoint' => $s3['endpoint'], 'use_path_style_endpoint' => true, - 'bucket_endpoint' => $s3->isHetzner() || $s3->isDigitalOcean(), 'aws_url' => $s3->awsUrl(), ]); } diff --git a/config/constants.php b/config/constants.php index da7bdc65e..739a616ae 100644 --- a/config/constants.php +++ b/config/constants.php @@ -2,7 +2,7 @@ return [ 'coolify' => [ - 'version' => '4.0.0-beta.389', + 'version' => '4.0.0-beta.390', 'helper_version' => '1.0.6', 'realtime_version' => '1.0.5', 'self_hosted' => env('SELF_HOSTED', true), diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php index 026b3b579..0a981f3a9 100644 --- a/resources/views/livewire/project/application/general.blade.php +++ b/resources/views/livewire/project/application/general.blade.php @@ -71,27 +71,50 @@ @endif @if ($application->build_pack !== 'dockercompose')
- - - Generate Domain - + @if ($application->settings->is_container_label_readonly_enabled == false) + + @else + + Generate Domain + + @endif
- - - - - - - -
Set Direction
-
-
+ @if ($application->settings->is_container_label_readonly_enabled == false) + @if ($application->redirect === 'both') + + @elseif ($application->redirect === 'www') + + @elseif ($application->redirect === 'non-www') + + @endif + @else + + + + + + @if ($application->settings->is_container_label_readonly_enabled) + + +
Set Direction
+
+
+ @endif + @endif
@endif @@ -285,7 +308,7 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry" helper="By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$.

If you want to use env variables inside the labels, turn this off." id="application.settings.is_container_label_escape_enabled" instantSave> {{-- --}} @endif @@ -299,9 +322,15 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry" @if ($application->settings->is_static || $application->build_pack === 'static') @else - + @if ($application->settings->is_container_label_readonly_enabled === false) + + @else + + @endif @endif @if (!$application->destination->server->isSwarm()) - @if (!str($database->status)->startsWith('exited')) - - - - - - - - - Restart - - - - - destination->server->isFunctional()) +
+ @if (!str($database->status)->startsWith('exited')) + + + + + + + + + Restart + + + + + + + + + + + + Stop + + + @else + - @endif - @script - - @endscript -
+ Start + + @endif + @script + + @endscript + + @else +
Underlying server is not functional.
+ @endif diff --git a/resources/views/livewire/upgrade.blade.php b/resources/views/livewire/upgrade.blade.php index 6e71ebbc0..1187642ea 100644 --- a/resources/views/livewire/upgrade.blade.php +++ b/resources/views/livewire/upgrade.blade.php @@ -116,7 +116,7 @@ class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">Cancel }, 5000) } else { this.currentStatus = - "Waiting for Coolify to come back from dead..." + "Waiting for Coolify to come back from the dead..." } }) }, 2000); diff --git a/versions.json b/versions.json index fa38cf43c..141624819 100644 --- a/versions.json +++ b/versions.json @@ -1,10 +1,10 @@ { "coolify": { "v4": { - "version": "4.0.0-beta.389" + "version": "4.0.0-beta.390" }, "nightly": { - "version": "4.0.0-beta.390" + "version": "4.0.0-beta.391" }, "helper": { "version": "1.0.6" diff --git a/vite.config.js b/vite.config.js index 8b3841550..fc739c95d 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,37 +1,41 @@ -import { defineConfig } from "vite"; +import { defineConfig, loadEnv } from "vite"; import laravel from "laravel-vite-plugin"; import vue from "@vitejs/plugin-vue"; -export default defineConfig({ - server: { - watch: { - ignored: [ - "**/dev_*_data/**", - "**/storage/**", - ], - }, - host: "0.0.0.0", - hmr: { - host: process.env.VITE_HOST, - }, - }, - plugins: [ - laravel({ - input: ["resources/css/app.css", "resources/js/app.js"], - refresh: true, - }), - vue({ - template: { - transformAssetUrls: { - base: null, - includeAbsolute: false, - }, +export default defineConfig(({ mode }) => { + const env = loadEnv(mode, process.cwd(), '') + + return { + server: { + watch: { + ignored: [ + "**/dev_*_data/**", + "**/storage/**", + ], + }, + host: "0.0.0.0", + hmr: { + host: env.VITE_HOST || '0.0.0.0' }, - }), - ], - resolve: { - alias: { - vue: "vue/dist/vue.esm-bundler.js", }, - }, + plugins: [ + laravel({ + input: ["resources/css/app.css", "resources/js/app.js"], + refresh: true, + }), + vue({ + template: { + transformAssetUrls: { + base: null, + includeAbsolute: false, + }, + }, + }), + ], + resolve: { + alias: { + vue: "vue/dist/vue.esm-bundler.js", + }, + }, + } });