kubelink 0.1.12 → 1.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/kubelink.gemspec +10 -7
- data/lib/kubelink/sentry.rb +18 -16
- data/lib/kubelink/version.rb +3 -1
- metadata +32 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d24385026aadeedeabd60aff9b7426d9eed13852213bae992c414334d1f4979
|
4
|
+
data.tar.gz: 1bb73d08638086d633c806d0351bb7153045ec032f31a51dcde4fbb1e24a6652
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5a81a7d52ccced7b3923e4ae49deaa8d51fee118de9975b33869df3e860bd8a7defb6c7b52f759a39d4e9e7b83f9e019c672972f7e2c9651f800d05b54d9ecc
|
7
|
+
data.tar.gz: c01c6a54d1703f3b16878b02438a95d8be57cee198b1d42af90d37deab4c13df7baf5d5bc2d1bc309f7f6420b91680af4f359fa9b52f9e895c96ea22605ee63b
|
data/kubelink.gemspec
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require 'kubelink/version'
|
4
6
|
|
@@ -8,7 +10,7 @@ Gem::Specification.new do |s|
|
|
8
10
|
s.author = 'Martino di Filippo'
|
9
11
|
s.email = 'difilippo@shaman.xyz'
|
10
12
|
s.homepage = 'https://git.shaman.xyz/shaman/kubelink'
|
11
|
-
s.summary =
|
13
|
+
s.summary = 'Integrate a Rails app with our Kubernetes environment'
|
12
14
|
s.license = 'MIT'
|
13
15
|
s.metadata = {
|
14
16
|
'source_code_uri' => 'https://git.shaman.xyz/shaman/kubelink/tree/master'
|
@@ -16,18 +18,19 @@ Gem::Specification.new do |s|
|
|
16
18
|
|
17
19
|
s.required_ruby_version = '>= 2.3.0'
|
18
20
|
|
19
|
-
s.files = Dir.chdir(File.expand_path(
|
21
|
+
s.files = Dir.chdir(File.expand_path(__dir__)) do
|
20
22
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
23
|
end
|
22
24
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
25
|
s.require_paths = ['lib']
|
24
26
|
|
25
27
|
s.add_dependency 'activesupport', '>= 5.1', '< 7'
|
26
|
-
s.add_dependency 'lograge', '~> 0.11.
|
27
|
-
s.add_dependency 'prometheus_exporter', '~> 0.
|
28
|
+
s.add_dependency 'lograge', '~> 0.11.2'
|
29
|
+
s.add_dependency 'prometheus_exporter', '~> 0.7.0'
|
28
30
|
s.add_dependency 'rails', '>= 5.1', '< 7'
|
29
|
-
s.add_dependency 'sentry-
|
31
|
+
s.add_dependency 'sentry-rails', '~> 4.5.1'
|
32
|
+
s.add_dependency 'sentry-ruby', '~> 4.5.1'
|
30
33
|
|
31
|
-
s.add_development_dependency 'bundler', '~> 2.
|
34
|
+
s.add_development_dependency 'bundler', '~> 2.2'
|
32
35
|
s.add_development_dependency 'rake', '~> 12.3'
|
33
36
|
end
|
data/lib/kubelink/sentry.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Kubelink
|
2
4
|
class Sentry < Rails::Railtie
|
3
5
|
def self.sentry_dsn
|
@@ -5,29 +7,30 @@ module Kubelink
|
|
5
7
|
u = URI.parse(ENV['SENTRY_DSN'])
|
6
8
|
u.password = nil
|
7
9
|
u.to_s
|
8
|
-
rescue
|
10
|
+
rescue StandardError
|
9
11
|
nil
|
10
12
|
end
|
11
13
|
end
|
12
14
|
|
13
|
-
initializer
|
15
|
+
initializer 'kubelink.sentry_integration' do
|
14
16
|
ActiveSupport.on_load :action_view do
|
15
17
|
include Helpers
|
16
18
|
end
|
17
19
|
|
18
20
|
if Sentry.sentry_dsn
|
19
|
-
|
20
|
-
|
21
|
-
Raven.configure do |config|
|
21
|
+
Sentry.init do |config|
|
22
|
+
config.breadcrumbs_logger = [:active_support_logger]
|
22
23
|
config.dsn = Sentry.sentry_dsn
|
23
24
|
config.release = ENV['RAILS_COMMIT'] if ENV.key?('RAILS_COMMIT')
|
25
|
+
config.send_default_pii = true
|
26
|
+
config.traces_sample_rate = 1.0
|
24
27
|
end
|
25
28
|
|
26
29
|
ActiveSupport.on_load :action_controller do
|
27
30
|
include Controller
|
28
31
|
end
|
29
32
|
elsif Rails.env.production? && !defined?(Rake)
|
30
|
-
throw
|
33
|
+
throw 'This application cannot run in production without setting SENTRY_DSN'
|
31
34
|
end
|
32
35
|
end
|
33
36
|
|
@@ -35,13 +38,12 @@ module Kubelink
|
|
35
38
|
def sentry_include_tag
|
36
39
|
return unless Sentry.sentry_dsn.present?
|
37
40
|
|
38
|
-
script = 'https://browser.sentry-cdn.com/5.
|
41
|
+
script = 'https://browser.sentry-cdn.com/5.11.0/bundle.min.js'
|
39
42
|
|
40
|
-
[
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
].join("\n").html_safe
|
43
|
+
[javascript_include_tag(script, crossorigin: :anonymous),
|
44
|
+
javascript_tag(nonce: true) do
|
45
|
+
%{Sentry.init({ dsn: "#{Sentry.sentry_dsn}" });}.html_safe
|
46
|
+
end].join("\n").html_safe
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
@@ -49,12 +51,12 @@ module Kubelink
|
|
49
51
|
extend ActiveSupport::Concern
|
50
52
|
|
51
53
|
included do
|
52
|
-
before_action :
|
54
|
+
before_action :set_sentry_context
|
53
55
|
end
|
54
56
|
|
55
|
-
def
|
56
|
-
|
57
|
-
|
57
|
+
def set_sentry_context
|
58
|
+
Sentry.set_extras(params: params.dup.permit!.to_hash, url: request.url)
|
59
|
+
Sentry.set_user(ip_address: request.remote_ip)
|
58
60
|
end
|
59
61
|
end
|
60
62
|
end
|
data/lib/kubelink/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kubelink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 1.0.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martino di Filippo
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -36,28 +36,28 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.11.
|
39
|
+
version: 0.11.2
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.11.
|
46
|
+
version: 0.11.2
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: prometheus_exporter
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.
|
53
|
+
version: 0.7.0
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
60
|
+
version: 0.7.0
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rails
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,33 +79,47 @@ dependencies:
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '7'
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
|
-
name: sentry-
|
82
|
+
name: sentry-rails
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version:
|
87
|
+
version: 4.5.1
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
92
|
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
94
|
+
version: 4.5.1
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: sentry-ruby
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - "~>"
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 4.5.1
|
102
|
+
type: :runtime
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - "~>"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: 4.5.1
|
95
109
|
- !ruby/object:Gem::Dependency
|
96
110
|
name: bundler
|
97
111
|
requirement: !ruby/object:Gem::Requirement
|
98
112
|
requirements:
|
99
113
|
- - "~>"
|
100
114
|
- !ruby/object:Gem::Version
|
101
|
-
version: 2.
|
115
|
+
version: '2.2'
|
102
116
|
type: :development
|
103
117
|
prerelease: false
|
104
118
|
version_requirements: !ruby/object:Gem::Requirement
|
105
119
|
requirements:
|
106
120
|
- - "~>"
|
107
121
|
- !ruby/object:Gem::Version
|
108
|
-
version: 2.
|
122
|
+
version: '2.2'
|
109
123
|
- !ruby/object:Gem::Dependency
|
110
124
|
name: rake
|
111
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,7 +134,7 @@ dependencies:
|
|
120
134
|
- - "~>"
|
121
135
|
- !ruby/object:Gem::Version
|
122
136
|
version: '12.3'
|
123
|
-
description:
|
137
|
+
description:
|
124
138
|
email: difilippo@shaman.xyz
|
125
139
|
executables: []
|
126
140
|
extensions: []
|
@@ -147,7 +161,7 @@ licenses:
|
|
147
161
|
- MIT
|
148
162
|
metadata:
|
149
163
|
source_code_uri: https://git.shaman.xyz/shaman/kubelink/tree/master
|
150
|
-
post_install_message:
|
164
|
+
post_install_message:
|
151
165
|
rdoc_options: []
|
152
166
|
require_paths:
|
153
167
|
- lib
|
@@ -158,12 +172,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
158
172
|
version: 2.3.0
|
159
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
174
|
requirements:
|
161
|
-
- - "
|
175
|
+
- - ">"
|
162
176
|
- !ruby/object:Gem::Version
|
163
|
-
version:
|
177
|
+
version: 1.3.1
|
164
178
|
requirements: []
|
165
|
-
rubygems_version: 3.
|
166
|
-
signing_key:
|
179
|
+
rubygems_version: 3.2.15
|
180
|
+
signing_key:
|
167
181
|
specification_version: 4
|
168
182
|
summary: Integrate a Rails app with our Kubernetes environment
|
169
183
|
test_files: []
|