Refactor: Use .env for admin credentials
This commit is contained in:
19
.env.example
19
.env.example
@@ -1,6 +1,19 @@
|
|||||||
# Timezone
|
# Docker WebUI Configuration
|
||||||
TZ=Europe/Copenhagen
|
# Copy this file to .env and customize your settings
|
||||||
|
|
||||||
|
# ===============================================
|
||||||
|
# ADMIN CREDENTIALS
|
||||||
|
# ===============================================
|
||||||
|
# IMPORTANT: Change these before first run!
|
||||||
|
# These credentials are used to create the admin account
|
||||||
|
|
||||||
# Admin Credentials (CHANGE THESE!)
|
|
||||||
ADMIN_EMAIL=admin@docker-webui.local
|
ADMIN_EMAIL=admin@docker-webui.local
|
||||||
ADMIN_PASSWORD=changeme123
|
ADMIN_PASSWORD=changeme123
|
||||||
|
|
||||||
|
# ===============================================
|
||||||
|
# TIMEZONE
|
||||||
|
# ===============================================
|
||||||
|
# Set your server timezone
|
||||||
|
# Examples: Europe/Copenhagen, America/New_York, Asia/Tokyo
|
||||||
|
|
||||||
|
TZ=Europe/Copenhagen
|
||||||
|
|||||||
73
INSTALL.md
Normal file
73
INSTALL.md
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
# Quick Install Guide
|
||||||
|
|
||||||
|
## 1. Copy Environment File
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp .env.example .env
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. Edit Your Credentials
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nano .env
|
||||||
|
```
|
||||||
|
|
||||||
|
Change these values:
|
||||||
|
```env
|
||||||
|
ADMIN_EMAIL=your-email@example.com
|
||||||
|
ADMIN_PASSWORD=YourSecurePassword123
|
||||||
|
TZ=Europe/Copenhagen
|
||||||
|
```
|
||||||
|
|
||||||
|
**Security Note:** The `.env` file is ignored by git and won't be committed.
|
||||||
|
|
||||||
|
## 3. Start Docker Container
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose up -d --build
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4. Create Admin Account
|
||||||
|
|
||||||
|
1. Open browser: `http://your-server-ip:8080`
|
||||||
|
2. Go to Settings page
|
||||||
|
3. Click "Sign Up"
|
||||||
|
4. Use the **exact credentials** from your `.env` file
|
||||||
|
5. Submit to create admin account
|
||||||
|
|
||||||
|
## 5. Login
|
||||||
|
|
||||||
|
Return to login page and sign in with your credentials.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Quick Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# View logs
|
||||||
|
docker-compose logs -f
|
||||||
|
|
||||||
|
# Restart
|
||||||
|
docker-compose restart
|
||||||
|
|
||||||
|
# Stop
|
||||||
|
docker-compose down
|
||||||
|
|
||||||
|
# Update
|
||||||
|
git pull && docker-compose up -d --build
|
||||||
|
```
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
**Can't access from other machines?**
|
||||||
|
- Check firewall: `sudo ufw status`
|
||||||
|
- Verify host networking: `docker inspect docker-webui | grep NetworkMode`
|
||||||
|
|
||||||
|
**Metrics not updating?**
|
||||||
|
- Check WebSocket connection (WiFi icon in header)
|
||||||
|
- Verify socket mount: `docker exec docker-webui ls -la /var/run/docker.sock`
|
||||||
|
|
||||||
|
**Wrong credentials?**
|
||||||
|
- Edit `.env` file
|
||||||
|
- Recreate container: `docker-compose down && docker-compose up -d`
|
||||||
|
- Create new admin account in Settings
|
||||||
Reference in New Issue
Block a user