From 84860b0d99a1b57eed68780cba3c84dd87c0273d Mon Sep 17 00:00:00 2001 From: Pouzor Date: Mon, 9 Mar 2026 11:42:00 +0100 Subject: [PATCH] fix: consolidate .env.example to root, add missing auth defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add AUTH_USERNAME, AUTH_PASSWORD_HASH (admin/admin) to root .env.example - Remove duplicate backend/.env.example — root file is the single source of truth - Fix fresh-install login failure caused by missing password hash --- .env.example | 15 +++++++++++++-- backend/.env.example | 15 --------------- 2 files changed, 13 insertions(+), 17 deletions(-) delete mode 100644 backend/.env.example diff --git a/.env.example b/.env.example index 9dc76fd..2d30a43 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,16 @@ # Backend - server-side only (NEVER commit .env) SECRET_KEY=change_me_in_production SQLITE_PATH=./data/homelab.db -CONFIG_PATH=./config.yml -CORS_ORIGINS=http://localhost:5173 +CORS_ORIGINS=["http://localhost:5173","http://localhost:3000"] + +# Auth — default credentials: admin / admin +# ⚠️ Change before exposing on a network. +# Generate a new hash: python3 -c "from passlib.context import CryptContext; print(CryptContext(schemes=['bcrypt']).hash('yourpassword'))" +AUTH_USERNAME=admin +AUTH_PASSWORD_HASH=$2b$12$RtMbyw17l4N5UGzeXMNAWuzCaVV.XFBY7ZetWheQhxcBDcxahapkG + +# Scanner — JSON array of CIDR ranges to scan +SCANNER_RANGES=["192.168.1.0/24"] + +# Status checker interval in seconds +STATUS_CHECKER_INTERVAL=60 diff --git a/backend/.env.example b/backend/.env.example deleted file mode 100644 index 111f121..0000000 --- a/backend/.env.example +++ /dev/null @@ -1,15 +0,0 @@ -SECRET_KEY= -SQLITE_PATH=./data/homelab.db -CORS_ORIGINS=["http://localhost:5173","http://localhost:3000"] - -# Auth — default credentials: admin / admin -# ⚠️ Change before exposing on a network. -# Generate a new hash: python3 -c "from passlib.context import CryptContext; print(CryptContext(schemes=['bcrypt']).hash('yourpassword'))" -AUTH_USERNAME=admin -AUTH_PASSWORD_HASH=$2b$12$RtMbyw17l4N5UGzeXMNAWuzCaVV.XFBY7ZetWheQhxcBDcxahapkG - -# Scanner — JSON array of CIDR ranges to scan -SCANNER_RANGES=["192.168.1.0/24"] - -# Status checker interval in seconds -STATUS_CHECKER_INTERVAL=60