diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-06 16:22:46 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-06 16:22:46 +0000 |
commit | a4dd5792616b6bdc905a1f9ebbd2271fb6e3c34c (patch) | |
tree | dfe02d37dc708c2e3fa1b18ae9d0cd72b9f99e3f /app/models | |
parent | 0a58a8c8258d26e7f5c782ca1cce8665d230fa83 (diff) | |
parent | 70b9d8da4c24bc2317220bedb81b5d2ecf34c351 (diff) | |
download | gitlab-ce-a4dd5792616b6bdc905a1f9ebbd2271fb6e3c34c.tar.gz |
Merge branch '27520-option-to-prevent-signing-in-from-multiple-ips' into 'master'
GitLab should have an option to prevent users from signing in from multiple IPs
Closes #27520
See merge request !8998
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/application_setting.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 255e8c4ff78..be632930895 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -64,6 +64,16 @@ class ApplicationSetting < ActiveRecord::Base presence: true, if: :akismet_enabled + validates :unique_ips_limit_per_user, + numericality: { greater_than_or_equal_to: 1 }, + presence: true, + if: :unique_ips_limit_enabled + + validates :unique_ips_limit_time_window, + numericality: { greater_than_or_equal_to: 0 }, + presence: true, + if: :unique_ips_limit_enabled + validates :koding_url, presence: true, if: :koding_enabled @@ -184,6 +194,9 @@ class ApplicationSetting < ActiveRecord::Base domain_whitelist: Settings.gitlab['domain_whitelist'], gravatar_enabled: Settings.gravatar['enabled'], help_page_text: nil, + unique_ips_limit_per_user: 10, + unique_ips_limit_time_window: 3600, + unique_ips_limit_enabled: false, housekeeping_bitmaps_enabled: true, housekeeping_enabled: true, housekeeping_full_repack_period: 50, |