mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-21 00:24:36 +00:00
fix(v5): rotate agent tokens every fifteen minutes
This commit is contained in:
@@ -57,7 +57,7 @@ class Kernel extends ConsoleKernel
|
||||
|
||||
// V5 host JWT rotation: re-mints and SSH-pushes a fresh host token
|
||||
// before the on-disk token expires so coold reconnects stay authorized.
|
||||
$this->scheduleInstance->job(new V5RotateAgentTokensJob)->hourly()->withoutOverlapping()->onOneServer();
|
||||
$this->scheduleInstance->job(new V5RotateAgentTokensJob)->everyFifteenMinutes()->withoutOverlapping()->onOneServer();
|
||||
|
||||
if (isDev()) {
|
||||
// Instance Jobs
|
||||
|
||||
@@ -48,3 +48,15 @@ it('schedules every production job with onOneServer', function () {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('runs v5 agent token rotation often enough for the default ttl and refresh threshold', function () {
|
||||
$schedule = app(Schedule::class);
|
||||
|
||||
$event = collect($schedule->events())->first(
|
||||
fn ($e) => str_contains((string) $e->description, 'V5RotateAgentTokensJob')
|
||||
);
|
||||
|
||||
expect($event)->not->toBeNull();
|
||||
expect($event->expression)->toBe('*/15 * * * *');
|
||||
expect($event->onOneServer)->toBeTrue();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user