Fix B2 in deploy guide: generate admin credentials via Docker, not host npm

The deploy host only has Docker installed, not Node/npm directly, so the
original `npm install` / `node hash-password.js` steps failed with
"command not found". Both the bcrypt hash and session secret are now
generated with a throwaway `node:22-alpine` container instead.
This commit is contained in:
Pascal Scholz 2026-09-21 21:46:54 +02:00
parent 93178a24e3
commit ab7d506eea

View file

@ -73,17 +73,20 @@ git pull
```
### B2. Login-Zugangsdaten erzeugen
Der Server selbst braucht dafür kein Node/npm installiert zu haben – das läuft in einem
kurzlebigen Docker-Container (Node steckt nur in den Containern, nicht auf dem Host):
```bash
cd ~/sites/larpaso-website/admin
npm install # einmalig, installiert die Admin-Abhängigkeiten
node hash-password.js "dein-neues-passwort"
docker run --rm -e PW='dein-neues-passwort' node:22-alpine sh -c \
"npm install --no-save bcryptjs >/dev/null 2>&1 && \
node -e \"console.log(require('bcryptjs').hashSync(process.env.PW, 12))\""
```
Gibt einen bcrypt-Hash aus (beginnt mit `$2a$` oder `$2b$`) – merken/kopieren.
Zufälliges Session-Secret erzeugen:
```bash
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
docker run --rm node:22-alpine node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
```
Auch kopieren.
Auch kopieren. (Beide Befehle laden einmalig das `node:22-alpine`-Image, das ohnehin für
den Website-Build gebraucht wird – geht beim zweiten Mal deutlich schneller.)
### B3. `~/stack/admin.env` anlegen (NICHT ins Git-Repo!)
```bash