falcon 0.47.10 → 0.48.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/falcon/command/virtual.rb +2 -1
- data/lib/falcon/middleware/proxy.rb +14 -1
- data/lib/falcon/proxy_endpoint.rb +2 -2
- data/lib/falcon/service/virtual.rb +15 -6
- data/lib/falcon/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +24 -16
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4305e4b3c191643bd6ee8dfc2f02e8f5c30b0fb7c60bb61bee5675c983e3e98b
|
4
|
+
data.tar.gz: 7c8c86e7557bbff0d29ca83af877b36a12e0db86c2a2bf5e01cd2df88b35ad82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6de22e4f8048e1632e8c37eab7727623c62f4a47838fee3da284bd0bb2c050e51019943b109805ccc9e23cada977449dc2fcb04a6bf6d1c18c354366bc204fc
|
7
|
+
data.tar.gz: 1a6f70ac00514ee5a6a110ec2013dc494077f84d5fa257cbdab11394301c4f857ca49bb4236051d4d3090360fab18809b2b2e6fde9b8a9cbc1d78efd01e0fb87
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -69,11 +69,12 @@ module Falcon
|
|
69
69
|
end
|
70
70
|
|
71
71
|
# An endpoint suitable for connecting to the specified hostname.
|
72
|
-
def host_endpoint(hostname, **options)
|
72
|
+
def host_endpoint(hostname, path: "/", **options)
|
73
73
|
endpoint = secure_endpoint(**options)
|
74
74
|
|
75
75
|
url = URI.parse(@options[:bind_secure])
|
76
76
|
url.hostname = hostname
|
77
|
+
url.path = path
|
77
78
|
|
78
79
|
return Async::HTTP::Endpoint.new(url, hostname: endpoint.hostname)
|
79
80
|
end
|
@@ -150,7 +150,20 @@ module Falcon
|
|
150
150
|
|
151
151
|
Traces::Provider(self) do
|
152
152
|
def call(request)
|
153
|
-
|
153
|
+
attributes = {
|
154
|
+
authority: request.authority,
|
155
|
+
}
|
156
|
+
|
157
|
+
if host = lookup(request)
|
158
|
+
attributes[:endpoint] = host.endpoint.inspect
|
159
|
+
|
160
|
+
if client = @clients[host.endpoint]
|
161
|
+
attributes[:client] = client.as_json
|
162
|
+
attributes[:pool] = client.pool.as_json
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
Traces.trace('falcon.middleware.proxy.call', attributes: attributes) do
|
154
167
|
super
|
155
168
|
end
|
156
169
|
end
|
@@ -17,7 +17,7 @@ module Falcon
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def to_s
|
20
|
-
"\#<#{self.class} endpoint=#{@endpoint}>"
|
20
|
+
"\#<#{self.class} protocol=#{self.protocol} endpoint=#{@endpoint}>"
|
21
21
|
end
|
22
22
|
|
23
23
|
# The actual endpoint for I/O.
|
@@ -25,7 +25,7 @@ module Falcon
|
|
25
25
|
attr :endpoint
|
26
26
|
|
27
27
|
# The protocol to use for this connection.
|
28
|
-
# @returns [Async::HTTP::Protocol] A specific protocol, e.g. {Async::HTTP::
|
28
|
+
# @returns [Async::HTTP::Protocol] A specific protocol, e.g. {Async::HTTP::Protocol::HTTP1}
|
29
29
|
def protocol
|
30
30
|
@options[:protocol]
|
31
31
|
end
|
@@ -14,17 +14,28 @@ module Falcon
|
|
14
14
|
class Virtual < Async::Service::Generic
|
15
15
|
# Drop privileges according to the user and group of the specified path.
|
16
16
|
# @parameter path [String] The path to the application directory.
|
17
|
+
# @returns [Hash] The environment to use for the spawned process.
|
17
18
|
def assume_privileges(path)
|
19
|
+
# Process.exec / Process.spawn don't replace the environment but instead update it, so we need to clear out any existing BUNDLE_ variables using `nil` values, which will cause them to be removed from the child environment:
|
20
|
+
env = ENV.to_h do |key, value|
|
21
|
+
if key.start_with?('BUNDLE_')
|
22
|
+
[key, nil]
|
23
|
+
else
|
24
|
+
[key, value]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
env['PWD'] = File.dirname(path)
|
29
|
+
|
18
30
|
stat = File.stat(path)
|
19
31
|
|
20
32
|
Process::GID.change_privilege(stat.gid)
|
21
33
|
Process::UID.change_privilege(stat.uid)
|
22
34
|
|
23
35
|
home = Etc.getpwuid(stat.uid).dir
|
36
|
+
env['HOME'] = home
|
24
37
|
|
25
|
-
return
|
26
|
-
'HOME' => home,
|
27
|
-
}
|
38
|
+
return env
|
28
39
|
end
|
29
40
|
|
30
41
|
# Spawn an application instance from the specified path.
|
@@ -35,9 +46,7 @@ module Falcon
|
|
35
46
|
container.spawn(name: "Falcon Application", restart: true, key: path) do |instance|
|
36
47
|
env = assume_privileges(path)
|
37
48
|
|
38
|
-
instance.exec(env,
|
39
|
-
"bundle", "exec", "--keep-file-descriptors",
|
40
|
-
path, ready: false, **options)
|
49
|
+
instance.exec(env, "bundle", "exec", path, ready: false, **options)
|
41
50
|
end
|
42
51
|
end
|
43
52
|
|
data/lib/falcon/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: falcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.48.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -59,7 +59,7 @@ cert_chain:
|
|
59
59
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
60
60
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
61
61
|
-----END CERTIFICATE-----
|
62
|
-
date: 2024-
|
62
|
+
date: 2024-09-24 00:00:00.000000000 Z
|
63
63
|
dependencies:
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: async
|
@@ -95,34 +95,28 @@ dependencies:
|
|
95
95
|
requirements:
|
96
96
|
- - "~>"
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: '0.
|
99
|
-
- - ">="
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: 0.66.3
|
98
|
+
version: '0.75'
|
102
99
|
type: :runtime
|
103
100
|
prerelease: false
|
104
101
|
version_requirements: !ruby/object:Gem::Requirement
|
105
102
|
requirements:
|
106
103
|
- - "~>"
|
107
104
|
- !ruby/object:Gem::Version
|
108
|
-
version: '0.
|
109
|
-
- - ">="
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: 0.66.3
|
105
|
+
version: '0.75'
|
112
106
|
- !ruby/object:Gem::Dependency
|
113
107
|
name: async-http-cache
|
114
108
|
requirement: !ruby/object:Gem::Requirement
|
115
109
|
requirements:
|
116
110
|
- - "~>"
|
117
111
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.4
|
112
|
+
version: '0.4'
|
119
113
|
type: :runtime
|
120
114
|
prerelease: false
|
121
115
|
version_requirements: !ruby/object:Gem::Requirement
|
122
116
|
requirements:
|
123
117
|
- - "~>"
|
124
118
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.4
|
119
|
+
version: '0.4'
|
126
120
|
- !ruby/object:Gem::Dependency
|
127
121
|
name: async-service
|
128
122
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,34 +173,48 @@ dependencies:
|
|
179
173
|
- - "~>"
|
180
174
|
- !ruby/object:Gem::Version
|
181
175
|
version: '3.0'
|
176
|
+
- !ruby/object:Gem::Dependency
|
177
|
+
name: protocol-http
|
178
|
+
requirement: !ruby/object:Gem::Requirement
|
179
|
+
requirements:
|
180
|
+
- - "~>"
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0.31'
|
183
|
+
type: :runtime
|
184
|
+
prerelease: false
|
185
|
+
version_requirements: !ruby/object:Gem::Requirement
|
186
|
+
requirements:
|
187
|
+
- - "~>"
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '0.31'
|
182
190
|
- !ruby/object:Gem::Dependency
|
183
191
|
name: process-metrics
|
184
192
|
requirement: !ruby/object:Gem::Requirement
|
185
193
|
requirements:
|
186
194
|
- - "~>"
|
187
195
|
- !ruby/object:Gem::Version
|
188
|
-
version: 0.2
|
196
|
+
version: '0.2'
|
189
197
|
type: :runtime
|
190
198
|
prerelease: false
|
191
199
|
version_requirements: !ruby/object:Gem::Requirement
|
192
200
|
requirements:
|
193
201
|
- - "~>"
|
194
202
|
- !ruby/object:Gem::Version
|
195
|
-
version: 0.2
|
203
|
+
version: '0.2'
|
196
204
|
- !ruby/object:Gem::Dependency
|
197
205
|
name: protocol-rack
|
198
206
|
requirement: !ruby/object:Gem::Requirement
|
199
207
|
requirements:
|
200
208
|
- - "~>"
|
201
209
|
- !ruby/object:Gem::Version
|
202
|
-
version: '0.
|
210
|
+
version: '0.7'
|
203
211
|
type: :runtime
|
204
212
|
prerelease: false
|
205
213
|
version_requirements: !ruby/object:Gem::Requirement
|
206
214
|
requirements:
|
207
215
|
- - "~>"
|
208
216
|
- !ruby/object:Gem::Version
|
209
|
-
version: '0.
|
217
|
+
version: '0.7'
|
210
218
|
- !ruby/object:Gem::Dependency
|
211
219
|
name: samovar
|
212
220
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|