coolify/app/Actions/Server
Andras Bacsai 00d6e83e7f fix(sentinel): auto-regenerate invalid or undecryptable tokens
Replace hard validation error with self-healing token logic. Tokens that
are null, empty, or fail decryption are now regenerated automatically
rather than crashing sentinel startup or metrics reads.

Token format changed from encrypted JSON payload to a plain 64-char
random string (Str::random), eliminating double-encryption issues and
simplifying the validation regex to cover the new character set.

New `ensureValidSentinelToken()` method on ServerSetting centralises
the get-or-regenerate contract; both StartSentinel and HasMetrics now
delegate to it. HasMetrics logs a warning when regeneration occurs so
operators know a sentinel container restart is required.

`isValidSentinelToken()` now accepts `?string` (null → false).

Adds feature tests covering: null/empty/undecryptable stored values,
idempotent return of valid tokens, RuntimeException only when
regeneration itself produces an invalid token, no double-encryption of
newly generated tokens, and cast round-trip consistency.
2026-04-29 16:44:12 +02:00
..
CheckUpdates.php Add Arch Linux server support and fix package sanitization 2025-12-08 09:02:00 +01:00
CleanupDocker.php fix(server): exclude persistent resources from container prune 2026-04-19 15:17:47 +02:00
ConfigureCloudflared.php Revert "refactor(file-transfer): replace base64 encoding with direct file transfer method across multiple database actions for improved clarity and efficiency" 2025-09-15 17:55:08 +02:00
DeleteServer.php feat: implement Hetzner deletion failure notification system with email and messaging support 2025-10-10 09:35:58 +02:00
InstallDocker.php fix(models): replace forceFill/forceCreate with fill/create and add fillable guards 2026-03-31 13:45:31 +02:00
InstallPrerequisites.php Add Arch Linux server support and fix package sanitization 2025-12-08 09:02:00 +01:00
ResourcesCheck.php Revert "rector: arrrrr" 2025-01-07 15:31:43 +01:00
RestartContainer.php fix: restart sentinel once a day 2024-10-29 10:28:05 +01:00
RunCommand.php Inline many variables. 2024-10-31 18:20:11 +01:00
StartLogDrain.php fix(log-drain): prevent command injection by base64-encoding environment variables 2026-03-10 22:22:51 +01:00
StartSentinel.php fix(sentinel): auto-regenerate invalid or undecryptable tokens 2026-04-29 16:44:12 +02:00
StopLogDrain.php Revert "rector: arrrrr" 2025-01-07 15:31:43 +01:00
StopSentinel.php pint 2024-10-17 22:08:23 +02:00
UpdateCoolify.php Add human-friendly output to upgrade script 2025-12-12 15:18:57 +01:00
UpdatePackage.php Add package validation guard and make pacman idempotent 2025-12-08 09:17:24 +01:00
ValidatePrerequisites.php feat: enhance prerequisite validation to return detailed results 2025-11-21 13:14:48 +01:00
ValidateServer.php fix: sanitize error output in server validation logs 2026-03-26 18:36:36 +01:00