Environment Variables
bunqueue can be configured through environment variables.
Server Configuration
TCP_PORT
TCP server port for client connections.
| Type | Default | Example |
|---|---|---|
| number | 6789 | 6789 |
TCP_PORT=6789 bunqueue startHTTP_PORT
HTTP server port for REST API and metrics.
| Type | Default | Example |
|---|---|---|
| number | 6790 | 6790 |
HTTP_PORT=6790 bunqueue startDATA_PATH
Path to SQLite database file.
| Type | Default | Example |
|---|---|---|
| string | ./data/bunq.db | /var/lib/bunqueue/queue.db |
DATA_PATH=/var/lib/bunqueue/queue.db bunqueue startAUTH_TOKENS
Comma-separated list of authentication tokens.
| Type | Default | Example |
|---|---|---|
| string | (none) | token1,token2,token3 |
AUTH_TOKENS=secret-token-1,secret-token-2 bunqueue startWhen set, all TCP and HTTP requests must include a valid token:
# TCP clientbunqueue push emails '{"to":"test@example.com"}' --token secret-token-1
# HTTP APIcurl -H "Authorization: Bearer secret-token-1" http://localhost:6790/api/queuesLogging
LOG_LEVEL
Minimum log level to output.
| Type | Default | Values |
|---|---|---|
| string | info | debug, info, warn, error |
LOG_LEVEL=debug bunqueue startLOG_FORMAT
Log output format.
| Type | Default | Values |
|---|---|---|
| string | text | text, json |
LOG_FORMAT=json bunqueue startJSON format output:
{"level":"info","msg":"Server started","tcp":6789,"http":6790,"ts":"2024-01-15T10:30:00Z"}S3 Backup Configuration
S3_BACKUP_ENABLED
Enable automated S3 backups.
| Type | Default | Values |
|---|---|---|
| boolean | false | 0, 1, false, true |
S3_BACKUP_ENABLED=1 bunqueue startS3_ACCESS_KEY_ID
S3 access key for authentication.
| Type | Default | Aliases |
|---|---|---|
| string | (none) | AWS_ACCESS_KEY_ID |
S3_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE bunqueue startS3_SECRET_ACCESS_KEY
S3 secret key for authentication.
| Type | Default | Aliases |
|---|---|---|
| string | (none) | AWS_SECRET_ACCESS_KEY |
S3_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY bunqueue startS3_BUCKET
S3 bucket name for backups.
| Type | Default | Aliases |
|---|---|---|
| string | (none) | AWS_BUCKET |
S3_BUCKET=my-bunqueue-backups bunqueue startS3_REGION
AWS region for S3 bucket.
| Type | Default | Aliases |
|---|---|---|
| string | us-east-1 | AWS_REGION |
S3_REGION=eu-west-1 bunqueue startS3_ENDPOINT
Custom S3 endpoint for non-AWS providers.
| Type | Default | Example |
|---|---|---|
| string | (none) | https://account.r2.cloudflarestorage.com |
# Cloudflare R2S3_ENDPOINT=https://abc123.r2.cloudflarestorage.com bunqueue start
# MinIOS3_ENDPOINT=http://localhost:9000 bunqueue start
# DigitalOcean SpacesS3_ENDPOINT=https://nyc3.digitaloceanspaces.com bunqueue startS3_BACKUP_INTERVAL
Interval between automated backups (milliseconds).
| Type | Default | Example |
|---|---|---|
| number | 21600000 (6 hours) | 3600000 (1 hour) |
S3_BACKUP_INTERVAL=3600000 bunqueue startS3_BACKUP_RETENTION
Number of backups to keep.
| Type | Default | Example |
|---|---|---|
| number | 7 | 30 |
S3_BACKUP_RETENTION=30 bunqueue startS3_BACKUP_PREFIX
Prefix for backup files in S3.
| Type | Default | Example |
|---|---|---|
| string | backups/ | bunqueue/prod/ |
S3_BACKUP_PREFIX=bunqueue/production/ bunqueue startComplete Examples
Development
TCP_PORT=6789HTTP_PORT=6790DATA_PATH=./data/dev.dbLOG_LEVEL=debugLOG_FORMAT=textProduction
TCP_PORT=6789HTTP_PORT=6790DATA_PATH=/var/lib/bunqueue/production.dbLOG_LEVEL=infoLOG_FORMAT=jsonAUTH_TOKENS=prod-token-abc123,prod-token-xyz789
# S3 BackupS3_BACKUP_ENABLED=1S3_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLES3_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEYS3_BUCKET=company-bunqueue-backupsS3_REGION=us-east-1S3_BACKUP_INTERVAL=3600000S3_BACKUP_RETENTION=30S3_BACKUP_PREFIX=production/Docker Compose
version: '3.8'
services: bunqueue: image: bunqueue:latest ports: - "6789:6789" - "6790:6790" volumes: - bunqueue-data:/data environment: - TCP_PORT=6789 - HTTP_PORT=6790 - DATA_PATH=/data/queue.db - LOG_LEVEL=info - LOG_FORMAT=json - AUTH_TOKENS=${AUTH_TOKENS} - S3_BACKUP_ENABLED=1 - S3_ACCESS_KEY_ID=${S3_ACCESS_KEY_ID} - S3_SECRET_ACCESS_KEY=${S3_SECRET_ACCESS_KEY} - S3_BUCKET=${S3_BUCKET} - S3_REGION=${S3_REGION} - S3_BACKUP_INTERVAL=21600000 - S3_BACKUP_RETENTION=7
volumes: bunqueue-data:Kubernetes
apiVersion: v1kind: ConfigMapmetadata: name: bunqueue-configdata: TCP_PORT: "6789" HTTP_PORT: "6790" DATA_PATH: "/data/queue.db" LOG_LEVEL: "info" LOG_FORMAT: "json" S3_BACKUP_ENABLED: "1" S3_REGION: "us-east-1" S3_BACKUP_INTERVAL: "21600000" S3_BACKUP_RETENTION: "7" S3_BACKUP_PREFIX: "kubernetes/"
---apiVersion: v1kind: Secretmetadata: name: bunqueue-secretstype: OpaquestringData: AUTH_TOKENS: "your-production-token" S3_ACCESS_KEY_ID: "your-access-key" S3_SECRET_ACCESS_KEY: "your-secret-key" S3_BUCKET: "your-bucket"
---apiVersion: apps/v1kind: Deploymentmetadata: name: bunqueuespec: replicas: 1 selector: matchLabels: app: bunqueue template: metadata: labels: app: bunqueue spec: containers: - name: bunqueue image: bunqueue:latest ports: - containerPort: 6789 - containerPort: 6790 envFrom: - configMapRef: name: bunqueue-config - secretRef: name: bunqueue-secrets volumeMounts: - name: data mountPath: /data volumes: - name: data persistentVolumeClaim: claimName: bunqueue-pvcPrecedence
Environment variables take precedence in this order:
- Command-line arguments (highest)
- Environment variables
- Configuration file
- Default values (lowest)
# Command-line winsTCP_PORT=6789 bunqueue start --tcp-port 7000# Uses port 7000