first commit
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
const ALLOWED_IPS = [
|
||||
"86.106.20.28", // L2
|
||||
"89.116.209.21", // L2
|
||||
"86.106.20.24", // L3
|
||||
"84.32.173.80", // L3
|
||||
"34.141.125.49", // euw3-stage-koalemos
|
||||
"35.230.138.117", // euw2-prod-apollo
|
||||
"35.242.131.17", // euw2-prod-apollo
|
||||
"34.89.86.34", // euw2-prod-apollo
|
||||
"35.242.132.122", // euw2-prod-apollo
|
||||
"35.234.116.158", // euw3-stage-koalemos
|
||||
"34.159.186.242", // euw3-stage-koalemos
|
||||
]
|
||||
|
||||
module.exports = {
|
||||
ALLOWED_IPS,
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
|
||||
/// <reference path="../pb_data/types.d.ts" />
|
||||
|
||||
onRecordCreateRequest((e) => {
|
||||
const { ALLOWED_IPS } = require(`${__hooks}/superusers-allow-list.js`)
|
||||
const ip = e.realIP()
|
||||
|
||||
if (!ALLOWED_IPS.includes(ip)) {
|
||||
throw new BadRequestError(`Not allowed to create superuser`)
|
||||
}
|
||||
|
||||
e.next()
|
||||
}, "_superusers")
|
||||
|
||||
onRecordUpdateRequest((e) => {
|
||||
const { ALLOWED_IPS } = require(`${__hooks}/superusers-allow-list.js`)
|
||||
const ip = e.realIP()
|
||||
|
||||
if (!ALLOWED_IPS.includes(ip)) {
|
||||
throw new BadRequestError(`Not allowed to update superuser`)
|
||||
}
|
||||
|
||||
e.next()
|
||||
}, "_superusers")
|
||||
|
||||
onRecordDeleteRequest((e) => {
|
||||
const { ALLOWED_IPS } = require(`${__hooks}/superusers-allow-list.js`)
|
||||
const ip = e.realIP()
|
||||
|
||||
if (!ALLOWED_IPS.includes(ip)) {
|
||||
throw new BadRequestError(`Not allowed to delete superuser`)
|
||||
}
|
||||
|
||||
e.next()
|
||||
}, "_superusers")
|
||||
|
||||
onRecordRequestPasswordResetRequest((e) => {
|
||||
const { ALLOWED_IPS } = require(`${__hooks}/superusers-allow-list.js`)
|
||||
const ip = e.realIP()
|
||||
|
||||
if (!ALLOWED_IPS.includes(ip)) {
|
||||
throw new BadRequestError(`Not allowed to request password reset for superuser`)
|
||||
}
|
||||
|
||||
e.next()
|
||||
}, "_superusers")
|
||||
|
||||
onCollectionViewRequest((e) => {
|
||||
const { ALLOWED_IPS } = require(`${__hooks}/superusers-allow-list.js`)
|
||||
const ip = e.realIP()
|
||||
|
||||
if (!ALLOWED_IPS.includes(ip)) {
|
||||
throw new BadRequestError(`Not allowed to view collection`)
|
||||
}
|
||||
|
||||
e.next()
|
||||
})
|
||||
|
||||
onCollectionCreateRequest((e) => {
|
||||
const { ALLOWED_IPS } = require(`${__hooks}/superusers-allow-list.js`)
|
||||
const ip = e.realIP()
|
||||
|
||||
if (!ALLOWED_IPS.includes(ip)) {
|
||||
throw new BadRequestError(`Not allowed to create collection`)
|
||||
}
|
||||
|
||||
e.next()
|
||||
})
|
||||
|
||||
onCollectionUpdateRequest((e) => {
|
||||
const { ALLOWED_IPS } = require(`${__hooks}/superusers-allow-list.js`)
|
||||
const ip = e.realIP()
|
||||
|
||||
if (!ALLOWED_IPS.includes(ip)) {
|
||||
throw new BadRequestError(`Not allowed to update collection`)
|
||||
}
|
||||
|
||||
e.next()
|
||||
})
|
||||
|
||||
onCollectionDeleteRequest((e) => {
|
||||
const { ALLOWED_IPS } = require(`${__hooks}/superusers-allow-list.js`)
|
||||
const ip = e.realIP()
|
||||
|
||||
if (!ALLOWED_IPS.includes(ip)) {
|
||||
throw new BadRequestError(`Not allowed to delete collection`)
|
||||
}
|
||||
|
||||
e.next()
|
||||
})
|
||||
|
||||
onCollectionsImportRequest((e) => {
|
||||
const { ALLOWED_IPS } = require(`${__hooks}/superusers-allow-list.js`)
|
||||
const ip = e.realIP()
|
||||
|
||||
if (!ALLOWED_IPS.includes(ip)) {
|
||||
throw new BadRequestError(`Not allowed to import collections`)
|
||||
}
|
||||
|
||||
e.next()
|
||||
})
|
||||
Reference in New Issue
Block a user