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')