perus 0.1.30 → 0.1.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/perus/server/app.rb +14 -8
- data/lib/perus/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dffad6633b9cc4d3c1d8769c469fb8f22ac9d4e
|
4
|
+
data.tar.gz: a27811eaae60988d004642feba8b3c0baed9bfd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac2d80e5ce30cd91fa06a9d49a09072658a440950d5a50d1fc75959267b154198f14e38d7109b9d8e39218a9e90d582522953dc6550dfa3b619851895b0ea570
|
7
|
+
data.tar.gz: f181bb5de480f96d9a0c42d2a7e9f0f826c66eb79bbfa2f0ca336d30afcfc9bc9533312c2c6f4c0d1cab93e76ec198a2a92a3e99f2ba8d70b530f340efa16a5f
|
data/lib/perus/server/app.rb
CHANGED
@@ -193,15 +193,21 @@ module Perus::Server
|
|
193
193
|
|
194
194
|
# config of system based on request ip
|
195
195
|
get '/systems/config_for_ip' do
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
196
|
+
ip = nil
|
197
|
+
begin
|
198
|
+
if request.ip == '127.0.0.1' && ENV['RACK_ENV'] == 'production'
|
199
|
+
ip = request.env['HTTP_X_FORWARDED_FOR']
|
200
|
+
else
|
201
|
+
ip = request.ip
|
202
|
+
end
|
201
203
|
|
202
|
-
|
203
|
-
|
204
|
-
|
204
|
+
system = System.where(ip: ip).first
|
205
|
+
content_type :json
|
206
|
+
system.config_hash.to_json
|
207
|
+
rescue => e
|
208
|
+
puts "\nNo config for: #{ip}\n"
|
209
|
+
raise e
|
210
|
+
end
|
205
211
|
end
|
206
212
|
|
207
213
|
# render all errors in html to replace the shortened subset on the system page
|
data/lib/perus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Will Cannings
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -333,9 +333,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
333
333
|
version: '0'
|
334
334
|
requirements: []
|
335
335
|
rubyforge_project:
|
336
|
-
rubygems_version: 2.
|
336
|
+
rubygems_version: 2.5.1
|
337
337
|
signing_key:
|
338
338
|
specification_version: 4
|
339
339
|
summary: Simple system overview server
|
340
340
|
test_files: []
|
341
|
-
has_rdoc:
|