Skip to content

feat(settings): change network reach and the edition from the web app - #380

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-ws42o4
Oct 15, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-ws42o4

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: whether the web app is reachable from other devices on the network (LENS_PUBLIC) and the edition (LENS_TARGET, full or lean) were chosen on the install line, and changing either meant running the line again in a terminal.

After: Settings › Access & embedding has Reachable from other devices on this network, and Settings › Components has the edition (Full, with LibreOffice and Chromium, or Lean). Changing either says what will happen and applies with one button: the machine's upgrade agent runs the install again for the version running, and Lens restarts, the same way Settings › HTTPS opens its ports. Without an agent, the section shows the install line to run. Agents use GET/PUT /api/v1/admin/install and the MCP tools install_settings and set_install_settings.

How: updates.reconfigure now takes public and target next to https and writes only the lines set, so an HTTPS request is unchanged. lens-upgrade.sh reads public= (0|1) and target= (full|lean) and passes them to install.sh; anything else is dropped. The current values come from LENS_BIND and LENS_TARGET, which docker-compose.prod.yml now passes to the API (a microsandbox already has them); started any other way, the UI says it can't tell rather than guess. Rebased onto the upgrade page from #262: the agent's rollback and step reporting are kept, and the new run fields sit alongside step and restore.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests. (tests/api/test_install_settings.py, MCP tools in test_mcp.py, __tests__/install-settings.test.tsx)
  • My change requires documentation updates, and I have updated docs/ accordingly. (updates.md "Setting the machine up again", configuration.md, get-started.md, mcp.md)
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Done questions (AGENTS.md)

  • Goal: two install-line-only choices are now in the web app; merged on green CI.
  • Agents: GET/PUT /api/v1/admin/install, MCP install_settings / set_install_settings.
  • Zero setup: uses the upgrade agent install.sh already sets up; no new step.
  • Fewest clicks: one toggle and one Apply, no confirm dialog; switching back cancels.
  • Configurable: both editable in Settings, defaulting to what the install chose; not in the wizard.
  • Light: Lean stays one click away; nothing new runs by default.
  • Private and secure: admin-only, audited (lens.install); the agent accepts only 0|1 and full|lean; threat-model.md/yaml/json record the new surface.
  • Cost: n/a.
  • User decides: nothing changes until an admin applies it; defaults unchanged.
  • Upgrades: older run records simply lack the new optional fields; no upgrade step needed.
  • Honest: docs label it built; unknown values are shown as unknown.
  • Tests, docs and generated files (make openapi) updated.
  • Open: n/a.
  • Reported in the thread; refine later (docs/updates.md): Windows installs get the Linux/Mac line; installs not started by install.sh, compose or a microsandbox show both as not known.

🤖 Generated with Claude Code

https://claude.ai/code/session_014Y4mUBxDN6pTR2fykqrfYV


Generated by Claude Code

Settings › Access & embedding gets "Reachable from other devices on this
network", and Settings › Components the edition (Full or Lean). Changing
either says what will happen and applies with one button: the machine's
upgrade agent runs install.sh again for the version running with
LENS_PUBLIC or LENS_TARGET, and Lens restarts, the way Settings › HTTPS
opens the HTTPS ports with LENS_HTTPS. Without an agent the section shows
the install line to run. Before, both needed the install line again.

Choices made:
- Current values come from the environment Lens was started with.
  docker-compose.prod.yml passes LENS_TARGET (${LENS_TARGET:-full}, the
  build target's own default) and LENS_BIND (${LENS_BIND:-127.0.0.1}, the
  web port's) to the API and workers; a microsandbox already exports .env.
  install.sh needs no change for it. Started any other way, both read as
  null and the UI says it can't tell, never a guess. A loopback LENS_BIND
  is "this machine only", any other address "reachable".
- updates.reconfigure takes https, public and target and writes only the
  lines that are set: an HTTPS request is byte for byte what it was.
  lens-upgrade.sh reads public= and target= with val, keeps only 0|1 and
  full|lean, passes LENS_TARGET (else .env's) and LENS_PUBLIC (empty when
  not asked, which is install.sh's own fallback to LENS_BIND).
- GET/PUT /api/v1/admin/install on the updates router (AdminReader,
  AdminWriter, audited as lens.install). PUT leaves alone what is so
  already, and with nothing left to change restarts nothing (200); without
  an agent it answers 409 with the line to run; `manual` has the line for
  each choice.
- MCP tools install_settings and set_install_settings, next to monitoring
  and set_monitoring, the comparable machine tools. The chat assistant's
  ops tools expose no machine changes, so none were added there.
- UI: no confirm dialog; switching back cancels; keeping Lens to this
  machine while the page is open at a network address warns that this
  browser may lose it there.
- Stored data: the run record gains optional public and target fields,
  read with .get and simply absent from older rows, so no upgrade step.
- threat-model.md records the new admin surface (the variants, the inbox
  lines and the endpoints); the YAML and JSON follow it.

Refine later (docs/updates.md): Windows installs get the Linux/Mac line;
installs not started by install.sh, compose or a microsandbox show both
as not known.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Y4mUBxDN6pTR2fykqrfYV
@adeelahmad adeelahmad self-assigned this Oct 15, 2026
@adeelahmad
adeelahmad merged commit 4052994 into main Oct 15, 2026
18 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-ws42o4 branch October 15, 2026 02:04
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.

2 participants