Merge branch 'version-check' into 'master'
Version check See merge request !1509
This commit is contained in:
commit
f32a045ef4
|
@ -42,6 +42,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
|
|||
:default_project_visibility,
|
||||
:default_snippet_visibility,
|
||||
:restricted_signup_domains_raw,
|
||||
:version_check_enabled,
|
||||
restricted_visibility_levels: [],
|
||||
)
|
||||
end
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
module VersionCheckHelper
|
||||
def version_status_badge
|
||||
if Rails.env.production?
|
||||
image_tag VersionCheck.new.url
|
||||
end
|
||||
end
|
||||
end
|
|
@ -32,6 +32,12 @@
|
|||
= f.check_box :twitter_sharing_enabled, :'aria-describedby' => 'twitter_help_block'
|
||||
%strong Twitter enabled
|
||||
%span.help-block#twitter_help_block Show users a button to share their newly created public or internal projects on twitter
|
||||
.form-group
|
||||
.col-sm-offset-2.col-sm-10
|
||||
.checkbox
|
||||
= f.label :version_check_enabled do
|
||||
= f.check_box :version_check_enabled
|
||||
Version check enabled
|
||||
%fieldset
|
||||
%legend Misc
|
||||
.form-group
|
||||
|
|
|
@ -56,7 +56,12 @@
|
|||
%span.light.pull-right
|
||||
= boolean_to_icon Gitlab.config.omniauth.enabled
|
||||
.col-md-4
|
||||
%h4 Components
|
||||
%h4
|
||||
Components
|
||||
- if current_application_settings.version_check_enabled
|
||||
.pull-right
|
||||
= version_status_badge
|
||||
|
||||
%hr
|
||||
%p
|
||||
GitLab
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
GitLab
|
||||
%span= Gitlab::VERSION
|
||||
%small= Gitlab::REVISION
|
||||
- if current_application_settings.version_check_enabled
|
||||
= version_status_badge
|
||||
%p.slead
|
||||
GitLab is open source software to collaborate on code.
|
||||
%br
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddVersionCheckToApplicationSettings < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :application_settings, :version_check_enabled, :boolean, default: true
|
||||
end
|
||||
end
|
|
@ -28,6 +28,7 @@ ActiveRecord::Schema.define(version: 20150509180749) do
|
|||
t.integer "default_branch_protection", default: 2
|
||||
t.boolean "twitter_sharing_enabled", default: true
|
||||
t.text "restricted_visibility_levels"
|
||||
t.boolean "version_check_enabled", default: true
|
||||
t.integer "max_attachment_size", default: 10, null: false
|
||||
t.integer "default_project_visibility"
|
||||
t.integer "default_snippet_visibility"
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
require "base64"
|
||||
|
||||
# This class is used to build image URL to
|
||||
# check if it is a new version for update
|
||||
class VersionCheck
|
||||
def data
|
||||
{ version: Gitlab::VERSION }
|
||||
end
|
||||
|
||||
def url
|
||||
encoded_data = Base64.urlsafe_encode64(data.to_json)
|
||||
"#{host}?gitlab_info=#{encoded_data}"
|
||||
end
|
||||
|
||||
def host
|
||||
'https://version.gitlab.com/check.png'
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnp2mUaLBoHFX127ysonX
|
||||
OihiGpI4098eFfH1iAxpKHIof0vs0jFF05IUScNXJZ1U3w8G1U/unY/wGGa3NzAb
|
||||
ZfDd22eOF6X2Gfiey6U4w9dFf0/UT5x1bphlpX357yh4O9oWWuNaWD062DTbOOsJ
|
||||
U6UW2U/sZAu/QScys0Nw+gJ58t93hb4jFq+nO5IAQc6g4S8ek5YvIXOshFEpF2in
|
||||
ZLbSYowx92+9GzfjvdQ7fk0Q2ssg0zfScVa6FY8n019osz0SC3wcSd/qicdfecpu
|
||||
7oycpd9YDqk4lufE1qVMOsgE8OO4KXMrByz2f+T0p/bH9zdBa5HYylf1T7i60hIL
|
||||
kQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
Loading…
Reference in New Issue