Trying to start BTSync with a config file on Windows


delegatevoid

Recommended Posts

Hi,

 

I've copied the content of the example config and modified the storage_path and api_key properties.

I've placed it in the same directory as btsync.exe as btsync.conf 

{    "storage_path" : "./",    "use_gui" : false,    "webui" : {               "listen" : "127.0.0.1:8888",        "login" : "api",        "password" : "secret",        "api_key" : "thesecretapikeythatwehavetosharewitheveryone"    }}

Of course on my system the api_key corresponds with my own secret api key as received by mail.

 

I then try to launch it from the command like like so:

btsync.exe /config btsync.conf

But that simply starts btsync like it does normally, with the GUI enabled and the web interface disabled
or at least not using the settings as specified in the config file.

 

I have tried various values for storage_path such as:

 

  • ./
  • /
  • p:\btsyncapi
  • p:/btsyncapi
  • p:\btsyncapi\
  • p:/btsyncapi/

And btsyncapi is an empty folder on my 'p' drive, so it does exist.

 

So apparently it btsync seems to ignore the config file and I cannot find any indication
of what's going on in the logs, there is no feedback of any kind.

 

Can someone tell me what I'm doing wrong?

 

System: Windows 8.1

 

 

Link to comment
Share on other sites

writen text to C:\Program Files (x86)\BitTorrent Sync\sync.conf

 

-->

{
   "storage_path" : "/Users/Administrator/AppData/Roaming/BitTorrent Sync",  ;// config folder......
   "use_gui" : true,                ;// false is not GUI mode , true is viewing GUI
   "webui" : {
        "listen" : "192.168.10.3:8888",  ;// real ip and port
        "login" : "api",
        "password" : "secret",
        "api_key" : "your get e-mail api key"
    }
}

--->

 

dos command here

 

C:\Program Files (x86)\BitTorrent Sync>btsync.exe /config sync.conf Enter 

 

acess http://your ip:port/api?.....api code writen ie explorer.....accessssss can..

 

ie 9 is receive code download is api.js...

 

it's api.js type JSON code....

Link to comment
Share on other sites

Hi,

That doesn't help me. I've done the exact same thing, but btsync still ignores the config file.

For example, I told it not to use a GUI and it does. Also it starts the web server but not with username api/secret
but the default username and password instead.

 

To give you an idea, this is the console/cmd session:

 

 

E:\Program Files (x86)\BitTorrent Sync>dir Volume in drive E is Program Files Volume Serial Number is 3212-2BC0 Directory of E:\Program Files (x86)\BitTorrent Sync15/11/2013  10:36    <DIR>          .15/11/2013  10:36    <DIR>          ..31/10/2013  13:12         1 538 920 BTSync.exe15/11/2013  10:33               823 sync.conf               2 File(s)      1 539 743 bytes               2 Dir(s)  400 937 422 848 bytes freeE:\Program Files (x86)\BitTorrent Sync>BTSync.exe /config sync.confE:\Program Files (x86)\BitTorrent Sync>

At this point btsync starts, it just doesn't use my config file.

Link to comment
Share on other sites

 

Hi,

That doesn't help me. I've done the exact same thing, but btsync still ignores the config file.

For example, I told it not to use a GUI and it does. Also it starts the web server but not with username api/secret

but the default username and password instead.

 

To give you an idea, this is the console/cmd session:

 

 

E:\Program Files (x86)\BitTorrent Sync>dir Volume in drive E is Program Files Volume Serial Number is 3212-2BC0 Directory of E:\Program Files (x86)\BitTorrent Sync15/11/2013  10:36    <DIR>          .15/11/2013  10:36    <DIR>          ..31/10/2013  13:12         1 538 920 BTSync.exe15/11/2013  10:33               823 sync.conf               2 File(s)      1 539 743 bytes               2 Dir(s)  400 937 422 848 bytes freeE:\Program Files (x86)\BitTorrent Sync>BTSync.exe /config sync.confE:\Program Files (x86)\BitTorrent Sync>

At this point btsync starts, it just doesn't use my config file.

 

 

i'm BTSync to install path :   [C:\Program Files (x86)\BitTorrent Sync]

    install folder list is => 

               BTSync.exe

               sync.conf

          

config folder path              :   [ C:\Users\Administrator\AppData\Roaming\BitTorrent Sync]

    config folder list is =>

              3DB4B735419B366C322FD10F9817A42973B6091D.db

              4DA35176F4656AAAE65F016B52321F4ADA2C8FC6.db

              4DA35176F4656AAAE65F016B52321F4ADA2C8FC6.db-shm

              4DA35176F4656AAAE65F016B52321F4ADA2C8FC6.db-wal

              5793E20B1A00F7AA3685D0DC08EC6A5DC64C697A.db

              5793E20B1A00F7AA3685D0DC08EC6A5DC64C697A.db-shm

              5793E20B1A00F7AA3685D0DC08EC6A5DC64C697A.db-wal

              Cache

              debug.txt

              settings.dat

              settings.dat.old

              sync.dat

              sync.dat.old

              sync.lng

              sync.log

              sync.pid

 

ie using writen text to  [ http://api:secret@192.168.10.3:8888/api?method=get_folders ]

              Result JSON  to

              {

                  "device_name","MSDN-SPECIAL"

                  "disk_low_priority",1

                  "download_limit",0

                  "folder_rescan_interval","600"

                  "lan_encrypt_data",1

                  "lan_use_tcp",0

                  "lang",4294967295

                  "listening_port",49056

                  "max_file_size_diff_for_patching","1000"

                  "max_file_size_for_versioning","1000"

                  "rate_limit_local_peers",0

                  "recv_buf_size","5"

                  "send_buf_size","5"

                  "sync_max_time_diff","600"

                  "sync_trash_ttl","30"

                  "upload_limit",0

                  "use_upnp",1

                }

 

http://api:secret@192.168.10.3:8888/api?method=get_folders&secret   writen to..

 

Result

 

[

  {

    "dir","\\\\?\\D:\\adobe"

    "error",0

    "files",7

    "indexing",0

    "secret","ATGIABCDEFFFF~~~~~~FP4D"

    "size",361715533

    "type","read_write"

  }

  {

    "dir","\\\\?\\d:\\sync_test"

    "error",0

    "files",7451

    "indexing",0

    "secret","ACUYJ7ABCDEF~~~~~XJNNNK"

    "size",337319623

    "type","read_write"

  }

]

 

 

 

 

sync.conf  is

----------------------

{

   "storage_path" : "/Users/Administrator/AppData/Roaming/BitTorrent Sync",

   "use_gui" : true,   ;< ===debug only

   "webui" : {

        "listen" : "192.168.10.3:8888",

        "login" : "api",

        "password" : "secret",

        "api_key" : "my api key"

    }

}

-------

you......writen text  [;] is not using..too   ex)  ;< ===debug only  it's text delete .......save

 

Administrator  is your login propile folder

 

do you make config folder is ?????? what?

Link to comment
Share on other sites

 

Hi,

That doesn't help me. I've done the exact same thing, but btsync still ignores the config file.

For example, I told it not to use a GUI and it does. Also it starts the web server but not with username api/secret

but the default username and password instead.

 

To give you an idea, this is the console/cmd session:

 

 

E:\Program Files (x86)\BitTorrent Sync>dir Volume in drive E is Program Files Volume Serial Number is 3212-2BC0 Directory of E:\Program Files (x86)\BitTorrent Sync15/11/2013  10:36    <DIR>          .15/11/2013  10:36    <DIR>          ..31/10/2013  13:12         1 538 920 BTSync.exe15/11/2013  10:33               823 sync.conf               2 File(s)      1 539 743 bytes               2 Dir(s)  400 937 422 848 bytes freeE:\Program Files (x86)\BitTorrent Sync>BTSync.exe /config sync.confE:\Program Files (x86)\BitTorrent Sync>

At this point btsync starts, it just doesn't use my config file.

 

 

 

.............

"use_gui" : false, ;< ===debug only

"webui" : {

[false] set is not using BTSync GUI

view can Taskmgr.exe listing on BTSync.exe  not view icon/tray......

only access web ui..tooooooo....

 

"use_gui" : true

"webui" : {

[true] set is can GUI / webui access....

Link to comment
Share on other sites

On Windows XP 32 bit, i can run btsync with this config:

{    "storage_path" : "D://btsync_api/",    "use_gui" : false,    "webui" : {        "listen" : "127.0.0.1:7878",        "login" : "login",        "password" : "passwd",        "api_key" : "yourapikey"    }}

Command line:

btsync.exe /config btsync_api.conf

I'm using version 1.2.68.

 

I used "d:\btsync_api" as "storage_path" but not worked, but with "d://btsync_api" now works perfectly.

Link to comment
Share on other sites

Hi,

 

So it turned out I was using an older version and the auto update and manual update features didn't work.

I manually installed a newer version and after playing with the storage_path variable a bit I got it working.

 

That settings seems to be a fragile point. Either way, if the BTSync devs are reading this, when the config file
is invalid the application really should dump some information in the log file or provide some feedback on the command line.

 

I'm also wondering, have not tried, will do so later, if it's possible to run multiple instances (with their own storage_path)
otherwise if you integrate your software with btsync nobody else can do so on the same computer. 

 

Of course at this time, distributing your app is impossible anyway because it requires you redistribute the API key
in plain text.

 

Thnx for the help everyone!

Link to comment
Share on other sites

Has anyone had any luck running this on Windows 8?

 

Seems like no combination of settings is going to get this API to start. I've followed all the advice above....

 

Sync.conf is in C:\Users\steve_000\AppData\Roaming\BitTorrent Sync - I've tried setting storage path to that location as well as just a folder in the root directory...

 

I'm thinking I need to run a VM locally running Win 7 or something to get this to work... I echo the previous sentiment - a little logging would take all the guess work out of this...

 

{
    // path to folder where Sync will store its internal data,
    // folder must exist on disk
    "storage_path" : "C:\TestVersion\",

    // run Sync in GUI-less mode
    "use_gui" : false,

    "webui" : {
        // IP address and port to access HTTP API
        "listen" : "127.0.0.1:8888",
        // login and password for HTTP basic authentication
        // authentication is optional, but it's recommended to use some
        // secret values unique for each Sync installation
        "login" : "api",
        "password" : "secret",
        // replace xxx with API key received from BitTorrent
        "api_key" : "My key"
    }
}

Link to comment
Share on other sites

@Johnny2Shoes: I got it working on Windows 8.1, so I'm guessing it'll work on 8.0 as well.

 

I did find that using anything other than the 'working directory' as the storage_path fails.

 

The following configuration works for me:

 

{    // path to folder where Sync will store its internal data,    // folder must exist on disk"storage_path" : "./",    // run Sync in GUI-less mode    "use_gui" : true,    "webui" : {        // IP address and port to access HTTP API        "listen" : "127.0.0.1:8888",        // login and password for HTTP basic authentication        // authentication is optional, but it's recommended to use some        // secret values unique for each Sync installation        "login" : "api",        "password" : "secret",        // replace xxx with API key received from BitTorrent        "api_key" : ""    }}

The key here is "storage_path" : "./"

This will create the storage path in the same directory as the btsync executable, which is probably not a bad thing
since this will be your application directory if you integrate it with your own software.

 

This will also prevent storage_path collisions with other instances of btsync on the computer.

 

 

Link to comment
Share on other sites

This worked for me on Win8.1x64. 

{    "storage_path" : "c:/BTSync",    "use_gui" : true,    "webui" : {        "listen" : "127.0.0.1:8888",        "login" : "<someusername>",        "password" : "<somepassword>",        "api_key" : "<someAPIkey>"    }}

Then save this file in this path (path and filename are important):

"%UserProfile%\AppData\Roaming\BitTorrent Sync\sync.conf"

 

Then launch BTSync without any command line options.

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

You can simply copy the btsync executable anywhere you want and set 

"storage_path" : "./"

This will create the storage path in the same folder as the btsync executable,

wherever on your system you have placed it.

 

This is what I use to 'embed' btsync in my own application in order to provide a custom UI. 

If you are going to build anything on top of btsync you don't want to hardcode the path anyway

Link to comment
Share on other sites

  • 1 month later...

ryechz,

 

It is okay to use the Linux sample config in windows, with one little trick. You have to use backslashes in the files and folders paths. And as config file is stored in JSON format, you have to escape backslashes with double backslahses as they are the control character.

 

So the sample path to c:\temp\mystorage should be written as "C:\\temp\\mystorage" in config for windows. Also, there is a known issue which worsens usage of config files on Windows: Win version of BTSync does not display error messages to the console while parsing the config file.

 

Please try correcting your paths and let me know if it helps.

Link to comment
Share on other sites

  • 1 month later...

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.