diff --git a/CHANGELOG.md b/CHANGELOG.md index 74de1fec5b..6f06395fa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ### Fixed +- Ask for confirmation in a dialog before you change the name of a persistent volume of an application or a database. A new name does not rename the Docker volume: after the next restart, the resource uses a different volume, which Docker creates empty, and the data stays in the old volume. Before, Coolify saved the new name without a warning, so the data looked lost after the restart. The dialog tells you to copy the data into the new volume ([#8816](https://github.com/coollabsio/coolify/issues/8816)) - Show "Not in Compose file" on the applications and databases of a service that you removed from its Docker Compose file, and do not count them in the service status. Before, each removed part showed as "Exited" and the service stayed degraded. Coolify keeps the settings of a removed part: if you add the service back under the same name, Coolify uses the part again. To remove the part, delete it in its settings. A part that a Compose error created, for example a `ports:` block at the wrong indentation, is also marked. Existing parts are marked at the next deployment or save of the service ([#9591](https://github.com/coollabsio/coolify/issues/9591)) - Fix deployments that failed with "The container name ... is already in use" when **Use build secrets** is on. To set the real `SOURCE_COMMIT`, Coolify starts the helper container a second time with the same name. Before, Coolify stopped the old helper and started the new one immediately, but Docker removes a stopped `--rm` container in the background, so the name was sometimes still in use. Coolify now removes the old helper and waits until Docker frees the name ([#9363](https://github.com/coollabsio/coolify/issues/9363)) - Fix Docker builds that failed with "BuildKit is enabled but the buildx component is missing or broken" when the application has a build-time variable `HOME` or `DOCKER_CONFIG`. Coolify loads the build-time variables before it runs `docker build` in the helper container, so the variable moved the Docker CLI away from its plugins in `/root/.docker/cli-plugins`. The Docker CLI in the helper now always uses `/root/.docker`. A `HOME` build argument keeps its value ([#9726](https://github.com/coollabsio/coolify/issues/9726)) diff --git a/app/Livewire/Project/Shared/Storages/All.php b/app/Livewire/Project/Shared/Storages/All.php index 1a86da9fd9..69f758bba3 100644 --- a/app/Livewire/Project/Shared/Storages/All.php +++ b/app/Livewire/Project/Shared/Storages/All.php @@ -47,6 +47,13 @@ class All extends Component public bool $deleteDockerVolume = false; + /** + * Volume rename that waits for confirmation. A new name mounts another Docker volume, and the data stays in the old one. + * + * @var array{storageId: int, from: string, to: string}|null + */ + public ?array $pendingRename = null; + protected $listeners = ['refreshVolumeList' => 'refreshList', 'refreshVolumeBackups' => 'refreshList']; public function mount(): void @@ -80,11 +87,12 @@ class All extends Component $this->resource->loadMissing('environment.project'); } + $this->pendingRename = null; $this->rebuildForms(); $this->rebuildVolumeBackupMeta(); } - public function submit(int $storageId): void + public function submit(int $storageId, bool $renameConfirmed = false): void { $this->authorize('update', $this->resource); $this->validateStorage($storageId); @@ -97,7 +105,16 @@ class All extends Component } $form = $this->forms[$storageId]; - if (! $storage->isSharedWithAnotherResource()) { + $isRename = ! $storage->isSharedWithAnotherResource() && $form['name'] !== $storage->name; + $rename = ['storageId' => $storageId, 'from' => $storage->name, 'to' => $form['name']]; + if ($isRename && ! ($renameConfirmed && $this->pendingRename === $rename)) { + $this->pendingRename = $rename; + + return; + } + $this->pendingRename = null; + + if ($isRename) { $storage->name = $form['name']; } $storage->mount_path = $form['mountPath']; @@ -112,6 +129,14 @@ class All extends Component $this->dispatch('success', 'Storage updated successfully'); } + public function cancelRename(int $storageId): void + { + $this->authorize('view', $this->resource); + $storage = $this->findStorageOrFail($storageId); + $this->forms[$storageId]['name'] = $storage->name; + $this->pendingRename = null; + } + public function instantSave(int $storageId): void { $this->submit($storageId); diff --git a/resources/views/livewire/project/shared/storages/all.blade.php b/resources/views/livewire/project/shared/storages/all.blade.php index 88a9deab0d..98253ef137 100644 --- a/resources/views/livewire/project/shared/storages/all.blade.php +++ b/resources/views/livewire/project/shared/storages/all.blade.php @@ -352,4 +352,53 @@ @endif + @if ($pendingRename) +