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 automation/sync-main-to-next
Andras Bacsai9ef1ab7649bc
diff --cc app/Actions/Database/StartDatabase.phpindex 7735c77d88,3487bc9a42..c7fbff37b5--- a/app/Actions/Database/StartDatabase.php+++ b/app/Actions/Database/StartDatabase.php@@@ -28,33 -32,32 +32,34 @@@ class StartDatabasif (! $server->isFunctional()) {return 'Server is not functional';}+ $database->resetRestartLimit();- switch ($database->getMorphClass()) {- case StandalonePostgresql::class:- $activity = StartPostgresql::run($database);- break;- case StandaloneRedis::class:- $activity = StartRedis::run($database);- break;- case StandaloneMongodb::class:- $activity = StartMongodb::run($database);- break;- case StandaloneMysql::class:- $activity = StartMysql::run($database);- break;- case StandaloneMariadb::class:- $activity = StartMariadb::run($database);- break;- case StandaloneKeydb::class:- $activity = StartKeydb::run($database);- break;- case StandaloneDragonfly::class:- $activity = StartDragonfly::run($database);- break;- case StandaloneClickhouse::class:- $activity = StartClickhouse::run($database);- break;++ $activity = activity()+ ->withProperties([+ 'server_uuid' => $server->uuid,+ 'type' => ActivityTypes::INLINE->value,+ 'type_uuid' => $database->uuid,+ 'status' => ProcessStatus::QUEUED->value,+ 'team_id' => $server->team_id,+ 'operation' => 'database-start',+ ])+ ->performedOn($database)+ ->event(ActivityTypes::INLINE->value)+ ->log('[]');++ if ($activity === null) {+ return 'Database start could not be queued because activity logging is disabled.';++}++ DatabaseStartJob::dispatch(+ $database->getMorphClass(),+ (int) $database->getKey(),+ (int) $database->team()->id,+ (int) $activity->getKey(),+ auth()->id(),+ );+if ($database->is_public && $database->public_port) {StartDatabaseProxy::dispatch($database);}diff --cc app/Jobs/ApplicationDeploymentJob.phpindex 88036f5191,a70d917815..0887e7e864--- a/app/Jobs/ApplicationDeploymentJob.php+++ b/app/Jobs/ApplicationDeploymentJob.php@@@ -1855,128 -1974,43 +1986,130 @@@ class ApplicationDeploymentJob implemenreturn $envs;}+ private function validatedBuildtimeEnvironmentVariableKey(string $key, string $origin): string+ {+++ try {+ if (! ValidationPatterns::isValidEnvironmentVariableKey($key)) {+ throw new \InvalidArgumentException('Invalid build-time environment variable key.');+++ }++ return $key;+ } catch (\InvalidArgumentException $exception) {+ $this->logInvalidBuildtimeEnvironmentVariableKey($key, $origin);++ throw new DeploymentException(+ "Invalid environment variable name from {$origin}: ".ValidationPatterns::displayShellEnvironmentVariableKey($key).'. Names must start with a letter or underscore and contain only letters, numbers, underscores, and dots.',+ previous: $exception,+ );+ }+ }++ private function logInvalidBuildtimeEnvironmentVariableKey(string $key, string $origin): void+ {+ $displayKey = ValidationPatterns::displayShellEnvironmentVariableKey($key);++ $this->application_deployment_queue->addLogEntry('----------------------------------------', 'stderr');+ $this->application_deployment_queue->addLogEntry("⚠️ Invalid environment variable name from {$origin}: {$displayKey}", 'stderr');+ $this->application_deployment_queue->addLogEntry('Build-time variable names must start with a letter or underscore and contain only letters, numbers, underscores, and dots.', 'stderr');+ $this->application_deployment_queue->addLogEntry('💡 How to fix:', type: 'info');++ if ($origin === 'the Nixpacks plan') {+ $this->application_deployment_queue->addLogEntry(' 1. Open nixpacks.toml and check the [variables] section. Quoted keys can contain characters that are not valid environment variable names.', type: 'info');+ $this->application_deployment_queue->addLogEntry(' 2. Rename the key to a plain name like MY_VARIABLE (no spaces, shell syntax, or command substitutions).', type: 'info');+ $this->logSuggestedShellEnvironmentVariableKey($key);+ $this->application_deployment_queue->addLogEntry(' 3. Commit, push, and redeploy.', type: 'info');+ $this->application_deployment_queue->addLogEntry('Docs: https://nixpacks.com/docs/configuration/file', type: 'info');+ } else {+ $this->application_deployment_queue->addLogEntry(' Rename the environment variable to use only letters, numbers, and underscores, then redeploy.', type: 'info');+ $this->logSuggestedShellEnvironmentVariableKey($key);+ }++ $this->application_deployment_queue->addLogEntry('----------------------------------------', 'stderr');+ }++ private function logSuggestedShellEnvironmentVariableKey(string $key): void+ {+ $suggestedKey = str_replace('.', '_', $key);+ if ($suggestedKey === $key || preg_match(ValidationPatterns::SHELL_ENVIRONMENT_VARIABLE_KEY_PATTERN, $suggestedKey) !== 1) {+ return;+ }++ $displaySuggestedKey = ValidationPatterns::displayShellEnvironmentVariableKey($suggestedKey);++ $this->application_deployment_queue->addLogEntry(" Suggested name: {$displaySuggestedKey}", type: 'info');+ }+private function save_buildtime_environment_variables(){- // Generate build-time environment variables locally$environment_variables = $this->generate_buildtime_environment_variables();+ [$shell_environment_variables, $dotted_environment_variables] = $environment_variables->partition(function (string $environmentVariable): bool {+ [$key] = explode('=', $environmentVariable, 2);- // Save .env file for build phase in /artifacts to prevent it from being copied into Docker images- if ($environment_variables->isNotEmpty()) {- $envs_base64 = base64_encode($environment_variables->implode("\n"));+ return preg_match(ValidationPatterns::SHELL_ENVIRONMENT_VARIABLE_KEY_PATTERN, $key) === 1;+ });- $this->application_deployment_queue->addLogEntry('Creating build-time .env file in /artifacts (outside Docker context).', hidden: true);+ if ($dotted_environment_variables->isEmpty()) {+ $this->useBuildtimeEnvironmentLauncher = false;- $this->execute_remote_command(- [+ if ($environment_variables->isNotEmpty()) {+ $envs_base64 = base64_encode($environment_variables->implode("\n"));++ $this->application_deployment_queue->addLogEntry('Creating build-time .env file in /artifacts (outside Docker context).', hidden: true);+ $this->execute_remote_command([executeInDocker($this->deployment_uuid, "echo '$envs_base64' | base64 -d | tee ".self::BUILD_TIME_ENV_PATH.' > /dev/null'),- 'skip_command_log' => true,- ]- );+ ]);- if (isDev()) {- $this->execute_remote_command(- [+ if (isDev()) {+ $this->execute_remote_command([executeInDocker($this->deployment_uuid, 'cat '.self::BUILD_TIME_ENV_PATH),'hidden' => true,- ]- );+ ]);+ }+ } elseif (in_array($this->build_pack, ['dockercompose', 'dockerfile', 'railpack'], true)) {+ $this->application_deployment_queue->addLogEntry('Creating empty build-time .env file in /artifacts (no build-time variables defined).', hidden: true);+ $this->execute_remote_command([+ executeInDocker($this->deployment_uuid, 'touch '.self::BUILD_TIME_ENV_PATH),+ ]);}- } elseif (in_array($this->build_pack, ['dockercompose', 'dockerfile', 'railpack'], true)) {- // For build packs that source the build-time .env file, create an empty file even if there are no build-time variables- // This ensures the file exists when referenced in build commands- $this->application_deployment_queue->addLogEntry('Creating empty build-time .env file in /artifacts (no build-time variables defined).', hidden: true);- $this->execute_remote_command(- [- executeInDocker($this->deployment_uuid, 'touch '.self::BUILD_TIME_ENV_PATH),- ]- );+ return;+ }++ $this->useBuildtimeEnvironmentLauncher = true;++ $launcher = [+ '#!/bin/bash',+ 'set -a',+ 'source '.self::BUILD_TIME_SHELL_ENV_PATH,+ 'set +a',+ ];++ $launcher[] = 'exec env \\';+ foreach ($dotted_environment_variables as $environmentVariable) {+ $launcher[] = " {$environmentVariable} \\";}+ $launcher[] = ' "$@"';++ $files = [+ self::BUILD_TIME_ENV_PATH => $environment_variables->implode("\n"),+ self::BUILD_TIME_SHELL_ENV_PATH => $shell_environment_variables->implode("\n"),+ self::BUILD_TIME_ENV_LAUNCHER_PATH => implode("\n", $launcher)."\n",+ ];++ $this->application_deployment_queue->addLogEntry('Creating build-time environment files in /artifacts (outside Docker context).', hidden: true);++ foreach ($files as $path => $contents) {+ $contents_base64 = base64_encode($contents);+ $this->execute_remote_command([+ executeInDocker($this->deployment_uuid, "echo '$contents_base64' | base64 -d | tee {$path} > /dev/null"),+ ]);+ }++ $this->execute_remote_command([+ executeInDocker($this->deployment_uuid, 'chmod 700 '.self::BUILD_TIME_ENV_LAUNCHER_PATH),+ ]);}private function elixir_finetunes()diff --cc app/Livewire/Notifications/Telegram.phpindex 51239b8621,9f19b22f5f..f999294477--- a/app/Livewire/Notifications/Telegram.php+++ b/app/Livewire/Notifications/Telegram.php@@@ -263,10 -252,36 +263,38 @@@ class Telegram extends Componen}}+ public function toggleTelegramEnabled(): void+ {+ try {+ $this->resetErrorBag();++ if ($this->telegramEnabled) {+ $this->telegramEnabled = false;+ } else {+ $this->validate([+ 'telegramToken' => 'required',+ 'telegramChatId' => 'required',+ ], [+ 'telegramToken.required' => 'Telegram Token is required.',+ 'telegramChatId.required' => 'Telegram Chat ID is required.',+ ]);+ $this->telegramEnabled = true;+ }++ $this->saveModel();+ } catch (\Throwable $e) {+ $this->syncData();++ handleError($e, $this);+ } finally {+ $this->dispatch('refresh');+ }+ }+public function saveModel(){+ $this->authorize('update', $this->settings);+$this->syncData(true);refreshSession();$this->dispatch('success', 'Settings saved.');diff --cc app/Livewire/Project/Database/BackupEdit.phpindex 28f7e02556,608d153ebc..1d223b6967--- a/app/Livewire/Project/Database/BackupEdit.php+++ b/app/Livewire/Project/Database/BackupEdit.php@@@ -207,12 -207,20 +207,20 @@@ class BackupEdit extends Componen}}+ $database = $this->backup->database;+ $backupUuid = $this->backup->uuid;$this->backup->delete();+ auditLog('ui.database.backup_schedule_deleted', [+ 'team_id' => $database->team()?->id,+ 'database_uuid' => $database->uuid,+ 'database_name' => $database->name,+ 'backup_uuid' => $backupUuid,+ ]);- if ($this->backup->database->getMorphClass() === ServiceDatabase::class) {- $serviceDatabase = $this->backup->database;+ if ($database->getMorphClass() === ServiceDatabase::class) {+ $serviceDatabase = $database;- return redirect()->route('project.service.database.backups', [+ return redirectRoute($this, 'project.service.database.backups', ['project_uuid' => $this->parameters['project_uuid'],'environment_uuid' => $this->parameters['environment_uuid'],'service_uuid' => $serviceDatabase->service->uuid,diff --cc app/Livewire/Project/Shared/EnvironmentVariable/Show.phpindex 8350cffa4c,4b68c4d8f1..fea181395c--- a/app/Livewire/Project/Shared/EnvironmentVariable/Show.php+++ b/app/Livewire/Project/Shared/EnvironmentVariable/Show.php@@@ -164,7 -169,23 +171,24 @@@ class Show extends Componen$this->valuesLoaded = true;}+ public function copyValue(): ?string+ {+ if ($this->env->is_shown_once || (auth()->user()?->isMember() ?? true)) {+ return null;+ }++ if (! $this->env instanceof ModelsEnvironmentVariable) {+ return $this->env->value;+ }++ return $this->env->get_real_environment_variables_with_server(+ $this->env->resolveReferencedValue(),+ $this->env->resourceable,+ );+ }+- public function syncData(bool $toModel = false)+ private function syncData(bool $toModel = false): void++{if ($toModel) {$this->key = ValidationPatterns::normalizeEnvironmentVariableKey($this->key);diff --cc app/Models/Application.phpindex f8eb75a5ab,2fa1cff990..e7c2c1d90e--- a/app/Models/Application.php+++ b/app/Models/Application.php@@@ -7,8 -7,7 +7,10 @@@ use App\Services\ConfigurationGeneratoruse App\Services\DeploymentConfiguration\ApplicationConfigurationSnapshot;use App\Services\DeploymentConfiguration\ConfigurationDiff;use App\Services\DeploymentConfiguration\ConfigurationDiffer;+use App\Support\DomainPortOverrides;+use App\Support\DomainUrlParts;+ use App\Traits\Auditable;++use App\Traits\ClearsGlobalSearchCache;use App\Traits\HasConfiguration;use App\Traits\HasMetrics;diff --cc app/Models/Service.phpindex 66c67ca8de,429422b90e..11756f3c7e--- a/app/Models/Service.php+++ b/app/Models/Service.php@@@ -4,9 -4,10 +4,12 @@@ namespace App\Modelsuse App\Enums\ProcessStatus;use App\Services\ContainerStatusAggregator;+use App\Support\DomainPortOverrides;+ use App\Traits\Auditable;++use App\Traits\ClearsGlobalSearchCache;use App\Traits\HasSafeStringAttribute;+ use App\Traits\HasSecretManager;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\Relations\HasMany;diff --cc app/Models/StandaloneClickhouse.phpindex ee8558bb0a,6265345ee9..a627d00aa6--- a/app/Models/StandaloneClickhouse.php+++ b/app/Models/StandaloneClickhouse.php@@@ -5,16 -6,18 +6,21 @@@ use App\Traits\Auditableuse App\Traits\ClearsGlobalSearchCache;use App\Traits\HasDatabaseHealthCheck;use App\Traits\HasMetrics;+use App\Traits\HasRestartLimit;use App\Traits\HasSafeStringAttribute;+ use App\Traits\HasSecretManager;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\SoftDeletes;class StandaloneClickhouse extends BaseModel{- use ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, SoftDeletes;- use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++++ use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++ protected array $auditExclude = ['last_online_at'];++protected $fillable = ['uuid','name',diff --cc app/Models/StandaloneDragonfly.phpindex c728419550,da4804dd2d..8371bd0493--- a/app/Models/StandaloneDragonfly.php+++ b/app/Models/StandaloneDragonfly.php@@@ -5,15 -6,15 +6,18 @@@ use App\Traits\Auditableuse App\Traits\ClearsGlobalSearchCache;use App\Traits\HasDatabaseHealthCheck;use App\Traits\HasMetrics;+use App\Traits\HasRestartLimit;use App\Traits\HasSafeStringAttribute;+ use App\Traits\HasSecretManager;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\SoftDeletes;class StandaloneDragonfly extends BaseModel{- use ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, SoftDeletes;- use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++++ use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++protected $fillable = ['uuid',diff --cc app/Models/StandaloneKeydb.phpindex 9c4e4aa664,f4dbaec210..bbe55a4f5a--- a/app/Models/StandaloneKeydb.php+++ b/app/Models/StandaloneKeydb.php@@@ -5,15 -6,15 +6,18 @@@ use App\Traits\Auditableuse App\Traits\ClearsGlobalSearchCache;use App\Traits\HasDatabaseHealthCheck;use App\Traits\HasMetrics;+use App\Traits\HasRestartLimit;use App\Traits\HasSafeStringAttribute;+ use App\Traits\HasSecretManager;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\SoftDeletes;class StandaloneKeydb extends BaseModel{- use ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, SoftDeletes;- use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++++ use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++protected $fillable = ['uuid',diff --cc app/Models/StandaloneMariadb.phpindex 4eada8a008,c923b489bd..d35509ce99--- a/app/Models/StandaloneMariadb.php+++ b/app/Models/StandaloneMariadb.php@@@ -5,8 -6,8 +6,9 @@@ use App\Traits\Auditableuse App\Traits\ClearsGlobalSearchCache;use App\Traits\HasDatabaseHealthCheck;use App\Traits\HasMetrics;+use App\Traits\HasRestartLimit;use App\Traits\HasSafeStringAttribute;+ use App\Traits\HasSecretManager;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\Relations\MorphTo;@@@ -14,7 -15,7 +16,9 @@@ use Illuminate\Database\Eloquent\SoftDeclass StandaloneMariadb extends BaseModel{- use ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, SoftDeletes;- use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++++ use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++protected $fillable = ['uuid',diff --cc app/Models/StandaloneMongodb.phpindex d0a68d4e71,70b108087a..faf54e0e71--- a/app/Models/StandaloneMongodb.php+++ b/app/Models/StandaloneMongodb.php@@@ -5,15 -6,15 +6,18 @@@ use App\Traits\Auditableuse App\Traits\ClearsGlobalSearchCache;use App\Traits\HasDatabaseHealthCheck;use App\Traits\HasMetrics;+use App\Traits\HasRestartLimit;use App\Traits\HasSafeStringAttribute;+ use App\Traits\HasSecretManager;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\SoftDeletes;class StandaloneMongodb extends BaseModel{- use ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, SoftDeletes;- use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++++ use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++protected $fillable = ['uuid',diff --cc app/Models/StandaloneMysql.phpindex 4f9e737193,6a08a4dc45..5a1ecb8425--- a/app/Models/StandaloneMysql.php+++ b/app/Models/StandaloneMysql.php@@@ -5,15 -6,15 +6,18 @@@ use App\Traits\Auditableuse App\Traits\ClearsGlobalSearchCache;use App\Traits\HasDatabaseHealthCheck;use App\Traits\HasMetrics;+use App\Traits\HasRestartLimit;use App\Traits\HasSafeStringAttribute;+ use App\Traits\HasSecretManager;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\SoftDeletes;class StandaloneMysql extends BaseModel{- use ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, SoftDeletes;- use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++++ use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++protected $fillable = ['uuid',diff --cc app/Models/StandalonePostgresql.phpindex 6027288552,f8dc5c0caa..e91539d55b--- a/app/Models/StandalonePostgresql.php+++ b/app/Models/StandalonePostgresql.php@@@ -5,15 -6,15 +6,18 @@@ use App\Traits\Auditableuse App\Traits\ClearsGlobalSearchCache;use App\Traits\HasDatabaseHealthCheck;use App\Traits\HasMetrics;+use App\Traits\HasRestartLimit;use App\Traits\HasSafeStringAttribute;+ use App\Traits\HasSecretManager;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\SoftDeletes;class StandalonePostgresql extends BaseModel{- use ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, SoftDeletes;- use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++++ use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++protected $fillable = ['uuid',diff --cc app/Models/StandaloneRedis.phpindex 8a74824be8,3bfcc5434e..674f7867fd--- a/app/Models/StandaloneRedis.php+++ b/app/Models/StandaloneRedis.php@@@ -5,16 -6,18 +6,21 @@@ use App\Traits\Auditableuse App\Traits\ClearsGlobalSearchCache;use App\Traits\HasDatabaseHealthCheck;use App\Traits\HasMetrics;+use App\Traits\HasRestartLimit;use App\Traits\HasSafeStringAttribute;+ use App\Traits\HasSecretManager;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\SoftDeletes;class StandaloneRedis extends BaseModel{- use ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, SoftDeletes;- use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++++ use Auditable, ClearsGlobalSearchCache, HasDatabaseHealthCheck, HasFactory, HasMetrics, HasRestartLimit, HasSafeStringAttribute, HasSecretManager, SoftDeletes;++ protected array $auditExclude = ['last_online_at'];++protected $fillable = ['uuid','name',diff --cc resources/views/livewire/project/application/heading.blade.phpindex 15181987ce,df7522eacf..06d07d9ffe--- a/resources/views/livewire/project/application/heading.blade.php+++ b/resources/views/livewire/project/application/heading.blade.php@@@ -43,110 -40,62 +40,69 @@@<div class="w-full xl:hidden">@if (!($application->build_pack === 'dockercompose' && is_null($application->docker_compose_raw)))@can('deploy', $application)- <div id="application-mobile-actions" class="relative mb-3"- x-data="{ open: false }" @click.outside="open = false"- @keydown.escape.window="open = false">- <button type="button" class="button w-full justify-between" @click="open = !open"- :aria-expanded="open" aria-haspopup="menu">- <span class="inline-flex items-center gap-2">- Actions- </span>- <span class="inline-flex transition-transform" :class="open && 'rotate-180'">- <x-reicon name="chevron-down" class="size-3 opacity-55" />- </span>- </button>-- <div x-cloak x-show="open" x-transition.origin.top.left- class="listbox-panel top-full! left-0! right-0! mt-1! w-full! min-w-0!" role="menu">- @if (!str($application->status)->startsWith('exited'))+ <x-split-action id="application-mobile-actions" class="mb-3 flex w-full">+ @if (str($application->status)->startsWith('exited'))+ <x-slot:main wire:click="deploy">+ <x-reicon name="play-circle" class="size-3.5" />- Deploy++ {{ $application->stoppedAfterRestartLimit() ? 'Retry deployment' : 'Deploy' }}+ </x-slot:main>@if (!$application->destination->server->isSwarm())- @can('deploy', $application)- <button type="button" class="listbox-option justify-start! gap-2.5!"- wire:click="deploy" @click="open = false" role="menuitem">- <x-reicon name="refresh" class="size-3.5 opacity-70" />- Deploy- </button>- @else- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled- role="menuitem">- <x-reicon name="refresh" class="size-3.5 opacity-70" />- Deploy- </button>- @endcan- @endif- @if ($application->build_pack !== 'dockercompose')- @if ($application->destination->server->isSwarm())- @can('deploy', $application)- <button type="button" class="listbox-option justify-start! gap-2.5!"- wire:click="deploy" @click="open = false" role="menuitem">- <x-reicon name="refresh" class="size-3.5 opacity-70" />- Update Service- </button>- @else- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled- role="menuitem">- <x-reicon name="refresh" class="size-3.5 opacity-70" />- Update Service- </button>- @endcan- @else- @can('deploy', $application)- <button type="button" class="listbox-option justify-start! gap-2.5!"- @click="open = false; document.getElementById('application-mobile-restart-trigger')?.click()"- role="menuitem">- <x-reicon name="restart" class="size-3.5 opacity-70" />- Restart- </button>- @else- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled- role="menuitem">- <x-reicon name="restart" class="size-3.5 opacity-70" />- Restart- </button>- @endcan- @endif+ <button type="button" class="listbox-option justify-start! gap-2.5!" wire:click="deploy(true)"+ @click="open = false" role="menuitem">+ <x-reicon name="refresh" class="size-3.5 opacity-70" />- Deploy (without cache)++ {{ $application->stoppedAfterRestartLimit() ? 'Retry deployment (without cache)' : 'Deploy (without cache)' }}++ </button>+ @endif- @else- @can('deploy', $application)++ @if ($application->container_present !== false)+ <button type="button" class="listbox-option justify-start! gap-2.5!"- wire:click="deploy" @click="open = false" role="menuitem">- <x-reicon name="play-circle" class="size-3.5 opacity-70" />- {{ $application->stoppedAfterRestartLimit() ? 'Retry deployment' : 'Deploy' }}++ @click="open = false; document.getElementById('application-mobile-stop-trigger')?.click()" role="menuitem">++ <x-reicon name="stop-circle" class="size-3.5 text-error" />++ Remove container</button>+ @endif+ @else+ @if ($application->destination->server->isSwarm())+ @if ($application->build_pack !== 'dockercompose')+ <x-slot:main wire:click="deploy">+ <x-reicon name="refresh" class="size-3.5" />+ Update Service+ </x-slot:main>+ @else+ <x-slot:main @click="document.getElementById('application-mobile-stop-trigger')?.click()">+ <x-reicon name="stop-circle" class="size-3.5" />+ Stop+ </x-slot:main>+ @endif@else- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled- role="menuitem">- <x-reicon name="play-circle" class="size-3.5 opacity-70" />- {{ $application->stoppedAfterRestartLimit() ? 'Retry deployment' : 'Deploy' }}- </button>- @endcan- @endif- @if (!$application->destination->server->isSwarm())- @can('deploy', $application)+ <x-slot:main wire:click="deploy">+ <x-reicon name="refresh" class="size-3.5" />+ Redeploy+ </x-slot:main><button type="button" class="listbox-option justify-start! gap-2.5!"- wire:click="{{ $application->status === 'running' ? 'force_deploy_without_cache' : 'deploy(true)' }}"+ wire:click="{{ str($application->status)->startsWith('running') ? 'force_deploy_without_cache' : 'deploy(true)' }}"@click="open = false" role="menuitem"><x-reicon name="refresh" class="size-3.5 opacity-70" />- {{ $application->stoppedAfterRestartLimit() ? 'Retry deployment (without cache)' : 'Deploy (without cache)' }}+ {{ str($application->status)->startsWith('running') ? 'Redeploy (without cache)' : 'Deploy (without cache)' }}</button>- @else- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled+ @if ($application->build_pack !== 'dockercompose')+ <button type="button" class="listbox-option justify-start! gap-2.5!"+ @click="open = false; document.getElementById('application-mobile-restart-trigger')?.click()"+ role="menuitem">+ <x-reicon name="restart" class="size-3.5 opacity-70" />+ Restart+ </button>+ @endif+ @endif+ @unless ($application->destination->server->isSwarm() && $application->build_pack === 'dockercompose')+ <button type="button" class="listbox-option justify-start! gap-2.5!"+ @click="open = false; document.getElementById('application-mobile-stop-trigger')?.click()"role="menuitem">- <x-reicon name="refresh" class="size-3.5 opacity-70" />- {{ $application->stoppedAfterRestartLimit() ? 'Retry deployment (without cache)' : 'Deploy (without cache)' }}+ <x-reicon name="stop-circle" class="size-3.5 text-error" />+ Stop</button>- @endcan+ @endunless@endif- @if (!str($application->status)->startsWith('exited') || $application->container_present !== false)- <button type="button" class="listbox-option justify-start! gap-2.5!"- @click="open = false; document.getElementById('application-mobile-stop-trigger')?.click()"- role="menuitem">- <x-reicon name="stop-circle" class="size-3.5 text-error" />- {{ str($application->status)->startsWith('exited') ? 'Remove container' : 'Stop' }}- </button>- @endif- </div>- </div>+ </x-split-action>@endcan@endif<div class="hidden" aria-hidden="true">@@@ -188,38 -134,17 +144,24 @@@<x-applications.links :application="$application" /></div>@can('deploy', $application)- <div id="application-desktop-actions" class="relative" x-data="{ open: false }"- x-effect="$dispatch('resource-actions-toggled', { open })"- @click.outside="open = false" @keydown.escape.window="open = false">- <button type="button" class="button button-highlighted" @click="open = !open" :aria-expanded="open"- aria-haspopup="menu">- Actions- <x-reicon name="chevron-down" class="size-3 opacity-55" />- </button>-- <div x-cloak x-show="open" x-transition.origin.top.right- class="listbox-panel top-full! right-0! left-auto! mt-1! w-60! min-w-0!" role="menu">+ <x-split-action id="application-desktop-actions">@if (str($application->status)->startsWith('exited'))- <button type="button" class="listbox-option justify-start! gap-2.5!"- @disabled(!auth()->user()->can('deploy', $application))- wire:click="deploy" @click="open = false" role="menuitem">- <x-reicon name="play-circle" class="size-3.5 opacity-70" />+ <x-slot:main wire:click="deploy">+ <x-reicon name="play-circle" class="size-3.5" />- Deploy+ {{ $application->stoppedAfterRestartLimit() ? 'Retry deployment' : 'Deploy' }}- </button>+ </x-slot:main>@if (!$application->destination->server->isSwarm())- <button type="button" class="listbox-option justify-start! gap-2.5!"- @disabled(!auth()->user()->can('deploy', $application))- wire:click="deploy(true)" @click="open = false" role="menuitem">+ <button type="button" class="listbox-option justify-start! gap-2.5!" wire:click="deploy(true)"+ @click="open = false" role="menuitem"><x-reicon name="refresh" class="size-3.5 opacity-70" />- Deploy (without cache)+ {{ $application->stoppedAfterRestartLimit() ? 'Retry deployment (without cache)' : 'Deploy (without cache)' }}+ </button>+ @endif+ @if ($application->container_present !== false)+ <button type="button" class="listbox-option justify-start! gap-2.5!"- @click="open = false; document.getElementById('application-mobile-stop-trigger')?.click()"- role="menuitem">++ @click="open = false; document.getElementById('application-mobile-stop-trigger')?.click()" role="menuitem">+ <x-reicon name="stop-circle" class="size-3.5 text-error" />+ Remove container</button>@endif@elsediff --cc resources/views/livewire/project/service/heading.blade.phpindex e7da50c809,d08572dd7c..7604d7d0cc--- a/resources/views/livewire/project/service/heading.blade.php+++ b/resources/views/livewire/project/service/heading.blade.php@@@ -87,58 -74,23 +74,28 @@@<div class="w-full xl:hidden">@if ($service->isDeployable)@can('deploy', $service)- <div id="service-mobile-actions" class="relative mb-3"- x-data="{ open: false }" @click.outside="open = false"- @keydown.escape.window="open = false">- <button type="button" class="button w-full justify-between" x-bind:disabled="deploying"- @click="open = !open"- :aria-expanded="open" aria-haspopup="menu">- <span class="inline-flex items-center gap-2">- <x-loading-on-button x-show="deploying" x-cloak />- <span x-text="deploying ? 'Deploying…' : 'Actions'">Actions</span>- </span>- <span class="inline-flex transition-transform" :class="open && 'rotate-180'">- <x-reicon name="chevron-down" class="size-3 opacity-55" />- </span>- </button>-- <div x-cloak x-show="open" x-transition.origin.top.left- class="listbox-panel top-full! left-0! right-0! mt-1! w-full! min-w-0!" role="menu">+ <x-split-action id="service-mobile-actions" class="mb-3 flex w-full">- @if ($serviceStatus->contains('running') || $serviceStatus->contains('degraded'))+ @if ($selectedResource && $selectedResource->container_present !== false && $selectedResourceStatus->startsWith('exited'))- <button type="button" class="listbox-option justify-start! gap-2.5!"- @click="open = false; document.getElementById('selected-resource-remove-trigger')?.click()"- role="menuitem">- <x-reicon name="trash" class="size-3.5 text-error" />++ <x-slot:main @click="document.getElementById('selected-resource-remove-trigger')?.click()">++ <x-reicon name="trash" class="size-3.5" />+ Remove container- </button>++ </x-slot:main>+ @elseif ($serviceStatus->contains('running') || $serviceStatus->contains('degraded'))- @can('deploy', $service)- <button type="button" class="listbox-option justify-start! gap-2.5!"- @click="open = false; document.getElementById('service-restart-trigger')?.click()"- role="menuitem">- <x-reicon name="restart" class="size-3.5 opacity-70" />- Restart current version- </button>- @else- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled- role="menuitem">- <x-reicon name="restart" class="size-3.5 opacity-70" />- Restart current version- </button>- @endcan+ <x-slot:main x-bind:disabled="deploying"+ @click="document.getElementById('service-restart-trigger')?.click()">+ <x-reicon name="restart" class="size-3.5" />+ Restart+ </x-slot:main>@if ($serviceStatus->contains('running'))<button type="button" class="listbox-option justify-start! gap-2.5!"- @disabled(!auth()->user()->can('deploy', $service))- @click="$wire.dispatch('pullAndRestartEvent'); open = false"- role="menuitem">+ @click="$wire.dispatch('pullAndRestartEvent'); open = false" role="menuitem"><x-reicon name="refresh" class="size-3.5 opacity-70" />- Pull latest and restart+ Restart (pull latest)</button>- @else+ @endif+ @if ($serviceStatus->contains('degraded'))<button type="button" class="listbox-option justify-start! gap-2.5!"- @disabled(!auth()->user()->can('deploy', $service))- @click="$wire.dispatch('forceDeployEvent'); open = false"- role="menuitem">+ @click="$wire.dispatch('forceDeployEvent'); open = false" role="menuitem"><x-reicon name="refresh" class="size-3.5 opacity-70" />Force Restart</button>@@@ -206,59 -140,23 +145,28 @@@<x-services.links :service="$service" /></div>@can('deploy', $service)- <div id="service-desktop-actions" class="relative" x-data="{ open: false }"- x-effect="$dispatch('resource-actions-toggled', { open })"- @click.outside="open = false" @keydown.escape.window="open = false">- <button type="button" class="button button-highlighted" @click="open = !open" :aria-expanded="open">- Actions- <x-reicon name="chevron-down" class="size-3 opacity-55" />- </button>- <div x-cloak x-show="open" x-transition.origin.top.right- class="listbox-panel top-full! right-0! left-auto! mt-1! w-64! min-w-0!" role="menu">- @if ($selectedResource && $selectedResource->container_present !== false && $selectedResourceStatus->startsWith('exited'))- <button type="button" class="listbox-option justify-start! gap-2.5!"- @click="open = false; document.getElementById('selected-resource-remove-trigger')?.click()"- role="menuitem">- <x-reicon name="trash" class="size-3.5 text-error" />- Remove container- </button>- @else- @if ($serviceStatus->contains('running') || $serviceStatus->contains('degraded'))- <button type="button" class="listbox-option justify-start! gap-2.5!"- @disabled(!auth()->user()->can('deploy', $service))- @click="open = false; document.getElementById('service-restart-trigger')?.click()">- <x-reicon name="restart" class="size-3.5 opacity-70" />- Restart- </button>- @if ($serviceStatus->contains('running'))- <button type="button" class="listbox-option justify-start! gap-2.5!"- @disabled(!auth()->user()->can('deploy', $service))- @click="$wire.dispatch('pullAndRestartEvent'); open = false">- <x-reicon name="refresh" class="size-3.5 opacity-70" />- Restart (pull latest)- </button>- @endif- <button type="button" class="listbox-option justify-start! gap-2.5!"- @disabled(!auth()->user()->can('stop', $service))- @click="open = false; document.getElementById('service-stop-trigger')?.click()">- <x-reicon name="stop-circle" class="size-3.5 text-error" />- Stop- </button>- @elseif (! $serviceStatus->contains('running'))+ <x-split-action id="service-desktop-actions">- @if ($serviceStatus->contains('running') || $serviceStatus->contains('degraded'))++ @if ($selectedResource && $selectedResource->container_present !== false && $selectedResourceStatus->startsWith('exited'))++ <x-slot:main @click="document.getElementById('selected-resource-remove-trigger')?.click()">++ <x-reicon name="trash" class="size-3.5" />++ Remove container++ </x-slot:main>++ @elseif ($serviceStatus->contains('running') || $serviceStatus->contains('degraded'))+ <x-slot:main x-bind:disabled="deploying"+ @click="document.getElementById('service-restart-trigger')?.click()">+ <x-reicon name="restart" class="size-3.5" />+ Restart+ </x-slot:main>+ @if ($serviceStatus->contains('running'))<button type="button" class="listbox-option justify-start! gap-2.5!"- @disabled(!auth()->user()->can('deploy', $service))- @click="deploying = true; $wire.dispatch('startEvent'); open = false">- <x-reicon name="play-circle" class="size-3.5 opacity-70" />- Deploy+ @click="$wire.dispatch('pullAndRestartEvent'); open = false" role="menuitem">+ <x-reicon name="refresh" class="size-3.5 opacity-70" />+ Restart (pull latest)</button>@endif- @if (! $serviceStatus->contains('running'))- <div class="my-1 border-t border-coolgray-200 dark:border-coolgray-300" role="separator"></div>- @endif@if ($serviceStatus->contains('degraded'))<button type="button" class="listbox-option justify-start! gap-2.5!"- @disabled(!auth()->user()->can('deploy', $service))- @click="$wire.dispatch('forceDeployEvent'); open = false">+ @click="$wire.dispatch('forceDeployEvent'); open = false" role="menuitem"><x-reicon name="refresh" class="size-3.5 opacity-70" />Force Restart</button>diff --cc resources/views/livewire/project/shared/environment-variable/show.blade.phpindex a2231ff49c,972cbdf3e7..30ef3f6598--- a/resources/views/livewire/project/shared/environment-variable/show.blade.php+++ b/resources/views/livewire/project/shared/environment-variable/show.blade.php@@@ -149,12 -152,16 +152,14 @@@</label><div class="relative">@if (!$valuesLoaded)- <div class="input input-with-password-toggle flex w-full items-center text-neutral-500 dark:text-fg-dim"- aria-busy="true">- <x-loading text="Loading value..." />- </div>+ <x-forms.input loading loadingText="Loading value..."+ defaultClass="input input-with-password-toggle" />@else<x-forms.env-var-input id="value" type="password"+ canGate="manageEnvironment" :canResource="$this->resource":required="$is_redis_credential" :disabled="!$canEditValue":availableVars="$isSharedVariable ? [] : $this->availableSharedVariables"+ :hasVaultSource="$this->hasSecretManagerSource()":projectUuid="data_get($parameters, 'project_uuid')":environmentUuid="data_get($parameters, 'environment_uuid')":serverUuid="data_get($parameters, 'server_uuid')" />diff --cc tests/Feature/PersistentStorageVolumesLayoutTest.phpindex f3938b87ff,d906cfb6a1..d7ae4ba8c0--- a/tests/Feature/PersistentStorageVolumesLayoutTest.php+++ b/tests/Feature/PersistentStorageVolumesLayoutTest.php@@@ -33,16 -33,7 +33,19 @@@ it('keeps storage backup schedule table->and($css)->toMatch('/\.backup-table-grid\s*\{[^}]*min-width:\s*50rem;/');});+++it('keeps nested storage component keys stable when mounts are added or deleted', function () {+ $view = file_get_contents(resource_path('views/livewire/project/service/storage.blade.php'));++ expect($view)+ ->toContain('wire:key="volumes-{{ $resource->id }}"')+ ->toContain('wire:key="svc-volumes-{{ $resource->id }}"')+ ->not->toContain('wire:key="volumes-{{ $resource->id }}-{{ $this->volumeCount }}"')+ ->not->toContain('wire:key="svc-volumes-{{ $resource->id }}-{{ $this->volumeCount }}"');+});++++ use App\Livewire\Project\Service\Storage;use App\Livewire\Project\Service\VolumeBackup\Create as CreateServiceVolumeBackup;use App\Livewire\Project\Shared\Storages\All;use App\Models\Application;diff --cc tests/v4/Feature/DangerDeleteResourceTest.phpindex af409a3c46,4a275ad484..655aec85fe--- a/tests/v4/Feature/DangerDeleteResourceTest.php+++ b/tests/v4/Feature/DangerDeleteResourceTest.php@@@ -5,9 -4,9 +5,10 @@@ use App\Livewire\Project\Shared\Dangeruse App\Models\Application;use App\Models\Environment;use App\Models\InstanceSettings;+ use App\Models\OauthIdentity;use App\Models\Project;use App\Models\Server;+use App\Models\Service;use App\Models\StandaloneDocker;use App\Models\Team;use App\Models\User;@@@ -63,30 -62,30 +64,45 @@@ test('delete returns error string whenexpect(Application::find($this->application->id))->not->toBeNull();});-test('delete succeeds with correct password and redirects', function () {- Livewire::test(Danger::class, ['resource' => $this->application])+test('delete redirects before dispatching resource cleanup after the response', function () {+ $service = Service::factory()->create([+ 'environment_id' => $this->environment->id,+ 'server_id' => $this->server->id,+ 'destination_id' => $this->destination->id,+ 'destination_type' => $this->destination->getMorphClass(),+ ]);++ $component = Livewire::test(Danger::class, ['resource' => $service])+ ->set('projectUuid', $this->project->uuid)+ ->set('environmentUuid', $this->environment->uuid)->call('delete', 'test-password')- ->assertHasNoErrors();+ ->assertHasNoErrors()+ ->assertRedirectToRoute('project.resource.index', [+ 'project_uuid' => $this->project->uuid,+ 'environment_uuid' => $this->environment->uuid,+ ]);- // Resource should be soft-deleted- expect(Application::find($this->application->id))->toBeNull();+ expect($component->effects)->toHaveKey('redirectUsingNavigate', true);++ expect(Service::find($service->id))->not->toBeNull();+ Queue::assertPushed(DeleteResourceJob::class, fn (DeleteResourceJob $job) => $job->resource->is($service));});+ test('delete succeeds without password for an oauth user', function () {+ OauthIdentity::create([+ 'user_id' => $this->user->id,+ 'provider' => 'oidc',+ 'issuer' => 'https://idp.example.com',+ 'provider_user_id' => 'oauth-user-id',+ ]);++ Livewire::test(Danger::class, ['resource' => $this->application])+ ->call('delete', '')+ ->assertHasNoErrors();++ expect(Application::find($this->application->id))->toBeNull();+ });+test('delete applies selectedActions from checkbox state', function () {$component = Livewire::test(Danger::class, ['resource' => $this->application])->call('delete', 'test-password', ['delete_configurations', 'docker_cleanup']);