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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f73d7181
Commit
f73d7181
authored
Jun 29, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1018 from glebm/master
Resque Authentication + iFrame view
parents
cfee2fc9
2da45e9c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
11 deletions
+28
-11
app/controllers/admin/resque_controller.rb
app/controllers/admin/resque_controller.rb
+5
-0
app/views/admin/dashboard/index.html.haml
app/views/admin/dashboard/index.html.haml
+1
-1
app/views/admin/resque/show.html.haml
app/views/admin/resque/show.html.haml
+2
-0
app/views/layouts/admin.html.haml
app/views/layouts/admin.html.haml
+5
-5
config/initializers/protect_resque.rb
config/initializers/protect_resque.rb
+0
-5
config/initializers/resque_authentication.rb
config/initializers/resque_authentication.rb
+14
-0
config/routes.rb
config/routes.rb
+1
-0
No files found.
app/controllers/admin/resque_controller.rb
0 → 100644
View file @
f73d7181
class
Admin::ResqueController
<
ApplicationController
layout
'admin'
def
show
end
end
\ No newline at end of file
app/views/admin/dashboard/index.html.haml
View file @
f73d7181
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
%h5
%h5
Resque Workers
Resque Workers
.data.padded
.data.padded
=
link_to
"/info/resque"
do
=
link_to
admin_resque_path
do
%h1
{
:class
=>
@workers
.
present?
?
"cgreen"
:
"cred"
}
%h1
{
:class
=>
@workers
.
present?
?
"cgreen"
:
"cred"
}
=
@workers
.
count
=
@workers
.
count
%hr
%hr
...
...
app/views/admin/resque/show.html.haml
0 → 100644
View file @
f73d7181
%h3
Resque
%iframe
{
:src
=>
"/info/resque"
,
:width
=>
1168
,
:height
=>
600
,
:style
=>
"border: none"
}
\ No newline at end of file
app/views/layouts/admin.html.haml
View file @
f73d7181
...
@@ -6,10 +6,10 @@
...
@@ -6,10 +6,10 @@
=
render
"layouts/head_panel"
,
:title
=>
"Admin area"
=
render
"layouts/head_panel"
,
:title
=>
"Admin area"
.container
.container
%nav
.main_menu
%nav
.main_menu
=
link_to
"Stats"
,
admin_root_path
,
:class
=>
"home
#{
controller
.
controller_name
==
"dashboard"
?
"current"
:
nil
}
"
=
link_to
"Stats"
,
admin_root_path
,
:class
=>
"home
#{
'current'
if
controller
.
controller_name
==
"dashboard"
}
"
=
link_to
"Projects"
,
admin_projects_path
,
:class
=>
controller
.
controller_name
==
"projects"
?
"current"
:
nil
=
link_to
"Projects"
,
admin_projects_path
,
:class
=>
(
'current'
if
controller
.
controller_name
==
"projects"
)
=
link_to
"Users"
,
admin_users_path
,
:class
=>
controller
.
controller_name
==
"users"
?
"current"
:
nil
=
link_to
"Users"
,
admin_users_path
,
:class
=>
(
'current'
if
controller
.
controller_name
==
'users'
)
=
link_to
"Emails"
,
admin_emails_path
,
:class
=>
controller
.
controller_name
==
"mailer"
?
"current"
:
nil
=
link_to
"Emails"
,
admin_emails_path
,
:class
=>
(
'current'
if
controller
.
controller_name
==
'mailer'
)
=
link_to
"Resque"
,
"/info/resque"
=
link_to
"Resque"
,
admin_resque_path
,
:class
=>
(
'current'
if
controller
.
controller_name
==
'resque'
)
.content
=
yield
.content
=
yield
config/initializers/protect_resque.rb
deleted
100644 → 0
View file @
cfee2fc9
require
'resque/server'
Resque
::
Server
.
use
(
Rack
::
Auth
::
Basic
)
do
|
user
,
password
|
user
==
"gitlab"
password
==
"5iveL!fe"
end
config/initializers/resque_authentication.rb
0 → 100644
View file @
f73d7181
require
'resque/server'
class
Authentication
def
initialize
(
app
)
@app
=
app
end
def
call
(
env
)
account
=
env
[
'warden'
].
authenticate!
(
:database_authenticatable
,
:rememberable
,
scope: :user
)
raise
"Access denied"
if
!
account
.
admin?
@app
.
call
(
env
)
end
end
Resque
::
Server
.
use
Authentication
\ No newline at end of file
config/routes.rb
View file @
f73d7181
...
@@ -50,6 +50,7 @@ Gitlab::Application.routes.draw do
...
@@ -50,6 +50,7 @@ Gitlab::Application.routes.draw do
get
'mailer/preview_note'
get
'mailer/preview_note'
get
'mailer/preview_user_new'
get
'mailer/preview_user_new'
get
'mailer/preview_issue_new'
get
'mailer/preview_issue_new'
resource
:resque
,
:controller
=>
'resque'
root
:to
=>
"dashboard#index"
root
:to
=>
"dashboard#index"
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