feat(logging): strengthen secret redaction and add admin controls (#12151)

This commit is contained in:
Andras Bacsai
2026-10-13 20:43:19 +02:00
committed by GitHub
parent 9302395063
commit 448dc8ea0a
92 changed files with 4582 additions and 417 deletions
+6 -3
View File
@@ -99,14 +99,17 @@ class CoolifyTask implements ShouldBeEncrypted, ShouldQueue
'job' => 'CoolifyTask',
'activity_id' => $this->activity->id,
'server_uuid' => $this->activity->getExtraProperty('server_uuid'),
'error' => $exception?->getMessage(),
'error' => $exception ? remove_iip($exception->getMessage()) : null,
'total_attempts' => $this->attempts(),
'trace' => $exception?->getTraceAsString(),
]);
// A database import whose restore can still run in the database container stays in progress
// until its stop has run, so it keeps blocking other operations on the database.
if (DatabaseImportCleanup::stopAfterTaskFailure($this->activity, $exception?->getMessage() ?: 'Job permanently failed')) {
// The message can contain command output or the SSH command, so store only a redacted copy.
$message = filled($exception?->getMessage()) ? remove_iip($exception->getMessage()) : null;
if (DatabaseImportCleanup::stopAfterTaskFailure($this->activity, $message ?: 'Job permanently failed')) {
RemoteProcessCommand::forget($this->activity);
return;
@@ -118,7 +121,7 @@ class CoolifyTask implements ShouldBeEncrypted, ShouldQueue
$stopRequested = DatabaseImportCleanup::stopRequested($this->activity);
$this->activity->properties = $this->activity->properties->merge(array_filter([
'status' => ProcessStatus::ERROR->value,
'error' => $stopRequested ? null : ($exception?->getMessage() ?? 'Job permanently failed'),
'error' => $stopRequested ? null : ($message ?? 'Job permanently failed'),
'failed_at' => now()->toIso8601String(),
], fn ($value) => $value !== null));
$this->activity->save();