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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95a409fbccf5e847376b13f8c904902505668d40
4
- data.tar.gz: 8baf21926d3ac8582e3b246176f824672dfde206
3
+ metadata.gz: 4dffad6633b9cc4d3c1d8769c469fb8f22ac9d4e
4
+ data.tar.gz: a27811eaae60988d004642feba8b3c0baed9bfd3
5
5
  SHA512:
6
- metadata.gz: bce7d9e7cd34e9929f94e766ad0d1c7f69df0bc09bb0945de5f8c2e05a8e666299559c131a34655e4233b3f4460a8e4059302b3fab2c1236d066817dc39dba2f
7
- data.tar.gz: 2f2ee5a896e963caf8d880d98d3bc773a6971c26a3ed8b4e7b9aa70e72af6b440ecf2bef75ac3a7e845f596996dba2de30d1c1bfbd415b9f1c56ad91de72bddf
6
+ metadata.gz: ac2d80e5ce30cd91fa06a9d49a09072658a440950d5a50d1fc75959267b154198f14e38d7109b9d8e39218a9e90d582522953dc6550dfa3b619851895b0ea570
7
+ data.tar.gz: f181bb5de480f96d9a0c42d2a7e9f0f826c66eb79bbfa2f0ca336d30afcfc9bc9533312c2c6f4c0d1cab93e76ec198a2a92a3e99f2ba8d70b530f340efa16a5f
@@ -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
- if request.ip == '127.0.0.1' && ENV['RACK_ENV'] == 'production'
197
- ip = request.env['HTTP_X_FORWARDED_FOR']
198
- else
199
- ip = request.ip
200
- end
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
- system = System.where(ip: ip).first
203
- content_type :json
204
- system.config_hash.to_json
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
@@ -1,3 +1,3 @@
1
1
  module Perus
2
- VERSION = "0.1.30"
2
+ VERSION = "0.1.31"
3
3
  end
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.30
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-03-28 00:00:00.000000000 Z
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.4.6
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: