Add default admin credentials and improved initialization logging

This commit is contained in:
aiulian25 2025-12-17 01:12:36 +00:00
parent 6c8f9ceb63
commit ec05cbb788
4 changed files with 54 additions and 7 deletions

View file

@ -37,9 +37,16 @@ That's it! 🎉
- **Web Interface**: http://localhost:12345 - **Web Interface**: http://localhost:12345
- **Update Server**: http://localhost:9000 - **Update Server**: http://localhost:9000
### Default Credentials ### 🔑 Default Credentials
On first run, create an admin account through the web interface. On first run, a default admin account is automatically created:
```
Username: admin
Password: admin
```
**⚠️ IMPORTANT**: You will be prompted to change this password on first login!
## 🔧 Configuration Options ## 🔧 Configuration Options

View file

@ -173,5 +173,9 @@ Your StreamFlow application is now ready for easy deployment! Users will be able
1. Download one file (`docker-compose.yml`) 1. Download one file (`docker-compose.yml`)
2. Run `docker compose up -d` 2. Run `docker compose up -d`
3. Access the application instantly 3. Access the application instantly
4. Login with default credentials:
- **Username**: `admin`
- **Password**: `admin`
- Change password on first login!
No complex builds, no dependencies, just pull and run! 🎉 No complex builds, no dependencies, just pull and run! 🎉

View file

@ -1,6 +1,25 @@
# StreamFlow IPTV Application # StreamFlow IPTV Application
A modern, feature-rich IPTV streaming application with secure Docker deployment on port 12345. [![Docker Hub](https://img.shields.io/docker/v/aiulian25/streamflow?label=Docker%20Hub&logo=docker)](https://hub.docker.com/r/aiulian25/streamflow)
[![Docker Pulls](https://img.shields.io/docker/pulls/aiulian25/streamflow)](https://hub.docker.com/r/aiulian25/streamflow)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
A modern, feature-rich IPTV streaming application with secure Docker deployment.
## 🚀 Quick Start (3 Commands)
```bash
# 1. Download docker-compose.yml
wget https://raw.githubusercontent.com/aiulian25/streamflow/main/docker-compose.yml
# 2. Start the application
docker compose up -d
# 3. Access at http://localhost:12345
# Login: admin / admin (change on first login!)
```
**That's it!** See [DOCKER_INSTALLATION.md](DOCKER_INSTALLATION.md) for detailed setup.
## 🆕 Desktop Application Available! ## 🆕 Desktop Application Available!

View file

@ -162,7 +162,14 @@ const initialize = () => {
// Create default admin user if no users exist // Create default admin user if no users exist
db.get("SELECT COUNT(*) as count FROM users", [], (err, result) => { db.get("SELECT COUNT(*) as count FROM users", [], (err, result) => {
if (!err && result.count === 0) { if (err) {
console.error('Error checking user count:', err);
return;
}
console.log(`Database initialized. Current users: ${result.count}`);
if (result.count === 0) {
const bcrypt = require('bcrypt'); const bcrypt = require('bcrypt');
const defaultPassword = bcrypt.hashSync('admin', 10); const defaultPassword = bcrypt.hashSync('admin', 10);
@ -172,14 +179,24 @@ const initialize = () => {
['admin', 'admin@streamflow.local', defaultPassword, 'admin', 1], ['admin', 'admin@streamflow.local', defaultPassword, 'admin', 1],
(err) => { (err) => {
if (err) { if (err) {
console.error('Failed to create default admin:', err); console.error('Failed to create default admin:', err);
} else { } else {
// CWE-532: Never log passwords - even default ones // CWE-532: Never log passwords - even default ones
console.log('✓ Default admin user created (username: admin)'); console.log('');
console.log('⚠ SECURITY: Change the default admin password immediately!'); console.log('═══════════════════════════════════════════════════════');
console.log('✅ Default admin user created successfully!');
console.log('');
console.log(' Username: admin');
console.log(' Password: admin');
console.log('');
console.log('⚠️ SECURITY WARNING: Change this password immediately!');
console.log('═══════════════════════════════════════════════════════');
console.log('');
} }
} }
); );
} else {
console.log(' Users already exist. Skipping default admin creation.');
} }
}); });