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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
345fd545
Commit
345fd545
authored
Feb 12, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add version check badge to admin area
parent
f5eb5fdd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
1 deletion
+40
-1
app/helpers/version_check_helper.rb
app/helpers/version_check_helper.rb
+5
-0
app/views/admin/dashboard/index.html.haml
app/views/admin/dashboard/index.html.haml
+5
-1
lib/version_check.rb
lib/version_check.rb
+30
-0
No files found.
app/helpers/version_check_helper.rb
0 → 100644
View file @
345fd545
module
VersionCheckHelper
def
version_status_badge
image_tag
VersionCheck
.
new
.
url
end
end
app/views/admin/dashboard/index.html.haml
View file @
345fd545
...
...
@@ -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
...
...
lib/version_check.rb
0 → 100644
View file @
345fd545
# 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
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