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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
UI options for deletion WIP
ayntk-ai4d0acee95cf3
diff --git a/app/Actions/Service/DeleteService.php b/app/Actions/Service/DeleteService.phpindex b043082acf..7c8eaf75d5 100644--- a/app/Actions/Service/DeleteService.php+++ b/app/Actions/Service/DeleteService.php@@ -10,7 +10,7 @@ class DeleteService{use AsAction;- public function handle(Service $service)+ public function handle(Service $service, bool $deleteConfigurations, bool $deleteVolumes, bool $deleteImages, bool $deleteNetworks){try {$server = data_get($service, 'server');@@ -61,4 +61,4 @@ class DeleteServiceCleanupDocker::run($server, true);}}-}+}\ No newline at end of filediff --git a/app/Jobs/DeleteResourceJob.php b/app/Jobs/DeleteResourceJob.phpindex dbf44dd5d6..36f6739866 100644--- a/app/Jobs/DeleteResourceJob.php+++ b/app/Jobs/DeleteResourceJob.php@@ -6,6 +6,7 @@ use App\Actions\Application\StopApplication;use App\Actions\Database\StopDatabase;use App\Actions\Service\DeleteService;use App\Actions\Service\StopService;+use App\Actions\Server\CleanupDocker;use App\Models\Application;use App\Models\Service;use App\Models\StandaloneClickhouse;@@ -31,7 +32,11 @@ class DeleteResourceJob implements ShouldBeEncrypted, ShouldQueuepublic function __construct(public Application|Service|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse $resource,public bool $deleteConfigurations = false,- public bool $deleteVolumes = false) {}+ public bool $deleteVolumes = false,+ public bool $deleteImages = false,+ public bool $deleteNetworks = false+ ) {+ }public function handle(){@@ -59,19 +64,33 @@ class DeleteResourceJob implements ShouldBeEncrypted, ShouldQueuebreak;}+ if ($this->deleteConfigurations) {+ $this->resource?->delete_configurations();+ }+if ($this->deleteVolumes && $this->resource->type() !== 'service') {$this->resource?->delete_volumes($persistentStorages);}- if ($this->deleteConfigurations) {- $this->resource?->delete_configurations();++ if ($this->deleteImages) {+ // Logic to delete images+ }++ if ($this->deleteNetworks) {+ // Logic to delete networks+ }++ $server = data_get($this->resource, 'server');+ if ($server) {+ CleanupDocker::run($server, true);}} catch (\Throwable $e) {ray($e->getMessage());- send_internal_notification('ContainerStoppingJob failed with: '.$e->getMessage());+ send_internal_notification('ContainerStoppingJob failed with: ' . $e->getMessage());throw $e;} finally {$this->resource->forceDelete();Artisan::queue('cleanup:stucked-resources');}}-}+}\ No newline at end of filediff --git a/resources/views/livewire/project/shared/danger.blade.php b/resources/views/livewire/project/shared/danger.blade.phpindex 276061a8e6..20bd7310b7 100644--- a/resources/views/livewire/project/shared/danger.blade.php+++ b/resources/views/livewire/project/shared/danger.blade.php@@ -12,5 +12,7 @@<x-forms.checkbox id="delete_configurations"label="Permanently delete configuration files from the server?"></x-forms.checkbox><x-forms.checkbox id="delete_volumes" label="Permanently delete associated volumes?"></x-forms.checkbox>+ <x-forms.checkbox id="delete_images" label="Permanently delete associated unused images?"></x-forms.checkbox>+ <x-forms.checkbox id="delete_connected_networks" label="Permanently delete all connected networks, this includes predfined ones?"></x-forms.checkbox></x-modal-confirmation>-</div>+</div>\ No newline at end of file