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
mount support on windows without cgo #2862
base: master
Are you sure you want to change the base?
Conversation
fgma, is it possible for you to update this PR for curent master branch ? |
Yes I saw this PR as well but haven't tested it yet. I am currently using winfsp to mount sshfs network drives and it works really well. What method do you currently use to mount backups on windows? Fuse, webdav or another? I quickly tried to integrate your PR into the master branch but there have been a lot of commits since then, I think it would be wise to let you review your code (if you find it useful). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Does anyone know of any other option besides WSL?
|
Replying to helpfully bump this PR. |
I'd really like to finish this but I've not received any feedback yet. I've already asked in #2860 because it is related and could share code. |
The main reason why there hasn't been any feedback to this PR so far is that it is an absolutely gigantic amount of code. Properly reviewing the whole PR would require at least a full day, most likely more. The other problem is that the PR looks like it needs a substantial rewrite. So I'm afraid that the feedback will be mostly bad news: As already indicated by the number of added and removed lines of code, there is essentially zero code sharing between the existing fuse implementation and this PR. That is not acceptable, we cannot maintain two completely separate implementations as that will just end in a maintenance nightmare. The only acceptable way to structure the implementation is to separate the fuse code into a data model (shared by both implementations!!!) and presentation code which just transforms that data model into the format required for the particular fuse library. For the snapshot pseudo-directories most of the refactoring work is done by #2913 which separates things into a generic SnapshotDirStructure and the fuse library adaption by SnapshotDir. To name a few specific problems (the list is probably far from complete):
My impression after scrolling through the code is that the The path walking must be implemented generically and not repeated for each node (and especially not for each method), such that the resulting interface is similar to that of the currently used fuse library. If that would be too inefficient, I'd be willing to settle for one The other question is the choice of fuse library. Is cgofuse + winfsp the only possible solution for windows? Or is there maybe a CGO-less fuse library which works for all operating systems? The latter would be a much better solution than having two different fuse libraries in use. Especially, as the currently used library is no longer supported for recent macOS versions. |
If this PR would require that much rewriting maybe it would be better to put this work into WebDAV (#485)? Especially as this could also help Mac users accessing snapshots in an easier way (#3096). Or would cgofuse also solve the Mac issue? Personally I have nearly no programming knowledge but wanted to dive into Go since a while. But I guess as a first "something" after working through a book or two this might be a bold project... |
I consider the current state of this PR a tech demo. As I already stated in my initial post:
To continue working on it I need some specific feedback about the future of restic:
|
Is it possible to serve owership and permissions with webdav backend? I guess this is not possible. If so Webdav can't be a replacement for fuse mounts. |
|
@JsBergbau |
I took a look myself and ended up with the following libraries: #3096 (comment) . Of those only cgofuse works on Windows and does not require CGO. If we decided to accept cgofuse, then we'd also get support for several other operating systems for free. In short, we can stick with cgofuse for windows. |
What does this PR change? What problem does it solve?
This PR adds mount support on window using winfsp and cgofuse. Besides the name implies it it does NOT require cgo on windows and cross compiles without any problems.
Basic functionality is working but code needs cleanup and is lacking documentation and refactoring.
To test it I prepared zip file that contains some bat files to demo the functionality:
mount_demo.zip
Please compile restic for windows and install winfsp. Then unzip the provided zip file. Copy the compiled binary to the mount_demo folder and run demo.bat. This will do the following:
If the drive does not show up immediately press F5 to refresh windows explorer.
I hope to get some feedback on how to continue working on this PR.
Was the change discussed in an issue or in the forum before?
#2791
Checklist
changelog/unreleased/
that describes the changes for our users (template here)gofmt
on the code in all commits