From cdaaf7e515c19f38927732657cf897fa952aecac Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 11 Sep 2025 16:55:40 +0200 Subject: [PATCH] =?UTF-8?q?=C3=84nderung:=20Verbesserung=20der=20Redis-Int?= =?UTF-8?q?egration=20und=20Aktualisierung=20der=20HTML-Metadaten?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Änderungen: - Die Redis-Client-Konfiguration wurde aktualisiert, um die Verwendung von Umgebungsvariablen für Passwort und URL zu unterstützen. - Warnungen wurden hinzugefügt, um auf fehlende Authentifizierungsinformationen hinzuweisen. - Die HTML-Dateien wurden um wichtige Metadaten wie Beschreibung, Open Graph- und Twitter-Tags erweitert, um die Sichtbarkeit und SEO zu verbessern. - Eine Beta-Hinweis-Nachricht wurde in die NoLoginView.vue eingefügt, um Benutzer über den Entwicklungsstatus der Plattform zu informieren. Diese Anpassungen erhöhen die Sicherheit der Redis-Verbindung und verbessern die Benutzererfahrung sowie die Auffindbarkeit der Anwendung. --- backend/utils/redis.js | 19 ++++++- frontend/index.html | 34 +++++++++++- frontend/public/index.html | 16 +++++- frontend/public/robots.txt | 6 ++ frontend/public/sitemap.xml | 25 +++++++++ frontend/src/views/home/NoLoginView.vue | 73 ++++++++++++++++++++++++- 6 files changed, 168 insertions(+), 5 deletions(-) create mode 100644 frontend/public/robots.txt create mode 100644 frontend/public/sitemap.xml diff --git a/backend/utils/redis.js b/backend/utils/redis.js index 1ce7de1..d4eb566 100644 --- a/backend/utils/redis.js +++ b/backend/utils/redis.js @@ -6,15 +6,30 @@ const EXPIRATION_TIME = 30 * 60 * 1000; const redisHost = process.env.REDIS_HOST || '127.0.0.1'; const redisPort = process.env.REDIS_PORT || '6379'; +const redisPassword = process.env.REDIS_PASSWORD || process.env.REDIS_PASS || undefined; +const redisUrl = process.env.REDIS_URL || `redis://${redisHost}:${redisPort}`; + if (!process.env.REDIS_HOST || !process.env.REDIS_PORT) { console.warn(`[redis] Verwende Fallback ${redisHost}:${redisPort}`); } +if (!process.env.REDIS_PASSWORD && !process.env.REDIS_PASS && !process.env.REDIS_URL) { + console.warn('[redis] Kein Passwort gesetzt (REDIS_PASSWORD/REDIS_PASS) und keine REDIS_URL vorhanden. Wenn der Server Auth erfordert, schlägt dies fehl.'); +} + const redisClient = createClient({ - url: `redis://${redisHost}:${redisPort}`, - password: process.env.REDIS_PASSWORD, + url: redisUrl, + password: redisPassword, legacyMode: false, }); +redisClient.on('error', (err) => { + if (typeof err?.message === 'string' && err.message.includes('NOAUTH')) { + console.error('[redis] Authentifizierungsfehler: Server verlangt Passwort. Bitte REDIS_PASSWORD/REDIS_PASS oder REDIS_URL setzen.'); + } else { + console.error('[redis] Fehler:', err); + } +}); + redisClient.connect().catch(console.error); const setUserSession = async (userId, sessionData) => { diff --git a/frontend/index.html b/frontend/index.html index 85701c9..2ee7196 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -3,7 +3,39 @@ - YourPart + + YourPart – Community, Chat, Forum, Falukant & Minispiele + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/index.html b/frontend/public/index.html index 4fb9314..a02741f 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -3,7 +3,21 @@ - YourPart + + YourPart – Community, Chat, Forum, Falukant & Minispiele + + + + + + + + + + + + + diff --git a/frontend/public/robots.txt b/frontend/public/robots.txt new file mode 100644 index 0000000..3327efb --- /dev/null +++ b/frontend/public/robots.txt @@ -0,0 +1,6 @@ +User-agent: * +Allow: / + +Sitemap: https://www.your-part.de/sitemap.xml + + diff --git a/frontend/public/sitemap.xml b/frontend/public/sitemap.xml new file mode 100644 index 0000000..cf4a57c --- /dev/null +++ b/frontend/public/sitemap.xml @@ -0,0 +1,25 @@ + + + + https://www.your-part.de/ + daily + 1.0 + + + https://www.your-part.de/blog + weekly + 0.7 + + + https://www.your-part.de/falukant + weekly + 0.7 + + + https://www.your-part.de/minigames + monthly + 0.5 + + + + diff --git a/frontend/src/views/home/NoLoginView.vue b/frontend/src/views/home/NoLoginView.vue index b899fe8..6fbeb92 100644 --- a/frontend/src/views/home/NoLoginView.vue +++ b/frontend/src/views/home/NoLoginView.vue @@ -1,5 +1,9 @@ @@ -95,6 +139,15 @@ export default {