-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
122 lines (102 loc) · 6.02 KB
/
.env.example
File metadata and controls
122 lines (102 loc) · 6.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# ============================================
# INFRASTRUCTURE HOST CONFIGURATION
# ============================================
# INFRA_HOST: Used by docker-compose.infra.yaml for Kafka & MongoDB configuration
# - Same system: Leave unset (defaults to host.docker.internal)
# - Separate systems: Set to the infrastructure machine's IP/hostname
# ============================================
# INFRA_HOST=192.168.1.100 # Uncomment and set when running infra on a separate machine
# ============================================
# CONNECTION URLS (for application services in docker-compose.yaml)
# ============================================
# Same system: Use host.docker.internal as the host
# Separate systems: Use the infrastructure machine's IP/hostname
# ============================================
NODE_ENV= # Set to either production or development
# ============================================
# API SERVER
# ============================================
NS_API_KEY= # Generate via: openssl rand -base64 32
PORT=3000 # API server port
MAX_BATCH_REQ_LIMIT=1000 # Max batch request size
# ============================================
# DATABASE
# ============================================
MONGO_URI= # MongoDB connection string (If you are using self hosted instance, it should be configured with replicaSet: mongodb://host:port/simplens?replicaSet=rs0)
# ============================================
# KAFKA
# ============================================
BROKERS= # Kafka brokers list (host:port if self-hosted)
# Kafka Topic Partitions (Core Topics)
DELAYED_PARTITION=1 # Partitions for delayed_notification topic
NOTIFICATION_STATUS_PARTITION=1 # Partitions for notification_status topic
# ============================================
# REDIS
# ============================================
REDIS_URL= # Redis connection URL (redis://host:port if self-hosted)
# ============================================
# PLUGIN SYSTEM
# ============================================
SIMPLENS_CONFIG_PATH=./simplens.config.yaml # Path to plugin configuration file
PROCESSOR_CHANNEL=all # 'all' for all channels, or specific: 'email', 'sms'
# ============================================
# BACKGROUND WORKER
# ============================================
OUTBOX_POLL_INTERVAL_MS=5000 # Poll every 5 seconds
OUTBOX_CLEANUP_INTERVAL_MS=60000 # Cleanup every 60 seconds
OUTBOX_BATCH_SIZE=100 # Process 100 entries per poll
OUTBOX_RETENTION_MS=300000 # Keep published entries for 5 minutes
OUTBOX_CLAIM_TIMEOUT_MS=30000 # Claim timeout for crashed workers
# ============================================
# RETRY & IDEMPOTENCY
# ============================================
IDEMPOTENCY_TTL_SECONDS=86400 # Keep idempotency keys for 24 hours
MAX_RETRY_COUNT=5 # Max retries before marking as failed
PROCESSING_TTL_SECONDS=120 # Processing lock held for 2 minutes
# ============================================
# DELAYED NOTIFICATIONS
# ============================================
DELAYED_POLL_INTERVAL_MS=1000 # Poll Redis every 1 second
DELAYED_BATCH_SIZE=10 # Fetch 10 due events per poll
MAX_POLLER_RETRIES=3 # Max retries before DLQ
# ============================================
# RECOVERY SERVICE
# ============================================
RECOVERY_POLL_INTERVAL_MS=60000 # Run recovery every 1 minute
PROCESSING_STUCK_THRESHOLD_MS=300000 # Mark as stuck after 5 minutes
PENDING_STUCK_THRESHOLD_MS=300000 # Mark as orphaned after 5 minutes
RECOVERY_BATCH_SIZE=50 # Process 50 stuck notifications per poll
RECOVERY_CLAIM_TIMEOUT_MS=60000 # Claim timeout for recovery cron worker
# ============================================
# CLEANUP (runs as part of recovery)
# ============================================
CLEANUP_RESOLVED_ALERTS_RETENTION_MS=86400000 # Keep resolved alerts for 24 hours
CLEANUP_PROCESSED_STATUS_OUTBOX_RETENTION_MS=86400000 # Keep processed status outbox for 24 hours
# ============================================
# LOGGING (Grafana/Loki)
# ============================================
LOKI_URL= # Loki URL for log aggregation (http://host:port if self-hosted)
LOG_LEVEL=info # Log level: debug, info, warn, error
LOG_TO_FILE=true # Enable file logging
# ============================================
# ADMIN DASHBOARD
# ============================================
AUTH_SECRET= # Generate via: openssl rand -base64 32
ADMIN_USERNAME=admin # Dashboard admin username
ADMIN_PASSWORD= # Dashboard admin password
AUTH_TRUST_HOST=true # Trust host for auth
API_BASE_URL= # Notification service API URL
WEBHOOK_HOST= # Webhook host for callbacks
WEBHOOK_PORT=3002 # Dashboard webhook port
DASHBOARD_PORT=3002 # Dashboard port
BASE_PATH= # Configurable BASE_PATH to render the admin dashboard
HTTPS_COOKIE= # Controls the storage of session cookies in http and https mode. (If set false, then the cookies can be stored in http connection)
# ============================================
# PLUGIN SPECIFIC ENV VARIABLES (Partition variables + Plugin credentials)
# ============================================
# Channel-Specific Partitions (Dynamic - based on simplens.config.yaml channels)
# Topic: {CHANNEL}_notification, Env: {CHANNEL}_PARTITION
MOCK_PARTITION=1 # Partitions for mock_notification topic
# PLUGIN CREDENTIALS (@simplens/nodemailer-gmail) (You need to install this plugin separately. Not included with simplens-core)
EMAIL_USER= # Gmail address
EMAIL_PASS= # Gmail app password (not regular password!)