vyomi-tunnel 1.2.0 → 1.2.1

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.
@@ -48,7 +48,7 @@ const friendly = (portal) => ({
48
48
  Throttled: "too many requests; wait a moment and retry.",
49
49
  });
50
50
 
51
- export async function fetchSession({ creds, fetchFn = globalThis.fetch, now = () => new Date(), version = "1.2.0" }) {
51
+ export async function fetchSession({ creds, fetchFn = globalThis.fetch, now = () => new Date(), version = "1.2.1" }) {
52
52
  const path = "/api/tunnel/session", body = JSON.stringify({ client: "vyomi-tunnel/" + version });
53
53
  const date = now().toISOString().replace(/\.\d+Z$/, "Z");
54
54
  let r;
package/bin/mesh-cli.mjs CHANGED
@@ -202,6 +202,7 @@ const HELP = `vyomi-tunnel - connect your machine to Vyomi
202
202
 
203
203
  Everything needs a key (Free works for Nano; Mesh needs Pro or Max).
204
204
  Get one: 'vyomi-tunnel help credentials'.
205
+ Log in to a Mesh VM over SSH: 'vyomi-tunnel help ssh'. Something failing? 'vyomi-tunnel help troubleshoot'.
205
206
  `;
206
207
  const DETAILS = {
207
208
  "gateway-backend": `Let a Nano API Gateway call a backend that runs on your machine
@@ -226,6 +227,9 @@ Where to get it: https://vyomi.cloud/account/tunnel-credentials
226
227
  vyomi_access_key_id = VYKA...
227
228
  vyomi_secret_access_key = ...
228
229
 
230
+ portal = https://vyomi.cloud
231
+
232
+ The portal line must start with https:// (http:// is redirected and the tunnel then fails with HTTP 405).
229
233
  Or set VYOMI_ACCESS_KEY_ID and VYOMI_SECRET_ACCESS_KEY.
230
234
  Use another profile with VYOMI_PROFILE. A Free key covers Nano; Mesh needs Pro or Max.
231
235
  The first Mesh command also sets up 'ssh <name>.vyomi' for you.`,
@@ -239,6 +243,35 @@ Add a type to narrow it:
239
243
  vyomi-tunnel list nano vm (also: api, db)
240
244
  vyomi-tunnel list mesh k3s (also: host, instance, llm, service, forward)
241
245
  A type alone works too: vyomi-tunnel list vm`,
246
+ ssh: `Log in to a Mesh VM over SSH
247
+
248
+ 1. See your Mesh and its VMs:
249
+ vyomi-tunnel list mesh
250
+ 2. Once, add the *.vyomi names to your SSH config:
251
+ vyomi-tunnel config
252
+ 3. Each Mesh makes its own VM login key. Fetch it once per Mesh:
253
+ ssh host.vyomi 'docker exec vyomi-mesh-simulator-1 cat /root/.vyomi/instance-keys/id_ed25519' > ~/.vyomi/mesh-instance-key
254
+ chmod 600 ~/.vyomi/mesh-instance-key
255
+ 4. Log in as 'ubuntu' with that key (use the instance id from step 1):
256
+ ssh -i ~/.vyomi/mesh-instance-key -o IdentitiesOnly=yes ubuntu@i-0123456789ab.vyomi
257
+
258
+ A bare 'ssh i-0123456789ab.vyomi' offers neither the key nor the user, so it ends in 'Permission denied (publickey)'.
259
+ A new Mesh is a new machine with a new key: repeat step 3. Problems: 'vyomi-tunnel help troubleshoot'.`,
260
+ troubleshoot: `Common problems
261
+
262
+ the portal refused the request (HTTP 405)
263
+ 'portal' in ~/.vyomi/credentials must be https://vyomi.cloud (with https), not http://.
264
+ No Vyomi credentials / session invalid
265
+ Create an access key at https://vyomi.cloud/admin/credentials and save it as ~/.vyomi/credentials. See: help credentials.
266
+ A key from your local portal (portal = http://localhost:8099) does not work against vyomi.cloud.
267
+ your Mesh Codespace is stopped
268
+ Start the Mesh in the Vyomi console, wait until it says ready, then retry.
269
+ Permission denied (publickey) on a VM
270
+ Use the Mesh's VM key and the 'ubuntu' user. See: help ssh.
271
+ REMOTE HOST IDENTIFICATION HAS CHANGED (host.vyomi)
272
+ Every Mesh is a new machine. Run: ssh-keygen -R host.vyomi -f ~/.vyomi/known_hosts and retry.
273
+ Mesh forward / SSH hangs or the console shows a loader forever
274
+ Restart the tunnel (it may hold a connection to a previous Mesh): stop 'vyomi-tunnel', start it again, reload the console tab.`,
242
275
  forward: `vyomi-tunnel forward <name> <local>:<remote>
243
276
 
244
277
  Listen on 127.0.0.1:<local> and forward to <name>:<remote> in your Mesh Codespace.
@@ -271,7 +304,7 @@ export async function main(argv) {
271
304
  if (!cmd || ["help", "-h", "--help", "-help", "-?"].includes(cmd) || rest.some((a) => ["-h", "--help", "-help"].includes(a))) { const topic = cmd === "help" ? rest[0] : (["-h", "--help", "-help", "-?"].includes(cmd) ? undefined : cmd); const t = topic && DETAILS[topic];
272
305
  if (topic && !t) { console.error(`vyomi-tunnel: no help for "${topic}".`); process.stdout.write(HELP); return 2; }
273
306
  process.stdout.write((t || HELP) + (t ? "\n" : "")); return cmd ? 0 : 2; }
274
- if (cmd === "--version" || cmd === "-v" || cmd === "version") { console.log(process.env.VYOMI_TUNNEL_VERSION || "vyomi-tunnel 1.2.0"); return 0; }
307
+ if (cmd === "--version" || cmd === "-v" || cmd === "version") { console.log(process.env.VYOMI_TUNNEL_VERSION || "vyomi-tunnel 1.2.1"); return 0; }
275
308
  const WS = createRequire(import.meta.url)(process.env.WS_PKG || "ws");
276
309
  // Mesh over the user's own ssh session (`--codespace <name>` or VYOMI_MESH_CODESPACE): no relay, no token (mesh-ssh.mjs).
277
310
  const ci = rest.indexOf("--codespace");
@@ -56,7 +56,7 @@ if (process.argv[2] && !process.argv[2].startsWith("-")) { console.error(`vyomi-
56
56
  { const { requireSession } = await import("./credentials.mjs"); const a = await requireSession();
57
57
  if (a.error) { console.error("vyomi-tunnel: " + a.error); process.exit(a.code === "NoCredentials" ? 2 : 1); } }
58
58
 
59
- const VERSION = "1.2.0";
59
+ const VERSION = "1.2.1";
60
60
  const PORT = Number(process.env.RELAY_PORT || 8090);
61
61
  // Mesh plane: the Nano console reaches the user's Mesh Codespace THROUGH this relay (the link runs on the laptop, over their own
62
62
  // `gh codespace ssh`; opened on first use). No hosted relay, no MESH_RELAY_URL. Needs a Pro/Max key + a running Mesh Codespace.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vyomi-tunnel",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Vyomi-Nano local reverse-tunnel — reach the in-browser cloud simulator from any local SDK/CLI. The install-once, zero-cloud counterpart to the hosted Cloudflare relay; the Nano tab auto-detects it and prefers it.",
5
5
  "type": "module",
6
6
  "bin": {