diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cf4aa01f..dc2b6cb11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,9 @@ - Update lexer regex, fix mention regex and add more tests ([778e83d3](https://github.com/pixelfed/pixelfed/commit/778e83d3)) - Update StatusTransformer, generate autolink on request ([dfe2379b](https://github.com/pixelfed/pixelfed/commit/dfe2379b)) - Update ComposeModal component, fix multi filter bug and allow media re-ordering before upload/posting ([56e315f6](https://github.com/pixelfed/pixelfed/commit/56e315f6)) +- Update ApiV1Dot1Controller, allow iar rate limits to be configurable ([28a80803](https://github.com/pixelfed/pixelfed/commit/28a80803)) +- Update ApiV1Dot1Controller, add domain to iar redirect ([1f82d47c](https://github.com/pixelfed/pixelfed/commit/1f82d47c)) +- Update ApiV1Dot1Controller, add configurable app confirm rate limit ttl ([4c6a0719](https://github.com/pixelfed/pixelfed/commit/4c6a0719)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.9 (2023-08-21)](https://github.com/pixelfed/pixelfed/compare/v0.11.8...v0.11.9) diff --git a/app/Http/Controllers/Api/ApiV1Dot1Controller.php b/app/Http/Controllers/Api/ApiV1Dot1Controller.php index 3eaa1d233..298deb705 100644 --- a/app/Http/Controllers/Api/ApiV1Dot1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Dot1Controller.php @@ -602,8 +602,8 @@ class ApiV1Dot1Controller extends Controller abort_if(BouncerService::checkIp($request->ip()), 404); } - $rl = RateLimiter::attempt('pf:apiv1.1:iarc:'.$request->ip(), 10, function(){}, 1800); - abort_if(!$rl, 400, 'Too many requests'); + $rl = RateLimiter::attempt('pf:apiv1.1:iarc:'.$request->ip(), config('pixelfed.app_registration_confirm_rate_limit_attempts', 20), function(){}, config('pixelfed.app_registration_confirm_rate_limit_decay', 1800)); + abort_if(!$rl, 429, 'Too many requests'); $this->validate($request, [ 'user_token' => 'required', diff --git a/config/pixelfed.php b/config/pixelfed.php index 521ccef71..fc7da598a 100644 --- a/config/pixelfed.php +++ b/config/pixelfed.php @@ -289,4 +289,6 @@ return [ 'app_registration_rate_limit_attempts' => env('PF_IAR_RL_ATTEMPTS', 3), 'app_registration_rate_limit_decay' => env('PF_IAR_RL_DECAY', 1800), + 'app_registration_confirm_rate_limit_attempts' => env('PF_IARC_RL_ATTEMPTS', 20), + 'app_registration_confirm_rate_limit_decay' => env('PF_IARC_RL_ATTEMPTS', 1800), ];