forked from mtusi2026/mtusi2026lab6
71 lines
2.6 KiB
Bash
71 lines
2.6 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
|
|
APP_ENV=lab
|
|
SESSION_TTL_SECONDS=3600
|
|
# Choose credentials locally. File paths contain no secret values.
|
|
DATABASE_URL_FILE=/run/secrets/database_url
|
|
# Optional on 3, required use on 4 in lab2; Redis OR Valkey (this solution: Redis since lab2):
|
|
SESSION_STORE=redis
|
|
CACHE_URL_FILE=/run/secrets/cache_url
|
|
API_REPLICAS=2
|
|
IDEMPOTENCY_TTL_SECONDS=86400
|
|
# SeaweedFS S3 (since lab4)
|
|
S3_ENDPOINT=http://s3:8333
|
|
S3_REGION=us-east-1
|
|
S3_BUCKET=messenger-attachments
|
|
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
|
|
|
|
# lab5: broker and worker. The API has NO broker credentials (it writes the transactional outbox);
|
|
# compose.yaml passes per-service files: dispatcher -> /run/secrets/broker_url_dispatcher,
|
|
# worker -> /run/secrets/broker_url_worker. This variable is therefore empty for api/janitor.
|
|
BROKER_URL_FILE=
|
|
WORKER_CONCURRENCY=2
|
|
WORKER_PREFETCH=1
|
|
JOB_MAX_ATTEMPTS=5
|
|
JOB_TIMEOUT_SECONDS=60
|
|
JOB_LEASE_SECONDS=15
|
|
JOB_BACKOFF_BASE_SECONDS=2
|
|
JOB_BACKOFF_MAX_SECONDS=60
|
|
WORKER_MEMORY_LIMIT_MB=512
|
|
STAGING_RETENTION_SECONDS=86400
|
|
PIPELINE_VERSION=1
|
|
# Fault injection (worker/dispatcher only, triggered by files in the faults volume): compose.yaml enables it on the
|
|
# training stand by default; set FAULT_INJECTION=0 here to disable.
|
|
|
|
# Pools and timeouts (same as lab3)
|
|
DB_POOL_MIN=1
|
|
DB_POOL_MAX=10
|
|
DB_POOL_WAIT_SECONDS=3
|
|
DB_CONNECT_TIMEOUT_SECONDS=3
|
|
DB_STATEMENT_TIMEOUT_MS=5000
|
|
REDIS_POOL_MAX=20
|
|
REDIS_TIMEOUT_MS=500
|
|
SHUTDOWN_DRAIN_SECONDS=3
|
|
SHUTDOWN_TIMEOUT_SECONDS=10
|
|
|
|
# lab4: S3 client and uploads
|
|
S3_CONNECT_TIMEOUT_SECONDS=1
|
|
S3_READ_TIMEOUT_SECONDS=5
|
|
S3_MAX_ATTEMPTS=2
|
|
S3_POOL_MAX=20
|
|
UPLOAD_TIMEOUT_SECONDS=60
|
|
UPLOAD_IDLE_TIMEOUT_SECONDS=10
|
|
DECODE_CONCURRENCY=2
|
|
# Cleanup of abandoned uploads and staging (janitor service): grace period and pass interval
|
|
ATTACHMENT_GRACE_SECONDS=3600
|
|
JANITOR_INTERVAL_SECONDS=300
|
|
|
|
# lab6: OpenTelemetry. Standard SDK variables; compose.yaml sets the same values for every app service
|
|
# and a distinct OTEL_SERVICE_NAME (messenger-api / messenger-worker / messenger-dispatcher / messenger-janitor).
|
|
OTEL_SERVICE_NAME=messenger-api
|
|
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
|
|
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
|
|
OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=lab
|
|
# true -> SDK off in all app processes (logs still go to stderr as JSON)
|
|
OTEL_SDK_DISABLED=false
|