chef-server-webui 0.9.6 → 0.9.8.beta.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ spec = Gem::Specification.new do |s|
21
21
  s.version = ChefServerWebui::VERSION
22
22
  s.platform = Gem::Platform::RUBY
23
23
  s.has_rdoc = true
24
- s.extra_rdoc_files = ["README.rdoc", "LICENSE" ]
24
+ s.extra_rdoc_files = ["README.rdoc", "LICENSE", "config.ru" ]
25
25
  s.summary = SUMMARY
26
26
  s.description = s.summary
27
27
  s.author = AUTHOR
@@ -29,7 +29,6 @@ spec = Gem::Specification.new do |s|
29
29
  s.homepage = HOMEPAGE
30
30
 
31
31
  s.add_dependency "merb-core", "~> 1.1.0"
32
- s.add_dependency "merb-slices", "~> 1.1.0"
33
32
  s.add_dependency "merb-assets", "~> 1.1.0"
34
33
  s.add_dependency "merb-helpers", "~> 1.1.0"
35
34
  s.add_dependency "merb-haml", "~> 1.1.0"
@@ -51,14 +51,17 @@ class Application < Merb::Controller
51
51
  redirect(url(:users_login), {:message => { :error => $! }, :permanent => true})
52
52
  end
53
53
 
54
+ def require_admin
55
+ raise AdminAccessRequired unless is_admin?
56
+ end
54
57
 
55
- def is_admin(name)
56
- user = Chef::WebUIUser.load(name)
57
- return user.admin
58
+ def is_admin?
59
+ user = Chef::WebUIUser.load(session[:user])
60
+ user.admin?
58
61
  end
59
62
 
60
- #return true if there is only one admin left, false otehrwise
61
- def is_last_admin
63
+ #return true if there is only one admin left, false otherwise
64
+ def is_last_admin?
62
65
  count = 0
63
66
  users = Chef::WebUIUser.list
64
67
  users.each do |u, url|
@@ -72,18 +75,9 @@ class Application < Merb::Controller
72
75
  end
73
76
 
74
77
  #whether or not the user should be able to edit a user's admin status
75
- def edit_admin
76
- is_admin(params[:user_id]) ? (!is_last_admin) : true
77
- end
78
-
79
- def authorized_user
80
- if session[:level] == :admin
81
- Chef::Log.debug("Authorized as Administrator")
82
- true
83
- else
84
- Chef::Log.debug("Unauthorized")
85
- raise Unauthorized, "The current user is not an Administrator, you can only Show and Edit the user itself. To control other users, login as an Administrator."
86
- end
78
+ def can_edit_admin?
79
+ return false unless is_admin? && !is_last_admin?
80
+ true
87
81
  end
88
82
 
89
83
  # Store the URI of the current request in the session.
@@ -22,6 +22,7 @@ class Clients < Application
22
22
  provides :json
23
23
  provides :html
24
24
  before :login_required
25
+ before :require_admin, :exclude => [:index, :show]
25
26
 
26
27
  # GET /clients
27
28
  def index
@@ -61,6 +62,7 @@ class Clients < Application
61
62
 
62
63
  # GET /clients/new
63
64
  def new
65
+ raise AdminAccessRequired unless params[:user_id] == session[:user] unless session[:level] == :admin
64
66
  @client = Chef::ApiClient.new
65
67
  render
66
68
  end
@@ -21,7 +21,8 @@ require 'chef' / 'data_bag'
21
21
  class Databags < Application
22
22
 
23
23
  provides :html, :json
24
- before :login_required
24
+ before :login_required
25
+ before :require_admin
25
26
 
26
27
  def new
27
28
  @databag = Chef::DataBag.new
@@ -16,4 +16,10 @@
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
18
  #
19
+ class AdminAccessRequired < Merb::ControllerExceptions::Forbidden; end
19
20
 
21
+ class Exceptions < Merb::Controller
22
+ def admin_access_required
23
+ render :layout => nil
24
+ end
25
+ end
@@ -25,6 +25,7 @@ class Nodes < Application
25
25
  provides :html
26
26
 
27
27
  before :login_required
28
+ before :require_admin, :only => [:destroy]
28
29
 
29
30
  def index
30
31
  begin
@@ -90,7 +90,11 @@ class OpenidConsumer < Application
90
90
  user = Chef::WebUIUser.load(u)
91
91
  if user.openid == oidresp.identity_url
92
92
  session[:user] = user.name
93
- session[:level] = :admin
93
+ if user.admin
94
+ session[:level] = :admin
95
+ else
96
+ session[:level] = :user
97
+ end
94
98
  break
95
99
  end
96
100
  end
@@ -22,7 +22,8 @@ require 'chef/role'
22
22
  class Roles < Application
23
23
 
24
24
  provides :html
25
- before :login_required
25
+ before :login_required
26
+ before :require_admin, :only => [:destroy]
26
27
 
27
28
  # GET /roles
28
29
  def index
@@ -100,7 +101,7 @@ class Roles < Application
100
101
  @role = Chef::Role.new
101
102
  @role.default_attributes(JSON.parse(params[:default_attributes])) if params[:default_attributes] != ''
102
103
  @role.override_attributes(JSON.parse(params[:override_attributes])) if params[:override_attributes] != ''
103
- @run_list = params[:for_role] ? params[:for_role] : []
104
+ @run_list = Chef::RunList.new.reset!(Array(params[:for_role]))
104
105
  @_message = { :error => "Could not create role" }
105
106
  render :new
106
107
  end
@@ -121,7 +122,8 @@ class Roles < Application
121
122
  Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
122
123
  @available_recipes = get_available_recipes
123
124
  @available_roles = Chef::Role.list.keys.sort
124
- @run_list = params[:for_role] ? params[:for_role] : []
125
+ @run_list = Chef::RunList.new.reset!( Array(params[:for_role]))
126
+ Chef::Log.error(@run_list.inspect)
125
127
  @role.default_attributes(JSON.parse(params[:default_attributes])) if params[:default_attributes] != ''
126
128
  @role.override_attributes(JSON.parse(params[:override_attributes])) if params[:override_attributes] != ''
127
129
  @_message = {:error => "Could not update role #{params[:id]}"}
@@ -24,12 +24,12 @@ class Users < Application
24
24
 
25
25
  provides :html
26
26
  before :login_required, :exclude => [:login, :login_exec, :complete]
27
+ before :require_admin, :exclude => [:login, :login_exec, :complete, :show, :edit, :logout, :destroy]
27
28
  log_params_filtered :password, :password2, :new_password, :confirm_new_password
28
29
 
29
30
  # List users, only if the user is admin.
30
31
  def index
31
32
  begin
32
- authorized_user
33
33
  @users = Chef::WebUIUser.list
34
34
  render
35
35
  rescue => e
@@ -41,7 +41,6 @@ class Users < Application
41
41
  # Edit user. Admin can edit everyone, non-admin user can only edit itself.
42
42
  def edit
43
43
  begin
44
- raise Forbidden, "The current user is not an Administrator, you can only Show and Edit the user itself. To control other users, login as an Administrator." unless params[:user_id] == session[:user] unless session[:level] == :admin
45
44
  @user = Chef::WebUIUser.load(params[:user_id])
46
45
  render
47
46
  rescue => e
@@ -53,7 +52,6 @@ class Users < Application
53
52
  # Show the details of a user. If the user is not admin, only able to show itself; otherwise able to show everyone
54
53
  def show
55
54
  begin
56
- raise Forbidden, "The current user is not an Administrator, you can only Show and Edit the user itself. To control other users, login as an Administrator." unless params[:user_id] == session[:user] unless session[:level] == :admin
57
55
  @user = Chef::WebUIUser.load(params[:user_id])
58
56
  render
59
57
  rescue => e
@@ -67,8 +65,8 @@ class Users < Application
67
65
  begin
68
66
  @user = Chef::WebUIUser.load(params[:user_id])
69
67
 
70
- if session[:level] == :admin and ['true','false'].include? params[:admin]
71
- @user.admin = str_to_bool(params[:admin])
68
+ if session[:level] == :admin and !is_last_admin?
69
+ @user.admin = params[:admin] =~ /1/ ? true : false
72
70
  end
73
71
 
74
72
  if params[:user_id] == session[:user] && params[:admin] == 'false'
@@ -85,18 +83,18 @@ class Users < Application
85
83
  @user.set_openid(URI.parse(params[:openid]).normalize.to_s)
86
84
  end
87
85
  @user.save
88
- @_message = { :notice => "Updated User #{@user.name}" }
86
+ @_message = { :notice => "Updated user #{@user.name}." }
89
87
  render :show
90
88
  rescue => e
91
89
  Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
92
- @_message = { :error => "Could not update user" }
90
+ @u = Chef::WebUIUser.load(params[:user_id])
91
+ @_message = { :error => "Could not update user #{@user.name}." }
93
92
  render :edit
94
93
  end
95
94
  end
96
95
 
97
96
  def new
98
97
  begin
99
- authorized_user
100
98
  @user = Chef::WebUIUser.new
101
99
  render
102
100
  rescue => e
@@ -107,7 +105,6 @@ class Users < Application
107
105
 
108
106
  def create
109
107
  begin
110
- authorized_user
111
108
  @user = Chef::WebUIUser.new
112
109
  @user.name = params[:name]
113
110
  @user.set_password(params[:password], params[:password2])
@@ -153,12 +150,12 @@ class Users < Application
153
150
 
154
151
  def destroy
155
152
  begin
156
- raise Forbidden, "The last admin user cannot be deleted" if (is_admin(params[:user_id]) && is_last_admin)
157
153
  raise Forbidden, "A non-admin user can only delete itself" if (params[:user_id] != session[:user] && session[:level] != :admin)
154
+ raise Forbidden, "The last admin user cannot be deleted" if (is_admin? && is_last_admin? && session[:user] == params[:user_id])
158
155
  @user = Chef::WebUIUser.load(params[:user_id])
159
156
  @user.destroy
160
157
  logout if params[:user_id] == session[:user]
161
- redirect(absolute_url(:users), {:message => { :notice => "User #{params[:user_id]} deleted successfully" }, :permanent => true})
158
+ redirect(absolute_url(:users), {:message => { :notice => "User #{params[:user_id]} deleted successfully." }, :permanent => true})
162
159
  rescue => e
163
160
  Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
164
161
  session[:level] != :admin ? set_user_and_redirect : redirect_to_list_users({ :error => $! })
@@ -10,7 +10,7 @@
10
10
  %div.group.form
11
11
  %label.label Private Key
12
12
  = check_box :name => "regen_private_key", :label => "Regenerate Private Key (Existing one will no longer work!)", :value => "1"
13
- %br
13
+ %br/
14
14
 
15
15
  %div.group.form
16
16
  %label.label Admin
@@ -3,8 +3,10 @@
3
3
  %h2.title Cookbooks
4
4
  .inner
5
5
  %table.table
6
- %tr
7
- %th.first Cookbook Name
6
+ %thead
7
+ %tr
8
+ %th.first Cookbook Name
9
+ %tbody
8
10
  - @cl.sort.each_with_index do |cookbook, index|
9
11
  %tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"}
10
- %td= link_to cookbook[0], url(:cookbook, { :id => cookbook[0] })
12
+ %td= link_to cookbook[0], url(:cookbook, { :id => cookbook[0] })
@@ -6,14 +6,16 @@
6
6
  .content
7
7
  .inner
8
8
  %table.table
9
- %tr
10
- %th.first{:colspan => 2} Databag Name
11
- %th &nbsp;
12
- %th.last &nbsp;
9
+ %thead
10
+ %tr
11
+ %th.first{:colspan => 2} Databag Name
12
+ %th &nbsp;
13
+ %th.last &nbsp;
14
+ %tbody
13
15
  - @databags.sort.each_with_index do |databag, index|
14
16
  %tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"}
15
17
  %td{:colspan => 2}= link_to databag[0], url(:databag, { :id => databag[0] })
16
18
  %td
17
19
  = link_to('Edit', url(:databag, :id => databag[0]))
18
20
  |
19
- = link_to('Delete', url(:databag, :id => databag[0]), :method => "delete", :confirm => "Really delete Databag #{databag[0]}? There is no undo.")
21
+ = link_to('Delete', url(:databag, :id => databag[0]), :method => "delete", :confirm => "Really delete Databag #{databag[0]}? There is no undo.")
@@ -0,0 +1,7 @@
1
+ .block#block-messages
2
+ .content
3
+ %h2.title Messages
4
+ .inner
5
+ .flash
6
+ %div{:class => "message error"}
7
+ %p Administrative access required.
@@ -20,7 +20,8 @@
20
20
  #user-navigation
21
21
  %ul
22
22
  - if session[:user]
23
- %li= link_to "Logout #{h session[:user]} (#{session[:level].to_s})", url(:users_logout), :method => "get", :confirm => "Are you sure you want to logout?"
23
+ %li= link_to "Edit account", url(:users_edit, :user_id => session[:user]), :method => 'get'
24
+ %li= link_to "Logout #{h session[:user]} (#{session[:level].to_s})", url(:users_logout), :method => 'get', :confirm => "Are you sure you want to logout?"
24
25
  - else
25
26
  %li= link_to "Login", url(:users_login), :rel => "facebox"
26
27
  .clear
@@ -49,7 +50,7 @@
49
50
  = catch_content :for_layout
50
51
  #footer
51
52
  .block
52
- %p Copyright &copy; 2009 Opscode
53
+ %p Copyright &copy; 2010 Opscode
53
54
  #sidebar
54
55
  .block.notice#sidebar_block_notice= catch_content :sidebar_block_notice
55
56
  .block#sidebar_block= catch_content :sidebar_block
@@ -29,7 +29,7 @@
29
29
  = catch_content :for_layout
30
30
  #footer
31
31
  .block
32
- %p Copyright &copy; 2009 Opscode
32
+ %p Copyright &copy; 2010 Opscode
33
33
  #sidebar
34
34
  .block.notice#sidebar_block_notice= catch_content :sidebar_block_notice
35
35
  .block#sidebar_block= catch_content :sidebar_block
@@ -9,10 +9,12 @@
9
9
  .left
10
10
  %h3 Run List
11
11
  %table.table
12
- %tr
13
- %th.first Position
14
- %th Name
15
- %th.last Type
12
+ %thead
13
+ %tr
14
+ %th.first Position
15
+ %th Name
16
+ %th.last Type
17
+ %tbody
16
18
  - if @node.run_list.empty?
17
19
  %tr
18
20
  %td{:colspan => 2} This node has no roles or recipes applied.
@@ -3,14 +3,16 @@
3
3
  %h2.title Status
4
4
  .inner
5
5
  %table.table
6
- %tr
7
- %th.first Node Name
8
- %th Platform
9
- %th FQDN
10
- %th IP Address
11
- %th Uptime
12
- %th Last Check-in
13
- %th.last Run List
6
+ %thead
7
+ %tr
8
+ %th.first Node Name
9
+ %th Platform
10
+ %th FQDN
11
+ %th IP Address
12
+ %th Uptime
13
+ %th Last Check-in
14
+ %th.last Run List
15
+ %tbody
14
16
  - if @status.empty?
15
17
  %tr
16
18
  %td{:colspan => 7}= "You appear to have no nodes - try connecting one, or creating or editing a #{link_to('client', url(:clients))}"
@@ -27,8 +29,9 @@
27
29
  = link_to(node[1]["uptime"].split(" ")[0..1].join(" ") , "#", :class => 'tooltip')
28
30
  .tooltip
29
31
  %table.table.tooltip
30
- %tr
31
- %td= node[1]["uptime"]
32
+ %tbody
33
+ %tr
34
+ %td= node[1]["uptime"]
32
35
 
33
36
  - unless node[1]["ohai_time"].nil?
34
37
  - current_time = Time.now.to_f
@@ -55,10 +58,11 @@
55
58
  = link_to(status_msg, "#", :class=> 'tooltip')
56
59
  .tooltip
57
60
  %table.table.tooltip
58
- %tr
59
- %td
60
- = ohai_time
61
- %br
61
+ %tbody
62
+ %tr
63
+ %td
64
+ = ohai_time
65
+ %br/
62
66
  - if hours == 0
63
67
  = "#{minutes_text} ago"
64
68
  - else
@@ -71,10 +75,12 @@
71
75
  = link_to("Run List", "#", :class => 'tooltip')
72
76
  .tooltip
73
77
  %table.table.tooltip
74
- %tr
75
- %th.first Position
76
- %th Name
77
- %th.last Type
78
+ %thead
79
+ %tr
80
+ %th.first Position
81
+ %th Name
82
+ %th.last Type
83
+ %tbody
78
84
  - if node[1].run_list.empty?
79
85
  %tr
80
86
  %td{:colspan => 2} This node has no roles or recipes applied.
@@ -1,39 +1,40 @@
1
1
  .content
2
2
  .inner
3
- -if form_for == "login"
4
- %div.group
5
- .text_field= text_field :id => "user_name", :name => "name", :label => "Username: ", :class => "text_field", :value => params.has_key?(:name) ? h(params[:name]) : @user.name
6
- %br
3
+ = form(:action => form_url, :method => :post, :id => form_id, :class => 'form') do
4
+ -if form_for == "login"
5
+ %div.group
6
+ .text_field= text_field :id => "user_name", :name => "name", :label => "Username: ", :value => params.has_key?(:name) ? h(params[:name]) : @user.name
7
+ %br/
8
+
9
+ %div.group
10
+ .text_field= password_field :id=> "password", :name => "password", :label=>"Password: ", :class => "password_field"
11
+ %br/
12
+ =link_to("Or, log in with OpenID if you have one associated with an existing user account.", url(:openid_consumer))
13
+ %br/
7
14
 
8
- %div.group
9
- .text_field= password_field :id=> "password", :name => "password", :label=>"Password: ", :class => "password_field"
10
- %br
11
- =link_to("Or, log in with OpenID if you have one associated with an existing user account.", url(:openid_consumer))
12
- %br
13
-
14
- - if form_for == "edit"
15
- %div.group.form
16
- %label.label New Password
17
- = password_field :id=>"user_new_password", :name => "new_password", :class =>"password_field"
18
- %span.description New password for the User. Keep blank if you do not want to change password.
15
+ - if form_for == "edit"
16
+ %div.group.form
17
+ %label.label New Password
18
+ = password_field :id=>"user_new_password", :name => "new_password", :class =>"password_field"
19
+ %span.description New password for the User. Keep blank if you do not want to change password.
19
20
 
20
- %div.group.form
21
- %label.label Confirm New Password
22
- = password_field :id=>"user_confirm_new_password", :name => "confirm_new_password", :class =>"password_field"
23
- %span.description Confirm new password for the User. Keep blank if you do not want to change password.
21
+ %div.group.form
22
+ %label.label Confirm New Password
23
+ = password_field :id=>"user_confirm_new_password", :name => "confirm_new_password", :class =>"password_field"
24
+ %span.description Confirm new password for the User. Keep blank if you do not want to change password.
24
25
 
25
- - if session[:level] == :admin && edit_admin
26
+ - if is_admin? && !is_last_admin?
27
+ %div.group.form
28
+ %label.label Admin
29
+ %input{ :type => "hidden", :name => "admin", :value => 0 }
30
+ %input{ :type => "checkbox", :name => "admin", :value => 1, :checked => @user.admin }
31
+ %span.description Whether or not the User is an admin.
32
+
26
33
  %div.group.form
27
- %label.label Admin
28
- = text_field :id => "user_admin", :name => "admin", :class => "text_field", :value => @user.admin
29
- %span.description Whether or not the User is an admin.
30
-
31
- %div.group.form
32
- %label.label OpenID Association
33
- = text_field :id => "openid", :name => "openid", :class => "text_field", :value => @user.openid
34
- %span.description Associate an OpenID with the user account, leave blank if you do not want to associate one.
35
-
36
- = form(:action => form_url, :method => :post, :id => form_id, :class => 'form') do
34
+ %label.label OpenID Association
35
+ = text_field :id => "openid", :name => "openid", :class => "text_field", :value => @user.openid
36
+ %span.description Associate an OpenID with the user account, leave blank if you do not want to associate one.
37
+
37
38
  %div.group
38
39
  .actions-bar
39
40
  .actions= submit submit_name, :id => submit_id, :class => 'button'
@@ -1,9 +1,12 @@
1
1
  .secondary-navigation
2
2
  %ul
3
- %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', url(:users))
4
- %li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', url(:users_new))
3
+ - if is_admin?
4
+ %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', url(:users))
5
+ - if is_admin?
6
+ %li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', url(:users_new))
5
7
  - if active != 'create' && active != 'index'
6
8
  %li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', url(:users_show))
7
- %li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', url(:users_edit, :user_id => params[:user_id]))
8
- %li= link_to('Delete', url(:users_delete, :user_id => params[:user_id]), :method => "delete", :confirm => "Really delete user #{params[:user_id]}? There is no undo.")
9
+ - if @user.admin || @user.name == params[:user_id]
10
+ %li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', url(:users_edit, :user_id => params[:user_id]))
11
+ %li= link_to('Delete', url(:users_delete, :user_id => params[:user_id]), :method => "delete", :confirm => "Really delete user #{params[:user_id]}? There is no undo.")
9
12
  .clear
@@ -1,6 +1,6 @@
1
1
  .block#block-tables
2
2
  .content
3
- %h2.title= "User: #{h @user.name}"
3
+ %h2.title= "Edit user: #{h @user.name}"
4
4
  .inner
5
5
  = partial('navigation', :active => 'edit')
6
6
  = partial('form', :header => "Edit User #{@user.name}", :form_id => 'edit_user', :submit_name => "Save User", :submit_id => "edit_user_button", :form_for => 'edit', :form_url => url(:users_update, @user.name) )
@@ -30,6 +30,13 @@ require "merb-core"
30
30
  $:.unshift(File.expand_path(File.dirname(__FILE__) + '/../../chef/lib'))
31
31
  $:.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
32
32
 
33
+ # Print the version if we have -v or --version
34
+ if ARGV.any? { |arg| arg =~ /\-v|\-\-version/ }
35
+ require 'chef-server-webui/version'
36
+ puts "Chef Server (Web UI) Version: #{ChefServerWebui::VERSION}"
37
+ exit 1
38
+ end
39
+
33
40
  require 'chef'
34
41
  require 'chef-server-webui'
35
42
 
@@ -0,0 +1,30 @@
1
+ #
2
+ # Author:: Daniel DeLeo (<dan@opscode.com>)
3
+ # Copyright:: Copyright (c) 2010 Opscode, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ Chef::Log.info("")
20
+ Chef::Log.info("*" * 80)
21
+ Chef::Log.info("* Starting Chef Server Web UI in Development Mode.")
22
+ Chef::Log.info("* Start the server with `-e production` for normal use")
23
+ Chef::Log.info("*" * 80)
24
+ Chef::Log.info("")
25
+
26
+ Merb::Config.use do |c|
27
+ c[:exception_details] = true
28
+ c[:reload_classes] = true
29
+ c[:reload_templates] = true
30
+ end
@@ -0,0 +1,23 @@
1
+ #
2
+ # Author:: Daniel DeLeo (<dan@opscode.com>)
3
+ # Copyright:: Copyright (c) 2010 Opscode, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ Merb::Config.use do |c|
20
+ c[:exception_details] = false
21
+ c[:reload_classes] = false
22
+ c[:reload_templates] = false
23
+ end
data/config/init.rb CHANGED
@@ -1,24 +1,20 @@
1
1
  #
2
- # ==== Standalone Chefserver configuration
3
- #
4
- # This configuration/environment file is only loaded by bin/slice, which can be
5
- # used during development of the slice. It has no effect on this slice being
6
- # loaded in a host application. To run your slice in standalone mode, just
7
- # run 'slice' from its directory. The 'slice' command is very similar to
8
- # the 'merb' command, and takes all the same options, including -i to drop
9
- # into an irb session for example.
2
+ # Author:: Adam Jacob (<adam@opscode.com>)
3
+ # Author:: Daniel DeLeo (<dan@opscode.com>)
4
+ # Copyright:: Copyright (c) 2008-2010 Opscode, Inc.
5
+ # License:: Apache License, Version 2.0
10
6
  #
11
- # The usual Merb configuration directives and init.rb setup methods apply,
12
- # including use_orm and before_app_loads/after_app_loads.
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
13
10
  #
14
- # If you need need different configurations for different environments you can
15
- # even create the specific environment file in config/environments/ just like
16
- # in a regular Merb application.
11
+ # http://www.apache.org/licenses/LICENSE-2.0
17
12
  #
18
- # In fact, a slice is no different from a normal # Merb application - it only
19
- # differs by the fact that seamlessly integrates into a so called 'host'
20
- # application, which in turn can override or finetune the slice implementation
21
- # code and views.
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
22
18
  #
23
19
 
24
20
 
@@ -39,15 +35,11 @@ require 'chef/webui_user'
39
35
  use_template_engine :haml
40
36
 
41
37
  Merb::Config.use do |c|
42
- # BUGBUG [cb] For some reason, this next line
43
- # causes a merb slice to vomit around openid
44
- #c[:fork_for_class_load] = false
38
+ c[:name] = "chef-server-webui"
39
+ c[:fork_for_class_load] = false
45
40
  c[:session_id_key] = '_chef_server_session_id'
46
41
  c[:session_secret_key] = Chef::Config.manage_secret_key
47
42
  c[:session_store] = 'cookie'
48
- c[:exception_details] = true
49
- c[:reload_classes] = true
50
- c[:reload_templates] = true
51
43
 
52
44
  c[:log_level] = Chef::Config[:log_level]
53
45
  if Chef::Config[:log_location].kind_of?(String)
data/config/rack.rb CHANGED
@@ -1,3 +1,21 @@
1
+ #
2
+ # Author:: Daniel DeLeo (<dan@opscode.com>)
3
+ # Copyright:: Copyright (c) 2010 Opscode, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
1
19
  use Rack::ContentLength
2
20
  use Merb::Rack::Static, Merb.dir_for(:public)
3
21
 
data/config/router.rb CHANGED
@@ -1,3 +1,22 @@
1
+ #
2
+ # Author:: Adam Jacob (<adam@opscode.com>)
3
+ # Author:: Daniel DeLeo (<dan@opscode.com>)
4
+ # Copyright:: Copyright (c) 2008-2010 Opscode, Inc.
5
+ # License:: Apache License, Version 2.0
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
1
20
  Merb::Router.prepare do
2
21
  resources :nodes, :id => /[^\/]+/
3
22
  resources :clients, :id => /[^\/]+/
@@ -1,3 +1,3 @@
1
1
  module ChefServerWebui
2
- VERSION = '0.9.6'
2
+ VERSION = '0.9.8.beta.1'
3
3
  end
metadata CHANGED
@@ -1,12 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-server-webui
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ prerelease: true
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 6
9
- version: 0.9.6
8
+ - 8
9
+ - beta
10
+ - 1
11
+ version: 0.9.8.beta.1
10
12
  platform: ruby
11
13
  authors:
12
14
  - Opscode
@@ -14,7 +16,7 @@ autorequire:
14
16
  bindir: bin
15
17
  cert_chain: []
16
18
 
17
- date: 2010-07-02 00:00:00 -07:00
19
+ date: 2010-07-23 00:00:00 -07:00
18
20
  default_executable:
19
21
  dependencies:
20
22
  - !ruby/object:Gem::Dependency
@@ -33,7 +35,7 @@ dependencies:
33
35
  prerelease: false
34
36
  version_requirements: *id001
35
37
  - !ruby/object:Gem::Dependency
36
- name: merb-slices
38
+ name: merb-assets
37
39
  requirement: &id002 !ruby/object:Gem::Requirement
38
40
  none: false
39
41
  requirements:
@@ -48,7 +50,7 @@ dependencies:
48
50
  prerelease: false
49
51
  version_requirements: *id002
50
52
  - !ruby/object:Gem::Dependency
51
- name: merb-assets
53
+ name: merb-helpers
52
54
  requirement: &id003 !ruby/object:Gem::Requirement
53
55
  none: false
54
56
  requirements:
@@ -63,7 +65,7 @@ dependencies:
63
65
  prerelease: false
64
66
  version_requirements: *id003
65
67
  - !ruby/object:Gem::Dependency
66
- name: merb-helpers
68
+ name: merb-haml
67
69
  requirement: &id004 !ruby/object:Gem::Requirement
68
70
  none: false
69
71
  requirements:
@@ -78,7 +80,7 @@ dependencies:
78
80
  prerelease: false
79
81
  version_requirements: *id004
80
82
  - !ruby/object:Gem::Dependency
81
- name: merb-haml
83
+ name: merb-param-protection
82
84
  requirement: &id005 !ruby/object:Gem::Requirement
83
85
  none: false
84
86
  requirements:
@@ -92,24 +94,9 @@ dependencies:
92
94
  type: :runtime
93
95
  prerelease: false
94
96
  version_requirements: *id005
95
- - !ruby/object:Gem::Dependency
96
- name: merb-param-protection
97
- requirement: &id006 !ruby/object:Gem::Requirement
98
- none: false
99
- requirements:
100
- - - ~>
101
- - !ruby/object:Gem::Version
102
- segments:
103
- - 1
104
- - 1
105
- - 0
106
- version: 1.1.0
107
- type: :runtime
108
- prerelease: false
109
- version_requirements: *id006
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: json
112
- requirement: &id007 !ruby/object:Gem::Requirement
99
+ requirement: &id006 !ruby/object:Gem::Requirement
113
100
  none: false
114
101
  requirements:
115
102
  - - <=
@@ -121,10 +108,10 @@ dependencies:
121
108
  version: 1.4.2
122
109
  type: :runtime
123
110
  prerelease: false
124
- version_requirements: *id007
111
+ version_requirements: *id006
125
112
  - !ruby/object:Gem::Dependency
126
113
  name: thin
127
- requirement: &id008 !ruby/object:Gem::Requirement
114
+ requirement: &id007 !ruby/object:Gem::Requirement
128
115
  none: false
129
116
  requirements:
130
117
  - - ">="
@@ -134,10 +121,10 @@ dependencies:
134
121
  version: "0"
135
122
  type: :runtime
136
123
  prerelease: false
137
- version_requirements: *id008
124
+ version_requirements: *id007
138
125
  - !ruby/object:Gem::Dependency
139
126
  name: haml
140
- requirement: &id009 !ruby/object:Gem::Requirement
127
+ requirement: &id008 !ruby/object:Gem::Requirement
141
128
  none: false
142
129
  requirements:
143
130
  - - ">="
@@ -147,10 +134,10 @@ dependencies:
147
134
  version: "0"
148
135
  type: :runtime
149
136
  prerelease: false
150
- version_requirements: *id009
137
+ version_requirements: *id008
151
138
  - !ruby/object:Gem::Dependency
152
139
  name: ruby-openid
153
- requirement: &id010 !ruby/object:Gem::Requirement
140
+ requirement: &id009 !ruby/object:Gem::Requirement
154
141
  none: false
155
142
  requirements:
156
143
  - - ">="
@@ -160,10 +147,10 @@ dependencies:
160
147
  version: "0"
161
148
  type: :runtime
162
149
  prerelease: false
163
- version_requirements: *id010
150
+ version_requirements: *id009
164
151
  - !ruby/object:Gem::Dependency
165
152
  name: coderay
166
- requirement: &id011 !ruby/object:Gem::Requirement
153
+ requirement: &id010 !ruby/object:Gem::Requirement
167
154
  none: false
168
155
  requirements:
169
156
  - - ">="
@@ -173,7 +160,7 @@ dependencies:
173
160
  version: "0"
174
161
  type: :runtime
175
162
  prerelease: false
176
- version_requirements: *id011
163
+ version_requirements: *id010
177
164
  description: A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.
178
165
  email: chef@opscode.com
179
166
  executables:
@@ -183,12 +170,15 @@ extensions: []
183
170
  extra_rdoc_files:
184
171
  - README.rdoc
185
172
  - LICENSE
173
+ - config.ru
186
174
  files:
187
175
  - LICENSE
188
176
  - README.rdoc
189
177
  - Rakefile
190
178
  - config.ru
191
179
  - bin/chef-server-webui
180
+ - config/environments/development.rb
181
+ - config/environments/production.rb
192
182
  - config/init.rb
193
183
  - config/rack.rb
194
184
  - config/router.rb
@@ -256,6 +246,7 @@ files:
256
246
  - app/views/databags/index.html.haml
257
247
  - app/views/databags/new.html.haml
258
248
  - app/views/databags/show.html.haml
249
+ - app/views/exceptions/admin_access_required.html.haml
259
250
  - app/views/exceptions/bad_request.json.erb
260
251
  - app/views/exceptions/internal_server_error.html.erb
261
252
  - app/views/exceptions/not_acceptable.html.erb
@@ -412,11 +403,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
412
403
  required_rubygems_version: !ruby/object:Gem::Requirement
413
404
  none: false
414
405
  requirements:
415
- - - ">="
406
+ - - ">"
416
407
  - !ruby/object:Gem::Version
417
408
  segments:
418
- - 0
419
- version: "0"
409
+ - 1
410
+ - 3
411
+ - 1
412
+ version: 1.3.1
420
413
  requirements: []
421
414
 
422
415
  rubyforge_project: