Commit Graph

77 Commits

Author SHA1 Message Date
GitLab Bot 692f4b734f Add latest changes from gitlab-org/gitlab@master 2020-09-03 21:08:18 +00:00
GitLab Bot 08b3b98051 Add latest changes from gitlab-org/gitlab@master 2020-09-01 12:11:01 +00:00
GitLab Bot 184906087f Add latest changes from gitlab-org/gitlab@master 2020-08-31 00:10:37 +00:00
GitLab Bot aca89cb7e9 Add latest changes from gitlab-org/gitlab@master 2020-08-04 15:09:27 +00:00
GitLab Bot ed00b1a6a3 Add latest changes from gitlab-org/gitlab@master 2020-07-28 12:09:49 +00:00
GitLab Bot ce34395e91 Add latest changes from gitlab-org/gitlab@master 2020-07-13 12:09:18 +00:00
GitLab Bot c59765a50a Add latest changes from gitlab-org/gitlab@master 2020-06-24 18:09:03 +00:00
GitLab Bot c6e6762bbf Add latest changes from gitlab-org/gitlab@master 2020-06-01 09:08:28 +00:00
GitLab Bot a5650b86b5 Add latest changes from gitlab-org/gitlab@master 2020-05-13 21:08:55 +00:00
GitLab Bot 3aeda4e614 Add latest changes from gitlab-org/gitlab@master 2020-04-30 21:09:47 +00:00
GitLab Bot b71a496c7a Add latest changes from gitlab-org/gitlab@master 2020-04-15 03:09:11 +00:00
GitLab Bot 132dd28342 Add latest changes from gitlab-org/gitlab@master 2020-03-28 09:08:30 +00:00
GitLab Bot 6f2065c468 Add latest changes from gitlab-org/gitlab@master 2020-03-25 15:07:47 +00:00
GitLab Bot 76e9fc7b29 Add latest changes from gitlab-org/gitlab@master 2020-03-11 18:09:23 +00:00
GitLab Bot 1fa79760ad Add latest changes from gitlab-org/gitlab@master 2020-03-10 12:08:16 +00:00
GitLab Bot 22e9af3c8b Add latest changes from gitlab-org/gitlab@master 2020-01-27 12:08:35 +00:00
GitLab Bot a5ab3467a7 Add latest changes from gitlab-org/gitlab@master 2020-01-13 15:07:53 +00:00
GitLab Bot 7f8330873c Add latest changes from gitlab-org/gitlab@master 2019-12-18 21:07:37 +00:00
GitLab Bot e723867717 Add latest changes from gitlab-org/gitlab@master 2019-12-17 18:07:48 +00:00
GitLab Bot d5b4360051 Add latest changes from gitlab-org/gitlab@master 2019-11-26 03:06:24 +00:00
GitLab Bot 34b3567c97 Add latest changes from gitlab-org/gitlab@master 2019-11-19 09:06:16 +00:00
GitLab Bot 2b3007dc96 Add latest changes from gitlab-org/gitlab@master 2019-09-20 18:06:35 +00:00
Robert Speicher b51770c66a Merge branch 'local-test-failures' into 'master'
git-user-related local test failures

See merge request gitlab-org/gitlab-ce!31437
2019-08-29 14:27:05 +00:00
Thong Kuah 8c42a0eac0 Add frozen_string_literal to lib part 2
Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-08-23 00:15:24 +12:00
David H. Wilkins 6391eeec30 git-user-related local test failures
Some of the tests fail locally due to the git user being different
than it is on the test runners.   I'd really like to be able to run
all of the tests locally.
2019-08-02 18:18:09 -05:00
Stan Hu 01203e7188 Fix health checks not working behind load balancers
The change in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24199 caused
requests coming from a load balancer to arrive as 127.0.0.1 instead of
the actual IP.

`Rack::Request#ip` behaves slightly differently different than
`ActionDispatch::Request#remote_ip`: the former will return the first
X-Forwarded-For IP if all of the IPs are trusted proxies, while the
second one filters out all proxies and falls back to REMOTE_ADDR, which
is 127.0.0.1.

For now, we can revert back to using `Rack::Request` because these
middlewares don't manipulate parameters. The actual fix problem involves
fixing Rails: https://github.com/rails/rails/issues/28436.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/58573
2019-03-12 12:46:40 -07:00
Ash McKenzie c0a5b628c8
Allow sidekiq admin requests, regardless of root 2019-01-16 19:14:46 +11:00
Stan Hu 7d28e39f58 Fix multipart attachments not uploading
Mixing and matching the use of Rack::Request and ActionDispatch::Request
in Rails 5 is bad, particularly if you have middleware that
manipulates or accesses environment variables.

`Gitlab::Middleware::Multipart` attempts to rewrite request parameters
to the proper values (e.g. replacing `data_file` with
`UploadedFile`). It does this by calling `Rack::Request#update_params`,
which essentially updates `env['rack.request.form_hash']`.

By changing to `ActionDispatch::Request`, the Go middleware was causing
the request parameters to be stored inside
`env['action_dispatch.request.request_parameters']`. Later calls to
`Rack::Request#update_params` would not have any effect because it would
attempt to update `env['rack.request.form_has']` instead of
`env['action_dispatch.request.request_parameters']`. As a result, the
controller still saw the old parameters.

Since the Go middleware appears to be using `ActionDispatch::Request`
for authorization methods, we can switch the multipart middleware to
use it too.

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/9035
2019-01-05 01:56:47 -08:00
mortyccp 0e061adfcb Fix lint errors 2019-01-03 20:28:02 +08:00
mortyccp 3a62f15657 Remove authentication via warden and PRIVATE_TOKEN header 2019-01-03 20:28:02 +08:00
mortyccp b7e0a09de2 Fix rspec error in rails 4 2019-01-03 20:28:02 +08:00
mortyccp d1fea99deb Allow basic authentication on go get middleware 2019-01-03 20:28:02 +08: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
Jan Provaznik 4ca9f3b417 Add public/uploads/tmp to allowed upload paths
When direct_upload is enabled and a for file is being uploaded,
then workhorse uses `public/uploads/tmp` path. If `uploads.storage_path`
i sset to a different directory, then upload fails because
`public/uploads/tmp` is not in allowed paths.
2018-08-21 17:39:46 +02:00
Stan Hu 22d44ae9a6 Use /-/health instead of breaking /-/liveness 2018-07-28 14:35:02 -07:00
Stan Hu eb2bc7d99a Simplify /-/liveness check to avoid connecting to the database
The previous implementation would hit the database each time
and provide a dummy response. If the database goes down, this
means all application workers would be taken out of service.
Simplify this check by using a Rails middleware that intercepts
this endpoint and returns a 200 response.
2018-07-28 14:35:02 -07:00
Mark Chao a63bce1a4b Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
Jan Provaznik 6b2ebea7dc Added test and used Array() instead of .wrap 2018-07-09 13:06:12 +02:00
Brett Walker f3e1028371 Refactor rspec matchers in read_only_spec.rb 2018-07-07 04:22:44 +00:00
Kamil Trzciński (OoO till 3th) 34694c3afc Merge branch 'jprovazn-direct-upload' into 'master'
Add workhorse authorize method for project/group uploads

Closes #44663

See merge request gitlab-org/gitlab-ce!19717
2018-07-04 09:50:29 +00:00
Ash McKenzie 26bea57883 Better route matching for read-only detection 2018-07-02 17:29:04 +10:00
Jan Provaznik 249c24891a Updated multipart to support workhorse direct uploads 2018-06-27 12:54:46 +02:00
Lin Jen-Shin bb4fcb7809 Move constants and update for feedback 2018-03-03 00:39:42 +08:00
Lin Jen-Shin 6c5a7d5305 Merge remote-tracking branch 'upstream/master' into 42572-release-controller
* upstream/master: (889 commits)
  SlackService - respect `notify_only_default_branch` for push events
  Clarify usage ping wording in admin area
  Update incoming emails documents
  Allow to include also descendant group labels
  Update docs on grouping CI jobs
  Support additional LabelsFinder parameters for group labels
  Extend Cluster Applications to install GitLab Runner to Kubernetes cluster
  Remove registry list webpack entry point
  Remove trailing newline that was causing an EE conflict
  Small fixes in Vuex docs
  Remove u2f webpack bundle
  Update documentation WRT to request parameters
  remove common_vue CommonsChunk config
  Fetch commit signatures from Gitaly in batches
  migrate stl_viewer to dynamic import
  migrate sketch_viewer to dynamic import
  migrate pdf_viewer to dynamic import
  migrate notebook_viewer to dynamic import
  migrate balsamiq_viewer to dynamic import
  Add some strings that were missing in gitlab.pot
  ...
2018-03-03 00:10:21 +08:00
Douwe Maan 7a6c7bd66b Allow token authentication on go-get request 2018-02-23 10:33:46 +00:00
Alessio Caiazza 34c2a59c57
Honour workhorse provided file name
In the attempt to unify file uploading at workhorse level gitlab-org/gitlab-workhorse!230
we moved to a prefix-based tempfile creation in order to avoid upload collisions.

Artifacts and LFS uploads already set original_filename to workhorse provided filename

This commit add the same feature to `Gitlab::Middleware::Multipart`
2018-02-12 17:31:29 +01:00
Lin Jen-Shin 31f1ec59a7 Release the entire env 2018-02-07 22:56:07 +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
Lin Jen-Shin d4d564c8e7 Try not to hold env and release the controller
after the request. This way, we could release the
project referred from the controller, which potentially
referred a repository which potentially allocated a lot of
memories.

Before this change, we could hold the last request data
and cannot release the memory. After this change, the
largest request data should be able to be collected from GC.

This might not impact the instances having heavy load,
as the last request should be changing all the time,
and GC won't kick in for each request anyway.

However it could still potentially allow us to free more
memories for each GC runs, because now we could free one
more request anyway.
2018-02-07 22:45:02 +08:00