Enhance set-admin-password script to handle decryption errors by prompting for recreation of users.json file. Implement backup creation before overwriting and update README with usage instructions for the new functionality.
This commit is contained in:
@@ -18,6 +18,16 @@ node scripts/set-admin-password.js
|
||||
|
||||
Das Script fragt dann nach dem neuen Passwort.
|
||||
|
||||
### Datei neu erstellen (bei Entschlüsselungsfehler)
|
||||
|
||||
Falls die `users.json` Datei nicht entschlüsselt werden kann (z.B. weil der `ENCRYPTION_KEY` nicht übereinstimmt), wird das Script automatisch fragen, ob die Datei neu erstellt werden soll. Sie können auch direkt das `--recreate` Flag verwenden:
|
||||
|
||||
```bash
|
||||
node scripts/set-admin-password.js "mein-neues-passwort" --recreate
|
||||
```
|
||||
|
||||
**Wichtig**: Die alte Datei wird automatisch als Backup gespeichert, bevor eine neue erstellt wird.
|
||||
|
||||
## Funktionen
|
||||
|
||||
- **Findet oder erstellt den Admin-User**: Falls der Admin-User nicht existiert, wird er automatisch erstellt
|
||||
|
||||
Reference in New Issue
Block a user