Files
textbee/api/.env.example
T
isra elandClaude Opus 5 95149a28c2 feat(api): pace bulk dispatch to the device send rate and bound push freshness
Large sends are now released to the push service in waves of
BULK_DISPATCH_WINDOW messages spaced by the device's configured send
delay, so the backlog waits in the queue instead of piling up ahead of
the phone. Each message records when its wave is due (dispatchDueAt) and
the stale-status cron leaves paced messages alone until then. A paced
batch stays in processing until every wave has been handed off, and the
send response carries estimatedCompletionAt for multi-wave sends.

SMS pushes now carry a 72 hour ttl (FCM_SMS_TTL_SECONDS) that never
expires before scheduledAt, and the heartbeat probe collapses with a
30 minute ttl. Swagger wording for dispatchedAt no longer implies device
receipt.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 00:24:54 +03:00

58 lines
1.9 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
PORT=3001
MONGO_URI=mongodb://adminUser:adminPassword@textbee-db:27017/textbee?authSource=admin
# to setup initial password
MONGO_ROOT_USER=adminUser
MONGO_ROOT_PASS=adminPassword
JWT_SECRET=secret # change this to a secure random string
JWT_EXPIRATION=60d
FRONTEND_URL=http://localhost:3000
#Update from Firebase service account json file
FIREBASE_PROJECT_ID=
FIREBASE_PRIVATE_KEY_ID=
FIREBASE_PRIVATE_KEY=
FIREBASE_CLIENT_EMAIL=
FIREBASE_CLIENT_ID=
FIREBASE_CLIENT_C509_CERT_URL=
MAIL_HOST=
MAIL_PORT=
MAIL_USER=
MAIL_PASS=
MAIL_FROM=
MAIL_REPLY_TO=
ADMIN_EMAIL=
# Webhook delivery HTTP timeout in milliseconds (default 30000, min 10000, max 60000)
WEBHOOK_DELIVERY_TIMEOUT_MS=30000
# Auto-disable webhook subscriptions with high failure rate (cron runs daily)
WEBHOOK_AUTO_DISABLE_FAILURE_THRESHOLD=50
WEBHOOK_AUTO_DISABLE_LOOKBACK_DAYS=30
# Min failure rate 01 to disable (e.g. 0.50 = 50%; only disable when failures/total >= this)
WEBHOOK_AUTO_DISABLE_MIN_FAILURE_RATE=0.50
# SMS Queue Configuration
USE_SMS_QUEUE=false
REDIS_URL=redis://localhost:6379 # if queue is enabled, redis url is required
# Max FCM messages per queue job
MAX_SMS_BATCH_SIZE=100
# Bulk sends are released in waves of this many messages, spaced by the
# device's configured send delay, so pushes never pile up ahead of the phone
BULK_DISPATCH_WINDOW=50
# Log a warning when a paced batch is projected to take longer than this
BULK_DISPATCH_MAX_SPREAD_HOURS=72
# How long FCM keeps an SMS push for an offline device before dropping it
FCM_SMS_TTL_SECONDS=259200
# Lifetime of the hourly heartbeat probe push
FCM_HEARTBEAT_TTL_SECONDS=1800
CLOUDFLARE_TURNSTILE_SECRET_KEY=1x0000000000000000000000000000000AA
# OAuth client id(s) that Google sign-in tokens must be issued for. Must match
# the web app's NEXT_PUBLIC_GOOGLE_CLIENT_ID. Comma-separate for several clients.
# When unset, the audience is not checked and a warning is logged.
GOOGLE_CLIENT_ID=