Skip to content
Snippets Groups Projects
Commit 345fd545 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Add version check badge to admin area

parent f5eb5fdd
No related branches found
No related tags found
No related merge requests found
module VersionCheckHelper
def version_status_badge
image_tag VersionCheck.new.url
end
end
Loading
Loading
@@ -56,7 +56,11 @@
%span.light.pull-right
= boolean_to_icon Gitlab.config.omniauth.enabled
.col-md-4
%h4 Components
%h4
Components
.pull-right
= version_status_badge
%hr
%p
GitLab
Loading
Loading
# This class is used to encrypt GitLab version and URL
# with public key when we send it to version.gitlab.com to
# check if it is a new version for update
class VersionCheck
include SimpleEncrypt
def public_key
public_key_file = Rails.root.join('safe', 'public.pem').to_s
File.read(public_key_file)
end
def data
{
version: Gitlab::VERSION,
url: Gitlab.config.gitlab.url
}
end
def encrypt(string)
encrypt_with_public_key(string, public_key)
end
def url
"#{host}?gitlab_info=#{encrypt(data.to_json)}"
end
def host
'http://localhost:9090/check.png'
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment