Skip to content

Plain http to a remote farm by explicit opt-in: --allow-insecure-http, SIMLOCK_ALLOW_INSECURE_HTTP, allowInsecureHttp #1839

Done

Description

@V3RON

Part of #1834.

Scope

A caller who passes --allow-insecure-http, sets SIMLOCK_ALLOW_INSECURE_HTTP=1, or gives a Node client allowInsecureHttp: true reaches a farm at http://<any host> from every CLI command, simlock tunnel, simlock files, simlock mcp, connectSimlock and connectSimlockAdmin. Without it, the refusal names the opt-in.

If it goes wrong: a command checks the URL a second time without the opt-in and fails after it connected, or a leftover variable breaks a local command.

Technical spec

Commit 200afe5.

Rows

Behaviours: B1, B2, B3, B4, B5
Interfaces: I1, I2, I3, I4, I5
Existing code: X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14

Facts

# Fact Source
F1 The tunnel tests assert today's scheme words for two inputs: http://10.0.0.5:7300 (refused for its host, so it gains I1's hint) and a 2049-character https:// URL (refused by the length step, which shares the scheme words and keeps them with no hint) src/cli/tunnel.test.ts:117 (host), :155-157 (length)
F2 checkedFarmUrl on main accepts https:// and loopback http:// and refuses http://100.75.181.35:4700, http://127.0.0.2:4700, ws://, ftp:// and a URL with no scheme with the scheme message node --experimental-strip-types on a script calling src/simlock-client/farm-url.ts at 200afe5; output in the feature's Examples

Modules touched

src/simlock-client (farm-url.ts, remote-connector.ts), src/client, src/admin, src/cli (index.ts, environment.ts, types.ts, tree.ts, connect.ts, commands/tunnel.ts, commands/lease.ts, commands/mcp.ts), src/mcp (main.ts, connect.ts), website reference/cli.mdx, reference/node-client.mdx, using-devices/node-client.mdx. Searches: checkedFarmUrl, remoteConnectOptions, checkedFarm(, RemoteFarm, connectToFarm, only for 127.0.0.1.

flowchart LR
  cli[src/cli router] --> conn[src/cli/connect.ts]
  cli --> tun[commands/tunnel.ts]
  conn --> admin[src/admin]
  conn --> mcp[src/mcp]
  mcp --> client[src/client]
  admin --> rc[simlock-client/remote-connector.ts]
  client --> rc
  rc --> fu[simlock-client/farm-url.ts]
  conn --> fu
  tun --> fu
Loading

Rules in play

  • documentation.md rule 9: the new flag, variable and option are public surface; B5 updates the pages in this PR.
  • architecture.md rule 8: the CLI only parses the flag and variable and passes them on; the rule itself stays in checkedFarmUrl.
  • ADR 0081 §3: every frontend keeps the one URL rule, now with the opt-in.
  • src/simlock-client/AGENTS.md and src/client/AGENTS.md: the URL rule line stays true; add the opt-in to it.

Tests

Seam: runCli with a faked environment, modelled on src/cli/index-remote-mode.test.ts and src/cli/tunnel.test.ts; connectSimlock/connectSimlockAdmin with a fake webSocket, modelled on src/simlock-client/remote.test.ts.

  • B1: an http farm URL to a non-loopback host with no opt-in exits 2 with I1's hinted refusal: whoami --url; SIMLOCK_URL; tunnel forward 8081; files list; mcp; an empty variable; https:// and loopback http:// not refused
  • B2: with the flag before or after the command, or the variable 1, the command reaches the farm at ws:///http://: whoami; lease through its reconnect notice; tunnel forward 8081; files list; mcp tool-call connect
  • B3: the opt-in changes nothing else: ws://, ftp://, no scheme; a path; 2049 characters; --allow-insecure-http=1; flag with --local and no URL; variable true with an http URL, and with no URL; leftover SIMLOCK_URL with --local: tunnel vs whoami, variable 1 and true
  • B4: Node clients: no option, false, true (client and admin); "yes"; true with endpoint and no url; true with ws://
  • B5: the website rows and the --help text name the opt-in

Done when

  • pnpm test:changed and pnpm typecheck pass; the B1–B4 tests pass with pnpm exec vitest run --project unit <file>.
  • The website builds: pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjs.
  • The pages in B5 name the opt-in.

Out of scope

Everything under the feature's Non-goals.

Depends on

Written by an agent.

Activity

  1. added
    task:draft
    on Nov 25, 2026
  2. added
    task:ready
    and removed
    task:draft
    on Nov 25, 2026
  3. self-assigned this
    on Nov 25, 2026
  4. added a commit that references this issue on Nov 25, 2026
    bceb8d7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

task:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions