rollbar 2.16.0 → 2.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/CHANGELOG.md +4 -0
- data/README.md +14 -1184
- data/gemfiles/rails30.gemfile +3 -0
- data/gemfiles/rails31.gemfile +3 -0
- data/gemfiles/rails32.gemfile +3 -0
- data/gemfiles/rails40.gemfile +4 -1
- data/gemfiles/rails41.gemfile +3 -0
- data/gemfiles/rails42.gemfile +3 -0
- data/gemfiles/rails50.gemfile +3 -0
- data/gemfiles/rails51.gemfile +3 -0
- data/lib/rollbar/request_data_extractor.rb +2 -0
- data/lib/rollbar/tasks/rollbar.cap +4 -37
- data/lib/rollbar/version.rb +1 -1
- data/spec/rollbar/request_data_extractor_spec.rb +6 -0
- metadata +3 -3
data/gemfiles/rails30.gemfile
CHANGED
data/gemfiles/rails31.gemfile
CHANGED
data/gemfiles/rails32.gemfile
CHANGED
data/gemfiles/rails40.gemfile
CHANGED
data/gemfiles/rails41.gemfile
CHANGED
data/gemfiles/rails42.gemfile
CHANGED
data/gemfiles/rails50.gemfile
CHANGED
data/gemfiles/rails51.gemfile
CHANGED
@@ -103,6 +103,8 @@ module Rollbar
|
|
103
103
|
{}
|
104
104
|
elsif sensitive_headers_list.include?(name)
|
105
105
|
{ name => Rollbar::Scrubbers.scrub_value(env[header]) }
|
106
|
+
elsif name == 'X-Forwarded-For' && !Rollbar.configuration.collect_user_ip
|
107
|
+
{}
|
106
108
|
else
|
107
109
|
{ name => env[header] }
|
108
110
|
end
|
@@ -14,58 +14,25 @@ namespace :rollbar do
|
|
14
14
|
:local_username => fetch(:rollbar_user),
|
15
15
|
:access_token => fetch(:rollbar_token),
|
16
16
|
:environment => fetch(:rollbar_env),
|
17
|
-
:revision => fetch(:rollbar_revision)
|
17
|
+
:revision => fetch(:rollbar_revision),
|
18
|
+
:comment => fetch(:rollbar_comment),
|
19
|
+
}
|
18
20
|
|
19
21
|
debug "Building Rollbar POST to #{uri} with #{params.inspect}"
|
20
22
|
|
21
23
|
request = Net::HTTP::Post.new(uri.request_uri)
|
22
24
|
request.body = ::JSON.dump(params)
|
23
25
|
|
24
|
-
Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http|
|
26
|
+
Net::HTTP.start(uri.host, uri.port, :ENV, :use_ssl => true) do |http|
|
25
27
|
http.request(request)
|
26
28
|
end
|
27
29
|
|
28
30
|
info 'Rollbar notification complete.'
|
29
31
|
end
|
30
32
|
end
|
31
|
-
|
32
|
-
desc 'Upload sourcemaps to Rollbar.'
|
33
|
-
task :sourcemap do
|
34
|
-
on primary fetch(:rollbar_role) do
|
35
|
-
info "Uploading source maps"
|
36
|
-
warn("You need to upgrade capistrano to '>= 3.1' version in order to correctly upload sourcemaps to Rollbar. (On 3.0, the reported revision will be incorrect.)") if Capistrano::VERSION =~ /^3\.0/
|
37
|
-
url_base = fetch(:rollbar_sourcemaps_minified_url_base)
|
38
|
-
unless url_base
|
39
|
-
warn "No #{rollbar_sourcemaps_minified_url_base} was specified. Sourcemaps won't be uploaded."
|
40
|
-
return
|
41
|
-
end
|
42
|
-
url_base = "http://#{url_base}" unless url_base.index(/https?:\/\//)
|
43
|
-
within release_path do
|
44
|
-
within 'public' do
|
45
|
-
source_maps = capture(:find, '-L', '.', '-name', "'*.js.map'").split("\n")
|
46
|
-
source_maps = source_maps.map { |file| file.gsub(/^\.\//, '') }
|
47
|
-
source_maps.each do |source_map|
|
48
|
-
minified_url = File.join(url_base, source_map)
|
49
|
-
args = *%W(--silent https://api.rollbar.com/api/1/sourcemap -F access_token=#{fetch(:rollbar_token)} -F version=#{fetch(:rollbar_revision)} -F minified_url=#{minified_url} -F source_map=@./#{source_map})
|
50
|
-
info "curl #{args.join(' ')}" # log the command, since capture doesn't output anything
|
51
|
-
api_response_body = capture(:curl, args)
|
52
|
-
begin
|
53
|
-
api_response_json = JSON.parse(api_response_body)
|
54
|
-
if api_response_json["err"] != 0
|
55
|
-
warn "Error uploading sourcemaps: #{api_response_json["message"] || 'Unknown Error'}"
|
56
|
-
end
|
57
|
-
rescue JSON::ParserError => e
|
58
|
-
warn "Error parsing response: #{e.message}. Response body: #{api_response_body}"
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
33
|
end
|
66
34
|
|
67
35
|
namespace :deploy do
|
68
|
-
after 'deploy:compile_assets', 'rollbar:sourcemap'
|
69
36
|
after 'deploy:finished', 'rollbar:deploy'
|
70
37
|
end
|
71
38
|
|
data/lib/rollbar/version.rb
CHANGED
@@ -149,6 +149,12 @@ describe Rollbar::RequestDataExtractor do
|
|
149
149
|
|
150
150
|
expect(result[:user_ip]).to be_nil
|
151
151
|
end
|
152
|
+
|
153
|
+
it 'does not extract user\'s IP on X-Forwarded-For header' do
|
154
|
+
result = subject.extract_request_data_from_rack(env)
|
155
|
+
|
156
|
+
expect(result[:headers]['X-Forwarded-For']).to be_nil
|
157
|
+
end
|
152
158
|
end
|
153
159
|
|
154
160
|
context 'with anonymize_user_ip configuration option enabled' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.16.
|
4
|
+
version: 2.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rollbar, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -284,7 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
284
284
|
version: '0'
|
285
285
|
requirements: []
|
286
286
|
rubyforge_project:
|
287
|
-
rubygems_version: 2.
|
287
|
+
rubygems_version: 2.6.10
|
288
288
|
signing_key:
|
289
289
|
specification_version: 4
|
290
290
|
summary: Reports exceptions to Rollbar
|