# =====================
# Avatar API - Environment Configuration
# Template Version: 1.0.0
# Compatible with octopize-avatar-deploy: >=1.0.0,<2.0.0
# =====================

# --- Project/Organization ---
ENV_NAME=production

# --- Paths & Storage ---
DB_VOLUME=avatar_postgres_data
SEAWEEDFS_VOLUME=avatar_seaweedfs_data

# --- Database ---
DB_HOST=db.complete.com
# --- Service Versions ---
AVATAR_API_VERSION=NORMALIZED_VERSION
AVATAR_WEB_VERSION=NORMALIZED_VERSION
AVATAR_SEAWEEDFS_REGISTRY=chrislusf
AVATAR_SEAWEEDFS_VERSION=NORMALIZED_VERSION

AVATAR_SEAWEEDFS_LOG_VERBOSITY=0

AVATAR_AUTHENTIK_VERSION=NORMALIZED_VERSION
AVATAR_AUTHENTIK_REPOSITORY=ghcr.io/goauthentik

# --- Authentik Bootstrap Configuration ---
# These credentials are used for automated installation (skip OOBE)
AUTHENTIK_BOOTSTRAP_EMAIL=admin@example.com
AUTHENTIK_BOOTSTRAP_PASSWORD=RANDOM_PASSWORD
AUTHENTIK_BOOTSTRAP_TOKEN=RANDOM_TOKEN

# --- Service URLs & Paths ---
AVATAR_DOMAIN=avatar.complete.com
# Defines the URL where the web client is served.
AVATAR_WEB_CLIENT_URL=https://avatar.complete.com/web/
# --- API Configuration ---

# Defines the URL where the API is served.
AVATAR_API_URL=https://avatar.complete.com/api
# Public and internal storage endpoint URLs
AVATAR_STORAGE_ENDPOINT_PUBLIC_URL=https://avatar.complete.com/storage
AVATAR_STORAGE_ENDPOINT_INTERNAL_URL=http://s3:8333


## SSO Configuration ##
# Blueprint environment variables (used by authentik to resolve !Env tags in the blueprint)
AVATAR_AUTHENTIK_BLUEPRINT_DOMAIN=avatar.complete.com
AVATAR_AUTHENTIK_BLUEPRINT_CLIENT_ID=RANDOM_CLIENT_ID
AVATAR_AUTHENTIK_BLUEPRINT_CLIENT_SECRET=RANDOM_CLIENT_SECRET
AVATAR_AUTHENTIK_BLUEPRINT_API_REDIRECT_URI=https://avatar.complete.com/api/login/sso/auth
AVATAR_AUTHENTIK_BLUEPRINT_SELF_SERVICE_LICENSE=free_trial
# User-event webhook (authentik -> API) so disabled/deleted users lose API-key access
AVATAR_AUTHENTIK_BLUEPRINT_API_WEBHOOK_URL=http://api:8000/internal/authentik/user-events
AVATAR_AUTHENTIK_BLUEPRINT_WEBHOOK_SECRET=RANDOM_SECRET

# SSO settings for the Avatar API service
SSO_CLIENT_ID=RANDOM_CLIENT_ID
SSO_CLIENT_SECRET=RANDOM_CLIENT_SECRET
SSO_PROVIDER_APP_NAME=avatar-api
SSO_PROVIDER_URL=https://avatar.complete.com/sso
# authentik management-API token + webhook shared secret for API-key revocation
# of users disabled/deleted in authentik
AUTHENTIK_API_TOKEN=RANDOM_TOKEN
AUTHENTIK_WEBHOOK_SECRET=RANDOM_SECRET


# Number of days after which datasets will be deleted (ISO8601 timedelta string, e.g. 30d, 2w, 12h)
SHARED_STORAGE_PATH=s3://{user_id}/{expire_days}d # for seaweedfs

# --- Logging & Debug ---
# Whether to prettify the logger output. Default is false, and will output JSON.
USE_CONSOLE_LOGGING=false
# Whether to enable Sentry for error tracking.
IS_SENTRY_ENABLED=true
# Logging level. Can be one of DEBUG, INFO, WARNING, ERROR, CRITICAL.
LOG_LEVEL=INFO

# URL the API fetches its client/API compatibility mapping from at runtime.
# Leave empty to make the API serve only its in-image copy (e.g. for deployments
# whose firewall blocks outgoing connections).
COMPATIBILITY_MAPPING_URL=https://license.octopize.io/compatibility/compatibility_mapping.json

# =============================
# SMTP Email Configuration
SMTP_HOST=smtp.complete.com
SMTP_PORT=587
SMTP_USE_TLS=true
SMTP_START_TLS=false
SMTP_VERIFY=true
SMTP_SENDER_EMAIL=noreply@complete.com
SMTP_USERNAME=smtp-user
SMTP_PASSWORD=smtp-pass
# =============================

# =============================
# To enable Telemetry, set the following variables:
TELEMETRY_S3_ENDPOINT_URL=https://s3.fr-par.scw.cloud
TELEMETRY_S3_REGION=fr-par
TELEMETRY_S3_BUCKET_NAME=avatar-telemetry-test
# =============================
