feat: Complete HTTPS multi-endpoint configuration and deployment automation

- Enhanced Caddyfile with consolidated HTTPS block supporting all access points
- Added support for https://digiserver, https://10.76.152.164, and https://digiserver.sibiusb.harting.intra
- Configured Caddy reverse proxy with HTTP/3 (QUIC), TLS 1.3+, and HTTP/2 support
- Implemented security headers (X-Frame-Options, X-Content-Type-Options, X-XSS-Protection)
- Added HTTP to HTTPS automatic redirects for all endpoints
- Enhanced setup_https.sh with improved error handling and progress reporting
- Created deploy.sh for fully automated one-command deployment
- Added comprehensive deployment documentation (5 guides)
- Configured 2GB file upload limit and 300s request/response timeouts
- Added Caddy admin API on port 2019 for configuration management
- Implemented health checks and container dependency management
- All volumes persistent and properly isolated
- Production-ready configuration with environment variable parameterization
This commit is contained in:
Quality App Developer
2026-01-14 20:40:26 +02:00
parent 361e0bc459
commit cedb411536
10 changed files with 1924 additions and 41 deletions

View File

@@ -0,0 +1,278 @@
# 📚 DigiServer Deployment Documentation Index
Complete documentation for deploying and maintaining DigiServer. Choose your path below:
---
## 🚀 I Want to Deploy Now!
### Quick Start (2 minutes)
```bash
cd /path/to/digiserver-v2
./deploy.sh
```
→ See [DEPLOYMENT_README.md](DEPLOYMENT_README.md)
### Or Step-by-Step Setup
```bash
./setup_https.sh
```
---
## 📖 Documentation Files
### 1. **[DEPLOYMENT_README.md](DEPLOYMENT_README.md)** ⭐ START HERE
- **Size**: 9.4 KB
- **Purpose**: Complete deployment guide for beginners
- **Contains**:
- Quick start instructions
- Prerequisites checklist
- 3 deployment methods (auto, semi-auto, manual)
- Verification procedures
- First access setup
- Troubleshooting guide
- **Read time**: 15-20 minutes
### 2. **[DOCKER_EXEC_COMMANDS.md](DOCKER_EXEC_COMMANDS.md)** ⭐ REFERENCE GUIDE
- **Size**: 7.6 KB
- **Purpose**: Quick reference for all docker exec commands
- **Contains**:
- Database migrations
- HTTPS configuration
- User management
- Database inspection
- Health checks
- Maintenance commands
- Troubleshooting commands
- **Use when**: You need a specific command
- **Read time**: 5-10 minutes (or search for what you need)
### 3. **[DEPLOYMENT_COMMANDS.md](DEPLOYMENT_COMMANDS.md)**
- **Size**: 6.8 KB
- **Purpose**: Detailed deployment command explanations
- **Contains**:
- Individual command explanations
- Complete deployment script template
- Health check procedures
- Verification steps
- Advanced troubleshooting
- **Read time**: 20-30 minutes
---
## 🔧 Executable Scripts
### 1. **[deploy.sh](deploy.sh)** - Fully Automated
- **Size**: 6.7 KB
- **Purpose**: One-command deployment
- **Does**:
1. Starts Docker containers
2. Runs all migrations
3. Configures HTTPS
4. Verifies setup
5. Shows access URLs
- **Usage**:
```bash
./deploy.sh
```
- **With custom settings**:
```bash
HOSTNAME=server1 DOMAIN=server1.internal ./deploy.sh
```
### 2. **[setup_https.sh](setup_https.sh)** - Semi-Automated
- **Size**: 5.9 KB
- **Purpose**: Setup script that works in or outside Docker
- **Does**:
- Detects environment (Docker container or host)
- Runs migrations
- Configures HTTPS
- Shows status
- **Usage**:
```bash
./setup_https.sh
```
---
## 🎯 Quick Navigation by Task
### "I need to deploy on a new PC"
1. Read: [DEPLOYMENT_README.md](DEPLOYMENT_README.md#prerequisites)
2. Run: `./deploy.sh`
3. Access: https://digiserver.sibiusb.harting.intra
### "I need a specific docker exec command"
→ Search [DOCKER_EXEC_COMMANDS.md](DOCKER_EXEC_COMMANDS.md)
### "I want to understand what's being deployed"
→ Read [DEPLOYMENT_COMMANDS.md](DEPLOYMENT_COMMANDS.md#prerequisites)
### "Something went wrong, help!"
→ See [DEPLOYMENT_README.md](DEPLOYMENT_README.md#-troubleshooting) or [DOCKER_EXEC_COMMANDS.md](DOCKER_EXEC_COMMANDS.md#-troubleshooting)
### "I need to configure custom settings"
→ Read [DEPLOYMENT_README.md](DEPLOYMENT_README.md#-environment-variables)
### "I want to manage HTTPS"
→ See [DOCKER_EXEC_COMMANDS.md](DOCKER_EXEC_COMMANDS.md#-https-configuration-management)
---
## 📋 Deployment Checklist
- [ ] Docker and Docker Compose installed
- [ ] Project files copied to new PC
- [ ] Run `./deploy.sh` or `./setup_https.sh`
- [ ] Verify with `docker-compose ps`
- [ ] Access https://digiserver.sibiusb.harting.intra
- [ ] Log in with admin/admin123
- [ ] Change default password
- [ ] Configure players and content
---
## 🔑 Configuration Options
### Default Settings
```
Hostname: digiserver
Domain: digiserver.sibiusb.harting.intra
IP Address: 10.76.152.164
Port: 443
Email: admin@example.com
Username: admin
Password: admin123
```
### Customize During Deployment
```bash
HOSTNAME=myserver \
DOMAIN=myserver.internal \
IP_ADDRESS=192.168.1.100 \
EMAIL=admin@myserver.com \
./deploy.sh
```
---
## 🆘 Common Tasks
| Task | Command |
|------|---------|
| **Start containers** | `docker-compose up -d` |
| **Stop containers** | `docker-compose stop` |
| **View logs** | `docker-compose logs -f` |
| **Check HTTPS status** | `docker-compose exec -T digiserver-app python /app/https_manager.py status` |
| **Reset password** | See [DOCKER_EXEC_COMMANDS.md](DOCKER_EXEC_COMMANDS.md#reset-admin-password) |
| **View all tables** | See [DOCKER_EXEC_COMMANDS.md](DOCKER_EXEC_COMMANDS.md#list-all-tables) |
| **Create admin user** | See [DOCKER_EXEC_COMMANDS.md](DOCKER_EXEC_COMMANDS.md#create-admin-user) |
---
## 📊 File Structure
```
digiserver-v2/
├── DEPLOYMENT_README.md ..................... Main deployment guide
├── DOCKER_EXEC_COMMANDS.md ................. Quick reference (BEST FOR COMMANDS)
├── DEPLOYMENT_COMMANDS.md .................. Detailed explanations
├── deploy.sh ............................. Fully automated deployment
├── setup_https.sh ......................... Semi-automated setup
├── docker-compose.yml ..................... Docker services config
├── Caddyfile .............................. Reverse proxy config
├── requirements.txt ....................... Python dependencies
├── app/
│ ├── app.py ............................ Flask application
│ ├── models/ ........................... Database models
│ │ ├── https_config.py
│ │ ├── user.py
│ │ └── ...
│ └── ...
├── migrations/
│ ├── add_https_config_table.py
│ ├── add_player_user_table.py
│ ├── add_email_to_https_config.py
│ └── migrate_player_user_global.py
└── old_code_documentation/
├── HTTPS_CONFIGURATION.md
└── ...
```
---
## 🚀 Deployment Methods Comparison
| Method | Time | Effort | Best For |
|--------|------|--------|----------|
| `./deploy.sh` | 2-3 min | Click & wait | First-time setup, automation |
| `./setup_https.sh` | 3-5 min | Manual review | Learning, step debugging |
| Manual commands | 10-15 min | Full control | Advanced users, scripting |
---
## ✨ What Gets Deployed
✅ Flask web application with admin dashboard
✅ HTTPS with self-signed certificates
✅ Caddy reverse proxy for routing
✅ SQLite database with all tables
✅ User management system
✅ HTTPS configuration management
✅ Player and content management
✅ Group and playlist management
✅ Admin audit trail
---
## 🎓 Learning Path
1. **Total Beginner?**
- Start: [DEPLOYMENT_README.md](DEPLOYMENT_README.md)
- Run: `./deploy.sh`
- Learn: Browse [DOCKER_EXEC_COMMANDS.md](DOCKER_EXEC_COMMANDS.md) for available commands
2. **Want to Understand Everything?**
- Read: [DEPLOYMENT_README.md](DEPLOYMENT_README.md#-deployment-methods) (all 3 methods)
- Study: [DEPLOYMENT_COMMANDS.md](DEPLOYMENT_COMMANDS.md)
- Reference: [DOCKER_EXEC_COMMANDS.md](DOCKER_EXEC_COMMANDS.md)
3. **Need to Troubleshoot?**
- Check: [DEPLOYMENT_README.md](DEPLOYMENT_README.md#-troubleshooting)
- Or: [DOCKER_EXEC_COMMANDS.md](DOCKER_EXEC_COMMANDS.md#-troubleshooting)
---
## 💡 Pro Tips
1. **Use `-T` flag** in docker-compose exec for scripts (prevents TTY issues)
2. **Keep backups** before major changes
3. **Check logs often**: `docker-compose logs -f`
4. **Use environment variables** for custom deployments
5. **Verify after deployment** using health check commands
---
## 🔗 Related Documentation
- **HTTPS Setup**: `old_code_documentation/HTTPS_CONFIGURATION.md`
- **Admin Features**: Check admin panel after login
- **API Documentation**: See `old_code_documentation/PLAYER_EDIT_MEDIA_API.md`
---
## 📞 Support
- Logs: `docker-compose logs digiserver-app`
- Health Check: See [DOCKER_EXEC_COMMANDS.md#-health-checks](DOCKER_EXEC_COMMANDS.md#-health-checks)
- Troubleshooting: See [DEPLOYMENT_README.md#-troubleshooting](DEPLOYMENT_README.md#-troubleshooting)
---
**Ready? Start with:** `./deploy.sh` 🚀
Or read [DEPLOYMENT_README.md](DEPLOYMENT_README.md) for the full guide.