Support Portainer Turnstile env aliases
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 50s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 50s
This commit is contained in:
@@ -25,6 +25,9 @@ JWT_SECRET=super_secret_jwt_key_123
|
||||
# When TURNSTILE_SECRET is empty, backend CAPTCHA enforcement is disabled.
|
||||
TURNSTILE_SITE_KEY=
|
||||
TURNSTILE_SECRET=
|
||||
# Backward-compatible aliases also accepted by the backend:
|
||||
# VITE_TURNSTILE_SITE_KEY=
|
||||
# TURNSTILE_SECRET_KEY=
|
||||
|
||||
# --- Frontend Configuration (Optional) ---
|
||||
# If you need to override the API URL for the frontend
|
||||
|
||||
@@ -120,6 +120,9 @@ TURNSTILE_SECRET
|
||||
`TURNSTILE_SITE_KEY` with Cloudflare's public site key so the login page can load
|
||||
the verification widget at runtime.
|
||||
|
||||
The backend also accepts `VITE_TURNSTILE_SITE_KEY` as a site-key alias and
|
||||
`TURNSTILE_SECRET_KEY` as a secret alias for older deployments.
|
||||
|
||||
## Validation
|
||||
|
||||
```bash
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
require('dotenv').config();
|
||||
|
||||
const TURNSTILE_SITE_KEY =
|
||||
process.env.TURNSTILE_SITE_KEY ||
|
||||
process.env.TURNSTILE_SITEKEY ||
|
||||
process.env.VITE_TURNSTILE_SITE_KEY ||
|
||||
process.env.CLOUDFLARE_TURNSTILE_SITE_KEY ||
|
||||
'';
|
||||
|
||||
const TURNSTILE_SECRET =
|
||||
process.env.TURNSTILE_SECRET ||
|
||||
process.env.TURNSTILE_SECRET_KEY ||
|
||||
process.env.CLOUDFLARE_TURNSTILE_SECRET ||
|
||||
'';
|
||||
|
||||
module.exports = {
|
||||
PORT: process.env.PORT || 3004,
|
||||
API_KEY: process.env.API_KEY || 'nexstar_secret_key_123',
|
||||
@@ -8,6 +21,6 @@ module.exports = {
|
||||
JWT_SECRET: process.env.JWT_SECRET || 'super_secret_jwt_key_123',
|
||||
DATABASE_URL: process.env.DATABASE_URL || 'postgres://graphuser:graphpassword@localhost:5432/graphdb',
|
||||
N8N_WHATSAPP_TRIGGER_URL: process.env.N8N_WHATSAPP_TRIGGER_URL || 'http://localhost:5678/webhook/whatsapp',
|
||||
TURNSTILE_SITE_KEY: process.env.TURNSTILE_SITE_KEY || process.env.VITE_TURNSTILE_SITE_KEY || '',
|
||||
TURNSTILE_SECRET: process.env.TURNSTILE_SECRET || process.env.TURNSTILE_SECRET_KEY || ''
|
||||
TURNSTILE_SITE_KEY,
|
||||
TURNSTILE_SECRET
|
||||
};
|
||||
|
||||
@@ -27,8 +27,11 @@ services:
|
||||
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin123}
|
||||
- JWT_SECRET=${JWT_SECRET:-super_secret_jwt_key_123}
|
||||
- N8N_WHATSAPP_TRIGGER_URL=${N8N_WHATSAPP_TRIGGER_URL:-http://localhost:5678/webhook/whatsapp}
|
||||
- TURNSTILE_SITE_KEY=${TURNSTILE_SITE_KEY:-${VITE_TURNSTILE_SITE_KEY:-}}
|
||||
- TURNSTILE_SECRET=${TURNSTILE_SECRET:-${TURNSTILE_SECRET_KEY:-}}
|
||||
- TURNSTILE_SITE_KEY=${TURNSTILE_SITE_KEY:-}
|
||||
- TURNSTILE_SITEKEY=${TURNSTILE_SITEKEY:-}
|
||||
- VITE_TURNSTILE_SITE_KEY=${VITE_TURNSTILE_SITE_KEY:-}
|
||||
- TURNSTILE_SECRET=${TURNSTILE_SECRET:-}
|
||||
- TURNSTILE_SECRET_KEY=${TURNSTILE_SECRET_KEY:-}
|
||||
depends_on:
|
||||
- db
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user