mirror of
https://github.com/diced/zipline.git
synced 2025-05-11 18:36:02 +02:00
blacklisted ips
This commit is contained in:
parent
194472683b
commit
e6efff28dd
2 changed files with 8 additions and 0 deletions
|
@ -134,3 +134,10 @@ server.listen(config.core.port, err => {
|
|||
)}`
|
||||
);
|
||||
});
|
||||
|
||||
server.addHook('preHandler', async (req, reply) => {
|
||||
if (config.core.blacklisted_ips && config.core.blacklisted_ips.includes(req.ip)) {
|
||||
await app.render404(req.raw, reply.raw);
|
||||
return (reply.sent = true);
|
||||
}
|
||||
});
|
|
@ -37,6 +37,7 @@ export interface ConfigUrls {
|
|||
export interface ConfigCore {
|
||||
secret: string;
|
||||
port: number;
|
||||
blacklisted_ips?: string[];
|
||||
}
|
||||
|
||||
export interface ConfigWebhooks {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue