Commit f38ce01b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Remove encryption

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 100d750b
...@@ -200,7 +200,6 @@ gem 'nprogress-rails' ...@@ -200,7 +200,6 @@ gem 'nprogress-rails'
gem 'request_store' gem 'request_store'
gem "virtus" gem "virtus"
gem 'addressable' gem 'addressable'
gem 'simple_encrypt'
group :development do group :development do
gem 'brakeman', require: false gem 'brakeman', require: false
......
...@@ -551,7 +551,6 @@ GEM ...@@ -551,7 +551,6 @@ GEM
json json
redis (>= 3.0.6) redis (>= 3.0.6)
redis-namespace (>= 1.3.1) redis-namespace (>= 1.3.1)
simple_encrypt (0.0.1)
simple_oauth (0.1.9) simple_oauth (0.1.9)
simplecov (0.9.0) simplecov (0.9.0)
docile (~> 1.1.0) docile (~> 1.1.0)
...@@ -775,7 +774,6 @@ DEPENDENCIES ...@@ -775,7 +774,6 @@ DEPENDENCIES
settingslogic settingslogic
shoulda-matchers (~> 2.7.0) shoulda-matchers (~> 2.7.0)
sidekiq (~> 3.3) sidekiq (~> 3.3)
simple_encrypt
simplecov simplecov
sinatra sinatra
six six
......
module VersionCheckHelper module VersionCheckHelper
def version_status_badge def version_status_badge
if File.exists?(Rails.root.join('safe', 'public.pem'))
image_tag VersionCheck.new.url image_tag VersionCheck.new.url
end end
end
end end
# This class is used to encrypt GitLab version and URL require "base64"
# with public key when we send it to version.gitlab.com to
# This class is used to build image URL to
# check if it is a new version for update # check if it is a new version for update
class VersionCheck 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 def data
{ { version: Gitlab::VERSION }
version: Gitlab::VERSION,
url: Gitlab.config.gitlab.url
}
end
def encrypt(string)
encrypt_with_public_key(string, public_key)
end end
def url def url
"#{host}?gitlab_info=#{encrypt(data.to_json)}" encoded_data = Base64.urlsafe_encode64(data.to_json)
"#{host}?gitlab_info=#{encoded_data}"
end end
def host def host
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment