rack-geofilter 0.1.1 → 0.1.2
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 +14 -0
- data/lib/rack/geofilter.rb +1 -1
- data/lib/rack/geofilter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1015351888a963bcc82a096c0bb8fedd3a47543a
|
4
|
+
data.tar.gz: e42706c70e079cde9cbc0e5748bc334bc32d26c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60f1fabb4f8c4f48ac2b293ec286b43d87a9d0132bc7d85dc2b530e817b3e3080307baa170b54e00c8db80c231f7a14c59ed5fd2ac716bbf9f603a8e57d27d10
|
7
|
+
data.tar.gz: 786b2ffa8546e018d8d7a941ca595a6206e749b47a29ca18a80e6d021b7035c390d3788c37d7f7bb9f146dc59e42eb730c78c30207aa67a8918c5324fa3be5b5
|
data/README.md
CHANGED
@@ -27,6 +27,20 @@ To use with Rails, add to your ``config/application.rb`` the following line
|
|
27
27
|
config.middleware.insert_before ActionDispatch::RemoteIp, Rack::Geofilter
|
28
28
|
```
|
29
29
|
|
30
|
+
Then setup the environment variable ``BLOCKED_COUNTRIES`` with a comma separated
|
31
|
+
list of the [ISO 3166-1 Alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
|
32
|
+
codes of the countries you want to block, e.g.,
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
BLOCKED_COUNTRIES="UA,RU,JP,KP,KR"
|
36
|
+
```
|
37
|
+
|
38
|
+
This will block the traffic from those countries and return
|
39
|
+
|
40
|
+
```
|
41
|
+
451 Service not available in country of origin
|
42
|
+
```
|
43
|
+
|
30
44
|
## Contributing
|
31
45
|
|
32
46
|
Bug reports and pull requests are welcome on GitHub at https://github.com/alessio-signorini/rack-geofilter.
|
data/lib/rack/geofilter.rb
CHANGED