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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
80fbced2
Commit
80fbced2
authored
Feb 17, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add admin settings entries
parent
5173c093
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
app/controllers/admin/application_settings_controller.rb
app/controllers/admin/application_settings_controller.rb
+3
-0
app/models/application_setting.rb
app/models/application_setting.rb
+10
-0
app/views/admin/application_settings/_form.html.haml
app/views/admin/application_settings/_form.html.haml
+22
-0
No files found.
app/controllers/admin/application_settings_controller.rb
View file @
80fbced2
...
@@ -138,6 +138,9 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
...
@@ -138,6 +138,9 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:two_factor_grace_period
,
:two_factor_grace_period
,
:user_default_external
,
:user_default_external
,
:user_oauth_applications
,
:user_oauth_applications
,
:unique_ips_limit_per_user
,
:unique_ips_limit_time_window
,
:unique_ips_limit_enabled
,
:version_check_enabled
,
:version_check_enabled
,
:terminal_max_session_time
,
:terminal_max_session_time
,
...
...
app/models/application_setting.rb
View file @
80fbced2
...
@@ -64,6 +64,16 @@ class ApplicationSetting < ActiveRecord::Base
...
@@ -64,6 +64,16 @@ class ApplicationSetting < ActiveRecord::Base
presence:
true
,
presence:
true
,
if: :akismet_enabled
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
,
validates
:koding_url
,
presence:
true
,
presence:
true
,
if: :koding_enabled
if: :koding_enabled
...
...
app/views/admin/application_settings/_form.html.haml
View file @
80fbced2
...
@@ -360,6 +360,28 @@
...
@@ -360,6 +360,28 @@
Generate API key at
Generate API key at
%a
{
href:
'http://www.akismet.com'
,
target:
'blank'
}
http://www.akismet.com
%a
{
href:
'http://www.akismet.com'
,
target:
'blank'
}
http://www.akismet.com
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
=
f
.
label
:unique_ips_limit_enabled
do
=
f
.
check_box
:unique_ips_limit_enabled
Limit sign in from multiple ips
%span
.help-block
#recaptcha_help_block
Helps prevent malicious users hide their activity
.form-group
=
f
.
label
:unique_ips_limit_per_user
,
'IPs per user'
,
class:
'control-label col-sm-2'
.col-sm-10
=
f
.
number_field
:unique_ips_limit_per_user
,
class:
'form-control'
.help-block
Maximum number of unique IPs per user
.form-group
=
f
.
label
:unique_ips_limit_time_window
,
'IP expiration time'
,
class:
'control-label col-sm-2'
.col-sm-10
=
f
.
number_field
:unique_ips_limit_time_window
,
class:
'form-control'
.help-block
How long an IP will be counted towards the limit
%fieldset
%fieldset
%legend
Abuse reports
%legend
Abuse reports
.form-group
.form-group
...
...
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