8000 feat(shares): serve the file tree over NFS, read-only, to allowed networks by adeelahmad · Pull Request #295 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(shares): serve the file tree over NFS, read-only, to allowed networks - #295

Merged
adeelahmad merged 7 commits into
mainfrom
claude/project-thread-plbel0
Oct 11, 2026
Merged

adeelahmad merged 7 commits into
mainfrom
claude/project-thread-plbel0

Conversation

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

Requested by Adeel · project thread

Before: the graph as files (#290) could only be browsed through the API and MCP.

After: Settings → NFS share serves it read-only over NFS to the networks you allow, showing what one chosen account sees. Off by default; published on host port 12049 (LENS_NFS_PORT), on LENS_SHARE_BIND/LENS_BIND.

How: a worker (lease on app_service:nfs, like the local model) runs rclone serve nfs --read-only (rclone already in the image, MIT) on 127.0.0.1 over an :s3: remote at s3.internal_endpoint (the S3 server's loopback copy in the worker, so the S3 share needn't be on), signed in with s3.service_key(account, "nfs"), revoked when the share stops. share_relay.py holds the published port and closes connections from outside nfs.allowed_networks before rclone sees them; allowed networks change live. Status at GET /settings/nfs/status.

Draft until #324 (S3 server, provides s3.py) merges. End-to-end check run locally with #324 merged in, real rclone 1.75.1 and seeded data: the runner starts, a hand-written NFSv3 client does MNT / then READDIR through the relay and gets the namespaces (calls, pods); rclone lsf over the same remote lists Collections/… and Entities/… files; the service key is gone after stop. Kernel mount wasn't possible in the test container (no NFS in its kernel).

Done questions

  1. Goal: NFS share of the graph tree; merges after feat(shares): the graph over S3 and WebDAV, read-only #324, on green.
  2. Agents: yes, PUT /settings/nfs and GET /settings/nfs/status.
  3. Zero setup: yes, rclone ships in the image; one switch.
  4. Fewest clicks: one switch; account defaults to the first admin, networks to private ranges; Settings shows the mount command.
  5. Configurable: enabled, account, allowed_networks, port in Settings; host port/bind are compose env like sensors.
  6. Light: off by default; one rclone process only when on.
  7. Private: read-only, one account's view, network allowlist, refuses 0.0.0.0/0; threat model P-NFS + entry point + downstream responsibility.
  8. Cost: n/a, no model calls.
  9. User decides: off by default, no defaults changed.
  10. Upgrades: n/a, new settings section with defaults and an app_service row; no stored-data change.
  11. Honest: docs/file-shares.md says NFSv3 has no login and what that means.
  12. Tested: tests/domain/test_nfs_share.py (relay, runner with stand-in rclone, key revoke, settings, API); openapi via make openapi; docs + mkdocs nav.
  13. Open: NFS, rclone (MIT).
  14. Reported in the thread; refine later in docs/file-shares.md (NFSv4/Kerberos, per-namespace shares, Synology/QNAP ports).

🤖 Generated with Claude Code

https://claude.ai/code/session_01EKnSy4KKeNYsqhnXvWVz97

…works

A worker runs rclone serve nfs --read-only over Lens's own S3 server as one
chosen account, behind a relay that turns away clients outside
nfs.allowed_networks. Off by default; Settings → NFS share; published on
host port 12049.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EKnSy4KKeNYsqhnXvWVz97
@adeelahmad adeelahmad self-assigned this Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EKnSy4KKeNYsqhnXvWVz97
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EKnSy4KKeNYsqhnXvWVz97
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EKnSy4KKeNYsqhnXvWVz97
Copy link
Copy Markdown
Owner Author

Other projects failed before any check ran: astral-sh/setup-uv@v7 couldn't fetch uv's version list from raw.githubusercontent.com (##[error]fetch failed), nothing in this diff. I'll re-run the failed job once the rest of this run finishes; if it fails the same way again I'll pin a uv version in the workflow so setup doesn't depend on that fetch.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EKnSy4KKeNYsqhnXvWVz97
@adeelahmad
adeelahmad marked this pull request as ready for review October 11, 2026 00:58
The throttled sign-in test read the button right after the alert appeared,
but the cool-down state is set in an effect that can land a tick later,
which failed CI on an unrelated PR.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EKnSy4KKeNYsqhnXvWVz97
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EKnSy4KKeNYsqhnXvWVz97
@adeelahmad
adeelahmad merged commit 55bcc80 into main Oct 11, 2026
18 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-plbel0 branch October 11, 2026 01:19
adeelahmad added a commit that referenced this pull request Oct 11, 2026
…monitoring switch as built (#351)

"Ask" names the built-in Telegram bot (#293) and Slack app (#287); "Connect your agents" adds mounting the graph's
files read-only over S3, WebDAV, NFS or SMB (#324, #295, #305) and copying the MCP address from the account menu
(#340); "Watch it run" says one switch in the web app starts Prometheus and Grafana (#337); "Light by default" adds
the cloud model presets (#334). The docs index gains the NFS and SMB pages, and "In progress" keeps only open PRs.


Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS

Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
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