diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-08 15:14:56 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-08 15:14:56 +0300 |
commit | f38ce01bc3b5a894d527550ca6a782567dfd19f9 (patch) | |
tree | c0fd6b184d2d3f5bbd79903eef8192c23b80a284 | |
parent | 100d750bc5ec4c6c5be11eb6f4100fe38b4ddee7 (diff) |
Remove encryption
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | Gemfile | 1 | ||||
-rw-r--r-- | Gemfile.lock | 2 | ||||
-rw-r--r-- | app/helpers/version_check_helper.rb | 4 | ||||
-rw-r--r-- | lib/version_check.rb | 24 |
4 files changed, 7 insertions, 24 deletions
@@ -200,7 +200,6 @@ gem 'nprogress-rails' gem 'request_store' gem "virtus" gem 'addressable' -gem 'simple_encrypt' group :development do gem 'brakeman', require: false diff --git a/Gemfile.lock b/Gemfile.lock index eb8d607c5fc..cca8f59ac28 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -551,7 +551,6 @@ GEM json redis (>= 3.0.6) redis-namespace (>= 1.3.1) - simple_encrypt (0.0.1) simple_oauth (0.1.9) simplecov (0.9.0) docile (~> 1.1.0) @@ -775,7 +774,6 @@ DEPENDENCIES settingslogic shoulda-matchers (~> 2.7.0) sidekiq (~> 3.3) - simple_encrypt simplecov sinatra six diff --git a/app/helpers/version_check_helper.rb b/app/helpers/version_check_helper.rb index df0e25b9f6e..63d8eaeb2bd 100644 --- a/app/helpers/version_check_helper.rb +++ b/app/helpers/version_check_helper.rb @@ -1,7 +1,5 @@ module VersionCheckHelper def version_status_badge - if File.exists?(Rails.root.join('safe', 'public.pem')) - image_tag VersionCheck.new.url - end + image_tag VersionCheck.new.url end end diff --git a/lib/version_check.rb b/lib/version_check.rb index ada5e0db7a9..018bd9dac97 100644 --- a/lib/version_check.rb +++ b/lib/version_check.rb @@ -1,27 +1,15 @@ -# This class is used to encrypt GitLab version and URL -# with public key when we send it to version.gitlab.com to +require "base64" + +# This class is used to build image URL 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) + { version: Gitlab::VERSION } end def url - "#{host}?gitlab_info=#{encrypt(data.to_json)}" + encoded_data = Base64.urlsafe_encode64(data.to_json) + "#{host}?gitlab_info=#{encoded_data}" end def host |