Commit graph

19 commits

Author SHA1 Message Date
Michael Kozono
797fe0a6e6 Backport authorized_keys_enabled defaults to true'
Originally from branch 'fix-authorized-keys-enabled-default-2738' via merge request https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2240

Removed background migrations which were intended to fix state after using Gitlab
without a default having been set

Squashed commits:
Locally, if Spring was not restarted, `current_application_settings` was still cached, which prevented the migration from editing the file. This will also ensure that any app server somehow hitting old cache data will properly default this setting regardless.
Retroactively fix migration
  This allows us to identify customers who ran the broken migration. Their `authorized_keys_enabled` column does not have a default at this point.
  We will fix the column after we fix the `authorized_keys` file.
Fix authorized_keys file if needed
Add default to authorized_keys_enabled setting
  Reminder: The original migration was fixed retroactively a few commits ago, so people who did not ever run GitLab 9.3.0 already have a column that defaults to true and disallows nulls. I have tested on PostgreSQL and MySQL that it is safe to run this migration regardless.
  Affected customers who did run 9.3.0 are the ones who need this migration to fix the authorized_keys_enabled column.
  The reason for the retroactive fix plus this migration is that it allows us to run a migration in between to fix the authorized_keys file only for those who ran 9.3.0.
Tweaks to address feedback
Extract work into background migration
Move batch-add-logic to background migration
  Do the work synchronously to avoid multiple workers attempting to add batches of keys at the same time.
  Also, make the delete portion wait until after adding is done.
Do read and delete work in background migration
Fix Rubocop offenses
Add changelog entry
Inform the user of actions taken or not taken
Prevent unnecessary `select`s and `remove_key`s
Add logs for action taken
Fix optimization
Reuse `Gitlab::ShellAdapter`
Guarantee the earliest key
Fix migration spec for MySQL
2018-01-08 20:34:20 +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
Alejandro Rodríguez
1c458d17d7 Move delete_remote_branches from Gitlab::Shell to Gitlab::Git::Repository 2018-01-03 23:07:38 -03:00
Alejandro Rodríguez
43308bd826 Move push_remote_branches from Gitlab::Shell to Gitlab::Git::Repository 2018-01-03 23:06:34 -03:00
Nick Thomas
4b785df27b
Import gitlab_projects.rb from gitlab-shell
By importing this Ruby code into gitlab-rails (and gitaly-ruby), we avoid
200ms of startup time for each gitlab_projects subprocess we are eliminating.

By not having a gitlab_projects subprocess between gitlab-rails / sidekiq and
any git subprocesses (e.g. for fork_project, fetch_remote, etc, calls), we can
also manage these git processes more cleanly, and avoid sending SIGKILL to them
2017-12-14 16:00:04 +00:00
Nick Thomas
327a9898a2
Fix the fork project functionality for projects with hashed storage
Note the dependency on gitlab-shell v5.10.0
2017-12-04 09:42:14 +00:00
Jacopo
0ce6785851 Replaces tag: true into :tag in the specs
Replaces all the explicit include metadata syntax in the specs (tag:
true) into the implicit one (:tag).
Added a cop to prevent future errors and handle autocorrection.
2017-10-07 13:57:54 +02:00
Zeger-Jan van de Weg
4656283c5c
Gitaly namespace service enabled for GitLab 2017-10-05 14:11:32 +02:00
Jacob Vosmaer
972c5e8900 Fix 'gitlay' typo in spec 2017-10-02 11:37:26 +02:00
Jacob Vosmaer
e5fecc3a37 Create repositories via Gitaly 2017-09-29 18:27:06 +02:00
Gabriel Mazetto
38607b48b6
[Backported from EE] Readonly flag for Projects
This is used in EE for the storage migration, and we want to use this
in CE as well to be able to migrate projects to hashed_storage.
2017-09-28 13:20:11 +01:00
Kim "BKC" Carlbäcker
b77176d11a Migrate Repository.FetchRemote to Gitaly
- `Gitlab::Shell.fetch_remote` now takes a `Gitlab::Git::Repository` instead
2017-08-30 20:51:56 +02:00
Nick Thomas
5fc871381a Speed up project creation by inlining repository creation 2017-08-15 18:33:07 +01:00
Nick Thomas
da5262f4e6 Backport changes in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2551 to CE 2017-08-07 19:17:11 +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
Stan Hu
d8cc0d0115 Speed up operations performed by gitlab-shell 2017-07-03 18:28:29 +00:00
Sean McGivern
faf2ce89cd Merge branch 'mrchrisw-import-shell-timeout' 2017-05-05 14:40:52 +01:00
Sean McGivern
5069682d8e Enable RSpec/FilePath cop
- Ignore JS fixtures
- Ignore qa directory
- Rewrite concern specs to put concern name first
2017-04-26 12:50:32 +01:00
Renamed from spec/lib/gitlab/backend/shell_spec.rb (Browse further)