linux server version, the config file, and modes of operations


dlapine

Recommended Posts

I have a couple of questions and observations concerning the user of the linux server btsync executable and the --config <myconf.conf> file. These may also apply to the

The simple linux server use is simply to start the executable and config things via the local web access. No problems there, but the web interface is rather simple and doesn't allow various configuration choices available via a configuration file, so the use of a configuration file is recommended.

As stated in the sample-config, if you enable a "shared folders" section, you lose the web gui.

Any reason why the web interface must be lost if I specify shared folders in the config file? We already have a way to disable the web interface (just forego the "listen" option under the webui section, if I don't want it available? It's really useful as a status indicator to see not only which folders are shared but who's access them in linux.

Another thing to note is that by default, the "storage_path" is <whatever_dir_I_executed_btsync_in/.sync> and that the configuration that is created is stored in that location. If you run the web interface and setup some shares, running the command line + config file version later without moving the storage_path will overwrite that configuration without warning.

One note on using the default sample config file is that it tries to set the pid, and the location is not appropriate for all linux distros. As a linux user, you should change it to something appropriate.

One other note for us non-JSON users is that the .conf file format hates an extra comma, and that extra comma tends to hide in the webui or shared_folder blocks. Be forewarned- I'll include my config files below.

So, after some time btsync on linux, I see three "modes" you can run the linux server version in:

1) btsync with no options to allow the web interface for configuration

2) btsync --config <myconf.conf> with options and the web interface for configuration

3) btsync --config <myconf.conf> with shared_folders set that removes the web interface

Both web interface modes "save" configuration changes automatically in a "storage_path", so that a restart of the service is restored to the previous config. In mode 2 you can set that location.

As far as I can see, unless you need to run the server version on NAS, you'll be better served with modes 1 or 2.

I'll include the working config files I have for convenience.

mode 2 (web interface + options)


{
// the machine is Linux_Box
// user is linuxguy
// btsync was downloaded and extracted to /home/linuxguy/Downloads

"device_name": "Linux_Box",
"listening_port" : 0, // 0 - randomize port


"storage_path" : "/home/linuxguy/.btsync",
// uncomment next line if you want to set location of pid file
"pid_file" : "/home/linuxguy/Downloads/btsync.pid",
"check_for_updates" : true,
"use_upnp" : true, // use UPnP for port mapping

/* limits in kB/s
0 - no limit
*/
"download_limit" : 0,
"upload_limit" : 0,
/* remove "listen" field to disable WebUI
remove "login" and "password" fields to disable credentials check
*/
"webui" :
{
"listen" : "0.0.0.0:8888",
"login" : "admin",
"password" : "whatever"
}
}

Mode 3 (config file only)


{
// the machine is Linux_Box
// user is linuxguy
// btsync was downloaded and extracted to /home/linuxguy/Downloads

"device_name": "Linux_Box",
"listening_port" : 0, // 0 - randomize port


"storage_path" : "/home/linuxguy/.btsync-noweb",
// uncomment next line if you want to set location of pid file
"pid_file" : "/home/linuxguy/Downloads/btsync.pid",
"check_for_updates" : true,
"use_upnp" : true, // use UPnP for port mapping

/* limits in kB/s
0 - no limit
*/
"download_limit" : 0,
"upload_limit" : 0,
"shared_folders" :
[
{
"secret" : "32_characters_of_awesome",
"dir" : "/data/Stuff_I_want_to_share",
"use_relay_server" : true,
"use_tracker" : true,
"use_dht" : false,
"search_lan" : true,
"use_sync_trash" : true
}
]

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.