diff options
| author | Adam Soltys <[email protected]> | 2026-10-08 16:10:44 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-08 16:10:51 -0700 |
| commit | 62429e1830e16cb4a89364888ea889cf908e06be (patch) | |
| tree | 1520bb0710f58dc6977aedc88fcd406755ba7e6e | |
| parent | 5f8b0f35f5e0d42f521679f08244721281cd96d7 (diff) | |
| download | coinosv3-server-62429e1830e16cb4a89364888ea889cf908e06be.tar.gz coinosv3-server-62429e1830e16cb4a89364888ea889cf908e06be.zip | |
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 <[email protected]>
| -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; |
