From af954c54863d2864656b6d199ace1991ea0a2ad2 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:57:38 +0000 Subject: [PATCH] Refactor: Use .env for admin credentials --- .env.example | 19 +++++++++++--- INSTALL.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 INSTALL.md diff --git a/.env.example b/.env.example index 0671a1b..e00fc24 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,19 @@ -# Timezone -TZ=Europe/Copenhagen +# Docker WebUI Configuration +# 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_PASSWORD=changeme123 + +# =============================================== +# TIMEZONE +# =============================================== +# Set your server timezone +# Examples: Europe/Copenhagen, America/New_York, Asia/Tokyo + +TZ=Europe/Copenhagen diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..8816ef0 --- /dev/null +++ b/INSTALL.md @@ -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