coolify/app/Traits
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
..
AuthorizesResourceCreation.php
CalculatesExcludedStatus.php fix: don't show health status for exited containers 2025-11-24 09:09:37 +01:00
ClearsGlobalSearchCache.php feat(global-search): integrate projects and environments into global search functionality 2025-09-30 13:37:03 +02:00
DeletesUserSessions.php Changes auto-committed by Conductor 2025-10-16 09:51:37 +02:00
EnvironmentVariableAnalyzer.php fix(environment-variables): correct method call syntax in analyzeBuildVariable function 2025-09-23 11:40:56 +02:00
EnvironmentVariableProtection.php feat(deployment): add SERVICE_NAME variables for service discovery 2025-09-08 15:22:44 +02:00
ExecuteRemoteCommand.php feat(deployment): add command_hidden flag to hide command text in logs 2026-03-25 16:48:49 +01:00
HasConfiguration.php
HasMetrics.php fix(sentinel): auto-regenerate invalid or undecryptable tokens 2026-04-29 16:44:12 +02:00
HasNotificationSettings.php feat(security): support expiration on API tokens with warning notifications 2026-04-20 14:28:38 +02:00
HasSafeStringAttribute.php
SaveFromRedirect.php
SshRetryable.php refactor(ssh-retry): remove Sentry tracking from retry logic 2026-02-15 14:00:27 +01:00