rack-dedos 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35a9da808f1fbf56cdf83862a982771065b0630bbec3b4bc4b45ee787f4b57cd
4
- data.tar.gz: 858380d7644f92d28f15ead5c41cb796118fbf0977bad9e19375a3b45befcbec
3
+ metadata.gz: 44d58ef342f579aa4245e7e3f8dd41b505f576331c6bb5f65d4c7b6e5e07e74f
4
+ data.tar.gz: 6b63cf01106e9f09d2fea0daee7691b0d263fcdc48e4c7b44bcf04144c4468b4
5
5
  SHA512:
6
- metadata.gz: 84ce070ddd54d01491e0c6437cc25514a6ff495fc6dfb4fcae2d42729c0619183c78cb20b53bee033d3abe62749c865be903c941976559b14f17d82752979f44
7
- data.tar.gz: 220d0ac5538ca7dde09826f03b231d7e6bb7830d59dad0efa29a54fae6124acec991d8b0a68a5c384f43af81cf3cdc279918bd3ab6bca2308ba55029a7487944
6
+ metadata.gz: cb872c5c6d1a339bbf62220fdd1c179349ed28d266d291fdca4013527039e5290539a5e60adee88c570e87de0b04a93ac808a99103f5faeda4d5616acaf88995
7
+ data.tar.gz: eedf962195f3eacea34330bfc4b158263ee15d57684a18f6bd48aa26a78e49e92fa73fcb96ec043e18e1b96dfcfbd586c5117cd805b8c3b96e2f3b52d14982e0
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  Nothing so far
4
4
 
5
+ ## 0.2.1
6
+
7
+ #### Fixes
8
+
9
+ * Fix paths on conditional requires
10
+ * Renew certificate
11
+
5
12
  ## 0.2.0
6
13
 
7
14
  #### Changes
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  [![Version](https://img.shields.io/gem/v/rack-dedos.svg?style=flat)](https://rubygems.org/gems/rack-dedos)
2
2
  [![Tests](https://img.shields.io/github/actions/workflow/status/svoop/rack-dedos/test.yml?style=flat&label=tests)](https://github.com/svoop/rack-dedos/actions?workflow=Test)
3
3
  [![Code Climate](https://img.shields.io/codeclimate/maintainability/svoop/rack-dedos.svg?style=flat)](https://codeclimate.com/github/svoop/rack-dedos/)
4
- [![Donorbox](https://img.shields.io/badge/donate-on_donorbox-yellow.svg)](https://donorbox.org/bitcetera)
4
+ [![GitHub Sponsors](https://img.shields.io/github/sponsors/svoop.svg)](https://github.com/sponsors/svoop)
5
5
 
6
6
  <img src="https://github.com/svoop/rack-dedos/raw/main/doc/chop-chop.png" alt="chop-chop" align="right">
7
7
 
@@ -15,6 +15,8 @@ The filters have been proven to work against certain DoS attacks, however, they
15
15
  * [API](https://www.rubydoc.info/gems/rack-dedos)
16
16
  * Author: [Sven Schwyn - Bitcetera](https://bitcetera.com)
17
17
 
18
+ Thank you for supporting free and open-source software by sponsoring on [GitHub](https://github.com/sponsors/svoop) or on [Donorbox](https://donorbox.com/bitcetera). Any gesture is appreciated, from a single Euro for a ☕️ cup of coffee to 🍹 early retirement.
19
+
18
20
  ## Install
19
21
 
20
22
  ### Security
@@ -141,7 +143,7 @@ tar -xz -C /tmp -f /tmp/geoipupdate.tgz
141
143
 
142
144
  A word on how the real client IP is determined. Both Rack 2 and Rack 3 (up to 3.0.7 at the time of writing) may populate the request `ip` incorrectly. Here's what a minimalistic Rack app deloyed to Render (behind Cloudflare) reports:
143
145
 
144
- > request.ip = 172.71.135.17
146
+ > request.ip = 172.71.135.17<br>
145
147
  > request.forwarded_for = ["81.XXX.XXX.XXX", "172.71.135.17", "10.201.229.136"]
146
148
 
147
149
  Obviously, the reported IP 172.71.135.17 is not the real client IP, the correct one is the (redacted) 81.XXX.XXX.XXX.
@@ -39,17 +39,16 @@ module Rack
39
39
 
40
40
  # Get the real IP of the client
41
41
  #
42
- # If a proxy such as Cloudflare is in the mix, the client IP reported
43
- # by Rack may be wrong. Therefore, we determine the real client IP
44
- # using the following priorities:
42
+ # If containers and/or proxies such as Cloudflare are in the mix, the
43
+ # client IP reported by Rack may be wrong. Therefore, we determine the
44
+ # real client IP using the following priorities:
45
45
  #
46
46
  # 1. Cf-Connecting-Ip header
47
47
  # 2. X-Forwarded-For header (also remove port number)
48
48
  # 3. IP reported by Rack
49
49
  #
50
50
  # @param request [Rack::Request]
51
- # @return [String, nil] real client IP or +nil+ if X-Forwarded-For is
52
- # not set
51
+ # @return [String] real client IP
53
52
  def real_ip(request)
54
53
  case
55
54
  when ip = request.get_header('HTTP_CF_CONNECTING_IP')
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rack
4
4
  module Dedos
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
data/lib/rack/dedos.rb CHANGED
@@ -20,11 +20,11 @@ module Rack
20
20
 
21
21
  Rack::Builder.new do
22
22
  unless except.include? :user_agent
23
- require_relative 'dedos/filter/user_agent'
23
+ require_relative 'dedos/filters/user_agent'
24
24
  use(::Rack::Dedos::Filters::UserAgent, options)
25
25
  end
26
26
  unless except.include? :country
27
- require_relative 'dedos/filter/country'
27
+ require_relative 'dedos/filters/country'
28
28
  use(::Rack::Dedos::Filters::Country, options)
29
29
  end
30
30
  run app
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-dedos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn
@@ -11,8 +11,8 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDODCCAiCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhydWJ5
14
- L0RDPWJpdGNldGVyYS9EQz1jb20wHhcNMjIxMTA2MTIzNjUwWhcNMjMxMTA2MTIz
15
- NjUwWjAjMSEwHwYDVQQDDBhydWJ5L0RDPWJpdGNldGVyYS9EQz1jb20wggEiMA0G
14
+ L0RDPWJpdGNldGVyYS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/ML37isgvwGiQxovDUqu6Sq14cQ1qE9y5prUBmL2AsDuCBpXXctcvamFqNC
26
+ PgfJtj7ZZcXmY0SfKCog7T1btkr6zYxPXpxwUqB45n0I6v5qc0UCNvMEfBzxlak5
27
+ VW7UMNlKD9qukeN55hxuLF2F/sLldMcHUo/ATgdV4zk1t3sK6A9+02wz5K5qfWdM
28
+ Mi+XWXmGd57uojk3RcIXNwBRRP4DTKcKgVXhuyHb7q1vjTXrS6bw1Ortu0KmWOIk
29
+ jTyRsT1gymASS2KHe+BaCTwD74GqO8q4woYLZgXnJ/PvgcFgY2FEi2Kn/sXLp4JE
30
+ boIgxQCMT+nxBHCD
31
31
  -----END CERTIFICATE-----
32
- date: 2023-05-16 00:00:00.000000000 Z
32
+ date: 2024-11-20 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rack
@@ -116,7 +116,7 @@ dependencies:
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  - !ruby/object:Gem::Dependency
119
- name: minitest-sound
119
+ name: minitest-flash
120
120
  requirement: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
@@ -243,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
243
  - !ruby/object:Gem::Version
244
244
  version: '0'
245
245
  requirements: []
246
- rubygems_version: 3.4.13
246
+ rubygems_version: 3.5.23
247
247
  signing_key:
248
248
  specification_version: 4
249
249
  summary: Radical filters to block denial-of-service (DoS) requests.
metadata.gz.sig CHANGED
Binary file