11# --- Core / Environment
2- APP_ADDITIONAL_ORIGINS = https://admin.example.test
2+ # Main runtime environment label (for example: local, develop, production).
33APP_ENV =
4+
5+ # Canonical application origin / base URL.
46APP_ORIGIN = https://example.test
57APP_URL =
68NEXT_PUBLIC_SITE_URL =
79
10+ # Additional trusted browser origins, comma-separated if multiple.
11+ APP_ADDITIONAL_ORIGINS = https://admin.example.test
12+
813# --- Database
14+ # Primary database URL used by the app runtime.
915DATABASE_URL =
16+
17+ # Local-only database URL used for strict local development/testing flows.
1018DATABASE_URL_LOCAL =
1119
1220# --- Upstash Redis (REST)
@@ -46,40 +54,62 @@ CLOUDINARY_UPLOAD_FOLDER=
4654CLOUDINARY_URL =
4755
4856# --- Payments (Stripe)
57+ # Public Stripe key for browser checkout flows.
4958NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY =
50- # Options: test, live (defaults to test in development, live in production)
59+
60+ # Allowed values: test, live.
61+ # In local/development, test mode is expected.
62+ # In production-like runtime, invalid or placeholder Stripe config must fail closed.
5163STRIPE_MODE =
64+
65+ # Toggle Stripe payments for Shop checkout flows.
5266STRIPE_PAYMENTS_ENABLED =
67+
68+ # Required when Stripe payments are enabled.
69+ # In production-like runtime, invalid or placeholder config must fail closed.
5370STRIPE_SECRET_KEY =
5471STRIPE_WEBHOOK_SECRET =
5572
5673# --- Payments (Monobank)
57- # Optional; set explicitly in production for clarity
74+ # Optional API base override. Leave empty to use code defaults unless a custom base is required.
5875MONO_API_BASE =
76+
77+ # Optional invoice timeout override in milliseconds.
5978MONO_INVOICE_TIMEOUT_MS =
6079
61- # Required for Monobank checkout/webhooks
80+ # Required when Monobank checkout/webhooks are enabled.
81+ # In production-like runtime, invalid or placeholder config must fail closed.
6282MONO_MERCHANT_TOKEN =
6383MONO_PUBLIC_KEY =
6484
65- # Optional webhook/runtime tuning (defaults in code if omitted)
85+ # Optional Monobank webhook/runtime tuning.
6686MONO_REFUND_ENABLED = 0
6787MONO_WEBHOOK_CLAIM_TTL_MS =
6888MONO_WEBHOOK_MODE =
6989
90+ # Global payments toggle for Shop checkout flows.
7091PAYMENTS_ENABLED =
7192
7293# --- Shipping (Nova Poshta)
73- # Toggles (optional; defaults are handled in code)
94+ # Shipping feature toggles.
7495SHOP_SHIPPING_ENABLED = 0
7596SHOP_SHIPPING_NP_ENABLED = 0
7697
77- # Retention (optional; days, used for cleanup/ retention policies)
98+ # Optional retention in days for cleanup / retention jobs.
7899SHOP_SHIPPING_RETENTION_DAYS =
79100
80- # Required when shipping is enabled (SHOP_SHIPPING_ENABLED=1 and SHOP_SHIPPING_NP_ENABLED=1).
81- # If shipping is enabled without required NP config, app throws NovaPoshtaConfigError at runtime.
82- # Optional if code has a default; set explicitly in production for clarity
101+ # Authoritative flat shipping prices used by Shop checkout and shipping-method resolution.
102+ # Values are stored in minor units for UAH.
103+ # Example: 500 = 5.00 UAH
104+ # Required whenever Nova Poshta shipping methods are enabled.
105+ # Missing or invalid values must fail closed.
106+ SHOP_SHIPPING_NP_WAREHOUSE_AMOUNT_MINOR =
107+ SHOP_SHIPPING_NP_LOCKER_AMOUNT_MINOR =
108+ SHOP_SHIPPING_NP_COURIER_AMOUNT_MINOR =
109+
110+ # Required Nova Poshta provider config when shipping is enabled
111+ # (SHOP_SHIPPING_ENABLED=1 and SHOP_SHIPPING_NP_ENABLED=1).
112+ # In production-like runtime, invalid or placeholder config must fail closed.
83113NP_API_BASE =
84114NP_API_KEY =
85115NP_SENDER_WAREHOUSE_REF =
@@ -89,7 +119,7 @@ NP_SENDER_NAME=
89119NP_SENDER_PHONE =
90120NP_SENDER_REF =
91121
92- # Optional tuning (override only if needed; otherwise code defaults apply)
122+ # Optional Nova Poshta runtime tuning.
93123NP_MAX_RETRIES =
94124NP_RETRY_DELAY_MS =
95125NP_TIMEOUT_MS =
@@ -100,18 +130,18 @@ INTERNAL_JANITOR_MIN_INTERVAL_SECONDS=
100130INTERNAL_JANITOR_SECRET =
101131JANITOR_URL =
102132
103- # Optional internal/admin runtime secrets & tuning (used by internal endpoints/jobs)
133+ # Optional internal/admin runtime secrets & tuning.
104134INTERNAL_SECRET =
105135JANITOR_TIMEOUT_MS =
106136
107- # Optional instance IDs for webhook multi-instance diagnostics/ claiming
137+ # Optional instance IDs for webhook multi-instance diagnostics / claiming.
108138STRIPE_WEBHOOK_INSTANCE_ID =
109139WEBHOOK_INSTANCE_ID =
110140
111141# --- Quiz
112142QUIZ_ENCRYPTION_KEY =
113143
114- # --- Web3Forms (feedback form)
144+ # --- Web3Forms / Sponsors / Feedback
115145GITHUB_SPONSORS_TOKEN =
116146NEXT_PUBLIC_WEB3FORMS_KEY =
117147
@@ -125,44 +155,49 @@ GMAIL_APP_PASSWORD=
125155GMAIL_USER =
126156
127157# --- Shop / Internal
128- # Optional public/base URL used by shop services/links
158+ # Optional absolute base URL used by Shop links/services.
159+ # Set explicitly in production to avoid incorrect absolute URLs.
129160SHOP_BASE_URL =
161+
162+ # Policy/consent version labels used by Shop flows.
130163SHOP_PRIVACY_VERSION = privacy-v1
131164SHOP_TERMS_VERSION = terms-v1
132165
133- # Required for signed shop status tokens (if status endpoint/ token flow is enabled)
166+ # Required for signed Shop status- token flows.
134167SHOP_STATUS_TOKEN_SECRET =
135168
136169# --- Security
137170CSRF_SECRET =
138171
172+ # Checkout route rate limiting.
139173CHECKOUT_RATE_LIMIT_MAX = 10
140174CHECKOUT_RATE_LIMIT_WINDOW_SECONDS = 300
141175
142- # Stripe webhook rate limit envs (applied per reason; reason-specific overrides generic) .
176+ # Stripe webhook rate- limit envs.
143177# Missing signature has its own envs with fallback to generic, then legacy invalid_sig.
144178STRIPE_WEBHOOK_MISSING_SIG_RL_MAX = 30
145179STRIPE_WEBHOOK_MISSING_SIG_RL_WINDOW_SECONDS = 60
146180
147- # Generic Stripe webhook rate limit fallback (applies to missing_sig and invalid_sig) .
181+ # Generic Stripe webhook rate- limit fallback.
148182STRIPE_WEBHOOK_RL_MAX = 30
149183STRIPE_WEBHOOK_RL_WINDOW_SECONDS = 60
150184
151- # Invalid signature envs (canonical for invalid_sig, legacy fallback for missing_sig) .
185+ # Invalid- signature envs.
152186STRIPE_WEBHOOK_INVALID_SIG_RL_MAX = 30
153187STRIPE_WEBHOOK_INVALID_SIG_RL_WINDOW_SECONDS = 60
154188
155- # SECURITY: If true, trust Cloudflare's cf-connecting-ip header for rate limiting.
156- # Enable ONLY when traffic is fronted by Cloudflare (header is set by Cloudflare at the edge) .
157- # Default: false (0). Keep 0 in untrusted environments to avoid IP spoofing.
189+ # SECURITY:
190+ # Trust Cloudflare's cf-connecting-ip header for rate limiting only when traffic is fronted by Cloudflare.
191+ # Default: 0
158192TRUST_CF_CONNECTING_IP = 0
159193
160- # SECURITY: If true, trust x-real-ip / x-forwarded-for headers for rate limiting.
161- # Enable ONLY behind Cloudflare or a trusted reverse proxy that overwrites these headers .
162- # Default: false (empty/0/false).
194+ # SECURITY:
195+ # Trust x-real-ip / x-forwarded-for only behind Cloudflare or another trusted reverse proxy.
196+ # Default: 0
163197TRUST_FORWARDED_HEADERS = 0
164198
165- # emergency switch
199+ # Emergency switch for rate limiting.
166200RATE_LIMIT_DISABLED = 0
167201
202+ # --- AI / External
168203GROQ_API_KEY =
0 commit comments