Skip to content

feat(cli): plain http to a remote farm by explicit opt-in - #1850

Merged
V3RON merged 14 commits into
mainfrom
task/1839
Nov 25, 2026
Merged

V3RON merged 14 commits into
mainfrom
task/1839

Conversation

@V3RON

@V3RON V3RON commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1839

Status

Implement: done Review: round 1 + fix-check passed, 2 fixed, 0 open Hardware: n/a Gate: not run (the merge step was not permitted in this session)
Next: gate (.agents/scripts/merge-pr.sh 1850)

Assumptions

none

Done when

  • pnpm test:changed and pnpm typecheck pass; the B1–B4 tests pass with pnpm exec vitest run --project unit <file>. — pnpm test:changed (2509 passed) and typecheck in the build and audit runs at 52186a2; the touched test files re-run green at 664f0c8
  • The website builds: pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjs. — run by the build and again by the audit, both passed
  • The pages in B5 name the opt-in. — reference/cli.mdx, reference/node-client.mdx, using-devices/node-client.mdx updated; the --help text is asserted in src/cli/insecure-http.test.ts

Completion conditions of #1834:

  • simlock whoami --url http://<non-loopback host> --allow-insecure-http and the same with SIMLOCK_ALLOW_INSECURE_HTTP=1 reach that farm; simlock tunnel, simlock files, simlock lease and simlock mcp do too. — B2 cases in src/cli/insecure-http.test.ts, tunnel.test.ts, index-files.test.ts, index-remote-reconnect.test.ts, index-remote-mcp.test.ts
  • Without the opt-in, the same commands exit 2 with a message that names --allow-insecure-http and SIMLOCK_ALLOW_INSECURE_HTTP=1. — B1 table in src/cli/insecure-http.test.ts
  • connectSimlock and connectSimlockAdmin with allowInsecureHttp: true reach an http:// farm; without it they throw a TypeError that names allowInsecureHttp. — B4 cases in src/simlock-client/remote.test.ts
  • The CLI reference and the Node client pages describe the opt-in. — B5 website rows in this PR

Review

Spec review: 1 blocking, 1 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 1 blocking, 1 fixed, 0 notes.
Rounds: 1. Tokens: 2.4M.
Runs: 8. Cost USD: 3.2558. Agent seconds: 1352.

Assessment: complete

Written by an agent.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds allowInsecureHttp to client APIs and adds --allow-insecure-http and SIMLOCK_ALLOW_INSECURE_HTTP to the CLI. When enabled, farm URL validation permits HTTP for any host, and remote connections use the corresponding WebSocket URL. CLI and client tests cover opt-in, rejection, and connection flows. Documentation describes the options and the unencrypted transmission of tokens over HTTP.

Suggested reviewers: leonardoxr

Merge Risk: Minimal · up to 664f0

This change adds an explicit opt-in for connecting to a remote farm over plain HTTP, and it is refused by default with messages that name the opt-in. I found no concrete defect, and the documentation warns that tokens travel unencrypted over HTTP. The remaining uncertainty is that I could not independently confirm the author-reported test results.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a CLI and client opt-in that allows plain HTTP to a remote farm. The raw summary covers the flag, env var, and Node option that implement it. The title is specific and…
Description check Passed The description links issue #1839 and reports the status of the tests, website build, and documentation for the insecure-HTTP opt-in. It names the test files and CLI, Node client, and docs pages that …
Linked Issues check Passed Directly linked issue #1839 is the only active target. Its coding requirements and the changes that implement them:

- Rejection without opt-in (B1): checkedFarmUrl in `src/simlock-client/farm-url.t…
Out of Scope Changes check Passed Every changed area maps to an objective in #1839 or supports one:

- Opt-in plumbing: src/cli/index.ts, environment.ts, types.ts, tree.ts, connect.ts, commands/tunnel.ts, `commands/lease.t…
Full details: Title check

Explanation

The title names the main change: a CLI and client opt-in that allows plain HTTP to a remote farm. The raw summary covers the flag, env var, and Node option that implement it. The title is specific and matches the changeset.

Full details: Description check

Explanation

The description links issue #1839 and reports the status of the tests, website build, and documentation for the insecure-HTTP opt-in. It names the test files and CLI, Node client, and docs pages that the changeset touches. It is related to the changeset.

Full details: Linked Issues check

Explanation

Directly linked issue #1839 is the only active target. Its coding requirements and the changes that implement them:

  • Rejection without opt-in (B1): checkedFarmUrl in src/simlock-client/farm-url.ts accepts insecure.allowed and a hint. Non-loopback http:// is refused unless opted in, and the refusal names the opt-in. src/cli/connect.ts (checkedFarmOrigin) passes the flag and variable through. src/cli/insecure-http.test.ts and src/cli/tunnel.test.ts assert the exit 2 refusal and its text.
  • Acceptance through CLI flag, environment variable, and Node option (B2): src/cli/index.ts parses --allow-insecure-http (no value accepted). src/cli/environment.ts maps SIMLOCK_ALLOW_INSECURE_HTTP. src/cli/connect.ts passes the state to connectSimlockAdmin. src/mcp/connect.ts and src/mcp/main.ts pass it to connectSimlock. src/simlock-client/remote-connector.ts accepts allowInsecureHttp only when exactly true. Tests cover whoami, lease, tunnel, files, and mcp in index-files.test.ts, index-remote-reconnect.test.ts, and index-remote-mcp.test.ts.
  • No change to other behavior (B3): ws://, ftp://, missing scheme, paths, the 2049-character limit, --allow-insecure-http=1, and local mode keep their prior handling. The tunnel tests cover the length and host cases. Local-mode tests cover leftover variables.
  • Node client (B4): src/client/index.ts, src/admin/index.ts, and src/simlock-client/remote.test.ts add allowInsecureHttp. Non-boolean values such as "yes" throw a TypeError that names the option. true with ws:// or with endpoint and no url is handled as specified.
  • Documentation (B5): reference/cli.mdx, reference/node-client.mdx, and using-devices/node-client.mdx name the opt-in. The --help text is asserted in insecure-http.test.ts.

The author reports pnpm test:changed (2,509 passed), typecheck, and the website build as passing. This assessment relies on the diff summary and the test descriptions. It did not re-run tests or read the test bodies. No requirement is unmet on the available evidence.

Full details: Out of Scope Changes check

Explanation

Every changed area maps to an objective in #1839 or supports one:

  • Opt-in plumbing: src/cli/index.ts, environment.ts, types.ts, tree.ts, connect.ts, commands/tunnel.ts, commands/lease.ts, src/mcp/main.ts, src/mcp/connect.ts, src/admin/index.ts, src/client/index.ts, and src/simlock-client/* carry the flag, variable, or Node option to the connection points named in the issue. lease.ts switches to checkedFarmOrigin, which the issue's "same URL rule" requirement needs.
  • Supporting tests: insecure-http.test.ts, tunnel.test.ts, index-files.test.ts, index-remote-reconnect.test.ts, index-remote-mcp.test.ts, and remote.test.ts cover the listed behaviors.
  • Documentation: the website pages and the AGENTS.md URL-rule lines are required by the issue's documentation rule and the cited architecture and ADR rules.

No change unrelated to #1839 appears in the summary. Limitation: the raw summary does not list every file. This verdict covers only the files it lists.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 286013f3-1f69-4fe6-a5f1-2bca3463c9d0
Commits

Reviewing files that changed from the base of the PR and between 200afe5 and 664f0c8.

Files selected for processing: 22

  • src/admin/index.ts
  • src/cli/commands/lease.ts
  • src/cli/commands/tunnel.ts
  • src/cli/connect.ts
  • src/cli/environment.ts
  • src/cli/index-files.test.ts
  • src/cli/index-remote-mcp.test.ts
  • src/cli/index-remote-reconnect.test.ts
  • src/cli/index.ts
  • src/cli/insecure-http.test.ts
  • src/cli/tree.ts
  • src/cli/tunnel.test.ts
  • src/cli/types.ts
  • src/client/index.ts
  • src/mcp/connect.ts
  • src/mcp/main.ts
  • src/simlock-client/farm-url.ts
  • src/simlock-client/remote-connector.ts
  • src/simlock-client/remote.test.ts
  • website/src/content/docs/docs/reference/cli.mdx
  • website/src/content/docs/docs/reference/node-client.mdx
  • website/src/content/docs/docs/using-devices/node-client.mdx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@V3RON

V3RON commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 52186a2
Round fix-check: 664f0c8

Runs: 8. Cost USD: 3.2558. Agent seconds: 1352.
Tokens input 283, output 82317, cache read 8151716, cache write 445728.
- build implementer: claude-sonnet-5-5 550 s $1.107
- audit implementer: claude-sonnet-5-5 147 s $0.2327
- review 1 reviewer: claude-sonnet-5-5 282 s $0.2375
- review 1 spec: claude-sonnet-5-5 38 s $0.2181
- review 1 code behaviour: claude-opus-5-5 193 s $1.0047
- review 1 claims: claude-sonnet-5-5 35 s $0.1849
- fix 1 implementer: claude-sonnet-5-5 62 s $0.1718
- review fix-check reviewer: claude-sonnet-5-5 45 s $0.0991
Finding outcomes: {"fixed":2}. Classes: {"documentation 7":1,"testing 3":1}.
{"findings":[{"id":"R1","role":"claims","class":"documentation 7","outcome":"fixed","fix":"664f0c8ab9504dc22e0479dae14c09ba7e186084","path":"src/simlock-client/AGENTS.md","round":"1"},{"id":"R2","role":"spec","class":"testing 3","outcome":"fixed","fix":"664f0c8ab9504dc22e0479dae14c09ba7e186084","path":"src/cli/insecure-http.test.ts","round":"1"}]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 25, 2026 09:00
@V3RON
V3RON merged commit bceb8d7 into main Nov 25, 2026
56 checks passed
@V3RON
V3RON deleted the task/1839 branch November 25, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant