feat: add complete password requirements to registration form
- Display all 5 backend password validation requirements - Added: minimum 8 characters (existing) - Added: maximum 100 characters - Added: at least one lowercase letter - Added: at least one uppercase letter - Added: at least one number - Each requirement shows real-time validation with green checkmark - Requirements match exactly with backend/src/utils/validators.js feat: add Traefik labels to frontend container - Enable Traefik auto-discovery for frontend service - Configure HTTP routing with Host rule - Setup both web (HTTP) and websecure (HTTPS) entrypoints - Configure load balancer backend port (80) - Include optional TLS/Let's Encrypt configuration - Change edh.example.com to your actual domain feat: configure production compose file to use Traefik network - Generated docker-compose.prod.deployed.yml now uses traefik-network - Frontend service joined to both edh-stats-network and traefik-network - Added Traefik labels for routing and TLS configuration - traefik-network configured as external (must be created by Traefik) - Removed external ports from frontend (Traefik handles routing) - Updated setup instructions to mention Traefik prerequisites - Changed TLS to enabled by default in production refactor: remove frontend port exposure and Traefik labels from dev compose - Removed port 8081 exposure from development docker-compose.yml - Removed Traefik labels from development environment - Development compose now simple and focused on local testing - Production compose (via deploy.sh) handles Traefik routing via DNS - Frontend only accessible through backend API in development - Cleaner separation: dev is simple, prod uses Traefik Switch Postgres data to host path and bump version Update Traefik rule, expose port, bump version feat: add database migration script for PostgreSQL - Created migrate-database.sh script for exporting/importing databases - Supports source and target database configuration via CLI options - Validates connections before migration - Verifies data integrity after import (table and row counts) - Can skip import and just export to file for manual restore - Supports Docker Compose container names - Includes comprehensive error handling and user prompts - Added DATABASE_MIGRATION.md documentation with usage examples - Handles common scenarios: dev→prod, backups, restore - Security considerations for password handling refactor: simplify migration script to run directly in PostgreSQL container - Removed network/remote host configuration (no longer needed) - Script now runs inside PostgreSQL container with docker compose exec - Simplified to use only source-db, target-db, output-file, skip-import options - No external dependencies - uses container's pg_dump and psql - Much simpler usage: docker compose exec postgres /scripts/migrate-database.sh - Updated documentation with container-based examples - Added real-world integration examples (daily backups, deployments, recovery) - Includes troubleshooting and access patterns for backup files feat: mount scripts directory into PostgreSQL container - Added ./scripts:/scripts:ro volume mount to postgres service - Makes migrate-database.sh and other scripts accessible inside container - Read-only mount for security (scripts can't be modified inside container) - Allows running: docker compose exec postgres /scripts/migrate-database.sh - Scripts are shared between host and container for easy access docs: clarify that migration script must run as postgres user - Added -u postgres flag to all docker compose exec commands - Explains why postgres user is required (PostgreSQL role authentication) - Created shell alias for convenience - Updated all scenarios and examples - Updated troubleshooting section - Clarifies connection issues related to user authentication feat: save database backups to host by default - Added ./backups volume mount to postgres container - Changed default backup location from /tmp to /backups - /backups is mounted to ./backups on host for easy access - Script automatically creates /backups directory if needed - Updated help and examples with -u postgres flag - Summary now shows both container and host backup paths - Backups are immediately available on host machine - No need for docker cp to retrieve backups feat: add --skip-export flag for import-only database operations - Allows importing from existing backup files without re-exporting - Added validate_backup_file() function to check backup existence - Updated main() to handle import-only mode with proper validation - Updated summary output to show import-only mode details - Updated help text with import-only example - Prevents using both --skip-import and --skip-export together docs: update database migration guide for import-only mode - Document new --skip-export flag for import-only operations - Add example for quick restore from backup without re-export - Update command options table with mode combinations - Update all scenarios and examples to use /backups mount - Clarify file location and volume mounting (./backups on host) - Add Scenario 5 for quick restore from backup - Simplify examples and fix container paths feat: clear existing data before importing in migration script - Added clear_database() function to drop all tables, views, and sequences - Drops and recreates public schema with proper permissions - Ensures clean import without data conflicts - Updated warning message to clarify data deletion - clear_database() called before import starts - Maintains database integrity and grants docs: update migration guide to explain data clearing on import - Clarify that existing data is deleted before import - Explain the drop/recreate schema process - Add notes to scenarios about data clearing - Document the import process sequence - Update version to 2.2 fix: remove verbose flag from pg_dump to prevent SQL syntax errors - Removed -v flag from pg_dump export command - Verbose output was being included in SQL file as comments - These comments caused 'syntax error at or near pg_dump' errors during import - Backup files will now be clean SQL without pg_dump metadata comments docs: document pg_dump verbose output fix and troubleshooting - Added troubleshooting section for pg_dump syntax errors - Noted that v2.3 fixes this issue - Directed users to create new backups if needed - Updated version to 2.3 - Clarified file location is /backups/ docs: add critical warning about using migration script for imports - Added prominent warning against using psql directly with -f flag - Explained why direct psql causes 'relation already exists' errors - Added troubleshooting section for these errors - Emphasized that script handles data clearing automatically - Clear examples of wrong vs right approach fix: remove pg_dump restrict commands that block data import - Added clean_backup_file() function to remove \restrict and \unrestrict - pg_dump adds these security commands which prevent data loading - Script now automatically cleans backup files before importing - Removes lines starting with \restrict or \unrestrict - Ensures all data (users, games, commanders) imports successfully - Called automatically during import process docs: add troubleshooting for pg_dump restrict commands blocking imports - Document the \restrict and \unrestrict security commands issue - Explain why they block data from being imported - Show that migration script v2.4+ removes them automatically - Update version to 2.4 - Add detailed troubleshooting section for empty imports
This commit is contained in:
38
deploy.sh
38
deploy.sh
@@ -255,7 +255,9 @@ generate_deployment_config() {
|
||||
# Generated: $(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
# GitHub User: ${GITHUB_USER}
|
||||
#
|
||||
# IMPORTANT: Create a .env file with these variables:
|
||||
# IMPORTANT: Prerequisites
|
||||
# - Traefik must be running with 'traefik-network' created
|
||||
# - Create a .env file with these variables:
|
||||
# DB_NAME=edh_stats
|
||||
# DB_USER=postgres
|
||||
# DB_PASSWORD=\$(openssl rand -base64 32)
|
||||
@@ -266,10 +268,12 @@ generate_deployment_config() {
|
||||
# DB_SEED=false
|
||||
#
|
||||
# FIRST TIME SETUP:
|
||||
# 1. Create .env file with above variables
|
||||
# 2. Run: docker-compose -f docker-compose.prod.deployed.yml up -d
|
||||
# 3. Database migrations will run automatically via db-migrate service
|
||||
# 4. Monitor logs: docker-compose logs -f db-migrate
|
||||
# 1. Ensure Traefik is running and traefik-network exists
|
||||
# 2. Update frontend domain in labels (edh.example.com -> yourdomain.com)
|
||||
# 3. Create .env file with above variables
|
||||
# 4. Run: docker-compose -f docker-compose.prod.deployed.yml up -d
|
||||
# 5. Database migrations will run automatically via db-migrate service
|
||||
# 6. Monitor logs: docker-compose logs -f db-migrate
|
||||
|
||||
services:
|
||||
# PostgreSQL database service
|
||||
@@ -280,7 +284,7 @@ services:
|
||||
- POSTGRES_PASSWORD=\${DB_PASSWORD}
|
||||
- POSTGRES_DB=\${DB_NAME}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ['CMD-SHELL', 'PGPASSWORD=\${DB_PASSWORD} pg_isready -U postgres -h localhost']
|
||||
interval: 10s
|
||||
@@ -353,9 +357,6 @@ services:
|
||||
|
||||
frontend:
|
||||
image: ${FRONTEND_IMAGE}
|
||||
ports:
|
||||
- '38080:80'
|
||||
- '30443:443'
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test:
|
||||
@@ -367,8 +368,23 @@ services:
|
||||
retries: 5
|
||||
networks:
|
||||
- edh-stats-network
|
||||
- traefik-network
|
||||
depends_on:
|
||||
- backend
|
||||
labels:
|
||||
# Enable Traefik discovery for this service
|
||||
- traefik.enable=true
|
||||
# Routing rule - change edh.example.com to your domain
|
||||
- traefik.http.routers.edh-stats-frontend.rule=Host(\`edh.zlor.fi\`)
|
||||
# Entry points: web (HTTP) and websecure (HTTPS)
|
||||
- traefik.http.routers.edh-stats-frontend.entrypoints=web,websecure
|
||||
# Service configuration
|
||||
- traefik.http.routers.edh-stats-frontend.service=edh-stats-frontend
|
||||
# Backend port (nginx internal port)
|
||||
- traefik.http.services.edh-stats-frontend.loadbalancer.server.port=80
|
||||
# Enable TLS with Let's Encrypt
|
||||
- traefik.http.routers.edh-stats-frontend.tls=true
|
||||
- traefik.http.routers.edh-stats-frontend.tls.certresolver=letsencrypt
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
@@ -386,6 +402,10 @@ networks:
|
||||
edh-stats-network:
|
||||
driver: bridge
|
||||
|
||||
traefik-network:
|
||||
external: true
|
||||
name: traefik-network
|
||||
|
||||
x-dockge:
|
||||
urls:
|
||||
- https://edh.zlor.fi
|
||||
|
||||
Reference in New Issue
Block a user