Skip to content

Commit 872bacd

Browse files
committed
Leave GitLab to write its own secrets.yml file
As things stand, we are missing two additional keys from the file. GitLab automatically adds these each time it starts but they then get splatted by Chef on the next run, only to be reinstated with different values later. On top of this, the production_db_key_base attribute was not documented so I have ended up with a value of "production" in my live environment. I suspect others have too. This value should have been randomly generated. Fortunately we were not using any features that depend on this key. Although it would be nice to preserve these keys in Chef for migrations and restorations, this should be done securely using encrypted data bags or similar. Until that is done, I believe it is safer to just let GitLab generate its own keys. Perhaps this wasn't an option before. This also avoids the list of keys falling behind.
1 parent 7d8d53c commit 872bacd

File tree

3 files changed

+0
-25
lines changed

3 files changed

+0
-25
lines changed

attributes/default.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@
144144
default['gitlab']['ldap']['allow_username_or_email_login'] = true
145145
default['gitlab']['ldap']['user_filter'] = ''
146146

147-
# Secrets
148-
default['gitlab']['secrets']['production_db_key_base'] = 'production' # UPDATE THIS, at least 30 chars. Used to encrypt Variables.
149-
150147
# Mysql
151148
default['mysql']['server_root_password'] = 'Ch4ngm3'
152149
default['build-essential']['compile_time'] = true # needed for mysql chef_gem

recipes/default.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,6 @@ class file open;
246246
)
247247
end
248248

249-
# Render gitlab secrets file
250-
template "#{node['gitlab']['app_home']}/config/secrets.yml" do
251-
owner node['gitlab']['user']
252-
group node['gitlab']['group']
253-
mode '0600'
254-
variables(
255-
production_db_key_base: node['gitlab']['secrets']['production_db_key_base']
256-
)
257-
end
258-
259249
# Copy file rack_attack.rb
260250
cookbook_file "#{node['gitlab']['app_home']}/config/initializers/rack_attack.rb" do
261251
owner node['gitlab']['user']

templates/default/secrets.yml.erb

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)