@drsamonline/cli 0.12.7 → 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 +1 -1
- package/src/cli.js +18 -1
- package/src/commands-extra.js +9 -1
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -174,6 +174,9 @@ async function cmdUp(flags) {
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
const configOverride = {};
|
|
177
|
+
// --headless: the proxy engine only, no dashboard. A gateway on a VPS should
|
|
178
|
+
// not serve a page that can rewrite its own config.
|
|
179
|
+
if (flags.headless === true) configOverride.headless = true;
|
|
177
180
|
if (role) configOverride.planes = { ...(configOverride.planes ?? {}), role };
|
|
178
181
|
if (flags['model-plane']) {
|
|
179
182
|
configOverride.planes = { ...(configOverride.planes ?? {}), modelPlaneUrl: String(flags['model-plane']) };
|
|
@@ -185,6 +188,20 @@ async function cmdUp(flags) {
|
|
|
185
188
|
...(Object.keys(configOverride).length ? { configOverride } : {}),
|
|
186
189
|
});
|
|
187
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
|
+
}
|
|
188
205
|
const host = config.server.host;
|
|
189
206
|
const port = flags.port ? Number(flags.port) : config.server.port;
|
|
190
207
|
|
|
@@ -586,7 +603,7 @@ sui ${VERSION} — one endpoint for every LLM
|
|
|
586
603
|
|
|
587
604
|
${RUN_AS} first run: find keys, find tools, prove the route, start
|
|
588
605
|
${RUN_AS} init the same, explicitly --demo --force --port 8787
|
|
589
|
-
${RUN_AS} start run the gateway --port 8787 --config <file> --no-workers
|
|
606
|
+
${RUN_AS} start run the gateway --port 8787 --config <file> --no-workers --headless --allow-open
|
|
590
607
|
(aliases: up, serve)
|
|
591
608
|
${RUN_AS} invariants every hard constraint, and which are enforced
|
|
592
609
|
${RUN_AS} keys hash replace plaintext API keys with SHA-256 hashes
|
package/src/commands-extra.js
CHANGED
|
@@ -1023,7 +1023,15 @@ export async function cmdProbe(flags, args) {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
say('');
|
|
1025
1025
|
|
|
1026
|
-
|
|
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) {
|