fix(installer): clean old Authelia DB on fresh install to avoid encryption key mismatch
This commit is contained in:
parent
50648f9c43
commit
631780cdf6
2 changed files with 7 additions and 3 deletions
|
|
@ -61,12 +61,14 @@ NextWks/
|
|||
|
||||
### Prerequisites
|
||||
|
||||
- Go 1.22+
|
||||
- Authelia v4.38 (install with `bash scripts/install-authelia.sh`)
|
||||
- Linux (amd64) — tested on Debian/Ubuntu, Proxmox LXC
|
||||
- Go 1.22+ (installed automatically if missing)
|
||||
- `git`, `curl`, `openssl` (standard tools)
|
||||
|
||||
### Production Install (recommended)
|
||||
### Production Install
|
||||
|
||||
```bash
|
||||
# One command — downloads, builds, deploys
|
||||
curl -fsSL https://git.lohmar.co.uk/lexton-it/NextWks/raw/main/install.sh | bash
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -381,6 +381,8 @@ AUTHEOF
|
|||
# Create initial users_database.yml (needed for Authelia to start)
|
||||
if [ ! -f "${AUTHELIA_DIR}/users_database.yml" ]; then
|
||||
info "Creating initial users database..."
|
||||
# Remove old DB if encryption key changed
|
||||
find "${AUTHELIA_DIR}/db.sqlite3" -delete 2>/dev/null || true
|
||||
ADMIN_HASH=$("${AUTHELIA_DIR}/authelia" crypto hash generate --password "$(openssl rand -base64 16)" 2>/dev/null | awk '{print $NF}' || echo "\$argon2id\$v=19\$m=65536,t=3,p=4\$placeholder")
|
||||
cat > "${AUTHELIA_DIR}/users_database.yml" << USERSDB
|
||||
users:
|
||||
|
|
|
|||
Loading…
Reference in a new issue