Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-12 00:09:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-12 00:09:40 +0300
commit3f45eb27e9586ad87682c2d125770e119a7e9fe0 (patch)
tree533c2906ecf49c1403a2c21211241f21768e139a /lib/system_check
parent636eb69592af287dd76876e6fc3c898ad1af33f6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/system_check')
-rw-r--r--lib/system_check/app/hashed_storage_all_projects_check.rb22
-rw-r--r--lib/system_check/app/hashed_storage_enabled_check.rb23
-rw-r--r--lib/system_check/rake_task/app_task.rb4
3 files changed, 48 insertions, 1 deletions
diff --git a/lib/system_check/app/hashed_storage_all_projects_check.rb b/lib/system_check/app/hashed_storage_all_projects_check.rb
new file mode 100644
index 00000000000..f67f7828cf5
--- /dev/null
+++ b/lib/system_check/app/hashed_storage_all_projects_check.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+module SystemCheck
+ module App
+ class HashedStorageAllProjectsCheck < SystemCheck::BaseCheck
+ set_name 'All projects are in hashed storage?'
+
+ def check?
+ !Project.with_unmigrated_storage.exists?
+ end
+
+ def show_error
+ try_fixing_it(
+ "Please migrate all projects to hashed storage#{' on the primary' if Gitlab.ee? && Gitlab::Geo.secondary?}",
+ "as legacy storage is deprecated in 13.0 and support will be removed in 13.4."
+ )
+
+ for_more_information('doc/administration/repository_storage_types.md')
+ end
+ end
+ end
+end
diff --git a/lib/system_check/app/hashed_storage_enabled_check.rb b/lib/system_check/app/hashed_storage_enabled_check.rb
new file mode 100644
index 00000000000..b7c1791b740
--- /dev/null
+++ b/lib/system_check/app/hashed_storage_enabled_check.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module SystemCheck
+ module App
+ class HashedStorageEnabledCheck < SystemCheck::BaseCheck
+ set_name 'GitLab configured to store new projects in hashed storage?'
+
+ def check?
+ Gitlab::CurrentSettings.current_application_settings.hashed_storage_enabled
+ end
+
+ def show_error
+ try_fixing_it(
+ "Please enable the setting",
+ "`Use hashed storage paths for newly created and renamed projects`",
+ "in GitLab's Admin panel to avoid security issues and ensure data integrity."
+ )
+
+ for_more_information('doc/administration/repository_storage_types.md')
+ end
+ end
+ end
+end
diff --git a/lib/system_check/rake_task/app_task.rb b/lib/system_check/rake_task/app_task.rb
index aec7e5f416e..99c93edd12d 100644
--- a/lib/system_check/rake_task/app_task.rb
+++ b/lib/system_check/rake_task/app_task.rb
@@ -31,7 +31,9 @@ module SystemCheck
SystemCheck::App::GitVersionCheck,
SystemCheck::App::GitUserDefaultSSHConfigCheck,
SystemCheck::App::ActiveUsersCheck,
- SystemCheck::App::AuthorizedKeysPermissionCheck
+ SystemCheck::App::AuthorizedKeysPermissionCheck,
+ SystemCheck::App::HashedStorageEnabledCheck,
+ SystemCheck::App::HashedStorageAllProjectsCheck
]
end
end