tina4ruby 3.13.164 → 3.13.166
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -0
- data/lib/tina4/batch_spawn.rb +156 -0
- data/lib/tina4/cli.rb +22 -6
- data/lib/tina4/database.rb +37 -4
- data/lib/tina4/database_url.rb +314 -85
- data/lib/tina4/dev_admin.rb +10 -16
- data/lib/tina4/drivers/postgres_driver.rb +15 -7
- data/lib/tina4/graph.rb +51 -22
- data/lib/tina4/mcp.rb +5 -0
- data/lib/tina4/mqtt.rb +26 -9
- data/lib/tina4/queue.rb +10 -1
- data/lib/tina4/rack_app.rb +2 -1
- data/lib/tina4/router.rb +22 -1
- data/lib/tina4/secret_file.rb +9 -1
- data/lib/tina4/seeder.rb +27 -5
- data/lib/tina4/session_handlers/database_handler.rb +15 -0
- data/lib/tina4/session_handlers/mongo_handler.rb +1 -1
- data/lib/tina4/version.rb +1 -1
- data/lib/tina4/websocket_backplane.rb +35 -11
- data/lib/tina4.rb +7 -2
- metadata +3 -2
data/lib/tina4/mcp.rb
CHANGED
|
@@ -888,6 +888,11 @@ module Tina4
|
|
|
888
888
|
sensitive = %w[secret password token key credential api_key]
|
|
889
889
|
if sensitive.any? { |s| key.downcase.include?(s) }
|
|
890
890
|
"***REDACTED***"
|
|
891
|
+
elsif key.match?(/(?:_URL|_URI|_DSN)\z/i)
|
|
892
|
+
# A connection URL carries its password inline (TINA4_DATABASE_URL,
|
|
893
|
+
# TINA4_CACHE_URL, TINA4_GRAPH_URL...), and no key-name test catches
|
|
894
|
+
# it. Masked by the shared primitive (GHSA-h2mr-m3v3-cq8c).
|
|
895
|
+
Tina4::DatabaseUrl.redact(value)
|
|
891
896
|
else
|
|
892
897
|
value
|
|
893
898
|
end
|
data/lib/tina4/mqtt.rb
CHANGED
|
@@ -62,6 +62,8 @@ module Tina4
|
|
|
62
62
|
DEFAULT_PORT = 1883
|
|
63
63
|
DEFAULT_TLS_PORT = 8883
|
|
64
64
|
DEFAULT_URL = "mqtt://127.0.0.1:1883"
|
|
65
|
+
# "scheme:/x" or "scheme//x": a scheme that lost its ":" or a "/".
|
|
66
|
+
MANGLED_SCHEME = %r{\A[A-Za-z][A-Za-z0-9+.\-]*(?::/(?!/)|//)}.freeze
|
|
65
67
|
DEFAULT_KEEPALIVE = 60
|
|
66
68
|
SUBSCRIPTION_REFUSED = 0x80
|
|
67
69
|
MAX_REMAINING_LENGTH = 268_435_455 # 4 varint bytes
|
|
@@ -170,6 +172,8 @@ module Tina4
|
|
|
170
172
|
raw = url.to_s.strip
|
|
171
173
|
raise ArgumentError, "MQTT url is empty — set TINA4_MQTT_URL (e.g. #{DEFAULT_URL})" if raw.empty?
|
|
172
174
|
|
|
175
|
+
refuse_mangled_scheme!(raw)
|
|
176
|
+
|
|
173
177
|
scheme = raw[%r{\A([A-Za-z][A-Za-z0-9+.-]*)://}, 1]&.downcase
|
|
174
178
|
unless scheme.nil? || %w[mqtt tcp mqtts].include?(scheme)
|
|
175
179
|
raise ArgumentError,
|
|
@@ -181,15 +185,7 @@ module Tina4
|
|
|
181
185
|
tls = scheme == "mqtts"
|
|
182
186
|
rest = scheme ? raw.sub(%r{\A[A-Za-z][A-Za-z0-9+.-]*://}, "") : raw
|
|
183
187
|
|
|
184
|
-
|
|
185
|
-
# leaves the host intact.
|
|
186
|
-
username = password = nil
|
|
187
|
-
if rest.include?("@")
|
|
188
|
-
userinfo, _, rest = rest.rpartition("@")
|
|
189
|
-
raw_username, has_password, raw_password = userinfo.partition(":")
|
|
190
|
-
username = percent_decode(raw_username)
|
|
191
|
-
password = percent_decode(raw_password) unless has_password.empty?
|
|
192
|
-
end
|
|
188
|
+
username, password, rest = split_credentials(rest)
|
|
193
189
|
|
|
194
190
|
match = rest.match(%r{\A(?<host>\[[^\]]+\]|[^:/]+)(?::(?<port>\d+))?(?:/.*)?\z})
|
|
195
191
|
raise ArgumentError, "malformed MQTT url #{Tina4::DatabaseUrl.redact(raw).inspect} — expected mqtt://host:port" unless match
|
|
@@ -203,6 +199,27 @@ module Tina4
|
|
|
203
199
|
}
|
|
204
200
|
end
|
|
205
201
|
|
|
202
|
+
# A scheme that lost its ":" or a "/" (`mqtt:/u:pw@h`, `mqtt//u:pw@h`) is
|
|
203
|
+
# a typo, not a bare host: refused without echoing it
|
|
204
|
+
# (GHSA-h2mr-m3v3-cq8c), since the credential sits where the host is read.
|
|
205
|
+
def self.refuse_mangled_scheme!(raw)
|
|
206
|
+
return unless raw.match?(MANGLED_SCHEME)
|
|
207
|
+
|
|
208
|
+
raise ArgumentError.new("MQTT url: #{Tina4::DatabaseUrl::AMBIGUOUS_URL}"), cause: nil
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# [username, password, host-and-rest]. Userinfo ends at the LAST "@", so a
|
|
212
|
+
# password containing an un-encoded "@" still leaves the host intact; the
|
|
213
|
+
# shared split also refuses an "@" that cannot be ending a userinfo (one in
|
|
214
|
+
# the path or query).
|
|
215
|
+
def self.split_credentials(rest)
|
|
216
|
+
userinfo, rest = Tina4::DatabaseUrl.split_userinfo(rest, "MQTT url")
|
|
217
|
+
return [nil, nil, rest] if userinfo.nil?
|
|
218
|
+
|
|
219
|
+
raw_username, has_password, raw_password = userinfo.partition(":")
|
|
220
|
+
[percent_decode(raw_username), has_password.empty? ? nil : percent_decode(raw_password), rest]
|
|
221
|
+
end
|
|
222
|
+
|
|
206
223
|
# %XX in url userinfo. Not CGI.unescape / URI.decode_www_form_component:
|
|
207
224
|
# those also turn "+" into a space, which silently corrupts a password.
|
|
208
225
|
def self.percent_decode(value)
|
data/lib/tina4/queue.rb
CHANGED
|
@@ -558,8 +558,11 @@ module Tina4
|
|
|
558
558
|
config = {}
|
|
559
559
|
url = url.sub("amqp://", "").sub("amqps://", "")
|
|
560
560
|
|
|
561
|
+
# Userinfo ends at the LAST "@" (GHSA-h2mr-m3v3-cq8c). Splitting at the
|
|
562
|
+
# first one turned `u:p@ss@host` into password "p" and host "ss@host",
|
|
563
|
+
# which Bunny then printed in its connection error.
|
|
561
564
|
if url.include?("@")
|
|
562
|
-
creds, rest = url.
|
|
565
|
+
creds, _, rest = url.rpartition("@")
|
|
563
566
|
if creds.include?(":")
|
|
564
567
|
config[:username], config[:password] = creds.split(":", 2)
|
|
565
568
|
else
|
|
@@ -596,6 +599,12 @@ module Tina4
|
|
|
596
599
|
|
|
597
600
|
if hostport.include?(":")
|
|
598
601
|
host, port = hostport.split(":", 2)
|
|
602
|
+
# A non-numeric port is the password of a URL that lost its host
|
|
603
|
+
# (`amqp://u:secret`) - and whatever followed a "/" in it became the
|
|
604
|
+
# vhost. Refused without echoing the value (GHSA-h2mr-m3v3-cq8c).
|
|
605
|
+
unless port.match?(/\A\d*\z/)
|
|
606
|
+
raise ArgumentError.new("TINA4_QUEUE_URL: #{Tina4::DatabaseUrl::AMBIGUOUS_URL}"), cause: nil
|
|
607
|
+
end
|
|
599
608
|
config[:host] = host
|
|
600
609
|
config[:port] = port.to_i
|
|
601
610
|
elsif hostport && !hostport.empty?
|
data/lib/tina4/rack_app.rb
CHANGED
|
@@ -1260,7 +1260,8 @@ module Tina4
|
|
|
1260
1260
|
end
|
|
1261
1261
|
|
|
1262
1262
|
def self.enforce_route_auth(env, route)
|
|
1263
|
-
|
|
1263
|
+
# A bare ANY route is public for reads and secured for writes (ADR-0019).
|
|
1264
|
+
return nil unless route.auth_required_for?(env["REQUEST_METHOD"])
|
|
1264
1265
|
|
|
1265
1266
|
# ERR-DEC-02 (#342): a browser gets errors/401.twig, an API client the JSON
|
|
1266
1267
|
# envelope — the same negotiation every other framework error uses. Was an
|
data/lib/tina4/router.rb
CHANGED
|
@@ -14,6 +14,9 @@ module Tina4
|
|
|
14
14
|
attr_reader :method, :path, :handler, :auth_handler, :swagger_meta,
|
|
15
15
|
:path_regex, :param_names, :template
|
|
16
16
|
attr_accessor :auth_required, :cached
|
|
17
|
+
# True on a bare ANY route: reads are public, writes need a token. See
|
|
18
|
+
# #auth_required_for?.
|
|
19
|
+
attr_reader :auth_write_methods
|
|
17
20
|
# RBAC guard groups (Feature 138 / ADR-0058). Each is an array of arrays:
|
|
18
21
|
# OR within a group, AND across groups (stacking).
|
|
19
22
|
attr_reader :roles, :perms
|
|
@@ -31,6 +34,13 @@ module Tina4
|
|
|
31
34
|
# Middleware is additive, never an auth bypass. tina4-book#141
|
|
32
35
|
# PY-10-02. Call .no_auth on the route to opt out explicitly.
|
|
33
36
|
@auth_required = %w[POST PUT PATCH DELETE].include?(@method)
|
|
37
|
+
# An ANY route serves reads AND writes from one entry, so one boolean
|
|
38
|
+
# cannot say "public GET, secured POST". With no explicit choice it is
|
|
39
|
+
# write-secured: the gate requires a token when the request method is a
|
|
40
|
+
# write, exactly as if each method had its own route (ADR-0019; tina4-php
|
|
41
|
+
# and tina4-nodejs register any() as one route per method). .secure /
|
|
42
|
+
# .role / .can lock every method; .no_auth opens every method.
|
|
43
|
+
@auth_write_methods = @method == "ANY"
|
|
34
44
|
@cached = false
|
|
35
45
|
# CSRF is enforced on a write route even when it is public (#265): a form
|
|
36
46
|
# token proves ORIGIN, not identity. Call .no_csrf to opt a server-to-
|
|
@@ -54,9 +64,17 @@ module Tina4
|
|
|
54
64
|
# Returns self for chaining: Router.post("/login") { ... }.no_auth
|
|
55
65
|
def no_auth
|
|
56
66
|
@auth_required = false
|
|
67
|
+
@auth_write_methods = false
|
|
57
68
|
self
|
|
58
69
|
end
|
|
59
70
|
|
|
71
|
+
# Whether a request with +http_method+ must carry a token on this route.
|
|
72
|
+
def auth_required_for?(http_method)
|
|
73
|
+
return true if @auth_required
|
|
74
|
+
|
|
75
|
+
@auth_write_methods && !%w[GET HEAD OPTIONS].include?(http_method.to_s.upcase)
|
|
76
|
+
end
|
|
77
|
+
|
|
60
78
|
# Opt a route OUT of CSRF form-token validation (webhooks / server-to-server
|
|
61
79
|
# callbacks that carry no browser session). .no_auth no longer skips CSRF
|
|
62
80
|
# (#265): a public form stays CSRF-protected. CSRF (origin) and auth
|
|
@@ -835,7 +853,10 @@ module Tina4
|
|
|
835
853
|
def record_broken_route_import(file, error)
|
|
836
854
|
broken_dir = File.join(Dir.pwd, "data", ".broken")
|
|
837
855
|
FileUtils.mkdir_p(broken_dir) unless Dir.exist?(broken_dir)
|
|
838
|
-
|
|
856
|
+
# ":" too: an absolute Windows path starts with a drive letter, and on
|
|
857
|
+
# NTFS a colon in a file name writes an alternate data stream instead of
|
|
858
|
+
# a file, so no data/.broken/*.broken listing would see the marker.
|
|
859
|
+
slug = file.gsub(%r{[/\\:]}, "_")
|
|
839
860
|
payload = JSON.generate(
|
|
840
861
|
type: "auto_discover_failure",
|
|
841
862
|
file: file,
|
data/lib/tina4/secret_file.rb
CHANGED
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
module Tina4
|
|
9
9
|
# Internal credential persistence: validate and read/write the same descriptor.
|
|
10
10
|
module SecretFile
|
|
11
|
+
# O_NONBLOCK keeps an open from hanging on a FIFO planted at a credential
|
|
12
|
+
# path. Windows has no FIFOs at file paths, and Ruby on Windows rejects the
|
|
13
|
+
# flag outright: File.open answers EACCES for a read-write open and IOError
|
|
14
|
+
# for a read-only one. Passing it there broke every secret write (RSA keys
|
|
15
|
+
# from Auth.setup, the dev TINA4_SECRET in .env.local, dev-admin .env edits)
|
|
16
|
+
# and the dev-admin file viewer. Zero on Windows; the flag elsewhere.
|
|
17
|
+
OPEN_NONBLOCK = defined?(File::NONBLOCK) && !Gem.win_platform? ? File::NONBLOCK : 0
|
|
18
|
+
|
|
11
19
|
def self.update(path)
|
|
12
20
|
begin
|
|
13
21
|
before = File.lstat(path)
|
|
@@ -17,7 +25,7 @@ module Tina4
|
|
|
17
25
|
end
|
|
18
26
|
flags = File::RDWR | File::CREAT
|
|
19
27
|
flags |= File::NOFOLLOW if defined?(File::NOFOLLOW)
|
|
20
|
-
flags |=
|
|
28
|
+
flags |= OPEN_NONBLOCK
|
|
21
29
|
File.open(path, flags, 0o600) do |file|
|
|
22
30
|
file.flock(File::LOCK_EX)
|
|
23
31
|
stat = file.stat
|
data/lib/tina4/seeder.rb
CHANGED
|
@@ -998,13 +998,31 @@ module Tina4
|
|
|
998
998
|
seed_dir(seed_folder: seed_folder, clear: clear)
|
|
999
999
|
end
|
|
1000
1000
|
|
|
1001
|
-
#
|
|
1001
|
+
# Raised when a seed file raises, so the seed run stopped at it (ADR-0108).
|
|
1002
|
+
# +seed_file+ is the failing file, +completed+ the files that ran before it,
|
|
1003
|
+
# and +cause+ (set by Ruby on a raise inside rescue) the original error.
|
|
1004
|
+
class SeedError < StandardError
|
|
1005
|
+
attr_reader :seed_file, :completed
|
|
1006
|
+
|
|
1007
|
+
def initialize(seed_file, completed, error)
|
|
1008
|
+
@seed_file = seed_file
|
|
1009
|
+
@completed = completed.dup
|
|
1010
|
+
super("Seed file failed: #{File.basename(seed_file)}: #{error.message}")
|
|
1011
|
+
end
|
|
1012
|
+
end
|
|
1013
|
+
|
|
1014
|
+
# Run the seed files in +seed_folder+ in name order, skipping files that
|
|
1015
|
+
# start with "_". Returns the files executed, in order ([] when the folder is
|
|
1016
|
+
# missing). A seed file that raises stops the run: it is logged and a
|
|
1017
|
+
# Tina4::SeedError naming it is raised, and no later file runs (ADR-0108).
|
|
1002
1018
|
#
|
|
1003
1019
|
# @param seed_folder [String] path to seed files (default: "seeds")
|
|
1020
|
+
# @return [Array<String>] the seed files executed, in order
|
|
1021
|
+
# @raise [Tina4::SeedError] when a seed file raises
|
|
1004
1022
|
def self.seed_dir(seed_folder: "seeds", clear: false)
|
|
1005
1023
|
unless Dir.exist?(seed_folder)
|
|
1006
1024
|
Tina4::Log.info("Seeder: No seeds folder found at #{seed_folder}")
|
|
1007
|
-
return
|
|
1025
|
+
return []
|
|
1008
1026
|
end
|
|
1009
1027
|
|
|
1010
1028
|
files = Dir.glob(File.join(seed_folder, "*.rb")).sort
|
|
@@ -1012,19 +1030,23 @@ module Tina4
|
|
|
1012
1030
|
|
|
1013
1031
|
if files.empty?
|
|
1014
1032
|
Tina4::Log.info("Seeder: No seed files found in #{seed_folder}")
|
|
1015
|
-
return
|
|
1033
|
+
return []
|
|
1016
1034
|
end
|
|
1017
1035
|
|
|
1018
1036
|
Tina4::Log.info("Seeder: Found #{files.length} seed file(s) in #{seed_folder}")
|
|
1019
1037
|
|
|
1038
|
+
executed = []
|
|
1020
1039
|
files.each do |filepath|
|
|
1021
1040
|
begin
|
|
1022
1041
|
Tina4::Log.info("Seeder: Running #{File.basename(filepath)}...")
|
|
1023
1042
|
load filepath
|
|
1024
1043
|
Tina4::Log.info("Seeder: Completed #{File.basename(filepath)}")
|
|
1025
|
-
rescue => e
|
|
1026
|
-
Tina4::Log.error("Seeder:
|
|
1044
|
+
rescue StandardError, ScriptError => e
|
|
1045
|
+
Tina4::Log.error("Seeder: #{File.basename(filepath)} failed, seeding stopped: #{e.message}")
|
|
1046
|
+
raise SeedError.new(filepath, executed, e)
|
|
1027
1047
|
end
|
|
1048
|
+
executed << filepath
|
|
1028
1049
|
end
|
|
1050
|
+
executed
|
|
1029
1051
|
end
|
|
1030
1052
|
end
|
|
@@ -177,6 +177,21 @@ module Tina4
|
|
|
177
177
|
db.execute("DELETE FROM #{TABLE_NAME} WHERE expires_at > 0 AND expires_at < ?", [Time.now.to_f])
|
|
178
178
|
end
|
|
179
179
|
|
|
180
|
+
# Release the connection this handler opened itself from
|
|
181
|
+
# TINA4_DATABASE_URL. An injected :db belongs to the caller and is never
|
|
182
|
+
# closed here. Idempotent; the next read or write reopens the connection.
|
|
183
|
+
# Without it a SQLite session file stayed open for the life of the
|
|
184
|
+
# process, and on Windows an open file cannot be deleted or replaced.
|
|
185
|
+
def close
|
|
186
|
+
return if @db_option || @db.nil?
|
|
187
|
+
|
|
188
|
+
begin
|
|
189
|
+
@db.close
|
|
190
|
+
ensure
|
|
191
|
+
@db = nil
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
180
195
|
private
|
|
181
196
|
|
|
182
197
|
# The database connection, resolved on FIRST USE. An explicit :db option
|
|
@@ -304,7 +304,7 @@ module Tina4
|
|
|
304
304
|
# server, which is far worse than any parse error.
|
|
305
305
|
def parse_host_port(uri)
|
|
306
306
|
remainder = uri.to_s.sub(%r{\Amongodb://}, "")
|
|
307
|
-
remainder = remainder.
|
|
307
|
+
remainder = remainder.rpartition("@").last.to_s # credentials end at the LAST "@" (GHSA-h2mr-m3v3-cq8c)
|
|
308
308
|
remainder = remainder.split("/", 2).first.to_s # path + query
|
|
309
309
|
remainder = remainder.split(",", 2).first.to_s # first seed host
|
|
310
310
|
host, port = remainder.split(":", 2)
|
data/lib/tina4/version.rb
CHANGED
|
@@ -89,17 +89,12 @@ module Tina4
|
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
@url = url || ENV.fetch("TINA4_WS_BACKPLANE_URL", "redis://localhost:6379")
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
# e.message. Re-raise naming only the redacted form.
|
|
99
|
-
raise ArgumentError,
|
|
100
|
-
"Invalid TINA4_WS_BACKPLANE_URL for the Redis backplane: " \
|
|
101
|
-
"#{Tina4::DatabaseUrl.redact(@url)} (#{e.class})"
|
|
102
|
-
end
|
|
92
|
+
# GHSA-h2mr-m3v3-cq8c: the redis gem re-parses the URL with URI.parse,
|
|
93
|
+
# which reads `redis://u:12?q@h` as host "u", port 12 and then quotes that
|
|
94
|
+
# host in its connection errors. Refuse (generically) any URL whose
|
|
95
|
+
# userinfo URI.parse would not take the way the shared redaction does.
|
|
96
|
+
Tina4::DatabaseUrl.assert_client_url!(@url, "Invalid TINA4_WS_BACKPLANE_URL for the Redis backplane")
|
|
97
|
+
@redis, @subscriber = open_clients
|
|
103
98
|
@threads = {}
|
|
104
99
|
@running = true
|
|
105
100
|
end
|
|
@@ -137,6 +132,28 @@ module Tina4
|
|
|
137
132
|
@subscriber.close
|
|
138
133
|
@redis.close
|
|
139
134
|
end
|
|
135
|
+
|
|
136
|
+
private
|
|
137
|
+
|
|
138
|
+
# The publisher and subscriber clients. A URL the client cannot parse
|
|
139
|
+
# raises URI::InvalidURIError quoting the WHOLE raw URL, password included,
|
|
140
|
+
# and WebSocket#ensure_backplane logs e.message. Re-raised naming only the
|
|
141
|
+
# redacted form - outside the rescue and with cause: nil, because a chained
|
|
142
|
+
# cause carries that raw message into every crash report and full_message.
|
|
143
|
+
def open_clients
|
|
144
|
+
clients = new_clients
|
|
145
|
+
return clients if clients.is_a?(Array)
|
|
146
|
+
|
|
147
|
+
raise ArgumentError.new("Invalid TINA4_WS_BACKPLANE_URL for the Redis backplane: " \
|
|
148
|
+
"#{Tina4::DatabaseUrl.redact(@url)} (#{clients.class})"), cause: nil
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Both clients, or the error building them raised (returned, not raised).
|
|
152
|
+
def new_clients
|
|
153
|
+
[Redis.new(url: @url), Redis.new(url: @url)]
|
|
154
|
+
rescue StandardError => e
|
|
155
|
+
e
|
|
156
|
+
end
|
|
140
157
|
end
|
|
141
158
|
|
|
142
159
|
# NATS pub/sub backplane.
|
|
@@ -163,6 +180,13 @@ module Tina4
|
|
|
163
180
|
@running = true
|
|
164
181
|
@mutex = Mutex.new
|
|
165
182
|
|
|
183
|
+
# Same rule as RedisBackplane (GHSA-h2mr-m3v3-cq8c): refuse a URL whose
|
|
184
|
+
# userinfo the client would read differently from the shared redaction.
|
|
185
|
+
# nats-pure takes a comma-separated server list, so each is checked.
|
|
186
|
+
@url.to_s.split(",").each do |server|
|
|
187
|
+
Tina4::DatabaseUrl.assert_client_url!(server.strip, "Invalid TINA4_WS_BACKPLANE_URL for the NATS backplane")
|
|
188
|
+
end
|
|
189
|
+
|
|
166
190
|
# Connect to NATS in a background thread with its own event loop
|
|
167
191
|
@nats = NATS::IO::Client.new
|
|
168
192
|
@nats.connect(@url)
|
data/lib/tina4.rb
CHANGED
|
@@ -346,6 +346,7 @@ module Tina4
|
|
|
346
346
|
autoload :IMAP_CONNECTION_ERRORS, File.expand_path("tina4/messenger", __dir__)
|
|
347
347
|
autoload :DocStore, File.expand_path("tina4/docstore", __dir__)
|
|
348
348
|
autoload :FakeData, File.expand_path("tina4/seeder", __dir__)
|
|
349
|
+
autoload :SeedError, File.expand_path("tina4/seeder", __dir__)
|
|
349
350
|
autoload :WSDL, File.expand_path("tina4/wsdl", __dir__)
|
|
350
351
|
# Validator is a counted framework feature and belongs on the main
|
|
351
352
|
# `require "tina4"` surface like every other subsystem — PHP reaches
|
|
@@ -1017,8 +1018,12 @@ module Tina4
|
|
|
1017
1018
|
# A successful single connection was already logged, with this URL, by
|
|
1018
1019
|
# Database#connect - one "Database connected" line, not two.
|
|
1019
1020
|
rescue => e
|
|
1020
|
-
|
|
1021
|
-
|
|
1021
|
+
# GHSA-h2mr-m3v3-cq8c: this logged e.message RAW. Whatever raised here
|
|
1022
|
+
# (a driver, the sqlite path resolver) can quote the URL or a part of
|
|
1023
|
+
# it, so the logged line is the scrubbed one too.
|
|
1024
|
+
@database_setup_error = Tina4::DatabaseUrl.scrub_message(e.message, db_url, safe_url)
|
|
1025
|
+
.gsub(%r{://[^/\s@]*@}, "://")
|
|
1026
|
+
Tina4::Log.error("Database connection failed: #{@database_setup_error}")
|
|
1022
1027
|
end
|
|
1023
1028
|
end
|
|
1024
1029
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tina4ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.13.
|
|
4
|
+
version: 3.13.166
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tina4 Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sqlite3
|
|
@@ -195,6 +195,7 @@ files:
|
|
|
195
195
|
- lib/tina4/auto_crud.rb
|
|
196
196
|
- lib/tina4/background.rb
|
|
197
197
|
- lib/tina4/base64.rb
|
|
198
|
+
- lib/tina4/batch_spawn.rb
|
|
198
199
|
- lib/tina4/cache.rb
|
|
199
200
|
- lib/tina4/cache_backends.rb
|
|
200
201
|
- lib/tina4/cache_backends/base_backend.rb
|