
Platinum Sponsor
CEOACC.COM | Wholesale Social Media Accounts from the Source
Buy Facebook accounts, Wholesale Instagram accounts, Buy Twitter accounts, Buy TikTok accounts, Buy Telegram accounts, Buy Apple IDs, Buy Google Gmail accounts


Updated: 2026-03-28
This guide covers security configuration recommendations for Dujiao-Next in production environments.
The app.secret_key in config.yml is used for AES-256 encryption of sensitive data (such as payment channel keys, Bot Tokens, etc.).
app:
secret_key: "<first openssl output>"Requirements:
Generate a random key:
openssl rand -hex 32Admins and users use separate JWT secret keys:
jwt:
secret: "<second openssl output>"
expire_hours: 24
user_jwt:
secret: "<third openssl output>"
expire_hours: 24
remember_me_expire_hours: 168Recommendations:
app.secret_key, the admin JWT secret, and the user JWT secret separately and keep all three differentThe current version refuses to start with built-in defaults, known placeholders, values shorter than 32 characters, or duplicated runtime secrets.
The system includes built-in login rate limiting to prevent brute-force attacks:
security:
login_rate_limit:
window_seconds: 300 # Detection window (default 5 minutes)
max_attempts: 5 # Maximum failed attempts
block_seconds: 900 # Lockout duration (default 15 minutes)When the same account fails max_attempts times within window_seconds, the account is locked for block_seconds.
Login rate limiting requires Redis. This feature is unavailable when Redis is disabled.
Besides login, the following endpoints have built-in rate limits (fixed values, not read from config.yml, also Redis-dependent). Requests over the limit get a "too many requests" error:
| Endpoint | Counted by | Limit |
|---|---|---|
| Register / forgot password / send verification code | IP | 20 per 5 minutes, blocked for 5 minutes |
| Gift card redemption | User + IP | 10 per minute, blocked for 5 minutes |
| Payment callbacks / webhooks / upstream callbacks | IP | 120 per minute, blocked for 1 minute |
| Channel API (Telegram Bot, etc.) | IP + channel key | 600 per minute, blocked for 30 seconds |
security:
password_policy:
min_length: 8 # Minimum length
require_upper: true # Must contain uppercase letters
require_lower: true # Must contain lowercase letters
require_number: true # Must contain digits
require_special: false # Whether to require special charactersThe password policy is enforced during user registration and password changes. It is recommended to keep at least the default configuration in production.
The system supports two CAPTCHA providers:
captcha:
provider: "image"
scenes:
login: true
register_send_code: true
reset_send_code: true
guest_create_order: true
image:
length: 5
expire_seconds: 300captcha:
provider: "turnstile"
scenes:
login: true
register_send_code: true
turnstile:
site_key: "your-site-key"
secret_key: "your-secret-key"Recommendation: Enable CAPTCHA for at least login and registration in production. Turnstile provides a better user experience, while image CAPTCHA does not depend on external services.
HTTPS is mandatory for production environments:
Restrict CORS to only allow your site domain:
cors:
allowed_origins:
- "https://shop.example.com" # storefront and admin share one domain
allowed_methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"]
allow_credentials: true
max_age: 600Note: The default allowed_origins is ["*"] (all origins allowed). This must be changed for production.
Always set the server to release mode in production:
server:
mode: releasedebug mode outputs detailed debugging information that may expose sensitive data.
Restrict uploaded file types and sizes:
upload:
max_size: 10485760 # Maximum 10MB
allowed_types:
- "image/jpeg"
- "image/png"
- "image/gif"
- "image/webp"
allowed_extensions:
- ".jpg"
- ".jpeg"
- ".png"
- ".gif"
- ".webp"
max_width: 4096
max_height: 4096The system validates both MIME type and file extension to prevent non-image file uploads.
SVG can carry scripts, so the official example config does not allow it. To enable it, allow both image/svg+xml and .svg. Uploaded SVGs are then parsed as XML and rejected if they contain <script>, <foreignObject>, on* event attributes, javascript: URLs or similar; opening /uploads/*.svg directly forces a download with scripts disabled, while <img> references display normally.
The following data is encrypted at rest using AES-256-GCM:
User and admin passwords are stored as bcrypt hashes and cannot be reversed.
The site connection API uses HMAC-SHA256 signatures to verify requests and prevent tampering.
Before deploying to production, verify the following:
app.secret_key, jwt.secret, and user_jwt.secret are three different random values of at least 32 charactersapp.secret_key is stored with the matching database backupbootstrapserver.mode to releaseallowed_origins to actual domain names