An Unofficial Btsync Ubuntu/Debian Packaging Project Fork


Silvenga

Recommended Posts

An Unofficial Btsync Ubuntu/Debian Packaging Project Fork

Bittorrent Sync is an awesome solution for many problems ranging from synchronizing large amounts of files to certain centralized governing bodies. About three years ago, @tuxpoldo and many other contributors created the unofficial packaging project for Ubuntu/Debian to ease deployments on these systems - the project has since evolved to fill in the missing gaps of the official Sync project and continues to provide packages for legacy Btsync clients.

Current features include, but are not limited to:

  • Easy installing and upgrading
  • Generated configuration files (via an easy command line interface)
  • Run as a different user/group
  • Startup/Shutdown scripts
  • Support for multiple instances
  • Custom nice levels

A Reboot

Build Status

Unfortunately, after several years of active work, it seems @tuxpoldo has moved on and the unofficial packages got a bit stale. Since all the work is open source I was able to build new packages (with a few tweaks here and there) and since many members of the community used the packages I decided to share my work publicly. An archive of the original post from @tuxpoldo: https://forum.getsync.com/topic/18974-debian-and-ubuntu-server-unofficial-packages-for-bittorrent-sync/

I will be providing continued maintenance for this awesome project and until I am accustomed to this project (or Python for the matter) I can provide support for the btsync and btsync-common packages with new binary versions and bugfixes. I personally use these packages on several headless servers to sync files and will particularly support that use case.

Debian and Ubuntu packages can be found under my private repository http://deb.silvenga.com. New versions should be automatically built and published to this location via my build server (found above) when new changelogs are released. These packages should also work for other Ubuntu/Debian derivatives (Mint, LUbuntu, Raspbian, etc.).

The source to these packages (e.g. build scripts, changelogs, etc.) can be found in my GitHub fork: https://github.com/Silvenga/btsync-deb. I encourage reporting issues with the packaging to this repository.

Cheers!

Installing

Add my package signing key:

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 992A3C9A3C3DE741

Add the btsync repository:

add-apt-repository "deb http://deb.silvenga.com/btsync any main"
apt-get update

Install btsync

apt-get install btsync

After following the prompts, open your browser to http://127.0.0.1:8888/gui/ (if using the default configuration).

TODO List

  • Log to proper log folder. (log path is now customizable via #6)
  • Setup logrotate. (might not be needed)
  • Fix the formatting of this post. :(

FAQ

Adding a new synced folder results in the following error:

Sync does not have permission to access this folder

Make sure the user Btsync is running as has read and write access to the path set when prompted for the "Start path for the web interface".

Alternatively, / can be used.


You would receive something like the following when running apt-get-repository:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 167, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 105, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 595, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 89, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/jessie

Raspbian's add-apt-repository seems to be broken under at last Jessie. The following commands will resolve the issues:

echo "deb http://deb.silvenga.com/btsync any main" > /etc/apt/sources.list.d/silvenga-btsync-deb.list
apt-get update
apt-get install btsync

Adding signing key fails with the following stacktrace:

gpg: requesting key 3C3DE741 from hkp server keyserver.ubuntu.com
gpg: no writable keyring found: eof
gpg: error reading `[stream]': general error

Make sure to run all the above commands as root either by using sudo or switching to the root user.

 

 

Link to comment
Share on other sites

Just for reference (since there seem to be suggestions to the contrary in another thread). It's also easy to run the official package using different users.

  • Install the official package.
  • Install systemd.
  • Create the file /etc/systemd/system/btsync@.service:
[Unit]
Description=BitTorrent Sync for %i

[Service]
Type=simple
User=%i
ExecStart=/usr/bin/btsync --nodaemon --config /home/%i/.sync/sync.conf
WorkingDirectory=/home/%i
Restart=always

[Install]
WantedBy=multi-user.target
  • You can now create a configuration file for your user in /home/<youruser>/.sync/sync.conf . There are some instructions in this blog post on how to do this: https://danieldk.eu/Posts/2015-10-18-erp.html (look at the 'per-user configuration' section).
  • You can now start/stop/restart and permanently enable the service for a specific user:
sudo systemctl start btsync@<youruser>.service
sudo systemctl stop btsync@<youruser>.service
sudo systemctl restart btsync@<youruser>.service
# Get the status for the service
sudo systemctl status btsync@<youruser>.service
# Permanently enable
sudo systemctl enable btsync@<youruser>.service

The nice thing about this approach is that it works for any number of users, just fill in the user name in the <youruser> part. E.g. our Raspberry at home has BTSync instances running for me and my wife, under different users.

Link to comment
Share on other sites

On 2/20/2016 at 0:51 AM, iswrong said:

Just for reference (since there seem to be suggestions to the contrary in another thread). It's also easy to run the official package using different users.

Unfortunately, Ubuntu LTS doesn't ship with SystemD at this time and installing it is relatively unsafe. :(

Link to comment
Share on other sites

On 20-2-2016 at 7:51 AM, iswrong said:

Just for reference (since there seem to be suggestions to the contrary in another thread). It's also easy to run the official package using different users.

  • Install the official package.
  • Install systemd.
  • Create the file /etc/systemd/system/btsync@.service:

[Unit]
Description=BitTorrent Sync for %i

[Service]
Type=simple
User=%i
ExecStart=/usr/bin/btsync --nodaemon --config /home/%i/.sync/sync.conf
WorkingDirectory=/home/%i
Restart=always

[Install]
WantedBy=multi-user.target
  • You can now create a configuration file for your user in /home/<youruser>/.sync/sync.conf . There are some instructions in this blog post on how to do this: https://danieldk.eu/Posts/2015-10-18-erp.html (look at the 'per-user configuration' section).
  • You can now start/stop/restart and permanently enable the service for a specific user:

sudo systemctl start btsync@<youruser>.service
sudo systemctl stop btsync@<youruser>.service
sudo systemctl restart btsync@<youruser>.service
# Get the status for the service
sudo systemctl status btsync@<youruser>.service
# Permanently enable
sudo systemctl enable btsync@<youruser>.service

The nice thing about this approach is that it works for any number of users, just fill in the user name in the <youruser> part. E.g. our Raspberry at home has BTSync instances running for me and my wife, under different users.

 

Tried to install it with these options, btsync starts ok, but i can not access the web gui. So i went back to silvenga/tuxpoldo version.

Link to comment
Share on other sites

5 hours ago, iswrong said:

Works fine for me. Did you connect to the right port? Did you check with 'netstat -tap' on which ports sync is listening?

There might be an issue with the server. It is in an remote location so I can 't access it this moment. I reinstalled the silvenga version but cannot access the webgui either. Port and everything should be ok since i have used it for a couple of years already.

Link to comment
Share on other sites

  • 1 month later...

There is a issue with update - all my Debian bases arm servers (4) hangs during update with very same message
"

The following packages will be upgraded:

  btsync-core

1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Need to get 0 B/4,441 kB of archives.

After this operation, 6,144 B disk space will be freed.

Do you want to continue? [Y/n] y

Reading changelogs... Done

(Reading database ... 25660 files and directories currently installed.)

Preparing to unpack .../btsync-core_2.3.6-1.0_armhf.deb ...

Unpacking btsync-core (2.3.6-1.0) over (2.3.3-1.0) ...

Processing triggers for btsync (2.3.0-1.0) ...

"

Edited by filemoon
Link to comment
Share on other sites

  • 2 weeks later...

Hi.

Silvenga - you are big and doing great job (sorted).
Thank you :)

(I was a bit overenthusiastic - installation is ok but binary is not working with arm64 cpu (strange error) - same story with binary downloaded directly form their webpage (but repo is 100% ok- I've contacted support let's see if they can help me).
 

Edited by filemoon
Link to comment
Share on other sites

54 minutes ago, filemoon said:

Hi.

Silvenga - you are big and doing great job (sorted).
Thank you :)

(I was a bit overenthusiastic - installation is ok but binary is not working with arm64 cpu (strange error) - same story with binary downloaded directly form their webpage (but repo is 100% ok- I've contacted support let's see if they can help me).
 

Thought that was going to happen. I was hoping there was a compatibility layer like with x86 -> x64 (I see now there isn't), I also saw that tuxpoldo's launchpad repo had arm64 builds (I see now there isn't any binaries).

Ping me if Bittorrent provides an arm64 release and I'll update the repo. 

Link to comment
Share on other sites

  • 1 month later...

Is this supposed to still be active?

It doesn't seems to work anymore!?

When I try to install the key I get this:

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d//innvue.gpg --keyring /etc/apt/trusted.gpg.d//pkg-mozilla-archive-keyring.gpg --keyserver keyserver.ubuntu.com --recv-keys 992A3C9A3C3DE741
gpg: requesting key 3C3DE741 from hkp server keyserver.ubuntu.com
?: keyserver.ubuntu.com: Connection refused
gpgkeys: HTTP fetch error 7: couldn't connect: Connection refused
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.