Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
88441592
Commit
88441592
authored
Dec 06, 2018
by
Michael Kozono
Committed by
Nick Thomas
Dec 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate non-hashed repository storage for Geo installations
parent
0dcac738
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
1 deletion
+101
-1
ee/changelogs/unreleased/mk-geo-add-hashed-storage-system-checks.yml
...gs/unreleased/mk-geo-add-hashed-storage-system-checks.yml
+5
-0
ee/lib/system_check/app/hashed_storage_all_projects_check.rb
ee/lib/system_check/app/hashed_storage_all_projects_check.rb
+22
-0
ee/lib/system_check/app/hashed_storage_enabled_check.rb
ee/lib/system_check/app/hashed_storage_enabled_check.rb
+23
-0
ee/lib/system_check/rake_task/geo_task.rb
ee/lib/system_check/rake_task/geo_task.rb
+3
-1
ee/spec/lib/system_check/app/hashed_storage_all_projects_check_spec.rb
...ystem_check/app/hashed_storage_all_projects_check_spec.rb
+24
-0
ee/spec/lib/system_check/app/hashed_storage_enabled_check_spec.rb
...lib/system_check/app/hashed_storage_enabled_check_spec.rb
+24
-0
No files found.
ee/changelogs/unreleased/mk-geo-add-hashed-storage-system-checks.yml
0 → 100644
View file @
88441592
---
title
:
Deprecate non-hashed repository storage for Geo installations
merge_request
:
8739
author
:
type
:
deprecated
ee/lib/system_check/app/hashed_storage_all_projects_check.rb
0 → 100644
View file @
88441592
# 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
::
Geo
.
secondary?
}
"
,
"to avoid security issues and ensure data integrity."
)
for_more_information
(
'doc/administration/repository_storage_types.md'
)
end
end
end
end
ee/lib/system_check/app/hashed_storage_enabled_check.rb
0 → 100644
View file @
88441592
# 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
ee/lib/system_check/rake_task/geo_task.rb
View file @
88441592
...
...
@@ -23,7 +23,9 @@ module SystemCheck
SystemCheck
::
Geo
::
ClocksSynchronizationCheck
,
SystemCheck
::
App
::
GitUserDefaultSSHConfigCheck
,
SystemCheck
::
Geo
::
AuthorizedKeysCheck
,
SystemCheck
::
Geo
::
AuthorizedKeysFlagCheck
SystemCheck
::
Geo
::
AuthorizedKeysFlagCheck
,
SystemCheck
::
App
::
HashedStorageEnabledCheck
,
SystemCheck
::
App
::
HashedStorageAllProjectsCheck
]
end
end
...
...
ee/spec/lib/system_check/app/hashed_storage_all_projects_check_spec.rb
0 → 100644
View file @
88441592
# frozen_string_literal: true
require
'spec_helper'
require
'rake_helper'
describe
SystemCheck
::
App
::
HashedStorageAllProjectsCheck
do
before
do
silence_output
end
describe
'#check?'
do
it
'fails when at least one project is in legacy storage'
do
create
(
:project
,
:legacy_storage
)
expect
(
subject
.
check?
).
to
be_falsey
end
it
'succeeds when all projects are in hashed storage'
do
create
(
:project
)
expect
(
subject
.
check?
).
to
be_truthy
end
end
end
ee/spec/lib/system_check/app/hashed_storage_enabled_check_spec.rb
0 → 100644
View file @
88441592
# frozen_string_literal: true
require
'spec_helper'
require
'rake_helper'
describe
SystemCheck
::
App
::
HashedStorageEnabledCheck
do
before
do
silence_output
end
describe
'#check?'
do
it
'fails when hashed storage is disabled'
do
stub_application_setting
(
hashed_storage_enabled:
false
)
expect
(
subject
.
check?
).
to
be_falsey
end
it
'succeeds when hashed storage is enabled'
do
stub_application_setting
(
hashed_storage_enabled:
true
)
expect
(
subject
.
check?
).
to
be_truthy
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment