-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Implement managing user/group permission with unison #40
Comments
For unison, there is yet none, there is work undergo though #21 i think unison itself in its way of 2 way syncing will make it hard to cope with this mappings - i am not actively working on this though. If you want to use 2way sync with unison, your best bet is chaning your dev-image to run on specific uids matching your OSX probably - i yet do not know. I keep this issue open as a feature. |
I am very open minded here, but for know, this feature has to rely on contributions out from the community. I hope some people will have better/good ideas on this issue, as far as i know, it has yet not been tackled by any alternatives yet. So please, get involved or ask people to get involved on this issue :) |
I did some test and read the union doc. From the union doc https://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html
It's what I observe, changing user or group have no effect but permissions are synchronized. More doc:
So the way to "force" a user and group is to run unison has another user. It's also possible to sync owner and group (by name or numerically). |
The idea behind the PR linked an the new one #47 is to make unison sync the userid numerically. Say that you run In the volume container, files would belong to the user In the app container where you use the volume, you have to create an init script that change the uid of the user who needs permissions to write in the voume. Example for
To make your script portable, you can use the fact that the unison volume change the owner of the mounted folder to the appropriate id, so you could do something like:
where |
Is there any reason you pick a static 501? is this because of your OSX uid? couldnt we pick the uid, the app container potentially has, so the setting what is needed in docker-sync.yml? |
This is an example. The way to get the appropriate uid is to use the |
@mickaelperrin so people have to get there uid on the host ( OSX ) and then reconfigure there target app-container to use this uid, right? Obviously doing the opposite as in rsync does not work due to the "sync back" from sync container to osX? |
Yes exactly. |
Why not matching the user/group name? I think it would be easier for users. You just need to create a user with the same name on both machine. Or perhaps expose those options in the settings so people can chose? On my use case I just need to force a user. |
This allows you to use the same volume in multiple containers that runs differents users. But, for simpler use cases, running unison in a different user than root could work also. |
@mickaelperrin thats more or less solved, isnt it? We have user mapping for now, thats enough for basically all cases, isn't it? |
Indeed, we manage |
great, since both is implemented in rsync, we can close this issue. Thanks for the feedback! |
When I'm using rsync I can fix the permission to www-data but not with unison. Is their a workaround?
I want to use unison to have a two way sync. So for example I can see and edit the drupal config files generated by php.
The text was updated successfully, but these errors were encountered: