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
771798f5
Commit
771798f5
authored
Feb 11, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HTTPS/SSL checks for Geo Nodes
parent
b125c8df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
10 deletions
+26
-10
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+26
-10
No files found.
lib/tasks/gitlab/check.rake
View file @
771798f5
...
...
@@ -950,6 +950,10 @@ namespace :gitlab do
'doc/gitlab-geo/README.md'
end
def
see_custom_certificate_doc
'https://docs.gitlab.com/omnibus/common_installation_problems/README.html#using-self-signed-certificate-or-custom-certificate-authorities'
end
def
sudo_gitlab
(
command
)
"sudo -u
#{
gitlab_user
}
-H
#{
command
}
"
end
...
...
@@ -1098,8 +1102,14 @@ namespace :gitlab do
end
def
check_gitlab_geo_node
(
node
)
display_error
=
Proc
.
new
do
|
e
|
puts
'no'
.
color
(
:red
)
puts
' Reason:'
.
color
(
:blue
)
puts
"
#{
e
.
message
}
"
end
begin
response
=
Net
::
HTTP
.
start
(
node
.
uri
.
host
,
node
.
uri
.
port
)
do
|
http
|
response
=
Net
::
HTTP
.
start
(
node
.
uri
.
host
,
node
.
uri
.
port
,
use_ssl:
(
node
.
uri
.
scheme
==
'https'
)
)
do
|
http
|
http
.
request
(
Net
::
HTTP
::
Get
.
new
(
node
.
uri
))
end
...
...
@@ -1109,18 +1119,15 @@ namespace :gitlab do
puts
'no'
.
color
(
:red
)
end
rescue
Errno
::
ECONNREFUSED
=>
e
puts
'no'
.
color
(
:red
)
puts
' Reason:'
.
color
(
:blue
)
puts
"
#{
e
.
message
}
"
display_error
.
call
(
e
)
try_fixing_it
(
'Check if the machine is online and GitLab is running'
,
'Check your firewall rules and make sure this machine can reach target machine'
,
"Make sure port and protocol are correct: '
#{
node
.
url
}
', or change it in Admin > Geo Nodes"
)
rescue
SocketError
=>
e
puts
'no'
.
color
(
:red
)
puts
' Reason:'
.
color
(
:blue
)
puts
"
#{
e
.
message
}
"
display_error
.
call
(
e
)
if
e
.
cause
&&
e
.
cause
.
message
.
starts_with?
(
'getaddrinfo'
)
try_fixing_it
(
...
...
@@ -1129,10 +1136,19 @@ namespace :gitlab do
'If machine host is incorrect, change it in Admin > Geo Nodes'
)
end
rescue
OpenSSL
::
SSL
::
SSLError
=>
e
display_error
.
call
(
e
)
try_fixing_it
(
'If you have a self-signed CA or certificate you need to whitelist in Omnibus'
,
)
for_more_information
(
see_custom_certificate_doc
)
try_fixing_it
(
'If you have a valid certificate make sure you have the full certificate chain in the pem file'
)
rescue
Exception
=>
e
puts
'no'
.
color
(
:red
)
puts
' Reason:'
.
color
(
:blue
)
puts
"
#{
e
.
message
}
"
display_error
.
call
(
e
)
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