deflectable 0.3.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -11
- data/lib/deflectable/blacklist.rb +10 -0
- data/lib/deflectable/filtering.rb +19 -0
- data/lib/deflectable/version.rb +1 -1
- data/lib/deflectable/watcher.rb +6 -22
- data/lib/deflectable/whitelist.rb +10 -0
- data/lib/deflectable.rb +3 -0
- data/lib/generators/deflectable/templates/deflectable.yml +5 -7
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +44 -250
- data/test/dummy/log/test.log +46 -13
- data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- metadata +5 -4
- data/test/dummy/config/deflectable.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 360ccb8d8e116753a9a29d6b042137467d9e4fb8
|
4
|
+
data.tar.gz: 369179b44205e1cbdbfeb93d6f35eadaa856d423
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c96c23991ae7875dd6c33bb556dfdfdff524db693f0ec0d5384be4045756c6c9a0170b562f55a46ef9e8f25a559951464d4b56257f15b801a8b784d94dce5d4
|
7
|
+
data.tar.gz: 074dea192fd5ef24eceb6d20017248c62534965be62b9616f8e3ecaa897e5e93ef8de7b7f38c0e760aef68bfab282eec3814a7a66d47f27114dc6b2e4f6a762d
|
data/README.md
CHANGED
@@ -24,9 +24,22 @@ Or install it yourself as:
|
|
24
24
|
```bash
|
25
25
|
$ rails generate deflectable:install
|
26
26
|
```
|
27
|
+
Generated files
|
27
28
|
|
28
|
-
*
|
29
|
-
*
|
29
|
+
* config/deflectable.yml
|
30
|
+
* public/403.html
|
31
|
+
|
32
|
+
#### deflectable.yml
|
33
|
+
|
34
|
+
```yaml
|
35
|
+
# config/deflectable.yml
|
36
|
+
|
37
|
+
:log: true # default false
|
38
|
+
:whitelist: # or :blacklist
|
39
|
+
- 192.168.1.1
|
40
|
+
- 10.20.30.0/24 # ip range
|
41
|
+
- 3ffe:505:2::1 # IPv6 supported
|
42
|
+
```
|
30
43
|
|
31
44
|
### Modified config.ru
|
32
45
|
|
@@ -35,12 +48,3 @@ $ rails generate deflectable:install
|
|
35
48
|
|
36
49
|
use Deflectable::Watcher
|
37
50
|
```
|
38
|
-
|
39
|
-
|
40
|
-
## Contributing
|
41
|
-
|
42
|
-
1. Fork it
|
43
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
44
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
45
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
46
|
-
5. Create new Pull Request
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'ipaddr'
|
2
|
+
class Deflectable::Filtering
|
3
|
+
|
4
|
+
def initialize(filter_list)
|
5
|
+
@list = parse_ipaddress(filter_list)
|
6
|
+
end
|
7
|
+
|
8
|
+
def include?(request_ip)
|
9
|
+
@list.any?{|ip| ip.include?(request_ip)}
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def parse_ipaddress(list)
|
15
|
+
list.map do |ip|
|
16
|
+
IPAddr.new(ip).to_range rescue nil
|
17
|
+
end.compact
|
18
|
+
end
|
19
|
+
end
|
data/lib/deflectable/version.rb
CHANGED
data/lib/deflectable/watcher.rb
CHANGED
@@ -18,7 +18,7 @@ module Deflectable
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def call(env)
|
21
|
-
return reject!(env)
|
21
|
+
return reject!(env) unless permit?(env)
|
22
22
|
status, headers, body = @app.call(env)
|
23
23
|
[status, headers, body]
|
24
24
|
end
|
@@ -34,8 +34,8 @@ There was both a :blanklist and :whitelist.
|
|
34
34
|
`Please select the :blacklist or :whitelist.'
|
35
35
|
EOS
|
36
36
|
end
|
37
|
-
@filtering =
|
38
|
-
@filtering =
|
37
|
+
@filtering = Whitelist.new(options) unless options[:whitelist].empty?
|
38
|
+
@filtering = Blacklist.new(options) unless options[:blacklist].empty?
|
39
39
|
unless options[:logger]
|
40
40
|
self.options[:logger] = Logger.new('deflecter.log')
|
41
41
|
end
|
@@ -65,25 +65,9 @@ There was both a :blanklist and :whitelist.
|
|
65
65
|
'<p>failed</p>'
|
66
66
|
end
|
67
67
|
|
68
|
-
def
|
69
|
-
|
70
|
-
|
71
|
-
allowed?(env) ? false : true
|
72
|
-
when :blacklist
|
73
|
-
denied?(env)
|
74
|
-
else
|
75
|
-
false
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
def allowed?(env)
|
80
|
-
return true if options[:whitelist].empty?
|
81
|
-
options[:whitelist].include?(env['REMOTE_ADDR']) ? true : false
|
82
|
-
end
|
83
|
-
|
84
|
-
def denied?(env)
|
85
|
-
return false if options[:blacklist].empty?
|
86
|
-
options[:blacklist].include?(env['REMOTE_ADDR']) ? true : false
|
68
|
+
def permit?(env)
|
69
|
+
return true unless @filtering
|
70
|
+
@filtering.permit?(env['REMOTE_ADDR'])
|
87
71
|
end
|
88
72
|
|
89
73
|
def log(message, level = :info)
|
data/lib/deflectable.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
# :log: true
|
2
|
-
# :whitelist:
|
3
|
-
# -
|
4
|
-
# -
|
5
|
-
# :
|
6
|
-
# - '12.12.12.12'
|
7
|
-
# - '90.80.70.60'
|
1
|
+
# :log: true # default: false
|
2
|
+
# :whitelist: # or :blacklist
|
3
|
+
# - 192.168.1.1
|
4
|
+
# - 10.20.30.0/24 # ip range
|
5
|
+
# - 3ffe:505:2::1 # IPv6 supported
|
Binary file
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -1,314 +1,108 @@
|
|
1
1
|
|
2
2
|
|
3
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
4
|
-
|
5
|
-
SQLite3::CantOpenException (unable to open database file):
|
6
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `initialize'
|
7
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `new'
|
8
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `sqlite3_connection'
|
9
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
|
10
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
|
11
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
|
12
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
|
13
|
-
/Users/sakuma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
|
14
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
|
15
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
|
16
|
-
/Users/sakuma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
|
17
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
|
18
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
|
19
|
-
activerecord (4.0.0) lib/active_record/connection_handling.rb:79:in `retrieve_connection'
|
20
|
-
activerecord (4.0.0) lib/active_record/connection_handling.rb:53:in `connection'
|
21
|
-
activerecord (4.0.0) lib/active_record/query_cache.rb:51:in `restore_query_cache_settings'
|
22
|
-
activerecord (4.0.0) lib/active_record/query_cache.rb:43:in `rescue in call'
|
23
|
-
activerecord (4.0.0) lib/active_record/query_cache.rb:32:in `call'
|
24
|
-
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
|
25
|
-
activerecord (4.0.0) lib/active_record/migration.rb:369:in `call'
|
26
|
-
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
|
27
|
-
activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__1688254131637688522__call__callbacks'
|
28
|
-
activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
|
29
|
-
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
|
30
|
-
actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in `call'
|
31
|
-
actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
|
32
|
-
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
|
33
|
-
actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
|
34
|
-
railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
|
35
|
-
railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
|
36
|
-
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
|
37
|
-
activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
|
38
|
-
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
|
39
|
-
railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
|
40
|
-
actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
|
41
|
-
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
|
42
|
-
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
|
43
|
-
activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
|
44
|
-
rack (1.5.2) lib/rack/lock.rb:17:in `call'
|
45
|
-
actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:in `call'
|
46
|
-
railties (4.0.0) lib/rails/engine.rb:511:in `call'
|
47
|
-
railties (4.0.0) lib/rails/application.rb:97:in `call'
|
48
|
-
/Users/sakuma/apps/libs/deflectable/lib/deflectable/watcher.rb:25:in `call'
|
49
|
-
rack (1.5.2) lib/rack/lock.rb:17:in `call'
|
50
|
-
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
|
51
|
-
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
|
52
|
-
/Users/sakuma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
|
53
|
-
/Users/sakuma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
|
54
|
-
/Users/sakuma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
|
55
|
-
|
56
|
-
|
57
|
-
Rendered /Users/sakuma/.rvm/gems/ruby-2.0.0-p247@deflectable/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.4ms)
|
58
|
-
Rendered /Users/sakuma/.rvm/gems/ruby-2.0.0-p247@deflectable/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.8ms)
|
59
|
-
Rendered /Users/sakuma/.rvm/gems/ruby-2.0.0-p247@deflectable/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.7ms)
|
60
|
-
Rendered /Users/sakuma/.rvm/gems/ruby-2.0.0-p247@deflectable/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (11.6ms)
|
61
|
-
[1m[36m (2.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
62
|
-
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
63
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
64
|
-
|
65
|
-
|
66
|
-
Started GET "/" for 127.0.0.1 at 2013-09-25 22:57:04 +0900
|
3
|
+
Started GET "/" for 127.0.0.1 at 2013-09-24 23:00:33 +0900
|
67
4
|
Processing by WelcomeController#index as HTML
|
68
5
|
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
69
|
-
Completed 200 OK in
|
6
|
+
Completed 200 OK in 27ms (Views: 26.3ms | ActiveRecord: 0.0ms)
|
70
7
|
|
71
8
|
|
72
|
-
Started GET "/assets/application.
|
9
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-24 23:00:34 +0900
|
73
10
|
|
74
11
|
|
75
|
-
Started GET "/assets/application.
|
12
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-24 23:00:34 +0900
|
76
13
|
|
77
14
|
|
78
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
15
|
+
Started GET "/" for 127.0.0.1 at 2013-09-24 23:51:20 +0900
|
79
16
|
Processing by WelcomeController#index as HTML
|
80
|
-
Rendered welcome/index.html.erb within layouts/application (
|
81
|
-
Completed 200 OK in
|
17
|
+
Rendered welcome/index.html.erb within layouts/application (17.0ms)
|
18
|
+
Completed 200 OK in 41ms (Views: 40.6ms | ActiveRecord: 0.0ms)
|
82
19
|
|
83
20
|
|
84
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-
|
21
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-24 23:51:20 +0900
|
85
22
|
|
86
23
|
|
87
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-
|
24
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-24 23:51:20 +0900
|
88
25
|
|
89
26
|
|
90
|
-
Started GET "/" for 127.0.0.1 at 2013-09-25
|
27
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 09:26:37 +0900
|
91
28
|
Processing by WelcomeController#index as HTML
|
92
|
-
Rendered welcome/index.html.erb within layouts/application (
|
93
|
-
Completed 200 OK in
|
94
|
-
|
95
|
-
|
96
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-25 22:57:13 +0900
|
97
|
-
|
98
|
-
|
99
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-25 22:57:13 +0900
|
29
|
+
Rendered welcome/index.html.erb within layouts/application (1.1ms)
|
30
|
+
Completed 200 OK in 45ms (Views: 44.5ms | ActiveRecord: 0.0ms)
|
100
31
|
|
101
32
|
|
102
|
-
Started GET "/" for 127.0.0.1 at 2013-09-25
|
33
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 09:30:07 +0900
|
103
34
|
Processing by WelcomeController#index as HTML
|
104
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
105
|
-
Completed 200 OK in
|
106
|
-
|
107
|
-
|
108
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
109
|
-
|
110
|
-
|
111
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
112
|
-
|
113
|
-
|
114
|
-
Started GET "/" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
115
|
-
Processing by WelcomeController#index as HTML
|
116
|
-
Rendered welcome/index.html.erb within layouts/application (0.1ms)
|
117
|
-
Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)
|
118
|
-
|
119
|
-
|
120
|
-
Started GET "/" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
121
|
-
Processing by WelcomeController#index as HTML
|
122
|
-
Rendered welcome/index.html.erb within layouts/application (0.0ms)
|
123
|
-
Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
|
124
|
-
|
125
|
-
|
126
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
127
|
-
|
128
|
-
|
129
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
35
|
+
Rendered welcome/index.html.erb within layouts/application (0.7ms)
|
36
|
+
Completed 200 OK in 24ms (Views: 23.4ms | ActiveRecord: 0.0ms)
|
130
37
|
|
131
38
|
|
132
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
39
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 09:32:49 +0900
|
133
40
|
Processing by WelcomeController#index as HTML
|
134
41
|
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
135
|
-
Completed 200 OK in
|
136
|
-
|
137
|
-
|
138
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:35:51 +0900
|
42
|
+
Completed 200 OK in 24ms (Views: 23.7ms | ActiveRecord: 0.0ms)
|
139
43
|
|
140
44
|
|
141
|
-
Started GET "/
|
142
|
-
|
143
|
-
|
144
|
-
Started GET "/" for 127.0.0.1 at 2013-09-26 00:36:39 +0900
|
45
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 09:39:33 +0900
|
145
46
|
Processing by WelcomeController#index as HTML
|
146
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
147
|
-
Completed 200 OK in
|
148
|
-
|
149
|
-
|
150
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:36:39 +0900
|
151
|
-
|
152
|
-
|
153
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:36:39 +0900
|
47
|
+
Rendered welcome/index.html.erb within layouts/application (0.7ms)
|
48
|
+
Completed 200 OK in 23ms (Views: 23.0ms | ActiveRecord: 0.0ms)
|
154
49
|
|
155
50
|
|
156
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
51
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 09:46:32 +0900
|
157
52
|
Processing by WelcomeController#index as HTML
|
158
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
159
|
-
Completed 200 OK in
|
160
|
-
|
161
|
-
|
162
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:36:44 +0900
|
163
|
-
|
164
|
-
|
165
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:36:44 +0900
|
53
|
+
Rendered welcome/index.html.erb within layouts/application (0.7ms)
|
54
|
+
Completed 200 OK in 24ms (Views: 23.5ms | ActiveRecord: 0.0ms)
|
166
55
|
|
167
56
|
|
168
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
57
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 09:47:37 +0900
|
169
58
|
Processing by WelcomeController#index as HTML
|
170
59
|
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
171
|
-
Completed 200 OK in
|
172
|
-
|
173
|
-
|
174
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:42:54 +0900
|
60
|
+
Completed 200 OK in 24ms (Views: 23.6ms | ActiveRecord: 0.0ms)
|
175
61
|
|
176
62
|
|
177
|
-
Started GET "/
|
178
|
-
|
179
|
-
|
180
|
-
Started GET "/" for 127.0.0.1 at 2013-09-26 00:45:45 +0900
|
63
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 09:48:19 +0900
|
181
64
|
Processing by WelcomeController#index as HTML
|
182
65
|
Rendered welcome/index.html.erb within layouts/application (0.7ms)
|
183
|
-
Completed 200 OK in
|
184
|
-
|
185
|
-
|
186
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:45:45 +0900
|
187
|
-
|
188
|
-
|
189
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:45:45 +0900
|
190
|
-
|
191
|
-
|
192
|
-
Started GET "/" for 127.0.0.1 at 2013-09-26 00:47:41 +0900
|
193
|
-
Processing by WelcomeController#index as HTML
|
194
|
-
Rendered welcome/index.html.erb within layouts/application (0.9ms)
|
195
|
-
Completed 200 OK in 29ms (Views: 28.9ms | ActiveRecord: 0.0ms)
|
66
|
+
Completed 200 OK in 24ms (Views: 23.8ms | ActiveRecord: 0.0ms)
|
196
67
|
|
197
68
|
|
198
|
-
Started GET "/
|
199
|
-
|
200
|
-
|
201
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:47:41 +0900
|
202
|
-
|
203
|
-
|
204
|
-
Started GET "/" for 127.0.0.1 at 2013-09-26 00:48:09 +0900
|
69
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 09:49:49 +0900
|
205
70
|
Processing by WelcomeController#index as HTML
|
206
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
207
|
-
Completed 200 OK in 24ms (Views:
|
208
|
-
|
209
|
-
|
210
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:48:09 +0900
|
211
|
-
|
212
|
-
|
213
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:48:09 +0900
|
71
|
+
Rendered welcome/index.html.erb within layouts/application (0.7ms)
|
72
|
+
Completed 200 OK in 24ms (Views: 23.6ms | ActiveRecord: 0.0ms)
|
214
73
|
|
215
74
|
|
216
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
75
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 09:50:53 +0900
|
217
76
|
Processing by WelcomeController#index as HTML
|
218
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
219
|
-
Completed 200 OK in
|
220
|
-
|
221
|
-
|
222
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:49:31 +0900
|
223
|
-
|
224
|
-
|
225
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:49:31 +0900
|
77
|
+
Rendered welcome/index.html.erb within layouts/application (0.7ms)
|
78
|
+
Completed 200 OK in 24ms (Views: 23.6ms | ActiveRecord: 0.0ms)
|
226
79
|
|
227
80
|
|
228
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
81
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 10:26:22 +0900
|
229
82
|
Processing by WelcomeController#index as HTML
|
230
83
|
Rendered welcome/index.html.erb within layouts/application (0.0ms)
|
231
|
-
Completed 200 OK in
|
232
|
-
|
233
|
-
|
234
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:49:36 +0900
|
235
|
-
|
236
|
-
|
237
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:49:36 +0900
|
238
|
-
|
239
|
-
|
240
|
-
Started GET "/" for 127.0.0.1 at 2013-09-26 00:55:23 +0900
|
241
|
-
Processing by WelcomeController#index as HTML
|
242
|
-
Rendered welcome/index.html.erb within layouts/application (1.5ms)
|
243
|
-
Completed 200 OK in 29ms (Views: 28.6ms | ActiveRecord: 0.0ms)
|
244
|
-
|
245
|
-
|
246
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:55:30 +0900
|
247
|
-
|
248
|
-
|
249
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:55:33 +0900
|
250
|
-
|
251
|
-
|
252
|
-
Started GET "/" for 127.0.0.1 at 2013-09-26 00:55:52 +0900
|
253
|
-
Processing by WelcomeController#index as HTML
|
254
|
-
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
255
|
-
Completed 200 OK in 25ms (Views: 24.5ms | ActiveRecord: 0.0ms)
|
256
|
-
|
257
|
-
|
258
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:55:53 +0900
|
259
|
-
|
260
|
-
|
261
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:55:53 +0900
|
262
|
-
|
263
|
-
|
264
|
-
Started GET "/" for 127.0.0.1 at 2013-09-26 00:56:17 +0900
|
265
|
-
Processing by WelcomeController#index as HTML
|
266
|
-
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
267
|
-
Completed 200 OK in 25ms (Views: 24.4ms | ActiveRecord: 0.0ms)
|
268
|
-
|
269
|
-
|
270
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:56:17 +0900
|
271
|
-
|
272
|
-
|
273
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:56:17 +0900
|
84
|
+
Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)
|
274
85
|
|
275
86
|
|
276
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
87
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 10:32:29 +0900
|
277
88
|
Processing by WelcomeController#index as HTML
|
278
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
279
|
-
Completed 200 OK in 24ms (Views:
|
89
|
+
Rendered welcome/index.html.erb within layouts/application (0.7ms)
|
90
|
+
Completed 200 OK in 24ms (Views: 23.6ms | ActiveRecord: 0.0ms)
|
280
91
|
|
281
92
|
|
282
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-
|
93
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-25 10:32:30 +0900
|
283
94
|
|
284
95
|
|
285
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-
|
286
|
-
Rejected(blacklist): 127.0.0.1
|
287
|
-
Rejected(blacklist): 127.0.0.1
|
288
|
-
Rejected(blacklist): 127.0.0.1
|
289
|
-
Rejected(blacklist): 127.0.0.1
|
96
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-25 10:32:30 +0900
|
290
97
|
|
291
98
|
|
292
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
99
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 10:33:11 +0900
|
293
100
|
Processing by WelcomeController#index as HTML
|
294
101
|
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
295
|
-
Completed 200 OK in
|
296
|
-
|
297
|
-
|
298
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 01:17:52 +0900
|
299
|
-
|
300
|
-
|
301
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 01:17:52 +0900
|
302
|
-
Rejected(whitelist): 127.0.0.1
|
303
|
-
|
304
|
-
|
305
|
-
Started GET "/" for 127.0.0.1 at 2013-09-26 01:20:16 +0900
|
306
|
-
Processing by WelcomeController#index as HTML
|
307
|
-
Rendered welcome/index.html.erb within layouts/application (1.0ms)
|
308
|
-
Completed 200 OK in 25ms (Views: 24.5ms | ActiveRecord: 0.0ms)
|
102
|
+
Completed 200 OK in 24ms (Views: 23.6ms | ActiveRecord: 0.0ms)
|
309
103
|
|
310
104
|
|
311
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-
|
105
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-25 10:33:11 +0900
|
312
106
|
|
313
107
|
|
314
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-
|
108
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-25 10:33:11 +0900
|
data/test/dummy/log/test.log
CHANGED
@@ -1,16 +1,49 @@
|
|
1
|
-
[1m[36m (2.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
2
|
-
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
3
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
4
|
-
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
5
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
6
1
|
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
7
|
-
|
8
|
-
AcceptableTest:
|
9
|
-
|
10
|
-
|
2
|
+
-------------------------------------
|
3
|
+
AcceptableTest: test_should_get_index
|
4
|
+
-------------------------------------
|
5
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
6
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
7
|
+
---------------------------
|
8
|
+
DeflectableTest: test_truth
|
9
|
+
---------------------------
|
10
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
11
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
12
|
+
--------------------------------------------
|
13
|
+
WelcomeControllerTest: test_should_get_index
|
14
|
+
--------------------------------------------
|
11
15
|
Processing by WelcomeController#index as HTML
|
12
16
|
Rendered welcome/index.html.erb within layouts/application (0.7ms)
|
13
|
-
Completed 200 OK in
|
17
|
+
Completed 200 OK in 12ms (Views: 12.1ms | ActiveRecord: 0.0ms)
|
18
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
19
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
20
|
+
-------------------------------------
|
21
|
+
AcceptableTest: test_should_get_index
|
22
|
+
-------------------------------------
|
23
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
24
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
25
|
+
---------------------------
|
26
|
+
DeflectableTest: test_truth
|
27
|
+
---------------------------
|
28
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
29
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
30
|
+
-------------------------------------
|
31
|
+
AcceptableTest: test_should_get_index
|
32
|
+
-------------------------------------
|
33
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
34
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
35
|
+
---------------------------
|
36
|
+
DeflectableTest: test_truth
|
37
|
+
---------------------------
|
38
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
39
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
40
|
+
-------------------------------------
|
41
|
+
AcceptableTest: test_should_get_index
|
42
|
+
-------------------------------------
|
43
|
+
Started GET "/" for 127.0.0.1 at 2013-09-24 23:17:55 +0900
|
44
|
+
Processing by WelcomeController#index as HTML
|
45
|
+
Rendered welcome/index.html.erb within layouts/application (0.9ms)
|
46
|
+
Completed 200 OK in 26ms (Views: 25.5ms | ActiveRecord: 0.0ms)
|
14
47
|
[1m[35m (0.1ms)[0m rollback transaction
|
15
48
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
16
49
|
---------------------------
|
@@ -21,10 +54,10 @@ DeflectableTest: test_truth
|
|
21
54
|
----------------------------------------------------------
|
22
55
|
AcceptableTest: test_should_get_index_when_not_ip_controll
|
23
56
|
----------------------------------------------------------
|
24
|
-
Started GET "/" for 127.0.0.1 at 2013-09-25
|
57
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 18:10:23 +0900
|
25
58
|
Processing by WelcomeController#index as HTML
|
26
|
-
Rendered welcome/index.html.erb within layouts/application (
|
27
|
-
Completed 200 OK in
|
59
|
+
Rendered welcome/index.html.erb within layouts/application (1.1ms)
|
60
|
+
Completed 200 OK in 13ms (Views: 13.1ms | ActiveRecord: 0.0ms)
|
28
61
|
[1m[35m (0.1ms)[0m rollback transaction
|
29
62
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
30
63
|
---------------------------
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deflectable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naohiro Sakuma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -87,8 +87,11 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- lib/deflectable/blacklist.rb
|
91
|
+
- lib/deflectable/filtering.rb
|
90
92
|
- lib/deflectable/version.rb
|
91
93
|
- lib/deflectable/watcher.rb
|
94
|
+
- lib/deflectable/whitelist.rb
|
92
95
|
- lib/deflectable.rb
|
93
96
|
- lib/generators/deflectable/install_generator.rb
|
94
97
|
- lib/generators/deflectable/templates/403.html
|
@@ -113,7 +116,6 @@ files:
|
|
113
116
|
- test/dummy/config/boot.rb
|
114
117
|
- test/dummy/config/database.yml
|
115
118
|
- test/dummy/config/deflect.yml
|
116
|
-
- test/dummy/config/deflectable.yml
|
117
119
|
- test/dummy/config/environment.rb
|
118
120
|
- test/dummy/config/environments/development.rb
|
119
121
|
- test/dummy/config/environments/production.rb
|
@@ -193,7 +195,6 @@ test_files:
|
|
193
195
|
- test/dummy/config/boot.rb
|
194
196
|
- test/dummy/config/database.yml
|
195
197
|
- test/dummy/config/deflect.yml
|
196
|
-
- test/dummy/config/deflectable.yml
|
197
198
|
- test/dummy/config/environment.rb
|
198
199
|
- test/dummy/config/environments/development.rb
|
199
200
|
- test/dummy/config/environments/production.rb
|