5626: Add git_hostname configuration option.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 1 Apr 2015 19:59:33 +0000 (15:59 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 1 Apr 2015 19:59:33 +0000 (15:59 -0400)
services/api/app/models/repository.rb
services/api/config/application.default.yml

index 0cab4dcf8760641b95f7eb8f3c5dfa2b05d11018..d2da6eab29201d5279b699631a5a537def66180e 100644 (file)
@@ -20,7 +20,11 @@ class Repository < ArvadosModel
   end
 
   def push_url
-    "git@git.%s.arvadosapi.com:%s.git" % [Rails.configuration.uuid_prefix, name]
+    if Rails.configuration.git_host
+      "git@%s:%s.git" % [Rails.configuration.git_host, name]
+    else
+      "git@git.%s.arvadosapi.com:%s.git" % [Rails.configuration.uuid_prefix, name]
+    end
   end
 
   def fetch_url
index b6d37f9eb46e30247bb3f935fdc751eacfae0ea7..1696e2c56ebf9226126945c86b254144c7acd7fa 100644 (file)
@@ -57,6 +57,11 @@ common:
   # logic for deciding on a hostname.
   host: false
 
+  # If not false, this is the hostname that will be used to generate fetch_url
+  # and push_url for git repositories.  By default, this will be
+  # git.(uuid_prefix).arvadosapi.com
+  git_host: false
+
   # If this is not false, HTML requests at the API server's root URL
   # are redirected to this location, and it is provided in the text of
   # user activation notification email messages to remind them where