railwatch-server 0.1.0 → 0.1.1
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 +4 -4
- data/README.md +2 -2
- data/lib/puma/plugin/railwatch_server.rb +2 -2
- data/lib/railwatch/server/engine.rb +1 -1
- data/lib/railwatch/server/version.rb +1 -1
- data/lib/railwatch/server.rb +1 -2
- data/lib/tasks/railwatch_server.rake +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e651284295ca9016d2e1c0218e92d224430acbcb4c847bad674dbb336531e882
|
|
4
|
+
data.tar.gz: c01f2df53659f822c3c9b780009d83f3a389e6d5a9e5ac3059b2dd5090197247
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a3d50dae823218dbaf5d6e52ae3c316fb319f0df9265a3c3acc00f06c66ce85d3910a427f3908acb8ed161fd86bd4ceb327ddca47480374ade280a63ace66fc
|
|
7
|
+
data.tar.gz: b785c6fd878a25a37e70b881b6549819be9dce826cbc44107680d98bb6ca105f2ca8ba9f22b2ef03dd582e2bda4601db582f43b59e7be558744c87816339daec
|
data/README.md
CHANGED
|
@@ -125,8 +125,8 @@ half-applied. `railwatch doctor` with `RAILWATCH_ENV_FILE` pointed at the
|
|
|
125
125
|
file shows what the server reads.
|
|
126
126
|
|
|
127
127
|
The agent is wired only when the app has not configured a destination:
|
|
128
|
-
when `RAILWATCH_TOKEN` is set,
|
|
129
|
-
|
|
128
|
+
when `RAILWATCH_TOKEN` is set, it is left alone and the bundled server
|
|
129
|
+
serves only the dashboard.
|
|
130
130
|
|
|
131
131
|
**Who the server sees.** The dashboard's gate is the `railwatch` gem's:
|
|
132
132
|
HTTP Basic, on and closed by default; or, with Basic off,
|
|
@@ -88,8 +88,8 @@ Puma::Plugin.create do
|
|
|
88
88
|
# gone. Each stop! is idempotent; the gem's own at_exit then does nothing.
|
|
89
89
|
def shutdown
|
|
90
90
|
@shutting_down = true
|
|
91
|
-
if defined?(::Railwatch) && ::Railwatch.respond_to?(:enabled?) && ::Railwatch.enabled?
|
|
92
|
-
[ "Health", "Sessions"
|
|
91
|
+
if defined?(::Railwatch) && ::Railwatch.respond_to?(:enabled?) && ::Railwatch.enabled?
|
|
92
|
+
[ "Health", "Sessions" ].each do |name|
|
|
93
93
|
mod = ::Railwatch.const_get(name) if ::Railwatch.const_defined?(name)
|
|
94
94
|
mod.stop! if mod.respond_to?(:stop!)
|
|
95
95
|
end
|
|
@@ -45,7 +45,7 @@ module Railwatch
|
|
|
45
45
|
"the server's process creates it the first time it starts (Puma with `plugin :railwatch_server`, or " \
|
|
46
46
|
"railwatch_server:start); this process reports once it restarts after that")
|
|
47
47
|
when :configured_elsewhere
|
|
48
|
-
Rails.logger.info("[railwatch-server] the railwatch agent is configured elsewhere (RAILWATCH_TOKEN
|
|
48
|
+
Rails.logger.info("[railwatch-server] the railwatch agent is configured elsewhere (RAILWATCH_TOKEN); " \
|
|
49
49
|
"the bundled server only serves the dashboard")
|
|
50
50
|
end
|
|
51
51
|
rescue Railwatch::Server::Error, Railwatch::Server::Binary::NotFound => e
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Railwatch
|
|
4
4
|
module Server
|
|
5
|
-
VERSION = "0.1.
|
|
5
|
+
VERSION = "0.1.1"
|
|
6
6
|
# The published railwatch-rs commit the bundled binaries are built from
|
|
7
7
|
# (README, "The server side"); the Corresponding Source under AGPL-3.0.
|
|
8
8
|
RAILWATCH_RS = "d4c842c2f02e1cd56aeedb1e9ad1403313f0aed8"
|
data/lib/railwatch/server.rb
CHANGED
|
@@ -41,9 +41,8 @@ module Railwatch
|
|
|
41
41
|
|
|
42
42
|
# Whether the app reports somewhere of its own choosing, in which case
|
|
43
43
|
# the agent is left alone: a token set (RAILWATCH_TOKEN or the
|
|
44
|
-
# initializer)
|
|
44
|
+
# initializer).
|
|
45
45
|
def agent_configured_elsewhere?
|
|
46
|
-
return true if Railwatch.config.local?
|
|
47
46
|
return false if Railwatch.config.ingest_url == config.local_url
|
|
48
47
|
|
|
49
48
|
Railwatch.config.token.to_s.strip != ""
|
|
@@ -25,7 +25,7 @@ namespace :railwatch_server do
|
|
|
25
25
|
puts "data dir #{dir.path}#{' (not provisioned)' unless dir.provisioned?}"
|
|
26
26
|
puts "server #{up ? 'UP' : 'DOWN'} on #{config.local_url}#{" (pid #{pid.read.split.first})" if pid.exist?}"
|
|
27
27
|
puts "dashboard #{config.normalized_mount_path}"
|
|
28
|
-
puts "agent " + (Railwatch::Server.agent_configured_elsewhere? ? "configured elsewhere (#{Railwatch.config.
|
|
28
|
+
puts "agent " + (Railwatch::Server.agent_configured_elsewhere? ? "configured elsewhere (#{Railwatch.config.ingest_url})" :
|
|
29
29
|
"reports to #{Railwatch.config.ingest_url}")
|
|
30
30
|
puts "log #{dir.log_file}"
|
|
31
31
|
exit(up ? 0 : 1)
|