Repository navigation
feat(nfs): import files added over the NFS share - #540
Merged
Merged
Conversation
While nfs.add_files is on, rclone serves NFS without --read-only and with a VFS write cache under data_dir/cache/nfs: a file written to the share is put to Lens's own S3 server once it's closed, with the share's service key, and imported as nfs.account adds it. The S3 server tells the NFS key apart (file_key.service) so NFS writes follow nfs.add_files and are audited as coming over NFS. Off, the share is read-only as before; changing the setting restarts rclone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013sC1p4dJXjteytbxDXnk5g
17 of 23 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: the NFS share was served read-only, so
cponto a mounted share failed.After: a file copied into a collection's folder on the NFS share is imported a moment after it's closed, as the account the share shows the tree as (
nfs.account), with the same checks as an upload. A file Lens can't take shows in the share's log.How: while
nfs.add_filesis on, rclone serves NFS without--read-onlyand with a VFS write cache underdata_dir/cache/nfs. A closed file is put to Lens's own S3 server with the share's service key, and imported through the sameshare_import.Adderas S3, WebDAV and SMB. The S3 server tells the NFS key apart (file_key.service), so NFS writes follownfs.add_filesand are audited as coming over NFS. Changing the setting restarts rclone; off, the share is read-only as before.Motivation and Context
Adeel asked that any file added through Lens's file protocols be imported automatically. #408 did S3 and WebDAV and #519 did SMB; this is the last one.
Steps to reproduce (if appropriate):
Turn on the NFS share, mount it (
mount -t nfs -o port=12049,mountport=12049,nfsvers=3,tcp host:/ /mnt/lens),cp talk.pdf /mnt/lens/pods/Collections/Talks/and look at the Talks collection.Types of changes
!in the title)Checklist:
make hookschecks it on commit).test_s3_writes.pytest_the_nfs_shares_key_follows_nfs_add_files,test_nfs_share.pyupdated.ci/local-ci.sh: backend, Next.js, pre-commit and the upgrade check pass.docs/accordingly (docs/file-shares.md, Adding files;docs/file-tree.md).## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
nfs.add_filesis in the settings API.cpor drag files in.nfs.add_files(on) is a switch in Settings, NFS share; not in the wizard.nfs.accountonly, fromnfs.allowed_networks, checked as uploads, never over Lens's own files. Threat model (P-NFS, entry point) updated in md, yaml and json.docs/requirements.mdname the tests. Tested for real with rclone 1.75.1 and libnfsnfs-cp; CI runs the unit tests, not a mounted share.make openapiregeneratedopenapi.jsonand the client.docs/file-shares.md): telling the client when Lens turns a file down, and making empty new folders collections at once.share_importadder.Generated by Claude Code