Stand der laufenden Anwendung von 192.168.1.5:/opt/timer-app (systemd-Dienst timer-app, Port 3003). Zeiterfassung mit Kostenberechnung: Node/Express, SQLite, Anmeldung ausschliesslich ueber Authentik (OIDC, PKCE, RP-Logout) - der frueher vorhandene Passwort-Login ist entfernt. Nicht im Repo, bewusst: - backend/.env und die .env-Sicherung: enthalten Session-Secret und die Authentik-Zugangsdaten. Vorlage ist backend/.env.example. - data/: die Datenbank mit den echten Zeiterfassungen. - node_modules/. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
30 lines
716 B
JavaScript
30 lines
716 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Erzeugt einen bcrypt-Hash fuer die .env-Variable PASSWORD_HASH.
|
|
*
|
|
* Aufruf: npm run hash-password -- "MeinPasswort"
|
|
* or: node tools/hash-password.js "MeinPasswort"
|
|
*/
|
|
|
|
const bcrypt = require('bcrypt');
|
|
|
|
const password = process.argv[2];
|
|
|
|
if (!password) {
|
|
console.error('Aufruf: npm run hash-password -- "DasPasswort"');
|
|
process.exit(1);
|
|
}
|
|
|
|
if (password.length < 8) {
|
|
console.error('FEHLER: Bitte mindestens 8 Zeichen verwenden.');
|
|
process.exit(1);
|
|
}
|
|
|
|
const hash = bcrypt.hashSync(password, 12);
|
|
|
|
console.log('');
|
|
console.log('Diese Zeile in die .env eintragen (und PASSWORD entfernen):');
|
|
console.log('');
|
|
console.log(`PASSWORD_HASH=${hash}`);
|
|
console.log('');
|