mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-05 23:47:50 +08:00
feat: add admin API IP whitelist (#1131)
* feat: add admin API IP whitelist * fix: harden admin IP whitelist checks
This commit is contained in:
@@ -67,6 +67,8 @@ JWT_SECRET = "xxx"
|
||||
|
||||
# Admin console password, if not configured, console access is not allowed
|
||||
# ADMIN_PASSWORDS = ["123", "456"]
|
||||
# Admin API IP whitelist; applies to admin-password and Admin user-token access
|
||||
# ADMIN_API_IP_WHITELIST = ["203.0.113.10"]
|
||||
|
||||
# Whether to allow users to create emails, not allowed if not configured
|
||||
ENABLE_USER_CREATE_EMAIL = true
|
||||
|
||||
@@ -23,8 +23,11 @@
|
||||
| Variable Name | Type | Description | Example |
|
||||
| ------------------------------ | --------- | ------------------------------------------------------- | ---------------- |
|
||||
| `PASSWORDS` | JSON | Website private passwords, required after configuration | `["123", "456"]` |
|
||||
| `ADMIN_API_IP_WHITELIST` | JSON | Admin API IP whitelist; when configured, only listed IPs may access `/admin/*` | `["203.0.113.10"]` |
|
||||
| `DISABLE_ADMIN_PASSWORD_CHECK` | Text/JSON | Warning: Admin console without password or user check | `false` |
|
||||
|
||||
When `ADMIN_API_IP_WHITELIST` is unset or empty, source IPs are not restricted. Once configured, it applies to both admin-password and Admin user-token access, trusts only Cloudflare's `CF-Connecting-IP` header, and denies requests without that header.
|
||||
|
||||
## Email Related Variables
|
||||
|
||||
| Variable Name | Type | Description | Example |
|
||||
|
||||
Reference in New Issue
Block a user