sharktide/tools / ban.js
sharktide's picture
download
raw
1.38 kB
import { createClient } from '@supabase/supabase-js'
const TARGET_DOMAIN = '712pgmy.icu'
// BAN FOR 100 YEARS (876600 HOURS)
const BAN_DURATION = '876600h'
const supabaseAdmin = createClient(
"https://dpixehhdbtzsbckfektd.supabase.co",
'sb_secret_WbGpyssWOUplNfwuv-LBFA_1uKvNq2y',
{ auth: { autoRefreshToken: false, persistSession: false } }
)
async function banDomainUsers() {
let hasMore = true
let page = 1
console.log(`Starting bulk ban for domain: ${TARGET_DOMAIN}...`)
while (hasMore) {
const { data: { users }, error } = await supabaseAdmin.auth.admin.listUsers({
page: page,
perPage: 100,
})
if (error) {
console.error('Error fetching users:', error)
break
}
if (!users || users.length === 0) {
hasMore = false
break
}
// Filter for users matching the domain who are not already banned
const targets = users.filter(user =>
user.email?.endsWith(TARGET_DOMAIN) && !user.banned_until
)
for (const user of targets) {
const { data, error: banError } = await supabaseAdmin.auth.admin.deleteUser(user.id)
if (banError) {
console.error(`Failed to ban ${user.email}:`, banError.message)
} else {
console.log(`Successfully banned: ${user.email}`)
}
}
page++
}
console.log('Bulk ban operation complete.')
}
banDomainUsers()

Xet Storage Details

Size:
1.38 kB
·
Xet hash:
cd4f347bbbe55812dbc4013f61a7c404e3620ad658d6d967a31c0e359ed2c08c

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.