Commit Graph

12 Commits

Author SHA1 Message Date
Ash McKenzie c0a5b628c8
Allow sidekiq admin requests, regardless of root 2019-01-16 19:14:46 +11:00
Jasper Maes 807139b6b9 Remove deprecated ActionDispatch::ParamsParser 2018-12-16 10:47:24 +01:00
Marcel Amirault eb640eded7 Correct Gitlab Capitalization in code files 2018-09-21 12:05:37 +00:00
Brett Walker f3e1028371 Refactor rspec matchers in read_only_spec.rb 2018-07-07 04:22:44 +00:00
Ash McKenzie 26bea57883 Better route matching for read-only detection 2018-07-02 17:29:04 +10:00
Lin Jen-Shin bb4fcb7809 Move constants and update for feedback 2018-03-03 00:39:42 +08:00
Lin Jen-Shin bbfce29ba8 Use a controller to hold request values
So that we don't need to hold env after the request.
This makes it much harder to test, especially Rails session is
acting weirdly, so we need `dig('flash', 'flashes', 'alert')`
to dig the actual flash value.
2018-02-07 22:45:02 +08:00
digitalMoksha cba68d338b use `Gitlab::Routing.url_helpers` instead of `Rails.application.routes.url_helpers`
since `Rails.application.routes.url_helpers` creates a new anonymous module every time it's called
2017-11-21 13:29:57 +01:00
Stan Hu 3c52e2f06e Optimize read-only middleware so that it does not consume as much CPU
In !15082, we changed the behavior of the middleware to call
`Rails.application.routes.recognize_path` whenever a new route arrived.
However, this can be a CPU-intensive task because Rails needs to allocate
memory and compile 850+ different regular expressions, which are complicated
in GitLab.

As a short-term fix, we can do a lightweight string match before
we do the heavier comparison.

Closes #40185, gitlab-com/infrastructure#3240
2017-11-20 15:27:52 -08:00
Joe Marty 4dea7944c4 Updates tests to reflect sign_out route change
- Also remove sign_out DELETE route from read-only whitelist routes
2017-11-07 11:42:25 -06:00
Brett Walker 2fd5cc2bff Geo route whitelisting is too optimistic 2017-11-02 12:50:04 +00:00
Toon Claes d13669716a Create idea of read-only database
In GitLab EE, a GitLab instance can be read-only (e.g. when it's a Geo
secondary node). But in GitLab CE it also might be useful to have the
"read-only" idea around. So port it back to GitLab CE.

Also having the principle of read-only in GitLab CE would hopefully
lead to less errors introduced, doing write operations when there
aren't allowed for read-only calls.

Closes gitlab-org/gitlab-ce#37534.
2017-10-06 22:37:40 +02:00