@drsamonline/cli 0.12.8 → 0.12.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drsamonline/cli",
3
- "version": "0.12.8",
3
+ "version": "0.12.9",
4
4
  "description": "The `sui` command line.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/cli.js CHANGED
@@ -188,6 +188,20 @@ async function cmdUp(flags) {
188
188
  ...(Object.keys(configOverride).length ? { configOverride } : {}),
189
189
  });
190
190
  const { config, server } = gateway;
191
+
192
+ // An open relay: bound to the network, no key, so anyone who can reach the port
193
+ // spends your quota and reads your traffic. Refuse unless asked explicitly.
194
+ const bindsPublicly = !['127.0.0.1', 'localhost', '::1'].includes(String(config.server.host));
195
+ if (bindsPublicly && !(config.apiKeys ?? []).length && flags['allow-open'] !== true) {
196
+ throw new ConfigError(
197
+ `Refusing to serve on ${config.server.host} with no API keys: anyone who can reach this port could spend your quota. ` +
198
+ `Add an apiKeys entry to the config, or pass --allow-open if this network is trusted.`,
199
+ { path: 'server.host' },
200
+ );
201
+ }
202
+ if (bindsPublicly && !(config.apiKeys ?? []).length) {
203
+ console.warn(` warning: serving on ${config.server.host} with no API keys (--allow-open). Anyone on this network can use your providers.`);
204
+ }
191
205
  const host = config.server.host;
192
206
  const port = flags.port ? Number(flags.port) : config.server.port;
193
207
 
@@ -589,7 +603,7 @@ sui ${VERSION} — one endpoint for every LLM
589
603
 
590
604
  ${RUN_AS} first run: find keys, find tools, prove the route, start
591
605
  ${RUN_AS} init the same, explicitly --demo --force --port 8787
592
- ${RUN_AS} start run the gateway --port 8787 --config <file> --no-workers --headless
606
+ ${RUN_AS} start run the gateway --port 8787 --config <file> --no-workers --headless --allow-open
593
607
  (aliases: up, serve)
594
608
  ${RUN_AS} invariants every hard constraint, and which are enforced
595
609
  ${RUN_AS} keys hash replace plaintext API keys with SHA-256 hashes
@@ -1023,7 +1023,15 @@ export async function cmdProbe(flags, args) {
1023
1023
  }
1024
1024
  say('');
1025
1025
 
1026
- const prober = new Prober({ entries: probeable, timeoutMs: Number(flags.timeout ?? 8000) });
1026
+ // Naming a provider is intent: `sui probe ollama` means "probe the model server
1027
+ // on this machine". A full sweep is not — there the guard refuses loopback,
1028
+ // link-local and private addresses, because a catalogue entry is data and data
1029
+ // can name anything, including cloud metadata.
1030
+ const prober = new Prober({
1031
+ entries: probeable,
1032
+ timeoutMs: Number(flags.timeout ?? 8000),
1033
+ allowLocal: args.length > 0,
1034
+ });
1027
1035
  const results = await prober.runOnce();
1028
1036
 
1029
1037
  if (flags.json) {