Files
mtusi2026lab5-fork/.env.example
T
2026-11-22 19:20:51 +03:00

57 lines
2.5 KiB
Bash

# Copy to .env for your LOCAL synthetic test environment; never commit .env.
# These are logical interface suggestions; map actual framework names in REPORT.md.
APP_HOST=0.0.0.0
APP_PORT=8080
# Host port published by the LB. Default 8080; change if that port is already taken.
LB_PORT=8080
APP_ENV=lab
SESSION_TTL_SECONDS=3600
# compose.yaml gives api/migrate DB_HOST/DB_USER/DB_NAME and
# DB_PASSWORD_FILE=/run/secrets/postgres_password (secret from POSTGRES_PASSWORD).
POSTGRES_USER=messenger
POSTGRES_PASSWORD=change-me-locally
POSTGRES_DB=messenger
SESSION_STORE=postgres
CACHE_URL_FILE=/run/secrets/cache_url
API_REPLICAS=2
IDEMPOTENCY_TTL_SECONDS=86400
S3_ENDPOINT=http://s3:9000
S3_REGION=us-east-1
S3_BUCKET=messenger-attachments
# compose.yaml gives minio MINIO_ROOT_USER_FILE / MINIO_ROOT_PASSWORD_FILE
# (secrets from MINIO_ROOT_USER / MINIO_ROOT_PASSWORD). Root is bootstrap-only.
# The API user is created by minio-init and limited to S3_BUCKET.
# App containers should read the files below, not these values as env vars.
MINIO_ROOT_USER=messenger-root
MINIO_ROOT_PASSWORD=change-me-minio-root
S3_ACCESS_KEY_ID=messenger-api
S3_SECRET_ACCESS_KEY=change-me-minio-api
S3_ACCESS_KEY_ID_FILE=/run/secrets/s3_access_key_id
S3_SECRET_ACCESS_KEY_FILE=/run/secrets/s3_secret_access_key
MAX_UPLOAD_BYTES=10485760
MAX_IMAGE_PIXELS=40000000
BROKER_URL_FILE=/run/secrets/broker_url
# First boot of RabbitMQ creates this user. BROKER_URL must use the same
# user and password; the app reads the URL from the file above.
RABBITMQ_USER=messenger
RABBITMQ_PASSWORD=change-me-rabbit
BROKER_URL=amqp://messenger:change-me-rabbit@rabbitmq:5672/
WORKER_CONCURRENCY=2
# Upload returns 429 once this many attachments are queued or processing.
# The rejected body is not stored. Already accepted jobs keep running.
MAX_INFLIGHT_JOBS=20
JOB_MAX_ATTEMPTS=5
JOB_TIMEOUT_SECONDS=60
# Full jitter before the next attempt: uniform(0, min(cap, base * 2^(attempt-1))).
JOB_RETRY_BASE_SECONDS=0.5
JOB_RETRY_CAP_SECONDS=30
# A dead worker's processing row is queued again after this. A live worker refreshes it.
# The effective lease is at least JOB_TIMEOUT_SECONDS + 30.
JOB_LEASE_SECONDS=90
# Ready staging is deleted after the ready commit. Failed staging is kept this long so
# `python -m app.replay` can still read it, then removed.
STAGING_RETENTION_SECONDS=86400
# Derivative parameters are fixed in app/thumbnail.py, not here:
# thumbnail JPEG q=85 inside 256, crop JPEG q=85 at 128, optimized WebP q=80 method=4 inside 1280.
# EXIF orientation is applied, then metadata is not copied into the derivatives.