- Track learner sessions and revoke them immediately on every request - Add a device replacement challenge for logins over the limit - Add learner and admin endpoints to list and remove devices - Trim excess sessions when enforcement is enabled - Stop logging refresh tokens and authorization headers Enforcement is off by default through DEVICE_LIMIT_ENFORCED.
154 lines
5.3 KiB
Plaintext
154 lines
5.3 KiB
Plaintext
# Complete backend example. Copy to .env and replace REPLACE_WITH_* values.
|
|
# Existing process environment variables override .env. Never commit real secrets.
|
|
# Host-run development using the repository Docker PostgreSQL and MongoDB ports.
|
|
# Inside Docker use service hostnames/ports instead: postgres:5432 and mongo:27017.
|
|
|
|
# Core (required)
|
|
ENV=development
|
|
PORT=8080
|
|
APP_VERSION=development
|
|
LOG_LEVEL=info
|
|
DB_URL=postgresql://root:secret@localhost:5592/gh?sslmode=disable
|
|
MONGODB_URL=mongodb://root:secret@localhost:27021/?authSource=admin
|
|
JWT_KEY=REPLACE_WITH_A_LONG_RANDOM_SIGNING_SECRET
|
|
ACCESS_EXPIRY=3600
|
|
REFRESH_EXPIRY=604800
|
|
MAX_LEARNER_DEVICES=2
|
|
DEVICE_LIMIT_ENFORCED=false
|
|
REPORT_EXPORT_PATH=./exports
|
|
|
|
# PostgreSQL connection pool
|
|
DB_MAX_CONNS=25
|
|
DB_MIN_CONNS=5
|
|
DB_MAX_CONN_LIFETIME_MINUTES=30
|
|
DB_MAX_CONN_IDLE_MINUTES=5
|
|
DB_HEALTH_CHECK_SECONDS=30
|
|
|
|
# SMS: API key required by startup validation, even when SMS is unused.
|
|
AFRO_SMS_API_KEY=REPLACE_WITH_AFROMESSAGE_TOKEN
|
|
AFRO_SMS_BASE_URL=https://api.afromessage.com
|
|
AFRO_SMS_SENDER_NAME=REPLACE_WITH_AUTHORIZED_SENDER
|
|
AFRO_SMS_IDENTIFIER_ID=
|
|
# Legacy loaded SMS fields
|
|
AFRO_SMS_HOST_URL=https://api.afromessage.com
|
|
AFRO_SMS_RECEIVER_PHONE_NUMBER=
|
|
|
|
# Email: both required by startup validation.
|
|
RESEND_API_KEY=REPLACE_WITH_RESEND_API_KEY
|
|
RESEND_SENDER_EMAIL=REPLACE_WITH_AUTHORIZED_SENDER_EMAIL
|
|
|
|
# Staff frontend links (admin dev server)
|
|
TEAM_INVITE_BASE_URL=http://localhost:5173/accept-invite
|
|
TEAM_PASSWORD_RESET_BASE_URL=http://localhost:5173/reset-password
|
|
TEAM_INVITE_EXPIRY_HOURS=168
|
|
# Customer app URLs: replace with your customer app and checkout deployments.
|
|
LEARNER_APP_BASE_URL=https://learn.example.com
|
|
LEARNER_WEB_CHECKOUT_BASE_URL=https://checkout.example.com
|
|
# Loaded legacy setting; confirm your reset flow consumes it.
|
|
PASSWORD_RESET_BASE_URL=https://learn.example.com/reset-password
|
|
|
|
# Google/Apple sign-in: leave blank when unused.
|
|
GOOGLE_OAUTH_CLIENT_ID=
|
|
GOOGLE_OAUTH_WEB_CLIENT_ID=
|
|
GOOGLE_OAUTH_CLIENT_SECRET=
|
|
GOOGLE_OAUTH_REDIRECT_URL=http://localhost:8080/api/v1/auth/google/callback
|
|
APPLE_SIGN_IN_CLIENT_IDS=
|
|
|
|
# Firebase: leave both blank to disable push delivery.
|
|
# Prefer a mounted credential file, e.g. ./secrets/firebase-service-account.json.
|
|
# A nonempty file path must exist; file contents override inline JSON.
|
|
FCM_SERVICE_ACCOUNT_KEY_FILE=
|
|
FCM_SERVICE_ACCOUNT_KEY=
|
|
|
|
# Vimeo / CloudConvert: set credentials before enabling.
|
|
VIMEO_ENABLED=false
|
|
VIMEO_ACCESS_TOKEN=
|
|
CLOUDCONVERT_ENABLED=false
|
|
CLOUDCONVERT_API_KEY=
|
|
|
|
# MinIO: API endpoint, not browser console; no http:// prefix.
|
|
MINIO_ENABLED=false
|
|
MINIO_ENDPOINT=localhost:9000
|
|
MINIO_ROOT_USER=REPLACE_WITH_STORAGE_ACCESS_ID
|
|
MINIO_ROOT_PASSWORD=REPLACE_WITH_STORAGE_SECRET
|
|
MINIO_BUCKET_NAME=rezina
|
|
MINIO_USE_SSL=false
|
|
# Optional legacy aliases (preferred names above take precedence).
|
|
MINIO_ACCESS_KEY=
|
|
MINIO_SECRET_KEY=
|
|
MINIO_BUCKET=
|
|
|
|
# Chapa: optional until payment features are used.
|
|
# Provider callbacks require a publicly reachable backend URL.
|
|
CHAPA_SECRET_KEY=
|
|
CHAPA_WEBHOOK_SECRET=
|
|
CHAPA_PUBLIC_KEY=
|
|
CHAPA_ENCRYPTION_KEY=
|
|
CHAPA_BASE_URL=https://api.chapa.co/v1
|
|
CHAPA_CALLBACK_URL=https://api.example.com/api/v1/payments/chapa/callback
|
|
CHAPA_RETURN_URL=https://checkout.example.com/payment-result
|
|
CHAPA_RECEIPT_URL=
|
|
CHAPA_TRANSFER_TYPE=
|
|
CHAPA_PAYMENT_TYPE=
|
|
|
|
# ArifPay: populate according to your merchant integration when used.
|
|
ARIFPAY_API_KEY=
|
|
ARIFPAY_BASE_URL=
|
|
ARIFPAY_CANCEL_URL=https://checkout.example.com/payment-cancelled
|
|
ARIFPAY_ERROR_URL=https://checkout.example.com/payment-error
|
|
ARIFPAY_SUCCESS_URL=https://checkout.example.com/payment-success
|
|
ARIFPAY_C2B_NOTIFY_URL=
|
|
ARIFPAY_B2C_NOTIFY_URL=
|
|
ARIFPAY_BANK=
|
|
ARIFPAY_BENEFICIARY_ACCOUNT_NUMBER=
|
|
ARIFPAY_DESCRIPTION=Rezina LMS subscription
|
|
ARIFPAY_ITEM_NAME=Learning subscription
|
|
|
|
# Background workers (current application defaults)
|
|
ACCOUNT_DELETION_PURGE_ENABLED=true
|
|
ACCOUNT_DELETION_PURGE_INTERVAL=1h
|
|
ACCOUNT_DELETION_PURGE_BATCH_SIZE=100
|
|
PAYMENT_EXPIRY_WORKER_ENABLED=true
|
|
PAYMENT_EXPIRY_WORKER_INTERVAL=15m
|
|
SUBSCRIPTION_EXPIRY_REMINDER_WORKER_ENABLED=true
|
|
SUBSCRIPTION_EXPIRY_REMINDER_WORKER_INTERVAL=24h
|
|
INACTIVE_SUBMODULE_CONTENT_PURGE_ENABLED=false
|
|
INACTIVE_SUBMODULE_CONTENT_PURGE_INTERVAL=24h
|
|
INACTIVE_SUBMODULE_CONTENT_RETENTION_DAYS=30
|
|
|
|
# Loaded legacy infrastructure: not initialized by the current entrypoint.
|
|
REDIS_ADDR=
|
|
KAFKA_BROKERS=
|
|
FIXER_API_KEY=
|
|
FIXER_BASE_URL=
|
|
BASE_CURRENCY=
|
|
|
|
# Legacy providers: configuration alone does not activate these integrations.
|
|
SANTIMPAY_SECRET_KEY=
|
|
SANTIMPAY_MERCHANT_ID=
|
|
SANTIMPAY_BASE_URL=
|
|
SANTIMPAY_NOTIFY_URL=
|
|
SANTIMPAY_CANCEL_URL=
|
|
# Known loader issue: FABRIC_APP_ID overwrites APP_SECRET; fix before use.
|
|
TELEBIRR_BASE_URL=
|
|
TELEBIRR_APP_SECRET=
|
|
TELEBIRR_FABRIC_APP_ID=
|
|
TELEBIRR_MERCHANT_CODE=
|
|
TELEBIRR_CALLBACK_URL=
|
|
|
|
# Optional demo-seed command settings, never automatically seeded on startup.
|
|
# Run: go run ./cmd/demo-seed -environment development
|
|
# Leave password empty for the documented demo default RezinaDemo!2026.
|
|
DEMO_SEED_PASSWORD=
|
|
# Leave blank for the seeder's sample video.
|
|
DEMO_VIDEO_URL=
|
|
# Production safeguards checked by demo-seed (not the backend ENV setting).
|
|
APP_ENV=development
|
|
ENVIRONMENT=development
|
|
GO_ENV=development
|
|
# Opt-in destructive-to-fixtures test target: disposable migrated database only.
|
|
DEMO_TEST_DB_URL=
|
|
|
|
# CORS currently lives in internal/web_server/app.go, allowing all origins (*).
|
|
# No CORS environment variable is supported by the current backend.
|