@vibelet/cli 1.2.9 → 1.2.11

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.
@@ -1,2 +1,2 @@
1
- var s=require("node:fs"),n=require("node:path"),c="@vibelet/cli";function a(e){try{let r=JSON.parse((0,s.readFileSync)(e,"utf8"));if(r.name===c&&typeof r.version=="string"&&r.version.length>0)return r.version}catch{}return null}function p(){return"1.2.9"}var i=p();process.stdout.write(`${i}
1
+ var s=require("node:fs"),n=require("node:path"),c="@vibelet/cli";function a(e){try{let r=JSON.parse((0,s.readFileSync)(e,"utf8"));if(r.name===c&&typeof r.version=="string"&&r.version.length>0)return r.version}catch{}return null}function p(){return"1.2.11"}var i=p();process.stdout.write(`${i}
2
2
  `);
package/dist/vibelet.mjs CHANGED
@@ -7581,6 +7581,44 @@ function isLocalNetworkHost(host) {
7581
7581
  || (first === 192 && second === 168);
7582
7582
  }
7583
7583
 
7584
+ function isLoopbackHost(host) {
7585
+ return host === 'localhost'
7586
+ || host === '127.0.0.1'
7587
+ || host === '::1'
7588
+ || host === '::ffff:127.0.0.1';
7589
+ }
7590
+
7591
+ function isPlainLocalHostname(host) {
7592
+ return Boolean(host) && !host.includes('.') && !host.includes(':');
7593
+ }
7594
+
7595
+ function isTrustedCleartextHost(host) {
7596
+ const normalized = normalizeHostValue(host.replace(/^https?:\/\//, '').replace(/\/.*$/, ''));
7597
+ return isLoopbackHost(normalized)
7598
+ || isLocalNetworkHost(normalized)
7599
+ || isTailscaleHost(normalized)
7600
+ || isPlainLocalHostname(normalized);
7601
+ }
7602
+
7603
+ function parseCommaSeparatedHosts(rawValue) {
7604
+ return typeof rawValue === 'string'
7605
+ ? rawValue.split(',').map((entry) => normalizeHostValue(entry)).filter(Boolean)
7606
+ : [];
7607
+ }
7608
+
7609
+ function validateExplicitCleartextHosts({ hostArg, fallbackHostsArg }) {
7610
+ const unsafeHosts = [
7611
+ ...(hostArg ? [normalizeHostValue(hostArg)] : []),
7612
+ ...parseCommaSeparatedHosts(fallbackHostsArg),
7613
+ ].filter((host) => host && !isTrustedCleartextHost(host));
7614
+ if (unsafeHosts.length === 0) {
7615
+ return;
7616
+ }
7617
+ fail(
7618
+ `Refusing public cleartext host ${unsafeHosts[0]}. Use --relay=https://..., a Tailscale host, or a LAN/local address.`,
7619
+ );
7620
+ }
7621
+
7584
7622
  function isQuickTunnelHost(host) {
7585
7623
  return host.endsWith('.trycloudflare.com');
7586
7624
  }
@@ -7762,9 +7800,9 @@ function printHelp() {
7762
7800
  process.stdout.write(` npx ${packageJson.name} --local Skip the default Cloudflare Tunnel for this run\n`);
7763
7801
  process.stdout.write(` npx ${packageJson.name} --force Force a new Cloudflare Tunnel URL\n`);
7764
7802
  process.stdout.write(` npx ${packageJson.name} --relay <url> Use a custom tunnel URL for remote access\n`);
7765
- process.stdout.write(` npx ${packageJson.name} --host <ip> Set the primary host/IP address\n`);
7803
+ process.stdout.write(` npx ${packageJson.name} --host <ip> Set the primary LAN/Tailscale host/IP address\n`);
7766
7804
  process.stdout.write(` npx ${packageJson.name} --port <port> Start or query the daemon on a custom port\n`);
7767
- process.stdout.write(` npx ${packageJson.name} --fallback-hosts <ips> Comma-separated fallback IPs\n`);
7805
+ process.stdout.write(` npx ${packageJson.name} --fallback-hosts <ips> Comma-separated LAN/Tailscale fallback IPs\n`);
7768
7806
  process.stdout.write(` npx ${packageJson.name} stop Stop the daemon\n`);
7769
7807
  process.stdout.write(` npx ${packageJson.name} restart Restart the daemon\n`);
7770
7808
  process.stdout.write(` npx ${packageJson.name} status Show service and daemon status\n`);
@@ -8083,6 +8121,7 @@ async function main() {
8083
8121
  } else {
8084
8122
  delete process.env.VIBELET_FALLBACK_HOSTS;
8085
8123
  }
8124
+ validateExplicitCleartextHosts({ hostArg, fallbackHostsArg });
8086
8125
  const backend = resolveBackend();
8087
8126
 
8088
8127
  if (command === 'stop') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibelet/cli",
3
- "version": "1.2.9",
3
+ "version": "1.2.11",
4
4
  "description": "Cross-platform CLI for installing and running the Vibelet daemon",
5
5
  "homepage": "https://vibelet.icu",
6
6
  "files": [