[FreeNAS 9 Plugin] - Syncthing

Status
Not open for further replies.

panz

Guru
Joined
May 24, 2013
Messages
556
Steve Gibson talks about Syncthing in the Security Now! episode 20th of may.
 

raidflex

Guru
Joined
Mar 14, 2012
Messages
531
Interesting alternative to BTsync.
 

Phlogi

Dabbler
Joined
Apr 2, 2014
Messages
33
Is the service syncthing update something you implemented or from the syncthing itself? I've never seen that again. Is it possible to make that into the freeNAS webgui for udpates?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
The syncthing binary has the "update" flag available. I just wrapped that up into the init script to and make some checks like whether the service is running.
I could probably make a button in the freenas gui, still debating whether or not to do this or rely on the freenas update mechanism.
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
Cool!
"It supports block-level synchronization, which means that if you sync encrypted TrueCrypt containers, only the modified bits and not the full container will be synchronized by the service."

Also, it will work on ARMv6 meaning it'll run on a Raspberry Pi. Your imagination can run wild here; but I see it as a possible way to transfer video files to the Pi over LAN or even WAN.
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
Are you sure the user/group is called sync? I've isntalled it and checked the jail its isntalled in and it shows SYNCER

cat /etc/passwd | grep sync
syncer:*:817:817:syncer Daemon:/nonexistent:/usr/sbin/nologin


Source
Notes
  • Uses the user/group 'sync', UID/GID = 817
  • Can be updated to the latest available version with the command 'service syncthing update'
Request to Add to FreeNAS Repo
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Are you sure the user/group is called sync? I've isntalled it and checked the jail its isntalled in and it shows SYNCER

cat /etc/passwd | grep sync
syncer:*:817:817:syncer Daemon:/nonexistent:/usr/sbin/nologin
you are right, I was requested not to use sync which is an commonly used term in freebsd. when summiting the port to freebsd upstream I was told not to user syncthing so this will change again =\
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
OK, thanks. How does one get "notified" of these changes? I assume freeNAS will show me there is an update for this plugin and I can then update it but does one get notifications about the changes? Anyway, I can manually check.

On another note, I see you're the right person to ask:

Is there a short how to on how to get this working? I've got a few problems with permissions:

a) create dataset on the NAS set permissions to what user/group, etc. if syncthing is later supposed to read/write the synced data in here?
b) anything to be done permission wise after one has added the storage to the jail where syncthing runs?
c) IF I were to want to create CIFS shares for the folders where syncthign writes to, what else is needed?

I hope you get the gist of what I'm asking, I'm mainly struggling setting the correct owner/permission when creating the dataset and when creating the share. I've played around with this with the result that syncthing can't write to those folders anymore - still experimenting :-/
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
adding storage to a jail doesn't change the underlying file's owner/group UID/GID. the freenas userland / jail userland don't know about each others user to UID and group to GID mapping they just know their own files ownership and the their own users/groups.

I don't use cifs or syncthing but my suggestion is to create a matching user+group syncer in freenas with UID/GID 817. you can also set cifs shares to force this user.

BTW, this is changing with the next syncthing I put in the repo. it will have user/group syncthing with UID/GID 819. =\
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
thx. One last request, would you mind updating this thread when you change anything significant in future versions of your plugin please?
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
@Joshua: sorry to bug you, I just realized I've got another related question:

I am having trouble connecting to syncthing running in a jail on freeNAS from a remote location.
I have checked and the correct ports get forwarded to the right IP on my router at home and when I'm home I can access the syncthign GUI so I was wondering what the jail option of NAT actually does as I have not checked it when creating this jail but I can still access syncthgns GUI so I thought its not necessary... Do you think this is the reason for this problem?

The official description says:
NATcheckboxenables Network Address Translation for the jail; will be greyed out for Linux jails or if VIMAGE is unchecked
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I wouldn't check nat, i think that just adds uneeded overhead. there really isn't anything special about port forwarding to a jail on freenas. you should be able to fix this on your own for your specific network. I think you can set what port syncthing uses for syncing, but upnp should do this for you if you have that on your router.
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
I'm having trouble upgrading from syncthing 0.9 beta9 to 0.9 - all previous updates via service syncthing update worked.
Here is what happens:
root@plugins:/ # service syncthing update
Stopping syncthing.
Waiting for PIDS: 8956, 8956.
16:31:04 FATAL: Upgrade: API call returned HTTP error: 404 Not Found
Starting syncthing.

Any ideas?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm having trouble upgrading from syncthing 0.9 beta9 to 0.9 - all previous updates via service syncthing update worked.
Here is what happens:
root@plugins:/ # service syncthing update
Stopping syncthing.
Waiting for PIDS: 8956, 8956.
16:31:04 FATAL: Upgrade: API call returned HTTP error: 404 Not Found
Starting syncthing.

Any ideas?
I'm not sure if that's a valid upgrade path. I'll try getting syncthing v9.0 in the repo tonight. Upgrading through the FreeNAS WebUI should work.
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
Awesome, thanks! syncthing apparently can backup from the GUI now:

  • Upgrades to new versions can be performed directly in the GUI (unless disabled at build time, not yet supported on Windows).
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
Btw, I've manually installed the PBI in a manually created jail hence the GUI update of the plugin won't work for me but now I can't find the link to the download page for the .pbi files again :-/
Once you've managed to upload the 0.9 .pbi file could you please share the link here again?

###edit###
I have found the PBI page but syncthign isn't listed: http://doc.freenas.org/index.php/Available_FreeNAS®_PBIs

and it seems the freeNAS Gui will pick up if you update the plugin, at least its currently showing me an update but I'll wait until you update it.
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
Btw, I've manually installed the PBI in a manually created jail hence the GUI update of the plugin won't work for me but now I can't find the link to the download page for the .pbi files again :-/
Does
pkg update
pkg upgrade
work?
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
I'll give it a try but where would it update from if Joshua hasn't updated his .pbi file? ...
 
Status
Not open for further replies.
Top