Files
GibSend/.env.selfhost.example
T
Michał Ordon 62d7c44efc feat: add REDIS_KEY_PREFIX env var for Redis ACL namespace isolation (#365)
* feat: add REDIS_KEY_PREFIX env var for Redis ACL namespace isolation

Adds optional REDIS_KEY_PREFIX env var that prefixes all Redis keys
(BullMQ queues via `prefix` option, cache/lock/rate-limit keys via
`redisKey()` helper). When unset, behavior is unchanged (BullMQ
defaults to "bull:", cache keys are unprefixed).

This enables self-hosters using Redis ACL multi-tenancy to restrict
useSend to its own key namespace (e.g. `~usesend:*`).

16 files changed across env schema, Redis module, 9 BullMQ queue/worker
files, and 5 direct Redis key operation sites.

* docs: add REDIS_KEY_PREFIX to self-host assets and fix docker run example

Add REDIS_KEY_PREFIX env var to docker/prod/compose.yml, .env.example,
.env.selfhost.example, and self-hosting docs. Fix missing trailing
backslashes in standalone docker run example.

* fix(redis): disable ioredis ready check and BullMQ version check

Redis ACL blocks INFO command (in @dangerous category). ioredis uses
INFO for ready check, BullMQ uses it for version detection. Without
these flags, BullMQ workers fail to initialize and silently stop
processing jobs.

- Add enableReadyCheck: false to ioredis connection
- Add skipVersionCheck: true to all 5 Queue + 5 Worker constructors

* fix(redis): add skipVersionCheck to remaining BullMQ job queues

Add skipVersionCheck: true to Queue and Worker constructors in all 4 job
files (campaign-scheduler, cleanup-email-bodies, usage-job,
webhook-cleanup) to match the pattern already used in service files.
This prevents BullMQ version mismatch errors when using REDIS_KEY_PREFIX
with Redis ACL namespace isolation.
2026-03-02 08:12:47 +11:00

44 lines
1.1 KiB
Bash

# Redis container name - required
REDIS_URL="redis://redis:6379"
# Postgres - required for docker-compose, not needed for just docker
POSTGRES_USER="postgres"
POSTGRES_PASSWORD="postgres"
POSTGRES_DB="usesend"
# Postgres - required
DATABASE_URL="postgresql://postgres:postgres@postgres:5432/usesend"
# NextAuth - required
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET=
#SMTP
SMTP_HOST=smtp.mailtrap.io # Example SMTP host
SMTP_USER= "usesend" # Example SMTP user
## Auth providers any one is required
# GitHub login - required
GITHUB_ID="<your-github-client-id>"
GITHUB_SECRET="<your-github-client-secret>"
# Google login - required
GOOGLE_CLIENT_ID="<your-google-client-id>"
GOOGLE_CLIENT_SECRET="<your-google-client-secret>"
# AWS details - required
AWS_DEFAULT_REGION="us-east-1"
AWS_SECRET_KEY="<your-aws-secret-key>"
AWS_ACCESS_KEY="<your-aws-access-key>"
DOCKER_OUTPUT=1
API_RATE_LIMIT=1
AUTH_EMAIL_RATE_LIMIT=5
# Optional: prefix all Redis keys (useful for shared Redis with ACL isolation)
# REDIS_KEY_PREFIX=""
# used to send important error notification - optional
DISCORD_WEBHOOK_URL=""