From d547725289c33ce241f80ac3f626c4cc22966105 Mon Sep 17 00:00:00 2001 From: Dicken Date: Thu, 28 May 2026 10:53:32 +0200 Subject: [PATCH] Passwort Falsch Abfrage und Version auf Dashboard --- backend/src/tools/dateien/routes.js | 5 ++- deploy-helper.bat | 60 +++++++++++++++++++++++++++++ frontend/src/App.jsx | 7 +--- frontend/vite.config.js | 10 +++++ 4 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 deploy-helper.bat diff --git a/backend/src/tools/dateien/routes.js b/backend/src/tools/dateien/routes.js index 5ead8db..0eb6af3 100644 --- a/backend/src/tools/dateien/routes.js +++ b/backend/src/tools/dateien/routes.js @@ -212,7 +212,10 @@ router.get('/:id/download', authenticate, async (req, res) => { const bcrypt = require('bcryptjs'); const pw = req.query.password || req.headers['x-share-password'] || ''; const ok = pw && await bcrypt.compare(pw, share.password_hash); - if (!ok) return res.status(403).json({ error: 'Falsches Passwort', passwordRequired: true }); + if (!ok) return res.status(403).json({ + error: 'Falsches Passwort', + passwordRequired: !pw // true = noch kein PW eingegeben, false = falsches PW + }); } const fp = path.join(UPLOAD_DIR, file.filename); diff --git a/deploy-helper.bat b/deploy-helper.bat new file mode 100644 index 0000000..68d7c5a --- /dev/null +++ b/deploy-helper.bat @@ -0,0 +1,60 @@ +@echo off +setlocal EnableDelayedExpansion +chcp 65001 >nul + +set PROJEKT=D:\projekt +set DOWNLOADS=%USERPROFILE%\Downloads +set COUNT=0 + +echo. +echo ╔══════════════════════════════════════╗ +echo ║ DickenDock Deploy-Helper ║ +echo ╚══════════════════════════════════════╝ +echo. + +:: Alle Dateien im Download-Ordner prüfen und im Projekt suchen +for %%F in ("%DOWNLOADS%\*.*") do ( + set "DATEI=%%~nxF" + :: Im Projektordner rekursiv nach dieser Datei suchen + for /r "%PROJEKT%" %%P in ("%%~nxF") do ( + copy /Y "%%F" "%%P" >nul 2>&1 + if !ERRORLEVEL!==0 ( + echo ✓ !DATEI! → %%P + set /A COUNT+=1 + ) + ) +) + +if %COUNT%==0 ( + echo Keine passenden Dateien im Download-Ordner gefunden. + echo. + goto :ende +) + +echo. +echo %COUNT% Datei(en) kopiert. +echo. +set /p MSG=" Commit-Nachricht (Enter = 'Update'): " +if "!MSG!"=="" set MSG=Update + +cd /d %PROJEKT% +git add -A +git commit -m "!MSG!" +git push + +if %ERRORLEVEL%==0 ( + echo. + echo ✓ Gepusht! Proxmox-Konsole: + echo. + echo cd /opt/dickendock + echo docker compose down + echo docker builder prune -f + echo docker compose up -d --build + echo. +) else ( + echo ✕ Push fehlgeschlagen. + echo. +) + +:ende +pause diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index c2f7912..8170611 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -838,11 +838,8 @@ function Dashboard({ toast, mobile, setActive, unreadMsgs=0 }) {
- {(() => { try { - const d = new Date(typeof __BUILD_TIME__ !== 'undefined' ? __BUILD_TIME__ : ''); - if (isNaN(d)) return null; - return `GEBAUT ${d.toLocaleDateString('de-DE',{day:'2-digit',month:'2-digit',year:'numeric'})} ${d.toLocaleTimeString('de-DE',{hour:'2-digit',minute:'2-digit'})}`; - } catch { return null; }})()} + {typeof __BUILD_TIME__ !== 'undefined' && __BUILD_TIME__ + ? `GEBAUT ${__BUILD_TIME__}` : null}
); diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 7c1e298..d81b529 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -1,7 +1,17 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' +const now = new Date(); +const buildTime = now.toLocaleString('de-DE', { + timeZone: 'Europe/Berlin', + day: '2-digit', month: '2-digit', year: 'numeric', + hour: '2-digit', minute: '2-digit' +}); + export default defineConfig({ plugins: [react()], server: { proxy: { '/api': 'http://localhost:4000' } }, + define: { + __BUILD_TIME__: JSON.stringify(buildTime), + }, })