summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/gitlab.yml.example16
-rw-r--r--config/initializers/8_gitaly.rb20
2 files changed, 25 insertions, 11 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 3747baf4c3b..d89e25c0959 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -443,14 +443,10 @@ production: &base
# Gitaly settings
gitaly:
- # The socket_path setting is optional and obsolete. When this is set
- # GitLab assumes it can reach a Gitaly services via a Unix socket at
- # this path. When this is commented out GitLab will not use Gitaly.
- #
- # This setting is obsolete because we expect it to be moved under
- # repositories/storages in GitLab 9.1.
- #
- # socket_path: tmp/sockets/private/gitaly.socket
+ # This setting controls whether GitLab uses Gitaly (new component
+ # introduced in 9.0). Eventually Gitaly use will become mandatory and
+ # this option will disappear.
+ enabled: false
#
# 4. Advanced settings
@@ -465,6 +461,7 @@ production: &base
storages: # You must have at least a `default` storage path.
default:
path: /home/git/repositories/
+ gitaly_address: unix:/home/git/gitlab/tmp/sockets/private/gitaly.socket
## Backup settings
backup:
@@ -577,6 +574,9 @@ test:
storages:
default:
path: tmp/tests/repositories/
+ gitaly_address: unix:<%= Rails.root.join('tmp/sockets/private/gitaly.socket') %>
+ gitaly:
+ enabled: false
backup:
path: tmp/tests/backups
gitlab_shell:
diff --git a/config/initializers/8_gitaly.rb b/config/initializers/8_gitaly.rb
index e4a505a8ba4..69c0a91d6f0 100644
--- a/config/initializers/8_gitaly.rb
+++ b/config/initializers/8_gitaly.rb
@@ -1,4 +1,18 @@
-# Make sure we initialize a Gitaly channel before Sidekiq starts multi-threaded execution.
-Gitlab.config.repositories.storages.each do |name, params|
- Gitlab::GitalyClient.configure_channel(name, params['socket_path'])
+require 'uri'
+
+# Make sure we initialize our Gitaly channels before Sidekiq starts multi-threaded execution.
+if Gitlab.config.gitaly.enabled || Rails.env.test?
+ Gitlab.config.repositories.storages.each do |name, params|
+ address = params['gitaly_address']
+
+ unless address.present?
+ raise "storage #{name.inspect} is missing a gitaly_address"
+ end
+
+ unless URI(address).scheme == 'unix'
+ raise "Unsupported Gitaly address: #{address.inspect}"
+ end
+
+ Gitlab::GitalyClient.configure_channel(name, address)
+ end
end