diff options
| -rw-r--r-- | names/server.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/names/server.js b/names/server.js index a40cff6..9b57ce7 100644 --- a/names/server.js +++ b/names/server.js @@ -871,7 +871,11 @@ setInterval(() => { drainWebhooks().catch(() => {}); }, 30_000); // crude per-IP limiter const rate = new Map(); const previews = new Map(); // url -> { meta, until } +// rateExempt: IPs (e.g. the operator's own, while testing sign-ups) the +// per-minute limits never apply to +const RATE_EXEMPT = new Set(CFG.rateExempt || []); function rateOk(ip, limit = 10) { + if (RATE_EXEMPT.has(ip)) return true; const now = Date.now(); const arr = (rate.get(ip) || []).filter((t) => t > now - 60_000); if (arr.length >= limit) return false; |
