falcon 0.48.0 → 0.48.1

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: a0dbc89627471c80f82f8888e8cce7ab9cf3dd01621ee6f92a7b6904b33c275a
4
- data.tar.gz: 848e0f96f5b247866d02bc9ae0fdfc1a0f2bb4a70a5dd853927e991e635950e9
3
+ metadata.gz: 4305e4b3c191643bd6ee8dfc2f02e8f5c30b0fb7c60bb61bee5675c983e3e98b
4
+ data.tar.gz: 7c8c86e7557bbff0d29ca83af877b36a12e0db86c2a2bf5e01cd2df88b35ad82
5
5
  SHA512:
6
- metadata.gz: f454b3f224174fde4901cb85ce7cfb12b447dbcf025788d3a769cab12ce1c0d0095164f668621d604a0e295648c2a18008a995133e635205c4d2aee32cf566c6
7
- data.tar.gz: 633db8f65e238d35a48541ba43c3490a5c398d09883f2fb6ac41f50c316549fe49426f1870f612634d39b3766709303890ad76d9e1bbbe8863d8d85d34fcfd1f
6
+ metadata.gz: c6de22e4f8048e1632e8c37eab7727623c62f4a47838fee3da284bd0bb2c050e51019943b109805ccc9e23cada977449dc2fcb04a6bf6d1c18c354366bc204fc
7
+ data.tar.gz: 1a6f70ac00514ee5a6a110ec2013dc494077f84d5fa257cbdab11394301c4f857ca49bb4236051d4d3090360fab18809b2b2e6fde9b8a9cbc1d78efd01e0fb87
checksums.yaml.gz.sig CHANGED
Binary file
@@ -150,7 +150,20 @@ module Falcon
150
150
 
151
151
  Traces::Provider(self) do
152
152
  def call(request)
153
- Traces.trace('falcon.middleware.proxy.call', attributes: {authority: request.authority}) do
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
@@ -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
 
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2017-2024, by Samuel Williams.
5
5
 
6
6
  module Falcon
7
- VERSION = "0.48.0"
7
+ VERSION = "0.48.1"
8
8
  end
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.48.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-09-04 00:00:00.000000000 Z
62
+ date: 2024-09-24 00:00:00.000000000 Z
63
63
  dependencies:
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: async
metadata.gz.sig CHANGED
Binary file