Add HTTPS support with Caddy and clean up legacy files
- Add Caddy reverse proxy for automatic HTTPS with Let's Encrypt - Update docker-compose.yml with Caddy service and internal networking - Remove all Redis dependencies (not needed for this deployment) - Fix Dockerfile permissions for instance and uploads directories - Move legacy scripts to old_code_documentation folder - add_muted_column.py, check_fix_player.py, migrate_add_edit_enabled.py - docker-start.sh, run_dev.sh, start.sh, clean_for_deployment.sh - Add HTTPS_SETUP.md documentation for Caddy configuration - Update .env.example with DOMAIN and EMAIL variables - Remove redis package from requirements.txt - Remove rate limiting Redis storage from config.py
This commit is contained in:
75
old_code_documentation/HTTPS_SETUP.md
Normal file
75
old_code_documentation/HTTPS_SETUP.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# DigiServer v2 - HTTPS Setup with Caddy
|
||||
|
||||
This setup uses **Caddy** as a reverse proxy with automatic HTTPS via Let's Encrypt.
|
||||
|
||||
## Quick Setup
|
||||
|
||||
### 1. Configure Domain
|
||||
Create a `.env` file or edit the existing one:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Edit `.env` and set:
|
||||
```
|
||||
DOMAIN=your-domain.com
|
||||
EMAIL=admin@your-domain.com
|
||||
```
|
||||
|
||||
### 2. Point Your Domain
|
||||
Make sure your domain's DNS A record points to your server's IP address.
|
||||
|
||||
### 3. Start Services
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
That's it! Caddy will **automatically**:
|
||||
- Obtain SSL certificates from Let's Encrypt
|
||||
- Renew certificates before expiration
|
||||
- Redirect HTTP to HTTPS
|
||||
- Enable HTTP/2 and HTTP/3
|
||||
|
||||
## Access Your Site
|
||||
|
||||
- **HTTP**: http://your-domain.com (redirects to HTTPS)
|
||||
- **HTTPS**: https://your-domain.com
|
||||
|
||||
## Testing Locally (Without Domain)
|
||||
|
||||
If you don't have a domain yet, leave DOMAIN as `localhost`:
|
||||
```
|
||||
DOMAIN=localhost
|
||||
```
|
||||
|
||||
Then access: http://localhost (no HTTPS, but app works)
|
||||
|
||||
## Certificate Storage
|
||||
|
||||
SSL certificates are stored in Docker volumes:
|
||||
- `caddy-data` - Certificate data
|
||||
- `caddy-config` - Caddy configuration
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Check Caddy logs:
|
||||
```bash
|
||||
docker logs digiserver-caddy
|
||||
```
|
||||
|
||||
### Verify certificates:
|
||||
```bash
|
||||
docker exec digiserver-caddy caddy list-certificates
|
||||
```
|
||||
|
||||
### Force certificate renewal:
|
||||
```bash
|
||||
docker exec digiserver-caddy caddy reload --config /etc/caddy/Caddyfile
|
||||
```
|
||||
|
||||
## Port Forwarding
|
||||
|
||||
Make sure your firewall/router allows:
|
||||
- Port 80 (HTTP - for Let's Encrypt challenge)
|
||||
- Port 443 (HTTPS)
|
||||
Reference in New Issue
Block a user