# Magento environment
# Base references:
# - https://github.com/bitnami/containers/tree/main/bitnami/magento

# Host & URLs
MAGENTO_URL="{{ MAGENTO_URL }}"
MAGENTO_BACKEND_FRONTNAME="admin"
MAGENTO_USE_SECURE={{ SSL_ENABLED | bool | ternary('1','0') }}
MAGENTO_BASE_URL_SECURE={{ SSL_ENABLED | bool | ternary('1','0') }}
MAGENTO_USE_SECURE_ADMIN={{ SSL_ENABLED | bool | ternary('1','0') }}

# Admin (seed from global administrator)
MAGENTO_ADMIN_USERNAME="{{ users.administrator.username }}"
MAGENTO_ADMIN_PASSWORD="{{ users.administrator.password }}"
MAGENTO_ADMIN_EMAIL="{{ users.administrator.email }}"
MAGENTO_ADMIN_FIRSTNAME="{{ users.administrator.firstname | default('Admin') }}"
MAGENTO_ADMIN_LASTNAME="{{ users.administrator.lastname  | default('User') }}"

# Database (central DB preferred)
MYSQL_HOST="{{ database_host }}"
MYSQL_PORT="{{ database_port }}"
MYSQL_USER="{{ database_username }}"
MYSQL_PASSWORD="{{ database_password }}"
MYSQL_DATABASE="{{ database_name }}"

# Search (Magento 2.4+)
OPENSEARCH_HOST="search"
OPENSEARCH_PORT_NUMBER="9200"
OPENSEARCH_INITIAL_ADMIN_PASSWORD="{{ users.administrator.password }}"

# SMTP (post-install you’ll wire these in Magento admin or env.php)
SMTP_HOST="{{ SYSTEM_EMAIL.HOST }}"
SMTP_PORT="{{ SYSTEM_EMAIL.PORT }}"
SMTP_USER="{{ users['no-reply'].email }}"
SMTP_PASSWORD="{{ users['no-reply'].mailu_token }}"
SMTP_PROTOCOL={{ SYSTEM_EMAIL.TLS | ternary('tls','ssl') }}

# Misc
PHP_MEMORY_LIMIT="768M"

APACHE_SERVERNAME={{ MAGENTO_DOMAIN }}