# Core
BOOKWYRM_URL="{{ BOOKWYRM_URL }}"
DOMAIN="{{ BOOKWYRM_HOSTNAME }}"
ALLOWED_HOSTS="{{ BOOKWYRM_HOSTNAME }},127.0.0.1,localhost"
PORT="{{ WEB_PORT }}"
WEB_PROTOCOL="{{ WEB_PROTOCOL }}"
MEDIA_ROOT="/app/media"
DATA_ROOT="/app/data"
REGISTRATION_OPEN={{ BOOKWYRM_REGISTRATION_OPEN }}
ALLOW_INVITE_REQUESTS={{ BOOKWYRM_ALLOW_INVITE_REQUESTS }}

# Django/Secrets (provide via vault/env in production)
SECRET_KEY="{{ BOOKWYRM_SECRET_KEY }}"

# Email / SMTP (BookWyrm expects these names)
EMAIL_HOST="{{ EMAIL_HOST }}"
EMAIL_PORT="{{ EMAIL_PORT }}"
EMAIL_USE_TLS={{ EMAIL_USE_TLS }}
EMAIL_USE_SSL={{ EMAIL_USE_SSL }}
EMAIL_HOST_USER="{{ EMAIL_HOST_USER }}"
EMAIL_HOST_PASSWORD="{{ EMAIL_HOST_PASSWORD }}"
DEFAULT_FROM_EMAIL="{{ EMAIL_DEFAULT_FROM }}"

# Database
POSTGRES_DB="{{ database_name }}"
POSTGRES_USER="{{ database_username }}"
POSTGRES_PASSWORD="{{ database_password }}"
POSTGRES_HOST="{{ database_host }}"
POSTGRES_PORT="{{ database_port }}"
DATABASE_URL="postgres://{{ database_username }}:{{ database_password }}@{{ database_host }}:{{ database_port }}/{{ database_name }}"

# Redis / Celery
REDIS_HOST="{{ BOOKWYRM_REDIS_HOST }}"
REDIS_PORT="{{ BOOKWYRM_REDIS_PORT }}"
REDIS_URL="{{ BOOKWYRM_REDIS_CACHE_URL }}"
REDIS_CACHE_URL="{{ BOOKWYRM_REDIS_CACHE_URL }}"
CACHE_URL="{{ BOOKWYRM_REDIS_CACHE_URL }}"
DJANGO_REDIS_URL="{{ BOOKWYRM_REDIS_CACHE_URL }}"

## Broker
BROKER_URL="{{ BOOKWYRM_BROKER_URL }}"
REDIS_BROKER_URL="{{ BOOKWYRM_REDIS_BROKER_URL }}"
REDIS_BROKER_HOST="{{ BOOKWYRM_REDIS_HOST }}"
REDIS_BROKER_PORT="{{ BOOKWYRM_REDIS_PORT }}"
REDIS_BROKER_DB_INDEX="{{ BOOKWYRM_REDIS_BROKER_DB }}"
CELERY_BROKER_URL="{{ BOOKWYRM_REDIS_BROKER_URL }}"

## Activity
REDIS_ACTIVITY_HOST="{{ BOOKWYRM_REDIS_HOST }}"
REDIS_ACTIVITY_PORT="{{ BOOKWYRM_REDIS_PORT }}"
REDIS_ACTIVITY_DB_INDEX="{{ BOOKWYRM_REDIS_ACTIVITY_DB }}"
REDIS_ACTIVITY_URL="{{ BOOKWYRM_REDIS_ACTIVITY_URL }}"

# Proxy (if BookWyrm sits behind reverse proxy)
FORWARDED_ALLOW_IPS="*"
USE_X_FORWARDED_HOST="true"
SECURE_PROXY_SSL_HEADER="{{ SSL_ENABLED | bool | string | lower }}"

# OIDC (optional – only if BOOKWYRM_OIDC_ENABLED)
{% if BOOKWYRM_OIDC_ENABLED %}
OIDC_TITLE="{{ BOOKWYRM_OIDC_LABEL | replace('\"','\\\"') }}"
OIDC_ISSUER="{{ BOOKWYRM_OIDC_ISSUER }}"
OIDC_AUTHORIZATION_ENDPOINT="{{ BOOKWYRM_OIDC_AUTH_URL }}"
OIDC_TOKEN_ENDPOINT="{{ BOOKWYRM_OIDC_TOKEN_URL }}"
OIDC_USERINFO_ENDPOINT="{{ BOOKWYRM_OIDC_USERINFO_URL }}"
OIDC_END_SESSION_ENDPOINT="{{ BOOKWYRM_OIDC_LOGOUT_URL }}"
OIDC_JWKS_URI="{{ BOOKWYRM_OIDC_JWKS_URL }}"
OIDC_CLIENT_ID="{{ BOOKWYRM_OIDC_CLIENT_ID }}"
OIDC_CLIENT_SECRET="{{ BOOKWYRM_OIDC_CLIENT_SECRET }}"
OIDC_SCOPES="{{ BOOKWYRM_OIDC_SCOPES }}"
OIDC_UNIQUE_ATTRIBUTE="{{ BOOKWYRM_OIDC_UNIQUE_ATTRIBUTE }}"
{% endif %}
