approvals; vault creation by backend

This commit is contained in:
tim
2025-01-16 20:16:31 -04:00
parent 65c4e08e84
commit 2f5a626e5c
8 changed files with 59 additions and 32 deletions

View File

@@ -29,6 +29,7 @@ function approveIP(ipAddress) {
if (!approved)
// todo log ban & report
console.warn(`IP ${ipAddress} from ${country} is banned`)
console.debug(`IP ${ipAddress} from ${country} is ${approved ? 'approved' : 'rejected'}`)
return approved
}
catch (e) {
@@ -40,7 +41,9 @@ function approveIP(ipAddress) {
export function approveRegion(socket, bypass) {
const ipAddress = socket.handshake.address
const approved = bypass === '6ehWWH98diqv39gWZcPo' || approveIP(ipAddress)
const debug = bypass === process.env.DEXORDER_REGION_APPROVAL;
const approved = debug || approveIP(ipAddress)
socket.emit('approvedRegion', approved)
if(debug)
console.info(`approved admin at ${ipAddress}`)
}