omq-cli 0.4.0 → 0.5.2
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 +34 -0
- data/README.md +10 -7
- data/lib/omq/cli/cli_parser.rb +6 -8
- data/lib/omq/cli/config.rb +1 -3
- data/lib/omq/cli/socket_setup.rb +1 -1
- data/lib/omq/cli/version.rb +1 -1
- data/lib/omq/cli.rb +14 -22
- metadata +43 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5f3ca44a806e32560f7cd0d7381f0aecd670e475659c5329853c2596e114dc22
|
|
4
|
+
data.tar.gz: b14444d22ccad4e1209d4aaf7102cf4065450bb9892eca8498cdbd90d865936d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53ce8979e26384cd35cd0ee6e1cb57d24f10e25c4a27e81063d5c6436d2d109bbf6f1aa9eee362d97bf8e75b82f9780c27482414a70b163b452c9a5349582d4e
|
|
7
|
+
data.tar.gz: 6cfc6975d43a04198d89759c406e3068a72224206a265dc13976db8617ba3df3a2b39629c791f139b5b180db693453c1bbc271da9cd041caa78aaddd3c9f9989
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.2 — 2026-04-07
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **Guard async-debug behind `OMQ_DEV`** — the Gemfile still caused the
|
|
8
|
+
openssl conflict on CI even after removing it from the gemspec.
|
|
9
|
+
|
|
10
|
+
## 0.5.1 — 2026-04-07
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **Move async-debug from runtime to dev dependency** — async-debug depends on
|
|
15
|
+
`openssl >= 3.0` which conflicts with Ruby's default openssl gem on CI.
|
|
16
|
+
Now only loaded when `OMQ_DEBUG_URI` is set, with a `LoadError` guard and
|
|
17
|
+
install hint.
|
|
18
|
+
|
|
19
|
+
## 0.5.0 — 2026-04-07
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **rbnacl, zstd-ruby, and msgpack are now fixed dependencies** —
|
|
24
|
+
no more runtime detection or conditional test guards.
|
|
25
|
+
- **`--curve-crypto` renamed to `--crypto`** — applies to CURVE and future
|
|
26
|
+
mechanisms (e.g. BLAKE3ZMQ). Env var renamed from `OMQ_CURVE_CRYPTO` to
|
|
27
|
+
`OMQ_CRYPTO`.
|
|
28
|
+
- **CURVE requires system libsodium** — rbnacl is bundled but needs libsodium
|
|
29
|
+
installed (`apt install libsodium-dev` / `brew install libsodium`). nuckle
|
|
30
|
+
(pure Ruby) is available via `--crypto nuckle` but marked as DANGEROUS.
|
|
31
|
+
|
|
32
|
+
### Removed
|
|
33
|
+
|
|
34
|
+
- **`has_zstd` / `has_msgpack` config fields** — no longer needed since both
|
|
35
|
+
gems are fixed dependencies.
|
|
36
|
+
|
|
3
37
|
## 0.4.0 — 2026-04-07
|
|
4
38
|
|
|
5
39
|
### Added
|
data/README.md
CHANGED
|
@@ -352,22 +352,25 @@ omq keygen
|
|
|
352
352
|
# OMQ_SERVER_PUBLIC='...'
|
|
353
353
|
# OMQ_SERVER_SECRET='...'
|
|
354
354
|
|
|
355
|
-
omq keygen --
|
|
355
|
+
omq keygen --crypto nuckle # pure Ruby backend (DANGEROUS — not audited)
|
|
356
356
|
```
|
|
357
357
|
|
|
358
358
|
Export the vars, then use `--curve-server` (server) or `--curve-server-key` (client).
|
|
359
359
|
|
|
360
360
|
## CURVE encryption
|
|
361
361
|
|
|
362
|
-
End-to-end encryption using CurveZMQ. Requires
|
|
363
|
-
- **rbnacl** (recommended) — wraps libsodium, fast and audited. `gem install rbnacl`
|
|
364
|
-
- **nuckle** — pure Ruby, no system dependencies, not audited. `gem install nuckle`
|
|
362
|
+
End-to-end encryption using CurveZMQ. Requires system libsodium:
|
|
365
363
|
|
|
366
|
-
|
|
364
|
+
```sh
|
|
365
|
+
apt install libsodium-dev # Debian/Ubuntu
|
|
366
|
+
brew install libsodium # macOS
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
To use nuckle (pure Ruby, DANGEROUS — not audited) instead:
|
|
367
370
|
|
|
368
371
|
```sh
|
|
369
|
-
omq rep -b tcp://:5555 --echo --curve-server --
|
|
370
|
-
# or:
|
|
372
|
+
omq rep -b tcp://:5555 --echo --curve-server --crypto nuckle
|
|
373
|
+
# or: OMQ_CRYPTO=nuckle omq rep -b tcp://:5555 --echo --curve-server
|
|
371
374
|
```
|
|
372
375
|
|
|
373
376
|
```sh
|
data/lib/omq/cli/cli_parser.rb
CHANGED
|
@@ -230,7 +230,7 @@ module OMQ
|
|
|
230
230
|
recv_maxsz: nil,
|
|
231
231
|
curve_server: false,
|
|
232
232
|
curve_server_key: nil,
|
|
233
|
-
|
|
233
|
+
crypto: nil,
|
|
234
234
|
}.freeze
|
|
235
235
|
|
|
236
236
|
|
|
@@ -248,12 +248,9 @@ module OMQ
|
|
|
248
248
|
end
|
|
249
249
|
|
|
250
250
|
|
|
251
|
-
# Validates that
|
|
251
|
+
# Validates option combinations that depend on socket type.
|
|
252
252
|
#
|
|
253
253
|
def self.validate_gems!(config)
|
|
254
|
-
abort "--msgpack requires the msgpack gem" if config.format == :msgpack && !config.has_msgpack
|
|
255
|
-
abort "--compress requires the zstd-ruby gem" if config.compress && !config.has_zstd
|
|
256
|
-
|
|
257
254
|
if config.recv_only? && (config.data || config.file)
|
|
258
255
|
abort "--data/--file not valid for #{config.type_name} (receive-only)"
|
|
259
256
|
end
|
|
@@ -363,12 +360,13 @@ module OMQ
|
|
|
363
360
|
opts[:parallel] = v || Etc.nprocessors
|
|
364
361
|
}
|
|
365
362
|
|
|
366
|
-
o.separator "\nCURVE encryption (requires
|
|
363
|
+
o.separator "\nCURVE encryption (requires system libsodium):"
|
|
367
364
|
o.on("--curve-server", "Enable CURVE as server (generates keypair)") { opts[:curve_server] = true }
|
|
368
365
|
o.on("--curve-server-key KEY", "Enable CURVE as client (server's Z85 public key)") { |v| opts[:curve_server_key] = v }
|
|
369
|
-
o.on("--
|
|
366
|
+
o.on("--crypto BACKEND", "Crypto backend: rbnacl (default) or nuckle (pure Ruby, DANGEROUS)") { |v| opts[:crypto] = v }
|
|
367
|
+
o.separator " Install libsodium: apt install libsodium-dev / brew install libsodium"
|
|
370
368
|
o.separator " Env vars: OMQ_SERVER_KEY (client), OMQ_SERVER_PUBLIC + OMQ_SERVER_SECRET (server)"
|
|
371
|
-
o.separator "
|
|
369
|
+
o.separator " OMQ_CRYPTO (backend: rbnacl or nuckle)"
|
|
372
370
|
|
|
373
371
|
o.separator "\nOther:"
|
|
374
372
|
o.on("-v", "--verbose", "Verbosity: -v endpoints, -vv events, -vvv messages") { opts[:verbose] += 1 }
|
data/lib/omq/cli/config.rb
CHANGED
data/lib/omq/cli/socket_setup.rb
CHANGED
|
@@ -78,7 +78,7 @@ module OMQ
|
|
|
78
78
|
|
|
79
79
|
return unless server_key_z85 || server_mode
|
|
80
80
|
|
|
81
|
-
crypto = CLI.load_curve_crypto(config.
|
|
81
|
+
crypto = CLI.load_curve_crypto(config.crypto || ENV["OMQ_CRYPTO"], verbose: config.verbose >= 1)
|
|
82
82
|
require "protocol/zmtp/mechanism/curve"
|
|
83
83
|
|
|
84
84
|
if server_key_z85
|
data/lib/omq/cli/version.rb
CHANGED
data/lib/omq/cli.rb
CHANGED
|
@@ -122,12 +122,12 @@ module OMQ
|
|
|
122
122
|
verbose = false
|
|
123
123
|
while (arg = argv.shift)
|
|
124
124
|
case arg
|
|
125
|
-
when "--
|
|
125
|
+
when "--crypto"
|
|
126
126
|
crypto_name = argv.shift
|
|
127
127
|
when "-v", "--verbose"
|
|
128
128
|
verbose = true
|
|
129
129
|
when "-h", "--help"
|
|
130
|
-
puts "Usage: omq keygen [--
|
|
130
|
+
puts "Usage: omq keygen [--crypto rbnacl|nuckle] [-v]\n\n" \
|
|
131
131
|
"Generates a CURVE keypair for persistent server identity.\n" \
|
|
132
132
|
"Output: Z85-encoded env vars for use with --curve-server."
|
|
133
133
|
exit
|
|
@@ -135,7 +135,7 @@ module OMQ
|
|
|
135
135
|
abort "omq keygen: unknown option: #{arg}"
|
|
136
136
|
end
|
|
137
137
|
end
|
|
138
|
-
crypto_name ||= ENV["
|
|
138
|
+
crypto_name ||= ENV["OMQ_CRYPTO"]
|
|
139
139
|
|
|
140
140
|
crypto = load_curve_crypto(crypto_name, verbose: verbose)
|
|
141
141
|
require "protocol/zmtp/mechanism/curve"
|
|
@@ -166,11 +166,11 @@ module OMQ
|
|
|
166
166
|
require "rbnacl"
|
|
167
167
|
RbNaCl
|
|
168
168
|
rescue LoadError
|
|
169
|
-
abort "CURVE requires
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"
|
|
169
|
+
abort "CURVE requires libsodium. Install it:\n" \
|
|
170
|
+
" apt install libsodium-dev # Debian/Ubuntu\n" \
|
|
171
|
+
" brew install libsodium # macOS\n" \
|
|
172
|
+
"Or use nuckle (pure Ruby, DANGEROUS — not audited):\n" \
|
|
173
|
+
" --crypto nuckle"
|
|
174
174
|
end
|
|
175
175
|
else
|
|
176
176
|
abort "Unknown CURVE crypto backend: #{name}. Use 'rbnacl' or 'nuckle'."
|
|
@@ -209,8 +209,12 @@ module OMQ
|
|
|
209
209
|
debug_ep = nil
|
|
210
210
|
|
|
211
211
|
if ENV["OMQ_DEBUG_URI"]
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
begin
|
|
213
|
+
require "async/debug"
|
|
214
|
+
debug_ep = Async::HTTP::Endpoint.parse ENV["OMQ_DEBUG_URI"]
|
|
215
|
+
rescue LoadError
|
|
216
|
+
abort "OMQ_DEBUG_URI requires the async-debug gem: gem install async-debug"
|
|
217
|
+
end
|
|
214
218
|
end
|
|
215
219
|
|
|
216
220
|
if config.type_name.nil?
|
|
@@ -265,18 +269,6 @@ module OMQ
|
|
|
265
269
|
opts = CliParser.parse(argv)
|
|
266
270
|
CliParser.validate!(opts)
|
|
267
271
|
|
|
268
|
-
opts[:has_msgpack] = begin
|
|
269
|
-
require "msgpack"
|
|
270
|
-
true
|
|
271
|
-
rescue LoadError
|
|
272
|
-
false
|
|
273
|
-
end
|
|
274
|
-
opts[:has_zstd] = begin
|
|
275
|
-
require "zstd-ruby"
|
|
276
|
-
true
|
|
277
|
-
rescue LoadError
|
|
278
|
-
false
|
|
279
|
-
end
|
|
280
272
|
opts[:stdin_is_tty] = $stdin.tty?
|
|
281
273
|
|
|
282
274
|
Ractor.make_shareable(Config.new(**opts))
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omq-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Patrik Wenger
|
|
@@ -107,6 +107,48 @@ dependencies:
|
|
|
107
107
|
- - "~>"
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
109
|
version: '0.1'
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: msgpack
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - ">="
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '0'
|
|
117
|
+
type: :runtime
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - ">="
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '0'
|
|
124
|
+
- !ruby/object:Gem::Dependency
|
|
125
|
+
name: rbnacl
|
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - "~>"
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '7.0'
|
|
131
|
+
type: :runtime
|
|
132
|
+
prerelease: false
|
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
134
|
+
requirements:
|
|
135
|
+
- - "~>"
|
|
136
|
+
- !ruby/object:Gem::Version
|
|
137
|
+
version: '7.0'
|
|
138
|
+
- !ruby/object:Gem::Dependency
|
|
139
|
+
name: zstd-ruby
|
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
|
141
|
+
requirements:
|
|
142
|
+
- - ">="
|
|
143
|
+
- !ruby/object:Gem::Version
|
|
144
|
+
version: '0'
|
|
145
|
+
type: :runtime
|
|
146
|
+
prerelease: false
|
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
148
|
+
requirements:
|
|
149
|
+
- - ">="
|
|
150
|
+
- !ruby/object:Gem::Version
|
|
151
|
+
version: '0'
|
|
110
152
|
description: Command-line tool for sending and receiving ZeroMQ messages on any socket
|
|
111
153
|
type (REQ/REP, PUB/SUB, PUSH/PULL, DEALER/ROUTER, and all draft types). Supports
|
|
112
154
|
Ruby eval (-e/-E), script handlers (-r), pipe virtual socket with Ractor parallelism,
|