Commit Graph

172 Commits

Author SHA1 Message Date
Douwe Maan 95ced3bb5f Merge branch 'fj-15329-services-callbacks-ssrf' into 'security-10-6'
Server Side Request Forgery in Services and Web Hooks

See merge request gitlab/gitlabhq!2337
2018-03-21 14:39:21 +00:00
Stan Hu 4acbc9410d Cache column_exists? for application settings
This is most a backport of
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4987/diffs but includes
other columns that use column_exists? in a way that may cause unnecessary
schema loads.
2018-03-15 12:51:39 -07:00
Matija Čupić 147f0428c0
Add validation for auto_devops_domain 2018-01-22 19:29:15 +01:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Michael Kozono 255a0f85e3 Backport option to disable writing to `authorized_keys` file
Originally branch 'mk-toggle-writing-to-auth-keys-1631'

See merge request !2004

Squashed commits:
Add authorized_keys_enabled to Application Settings
Ensure default settings are exposed in UI
Without this change, `authorized_keys_enabled` is unchecked when it is nil, even if it should be checked by default.
Add “Speed up SSH operations” documentation
Clarify the reasons for disabling writes
Add "How to go back" section
Tweak copy
Update Application Setting screenshot
2018-01-08 20:34:19 +00:00
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
Michael Kozono 732b122644 Add throttle application settings 2017-11-17 09:58:18 +01:00
Rémy Coutable d7942f223c Allow to disable the Performance Bar and document the `p b` shortcut in its doc page
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-30 16:13:15 +01: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
Douwe Maan 91e90ae78b Merge branch 'housekeeping_settings' into 'master'
Allow to use same periods for housekeeping tasks

Closes #34981

See merge request !13711
2017-09-12 12:20:40 +00: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
Visay Keo ba6c309f4a
Read import sources from setting at first initialization 2017-09-09 18:44:56 +07: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 b84ca08e35 Address review comments 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
Robin Bobbitt 649d042dbc Add option to disable project export on instance 2017-08-11 12:22:37 -04:00
Bob Van Landuyt c11ed138a0 Remove deprecated `repository_storage` attribute
In favor of the new `repository_storages`
2017-07-27 11:49:27 +02:00
Robin Bobbitt 672a68d372 Fixes needed when GitLab sign-in is not enabled
When sign-in is disabled:
 - skip password expiration checks
 - prevent password reset requests
 - don’t show Password tab in User Settings
 - don’t allow login with username/password for Git over HTTP requests
 - render 404 on requests to Profiles::PasswordsController
2017-07-13 10:08:27 -04:00
Nick Thomas aeb2869f66 Prevent bad data being added to application settings when Redis is unavailable 2017-07-10 15:40:51 +01:00
Sean McGivern b8c4d5e0f5 Merge branch 'master' into 33929-allow-to-enable-perf-bar-for-a-group 2017-07-07 15:54:39 +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
Yorick Peterse e1a3bf30b6
Rename ActiverecordSerialize cop
This cop has been renamed to ActiveRecordSerialize to match the way
"ActiveRecord" is usually written.
2017-07-06 12:01:36 +02:00
Robin Bobbitt e09ddc62b3 Help landing page customizations 2017-06-14 11:40:21 -04:00
Paul Charlton d93352825a redesign caching of application settings 2017-06-06 16:48:10 +00:00
Douwe Maan 9464456597 Merge branch 'pull-mirror-overhaul-ce-backport' into 'master'
backports changed import logic from pull mirroring feature into CE

See merge request !11850
2017-06-05 23:40:53 +00:00
Tiago Botelho 810866ecb6 backports changed import logic from pull mirroring feature into CE 2017-06-05 23:09:10 +01:00
Rémy Coutable 4cfa5ce4a9
Enable the Style/PreferredHashMethods cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-02 19:11:26 +02:00
Yorick Peterse cd74c1434e
Added Cop to blacklist the use of serialize
This Cop blacklists the use of ActiveRecord's "serialize" method, except
for cases where we already use this.
2017-05-31 14:03:37 +02: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
Luke "Jared" Bennett 3a3cf07f93
Merge remote-tracking branch 'origin/master' into add-sentry-js-again-with-vue 2017-04-28 16:03:03 +01:00
Luke "Jared" Bennett 284d4f76fe
Attempted adding separate clientside_sentry settings 2017-04-28 13:41:29 +01:00
Douglas Barbosa Alexandre d464d79032 Lazily sets UUID in ApplicationSetting for new installations 2017-04-26 17:06:15 -03:00
Sean McGivern ebd5e9b454 Port 'Add EE usage ping' to CE
CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/557
2017-04-14 15:20:55 +02:00
Adam Niedzielski 9543025e88 Introduce "polling_interval_multiplier" as application setting
Implement module for setting "Poll-Interval" response header.
Return 429 in ETag caching middleware when polling is disabled.
2017-04-03 15:17:04 +02:00
Stan Hu 681af5bc4f Fix Error 500 when application settings are saved
Due to a Rails bug, fetching the application settings from Redis
may prevent the attribute methods from being loaded for the `ApplicationSetting`
model. More details here: https://github.com/rails/rails/issues/27348

There was also a secondary problem introduced by overriding these
association methods which caused all default visibility levels to be
set to `nil`. Before, the previous implementation allowed the string
"20" to be saved as an integer, while now a table lookup happens
before that. We fix this by enforcing the integer value in the
controller and default to PRIVATE.

Closes #29674
2017-03-18 15:39:48 -07:00
Pawel Chojnacki 80fbced2e0 Add admin settings entries 2017-03-06 15:41:25 +01:00
Pawel Chojnacki e5cf3f51fb Allow limiting logging in users from too many different IPs. 2017-03-06 15:41:24 +01:00
Toon Claes c3b1cb71f0 Override setters so it also accepts string visibility levels
Override the `ApplicationSetting` default visibility_level setters so
they accept strings & integers for the levels.
2017-03-02 16:31:22 +01:00
Toon Claes 260cc57838 Expose ApplicationSetting visibility settings as String
Use strings for the ApplicationSetting properties:
 - restricted_visibility_levels
 - default_project_visibility
 - default_snippet_visibility
 - default_group_visibility
2017-03-02 12:15:25 +01:00
Lin Jen-Shin 728b0a5fe0 Introduce DurationValidator, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9219#note_24032923
2017-02-24 17:28:24 +08: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