Add server-level toggle to disable application image retention

Adds a new server-level setting that allows administrators to disable
per-application image retention globally for all applications on a server.
When enabled, Docker cleanup will only keep the currently running image
regardless of individual application retention settings.

Changes:
- Add migration for disable_application_image_retention boolean field
- Update ServerSetting model with cast
- Add checkbox in DockerCleanup page (Advanced section)
- Modify CleanupDocker action to check server-level setting
- Update Rollback page to show warning and disable inputs when server
  retention is disabled
- Add helper text noting server-level override capability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2025-12-05 12:22:20 +01:00
parent 0cc5973901
commit 511415770a
7 changed files with 48 additions and 4 deletions

View File

@@ -31,6 +31,9 @@ class DockerCleanup extends Component
#[Validate('boolean')]
public bool $deleteUnusedNetworks = false;
#[Validate('boolean')]
public bool $disableApplicationImageRetention = false;
public function mount(string $server_uuid)
{
try {
@@ -52,6 +55,7 @@ class DockerCleanup extends Component
$this->server->settings->docker_cleanup_threshold = $this->dockerCleanupThreshold;
$this->server->settings->delete_unused_volumes = $this->deleteUnusedVolumes;
$this->server->settings->delete_unused_networks = $this->deleteUnusedNetworks;
$this->server->settings->disable_application_image_retention = $this->disableApplicationImageRetention;
$this->server->settings->save();
} else {
$this->forceDockerCleanup = $this->server->settings->force_docker_cleanup;
@@ -59,6 +63,7 @@ class DockerCleanup extends Component
$this->dockerCleanupThreshold = $this->server->settings->docker_cleanup_threshold;
$this->deleteUnusedVolumes = $this->server->settings->delete_unused_volumes;
$this->deleteUnusedNetworks = $this->server->settings->delete_unused_networks;
$this->disableApplicationImageRetention = $this->server->settings->disable_application_image_retention;
}
}