Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(v5): rotate agent tokens every fifteen minutes

Andras Bacsaifbc6fd5ce523
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index f06bec45c2..cb79950825 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -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
diff --git a/tests/Feature/ScheduleOnOneServerTest.php b/tests/Feature/ScheduleOnOneServerTest.php
index 167d16bfa2..3d31b9139e 100644
--- a/tests/Feature/ScheduleOnOneServerTest.php
+++ b/tests/Feature/ScheduleOnOneServerTest.php
@@ -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();
+});