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:
parent
93178a24e3
commit
ab7d506eea
1 changed files with 8 additions and 5 deletions
|
|
@ -73,17 +73,20 @@ git pull
|
||||||
```
|
```
|
||||||
|
|
||||||
### B2. Login-Zugangsdaten erzeugen
|
### 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
|
```bash
|
||||||
cd ~/sites/larpaso-website/admin
|
docker run --rm -e PW='dein-neues-passwort' node:22-alpine sh -c \
|
||||||
npm install # einmalig, installiert die Admin-Abhängigkeiten
|
"npm install --no-save bcryptjs >/dev/null 2>&1 && \
|
||||||
node hash-password.js "dein-neues-passwort"
|
node -e \"console.log(require('bcryptjs').hashSync(process.env.PW, 12))\""
|
||||||
```
|
```
|
||||||
Gibt einen bcrypt-Hash aus (beginnt mit `$2a$` oder `$2b$`) – merken/kopieren.
|
Gibt einen bcrypt-Hash aus (beginnt mit `$2a$` oder `$2b$`) – merken/kopieren.
|
||||||
Zufälliges Session-Secret erzeugen:
|
Zufälliges Session-Secret erzeugen:
|
||||||
```bash
|
```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!)
|
### B3. `~/stack/admin.env` anlegen (NICHT ins Git-Repo!)
|
||||||
```bash
|
```bash
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue