8000 feat(settings): private networks for web pages and feeds in Settings → Documents by adeelahmad · Pull Request #378 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(settings): private networks for web pages and feeds in Settings → Documents - #378

Merged
adeelahmad merged 2 commits into
mainfrom
claude/project-thread-ws42o4
Oct 15, 2026
Merged

adeelahmad merged 2 commits into
mainfrom
claude/project-thread-ws42o4

Conversation

@adeelahmad
@adeelahmad adeelahmad commented Oct 15, 2026 •
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: letting Lens fetch web pages, calendar feeds or videos from a private network (an intranet wiki, a NAS) meant editing archive.yaml or setting LENS_WEB_NETWORKS in .env and restarting. The error a blocked feed showed pointed there.

After: Settings → Documents has Private networks Lens may fetch from, one network per line (192.168.1.0/24). The settings API takes documents.web_networks, so an agent can set it too. The error now points at the setting.

How: documents.web_networks joins the editable settings, validated as a list of networks and de-duplicated. Loopback, 0.0.0.0/8 and link-local networks (which include cloud metadata addresses) are refused from the web app and stay server-only (archive.yaml or LENS_WEB_NETWORKS), so an admin session can't point Lens at the server itself. Networks set on the server show in the field and always stay: what Settings saves is added to them, and server ones it sends back are left out of the saved list.

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. (test_an_admin_allows_a_private_network_in_settings, test_the_servers_own_networks_stay_whatever_the_web_app_saves; __tests__/settings-web-networks.test.ts)
  • My change requires documentation updates, and I have updated docs/ accordingly. (configuration.md, api.md)
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. (n/a)

Done questions (AGENTS.md)

  • Goal: one more .env-only setting is in the web app; merged on green CI.
  • Agents: PUT /api/v1/settings/documents with web_networks.
  • Zero setup: no new step; empty by default as before.
  • Fewest clicks: one field, saved with the rest of Documents.
  • Configurable: editable in Settings with an empty default; not in the wizard.
  • Light: n/a.
  • Private and secure: server-only networks can't be added from the web app; threat-model.md rows updated and the YAML hash refreshed.
  • Cost: n/a.
  • User decides: nothing private is reachable until an admin adds it; default unchanged.
  • Upgrades: networks in archive.yaml or .env keep working and stay after a save; no stored-data change.
  • Honest: docs say where it's set.
  • Tests and docs updated; OpenAPI unchanged (make openapi).
  • Open: CIDR notation; no new dependency.
  • Reported in the thread; refine later: none.

🤖 Generated with Claude Code

https://claude.ai/code/session_014Y4mUBxDN6pTR2fykqrfYV

…→ Documents

documents.web_networks was set only in archive.yaml or LENS_WEB_NETWORKS in .env. It's now a
list in Settings → Documents (and the settings API), so an admin or their agent can let Lens
fetch pages, calendar feeds and videos from an intranet without editing files. Loopback,
0.0.0.0/8 and link-local networks (cloud metadata) stay server-only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Y4mUBxDN6pTR2fykqrfYV
…s own

The web app's list replaced archive.yaml's and LENS_WEB_NETWORKS's, so
saving Settings → Documents dropped the server's networks, and one the web
app can't allow (loopback) couldn't be saved back at all. The web app's
networks are now added to the server's, and the server's ones it sends
back are left out of what it saves.

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 Oc A124 t 15, 2026
@adeelahmad
adeelahmad merged commit b02277f into main Oct 15, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-ws42o4 branch October 15, 2026 01:21
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

0