Inspect payment to paid Wi-Fi handoff without personal data

This commit is contained in:
jfeng committed 2026-10-22 17:47:19 +00:00
1 parent 9165731fec
commit a4e3d1ff56
1 file changed
+3 -5
+3 -5
View File
@@ -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})))); 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));} } 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'); const db=JSON.parse(fs.readFileSync(config.dataDir+'/db.json','utf8'));
if(active){ 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}))));
const cs=(await rosCommand(['/ip/firewall/connection/print'])).map(object).filter(c=>(c['src-address']||'').split(':')[0]===active.address); console.log('ACCESS-CONFIG',JSON.stringify({seconds:config.freeAccessSeconds,cooldown:config.freeAccessCooldownSeconds}));
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})))));
}