Skip to content

Commit a472dbe

Browse files
committed
Added support for ssh port specification in gitServer. Also clarity fix for access box.
1 parent 2c24a71 commit a472dbe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+53
-48
lines changed

Diff for: README.mkd

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ The *httpServer* variable should be set to the hostname which will be used to ac
110110
may optionally include a port using the ':portnum' syntax, i.e. www.my-own-person-git-host-server.com:8000. Unlike earlier versions of this plugin, this variable should
111111
*not* include the path to your Redmine root.
112112

113-
The *gitServer* variable should be set to the hostname which will be used to access the gitolite repositories via ssh. In most configurations, this
114-
variable will be identical to the *httpServer*, except for the fact that *gitServer* will never include an optional port number.
113+
The *gitServer* variable should be set to the hostname which will be used to access the gitolite repositories via ssh. Like *httpServer*, this variable may optionally include a port using the ':portnum' syntax, i.e. www.my-own-person-git-host-server.com:444. In most configurations, the *gitServer*
114+
variable will be identical to the *httpServer*, except when ports are involved.
115115

116116
The *gitUser* is the user under which gitolite is installed.
117117

Diff for: app/models/git_hosting_settings_observer.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ def before_save(object)
2626
valuehash['gitoliteIdentityPublicKeyFile'] = @@old_valuehash['gitoliteIdentityPublicKeyFile']
2727
end
2828

29-
# Server should not include any path components
29+
# Server should not include any path components. Also, ports should be numeric.
3030
if valuehash['gitServer']
3131
normalizedServer = valuehash['gitServer'].lstrip.rstrip.split('/').first
32-
if (normalizedServer == '')
32+
if (!normalizedServer.match(/^[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*(:\d+)?$/))
3333
valuehash['gitServer'] = @@old_valuehash['gitServer']
3434
else
3535
valuehash['gitServer'] = normalizedServer
3636
end
3737
end
3838

39-
# Server should not include any path components
39+
# Server should not include any path components. Also, ports should be numeric.
4040
if valuehash['httpServer']
4141
normalizedServer = valuehash['httpServer'].lstrip.rstrip.split('/').first
42-
if (normalizedServer == '')
42+
if (!normalizedServer.match(/^[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*(:\d+)?$/))
4343
valuehash['httpServer'] = @@old_valuehash['httpServer']
4444
else
4545
valuehash['httpServer'] = normalizedServer

Diff for: app/views/repositories/git_instructions.html.erb

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
12
<%# This is used to display basic git setup instructions, like on github... %>
23
<% flash.now[:warning] = "Repository is empty. Get started by following the instructions below." %>
3-
<% git_ssh_url = Setting.plugin_redmine_git_hosting['gitUser'] + "@" + Setting.plugin_redmine_git_hosting['gitServer'] + ":" + GitHosting.repository_name(@project) + '.git' %>
4-
4+
<% gitSHP = Setting.plugin_redmine_git_hosting['gitServer'].match(/:\d+$/) %>
5+
<% git_ssh_url =
6+
"#{gitSHP ? 'ssh://' : ''}#{Setting.plugin_redmine_git_hosting['gitUser']}@#{Setting.plugin_redmine_git_hosting['gitServer']}#{gitSHP ? '/' : ':'}#{GitHosting.repository_name(@project)}.git" %>
7+
58
<div class="box">
69

710
<h2>Git Setup:</h2>

Diff for: app/views/settings/_display_access.html.erb

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
%>
88
<br/>
99
<label><%= l(:label_ssh_access)%>:</label>
10-
<%= "ssh://#{@settings['gitUser']}@#{@settings['gitServer']}:#{@settings['gitRedmineSubdir']}<em>#{(GitHosting.repository_hierarchy)?'project1/project2/':''}project3.git</em>"
10+
<% gitSHP = Setting.plugin_redmine_git_hosting['gitServer'].match(/:\d+$/) %>
11+
<%= "#{gitSHP ? 'ssh://' : ''}#{@settings['gitUser']}@#{@settings['gitServer']}#{gitSHP ? '/' : ':'}#{@settings['gitRedmineSubdir']}<em>#{(GitHosting.repository_hierarchy)?'project1/project2/':''}project3.git</em>"
1112
%>
1213
<br/>
1314
<label><%= l(:label_http_access)%>:</label>

Diff for: assets/javascripts/git_url_display.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ function updateGitUrl(el)
44
guHttpBase = guHttpBase.replace(/\/$/, "")
55

66
var urls=[]
7-
urls["git_url_ssh"] = [guGitUser + "@" + guGitServer + ":" + guSshURL, guUserIsCommitter]
7+
var gitSHP = /:\d+$/.test(guGitServer)
8+
urls["git_url_ssh"] = [(gitSHP ? "ssh://" : "") + guGitUser + "@" + guGitServer + (gitSHP ? "/" : ":") + guSshURL, guUserIsCommitter]
89
urls["git_url_http"] = [guHttpProto + "://" + ( (!guProjectIsPublic) || guUserIsCommitter ? guUser + "@" : "") + guHttpBase + "/" + guHttpURL, guUserIsCommitter]
910
urls["git_url_git"] = ["git://" + guGitServer + "/" + guSshURL, false]
1011
var allGitUrlIds = ["git_url_ssh", "git_url_http", "git_url_git"]

Diff for: config/locales/bg.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/bs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/ca.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/cs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/da.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/de.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/el.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/en.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/es.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/fi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/fr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/gl.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/he.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/hu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/id.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/it.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

Diff for: config/locales/ja.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
mirror_push_sucess: Success.
101101
mirror_push_fail: Failed!
102102

103-
display_access_setup: Assuming that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties
103+
display_access_setup: Assume that <em>project1</em> is a parent of <em>project2</em>, and <em>project2</em> is a parent of <em>project3</em>. Given the current configuration, <em>project3</em>'s repository has the following properties
104104
display_access_emphasis: In the above patterns, <em>emphasized</em> components represent context-dependent elements.
105105
display_access_hierarchical: Parent projects are included in the URLs, since the repository is in <em>Hierarchical</em> mode.
106106
display_access_flat: Parent projects are not included in the URLs, since the repository is in <em>Flat</em> mode.

0 commit comments

Comments
 (0)