nas-samba v1.0.1: health check, hostname, remove demo credentials
- Add health check (curl /api/health) so Traefik can verify container health - Set container hostname to nas.alexzaw.dev - Remove hardcoded demo credentials from login page - Remove admin123 fallback password — require SMB_PASSWORD env var - Fail fast if no admin password is configured
This commit is contained in:
@@ -28,7 +28,7 @@ const JWT_SECRET = process.env.JWT_SECRET || 'cloudsync_secret_key';
|
||||
const JWT_ALGORITHM = 'HS256';
|
||||
const JWT_EXPIRATION_HOURS = 24;
|
||||
const ADMIN_USERNAME = process.env.ADMIN_USERNAME || 'alexz';
|
||||
const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || process.env.SMB_PASSWORD || 'admin123';
|
||||
const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || process.env.SMB_PASSWORD;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// SQLite setup
|
||||
@@ -1461,6 +1461,10 @@ app.get('*', (_req, res) => {
|
||||
// Seed admin user
|
||||
// ---------------------------------------------------------------------------
|
||||
function seedAdmin() {
|
||||
if (!ADMIN_PASSWORD) {
|
||||
console.error('FATAL: No admin password configured. Set SMB_PASSWORD or ADMIN_PASSWORD.');
|
||||
process.exit(1);
|
||||
}
|
||||
const count = sqlDb.prepare('SELECT COUNT(*) as count FROM users').get().count;
|
||||
if (count === 0) {
|
||||
const adminId = crypto.randomUUID();
|
||||
|
||||
Reference in New Issue
Block a user