Show a maintenance page instead of a blank 500 and update in one click
Emergency layer logs fatal errors to var/log/notfall.log and answers 503. The system page checks for a new release on load, shows its notes, runs backup, download, switch, migration and health check in one flow with live progress, and switches back automatically when the new version fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
339a48c810
commit
a6a334fe68
15 files changed
+973
-42
No files matched your search
@@ -306,6 +306,38 @@ final class SystemScreenTest extends WebTestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testTheOneClickUpdateEndpointsAreForAdministratorsOnly(): void
|
||||
{
|
||||
// Der Fortschritt für die Systemseite (ADR 113): Redakteure sehen ihn nicht, ein Start
|
||||
// braucht das Token der Sitzung, ein Abschluss den Einmalschlüssel des laufenden Updates.
|
||||
$redaktion = $this->login('editor');
|
||||
$redaktion->request('GET', '/admin/system/update/status');
|
||||
self::assertSame(403, $redaktion->getResponse()->getStatusCode());
|
||||
|
||||
$admin = $this->login();
|
||||
$admin->request('GET', '/admin/system/update/status');
|
||||
self::assertSame(200, $admin->getResponse()->getStatusCode());
|
||||
self::assertArrayHasKey('installiert', json_decode((string) $admin->getResponse()->getContent(), true));
|
||||
|
||||
$admin->request('POST', '/admin/system/update/starten', [], [], ['HTTP_X_CSRF_TOKEN' => 'erfunden']);
|
||||
self::assertSame(403, $admin->getResponse()->getStatusCode());
|
||||
self::assertStringContainsString('Sitzung ist abgelaufen', (string) $admin->getResponse()->getContent());
|
||||
|
||||
$admin->request('POST', '/admin/system/update/abschliessen', ['token' => 'egal']);
|
||||
self::assertStringContainsString('bereits abgeschlossen', (string) $admin->getResponse()->getContent(), 'Ohne offenes Update gibt es nichts abzuschließen.');
|
||||
|
||||
$marke = dirname(__DIR__).'/'.ArchiveUpdate::MARKE;
|
||||
@mkdir(dirname($marke), 0o775, true);
|
||||
file_put_contents($marke, json_encode(['fassung' => '9.9.9', 'seit' => gmdate('c'), 'alt' => 'x', 'token' => str_repeat('b', 32)]));
|
||||
try {
|
||||
$admin->request('POST', '/admin/system/update/abschliessen', ['token' => 'falsch']);
|
||||
self::assertSame(403, $admin->getResponse()->getStatusCode());
|
||||
self::assertFileExists($marke);
|
||||
} finally {
|
||||
@unlink($marke);
|
||||
}
|
||||
}
|
||||
|
||||
public function testNobodyButAnAdministratorCanStartAMigration(): void
|
||||
{
|
||||
// Ein Knopf, der die Datenbank umbaut, ist das lohnendste Ziel auf diesem Bildschirm.
|
||||
|
||||
Reference in new issue
Block a user