You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
It would be nice to add support for syncing file ownership with uid and gid. This already supports permissions.
2019 note: this issue was originally titled "...syncing uid:gid of files" and there's initial discussion of that, but that's too constricted hence I've retitled it. //@calmh
Reacted by nambrosch, Thomas Debesse, Alexey Murz Korepov, Márcio Siqueira, DemoFreak, Tim White, Joshua Aune, Jesse Stuart, aawise, Michel Albert and 20 more
I am pretty sure this is unlikely to happen as uids:gids can make no sense on windows or on a device which doesn't support users (android) or even have them.
I am syncing the /Users directory between two mac, so I run syncthing as
root. It runs great.
I run into the annoyance of having uid out of sync a few times.
As a reference, I use crashplan for backups. They preserve the uid:gid
metadata and they do their best effort to preserve this attributes if you
restore on a different platform.
So adding this values to the syncthing db and trying to apply if the OS is
homogeneous is doable.
Unfortunately I am not a programmer, so I can't contribute a patch, but I
think many people will greatly appreciate this feature.
On Feb 5, 2015 3:25 AM, "Audrius Butkevicius" [email protected]
wrote:
You can solve the same problem by running multiple instances though.
—
Reply to this email directly or view it on GitHub #1329 (comment)
.
@AudriusButkevicius I don't think windows or android is a good reason not to support this. This is the same idea as mtime and permissions.
It would not matter if this is the default or not but a configurable option to support this would go along way for use cases when using this as a deployment and configuration system for servers and not just desktop use.
if you sync between 2 linux servers or more with SAMBA on top can UID and GID be synched then?
this would solve my problem because all samba instances would have same UID and GID on all locations for me for an example. if both systems are same linux then file ownership should be synched at least....
if same but it should note that same UID and GID should be on both sides the same maybe?
#id testuser
uid 1000 gid 1000 on both locations....
one could have 1000 and the other 501 ... which are not same user....
@crosbymichael feel free to make a pull request.
Given it's implemented sensibly, I am pretty sure @calmh will consider merging it.
Saying Windows and Android is not a good reason not to support is not true (at least what I believe in).
Turning the code into an unmanageable mess just for the sake of it working on Unix, is a good enough reason for me. I just sadly cannot comprehend a sensible solution which works across the board.
By the end of the day, we (or perhaps that is just my personal view) are trying to make a tool which works on multiple platforms, and we try to make sure that all features work on all platforms (more or less).
I guess you could do uid:gid mapping based on the user account names across Unix and Windows, but then perhaps Unix people would expect it to work based on integers... Atleast that is the sort of behaviour I would expect syncing stuff from Unix to Windows... Not sure... gids don't even make sense on Windows.
@AudriusButkevicius lets try to keep the discussion professional and not suggest that someone's contribution for a feature that they care about would be "Turning the code into an unmanageable mess just for the sake of it working on Unix"
What I am saying, is that the only solution which comes to my mind now, would make an unmanageable mess. I guess I am a bit of an advocate of Windows here, and I don't want Windows to be left out, hence why it would be a mess.
As I said, given it's done sensibly, I am sure it could become a feature, even if an optional one.
Ok thanks. I opened this issue first instead of a PR so that this could be discussed with the maintainers. I know what it's like to have feature requests implemented in a PR without any discussion.
I'm more than happy to look for an elegant solution for this. If it turns out to add more complexity than what it would be worth, then I have no problem closing this issue.
Yeah, the relevant discussion is linked above. Solving this as described above (just copy uid+gid) isn't rocket science. Unfortunately it's also a half baked solution, as it doesn't work on non-Unixy systems, and will anyway not solve the other aspects that will pop up if this is implemented (sync by username and not uid, map some uids to others, etc)... As such, it would need to be really neat and unobtrusive to be worth it, in my opinion.
The reason this is open is because nobody needs this badly enough to work on it.
Maybe I can tell about my story: I started implementing it (just minor change when syncing just uid and gid 1:1 and also with option to sync/not sync ownership). This however needed a DB schema update and also a rescan of all folders on all devices to update the DB.
So I tested it and used it on my devices (all linux, all identical uid/gid) - works like a charm!
Then I thought about the next steps to create a PR:
think about mapping
owners in Windows -> ugly!
how to make a database migration -> ugly!
change the Web-UI to let the users enter mappings, etc.
what to do if only ownership of a file is changed??
So, finally I left with just using my patched version which is still working like a charm.. 😉
Maybe if I find more time, I'll tackle the above mentioned points and prepare a PR.
Or, if wished, I can simply share my modifications, maybe it is enough to opt in/opt out and someone can tackle the DB migration topic such that we'll only get an optional ownership syncing that only works for linux but doesn't harm anything on Windows.
Reacted by Aaron C. de Bruyn, Love JESUS and hiveai
@aawsome I'd love to get a copy of the patch and buy you a beer or something from an Amazon wishlist... I only need 1:1 uid/gid mapping on Linux since all my NAS boxen have identical IDs through winbind.
Or if you want to try getting a PR submitted or something, I might be able to do some sort of sponsorship through my company or one of my clients that needs it.
@aawsome Could I get a copy of your changes please? I have 2 linux boxes I'd like to sync. I would value what you have even if the corner cases you outlined have not been addresses. Cheers! @darkpixel Did you ever get a copy of the uid/gid syncing patch? If so, could I get a copy?
Sorry for not answering. This is the patch I'm still using, however it is based on syncthing 1.5.0 and there have been quite some changes in the master code since then.
I wanted to have a look how to rebase my patch but so far I didn't find the time for it. (and, honestly, after some time forgot about this topic).
Appreciate any help with rebasing this!
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
kozec commentedon Feb 5, 2015
Wouldn't that require running Syncthing as root?
jpjp commentedon Feb 5, 2015
Yep that would require root.
AudriusButkevicius commentedon Feb 5, 2015
I am pretty sure this is unlikely to happen as uids:gids can make no sense on windows or on a device which doesn't support users (android) or even have them.
AudriusButkevicius commentedon Feb 5, 2015
You can solve the same problem by running multiple instances though.
facastagnini commentedon Feb 5, 2015
I am syncing the /Users directory between two mac, so I run syncthing as
root. It runs great.
I run into the annoyance of having uid out of sync a few times.
As a reference, I use crashplan for backups. They preserve the uid:gid
metadata and they do their best effort to preserve this attributes if you
restore on a different platform.
So adding this values to the syncthing db and trying to apply if the OS is
homogeneous is doable.
Unfortunately I am not a programmer, so I can't contribute a patch, but I
think many people will greatly appreciate this feature.
On Feb 5, 2015 3:25 AM, "Audrius Butkevicius" [email protected]
wrote:
crosbymichael commentedon Feb 5, 2015
@AudriusButkevicius I don't think windows or android is a good reason not to support this. This is the same idea as mtime and permissions.
It would not matter if this is the default or not but a configurable option to support this would go along way for use cases when using this as a deployment and configuration system for servers and not just desktop use.
api984 commentedon Feb 5, 2015
if you sync between 2 linux servers or more with SAMBA on top can UID and GID be synched then?
this would solve my problem because all samba instances would have same UID and GID on all locations for me for an example. if both systems are same linux then file ownership should be synched at least....
if same but it should note that same UID and GID should be on both sides the same maybe?
#id testuser
uid 1000 gid 1000 on both locations....
one could have 1000 and the other 501 ... which are not same user....
AudriusButkevicius commentedon Feb 5, 2015
@crosbymichael feel free to make a pull request.
Given it's implemented sensibly, I am pretty sure @calmh will consider merging it.
Saying Windows and Android is not a good reason not to support is not true (at least what I believe in).
Turning the code into an unmanageable mess just for the sake of it working on Unix, is a good enough reason for me. I just sadly cannot comprehend a sensible solution which works across the board.
By the end of the day, we (or perhaps that is just my personal view) are trying to make a tool which works on multiple platforms, and we try to make sure that all features work on all platforms (more or less).
I guess you could do uid:gid mapping based on the user account names across Unix and Windows, but then perhaps Unix people would expect it to work based on integers... Atleast that is the sort of behaviour I would expect syncing stuff from Unix to Windows... Not sure... gids don't even make sense on Windows.
crosbymichael commentedon Feb 5, 2015
@AudriusButkevicius lets try to keep the discussion professional and not suggest that someone's contribution for a feature that they care about would be "Turning the code into an unmanageable mess just for the sake of it working on Unix"
AudriusButkevicius commentedon Feb 5, 2015
I am not saying that.
What I am saying, is that the only solution which comes to my mind now, would make an unmanageable mess. I guess I am a bit of an advocate of Windows here, and I don't want Windows to be left out, hence why it would be a mess.
As I said, given it's done sensibly, I am sure it could become a feature, even if an optional one.
crosbymichael commentedon Feb 5, 2015
Ok thanks. I opened this issue first instead of a PR so that this could be discussed with the maintainers. I know what it's like to have feature requests implemented in a PR without any discussion.
I'm more than happy to look for an elegant solution for this. If it turns out to add more complexity than what it would be worth, then I have no problem closing this issue.
AudriusButkevicius commentedon Feb 5, 2015
The
bossis back in a few days, hence you can perhaps propose a potential solution to the problem which then could be discussed.There is some history of this available here (which might have some sensible ideas):
https://discourse.syncthing.net/t/sync-file-ownership-and-permissions/143
Though I feel you cannot get a way with some sort of optional remapping config
calmh commentedon Feb 9, 2015
Yeah, the relevant discussion is linked above. Solving this as described above (just copy uid+gid) isn't rocket science. Unfortunately it's also a half baked solution, as it doesn't work on non-Unixy systems, and will anyway not solve the other aspects that will pop up if this is implemented (sync by username and not uid, map some uids to others, etc)... As such, it would need to be really neat and unobtrusive to be worth it, in my opinion.
60 remaining items
darkpixel commentedon Jun 16, 2020
Who can I sponsor and how much do they need?
AudriusButkevicius commentedon Jun 16, 2020
kastelo.net I guess is the official "commercial" body behind syncthing, but I guess you can hire someone who knows a bit of Go and html to do this.
aawsome commentedon Jun 17, 2020
Maybe I can tell about my story: I started implementing it (just minor change when syncing just uid and gid 1:1 and also with option to sync/not sync ownership). This however needed a DB schema update and also a rescan of all folders on all devices to update the DB.
So I tested it and used it on my devices (all linux, all identical uid/gid) - works like a charm!
Then I thought about the next steps to create a PR:
So, finally I left with just using my patched version which is still working like a charm.. 😉
Maybe if I find more time, I'll tackle the above mentioned points and prepare a PR.
Or, if wished, I can simply share my modifications, maybe it is enough to opt in/opt out and someone can tackle the DB migration topic such that we'll only get an optional ownership syncing that only works for linux but doesn't harm anything on Windows.
darkpixel commentedon Jun 17, 2020
@aawsome I'd love to get a copy of the patch and buy you a beer or something from an Amazon wishlist... I only need 1:1 uid/gid mapping on Linux since all my NAS boxen have identical IDs through winbind.
Or if you want to try getting a PR submitted or something, I might be able to do some sort of sponsorship through my company or one of my clients that needs it.
hiveai commentedon Aug 29, 2020
@aawsome Could I get a copy of your changes please? I have 2 linux boxes I'd like to sync. I would value what you have even if the corner cases you outlined have not been addresses. Cheers!
@darkpixel Did you ever get a copy of the uid/gid syncing patch? If so, could I get a copy?
Striffly commentedon Nov 24, 2020
You can find the patch here : https://github.com/aawsome/syncthing/tree/sync-owner
I will soon test it on a linux multi-device configuration (if I reach the end of a custom build on docker), I will keep you informed!
aawsome commentedon Nov 25, 2020
Sorry for not answering. This is the patch I'm still using, however it is based on syncthing 1.5.0 and there have been quite some changes in the master code since then.
I wanted to have a look how to rebase my patch but so far I didn't find the time for it. (and, honestly, after some time forgot about this topic).
Appreciate any help with rebasing this!
Merge branch 'main' into runtimeos
Merge branch 'main' into xattr
all: Support syncing ownership (fixes syncthing#1329) (syncthing#8434)
Merge tag 'v1.21.0' into ios_try_syncthing_v1.21.0