From a1fff682de99618298883742c8cdc169c03c623f Mon Sep 17 00:00:00 2001 From: lukasberns Date: Sat, 12 Nov 2011 08:30:42 +0900 Subject: [PATCH] Add support for custom SSH ports --- app/models/repository.rb | 6 +++++- config/gitosis.yml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/repository.rb b/app/models/repository.rb index c01320e8..3b094715 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -22,7 +22,11 @@ class Repository end def url_to_repo - "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git" + if !GITOSIS["port"] or GITOSIS["port"] == 22 + "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git" + else + "ssh://#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{GITOSIS["port"]}/#{path}.git" + end end def path_to_repo diff --git a/config/gitosis.yml b/config/gitosis.yml index cf76f5a2..1e3137e8 100644 --- a/config/gitosis.yml +++ b/config/gitosis.yml @@ -2,3 +2,4 @@ admin_uri: git@localhost:gitosis-admin.git base_path: /home/git/repositories/ host: localhost git_user: git +# port: 22