delegatevoid

Members
  • Posts

    65
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by delegatevoid

  1. Hi,

    So here's what I did just to verify what we already know.

     

    • I set up a second LAN that is not connected to the internet in anyway.
    • I added two systems to that LAN and installed BTSync on them.
    • I created a sync folder on one system
    • I added the sync folder on the other system (using the key provided by the first)
    • Seconds later the devices started syncing

    This is the expected behavior, the systems discover each other directly

    without the need for an internet connection.

     

    Let's say that for some reason your systems had to use an external tracker

    or relay host to find each other or to sync data,

     

    then there's probably something else at play here. Perhaps firewall rules somewhere? 

  2. Hi,

     

    An internet connection is not required for the API to work

    and unless you expose the port on which the web service is running to

    the outside world by using NAPT mappings there is no way to access

    the web service from outside your local network.

     

    So, long story short: By default the API is intended to be used in an LAN environment,

    which means it is no problem for you or your customers to implement it.

     

    As far as syncing is concerned, devices on the same LAN will normally

    sync directly witch each other without connecting to anything else.

     

    If you want to lock it down 100%, simply disable the following features for the sync folder:

     

    • Use relay server when required
    • Use tracker server
    • Search DHT network

    If you want to sync across devices on different networks,

    you can still disable all of the above, but you'll have to expose the port which BTSync

    uses to the outside network (this is not the same as the port on which the web service / api is running)

    and then add a predefined host to the "clients" sync folder configuration.

     

    The sync API cannot be de-activated using a remote call, since the API service is not exposed

    to the internet. And even if you do expose it to the internet (do so with care), de-activation would

    only be possible if that was build into the btsync application.

     

    There is a lot of controversy concerning the API key required to enable the API features,

    perhaps the developers did not think it through, or they wanted a way to limit the number of 

    people fiddling around with it until there is a "stable" release, who's to say, but given

    the nature of btsync I do not think it is the intention of the Bittorrent company to "control" how we use btsync.

     

    Just for reference, here's a quick example network:

     

    examplebtsyncnetwork.png

     

    If you look at both local area networks (two intranets if you will) then, by default, the API exposed

    by your BTSync instances will only be available for devices within the same LAN.

    No internet connection required.

     

    If you have more than one LAN connected into one VPN, the API will, by default,

    be availablefor devices within the entire VPN.

  3. Ok, apparently they changed the parameter from "encryption" to "encrypted". 


    And yet I'm not getting the encrypted key:

    http://localhost:8888/api?method=get_secrets&secret=AAAAAAAAAAAAAAAAAAAAAAAA&type=encrypted

    Returns:

    { "read_only": "AAAAAAAAAAAAAAAAAA", "read_write": "BBBBBBBBBBBBBB" }

    Note that I did replace the actual key values before posting here.

     

    The API documentation specifies:

    http://[address]:[port]/api?method=get_secrets[&secret=(secret)&type=encryption]

    Yet the following line on the same page specifies:

     

    • secret (required) - must specify folder secret
    • type (optional) - if type=encrypted, generate secret with support of encrypted peer

    Please note the colour coded parameter and how two different versions are used:

     

    encrypted vs encryption

     

    Neither values return the encrypted key for me. (v1.3.94)

  4. Hi,

    Sorry it took me a while to get back to you. Apparently I am no longer receiving notifications from this forum.

    As you pointed out you see the backup machine in the devices tab of the other computer. 

    When you look at the "transfers" tab, do you ever see any activity there? 

     

    Timothy

  5. Hi,

     

    While the API does expose some extra features, most of what you need can be configured with the default client.

     

    Seems like you have a number of issues:

     

    • High CPU usage of the BTSync application
      This might be due to a bug in the application, probably something the Bittorrent devs should take a look at
      I have noticed similar spikes in CPU usage on Windows but not to the extend where it hinders mouse movements.
      What are the specs of the machine you are experiencing this on?
    • Not syncing
      Can you verify that the other system is visible in the Devices tab?
      If the backup machine has a static IP, you may want to modify the properties of the sync folder
      on the source machine to "Use predefined hosts" and add the static IP of the backup machine (+ port).
      You will also have to configure the firewall to expose the port on which BTSync is listening (on the backup machine).
      At that point you can disable "use tracker server" and "use relay server". This usually fixes syncing issues for us.

    Timothy

  6. Aside from whether or not the API key should be removed completely,

    until that day comes it's still not clear to me:

     

    1) Do we as developer distribute the key with our software, essentially making it very easy for users to 'fetch' and abuse them

    or

    2) Will every user have to request their own API key... which will be a disaster...

  7. I was trying to reply to this blog entry:

    http://blog.bittorrent.com/2014/02/04/sync-hacks-how-to-set-up-bittorrent-sync-on-a-synology-nas/

     

    But apparently the comment system doesn't seem to work properly.

    So I'll just put up a quick note here.

     

    While the blog entry goes in-depth on how to set things up manually,

    for those that just want to get up and running in no time and keep everything up to date automatically,

    the easier solution is to add the SynoCommunity repository to the package manager in DSM

     

     
    Once it's added, use the packet manager to install BTSync and everything else will be set up for you.
     
  8. 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

  9. You can distribute the btsync executable with your own application and have your own application start it with the proper configuration parameters. There's no need for a "real" install on the target machine. If that's what you mean.

     

    If you meant "using the btsync executable as an embedded library" then I'm afraid that won't work (yet?)

  10. Hi,

     

    Is there a way to interact with BTSync on Android?

    Aside from installing the normal BTSync on Android as described here

    https://matt.bionicmessage.net/blog/2013/04/27/Running%20BitTorrent%20Sync%20on%20your%20(rooted)%20Android%20device

     

    I'd like to be able to add new keys from within another application.

     

     

    Update: Sorry, just remembered I had already asked this, and there is no way to delete the old post.

    Anyway, never got an answer so...

  11. I'm wondering if it is possible (or will be) to control BTSync running on Android from
    other applications running on the same machine. 

     

    Now this might sound weird if you're thinking of Android as a pure mobile OS,
    but we actually use Android as embedded device solutions (as opposed to using
    Linux based solutions on top of a Raspberry for example).

     

    If we have a few hundred devices in a network running one of our applications
    we could then have the central server tell that application to let btsync register
    a new secret key. So basically configure content distribution remotely.

     

     

  12. In all methods except for GetPreferences and SetPreferences 0 and  are used to
    represent boolean values while in those two the values true and false are used.

     

    It gets worse though, because in the Get/Set Preferences method there is one

    parameter that is using and to represent boolean values: use_upnp

     

    You guys should pick on or the other.

     

    Update: This is actually another error in the documentation and the returned json does use 1 and 0 to represent true or false

  13.  

     

    Generates read-write, read-only and encryption read-only secrets. If ‘secret’ parameter is specified, will return secrets available for sharing under this secret.

     

    This indicates the 'secret' parameter is optional, however at the end of this section in the docs:

     

     

    http://[address]:[port]/api?method=get_secrets[&secret=(secret)&type=encryption]

    • secret (required) - must specify folder secret
    • type (optional) - if type=encrypted, generate secret with support of encrypted peer

     

    In reality the parameter is in fact optional, not specifying a secret simply generates random keys.

  14. The SetFilePreferences method should return an indication of whether or not an error occured.

     

    For example, is an invalid secret key is specified or if the specified file does not exist.

    Currently there is no such feedback.

     

    This adds to my previous post about the AddFolder method.

     

    All methods should use the same field name to return errors and the
    value of the error code should be a unified list for the entire API, these are just API basics.