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
de6c3597
Commit
de6c3597
authored
Jul 04, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly handle transforming settings into useful datastructure
parent
c1b043bd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
app/controllers/concerns/requires_whitelisted_monitoring_client.rb
...ollers/concerns/requires_whitelisted_monitoring_client.rb
+5
-1
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+0
-1
No files found.
app/controllers/concerns/requires_whitelisted_monitoring_client.rb
View file @
de6c3597
...
@@ -14,6 +14,10 @@ module RequiresWhitelistedMonitoringClient
...
@@ -14,6 +14,10 @@ module RequiresWhitelistedMonitoringClient
Settings
.
monitoring
.
ip_whitelist
.
any?
{
|
e
|
e
.
include?
(
Gitlab
::
RequestContext
.
client_ip
)
}
Settings
.
monitoring
.
ip_whitelist
.
any?
{
|
e
|
e
.
include?
(
Gitlab
::
RequestContext
.
client_ip
)
}
end
end
def
ip_whitelist
@ip_whitelist
||=
Settings
.
monitoring
.
ip_whitelist
.
map
(
&
IPAddr
.
method
(
:new
))
end
def
token_valid?
def
token_valid?
token
=
params
[
:token
].
presence
||
request
.
headers
[
'TOKEN'
]
token
=
params
[
:token
].
presence
||
request
.
headers
[
'TOKEN'
]
token
.
present?
&&
token
.
present?
&&
...
...
config/initializers/1_settings.rb
View file @
de6c3597
...
@@ -499,7 +499,6 @@ Settings.webpack.dev_server['port'] ||= 3808
...
@@ -499,7 +499,6 @@ Settings.webpack.dev_server['port'] ||= 3808
#
#
Settings
[
'monitoring'
]
||=
Settingslogic
.
new
({})
Settings
[
'monitoring'
]
||=
Settingslogic
.
new
({})
Settings
.
monitoring
[
'ip_whitelist'
]
||=
%w{127.0.0.1/8}
Settings
.
monitoring
[
'ip_whitelist'
]
||=
%w{127.0.0.1/8}
Settings
.
monitoring
.
ip_whitelist
.
map!
(
&
IPAddr
.
method
(
:new
))
#
#
# Prometheus metrics settings
# Prometheus metrics settings
...
...
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