Commit Graph

70 Commits

Author SHA1 Message Date
Bob Van Landuyt f1ae1e39ce Move the circuitbreaker check out in a separate process
Moving the check out of the general requests, makes sure we don't have
any slowdown in the regular requests.

To keep the process performing this checks small, the check is still
performed inside a unicorn. But that is called from a process running
on the same server.

Because the checks are now done outside normal request, we can have a
simpler failure strategy:

The check is now performed in the background every
`circuitbreaker_check_interval`. Failures are logged in redis. The
failures are reset when the check succeeds. Per check we will try
`circuitbreaker_access_retries` times within
`circuitbreaker_storage_timeout` seconds.

When the number of failures exceeds
`circuitbreaker_failure_count_threshold`, we will block access to the
storage.

After `failure_reset_time` of no checks, we will clear the stored
failures. This could happen when the process that performs the checks
is not running.
2017-12-08 09:11:39 +01:00
Andrew Newdigate 64e5f996fa Add timeouts for Gitaly calls 2017-11-29 09:12:12 +00:00
Markus Koller 257fd57134 Allow password authentication to be disabled entirely 2017-11-23 13:16:14 +00:00
Bob Van Landuyt 1881d4f8ec Allow configuring new circuitbreaker settings from the UI and API 2017-10-23 12:02:23 +03:00
Kamil Trzcinski 64fd9814fd Prevent ApplicationSetting to cache nil value 2017-10-19 15:07:35 +03:00
Yorick Peterse 65a1cbc600 Merge branch 'prevent-creating-multiple-application-settings' into 'master'
Prevent creating multiple ApplicationSetting by forcing it to always have id=1

Closes #34728

See merge request gitlab-org/gitlab-ce!14718
2017-10-17 13:53:42 +00:00
Bob Van Landuyt 38af7c1613 Allow configuring the circuitbreaker through the API and UI 2017-10-17 11:50:32 +02:00
Kamil Trzcinski c909b6aa6d Prevent creating multiple ApplicationSetting by forcing it to always have id=1 2017-10-16 10:19:18 +02:00
Alex Lossent d96b0eac03 Allow to use same periods for housekeeping tasks
This enables skipping a lesser housekeeping task
(incremental or full repack) by consistently
scheduling a higher task (respectively full repack or gc)
with the same period.
Cf. #34981
2017-09-11 17:41:07 +02:00
Zeger-Jan van de Weg a315e6025c
Merge branch 'master' into zj-auto-devops-table 2017-09-04 09:28:46 +02:00
Zeger-Jan van de Weg 6ed490401f
Implement the implied CI/CD config for AutoDevOps
Behind an application setting, which defaults to false, this commit
implements the implied CI/CD config. Which means that in the case we
can't find the `.gitlab-ci.yml` on the commit we want to start a
pipeline for, we fall back to an implied configuration.

For now the Bash template has been copied to
`Auto-Devops.gitlab-ci.yml` so the tests actually work.

Fixes #34777
2017-08-31 22:25:25 +02:00
Nick Thomas 29b40db589 More review comments 2017-08-30 21:20:00 +01:00
Nick Thomas eb05bdc6f5 Move the key restriction validation to its own class 2017-08-30 20:50:44 +01:00
Nick Thomas 6847060266 Rework the permissions model for SSH key restrictions
`allowed_key_types` is removed and the `minimum_<type>_bits` fields are
renamed to `<tech>_key_restriction`. A special sentinel value (`-1`) signifies
that the key type is disabled.

This also feeds through to the UI - checkboxes per key type are out, inline
selection of "forbidden" and "allowed" (i.e., no restrictions) are in.

As with the previous model, unknown key types are disallowed, even if the
underlying ssh daemon happens to support them. The defaults have also been
changed from the lowest known bit size to "no restriction". So if someone
does happen to have a 768-bit RSA key, it will continue to work on upgrade, at
least until the administrator restricts them.
2017-08-30 20:50:44 +01:00
Nick Thomas b0f982fbdf Add settings for minimum key strength and allowed key type
This is an amalgamation of:

* Cory Hinshaw: Initial implementation !5552
* Rémy Coutable: Updates !9350
* Nick Thomas: Resolve conflicts and add ED25519 support !13712
2017-08-30 20:50:44 +01: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
Nick Thomas aeb2869f66 Prevent bad data being added to application settings when Redis is unavailable 2017-07-10 15:40:51 +01:00
Rémy Coutable 97611c88fc
Don't use Flipper for the Performance Bar
The implementation now simply rely on the
`performance_bar_allowed_group_id` Application Setting.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-07 02:34:51 +02:00
Rémy Coutable 040eeb1039
Allow to enable the Performance Bar for a group from the admin area
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-06 18:57:02 +02:00
Robert Speicher a6ec5121f0 Correct RSpec/SingleLineHook cop offenses 2017-06-14 13:18:56 -05:00
Sean McGivern 3c546acf78 Allow disabling usage ping in `gitlab.yml`
Setting `usage_ping_enabled` to false in `gitlab.yml`:

1. Disables the usage ping, regardless of the value stored in the database.
2. Prevents the usage ping from being enabled through the admin panel. It can
   only be enabled by either removing the line from `gitlab.yml` and configuring
   through the admin panel, or setting it to true in `gitlab.yml`.
2017-05-11 09:20:11 +01:00
Rémy Coutable d40e1f547e Enable the Style/TrailingCommaInLiteral cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Douglas Barbosa Alexandre d464d79032 Lazily sets UUID in ApplicationSetting for new installations 2017-04-26 17:06:15 -03:00
Lin Jen-Shin 83418ad846 Merge remote-tracking branch 'upstream/master' into 27762-add-default-artifacts-expiration
* upstream/master: (247 commits)
  Switched CONTRIBUTING.md style guide recommendation for method chaining
  Fix new offenses
  Stylistic tweaks
  Fix OAuth/SAML user blocking behavior
  Revert "Enable Style/DotPosition"
  Revert "Prefer leading style for Style/DotPosition"
  Revert "Enable Style/BarePercentLiterals"
  Manually correct autocorrect
  Move up delegate calls
  Exclude migrations from Style/MutableConstant
  ActiveSupport delegation is preferred over Forwardable
  Update haml_lint to work with newest rubocop
  Add explanations to cops
  Update rubocop and rubocop-rspec and regenerate .rubocop_todo.yml
  Update rubocop and rubocop-rspec and regenerate .rubocop_todo.yml
  Order cops alphabetically
  Don’t exclude some file in lib from rubocop
  Fix new offenses
  Enable Rails/Delegate
  Enable Style/WordArray
  ...
2017-02-24 17:14:35 +08:00
Douwe Maan 56de781a2c Revert "Enable Style/DotPosition"
This reverts commit e00fb2bdc2090e9cabeb1eb35a2672a882cc96e9.

# Conflicts:
#	.rubocop.yml
#	.rubocop_todo.yml
#	lib/gitlab/ci/config/entry/global.rb
#	lib/gitlab/ci/config/entry/jobs.rb
#	spec/lib/gitlab/ci/config/entry/factory_spec.rb
#	spec/lib/gitlab/ci/config/entry/global_spec.rb
#	spec/lib/gitlab/ci/config/entry/job_spec.rb
#	spec/lib/gitlab/ci/status/build/factory_spec.rb
#	spec/lib/gitlab/incoming_email_spec.rb
2017-02-23 09:33:19 -06:00
Douwe Maan 1fe7501b49 Revert "Prefer leading style for Style/DotPosition"
This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
2017-02-23 09:33:05 -06:00
Douwe Maan 7d4b52b27d Enable Style/WordArray 2017-02-23 09:32:41 -06:00
Douwe Maan 206953a430 Prefer leading style for Style/DotPosition 2017-02-23 09:32:22 -06:00
Douwe Maan 3dadf306dd Enable Style/DotPosition 2017-02-23 09:31:56 -06:00
Lin Jen-Shin 2b0426a497 Fix tests due to error key changed 2017-02-21 18:46:52 +08:00
Lin Jen-Shin eede4ab1a2 0 for unlimited, disallow blank, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/issues/27762#note_23520780
2017-02-16 23:40:13 +08:00
Lin Jen-Shin 46082f4b65 Use static error message and don't give booleans
in validation. Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9219#note_23437431
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9219#note_23437868
2017-02-16 19:30:32 +08:00
Lin Jen-Shin cfd839d6f5 Fix tests and disallow 0 to make it consistent with .gitlab-ci.yml 2017-02-15 15:31:51 +08:00
Lin Jen-Shin 602f3b84c0 Add a few more tests and make sure empty value sets to nil 2017-02-15 15:31:51 +08:00
Jacob Vosmaer 6bcc52a536 Refine Git garbage collection 2016-11-04 14:30:11 +01:00
Nick Thomas c1388d0efb Allow multiple repository storage shards to be enabled, and automatically round-robin between them 2016-11-04 04:01:08 +00:00
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Patricio Cano 6b8eceda39 Default to manual input for `domain_whitelist`, syntax fixes and added new tests. 2016-07-18 17:53:43 -05:00
Patricio Cano c71e658cca Refactor and rename `restricted_signup_domains` to `domain_whitelist` to better conform to its behavior and newly introduced behavior. 2016-07-18 17:53:43 -05:00
Patricio Cano 7943767267 Refactored the domain separator regex, plus syntax and grammar fixes. 2016-07-18 17:52:29 -05:00
Patricio Cano defb8660c0 Added the ability to block sign ups using a domain blacklist. 2016-07-18 17:52:29 -05:00
Alejandro Rodríguez 4a8a69837a Add Application Setting to configure default Repository Path for new projects 2016-06-29 23:35:00 -04:00
Andrei Gliga deca3da1a7 stub Devise.omniauth_providers to return GitHub even if the gitlab.yml has no omniauth provider enabled
This will fix failing tests in case gitlab.yml file has no omniauth providers enabled
2016-05-12 13:44:46 +03:00
Andrei Gliga 47ee5125e8 validate disabled_oauth_sign_in_sources in ApplicationSe 2016-05-12 13:44:46 +03:00
Jeroen van Baarsen f1479b56b7
Remove the annotate gem and delete old annotations
In 8278b763d9 the default behaviour of annotation
has changes, which was causing a lot of noise in diffs. We decided in #17382
that it is better to get rid of the whole annotate gem, and instead let people
look at schema.rb for the columns in a table.

Fixes: #17382
2016-05-09 18:00:28 +02:00
connorshea 85cc172959 Remove "Congratulations!" tweet button on newly-created project.
I’ve removed everything related to the feature based on this commit:
ce08f919f34fd8849834365

Resolves #10857.
2016-03-31 17:09:36 -06:00
Rémy Coutable b34963bc12 Validate email addresses using Devise.email_regexp
Also:
- Get rid of legacy :strict_mode
- Get rid of custom :email validator
- Add some shared examples to spec emails validation
2016-02-09 18:15:35 +01:00
Grzegorz Bizon 1cbc75b53c Validate maximum attachment size in application settings
`max_attachment_size` in `ApplicationSetting` should be present,
only integers greater than zero are valid.

Closes #13188
2016-02-09 12:11:16 +01:00
Jeroen Nijhof 85e0fce9ee Add sentry integration 2016-01-18 17:15:10 +01:00