infinum_graylog 0.10.0 → 0.11.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81a3c58f41536dccc43cee75b025a0e2467758e07f44a3f72c95bbe3940a9990
|
4
|
+
data.tar.gz: d05c00cc929e217fd76123242a8ade13bb7243a0d91f88dbc512b0d7aa05a3f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ed1ffb3b0ffc883cb41b13cc08a89ca9a8b1b927c785715684bad99cffb700916c5b1963310f161158f3d48c43453c73afe49c3586ef157282e79d7fd13d374
|
7
|
+
data.tar.gz: 7e9a738c6d5ed76ebdd88c239762786c9d7f1bc6881707a3daf18fa10fab058e7b5ca437907fd5b9280a02de22b69c736a7b87e79a21695c53aef7730ea7191f
|
@@ -8,6 +8,15 @@ module InfinumGraylog
|
|
8
8
|
yield(configuration)
|
9
9
|
end
|
10
10
|
|
11
|
+
def self.can_subscribe?
|
12
|
+
return false if configuration.skip_environments.include?(Rails.env)
|
13
|
+
|
14
|
+
tls_configuration = configuration.options[:tls]
|
15
|
+
|
16
|
+
tls_configuration.present? &&
|
17
|
+
File.exist?(tls_configuration['cert']) && File.exist?(tls_configuration['key'])
|
18
|
+
end
|
19
|
+
|
11
20
|
class Configuration
|
12
21
|
attr_accessor :application, :protocol, :level, :options, :host, :port, :skip_environments
|
13
22
|
attr_accessor :skip_statuses, :skippable_sql_actions
|
@@ -6,7 +6,9 @@ module InfinumGraylog
|
|
6
6
|
|
7
7
|
def call(env)
|
8
8
|
request = ActionDispatch::Request.new(env)
|
9
|
-
InfinumGraylog
|
9
|
+
if InfinumGraylog.can_subscribe?
|
10
|
+
InfinumGraylog::Notifier.request_id = request.uuid
|
11
|
+
end
|
10
12
|
@app.call(env)
|
11
13
|
end
|
12
14
|
end
|
@@ -1,8 +1,7 @@
|
|
1
1
|
module InfinumGraylog
|
2
2
|
class Subscriber
|
3
3
|
def self.subscribe
|
4
|
-
return unless
|
5
|
-
return if InfinumGraylog.configuration.skip_environments.include?(Rails.env)
|
4
|
+
return unless InfinumGraylog.can_subscribe?
|
6
5
|
|
7
6
|
puts '[InfinumGraylog] notifications configured'
|
8
7
|
|
@@ -18,12 +17,5 @@ module InfinumGraylog
|
|
18
17
|
|
19
18
|
yield if block_given?
|
20
19
|
end
|
21
|
-
|
22
|
-
def self.tls_and_files_exist?
|
23
|
-
tls_configuration = InfinumGraylog.configuration.options[:tls]
|
24
|
-
|
25
|
-
tls_configuration.present? &&
|
26
|
-
File.exist?(tls_configuration['cert']) && File.exist?(tls_configuration['key'])
|
27
|
-
end
|
28
20
|
end
|
29
21
|
end
|