From 94cddb798791b3025e8f9ab2437f16b431b39307 Mon Sep 17 00:00:00 2001 From: boban Date: Thu, 23 Apr 2026 21:58:21 +0200 Subject: [PATCH] Fix: Pusher-Key-Fehler + wire:model remember + Reverb-Keys im Installer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - connection.js: Echo nur initialisieren wenn VITE_REVERB_APP_KEY gesetzt - LoginForm: $remember Property ergänzt - installer.sh: Reverb-Keys automatisch generieren und in .env schreiben Co-Authored-By: Claude Sonnet 4.6 --- app/Livewire/Auth/LoginForm.php | 1 + installer.sh | 7 +++++++ resources/js/webserver/connection.js | 29 +++++++++++++++------------- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/app/Livewire/Auth/LoginForm.php b/app/Livewire/Auth/LoginForm.php index 4cde10a..2fc285c 100644 --- a/app/Livewire/Auth/LoginForm.php +++ b/app/Livewire/Auth/LoginForm.php @@ -12,6 +12,7 @@ class LoginForm extends Component public string $name = ''; public string $password = ''; + public bool $remember = false; public ?string $error = null; public bool $show = false; diff --git a/installer.sh b/installer.sh index 6937d0e..2712f12 100644 --- a/installer.sh +++ b/installer.sh @@ -507,6 +507,13 @@ sed -i "s|^REDIS_HOST=.*|REDIS_HOST=127.0.0.1|g" "${APP_DIR}/.env" sed -i "s|^REDIS_PASSWORD=.*|REDIS_PASSWORD=null|g" "${APP_DIR}/.env" sed -i "s|^REDIS_PORT=.*|REDIS_PORT=6379|g" "${APP_DIR}/.env" +REVERB_APP_ID="$(short)" +REVERB_APP_KEY="$(short)" +REVERB_APP_SECRET="$(short)" +grep -q '^REVERB_APP_ID=' "${APP_DIR}/.env" \ + || printf '\nREVERB_APP_ID=%s\nREVERB_APP_KEY=%s\nREVERB_APP_SECRET=%s\nREVERB_HOST=127.0.0.1\nREVERB_PORT=8080\nREVERB_SCHEME=http\nVITE_REVERB_APP_KEY=%s\nVITE_REVERB_HOST=${SERVER_IP}\nVITE_REVERB_PORT=8080\nVITE_REVERB_SCHEME=http\n' \ + "$REVERB_APP_ID" "$REVERB_APP_KEY" "$REVERB_APP_SECRET" "$REVERB_APP_KEY" >> "${APP_DIR}/.env" + # Bootstrap-Admin für den ersten Login BOOTSTRAP_USER="${APP_USER}" BOOTSTRAP_EMAIL="${APP_USER}@localhost" diff --git a/resources/js/webserver/connection.js b/resources/js/webserver/connection.js index 12e6a24..07da05e 100644 --- a/resources/js/webserver/connection.js +++ b/resources/js/webserver/connection.js @@ -1,17 +1,20 @@ import Echo from 'laravel-echo'; - import Pusher from 'pusher-js'; -window.Pusher = Pusher; -window.Echo = new Echo({ - broadcaster: 'reverb', - key: import.meta.env.VITE_REVERB_APP_KEY, - wsHost: import.meta.env.VITE_REVERB_HOST, - wsPort: import.meta.env.VITE_REVERB_PORT ?? 80, - wssPort: import.meta.env.VITE_REVERB_PORT ?? 443, - wsPath: '/ws', - forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https', - enabledTransports: ['ws', 'wss'], -}); +const reverbKey = import.meta.env.VITE_REVERB_APP_KEY; -export default Echo; +if (reverbKey) { + window.Pusher = Pusher; + window.Echo = new Echo({ + broadcaster: 'reverb', + key: reverbKey, + wsHost: import.meta.env.VITE_REVERB_HOST, + wsPort: import.meta.env.VITE_REVERB_PORT ?? 80, + wssPort: import.meta.env.VITE_REVERB_PORT ?? 443, + wsPath: '/ws', + forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https', + enabledTransports: ['ws', 'wss'], + }); +} + +export default window.Echo ?? null;