Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b3411958
Commit
b3411958
authored
Mar 08, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check if SSH port is != 22 when building ssh_path_prefix
parent
a54853e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
lib/gitlab/geo.rb
lib/gitlab/geo.rb
+15
-1
No files found.
lib/gitlab/geo.rb
View file @
b3411958
...
@@ -35,7 +35,7 @@ module Gitlab
...
@@ -35,7 +35,7 @@ module Gitlab
end
end
def
self
.
primary_ssh_path_prefix
def
self
.
primary_ssh_path_prefix
self
.
cache_value
(
:geo_primary_ssh_path_prefix
)
{
self
.
enabled?
&&
self
.
primary_node
&&
"git@
#{
self
.
primary_node
.
host
}
:"
}
self
.
cache_value
(
:geo_primary_ssh_path_prefix
)
{
self
.
enabled?
&&
self
.
primary_node
&&
build_primary_ssh_path_prefix
}
end
end
def
self
.
geo_node?
(
host
:,
port
:)
def
self
.
geo_node?
(
host
:,
port
:)
...
@@ -80,5 +80,19 @@ module Gitlab
...
@@ -80,5 +80,19 @@ module Gitlab
# urlsafe_base64 may return a string of size * 4/3
# urlsafe_base64 may return a string of size * 4/3
SecureRandom
.
urlsafe_base64
(
size
)[
0
,
size
]
SecureRandom
.
urlsafe_base64
(
size
)[
0
,
size
]
end
end
def
self
.
build_primary_ssh_path_prefix
primary_host
=
"
#{
Gitlab
.
config
.
gitlab_shell
.
ssh_user
}
@
#{
self
.
primary_node
.
host
}
"
if
Gitlab
.
config
.
gitlab_shell
.
ssh_port
!=
22
"ssh://
#{
primary_host
}
:
#{
Gitlab
.
config
.
gitlab_shell
.
ssh_port
}
/"
else
if
self
.
primary_node
.
host
.
include?
':'
"[
#{
primary_host
}
]:"
else
"
#{
primary_host
}
:"
end
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment