diff --git a/DOCKER_INSTALLATION.md b/DOCKER_INSTALLATION.md index 64d307e..0deffe6 100644 --- a/DOCKER_INSTALLATION.md +++ b/DOCKER_INSTALLATION.md @@ -37,9 +37,16 @@ That's it! 🎉 - **Web Interface**: http://localhost:12345 - **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 diff --git a/PUBLISHING_STEPS.md b/PUBLISHING_STEPS.md index 5b72971..66ac0a3 100644 --- a/PUBLISHING_STEPS.md +++ b/PUBLISHING_STEPS.md @@ -173,5 +173,9 @@ Your StreamFlow application is now ready for easy deployment! Users will be able 1. Download one file (`docker-compose.yml`) 2. Run `docker compose up -d` 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! 🎉 diff --git a/README.md b/README.md index 71a9dad..49b9c84 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,25 @@ # 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! diff --git a/backend/database/db.js b/backend/database/db.js index 555b061..bce8f3d 100644 --- a/backend/database/db.js +++ b/backend/database/db.js @@ -162,7 +162,14 @@ const initialize = () => { // Create default admin user if no users exist 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 defaultPassword = bcrypt.hashSync('admin', 10); @@ -172,14 +179,24 @@ const initialize = () => { ['admin', 'admin@streamflow.local', defaultPassword, 'admin', 1], (err) => { if (err) { - console.error('Failed to create default admin:', err); + console.error('❌ Failed to create default admin:', err); } else { // CWE-532: Never log passwords - even default ones - console.log('✓ Default admin user created (username: admin)'); - console.log('⚠ SECURITY: Change the default admin password immediately!'); + console.log(''); + 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.'); } });