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
Merge remote-tracking branch 'origin/next' into audit-policies
Andras Bacsai78d8afa602d9
diff --cc app/Jobs/ProcessGithubPullRequestWebhook.phpindex 93aee0676c,d35ecf35a5..61fc3d4ee1--- a/app/Jobs/ProcessGithubPullRequestWebhook.php+++ b/app/Jobs/ProcessGithubPullRequestWebhook.php@@@ -14,6 -14,8 +14,7 @@@ use Illuminate\Contracts\Queue\ShouldQuuse Illuminate\Foundation\Bus\Dispatchable;use Illuminate\Queue\InteractsWithQueue;use Illuminate\Queue\SerializesModels;+ use Throwable;-use Visus\Cuid2\Cuid2;class ProcessGithubPullRequestWebhook implements ShouldBeEncrypted, ShouldQueue{diff --cc database/migrations/2026_05_29_000000_encrypt_application_deployment_configuration_columns.phpindex 95500cfef5,63bd39f6c2..19c4445b26--- a/database/migrations/2026_05_29_000000_encrypt_application_deployment_configuration_columns.php+++ b/database/migrations/2026_05_29_000000_encrypt_application_deployment_configuration_columns.php@@@ -11,7 -11,8 +11,8 @@@ return new class extends Migratio*/public function up(): void{- if (DB::getDriverName() === 'sqlite') {- // SQLite (testing) uses type affinity, so json columns already accept text++ // SQLite (testing) uses type affinity, so json columns already accept text.+ if (DB::connection()->getDriverName() !== 'pgsql') {return;}diff --cc resources/views/components/applications/advanced.blade.phpindex 5964abb4e9,d97140570c..780a727e12--- a/resources/views/components/applications/advanced.blade.php+++ b/resources/views/components/applications/advanced.blade.php@@@ -3,34 -3,50 +3,84 @@@Advanced</x-slot>@if ($application->status === 'running')- <div class="dropdown-iteme" @if(!auth()->user()->can('deploy', $application)) data-disabled @endif wire:click='force_deploy_without_cache'>- <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"- stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">- <path stroke="none" d="M0 0h24v24H0z" fill="none" />- <path- d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />- <path- d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />- <path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />- <path d="M3 3l18 18" />- </svg>- Force deploy (without- cache)- </div>- <x-modal-confirmation title="Confirm Application Force Deployment?" buttonTitle="Force deploy"- submitAction="force_deploy_without_cache" :actions="[- 'This application will be force deployed without build cache.',- ]" :confirmWithText="false" :confirmWithPassword="false"- step2ButtonText="Confirm">- <x-slot:content>- <div class="dropdown-iteme">- <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"- stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">- <path stroke="none" d="M0 0h24v24H0z" fill="none" />- <path- d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />- <path- d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />- <path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />- <path d="M3 3l18 18" />- </svg>- Force deploy (without- cache)- </div>- </x-slot:content>- </x-modal-confirmation>++ @can('deploy', $application)++ <x-modal-confirmation title="Confirm Application Force Deployment?" buttonTitle="Force deploy"++ submitAction="force_deploy_without_cache" :actions="[++ 'This application will be force deployed without build cache.',++ ]" :confirmWithText="false" :confirmWithPassword="false"++ step2ButtonText="Confirm">++ <x-slot:content>++ <div class="dropdown-iteme">++ <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"++ stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">++ <path stroke="none" d="M0 0h24v24H0z" fill="none" />++ <path++ d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />++ <path++ d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />++ <path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />++ <path d="M3 3l18 18" />++ </svg>++ Force deploy (without++ cache)++ </div>++ </x-slot:content>++ </x-modal-confirmation>++ @else++ <div class="dropdown-iteme" data-disabled>++ <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"++ stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">++ <path stroke="none" d="M0 0h24v24H0z" fill="none" />++ <path++ d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />++ <path++ d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />++ <path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />++ <path d="M3 3l18 18" />++ </svg>++ Force deploy (without++ cache)++ </div>++ @endcan@else- <div class="dropdown-item" @if(!auth()->user()->can('deploy', $application)) data-disabled @endif wire:click='deploy(true)'>- <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 24 24" stroke-width="1.5"- stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">- <path stroke="none" d="M0 0h24v24H0z" fill="none" />- <path- d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />- <path- d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />- <path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />- <path d="M3 3l18 18" />- </svg>- Force deploy (without- cache)- </div>- <x-modal-confirmation title="Confirm Application Force Deployment?" buttonTitle="Force deploy"- submitAction="deploy(true)" :actions="[- 'This application will be force deployed without build cache.',- ]" :confirmWithText="false" :confirmWithPassword="false"- step2ButtonText="Confirm">- <x-slot:content>- <div class="dropdown-item">- <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 24 24" stroke-width="1.5"- stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">- <path stroke="none" d="M0 0h24v24H0z" fill="none" />- <path- d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />- <path- d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />- <path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />- <path d="M3 3l18 18" />- </svg>- Force deploy (without- cache)- </div>- </x-slot:content>- </x-modal-confirmation>++ @can('deploy', $application)++ <x-modal-confirmation title="Confirm Application Force Deployment?" buttonTitle="Force deploy"++ submitAction="deploy(true)" :actions="[++ 'This application will be force deployed without build cache.',++ ]" :confirmWithText="false" :confirmWithPassword="false"++ step2ButtonText="Confirm">++ <x-slot:content>++ <div class="dropdown-item">++ <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 24 24" stroke-width="1.5"++ stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">++ <path stroke="none" d="M0 0h24v24H0z" fill="none" />++ <path++ d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />++ <path++ d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />++ <path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />++ <path d="M3 3l18 18" />++ </svg>++ Force deploy (without++ cache)++ </div>++ </x-slot:content>++ </x-modal-confirmation>++ @else++ <div class="dropdown-item" data-disabled>++ <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 24 24" stroke-width="1.5"++ stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">++ <path stroke="none" d="M0 0h24v24H0z" fill="none" />++ <path++ d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />++ <path++ d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />++ <path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />++ <path d="M3 3l18 18" />++ </svg>++ Force deploy (without++ cache)++ </div>++ @endcan@endif</x-dropdown>diff --cc resources/views/components/services/advanced.blade.phpindex ed8c5d6474,8317233076..1974bf221b--- a/resources/views/components/services/advanced.blade.php+++ b/resources/views/components/services/advanced.blade.php@@@ -3,7 -3,7 +3,7 @@@Advanced</x-slot>@if (str($service->status)->contains('running'))- <div class="dropdown-item" @if(!auth()->user()->can('deploy', $service)) data-disabled @endif @click="$wire.dispatch('pullAndRestartEvent')">- <div class="dropdown-item" @click="document.getElementById('service-pullAndRestart-trigger')?.click()">++ <div class="dropdown-item" @if(!auth()->user()->can('deploy', $service)) data-disabled @endif @click="document.getElementById('service-pullAndRestart-trigger')?.click()"><svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none" />@@@ -17,7 -17,7 +17,7 @@@Pull Latest Images & Restart</div>@elseif (str($service->status)->contains('degraded'))- <div class="dropdown-item" @if(!auth()->user()->can('deploy', $service)) data-disabled @endif @click="$wire.dispatch('forceDeployEvent')">- <div class="dropdown-item" @click="document.getElementById('service-forceDeploy-trigger')?.click()">++ <div class="dropdown-item" @if(!auth()->user()->can('deploy', $service)) data-disabled @endif @click="document.getElementById('service-forceDeploy-trigger')?.click()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"stroke-linecap="round" stroke-linejoin="round" data-darkreader-inline-stroke=""style="--darkreader-inline-stroke: currentColor;" class="w-6 h-6" stroke-width="2">@@@ -27,7 -27,7 +27,7 @@@Force Restart</div>@else- <div class="dropdown-item" @if(!auth()->user()->can('deploy', $service)) data-disabled @endif @click="$wire.dispatch('forceDeployEvent')">- <div class="dropdown-item" @click="document.getElementById('service-forceDeploy-trigger')?.click()">++ <div class="dropdown-item" @if(!auth()->user()->can('deploy', $service)) data-disabled @endif @click="document.getElementById('service-forceDeploy-trigger')?.click()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"stroke-linecap="round" stroke-linejoin="round" data-darkreader-inline-stroke=""style="--darkreader-inline-stroke: currentColor;" class="w-4 h-4" stroke-width="2">@@@ -36,7 -36,7 +36,7 @@@</svg>Force Deploy</div>- <div class="dropdown-item" @if(!auth()->user()->can('stop', $service)) data-disabled @endif wire:click='stop(true)''>- <div class="dropdown-item" @click="document.getElementById('service-cleanup-trigger')?.click()">++ <div class="dropdown-item" @if(!auth()->user()->can('stop', $service)) data-disabled @endif @click="document.getElementById('service-cleanup-trigger')?.click()"><svg class="w-4 h-4" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M26 20h-6v-2h6zm4 8h-6v-2h6zm-2-4h-6v-2h6z" /><path fill="currentColor"diff --cc resources/views/livewire/project/application/heading.blade.phpindex e5cf131782,18e2e6db0e..4432348699--- a/resources/views/livewire/project/application/heading.blade.php+++ b/resources/views/livewire/project/application/heading.blade.php@@@ -103,49 -483,73 +483,75 @@@<div class="flex flex-wrap gap-2">@if (!str($application->status)->startsWith('exited'))@if (!$application->destination->server->isSwarm())- <x-forms.button canGate="deploy" :canResource="$application" title="With rolling update if possible" wire:click='deploy'>- <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-orange-400"- viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"- stroke-linecap="round" stroke-linejoin="round">- <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>- <path- d="M10.09 4.01l.496 -.495a2 2 0 0 1 2.828 0l7.071 7.07a2 2 0 0 1 0 2.83l-7.07 7.07a2 2 0 0 1 -2.83 0l-7.07 -7.07a2 2 0 0 1 0 -2.83l3.535 -3.535h-3.988">- </path>- <path d="M7.05 11.038v-3.988"></path>- </svg>- Redeploy- </x-forms.button>+++ <x-modal-confirmation title="Confirm Application Deployment?" buttonTitle="Redeploy"+ submitAction="deploy" :actions="[+ 'This application will be redeployed.',+ ]" :confirmWithText="false" :confirmWithPassword="false"+ step2ButtonText="Confirm">+ <x-slot:content>- <x-forms.button title="With rolling update if possible">++ <x-forms.button canGate="deploy" :canResource="$application" title="With rolling update if possible">+ <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-orange-400"+ viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"+ stroke-linecap="round" stroke-linejoin="round">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <path+ d="M10.09 4.01l.496 -.495a2 2 0 0 1 2.828 0l7.071 7.07a2 2 0 0 1 0 2.83l-7.07 7.07a2 2 0 0 1 -2.83 0l-7.07 -7.07a2 2 0 0 1 0 -2.83l3.535 -3.535h-3.988">+ </path>+ <path d="M7.05 11.038v-3.988"></path>+ </svg>+ Redeploy+ </x-forms.button>+ </x-slot:content>+ </x-modal-confirmation>@endif@if ($application->build_pack !== 'dockercompose')@if ($application->destination->server->isSwarm())- <x-forms.button canGate="deploy" :canResource="$application" title="Redeploy Swarm Service (rolling update)" wire:click='deploy'>- <svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"- xmlns="http://www.w3.org/2000/svg">- <g fill="none" stroke="currentColor" stroke-linecap="round"- stroke-linejoin="round" stroke-width="2">- <path- d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />- <path d="M20 4v5h-5" />- </g>- </svg>- Update Service- </x-forms.button>+ <x-modal-confirmation title="Confirm Application Deployment?" buttonTitle="Update Service"+ submitAction="deploy" :actions="[+ 'This Swarm service will be updated with a rolling deployment.',+ ]" :confirmWithText="false" :confirmWithPassword="false"+ step2ButtonText="Confirm">+ <x-slot:content>- <x-forms.button title="Redeploy Swarm Service (rolling update)">++ <x-forms.button canGate="deploy" :canResource="$application" title="Redeploy Swarm Service (rolling update)">+ <svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"+ xmlns="http://www.w3.org/2000/svg">+ <g fill="none" stroke="currentColor" stroke-linecap="round"+ stroke-linejoin="round" stroke-width="2">+ <path+ d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />+ <path d="M20 4v5h-5" />+ </g>+ </svg>+ Update Service+ </x-forms.button>+ </x-slot:content>+ </x-modal-confirmation>@else- <x-forms.button canGate="deploy" :canResource="$application" title="Restart without rebuilding" wire:click='restart'>- <svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"- xmlns="http://www.w3.org/2000/svg">- <g fill="none" stroke="currentColor" stroke-linecap="round"- stroke-linejoin="round" stroke-width="2">- <path- d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />- <path d="M20 4v5h-5" />- </g>- </svg>- Restart- </x-forms.button>+ <x-modal-confirmation title="Confirm Application Restart?" buttonTitle="Restart"+ submitAction="restart" :actions="[+ 'This application will be restarted without rebuilding.',+ ]" :confirmWithText="false" :confirmWithPassword="false"+ step2ButtonText="Confirm">+ <x-slot:content>- <x-forms.button title="Restart without rebuilding">++ <x-forms.button canGate="deploy" :canResource="$application" title="Restart without rebuilding">+ <svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"+ xmlns="http://www.w3.org/2000/svg">+ <g fill="none" stroke="currentColor" stroke-linecap="round"+ stroke-linejoin="round" stroke-width="2">+ <path+ d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />+ <path d="M20 4v5h-5" />+ </g>+ </svg>+ Restart+ </x-forms.button>+ </x-slot:content>+ </x-modal-confirmation>++@endif@endif- <x-modal-confirmation title="Confirm Application Stopping?" buttonTitle="Stop"+ <x-modal-confirmation :disabled="!auth()->user()->can('deploy', $application)" :authDisabled="!auth()->user()->can('deploy', $application)" title="Confirm Application Stopping?" buttonTitle="Stop"submitAction="stop" :checkboxes="$checkboxes" :actions="['This application will be stopped.','All non-persistent data of this application will be deleted.',@@@ -167,15 -571,23 +573,25 @@@</x-slot:button-title></x-modal-confirmation>@else- <x-forms.button canGate="deploy" :canResource="$application" wire:click='deploy'>- <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning"- viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"- stroke-linecap="round" stroke-linejoin="round">- <path stroke="none" d="M0 0h24v24H0z" fill="none" />- <path d="M7 4v16l13 -8z" />- </svg>- Deploy- </x-forms.button>+++ <x-modal-confirmation title="Confirm Application Deployment?" buttonTitle="Deploy"+ submitAction="deploy" :actions="[+ 'This application will be deployed.',+ ]" :confirmWithText="false" :confirmWithPassword="false"+ step2ButtonText="Confirm">+ <x-slot:content>- <x-forms.button>++ <x-forms.button canGate="deploy" :canResource="$application">+ <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning"+ viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"+ stroke-linecap="round" stroke-linejoin="round">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M7 4v16l13 -8z" />+ </svg>+ Deploy+ </x-forms.button>+ </x-slot:content>+ </x-modal-confirmation>++@endif</div></div>diff --cc resources/views/livewire/project/database/heading.blade.phpindex 03bbd1e5e4,61670cc725..ca4fcf1eab--- a/resources/views/livewire/project/database/heading.blade.php+++ b/resources/views/livewire/project/database/heading.blade.php@@@ -37,89 -211,37 +211,39 @@@</a>@endif</nav>+@if ($database->destination->server->isFunctional())<div class="flex flex-wrap gap-2 items-center">- <div class="md:hidden">- <x-dropdown>- <x-slot:title>- Actions- </x-slot>- @if (!str($database->status)->startsWith('exited'))- <x-modal-confirmation title="Confirm Database Restart?" buttonTitle="Restart" submitAction="restart"- :actions="[- 'This database will be unavailable during the restart.',- 'If the database is currently in use data could be lost.',- ]" :confirmWithText="false" :confirmWithPassword="false" step2ButtonText="Restart Database"- :dispatchEvent="true" dispatchEventType="restartEvent">- <x-slot:trigger>- <div class="dropdown-item dropdown-item-touch">- Restart- </div>- </x-slot:trigger>- </x-modal-confirmation>- <x-modal-confirmation title="Confirm Database Stopping?" buttonTitle="Stop" submitAction="stop"- :checkboxes="$checkboxes" :actions="[- 'This database will be stopped.',- 'If the database is currently in use data could be lost.',- 'All non-persistent data of this database (containers, networks, unused images) will be deleted (don\'t worry, no data is lost and you can start the database again).',- ]" :confirmWithText="false" :confirmWithPassword="false"- step1ButtonText="Continue" step2ButtonText="Confirm">- <x-slot:trigger>- <div class="dropdown-item dropdown-item-touch text-error">- Stop- </div>- </x-slot:trigger>- </x-modal-confirmation>- @else- <div class="dropdown-item dropdown-item-touch" @click="$wire.dispatch('startEvent')">- Start- </div>- @endif- </x-dropdown>- </div><div class="hidden flex-wrap items-center gap-2 md:flex">@if (!str($database->status)->startsWith('exited'))- <x-modal-confirmation :disabled="!auth()->user()->can('manage', $database)" :authDisabled="!auth()->user()->can('manage', $database)" title="Confirm Database Restart?" buttonTitle="Restart" submitAction="restart"- :actions="[- 'This database will be unavailable during the restart.',- 'If the database is currently in use data could be lost.',- ]" :confirmWithText="false" :confirmWithPassword="false" step2ButtonText="Restart Database"- :dispatchEvent="true" dispatchEventType="restartEvent">- <x-slot:button-title>- <svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"- xmlns="http://www.w3.org/2000/svg">- <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"- stroke-width="2">- <path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />- <path d="M20 4v5h-5" />- </g>- </svg>- Restart- </x-slot:button-title>- </x-modal-confirmation>- <x-modal-confirmation :disabled="!auth()->user()->can('manage', $database)" :authDisabled="!auth()->user()->can('manage', $database)" title="Confirm Database Stopping?" buttonTitle="Stop" submitAction="stop"- :checkboxes="$checkboxes" :actions="[- 'This database will be stopped.',- 'If the database is currently in use data could be lost.',- 'All non-persistent data of this database (containers, networks, unused images) will be deleted (don\'t worry, no data is lost and you can start the database again).',- ]" :confirmWithText="false" :confirmWithPassword="false"- step1ButtonText="Continue" step2ButtonText="Confirm">- <x-slot:button-title>- <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"- stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"- stroke-linejoin="round">- <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>- <path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">- </path>- <path- d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">- </path>- </svg>- Stop- </x-slot:button-title>- </x-modal-confirmation>- <x-forms.button title="Restart" @click="document.getElementById('database-restart-trigger')?.click()">++++ <x-forms.button canGate="manage" :canResource="$database" title="Restart" @click="document.getElementById('database-restart-trigger')?.click()">+ <svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"+ xmlns="http://www.w3.org/2000/svg">+ <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"+ stroke-width="2">+ <path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />+ <path d="M20 4v5h-5" />+ </g>+ </svg>+ Restart+ </x-forms.button>- <x-forms.button isError title="Stop" @click="document.getElementById('database-stop-trigger')?.click()">++ <x-forms.button canGate="manage" :canResource="$database" isError title="Stop" @click="document.getElementById('database-stop-trigger')?.click()">+ <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"+ stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"+ stroke-linejoin="round">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">+ </path>+ <path+ d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">+ </path>+ </svg>+ Stop+ </x-forms.button>@else- <x-forms.button canGate="manage" :canResource="$database" @click="$wire.dispatch('startEvent')" class="gap-2">- <button @click="document.getElementById('database-start-trigger')?.click()" class="gap-2 button">++ <x-forms.button canGate="manage" :canResource="$database" @click="document.getElementById('database-start-trigger')?.click()" class="gap-2">++<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"stroke-linejoin="round">diff --cc resources/views/livewire/project/service/heading.blade.phpindex fdcb1e2813,1071bd6582..820d99080b--- a/resources/views/livewire/project/service/heading.blade.php+++ b/resources/views/livewire/project/service/heading.blade.php@@@ -29,85 -363,13 +363,15 @@@<x-services.links :service="$service" /></div></nav>+@if ($service->isDeployable)- <div class="order-first flex flex-wrap items-center gap-2 sm:order-last">- <div class="md:hidden">- <x-dropdown>- <x-slot:title>- Actions- </x-slot>- @if (str($service->status)->contains('running'))- <div class="dropdown-item dropdown-item-touch" @click="$wire.dispatch('restartEvent')">- Restart- </div>- <x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" :dispatchEvent="true"- submitAction="stop" dispatchEventType="stopEvent" :checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]"- :confirmWithText="false" :confirmWithPassword="false" step1ButtonText="Continue" step2ButtonText="Confirm">- <x-slot:trigger>- <div class="dropdown-item dropdown-item-touch text-error">- Stop- </div>- </x-slot:trigger>- </x-modal-confirmation>- <div class="mx-2 my-1 border-t border-neutral-200 dark:border-coolgray-300"></div>- <div class="dropdown-item dropdown-item-touch" @click="$wire.dispatch('pullAndRestartEvent')">- Pull Latest Images & Restart- </div>- @elseif (str($service->status)->contains('degraded'))- <div class="dropdown-item dropdown-item-touch" @click="$wire.dispatch('restartEvent')">- Restart- </div>- <x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" :dispatchEvent="true"- submitAction="stop" dispatchEventType="stopEvent" :checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]"- :confirmWithText="false" :confirmWithPassword="false" step1ButtonText="Continue" step2ButtonText="Confirm">- <x-slot:trigger>- <div class="dropdown-item dropdown-item-touch text-error">- Stop- </div>- </x-slot:trigger>- </x-modal-confirmation>- <div class="mx-2 my-1 border-t border-neutral-200 dark:border-coolgray-300"></div>- <div class="dropdown-item dropdown-item-touch" @click="$wire.dispatch('forceDeployEvent')">- Force Restart- </div>- @elseif (str($service->status)->contains('exited'))- <div class="dropdown-item dropdown-item-touch" @click="$wire.dispatch('startEvent')">- Deploy- </div>- <div class="mx-2 my-1 border-t border-neutral-200 dark:border-coolgray-300"></div>- <div class="dropdown-item dropdown-item-touch" @click="$wire.dispatch('forceDeployEvent')">- Force Deploy- </div>- <div class="dropdown-item dropdown-item-touch" wire:click='stop(true)'>- Force Cleanup Containers- </div>- @else- <x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" :dispatchEvent="true"- submitAction="stop" dispatchEventType="stopEvent" :checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]"- :confirmWithText="false" :confirmWithPassword="false" step1ButtonText="Continue" step2ButtonText="Confirm">- <x-slot:trigger>- <div class="dropdown-item dropdown-item-touch text-error">- Stop- </div>- </x-slot:trigger>- </x-modal-confirmation>- <div class="dropdown-item dropdown-item-touch" @click="$wire.dispatch('startEvent')">- Deploy- </div>- <div class="mx-2 my-1 border-t border-neutral-200 dark:border-coolgray-300"></div>- <div class="dropdown-item dropdown-item-touch" @click="$wire.dispatch('forceDeployEvent')">- Force Deploy- </div>- <div class="dropdown-item dropdown-item-touch" wire:click='stop(true)'>- Force Cleanup Containers- </div>- @endif- </x-dropdown>- </div>- <div class="hidden flex-wrap items-center gap-2 md:flex">+ <div class="hidden flex-wrap items-center gap-2 md:flex">+ <div class="flex flex-wrap items-center gap-2"><x-services.advanced :service="$service" />@if (str($service->status)->contains('running'))- <x-forms.button canGate="deploy" :canResource="$service" title="Restart" @click="$wire.dispatch('restartEvent')">- <x-forms.button title="Restart" @click="document.getElementById('service-restart-trigger')?.click()">++++ <x-forms.button canGate="deploy" :canResource="$service" title="Restart" @click="document.getElementById('service-restart-trigger')?.click()">++<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"stroke-width="2">@@@ -117,25 -379,21 +381,23 @@@</svg>Restart</x-forms.button>- <x-modal-confirmation :disabled="!auth()->user()->can('stop', $service)" :authDisabled="!auth()->user()->can('stop', $service)" title="Confirm Service Stopping?" buttonTitle="Stop" :dispatchEvent="true"- submitAction="stop" dispatchEventType="stopEvent" :checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]"- :confirmWithText="false" :confirmWithPassword="false" step1ButtonText="Continue" step2ButtonText="Confirm">- <x-slot:button-title>- <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"- stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"- stroke-linejoin="round">- <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>- <path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">- </path>- <path- d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">- </path>- </svg>- Stop- </x-slot:button-title>- </x-modal-confirmation>- <x-forms.button isError title="Stop" @click="document.getElementById('service-stop-trigger')?.click()">++++ <x-forms.button canGate="stop" :canResource="$service" isError title="Stop" @click="document.getElementById('service-stop-trigger')?.click()">+ <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"+ stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"+ stroke-linejoin="round">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">+ </path>+ <path+ d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">+ </path>+ </svg>+ Stop+ </x-forms.button>@elseif (str($service->status)->contains('degraded'))- <x-forms.button canGate="deploy" :canResource="$service" title="Restart" @click="$wire.dispatch('restartEvent')">- <x-forms.button title="Restart" @click="document.getElementById('service-restart-trigger')?.click()">++ <x-forms.button canGate="deploy" :canResource="$service" title="Restart" @click="document.getElementById('service-restart-trigger')?.click()">++<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"stroke-width="2">@@@ -145,25 -403,21 +407,23 @@@</svg>Restart</x-forms.button>- <x-modal-confirmation :disabled="!auth()->user()->can('stop', $service)" :authDisabled="!auth()->user()->can('stop', $service)" title="Confirm Service Stopping?" buttonTitle="Stop" :dispatchEvent="true"- submitAction="stop" dispatchEventType="stopEvent" :checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]"- :confirmWithText="false" :confirmWithPassword="false" step1ButtonText="Continue" step2ButtonText="Confirm">- <x-slot:button-title>- <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"- stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"- stroke-linejoin="round">- <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>- <path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">- </path>- <path- d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">- </path>- </svg>- Stop- </x-slot:button-title>- </x-modal-confirmation>- <x-forms.button isError title="Stop" @click="document.getElementById('service-stop-trigger')?.click()">++++ <x-forms.button canGate="stop" :canResource="$service" isError title="Stop" @click="document.getElementById('service-stop-trigger')?.click()">+ <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"+ stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"+ stroke-linejoin="round">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">+ </path>+ <path+ d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">+ </path>+ </svg>+ Stop+ </x-forms.button>@elseif (str($service->status)->contains('exited'))- <x-forms.button canGate="deploy" :canResource="$service" @click="$wire.dispatch('startEvent')" class="gap-2">- <button @click="document.getElementById('service-start-trigger')?.click()" class="gap-2 button">++ <x-forms.button canGate="deploy" :canResource="$service" @click="document.getElementById('service-start-trigger')?.click()" class="gap-2">++<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"stroke-linejoin="round">@@@ -171,26 -425,22 +431,24 @@@<path d="M7 4v16l13 -8z" /></svg>Deploy- </button>+ </x-forms.button>@else- <x-modal-confirmation :disabled="!auth()->user()->can('stop', $service)" :authDisabled="!auth()->user()->can('stop', $service)" title="Confirm Service Stopping?" buttonTitle="Stop" :dispatchEvent="true"- submitAction="stop" dispatchEventType="stopEvent" :checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]"- :confirmWithText="false" :confirmWithPassword="false" step1ButtonText="Continue" step2ButtonText="Confirm">- <x-slot:button-title>- <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"- stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"- stroke-linejoin="round">- <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>- <path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">- </path>- <path- d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">- </path>- </svg>- Stop- </x-slot:button-title>- </x-modal-confirmation>- <x-forms.button canGate="deploy" :canResource="$service" @click="$wire.dispatch('startEvent')" class="gap-2">- <x-forms.button isError title="Stop" @click="document.getElementById('service-stop-trigger')?.click()">++++ <x-forms.button canGate="stop" :canResource="$service" isError title="Stop" @click="document.getElementById('service-stop-trigger')?.click()">+ <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"+ stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"+ stroke-linejoin="round">+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>+ <path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">+ </path>+ <path+ d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">+ </path>+ </svg>+ Stop+ </x-forms.button>- <button @click="document.getElementById('service-start-trigger')?.click()" class="gap-2 button">++ <x-forms.button canGate="deploy" :canResource="$service" @click="document.getElementById('service-start-trigger')?.click()" class="gap-2">++<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"stroke-linejoin="round">@@@ -246,8 -544,12 +549,11 @@@});$wire.$on('pullAndRestartEvent', () => {$wire.$dispatch('info', 'Pulling new images and restarting service.');- window.dispatchEvent(new CustomEvent('startservice'));$wire.$call('pullAndRestartEvent');});+ $wire.$on('cleanupEvent', () => {+ $wire.$call('stop', true);+ });$wire.on('imagePulled', () => {window.dispatchEvent(new CustomEvent('startservice'));$wire.$dispatch('info', 'Restarting service.');diff --cc tests/Feature/ProcessGithubPullRequestWebhookTest.phpindex 0000000000,6e0e9241e7..ce8e8c5badmode 000000,100644..100644--- a/tests/Feature/ProcessGithubPullRequestWebhookTest.php+++ b/tests/Feature/ProcessGithubPullRequestWebhookTest.php@@@ -1,0 -1,72 +1,60 @@@+ <?php++ use App\Actions\Application\CleanupPreviewDeployment;+ use App\Jobs\ProcessGithubPullRequestWebhook;+ use App\Models\Application;+ use App\Models\ApplicationPreview;+ use App\Models\Environment;+ use App\Models\InstanceSettings;+ use App\Models\Project;+ use App\Models\Server;+ use App\Models\StandaloneDocker;+ use App\Models\Team;+ use Illuminate\Foundation\Testing\RefreshDatabase;++ uses(RefreshDatabase::class);++ beforeEach(function () {+ InstanceSettings::unguarded(fn () => InstanceSettings::firstOrCreate(['id' => 0]));++ $this->team = Team::factory()->create();+ $this->server = Server::factory()->create(['team_id' => $this->team->id]);+ $this->destination = StandaloneDocker::where('server_id', $this->server->id)->first();+ $this->project = Project::factory()->create(['team_id' => $this->team->id]);+ $this->environment = Environment::factory()->create(['project_id' => $this->project->id]);++ $this->application = Application::factory()->create([+ 'environment_id' => $this->environment->id,+ 'destination_id' => $this->destination->id,+ 'destination_type' => $this->destination->getMorphClass(),+ ]);+ });++ it('cleans up a closed pull request preview when pull request comment cleanup fails', function () {+ $preview = ApplicationPreview::create([+ 'application_id' => $this->application->id,+ 'pull_request_id' => 42,+ 'pull_request_html_url' => 'https://github.com/example/repo/pull/42',+ ]);++ CleanupPreviewDeployment::shouldRun()+ ->once()+ ->withArgs(fn (Application $application, int $pullRequestId, ApplicationPreview $applicationPreview): bool => $application->is($this->application)+ && $pullRequestId === 42+ && $applicationPreview->is($preview))+ ->andReturn([+ 'cancelled_deployments' => 0,+ 'killed_containers' => 0,+ 'status' => 'success',+ ]);+- $job = new class(- applicationId: $this->application->id,- githubAppId: null,- action: 'closed',- pullRequestId: 42,- pullRequestHtmlUrl: 'https://github.com/example/repo/pull/42',- pullRequestTitle: null,- beforeSha: null,- afterSha: null,- commitSha: 'HEAD',- authorAssociation: 'OWNER',- fullName: 'example/repo',- ) extends ProcessGithubPullRequestWebhook++ $job = new class(applicationId: $this->application->id, githubAppId: null, action: 'closed', pullRequestId: 42, pullRequestHtmlUrl: 'https://github.com/example/repo/pull/42', pullRequestTitle: null, beforeSha: null, afterSha: null, commitSha: 'HEAD', authorAssociation: 'OWNER', fullName: 'example/repo') extends ProcessGithubPullRequestWebhook+ {+ protected function dispatchPullRequestClosedUpdate(Application $application, ApplicationPreview $preview): void+ {+ throw new RuntimeException('GitHub comment cleanup failed.');+ }+ };++ $job->handle();+ });