From d3a0af140dabdd6b53c1be0532b37f28254633be Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 8 Oct 2026 16:10:44 -0700 Subject: Registrar: rateExempt IPs in names-config.json skip the per-minute limits (the operator's own IP while testing sign-ups) Co-Authored-By: Claude Opus 5.5 --- names/server.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'names') 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; -- cgit v1.2.3