Commit a1fff682de99618298883742c8cdc169c03c623f

Authored by lukasberns
1 parent 6f915d5a

Add support for custom SSH ports

Showing 2 changed files with 6 additions and 1 deletions   Show diff stats
app/models/repository.rb
... ... @@ -22,7 +22,11 @@ class Repository
22 22 end
23 23  
24 24 def url_to_repo
25   - "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git"
  25 + if !GITOSIS["port"] or GITOSIS["port"] == 22
  26 + "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git"
  27 + else
  28 + "ssh://#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{GITOSIS["port"]}/#{path}.git"
  29 + end
26 30 end
27 31  
28 32 def path_to_repo
... ...
config/gitosis.yml
... ... @@ -2,3 +2,4 @@ admin_uri: git@localhost:gitosis-admin.git
2 2 base_path: /home/git/repositories/
3 3 host: localhost
4 4 git_user: git
  5 +# port: 22
... ...