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
34eaf32f
Commit
34eaf32f
authored
Apr 21, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitelist sidekiq route in the readonly_geo middleware
parent
744b21b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
lib/gitlab/middleware/readonly_geo.rb
lib/gitlab/middleware/readonly_geo.rb
+7
-3
No files found.
lib/gitlab/middleware/readonly_geo.rb
View file @
34eaf32f
...
...
@@ -13,8 +13,8 @@ module Gitlab
@env
=
env
if
disallowed_request?
&&
Gitlab
::
Geo
.
secondary?
Rails
.
logger
.
debug
(
'Git
l
ab Geo: preventing possible non readonly operation'
)
error_message
=
'You cannot do writing operations on a secondary Git
l
ab Geo instance'
Rails
.
logger
.
debug
(
'Git
L
ab Geo: preventing possible non readonly operation'
)
error_message
=
'You cannot do writing operations on a secondary Git
L
ab Geo instance'
if
json_request?
return
[
403
,
{
'Content-Type'
=>
'application/json'
},
[{
'message'
=>
error_message
}.
to_json
]]
...
...
@@ -60,12 +60,16 @@ module Gitlab
end
def
whitelisted_routes
logout_route
||
WHITELISTED
.
any?
{
|
path
|
@request
.
path
.
include?
(
path
)
}
logout_route
||
WHITELISTED
.
any?
{
|
path
|
@request
.
path
.
include?
(
path
)
}
||
sidekiq_route
end
def
logout_route
route_hash
[
:controller
]
==
'sessions'
&&
route_hash
[
:action
]
==
'destroy'
end
def
sidekiq_route
@request
.
path
.
start_with?
(
'/admin/sidekiq'
)
end
end
end
end
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