Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
732b1226
Commit
732b1226
authored
Oct 06, 2017
by
Michael Kozono
Committed by
Francisco Lopez
Nov 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add throttle application settings
parent
10c216da
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
0 deletions
+56
-0
app/models/application_setting.rb
app/models/application_setting.rb
+9
-0
db/migrate/20171006220837_add_global_rate_limits_to_application_settings.rb
...6220837_add_global_rate_limits_to_application_settings.rb
+38
-0
db/schema.rb
db/schema.rb
+9
-0
No files found.
app/models/application_setting.rb
View file @
732b1226
...
@@ -295,6 +295,15 @@ class ApplicationSetting < ActiveRecord::Base
...
@@ -295,6 +295,15 @@ class ApplicationSetting < ActiveRecord::Base
sign_in_text:
nil
,
sign_in_text:
nil
,
signup_enabled:
Settings
.
gitlab
[
'signup_enabled'
],
signup_enabled:
Settings
.
gitlab
[
'signup_enabled'
],
terminal_max_session_time:
0
,
terminal_max_session_time:
0
,
throttle_unauthenticated_enabled:
false
,
throttle_unauthenticated_requests_per_period:
3600
,
throttle_unauthenticated_period_in_seconds:
3600
,
throttle_authenticated_web_enabled:
false
,
throttle_authenticated_web_requests_per_period:
7200
,
throttle_authenticated_web_period_in_seconds:
3600
,
throttle_authenticated_api_enabled:
false
,
throttle_authenticated_api_requests_per_period:
7200
,
throttle_authenticated_api_period_in_seconds:
3600
,
two_factor_grace_period:
48
,
two_factor_grace_period:
48
,
user_default_external:
false
,
user_default_external:
false
,
polling_interval_multiplier:
1
,
polling_interval_multiplier:
1
,
...
...
db/migrate/20171006220837_add_global_rate_limits_to_application_settings.rb
0 → 100644
View file @
732b1226
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
AddGlobalRateLimitsToApplicationSettings
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_column_with_default
:application_settings
,
:throttle_unauthenticated_enabled
,
:boolean
,
default:
false
,
allow_null:
false
add_column_with_default
:application_settings
,
:throttle_unauthenticated_requests_per_period
,
:integer
,
default:
3600
,
allow_null:
false
add_column_with_default
:application_settings
,
:throttle_unauthenticated_period_in_seconds
,
:integer
,
default:
3600
,
allow_null:
false
add_column_with_default
:application_settings
,
:throttle_authenticated_api_enabled
,
:boolean
,
default:
false
,
allow_null:
false
add_column_with_default
:application_settings
,
:throttle_authenticated_api_requests_per_period
,
:integer
,
default:
7200
,
allow_null:
false
add_column_with_default
:application_settings
,
:throttle_authenticated_api_period_in_seconds
,
:integer
,
default:
3600
,
allow_null:
false
add_column_with_default
:application_settings
,
:throttle_authenticated_web_enabled
,
:boolean
,
default:
false
,
allow_null:
false
add_column_with_default
:application_settings
,
:throttle_authenticated_web_requests_per_period
,
:integer
,
default:
7200
,
allow_null:
false
add_column_with_default
:application_settings
,
:throttle_authenticated_web_period_in_seconds
,
:integer
,
default:
3600
,
allow_null:
false
end
def
down
remove_column
:application_settings
,
:throttle_authenticated_web_period_in_seconds
remove_column
:application_settings
,
:throttle_authenticated_web_requests_per_period
remove_column
:application_settings
,
:throttle_authenticated_web_enabled
remove_column
:application_settings
,
:throttle_authenticated_api_period_in_seconds
remove_column
:application_settings
,
:throttle_authenticated_api_requests_per_period
remove_column
:application_settings
,
:throttle_authenticated_api_enabled
remove_column
:application_settings
,
:throttle_unauthenticated_period_in_seconds
remove_column
:application_settings
,
:throttle_unauthenticated_requests_per_period
remove_column
:application_settings
,
:throttle_unauthenticated_enabled
end
end
db/schema.rb
View file @
732b1226
...
@@ -140,6 +140,15 @@ ActiveRecord::Schema.define(version: 20171106180641) do
...
@@ -140,6 +140,15 @@ ActiveRecord::Schema.define(version: 20171106180641) do
t
.
integer
"circuitbreaker_storage_timeout"
,
default:
30
t
.
integer
"circuitbreaker_storage_timeout"
,
default:
30
t
.
integer
"circuitbreaker_access_retries"
,
default:
3
t
.
integer
"circuitbreaker_access_retries"
,
default:
3
t
.
integer
"circuitbreaker_backoff_threshold"
,
default:
80
t
.
integer
"circuitbreaker_backoff_threshold"
,
default:
80
t
.
boolean
"throttle_unauthenticated_enabled"
,
default:
false
,
null:
false
t
.
integer
"throttle_unauthenticated_requests_per_period"
,
default:
3600
,
null:
false
t
.
integer
"throttle_unauthenticated_period_in_seconds"
,
default:
3600
,
null:
false
t
.
boolean
"throttle_authenticated_api_enabled"
,
default:
false
,
null:
false
t
.
integer
"throttle_authenticated_api_requests_per_period"
,
default:
7200
,
null:
false
t
.
integer
"throttle_authenticated_api_period_in_seconds"
,
default:
3600
,
null:
false
t
.
boolean
"throttle_authenticated_web_enabled"
,
default:
false
,
null:
false
t
.
integer
"throttle_authenticated_web_requests_per_period"
,
default:
7200
,
null:
false
t
.
integer
"throttle_authenticated_web_period_in_seconds"
,
default:
3600
,
null:
false
end
end
create_table
"audit_events"
,
force: :cascade
do
|
t
|
create_table
"audit_events"
,
force: :cascade
do
|
t
|
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment