mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
feat(logging): strengthen secret redaction and add admin controls (#12151)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user