Permalink
Browse files

[cli-args] add cli arg support, fix rack version and :public, api_ser…

…ver is in the config file
  • Loading branch information...
1 parent 18be88a commit 997ca1c16b91806fdb088b39294341ba6fef0468 @portertech portertech committed Oct 7, 2011
Showing with 6 additions and 5 deletions.
  1. 0 bin/sensu-dashboard
  2. +5 −5 lib/sensu-dashboard/app.rb
  3. +1 −0 sensu-dashboard.gemspec
View
0 bin/sensu-dashboard 100644 → 100755
No changes.
View
@@ -12,13 +12,13 @@ class DashboardServer < Sinatra::Base
register Sinatra::Async
set :root, File.dirname(__FILE__)
set :static, true
- set :public, Proc.new { File.join(root, "public") }
+ set :public_folder, Proc.new { File.join(root, "public") }
- api_server = 'http://127.0.0.1:8080'
-
- config = Sensu::Config.new
+ options = Sensu::Config.read_arguments(ARGV)
+ config = Sensu::Config.new(options)
settings = config.settings
- secret = settings['dashboard']['key']
+ secret = settings.has_key?('dashboard') ? settings['dashboard']['key'] : 'secret'
+ api_server = 'http://' + settings['api']['host'] + ':' + settings['api']['port'].to_s
before do
content_type 'application/json'
View
@@ -12,6 +12,7 @@ Gem::Specification.new do |s|
s.description = %q{Display current events and clients in sensu via a simple web interface}
s.add_dependency("eventmachine")
+ s.add_dependency("rack", ">= 1.3.4")
s.add_dependency("async_sinatra")
s.add_dependency("em-http-request")
s.add_dependency("em-websocket")

0 comments on commit 997ca1c

Please sign in to comment.