1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Prevent brute force login attack

This commit is contained in:
Chocobozzz 2018-03-29 10:58:24 +02:00
parent 23f4c3d412
commit 490b595a01
No known key found for this signature in database
GPG key ID: 583A612D890159BE
16 changed files with 189 additions and 22 deletions

View file

@ -127,6 +127,7 @@ const CONFIG = {
URL: '',
HOST: ''
},
TRUST_PROXY: config.get<string[]>('trust_proxy'),
LOG: {
LEVEL: config.get<string>('log.level')
},
@ -234,6 +235,13 @@ const CONSTRAINTS_FIELDS = {
}
}
const RATES_LIMIT = {
LOGIN: {
WINDOW_MS: 5 * 60 * 1000, // 5 minutes
MAX: 10 // 10 attempts
}
}
let VIDEO_VIEW_LIFETIME = 60000 * 60 // 1 hour
const VIDEO_TRANSCODING_FPS = {
MIN: 10,
@ -468,6 +476,7 @@ export {
USER_PASSWORD_RESET_LIFETIME,
IMAGE_MIMETYPE_EXT,
SCHEDULER_INTERVAL,
RATES_LIMIT,
JOB_COMPLETED_LIFETIME,
VIDEO_VIEW_LIFETIME
}