From a4e3d1ff56b53b1c3b4f626cc5278e3b163ea21f Mon Sep 17 00:00:00 2001 From: Jorge Fernando dos Santos Date: Thu, 22 Oct 2026 17:47:19 +0000 Subject: [PATCH] Inspect payment to paid Wi-Fi handoff without personal data --- backend/diagnose-hotspot.mjs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/diagnose-hotspot.mjs b/backend/diagnose-hotspot.mjs index cd1f2ae..920db7a 100644 --- a/backend/diagnose-hotspot.mjs +++ b/backend/diagnose-hotspot.mjs @@ -25,8 +25,6 @@ try { console.log('TEMP-RECORDS',JSON.stringify((db.tempAccess||[]).map(t=>({device:hash(t.mac),createdAt:t.createdAt,expiresAt:t.expiresAt,revoked:t.revoked})))); } catch(e){console.log('DB-ERROR',redact(e.message));} -const active=(await rosCommand(['/ip/hotspot/active/print'])).map(object).find(a=>hash(a['mac-address'])==='f38116d39a'); -if(active){ -const cs=(await rosCommand(['/ip/firewall/connection/print'])).map(object).filter(c=>(c['src-address']||'').split(':')[0]===active.address); -console.log('CONNECTION-DETAIL',redact(JSON.stringify(cs.map(c=>({destination:c['dst-address'],reply:c['reply-src-address'],state:c['tcp-state'],protocol:c.protocol,replied:c['seen-reply'],originalPackets:c['orig-packets'],replyPackets:c['repl-packets'],dstnat:c.dstnat}))))); -} +const db=JSON.parse(fs.readFileSync(config.dataDir+'/db.json','utf8')); +console.log('PAYMENT-HANDOFF',JSON.stringify(db.payments.slice(-8).map(p=>({id:hash(p.id),status:p.status,device:p.mac?hash(p.mac):null,hasVoucher:!!p.voucher,paidAt:p.paidAt,connection:p.connection||null})))); +console.log('ACCESS-CONFIG',JSON.stringify({seconds:config.freeAccessSeconds,cooldown:config.freeAccessCooldownSeconds}));