From 50648f9c431fe32ede591f6b5256111bcd5bfeec Mon Sep 17 00:00:00 2001 From: cclohmar Date: Sun, 14 Jun 2026 15:43:26 +0000 Subject: [PATCH] fix(installer): add missing notifier section, create Authelia users_database.yml on fresh install --- install.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/install.sh b/install.sh index 61e2550..14859d1 100755 --- a/install.sh +++ b/install.sh @@ -330,6 +330,12 @@ storage: encryption_key: "${STORAGE_KEY}" local: path: "${AUTHELIA_DIR}/db.sqlite3" +notifier: + smtp: + address: "${SMTP_HOST}:${SMTP_PORT}" + username: "${SMTP_USER}" + password: "${SMTP_PASS}" + sender: "Authelia <${SMTP_USER}>" access_control: default_policy: deny rules: @@ -371,6 +377,23 @@ $(echo "$OIDC_KEY" | sed 's/^/ /') AUTHEOF chmod 600 "$AUTHELIA_CONFIG" success "Authelia config written" + + # Create initial users_database.yml (needed for Authelia to start) + if [ ! -f "${AUTHELIA_DIR}/users_database.yml" ]; then + info "Creating initial users database..." + 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: + placeholder: + displayname: "Setup Account" + password: "${ADMIN_HASH}" + email: "${ADMIN_EMAIL:-admin@local}" + groups: [admins] +USERSDB + chmod 600 "${AUTHELIA_DIR}/users_database.yml" + success "Users database created" + fi + systemctl restart authelia 2>/dev/null && info "Authelia restarted" || info "Authelia not running (will start later)" fi