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
add38cc7
Commit
add38cc7
authored
Nov 23, 2020
by
DJ Mountney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup encrypted path syntax
parent
d33611a6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
6 deletions
+3
-6
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+2
-1
config/settings.rb
config/settings.rb
+1
-1
spec/config/settings_spec.rb
spec/config/settings_spec.rb
+0
-4
No files found.
config/initializers/1_settings.rb
View file @
add38cc7
...
...
@@ -7,7 +7,8 @@ Settings['shared'] ||= Settingslogic.new({})
Settings
.
shared
[
'path'
]
=
Settings
.
absolute
(
Settings
.
shared
[
'path'
]
||
"shared"
)
Settings
[
'encrypted_settings'
]
||=
Settingslogic
.
new
({})
Settings
.
encrypted_settings
[
'path'
]
=
Settings
.
absolute
(
Settings
.
encrypted_settings
[
'path'
]
||
File
.
join
(
Settings
.
shared
[
'path'
],
"encrypted_settings"
))
Settings
.
encrypted_settings
[
'path'
]
||=
File
.
join
(
Settings
.
shared
[
'path'
],
"encrypted_settings"
)
Settings
.
encrypted_settings
[
'path'
]
=
Settings
.
absolute
(
Settings
.
encrypted_settings
[
'path'
])
Settings
[
'ldap'
]
||=
Settingslogic
.
new
({})
Settings
.
ldap
[
'enabled'
]
=
false
if
Settings
.
ldap
[
'enabled'
].
nil?
...
...
config/settings.rb
View file @
add38cc7
...
...
@@ -154,7 +154,7 @@ class Settings < Settingslogic
def
encrypted
(
path
)
Gitlab
::
EncryptedConfiguration
.
new
(
content_path:
Settings
.
absolute
(
path
)
,
content_path:
path
,
base_key:
Gitlab
::
Application
.
secrets
.
encrypted_settings_key_base
,
previous_keys:
Gitlab
::
Application
.
secrets
.
rotated_encrypted_settings_key_base
||
[]
)
...
...
spec/config/settings_spec.rb
View file @
add38cc7
...
...
@@ -145,10 +145,6 @@ RSpec.describe Settings do
Settings
.
encrypted
(
'tmp/tests/test.enc'
)
end
it
'defaults the config path within the rails root'
do
expect
(
Settings
.
encrypted
(
'tmp/tests/test.enc'
).
content_path
.
fnmatch?
(
File
.
join
(
Rails
.
root
,
'**'
))).
to
be
true
end
it
'returns empty encrypted config when a key has not been set'
do
allow
(
Gitlab
::
Application
.
secrets
).
to
receive
(
:encrypted_settings_key_base
).
and_return
(
nil
)
expect
(
Settings
.
encrypted
(
'tmp/tests/test.enc'
).
read
).
to
be_empty
...
...
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