smart_proxy_dynflow 0.8.1 → 0.8.2

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: 0c9cd93e1cf950c5f7977d700a2d8b307faa98182af93063c55ced580617d054
4
- data.tar.gz: 2de7767e855c5914d6db7678ef2c2302c414a20b04cb6dd4df7294263ee00f95
3
+ metadata.gz: 6444ef5fcad649ae35d106b149f2832ea50c4cbbf9d6a1be7575332e9585fe8b
4
+ data.tar.gz: 587ed9c21c9c0dd3e320e29c28eb3cf76904aa3222c901979fc8e29023630f16
5
5
  SHA512:
6
- metadata.gz: b03995ac1c1bf44c900926371d3b42c56f05dc8b994fb07f3c87613e788a990e9ec597d67bb24a97279ae4bc0557fca01dabfbaace26299553467f8173ff8f73
7
- data.tar.gz: 0d4737d0298d940988c51ba62e04c45740530660ae76c492e706459965446e984f2ddeb319651a416864636dca407d4f281029bb75da9ad747da7f6b6d71ee42
6
+ metadata.gz: 4b27f6de4ae4353b6fdb45334b920b66bea2de0dce26af6c4f52855e9e28641acd9ec917e8d313b8aafb9c70f7077fa9223417d943e9ac2a30d6c05995d66e0a
7
+ data.tar.gz: e0877874c73541ab78d2957693202959bbffce5771ff71c9f1bee0664c5f78bf180addece3668206662e70cf08481d3586ff88f82eef3fc293d9a837ccfca75d
@@ -36,7 +36,8 @@ module Proxy
36
36
 
37
37
  post "/tasks/launch/?" do
38
38
  params = MultiJson.load(request.body.read)
39
- launcher = launcher_class(params).new(world, callback_host(params, request), params.fetch('options', {}))
39
+ first_params = params['input']&.values&.first || {}
40
+ launcher = launcher_class(params).new(world, callback_host(first_params, request), params.fetch('options', {}))
40
41
  launcher.launch!(params['input'])
41
42
  launcher.results.to_json
42
43
  end
@@ -72,8 +73,13 @@ module Proxy
72
73
  private
73
74
 
74
75
  def callback_host(params, request)
75
- params.fetch('action_input', {})['proxy_url'] ||
76
- request.env.values_at('HTTP_X_FORWARDED_FOR', 'HTTP_HOST').compact.first
76
+ params.fetch('action_input', {})['proxy_url'] || callback_host_from_env(request)
77
+ end
78
+
79
+ def callback_host_from_env(request)
80
+ protocol = %w[yes on 1].include?(request.env['HTTPS'].to_s) ? 'https' : 'http'
81
+ host = request.env.values_at('HTTP_X_FORWARDED_FOR', 'HTTP_HOST').compact.first
82
+ "#{protocol}://#{host}"
77
83
  end
78
84
 
79
85
  def launcher_class(params)
@@ -28,8 +28,8 @@ module Proxy::Dynflow
28
28
 
29
29
  db_file = Settings.instance.database
30
30
  if db_file.nil? || db_file.empty?
31
- Log.instance.warn "Could not open DB for dynflow at '#{db_file}', " \
32
- "will keep data in memory. Restart will drop all dynflow data."
31
+ Log.instance.info "Using in-memory database (default behaviour). Restart will drop all dynflow data. " \
32
+ "To change this behaviour configure setting 'database'."
33
33
  else
34
34
  FileUtils.mkdir_p(File.dirname(db_file))
35
35
  db_conn_string += "/#{db_file}"
@@ -1,5 +1,5 @@
1
1
  module Proxy
2
2
  module Dynflow
3
- VERSION = '0.8.1'.freeze
3
+ VERSION = '0.8.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_dynflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 1980-01-01 00:00:00.000000000 Z
11
+ date: 2022-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynflow
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  requirements: []
211
- rubygems_version: 3.2.26
211
+ rubygems_version: 3.3.20
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: Dynflow runtime for Foreman smart proxy