Environment and Secrets

Environment Configuration

Configuration is layered and environment-specific:

  • config/environment/.env.main β€” base configuration shared across environments
  • config/environment/.env.type.local, .dev, .prod, etc. β€” environment overrides
  • config/environment/.env.type.local.override, *.dev.override, etc. β€” optional overrides for local, dev, etc. (not committed to Git)
  • config/environment/.env.secret β€” sensitive credentials (auto-generated during install, not committed to Git)

Run make env to build the two generated files below (make install runs it for you):

  • .env.runtime β€” the non-secret files above merged in order (main β†’ type β†’ override). Every service reads it at runtime.
  • .env β€” .env.runtime plus .env.secret. Docker Compose reads it for its own settings.

If a script tells you to “Run make env first”, .env.runtime is missing. Both files are generated and excluded from Git via .gitignore.

⚠️ Tip: Do not edit .env or .env.runtime. make env and make install overwrite them. Edit the .env.type.* files, or create an override file for local development.

Secret Management

Secrets are generated automatically during installation using a template file:

  • Template path: sh/env/.env.secret.template
  • The template uses two placeholders: generate_this_pass for passwords (e.g. MYSQL_ROOT_PASSWORD=generate_this_pass) and generate_key for WordPress authentication keys/salts (e.g. WP_AUTH_KEY='generate_key'). The generator script also supports a third placeholder, generate_safe_token, which the shipped template does not currently use.
  • During installation, secret-gen.sh replaces these placeholders with randomly generated secure values
  • The resulting .env.secret file is excluded from Git via .gitignore

You do not need to manually create .env.secret. It is always generated based on the template.

SSL certificates located in config/ssl/live/<your-domain>/ are also managed as secrets. They should not be committed to version control.

πŸ” Important: Do not commit .env.secret, SSL files and other sensitive data to version control. They are meant to be environment-specific and should be kept secure.