- Add HTTPSConfig model for managing HTTPS settings - Add admin routes for HTTPS configuration management - Add beautiful admin template for HTTPS configuration - Add database migration for https_config table - Add CLI utility for HTTPS management - Add setup script for automated configuration - Add Caddy configuration generator and manager - Add comprehensive documentation (3 guides) - Add HTTPS Configuration card to admin dashboard - Implement input validation and security features - Add admin-only access control with audit trail - Add real-time configuration preview - Integrate with existing Caddy reverse proxy Features: - Enable/disable HTTPS from web interface - Configure domain, hostname, IP address, port - Automatic SSL certificate management via Let's Encrypt - Real-time Caddyfile generation and reload - Full audit trail with admin username and timestamps - Support for HTTPS and HTTP fallback access points - Beautiful, mobile-responsive UI Modified files: - app/models/__init__.py (added HTTPSConfig import) - app/blueprints/admin.py (added HTTPS routes) - app/templates/admin/admin.html (added HTTPS card) - docker-compose.yml (added Caddyfile mount and admin port) New files: - app/models/https_config.py - app/blueprints/https_config.html - app/utils/caddy_manager.py - https_manager.py - setup_https.sh - migrations/add_https_config_table.py - migrations/add_email_to_https_config.py - HTTPS_STATUS.txt - Documentation files (3 markdown guides)
59 lines
1.5 KiB
YAML
Executable File
59 lines
1.5 KiB
YAML
Executable File
#version: '3.8'
|
|
|
|
services:
|
|
digiserver-app:
|
|
build: .
|
|
container_name: digiserver-v2
|
|
# Don't expose directly; use Caddy reverse proxy instead
|
|
expose:
|
|
- "5000"
|
|
volumes:
|
|
- ./instance:/app/instance
|
|
- ./app/static/uploads:/app/app/static/uploads
|
|
- ./Caddyfile:/app/Caddyfile
|
|
environment:
|
|
- FLASK_ENV=production
|
|
- SECRET_KEY=${SECRET_KEY:-your-secret-key-change-this}
|
|
- ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
|
|
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin123}
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/').read()"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
networks:
|
|
- digiserver-network
|
|
|
|
# Caddy reverse proxy with automatic HTTPS
|
|
caddy:
|
|
image: caddy:2-alpine
|
|
container_name: digiserver-caddy
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
- "443:443/udp" # HTTP/3 support
|
|
- "2019:2019" # Caddy admin API
|
|
volumes:
|
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
|
- caddy-data:/data
|
|
- caddy-config:/config
|
|
environment:
|
|
- DOMAIN=${DOMAIN:-localhost}
|
|
- EMAIL=${EMAIL:-admin@localhost}
|
|
depends_on:
|
|
digiserver-app:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
networks:
|
|
- digiserver-network
|
|
|
|
networks:
|
|
digiserver-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
caddy-data:
|
|
caddy-config:
|