nofxx-god_web 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/god_web.gemspec +1 -2
- data/lib/app.rb +2 -3
- data/lib/environment.rb +4 -4
- data/lib/god_web.rb +1 -1
- data/views/command.erb +4 -2
- metadata +2 -4
- data/lib/sinatra_http_auth.rb +0 -53
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/god_web.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{god_web}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jesse Newland", "Marcos Piccinini"]
|
@@ -30,7 +30,6 @@ Gem::Specification.new do |s|
|
|
30
30
|
"lib/app.rb",
|
31
31
|
"lib/environment.rb",
|
32
32
|
"lib/god_web.rb",
|
33
|
-
"lib/sinatra_http_auth.rb",
|
34
33
|
"public/.DS_Store",
|
35
34
|
"public/app.css",
|
36
35
|
"public/icons/databases.png",
|
data/lib/app.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
|
2
1
|
before do
|
3
2
|
unless (GODWEB_CONFIG['username'].nil? && GODWEB_CONFIG['password'].nil?) || self.request.path_info == '/heartbeat'
|
4
|
-
|
5
|
-
|
3
|
+
use Rack::Auth::Basic do |user, pass|
|
4
|
+
[user, pass] == [GODWEB_CONFIG['username'], GODWEB_CONFIG['password']]
|
6
5
|
end
|
7
6
|
end
|
8
7
|
GODWEB.ping
|
data/lib/environment.rb
CHANGED
@@ -5,9 +5,6 @@ require 'stringio'
|
|
5
5
|
require 'yaml'
|
6
6
|
require 'erb'
|
7
7
|
require 'optparse'
|
8
|
-
#included until http://sinatra.lighthouseapp.com/projects/9779/tickets/16-patch-http-authentication is in a released version
|
9
|
-
require File.dirname(__FILE__) + '/app'
|
10
|
-
require File.dirname(__FILE__) + '/sinatra_http_auth'
|
11
8
|
require File.dirname(__FILE__) + '/god_web'
|
12
9
|
|
13
10
|
config = {
|
@@ -15,14 +12,17 @@ config = {
|
|
15
12
|
'username' => nil,
|
16
13
|
'password' => nil
|
17
14
|
}
|
15
|
+
|
18
16
|
begin
|
19
17
|
config.merge!(YAML.load(File.read(ARGV[0])))
|
20
18
|
GODWEB_CONFIG = config
|
21
19
|
rescue
|
22
20
|
GODWEB_CONFIG = config
|
23
21
|
end
|
24
|
-
|
25
22
|
GODWEB = GodWeb.new(config)
|
26
23
|
|
24
|
+
# Require app
|
25
|
+
require File.dirname(__FILE__) + '/app'
|
26
|
+
|
27
27
|
Sinatra::Application.public = File.dirname(__FILE__) + "/../public"
|
28
28
|
Sinatra::Application.views = File.dirname(__FILE__) + "/../views"
|
data/lib/god_web.rb
CHANGED
data/views/command.erb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
<div id="<%= @command %>ing_<%= @watch %>" class="panel" title="<%= @title %>">
|
2
|
-
|
3
|
-
|
2
|
+
<h2><%= @success ? 'Success' : 'Failed' %></h2>
|
3
|
+
<fieldset>
|
4
|
+
<div align='left'><%= @log %></div>
|
5
|
+
</fieldset>
|
4
6
|
</div>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nofxx-god_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Newland
|
@@ -67,7 +67,6 @@ files:
|
|
67
67
|
- lib/app.rb
|
68
68
|
- lib/environment.rb
|
69
69
|
- lib/god_web.rb
|
70
|
-
- lib/sinatra_http_auth.rb
|
71
70
|
- public/.DS_Store
|
72
71
|
- public/app.css
|
73
72
|
- public/icons/databases.png
|
@@ -116,7 +115,6 @@ files:
|
|
116
115
|
- views/watch.erb
|
117
116
|
has_rdoc: false
|
118
117
|
homepage: http://github.com/nofxx/god_web
|
119
|
-
licenses:
|
120
118
|
post_install_message:
|
121
119
|
rdoc_options:
|
122
120
|
- --charset=UTF-8
|
@@ -137,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
135
|
requirements: []
|
138
136
|
|
139
137
|
rubyforge_project:
|
140
|
-
rubygems_version: 1.
|
138
|
+
rubygems_version: 1.2.0
|
141
139
|
signing_key:
|
142
140
|
specification_version: 3
|
143
141
|
summary: iPhone friendly web UI for God
|
data/lib/sinatra_http_auth.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
module HttpAuthentication
|
2
|
-
module Basic
|
3
|
-
|
4
|
-
def authenticate_or_request_with_http_basic(realm = "Application", &login_procedure)
|
5
|
-
authenticate_with_http_basic(&login_procedure) || request_http_basic_authentication(realm)
|
6
|
-
end
|
7
|
-
|
8
|
-
def authenticate_with_http_basic(&login_procedure)
|
9
|
-
authenticate(&login_procedure)
|
10
|
-
end
|
11
|
-
|
12
|
-
def request_http_basic_authentication(realm = "Application")
|
13
|
-
authentication_request(realm)
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def authenticate(&login_procedure)
|
19
|
-
if authorization
|
20
|
-
login_procedure.call(*user_name_and_password)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def user_name_and_password
|
25
|
-
decode_credentials.split(/:/, 2)
|
26
|
-
end
|
27
|
-
|
28
|
-
def authorization
|
29
|
-
request.env['HTTP_AUTHORIZATION'] ||
|
30
|
-
request.env['X-HTTP_AUTHORIZATION'] ||
|
31
|
-
request.env['X_HTTP_AUTHORIZATION'] ||
|
32
|
-
request.env['REDIRECT_X_HTTP_AUTHORIZATION']
|
33
|
-
end
|
34
|
-
|
35
|
-
# Base64
|
36
|
-
def decode_credentials
|
37
|
-
(authorization.split.last || '').unpack("m").first
|
38
|
-
end
|
39
|
-
|
40
|
-
def authentication_request(realm)
|
41
|
-
status(401)
|
42
|
-
header("WWW-Authenticate" => %(Basic realm="#{realm.gsub(/"/, "")}"))
|
43
|
-
throw :halt, "HTTP Basic: Access denied.\n"
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
module Sinatra
|
50
|
-
class EventContext
|
51
|
-
include HttpAuthentication::Basic
|
52
|
-
end
|
53
|
-
end
|