Module: Gitlab::SetupHelper::Praefect

Extended by:
Gitlab::SetupHelper
Defined in:
lib/gitlab/setup_helper.rb

Class Method Summary collapse

Methods included from Gitlab::SetupHelper

create_configuration, generate_configuration

Class Method Details

.configuration_toml(gitaly_dir, storage_paths) ⇒ Object


117
118
119
120
121
122
123
124
125
# File 'lib/gitlab/setup_helper.rb', line 117

def configuration_toml(gitaly_dir, storage_paths)
  nodes = [{ storage: 'default', address: "unix:#{gitaly_dir}/gitaly.socket", primary: true, token: 'secret' }]
  storages = [{ name: 'default', node: nodes }]
  failover = { enabled: false }
  config = { socket_path: "#{gitaly_dir}/praefect.socket", memory_queue_enabled: true, virtual_storage: storages, failover: failover }
  config[:token] = 'secret' if Rails.env.test?

  TomlRB.dump(config)
end