Commit Graph

53 Commits

Author SHA1 Message Date
Jacob Vosmaer (GitLab) 1142e2c32e Migrate storage nesting check to Gitaly 2018-06-27 16:20:03 +00:00
Kamil Trzciński 53d1c87c86 Fix Fog mocking 2018-06-05 16:48:42 +02:00
Kamil Trzciński eea26a93e7 Update validator 2018-06-04 22:31:01 +02:00
Kamil Trzciński b8370c9f55 Support presigned multipart uploads 2018-06-04 13:04:29 +02:00
Stan Hu 81e899ea71 Merge branch 'sh-bump-ruby-2.4' into 'master'
Upgrade to Ruby 2.4.4

See merge request gitlab-org/gitlab-ce!19055
2018-06-01 17:59:04 +00:00
Stan Hu 990af4fb5d Replace grape-route-helpers with our own grape-path-helpers
This gem (https://gitlab.com/gitlab-org/grape-path-helpers) makes a number of changes:

1. Brings in @mdelaossa's changes in https://github.com/reprah/grape-route-helpers/pull/21
2. Fixes some broken specs and code for Grape 1.0+
3. Optimizes the generation of paths by bringing in @dblessing's
   HashWithIndifferentAccess changes in https://gitlab.com/gitlab-org/gitlab-ce/issues/45718#note_70123793

Closes #45718
2018-05-30 03:15:03 -07:00
Stan Hu b5c706326a Upgrade to Ruby 2.4.4
Fixes that make this work:

* A change in Ruby (ce635262f5)
requires passing in the exact required length for OpenSSL keys and IVs.

* Ensure the secrets.yml is generated before any prepended modules are
loaded. This is done by renaming the `secret_token.rb` initializer to
`01_secret_token.rb`, which is a bit ugly but involves the least impact on
other files.
2018-05-29 15:19:33 -07:00
Zeger-Jan van de Weg b788863c68
Remove method call to deprecated method
Given the settings initializer creates Gitaly Storage Settings objects
already, the calls to path can be moved to that initializer.
2018-05-11 08:57:06 +02:00
Francisco Javier López ef48664047 Replacing gollum libs for custom gitlab ones 2018-04-13 13:17:52 +00:00
Kamil Trzciński 678620cce6 Add `direct_upload` setting for artifacts 2018-04-05 15:01:14 +02:00
Sean McGivern 835fe4d324 Merge branch '40781-os-to-ce' into 'master'
Bring Object Storage to CE

Closes #4171, #4163, #3370, #2841, and #29203

See merge request gitlab-org/gitlab-ce!17358
2018-03-27 08:20:03 +00:00
Jacob Vosmaer 008a6a6ce6 Route path lookups through legacy_disk_path 2018-03-21 18:18:32 +01:00
Sean McGivern d4a282751d Merge branch '4879-support-private-https-urls-for-object-storage' into 'master'
Resolve ""Support private HTTPS urls for object storage""

Closes #4879

See merge request gitlab-org/gitlab-ee!4475
2018-02-28 21:26:34 +01:00
Mario de la Ossa 233a986111
Fix grape-route-helper route shadowing
Bringing in https://github.com/reprah/grape-route-helpers/pull/21 as a
monkey patch since the grape-route-helpers project seems to be abandoned
2018-01-29 15:28:14 -06:00
Achilleas Pipinellis 85940d766a
Default to HTTPS for all Gravatar URLs
If using gravatar.com, both plain_url and ssl_url in settings are now
served via HTTPS. Make this the default.
2018-01-25 10:00:46 +01:00
Francisco Javier López 138e8ad1a2 Fixing bug related to wiki last version 2018-01-09 16:01:09 +00:00
Pawel Chojnacki b90bf88b14 Fix rspec errors, and add more tests to MethodCall and ActionView 2017-11-02 18:11:43 +01:00
Bob Van Landuyt 619021fd7a Read circuitbreaker settings from `Gitlab::CurrentSettings`
Instead of from the configuration file
2017-10-17 11:50:32 +02:00
Markus Koller 26eadca48c
Upgrade doorkeeper-openid_connect 2017-09-20 17:38:33 +02:00
Robin Bobbitt 0013e6c00d Clean up read_registry scope changes
Closes #37789
2017-09-18 08:39:01 -04:00
Kamil Trzciński 1e6d305bcc Fix doorkeeper failure 2017-09-13 09:06:18 +00:00
Michael Kozono a037a79130 Setup repositories settings properly 2017-08-17 16:00:07 -07:00
Michael Kozono 1c3a2bc389 Setup LDAP settings properly 2017-08-17 16:00:07 -07:00
Bob Van Landuyt 3598e60bf2 Add a Circuitbreaker for storage paths 2017-08-04 15:38:48 +02:00
Rémy Coutable cddc5cacfb Use described_class when possible
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Paweł Chojnacki 26ac691a68 Instrument Unicorn with Ruby exporter 2017-07-04 15:28:34 +00:00
Sean McGivern 54c0c0cd17 Instrument MergeRequestDiff#load_commits
This instrumentation isn't needed strictly for performance measurements, but
just to see which controller actions call this method at all. See
<https://gitlab.com/gitlab-org/gitlab-ce/issues/30224#note_32306159> for more
details.
2017-06-14 12:01:38 +01:00
mhasbini 0a09925dce Enable Style/Proc cop for rubocop 2017-04-02 12:48:43 +03:00
Alejandro Rodríguez 46214d5e7b Improve storage validation after configuration structure update
Besides improving the error message to specify what exactly you
need to do to solve the error, we now don't skip all storage
validations on the test environment, so that you also get a nice error
message if you're running tests. Now if conditions are met to skip
valitaions (test env or env variable) we still make sure the settings
_look_ sane, we just skip verifying the paths exists and meet the given
conditions.
2017-03-08 15:51:30 -03:00
Sean McGivern a5db7f5425 Merge branch '28447-hybrid-repository-storages' into 'master'
Update storage settings to allow extra values per shard

See merge request !9597
2017-03-07 16:55:03 +00:00
Markus Koller b2ca28d24b Add specs for Doorkeeper resource_owner_authenticator 2017-03-07 15:08:15 +01:00
Markus Koller eefbc83730 Only use API scopes for personal access tokens 2017-03-07 15:00:29 +01:00
Markus Koller c498289048 Implement OpenID Connect identity provider 2017-03-07 14:54:35 +01:00
Alejandro Rodríguez 0b9d56f960 Update storage settings to allow extra values per shard
This will be necessary when adding gitaly settings. This version
doesn't make any functional changes, but allows us to include this
breaking change in 9.0 and add the needed extra settings in the future
with backwards compatibility
2017-03-03 12:13:30 -03:00
Adam Niedzielski ee31872777 Execute metrics initializer earlier
This makes sure that Gitlab::Metrics::RackMiddleware is added before
Gitlab::EtagCaching::Middleware.
2017-03-01 18:15:28 +01:00
Douwe Maan c10064aad5 Enable Style/SpaceInsideBrackets 2017-02-23 09:31:56 -06:00
Sean McGivern a96765e627 Add metric initializer spec
An empty file in one of the instrumented directories will cause the app
to fail to start when metrics are enabled. Metrics aren't enabled by
default in development or test.

We could handle the empty file case explicitly, but a file could still
not define the constant it is expected to, so instead run the
initializer manually in a spec and check that it succeeds.
2017-01-24 14:42:57 +00:00
Adam Niedzielski a8177e03e5 Introduce "stub_env" test helper for safely stubbing environment variables 2017-01-09 18:19:48 +01:00
Sean McGivern 90565b5f95 Give priority to environment variables
If an environment variable exists for secret_key_base, use that -
always. But don't save it to secrets.yml.

Also ensure that we never write to secrets.yml if there's a non-blank
value there.
2016-08-03 15:48:48 +01:00
Sean McGivern 379c2cbcbd Store all secret keys in secrets.yml
Move the last secret from .secret to config/secrets.yml, and delete
.secret if it exists.
2016-08-03 15:48:47 +01:00
Sean McGivern 405379bbfc Store OTP secret key in secrets.yml
.secret stores the secret token used for both encrypting login cookies
and for encrypting stored OTP secrets. We can't rotate this, because
that would invalidate all existing OTP secrets.

If the secret token is present in the .secret file or an environment
variable, save it as otp_key_base in secrets.yml. Now .secret can be
rotated without invalidating OTP secrets.

If the secret token isn't present (initial setup), then just generate a
separate otp_key_base and save in secrets.yml.

Update the docs to reflect that secrets.yml needs to be retained past
upgrades, but .secret doesn't.
2016-08-03 15:46:37 +01:00
lookatmike ae108ff703 Ignore invalid IPs in X-Forwarded-For when trusted proxies are configured. 2016-07-31 15:36:11 -04:00
Stan Hu 8d73c76131 Ignore invalid trusted proxies in X-Forwarded-For header
Certain reverse proxies can send invalid IP addresses in the X-Forwarded-For header
For example, Apache can send (null).

Closes #20194
2016-07-23 21:06:19 -07:00
Alejandro Rodríguez 89589007ae Skip repository storage path valitaions on test environment
Storage path are not created until `TestEnv.init`, so we must skip
their validation on initialization.
2016-07-21 18:33:51 -04:00
Alejandro Rodríguez 72f59ddf4c Use Pathname to make the repository storage path validations more robust 2016-07-21 18:29:56 -04:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Douwe Maan 8a245b80a5 Merge branch 'rack-request-trusted-proxies' into 'master'
Make Rack::Request use our trusted proxies when filtering IP addresses

## What does this MR do?

This allows us to control the trusted proxies while deployed in a private network.

## Are there points in the code the reviewer needs to double check?

If we want to limit what is impacted, we can do this specifically for the rack_attack request object.

## Why was this MR needed?

Normally Rack::Request will trust all private IPs as trusted proxies, which can cause problems if your users are connection on you network via private IP ranges.
    
Normally in a rails app this is handled by action_dispatch request, but rack_attack is specifically using the Rack::Request object instead.

## What are the relevant issue numbers?

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/17550

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- [ ] ~~API support added~~
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)


\cc @stanhu

See merge request !4958
2016-06-30 15:37:16 +00:00
DJ Mountney 860785f007 Make Rack::Request use our trusted proxies when filtering IP addresses
This allows us to control the trusted proxies while deployed in a private network. Normally Rack::Request will trust all private IPs as trusted proxies, which can caue problems if your users are connection on you network via private IP ranges.

Normally in a rails app this is handled by action_dispatch request, but rack_attack is specifically using the Rack::Request object instead.
2016-06-29 21:19:55 -07:00
Alejandro Rodríguez 86359ec854 Refactor repository paths handling to allow multiple git mount points 2016-06-29 22:30:31 -04:00