# ============================================================
# TorbatYar production env — copy to .env on app server
# Domain: torbatyar.ir | App: 192.168.10.162 | Nginx: 192.168.10.156
# ============================================================

ENVIRONMENT=production
DEBUG=false
LOG_LEVEL=INFO
SERVICE_NAME=core-service
API_V1_PREFIX=/api/v1

PLATFORM_NAME=Torbatyar
PLATFORM_SUPPORT_EMAIL=support@torbatyar.ir
PLATFORM_PRIMARY_COLOR=#0284c7
PLATFORM_SECONDARY_COLOR=#0f172a
PLATFORM_BASE_DOMAIN=torbatyar.ir

# Auto SSL for tenant domains (Celery → SSH → nginx certbot)
SSL_PROVISION_ENABLED=true
SSL_PROVISION_HOST=192.168.10.156
SSL_PROVISION_USER=torbatyaruser
SSL_PROVISION_PASSWORD=change-me
SSL_PROVISION_SCRIPT=/opt/torbatyar/bin/provision_ssl.py

POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_USER=superapp
POSTGRES_PASSWORD=superapp_password
POSTGRES_DB=core_platform_db
DATABASE_URL=postgresql+asyncpg://superapp:superapp_password@postgres:5432/core_platform_db
DATABASE_URL_SYNC=postgresql+psycopg://superapp:superapp_password@postgres:5432/core_platform_db

REDIS_HOST=redis
REDIS_PORT=6379
REDIS_DB=0
REDIS_URL=redis://redis:6379/0
FEATURE_ACCESS_CACHE_TTL=300
TENANT_METADATA_CACHE_TTL=300

CELERY_BROKER_URL=redis://redis:6379/1
CELERY_RESULT_BACKEND=redis://redis:6379/2

KEYCLOAK_ENABLED=true
KEYCLOAK_SERVER_URL=http://keycloak:8080
KEYCLOAK_PUBLIC_URL=https://auth.torbatyar.ir
KEYCLOAK_REALM=superapp
KEYCLOAK_CLIENT_ID=core-service
KEYCLOAK_CLIENT_SECRET=change-me
JWT_ALGORITHM=RS256
JWT_AUDIENCE=account
JWT_VERIFY_SIGNATURE=true
AUTH_REQUIRED=true

IDENTITY_SERVICE_URL=http://identity-access-service:8001
IDENTITY_DATABASE_URL=postgresql+asyncpg://superapp:superapp_password@postgres:5432/identity_access_db
IDENTITY_DATABASE_URL_SYNC=postgresql+psycopg://superapp:superapp_password@postgres:5432/identity_access_db
KEYCLOAK_FRONTEND_CLIENT_ID=superapp-frontend
KEYCLOAK_IDENTITY_CLIENT_SECRET=change-me-identity
IDENTITY_KEYCLOAK_CLIENT_ID=identity-access-service
FRONTEND_CALLBACK_URL=https://torbatyar.ir/auth/callback
CORS_ORIGINS=https://torbatyar.ir,https://www.torbatyar.ir,http://torbatyar.ir,http://www.torbatyar.ir
CORE_SERVICE_URL=http://core-service:8000

PAYAMAK_USERNAME=9155105404
PAYAMAK_FROM=9982004961
PAYAMAK_FROM_NUMBER=9982004961
PAYAMAK_API_KEY=967ceb37-eeef-429c-b6c5-b60a15306e4f
PAYAMAK_APIKEY=967ceb37-eeef-429c-b6c5-b60a15306e4f
PAYAMAK_PASSWORD=967ceb37-eeef-429c-b6c5-b60a15306e4f
PAYAMAK_BODY_ID=245189
JWT_SECRET=change-me-jwt-secret
OTP_EXPIRE_SECONDS=120
PLATFORM_ADMIN_MOBILES=09155105404

FRONTEND_PORT=3000
NEXT_PUBLIC_PLATFORM_BASE_DOMAIN=torbatyar.ir
NEXT_PUBLIC_BACKEND_URL=https://api.torbatyar.ir
NEXT_PUBLIC_API_BASE_URL=https://api.torbatyar.ir
NEXT_PUBLIC_IDENTITY_API_URL=https://identity.torbatyar.ir
NEXT_PUBLIC_KEYCLOAK_URL=https://auth.torbatyar.ir
NEXT_PUBLIC_KEYCLOAK_REALM=superapp
NEXT_PUBLIC_KEYCLOAK_CLIENT_ID=superapp-frontend
NEXT_PUBLIC_ACCOUNTING_API_URL=https://accounting.torbatyar.ir
NEXT_PUBLIC_CRM_API_URL=https://crm.torbatyar.ir
NEXT_PUBLIC_HEALTHCARE_API_URL=https://healthcare.torbatyar.ir

ACCOUNTING_SERVICE_URL=http://accounting-service:8002
ACCOUNTING_DATABASE_URL=postgresql+asyncpg://superapp:superapp_password@postgres:5432/accounting_db
ACCOUNTING_DATABASE_URL_SYNC=postgresql+psycopg://superapp:superapp_password@postgres:5432/accounting_db
ACCOUNTING_SERVICE_NAME=accounting-service

CRM_SERVICE_URL=http://crm-service:8003
CRM_DATABASE_URL=postgresql+asyncpg://superapp:superapp_password@postgres:5432/crm_db
CRM_DATABASE_URL_SYNC=postgresql+psycopg://superapp:superapp_password@postgres:5432/crm_db
CRM_SERVICE_NAME=crm-service

LOYALTY_SERVICE_URL=http://loyalty-service:8004
LOYALTY_DATABASE_URL=postgresql+asyncpg://superapp:superapp_password@postgres:5432/loyalty_db
LOYALTY_DATABASE_URL_SYNC=postgresql+psycopg://superapp:superapp_password@postgres:5432/loyalty_db
LOYALTY_SERVICE_NAME=loyalty-service

HEALTHCARE_SERVICE_URL=http://healthcare-service:8010
HEALTHCARE_DATABASE_URL=postgresql+asyncpg://superapp:superapp_password@postgres:5432/healthcare_db
HEALTHCARE_DATABASE_URL_SYNC=postgresql+psycopg://superapp:superapp_password@postgres:5432/healthcare_db
HEALTHCARE_SERVICE_NAME=healthcare-service

KEYCLOAK_SERVER_URL=http://keycloak:8080
KEYCLOAK_REALM=superapp

INTERNAL_TOKEN_SECRET=change-me-internal-secret

KEYCLOAK_ADMIN=admin
KEYCLOAK_ADMIN_PASSWORD=admin
