bosh-monitor 1.2671.0 → 1.2681.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bosh/monitor/api_controller.rb +17 -0
- data/lib/bosh/monitor/runner.rb +0 -3
- data/lib/bosh/monitor/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efd7f59aa1217707b0e778857eaa6e501c7bfd91
|
4
|
+
data.tar.gz: 7836f292481fe3282ef5d61ce6f3fc6f4d7c381b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa5ab8bff1c45ebffa9705801e5dceda7eb547d975fc2c8d17690ef657449e932565f6561e3c68cf0c7c7995897da85313e274e076b441fa0dcaab4c1fa90a20
|
7
|
+
data.tar.gz: 1f965f07790e1d8d598262e3145335079eab762cc7c15c2d2802a203f228971cfaa5a8898282b7af191de6079b92ae7d8c6735998b42d38daaa9172d8dc1dfa5
|
@@ -8,11 +8,28 @@ module Bosh::Monitor
|
|
8
8
|
set(:dump_errors, false)
|
9
9
|
end
|
10
10
|
|
11
|
+
helpers do
|
12
|
+
def protected!
|
13
|
+
return if authorized?
|
14
|
+
headers['WWW-Authenticate'] = ''
|
15
|
+
halt 401, 'Unauthorized'
|
16
|
+
end
|
17
|
+
|
18
|
+
def authorized?
|
19
|
+
@auth ||= Rack::Auth::Basic::Request.new(request.env)
|
20
|
+
@auth.provided? and @auth.basic? and @auth.credentials and @auth.credentials == [Bhm.http_user, Bhm.http_password]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
11
24
|
get "/varz" do
|
25
|
+
protected!
|
12
26
|
content_type(:json)
|
13
27
|
Yajl::Encoder.encode(Bhm.varz, :terminator => "\n")
|
14
28
|
end
|
15
29
|
|
30
|
+
get "/healthz" do
|
31
|
+
200
|
32
|
+
end
|
16
33
|
end
|
17
34
|
|
18
35
|
end
|
data/lib/bosh/monitor/runner.rb
CHANGED
@@ -85,9 +85,6 @@ module Bosh::Monitor
|
|
85
85
|
@logger.info "HTTP server is starting on port #{Bhm.http_port}..."
|
86
86
|
@http_server = Thin::Server.new("0.0.0.0", Bhm.http_port, :signals => false) do
|
87
87
|
Thin::Logging.silent = true
|
88
|
-
use Rack::Auth::Basic do |user, password|
|
89
|
-
[ user, password ] == [ Bhm.http_user, Bhm.http_password ]
|
90
|
-
end
|
91
88
|
map "/" do
|
92
89
|
run Bhm::ApiController.new
|
93
90
|
end
|
data/lib/bosh/monitor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2681.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VMware
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07
|
11
|
+
date: 2014-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
version: 1.6.0
|
139
139
|
description: |-
|
140
140
|
BOSH Health Monitor
|
141
|
-
|
141
|
+
c8f6a2
|
142
142
|
email: support@cloudfoundry.com
|
143
143
|
executables:
|
144
144
|
- bosh-monitor-console
|