summaryrefslogtreecommitdiff
path: root/lib/system_check
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
commit9f46488805e86b1bc341ea1620b866016c2ce5ed (patch)
treef9748c7e287041e37d6da49e0a29c9511dc34768 /lib/system_check
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
downloadgitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
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..7539309fbf4
--- /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 14.0."
+ )
+
+ 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