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 +4 -4
- data/lib/smart_proxy_dynflow/api.rb +9 -3
- data/lib/smart_proxy_dynflow/core.rb +2 -2
- data/lib/smart_proxy_dynflow/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6444ef5fcad649ae35d106b149f2832ea50c4cbbf9d6a1be7575332e9585fe8b
|
4
|
+
data.tar.gz: 587ed9c21c9c0dd3e320e29c28eb3cf76904aa3222c901979fc8e29023630f16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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.
|
32
|
-
"
|
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}"
|
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.
|
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:
|
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.
|
211
|
+
rubygems_version: 3.3.20
|
212
212
|
signing_key:
|
213
213
|
specification_version: 4
|
214
214
|
summary: Dynflow runtime for Foreman smart proxy
|