Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(database): warn about PostgreSQL password overwrite on full restore

Andras Bacsai8ace0d18e36d
diff --git a/resources/views/livewire/project/database/import-form.blade.php b/resources/views/livewire/project/database/import-form.blade.php
index a8087bd8ed..dd57b121c2 100644
--- a/resources/views/livewire/project/database/import-form.blade.php
+++ b/resources/views/livewire/project/database/import-form.blade.php
@@ -57,6 +57,10 @@
<div class="space-y-4">
@if ($resourceDbType === 'standalone-postgresql')
@if ($dumpAll)
+ <x-callout type="warning" title="Full restore overwrites administrator passwords">
+ The backup replaces PostgreSQL administrator role passwords, including the destination administrator password.
+ <span class="mt-1 block">If the administrator password changes, update it in Coolify's database configuration after the restore.</span>
+ </x-callout>
<x-forms.textarea rows="6" readonly label="Import command"
wire:model="restoreCommandText" canGate="update"
:canResource="$this->resource" />
diff --git a/tests/Feature/DatabaseRestoreDialogTest.php b/tests/Feature/DatabaseRestoreDialogTest.php
index 0086a6cf2f..5f78706a8c 100644
--- a/tests/Feature/DatabaseRestoreDialogTest.php
+++ b/tests/Feature/DatabaseRestoreDialogTest.php
@@ -8,3 +8,13 @@ test('database restore output opens in the centered process dialog', function ()
->toContain('<livewire:activity-monitor wire:key="database-restore-{{ $resourceUuid }}" header="Logs" fullHeight />')
->not->toContain('<x-slide-over @databaserestore.window="slideOverOpen = true"');
});
+
+test('postgresql dump all restore warns that administrator passwords are overwritten', function () {
+ $view = file_get_contents(resource_path('views/livewire/project/database/import-form.blade.php'));
+
+ expect($view)
+ ->toContain('@if ($dumpAll)')
+ ->toContain('Full restore overwrites administrator passwords')
+ ->toContain('The backup replaces PostgreSQL administrator role passwords, including the destination administrator password.')
+ ->toContain("If the administrator password changes, update it in Coolify's database configuration after the restore.");
+});