Skip to content

Commit

Permalink
Make rate limiting config more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
asaunier committed Jan 23, 2018
1 parent 5003d1d commit 5f2a7e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
12 changes: 6 additions & 6 deletions common.ini.in
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ image_backend.secret_key = {image_backend_secret_key}
image_url = {image_url}

# Rate limiting settings
# Window timespan in seconds (15min):
rate_limiting.window_span = 900
# Window timespan in seconds:
rate_limiting.window_span = {rate_limiting_window_span}
# Max number of actions allowed during a single window:
rate_limiting.limit = 50
rate_limiting.limit_moderator = 100
rate_limiting.limit_robot = 1000
rate_limiting.limit = {rate_limiting_limit}
rate_limiting.limit_moderator = {rate_limiting_limit_moderator}
rate_limiting.limit_robot = {rate_limiting_limit_robot}
# Max number of times a user can be rate limited before being blocked:
rate_limiting.max_times = 3
rate_limiting.max_times = {rate_limiting_max_times}
# Email address rate limiting alert messages are sent to
rate_limiting.alert_address = {rate_limiting_alert_address}
9 changes: 9 additions & 0 deletions config/default
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,13 @@ export guidebook_anonymous_user_account = 2

export show_debugger_for_errors = false

# Rate limiting settings
export rate_limiting_alert_address = [email protected]
# Window timespan in seconds:
export rate_limiting_window_span = 900
# Max number of actions allowed during a single window:
export rate_limiting_limit = 50
export rate_limiting_limit_moderator = 100
export rate_limiting_limit_robot = 1000
# Max number of times a user can be rate limited before being blocked:
export rate_limiting_max_times = 3

0 comments on commit 5f2a7e5

Please sign in to comment.