@everyone button box reward

This commit is contained in:
legop3
2026-05-15 00:53:40 -04:00
parent 95c2b89875
commit 384f97cdcf
5 changed files with 42 additions and 4 deletions
@@ -8,7 +8,6 @@ function registerButtonBoxRoute(deps) {
app,
logger,
buttonCount,
getRequestIp,
normalizeIp,
isLocalNetwork,
applyPress,
@@ -21,8 +20,16 @@ function registerButtonBoxRoute(deps) {
return null;
}
function getSocketIp(req) {
return (
req?.socket?.remoteAddress ||
req?.connection?.remoteAddress ||
null
);
}
function denyIfNotLocal(req, res) {
const ip = normalizeIp(getRequestIp(req));
const ip = normalizeIp(getSocketIp(req));
if (isLocalNetwork(ip)) {
return false;
}