Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mounting functionality for latest versions of macOS using NFS #7254

Merged
merged 6 commits into from
Oct 6, 2023

Commits on Oct 4, 2023

  1. vfs: [bugfix] Implement Name() method in WriteFileHandle and ReadFile…

    …Handle
    
    Name() method was originally left out and defaulted to the base
    class which always returns empty. This trigerred incorrect behavior
    in serve nfs where it relied on the Name() of the interafce to figure
    out what file it was modifying.
    
    This method is copied from RWFileHandle struct.
    
    Added extra assert in the tests.
    Saleh Dindar committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    af044ea View commit details
    Browse the repository at this point in the history
  2. vfs: [bugfix] Update dir modification time

    A subtle bug where dir modification time is not updated when the dir already exists
    in the cache. It is only noticeable when some clients use dir modification time to
    invalidate cache.
    Saleh Dindar committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    fb26cd4 View commit details
    Browse the repository at this point in the history
  3. vfs: Add go-billy dependency and make sure vfs.Handle implements bill…

    …y.File
    
    billy defines a common file system interface that is used in multiple go packages.
    vfs.Handle implements billy.File mostly, only two methods needed to be added to
    make it compliant.
    
    An interface check is added as well.
    
    This is a preliminary work for adding serve nfs command.
    Saleh Dindar committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    17524e0 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2023

  1. serve nfs: new serve nfs command

    Summary:
    Adding a new command to serve any remote over NFS. This is only useful for new macOS versions where FUSE mounts are not available.
     * Added willscot/go-nfs dependency and updated go.mod and go.sum
    
    Test Plan:
    ```
    go run rclone.go serve nfs --http-url https://beta.rclone.org :http:
    ```
    
    Test that it is serving correctly by mounting the NFS directory.
    
    ```
    mkdir nfs-test
    mount -oport=58654,mountport=58654 localhost: nfs-test
    ```
    
    Then we can list the mounted directory to see it is working.
    ```
    ls nfs-test
    ```
    Saleh Dindar committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    baacb23 View commit details
    Browse the repository at this point in the history
  2. nfsmount: New mount command to provide mount mechanism on macOS witho…

    …ut FUSE
    
    Summary:
    In cases where cmount is not available in macOS, we alias nfsmount to mount command and transparently start the NFS server and mount it to the target dir.
    
    The NFS server is started on localhost on a random port so it is reasonably secure.
    
    Test Plan:
    ```
    go run rclone.go mount --http-url https://beta.rclone.org :http: nfs-test
    ```
    
    Added mount tests:
    ```
    go test ./cmd/nfsmount
    ```
    Saleh Dindar committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    321a3a8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    35a5e5e View commit details
    Browse the repository at this point in the history