diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.php index 3fdbea216..a859b3510 100644 --- a/app/Jobs/DatabaseBackupJob.php +++ b/app/Jobs/DatabaseBackupJob.php @@ -18,6 +18,7 @@ use Illuminate\Queue\Middleware\WithoutOverlapping; use Illuminate\Queue\SerializesModels; use Throwable; +use Illuminate\Support\Str; class DatabaseBackupJob implements ShouldQueue { @@ -68,11 +69,13 @@ public function handle(): void return; } $this->container_name = $this->database->uuid; + $this->backup_dir = backup_dir() . "/" . $this->container_name; + if ($this->database->name === 'coolify-db') { $this->container_name = "coolify-db"; + $ip = Str::slug($this->server->ip); + $this->backup_dir = backup_dir() . "/coolify-db-$ip"; } - - $this->backup_dir = backup_dir() . "/" . $this->container_name; $this->backup_file = "/dumpall-" . Carbon::now()->timestamp . ".sql"; $this->backup_location = $this->backup_dir . $this->backup_file; @@ -95,6 +98,7 @@ public function handle(): void private function backup_standalone_postgresql(): void { try { + ray($this->backup_dir); $commands[] = "mkdir -p " . $this->backup_dir; $commands[] = "docker exec $this->container_name pg_dumpall -U {$this->database->postgres_user} > $this->backup_location"; diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index ff0e99679..65fe454ab 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -130,10 +130,16 @@ function set_transanctional_email_settings(InstanceSettings|null $settings = nul function base_ip(): string { if (is_dev()) { - return "http://localhost"; + return "localhost"; } $settings = InstanceSettings::get(); - return "http://$settings->public_ipv4"; + if ($settings->public_ipv4) { + return "$settings->public_ipv4"; + } + if ($settings->public_ipv6) { + return "$settings->public_ipv6"; + } + return "localhost"; } /** diff --git a/config/version.php b/config/version.php index 8ecc24277..7764582fa 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@