SOLVED BitTorrent Sync File Permissions

Status
Not open for further replies.

stephen thomas

Dabbler
Joined
Jun 22, 2016
Messages
16
Hi.

I'm quite new to FreeBSD, so if this is an obvious/easy answer, apologies in advance (I've searched these forums without finding an answer).

We have the latest stable build of FreeNAS 9.10 running. The setup is as follows:
  • Several users, each set up with their primary group being the same as their name
  • Several datasets on our volume, with each dataset having:
    • Owner (user): root
    • Owner (group): same name as dataset name (i.e. projects dataset will be assigned to the projects group).
  • Apple AFP shares for each dataset
  • Each user is assigned auxiliary groups for each share that they require access to (e.g. stephen has primary group: stephen. auxiliary groups: projects, finances, assets, btsync. john has primary group: john. auxiliary groups: projects, assets, btsync)
This works perfectly well on our local network. The problem comes with BitTorrent Sync. I followed this guide for setting it up:

http://blog.bittorrent.com/2014/02/...-freenas-with-bittorrent-sync-using-a-plugin/

As this guide asks you to set the permissions on the datasets as btsync (something we really don't want to do), I followed this guide to create the required groups inside the btsync jail:

http://whopoopedmypants.com/installing-and-configuring-btsync-on-freenas/

This works great, btsync now has read/write access (I've created storage inside the btsync jail for each dataset), with a small problem... The files synced to the NAS are written by user: btsync, group: (name of dataset) with the permissions: -rw-r--r--. It looks like I need to change the default write permission that btsync uses to be writable by both user and group, but I have no idea how to do this.

Any ideas on how to do this would be very gratefully received.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
I read your post, and poked around their knowledgebase a bit, and came up empty.
:(

Perhaps if you describe your use case in more detail, someone will be able to suggest a different approach.
 

stephen thomas

Dabbler
Joined
Jun 22, 2016
Messages
16
I read your post, and poked around their knowledgebase a bit, and came up empty.
:(

Perhaps if you describe your use case in more detail, someone will be able to suggest a different approach.

Thanks for your reply Robert. What other details do you think would help people understand the problem?

The problem, as I see it, is that I can't set the default write permissions for btsync. I need it to write to the datasets with group write permissions.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
What I mean is, take a step back and describe what you're trying to achieve.
 

stephen thomas

Dabbler
Joined
Jun 22, 2016
Messages
16
Ah ok. We're trying to have BitTorrent Sync be able to read and write to our existing datasets while still being able to read and write to these datasets on our local network through AFP shares. BitTorrent Sync currently writes new files as -rw-r-----. Having everyone in the office access the shares by logging in as the btsync user isn't an option.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
One more step back...
We're trying to have BitTorrent Sync be able to read and write to our existing datasets while still being able to read and write to these datasets on our local network through AFP shares.
Why?
 

stephen thomas

Dabbler
Joined
Jun 22, 2016
Messages
16
One more step back...

Why?

We're a small production company. We're working on a project with freelancers outside of the company. They need access to the same files that we do. BitTorrent Sync was chosen as the best way to sync the project files. Whenever one of the freelancers edits/creates a new file for the project, it's synced back to our FreeNAS, but it's written as read only.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Any reason not to sync the project files directly to each workstation, instead of using AFP shares?
 

stephen thomas

Dabbler
Joined
Jun 22, 2016
Messages
16
Any reason not to sync the project files directly to each workstation, instead of using AFP shares?

Yes. Our FreeNAS box is online 24/7, our workstations aren't. We can't rely on people having their computers on at certain times of the day to be sure that everyone has all of the latest files.

From what you're saying, I'm guessing that it's impossible to change the default write permissions for BTSync on FreeNAS?
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
We can't rely on people having their computers on at certain times of the day to be sure that everyone has all of the latest files.
As long as the FreeNAS is on 24/7, everyone will get the latest version when they login. Think of FreeNAS as the cloud replacement ... the Dropbox server equivalent. This is the most common reason for putting BitTorrent Sync on a server, i.e. to act as the always on node for a swarm of clients that are not always on.
I'm guessing that it's impossible to change the default write permissions for BTSync on FreeNAS?
I have not been able to find a way, but I haven't asked in their forums or emailed their support. Surely worth a try, if you're determined to use your existing structure.
 

stephen thomas

Dabbler
Joined
Jun 22, 2016
Messages
16
Any reason not to sync the project files directly to each workstation, instead of using AFP shares?

Ah wait, sorry, I misread what you were suggesting. Absolutely not. Using BitTorrent Sync between freeNAS and our workstations would completely negate the point of having our NAS. When we add files to our FreeNAS right now, they're immediately accessible to everyone on the network. We work with a lot of very big files and it would be out of the question to have to wait for these files to sync to each machine individually. Besides, should we really have to load 8TB worth of storage into each workstation just because we can't change the write permissions for BitTorrent Sync on FreeNAS ?

I'll ask some questions on the BitTorrent Sync forums. Thanks for your help :)
 

stephen thomas

Dabbler
Joined
Jun 22, 2016
Messages
16
I have to add that we're only sharing one project folder from one of the datasets with these freelancers. We have hundreds of other project folders which aren't being shared, terabytes worth of data, which is why using BitTorrent Sync for everything wouldn't work.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
8TB ... using BitTorrent Sync for everything wouldn't work
What about just that one project, for the duration of the project? Or are different freelancers working on different projects? To put it another way, is there 8TB of live data?
I'll ask some questions on the BitTorrent Sync forums.
Curious to know if you find a solution.
 

stephen thomas

Dabbler
Joined
Jun 22, 2016
Messages
16
What about just that one project, for the duration of the project? Or are different freelancers working on different projects? To put it another way, is there 8TB of live data?
The one project is a folder inside one of the datasets that we already access from our AFP shares. There's only one project that freelancers are working with us on right now. No, 8TB of data isn't being used by this one project, that's the amount of storage we have on the NAS after mirroring. To do this though, we'd have to create a new dataset specifically for this project, then install the BitTorrent sync client onto all the workstations. This wouldn't be the end of the world, but it does feel like a bit of a hack/workaround to me. It also isn't very future proof. We'd have to do this every time we work on a project with freelancers, potentially ending up with loads of datasets, which I imagine isn't a very good way to go...

Curious to know if you find a solution.
I'll let you know how it goes after asking the BTSync people :)
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
we'd have to create a new dataset specifically for this project
I don't think so. You should be able to mount any folder as jail storage, not just a dataset. However, it might make sense to have a master dataset for syncing, with each synced project folder underneath. In fact, that's the obvious way to set up BitTorrent Sync, regardless of the workflow.
then install the BitTorrent sync client onto all the workstations
The install would be once per workstation, and you'd only have to change each workstation's shared folders once per project.
 
Last edited:

stephen thomas

Dabbler
Joined
Jun 22, 2016
Messages
16
I don't think so. You should be able to mount any folder as jail storage, not just a dataset. However, it might make sense to have a master dataset for syncing, with each synced project folder underneath. In fact, that's the obvious way to set up BitTorrent Sync, regardless of the workflow.

Yes, this could work, but there may be a bit of a conflict if several of the workstations are trying to sync the same file to the NAS at the same time. I could be wrong though...

Anyway, I've sorted it now. I sent a support email to BitTorrent Sync and they pointed me to this thread:

https://forums.freenas.org/index.php?threads/setting-umask-for-btsync.20868/

If only I'd known the terminology umask, I may have found this article in the first place :)

Anywhoo, problem solved :) Thanks for the help Robert.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
there may be a bit of a conflict if several of the workstations are trying to sync the same file to the NAS at the same time
Any solution involving file sync has the potential for conflict. The usual solution is to create an additional copy of the file with a special name and warn you that manual resolution is required.
I've sorted it now
:cool:
 
Status
Not open for further replies.
Top