I looked at the docs to see if what I suggest here can already be achieved but didn’t succeed to find something - if I overlooked something I am very sorry
My Situation: I synchronize stuff from my NAS to ACD, and I want to have some stuff crypted, other stuff not.
By setting up a config for ACD “acd:” and a crypt config for the folder that contains secret material “secret:” pointing to acd:/secret and syncing accordingly I easily achieve the following on ACD
Which is what I want to achieve on ACD - public parts are not encrypted, private things are.
Now comes my question/feature wish:
For making use of ACD on the road, I mount “acd:” on my laptop via rclone. But to make any use of anything that is below /secret/ I have to mount additionally the “secret:” config to another point on my laptops, because the “acd” mount will of course show everything under /secret/ as random gibberish.
What I would like to see is rclone recognizing, that there are crypt configs for folders somewhere inside of “acd:” and - when mounting acd: - transparently mount the “secret:” at it’s “correct” place inside of the ACD folder tree, essentially giving me exactly the layout as it is on my NAS.
So “secret:” would basically be mounted on top of the acd:/secret folder transparently…
I hope I made myself clear about what I want to achieve
Regards, and thanks for the very cool work so far!
2016/12/09 23:47:48 mount helper error: fusermount: bad mount point /mnt/secret: Permission denied
2016/12/09 23:47:48 Fatal error: failed to mount FUSE fs: fusermount: exit status 1
This is what happens when trying to mount on secret on top of acd.
I thought about unionfs, but I think it can’t do what I want, as I am not looking for a union of both branches, but the secret folder on ACD should be completely invisible after the secret: mount is done “over” it.
On top, it would be pretty cool not to have to re-build the tree manually, but rclone (and just one rclone instance) recognizing the layout from its config definitions.
But having to do that somehow defeats the original feature request to have a very simple. non-root possibility tp mount the “full” tree. If rclone would internally route some parts of the tree through the crypt layer and some not (according to the config file), there would be no problem with fuse as there would only be one instance of rclone that is running, and only one mount point.
Just a small question regarding the procedures here (sorry if I didn’t see/understand some obvious docs) - for a feature request, is putting it in the forum as a feature the right thing or is putting some issue in github what I am expected to do?
I think my preferred option would be to make the two mounts work as described in my original answer. That is a more general purpose solution and doesn’t complicate the internals of rclone any more. Can you make that work for you?
If it would work exactly as you describe it (no need for doing it as root, or allow-other or other permission changing stuff) I could live with it being two calls to rclone mount. Having to use --allow-non-empty I don’t see as a problem. But having to use root or playing with permissions is
The unfortunate side effect would be that in my desktop environment I would still see two (or more - I personally have already two encrypted sub dirs on ACD and there will be more) different mount points that can/must be unmounted separately, which I wanted to avoid with my initial approach.
I have one more question regarding the way you are going to implement the topic.
With your approach, I would (in my case) still have to do 3 rclone mount calls to contruct my tree. No problem with that, I have a script that does that currently for me (just side by side and not mounted “in tree” over each other)
But - to put the mounts into the background, I essentially have something like this (rem1 containing two folders wth crypted content, that is made accessible as two crypted remotes rem2 and rem3)
rclone mount rem1: /acd/path1 &
rclone mount rem2: /acd/path2 &
rclone mount rem3: /acd/path3 &
Note the “&” to put it into the background…
After your enhancement, my script will look something like this (details omitted)
rclone mount rem1: /acd/path1 &
rclone mount rem2: /acd/path1/foo/path2 &
rclone mount rem3: /acd/path1/bar/path3 &
Now I wonder: will this work, or will there be race conditions given by the fact that I put 3 mounts into the background. I already see today that the mounts will not consistently happen in the order I start them (which is not surprising)
Or to put it in other words: If the second mount happens before the first one - will the system just fail or magically somehow the second mount will still shadow the directory of the crypted files in rem1? I somehow doubt that…
As I want to have the mount be in the background, how would I ensure the right order?
My original idea obviously wouldn’t have that problem as one rclone instance would only result in mount for the whole tree…
or better, wait for the mount to really appear, thats what i do when mounting multiple ACD mounts in a bash script. a simple while loop will do the trick. same thing for unmounting
well… the sleep 1 version is… really ugly and I have been in places with bad connection where I’d rather have needed a sleep 3 to be sure it works…
The while loop… having a tight spinning loop for something that may potentially fail in the sense that the break criteria might never appear… it’s also getting to look like a very complicated and non pretty solution for the desired effect
Well of course I could do things like waiting only a certain time, and fail if a mount is not working, unwinding all the already successful mounts prior to the fail. But having to script that in bash doesn’t look like a rewarding job to me.