discourse/config/initializers
Alan Guo Xiang Tan 859d61003e
DEV: API to register custom request rate limiting conditions (#30239)
This commit adds the `add_request_rate_limiter` plugin API which allows plugins to add custom rate limiters on top of the default rate limiters which requests by a user's id or the request's IP address.

Example to add a rate limiter that rate limits all requests from Googlebot under the same rate limit bucket:

```
add_request_rate_limiter(
  identifier: :country,
  key: ->(request) { "country/#{DiscourseIpInfo.get(request.ip)[:country]}" },
  activate_when: ->(request) { DiscourseIpInfo.get(request.ip)[:country].present? },
)
```
2024-12-23 09:57:18 +08:00
..
001-redis.rb
002-freedom_patches.rb DEV: Upgrade Rails to version 7.2 2024-11-27 10:48:47 +01:00
002-rails_failover.rb DEV: Upgrade Rails to version 7.2 2024-11-27 10:48:47 +01:00
004-message_bus.rb FIX: serialize Flags instead of PostActionType (#28362) 2024-08-14 12:13:46 +10:00
005-site_settings.rb
006-ensure_login_hint.rb
006-mini_profiler.rb FIX: Mini-profiler CSP nonce when in report-only mode (#28664) 2024-09-02 10:04:47 +01:00
008-rack-cors.rb
009-omniauth.rb
012-web_hook_events.rb
013-excon_defaults.rb
014-track-setting-changes.rb
099-anon-cache.rb
099-drain_pool.rb
100-active-support-type-extensions.rb
100-flags.rb DEV: Upgrade Rails to version 7.2 2024-11-27 10:48:47 +01:00
100-i18n.rb
100-logster.rb PERF: Don't do initialization for every DB if RAILS_DB is set (#28668) 2024-09-03 15:56:46 +10:00
100-oj.rb
100-onebox_options.rb FEATURE: use new site setting for onebox custom user agent. (#28045) 2024-07-24 04:45:30 +05:30
100-push-notifications.rb
100-quiet_logger.rb
100-regex-timeout.rb
100-secret_token.rb
100-session_store.rb
100-sidekiq.rb DEV: Log a warning message when a MiniScheduler scheduled job is stuck (#28258) 2024-08-08 12:20:16 +08:00
100-silence_logger.rb
100-strong_parameters.rb
100-verify_config.rb
100-wrap_parameters.rb
101-lograge.rb DEV: Log number of live slots used by requests (#29884) 2024-11-28 18:25:48 +02:00
102-truncate-logs.rb
200-first_middlewares.rb FIX: Set sane default for Net::HTTP when processing a request (#28141) 2024-08-06 07:12:42 +08:00
300-perf.rb
400-deprecations.rb
000-development_reload_warnings.rb DEV: Make the dev watcher ignore node_modules (#29263) 2024-10-17 23:34:10 +02:00
000-mini_sql.rb
000-post_migration.rb
000-trace_pg_connections.rb
000-zeitwerk.rb DEV: API to register custom request rate limiting conditions (#30239) 2024-12-23 09:57:18 +08:00
assets.rb
filter_parameter_logging.rb