ts-admin 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app.yml.example +3 -2
- data/bin/ts-admin +4 -0
- data/controller/init.rb +10 -3
- data/lib/ts-admin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 528db841c6ef8e98947079034726aa5a4ce3214b
|
4
|
+
data.tar.gz: 5fe471e105e13a03729202b24991bd301c357825
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68fd21ece886a89189657474545b41a7098164e946bae268d82a6a848f8d32884186b368e6118bf1481979dbce20257bdfef2ae96d958454a4dd32a89ff2b037
|
7
|
+
data.tar.gz: c1ad67697964dc72e52e1c0d558f203fef5d92c001e9b6a69e8218034c1a57dfcad6dbf136f0004768b352dfaeb9cfd50a9859ec810ad085b3ae76cfba473564
|
data/Gemfile.lock
CHANGED
data/app.yml.example
CHANGED
data/bin/ts-admin
CHANGED
@@ -10,6 +10,9 @@ OptionParser.new do |opts|
|
|
10
10
|
opts.on("-c", "--config [path]", "Port") do |config|
|
11
11
|
OPTIONS[:config] = config
|
12
12
|
end
|
13
|
+
opts.on("--ip [ip]", "IP") do |ip|
|
14
|
+
OPTIONS[:ip] = ip
|
15
|
+
end
|
13
16
|
opts.on("-p", "--port [port]", "Port") do |port|
|
14
17
|
OPTIONS[:port] = port.to_i
|
15
18
|
end
|
@@ -20,6 +23,7 @@ require File.expand_path('../../app', __FILE__)
|
|
20
23
|
|
21
24
|
Ramaze.start(
|
22
25
|
:adapter => :webrick,
|
26
|
+
:host => OPTIONS[:ip] || APP_CONFIG['ip'] || nil,
|
23
27
|
:port => OPTIONS[:port] || APP_CONFIG['port'] || 7000,
|
24
28
|
:file => __FILE__,
|
25
29
|
:root => Ramaze.options.roots
|
data/controller/init.rb
CHANGED
@@ -30,11 +30,18 @@ class Controller < Ramaze::Controller
|
|
30
30
|
return unless username and password
|
31
31
|
return if username.empty? or password.empty?
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
authenticated = false
|
34
|
+
auth = APP_CONFIG['auth'].is_a?(Array) ? APP_CONFIG['auth'] : [APP_CONFIG['auth']]
|
35
|
+
auth.each do |a|
|
36
|
+
next unless a['username'].downcase == username.downcase
|
37
|
+
next unless a['password'] == Digest::SHA1.hexdigest(password)
|
38
|
+
authenticated = true
|
39
|
+
end
|
40
|
+
|
41
|
+
return unless authenticated
|
35
42
|
|
36
43
|
session[:logged_in] = true
|
37
|
-
session[:username] =
|
44
|
+
session[:username] = username.downcase
|
38
45
|
end
|
39
46
|
|
40
47
|
def login_required
|
data/lib/ts-admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ts-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Schwab
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|