Fix: Wizard leitet nach SSL-Setup automatisch auf HTTPS weiter
- SESSION_SECURE_COOKIE wird nicht mehr automatisch gesetzt (verursachte 419 während HTTP-Poll) - pollSetup() leitet Browser sofort auf https://domain/setup weiter sobald SSL fertig - verhindert dass Livewire-Polling über HTTP läuft während nginx schon auf HTTPS umgestellt hat Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>main v1.1.10
parent
68a31e894d
commit
1547302297
|
|
@ -67,8 +67,12 @@ class WizardDomains extends Command
|
|||
$ssl ? 1 : 0,
|
||||
));
|
||||
|
||||
$helperOk = $out !== null && !str_contains((string) $out, '[x]');
|
||||
$outStr = (string) $out;
|
||||
$outStr = (string) $out;
|
||||
$helperOk = $out !== null
|
||||
&& !str_contains($outStr, '[x]')
|
||||
&& !str_contains($outStr, 'command not found')
|
||||
&& !str_contains($outStr, 'No such file')
|
||||
&& trim($outStr) !== '';
|
||||
|
||||
foreach (['ui', 'mail', 'webmail'] as $key) {
|
||||
$status = file_get_contents(self::STATE_DIR . "/{$key}");
|
||||
|
|
@ -85,9 +89,8 @@ class WizardDomains extends Command
|
|||
file_put_contents(self::STATE_DIR . '/done', $helperOk ? '1' : '0');
|
||||
Setting::set('ssl_configured', $helperOk ? '1' : '0');
|
||||
|
||||
if ($helperOk && $ssl) {
|
||||
$this->updateEnv(base_path('.env'), 'SESSION_SECURE_COOKIE', 'true');
|
||||
}
|
||||
// SESSION_SECURE_COOKIE wird nicht automatisch gesetzt —
|
||||
// nginx leitet HTTP→HTTPS weiter, Secure-Flag wird im Admin gesetzt
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,6 +181,12 @@ class Wizard extends Component
|
|||
$done = @file_get_contents(self::STATE_DIR . '/done');
|
||||
if ($done !== false) {
|
||||
$this->setupDone = true;
|
||||
|
||||
// Bei erfolgreichem SSL sofort auf HTTPS weiterleiten,
|
||||
// damit Livewire nicht mehr über HTTP pollt
|
||||
if (trim($done) === '1' && $this->ui_domain) {
|
||||
$this->redirect('https://' . $this->ui_domain . '/setup', navigate: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue