Improve .env file handling and variable replacement in deployment
Major improvements to environment variable management: 1. Added .env.example files for ALL stacks - Each stack now has its own .env.example with only required variables - Variables include comments explaining their purpose - Examples: core, dockge, infrastructure, dashboards, arcane, media, media-management, transcoders, monitoring, sablier, utilities, productivity, wikis, vpn, homeassistant, alternatives 2. Created .env.global generation - Generates /opt/stacks/.env.global with all variables - Strips comments and blank lines for clean output - Available to all stacks for reference 3. Improved variable replacement strategy - Variable replacement now ONLY targets labels and x-dockge sections in docker-compose files - Configuration files (traefik, authelia) still get full variable replacement - Uses Python script for precise section detection - Preserves environment variables and volume mounts as-is 4. New deployment approach - Each stack copies .env.example to .env - Values populated from main ~/EZ-Homelab/.env file - No more manual sed commands to remove unused variables - Consistent approach across all deployment functions 5. Updated deployment functions - deploy_dockge, deploy_core, deploy_infrastructure, deploy_dashboards, deploy_arcane, deploy_sablier_stack - All now use process_stack_env() for clean .env handling - All use updated localize_yml_file() for targeted variable replacement Benefits: - Clean, minimal .env files for each stack - No unnecessary variables or comments in deployed .env files - Variables in compose files preserved for Docker Compose to handle - Easier to understand what each stack needs - Uniform deployment approach across all stacks
This commit is contained in:
13
docker-compose/monitoring/.env.example
Normal file
13
docker-compose/monitoring/.env.example
Normal file
@@ -0,0 +1,13 @@
|
||||
# Monitoring Stack Environment Variables
|
||||
# These variables are used for Prometheus, Grafana, Uptime Kuma, etc.
|
||||
|
||||
# Base Configuration
|
||||
DOMAIN=example.duckdns.org
|
||||
SERVER_HOSTNAME=myserver
|
||||
TZ=America/New_York
|
||||
|
||||
# Grafana Configuration
|
||||
GRAFANA_ADMIN_PASSWORD=changeme
|
||||
|
||||
# Directory Configuration
|
||||
STACKS_DIR=/opt/stacks
|
||||
Reference in New Issue
Block a user