mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Configurable abuse limit
This commit is contained in:
@@ -142,6 +142,7 @@ _APP_MESSAGE_PUSH_TEST_DSN=
|
||||
_APP_WEBHOOK_MAX_FAILED_ATTEMPTS=10
|
||||
_APP_PROJECT_REGIONS=default
|
||||
_APP_FUNCTIONS_CREATION_ABUSE_LIMIT=5000
|
||||
_APP_EMAILS_ABUSE_LIMIT=20
|
||||
_APP_STATS_USAGE_DUAL_WRITING_DBS=database_db_main
|
||||
_APP_TRUSTED_HEADERS=x-forwarded-for
|
||||
_APP_POOL_ADAPTER=stack
|
||||
|
||||
@@ -1140,7 +1140,9 @@ Http::init()
|
||||
*/
|
||||
$abuseKey = 'initHook:outgoingEmail,projectId:{projectId}';
|
||||
|
||||
$timeLimit = $timelimit($abuseKey, limit: 1000, time: 3600); // 1000 emails per hour , per project
|
||||
$limitPerHour = \intval(System::getEnv('_APP_EMAILS_ABUSE_LIMIT', '1000'));
|
||||
|
||||
$timeLimit = $timelimit($abuseKey, limit: $limitPerHour, time: 3600); // 1000 emails per hour , per project
|
||||
$timeLimit
|
||||
->setParam('{projectId}', $project->getId());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user