active_elastic_job 3.0.0.alpha → 3.0.0

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: 76f95bc2f952a3d57402a5c41428e02f4662725e2c784d547c75ce8081edbf31
4
- data.tar.gz: 495df5d131344373516e77507461861a72007387adb6dde0a5c8a0274e535bf5
3
+ metadata.gz: 4fa6153074f7ae6a834972d070137734873cafdf2fe4807ead1a838ca9d497cf
4
+ data.tar.gz: e1b5905ce2c23f3d11a795883e8ee7be8be9c60fd391af4c76a2c252b99c6a4a
5
5
  SHA512:
6
- metadata.gz: fb613b8ad89d5b86437bd831b28247e54c3adc54127bdb6264f5ccc0fda7d4d26ffaec5fa5e312e09d042c580e088bb74753601f3b4aa1c68d19505ac3d7f31f
7
- data.tar.gz: 6149c28f1cce197d6722e83ca2927173133aca4b2d2afbb4803ff7b2191c3d314841c4e57c57cb3d7b1a6ea43e889e7029b09ccf5f125379d4d3f26e3340aeda
6
+ metadata.gz: 32dfb859495c2658137eb010c4e58e8be5872e8be54a6e245852157beefb2ce1bf542a350d263b9b493d70ce0a4d5f26d935a14e325f6eabd9c6f75bb2ce5d24
7
+ data.tar.gz: 2a44d66bef9a7903abb96c2d2ca899465cf8cd34ea770eb96cab20ccccffa4ee60360cbca2f7ceba0f9ff31709cc890d37fc219de11beda451df1f9e49016ffe
@@ -47,7 +47,7 @@ module ActiveElasticJob
47
47
  rescue ActiveElasticJob::MessageVerifier::InvalidDigest => e
48
48
  return FORBIDDEN_RESPONSE
49
49
  end
50
- return OK_RESPONSE
50
+ return OK_RESPONSE
51
51
  end
52
52
  end
53
53
  @app.call(env)
@@ -118,11 +118,15 @@ module ActiveElasticJob
118
118
  end
119
119
 
120
120
  def sent_from_docker_host?(request)
121
- app_runs_in_docker_container? && request.remote_ip =~ DOCKER_HOST_IP
121
+ app_runs_in_docker_container? && ip_originates_from_docker?(request)
122
+ end
123
+
124
+ def ip_originates_from_docker?(request)
125
+ (request.remote_ip =~ DOCKER_HOST_IP).present? or (request.remote_addr =~ DOCKER_HOST_IP).present?
122
126
  end
123
127
 
124
128
  def app_runs_in_docker_container?
125
- @app_in_docker_container ||= `[ -f /proc/1/cgroup ] && cat /proc/1/cgroup` =~ /(ecs|docker)/
129
+ (`[ -f /proc/1/cgroup ] && cat /proc/1/cgroup` =~ /(ecs|docker)/).present?
126
130
  end
127
131
  end
128
132
  end
@@ -3,7 +3,7 @@ module ActiveElasticJob
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
5
  TINY = 0
6
- PRE = 'alpha'
6
+ PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_elastic_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.alpha
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tawan Sierek
8
8
  - Joey Paris
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-01-27 00:00:00.000000000 Z
12
+ date: 2021-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk-sqs
@@ -207,7 +207,7 @@ homepage: https://github.com/active-elastic-job/active-elastic-job
207
207
  licenses:
208
208
  - MIT
209
209
  metadata: {}
210
- post_install_message:
210
+ post_install_message:
211
211
  rdoc_options: []
212
212
  require_paths:
213
213
  - lib
@@ -218,12 +218,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
218
218
  version: '2.5'
219
219
  required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  requirements:
221
- - - ">"
221
+ - - ">="
222
222
  - !ruby/object:Gem::Version
223
- version: 1.3.1
223
+ version: '0'
224
224
  requirements: []
225
225
  rubygems_version: 3.1.2
226
- signing_key:
226
+ signing_key:
227
227
  specification_version: 4
228
228
  summary: Active Elastic Job is a simple to use Active Job backend for Rails applications
229
229
  deployed on the Amazon Elastic Beanstalk platform.