LazyWolf

Members
  • Posts

    40
  • Joined

  • Last visited

Posts posted by LazyWolf

  1. One method you could use is to make a backup folder /BackUp and bind the folders you want to have backups to into that folder, then sync that folder...

    Example...


    mkdir /BackUp
    cd /BackUp
    mkdir opt var
    mount -o bind /opt /BackUp/opt
    mount -o bind /var /BackUp/var

    Not sure if this would work as I have not tested it myself but it should be one option -- also if it does work and you do like how it turns out -- you just need to edit /etc/fstab to make the folders bind on boot. Again you will run into permission issues if another computer adds files.

    So another option would be to have a cronjob to archive the files you want to protect and have the outputted archive go to the BackUp folder.

  2. Are the commands you typed exactly what you have in your post?

    What I see from your post is that you made a new directory /autostart not ~/.config/autostart/

    Also for my desktop this is the btsync.desktop file I use...


    [Desktop Entry]
    Name=BTSync
    Comment=Sync your files across computers and to the web
    Exec=/home/-user-/.sync/btsync --config /home/-user-/.sync/sync.conf
    Terminal=false
    Type=Application
    Categories=Network;FileTransfer;
    StartupNotify=false

    Also if you are creating the autostart and .desktop in your users directory, you do not need to use sudo as sudo will give the ownership of the file and folder to root. So...


    sudo chown user:user ~/.config/autostart -R

  3. In the android app go to the settings menu and under Backup click the backup button. Put the backup somewhere that will be easy to find(I would make a new folder). Download a file manager like OI File Manager, then navigate to where you put the backup. Extract the files in the .zip. Then go into the new btsync directory and rename sync.dat to sync.txt and open sync.txt. In there you will be able to see all your settings.

    Find the key you want and copy it down(ignore the 15: the key will always end with, ex if the key was AAAAAAAA the file would have :AAAAAAAA15:)

  4. Not sure if it has been fixed yet but I found that when a base64 string used as a key contained backslashes sync would ignore the rest of the key...

    Say your secrete was...

    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\BBBBBBBBBBBBBBBBBBBBBBBB

    I was able to use the key AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

    That was in 1.0. and I haven't tested but I use have a little script in my bin dir...


    #!/bin/bash
    key=`openssl rand 1024 -base64 | tr '/\n' '\0' | tr '+' '\0' | tr '[a-z]' '\0' | tr '=' '\0'`
    echo "A"$key
    exit

  5. Here is some quick python I typed up, havent had time to test it properly but it looks like it should run...

    It needs to be launched by root(maybe something simple like adding to /etc/rc.local), and the system needs to have python.

    Filename: BTSync-launcher.py

    root:root(rwx------)


    #!/usr/bin/python
    from subprocess import Popen, PIPE# used to open the process and to hide the output
    from os import setuid# Force the process to run as the set user
    from os.path import exists# Check to make sure config and bin exist
    from sys import exit# early exits
    from pwd import getpwnam# Used to get the uid of the given user
    user = "www-data"
    pathToBTSync = "/path/to/btsync"
    pathToConfig = "/path/to/config"
    #\
    userUID = getpwnam(user)[2]# Dont touch!
    def main():
    if not exists(pathToBTSync) or not exists(pathToConfig):
    print "Error finding %s or %s." % (pathToBTSync, pathToConfig)
    exit(1)
    Popen([pathToBTSync, '--config', pathToConfig], stdout=PIPE)
    if __name__ == "__main__":
    try:
    setuid(userUID)
    except OSError:
    print "You do not have permission to run this as %s try running it as root!" % user
    exit(1)
    main()

    Also in your BTSync config file make sure "pid_file" is in use and points to a folder that www-data owns and has rwx to.

  6. That isn't a solution at all and the fact that this is an "official" workaround makes me trust in BTSync's security _a lot_ less. This is so trivially insecure it's laughable.

    There currently is not a method built into BTSync that would allow for what you want, your secret is used to initiate contact between peers. It is not like a file system -- you cant just call up the one file you want but encrypted there has to be the initial contact between the peers then an encrypted tunnel of sorts is formed. So kos13 recommended working with what you have, if you are giving out a secret to anyone they could in turn give that away to someone else as well – that is a human issue and not something BTSync is currently equipped to handle.

    Another possible temporary workaround would to be a file based encryption schema like encfs, then each user could have their own folder that gets mounted when they log in. But again if someone owns their box it doesn't make any difference the only thing that method would accomplish would be to protect the data on the "seedbox"(for lack of a better word) which would more than likely be better protected by default than the client computers that would be accessing the data.

  7. Instead of making a new post I think it would be nice to have one general post about the Android App...

    Sync app ver 1.1.7

    Linux BTSync ver: 1.1.27

    I would like to see a better Camera Backup.

    For me it works but when I click on the Backup tab 98% of the time I just see "Auto backup is on Connecting..."(Picture)

    While that message is up if I go to the Sync tab I see there is a folder Camera added to the list (Picture) and everything syncs just fine, it just seems to me like it has not been implemented very well in the app.

    ---

    One more thing I think people should be aware of, when you send files through the Send tab the secrete generated for the QR code is a full access code, so if while your devices are tethered one of the devices deletes the file on their device it will be deleted on all devices.

  8. I would love to see a one-way sync for storing backups. Not sure how this could be implemented easily but I think it would be amazing in my line of work. Say you have a mission critical server that has staged backups -- once the backup script is finished it moves the archive to the sync folder and is pushed to an off-site NAS, home server, and cloud backup server. If the server is compromised the hacker would be able to see the backup files and may delete them, but the deletion will not be synced to all the other devices.

    I know there are many businesses(and people) that do not follow recommended backup procedures, say rotating two external hdds for backup use -- I have seen fires destroy servers, but not only the servers but the backup mediums that were meant to be stored off-site but were sitting on the server.

    So something like sync would be sweet because it doesn't really require human interaction.

    ---

    Also just thinking about internation travel where a laptop may be seized or stolen, it would be nice to have a one way sync to send data back then have that data safely deleted.

  9. I had an issue while testing out a newer version of btsync and had forgotten to backup the config files beforehand, then when I went back to the version my other devices were using it would not start up. I saw that I could recover the secrets and paths from sync.dat.old so I copied it and wrote a quick little python script to help me.

    If anyone uses a unix type os I hope this script will save you some time, it is made to search /home/username/.sync and your current directory first.


    #!/usr/bin/python
    """
    This is a quick little script I made to parse out the key and path pairs from BTSync's config.
    """

    # Imports
    from sys import exit
    from os import getenv
    from os.path import exists,abspath

    # G Vars
    pwd = abspath('.')+"/" # sets the current directroy
    defaultDirs = ((getenv("HOME")+"/.sync/sync.dat", getenv("HOME")+"/.sync/sync.dat.old"),
    (pwd + "sync.dat", pwd + "sync.dat.old"))
    #\
    sync = "" # Dont touch!
    syncOld = "" # Dont touch!
    bigData = [] # Dont touch!

    # Fns
    def __sortData():
    global bigData
    f0 = open(sync, "r")
    data = f0.read().split(":")
    f0.close()
    del f0
    f1 = open(syncOld, "r")
    tmp = f1.read().split(":")
    f1.close()
    del f1
    tmpLen = len(tmp)
    for i in range(0, tmpLen): data.append(tmp[i])
    del tmp, tmpLen
    dataLen = len(data)
    for i in range(0, dataLen):
    curLine = data[i]
    # if curLine.find("path") != -1 and data[i+3][-2:] == '15': bigData.append({'path':data[i+1][:-1],'secret':data[i+3][:-2]})
    if curLine.find("path") != -1 and data[i+3][-1:] == '7': bigData.append({'path':data[i+1][:-1],'secret':data[i+3][:-1]})
    elif curLine.find("path") != -1 and data[i+3][-2:] == '15': bigData.append({'path':data[i+1][:-1],'secret':data[i+3][:-2]})
    del data, dataLen, curLine
    return 0
    # end of sortData

    def __setPaths():
    global sync, syncOld
    for i in range(0, len(defaultDirs)):
    if exists(defaultDirs[i][0]) and exists(defaultDirs[i][1]):
    sync = defaultDirs[i][0]
    syncOld = defaultDirs[i][1]
    break
    if sync == '' or syncOld == "": return None
    else: return 0
    # end of setPath fn

    def __printData():
    print "------"
    input = bigData
    inputLen = len(input)
    if inputLen == 0: return None
    for i in range(0, inputLen):
    print "Secret: " + input[i]['secret']
    print " Path: " + input[i]['path']
    if i != (inputLen-1): print "---"
    print "------"
    del input, inputLen
    # end of printData dn

    # Main
    def main():
    # Look for sync.dat and sync.day.old file
    if __setPaths() == None:
    print "There was an error finding the sync.dat files!"
    exit(1)
    # Read both files and put them together
    if __sortData() == None:
    print "There was an error sorting the data!"
    exit(1)
    # print data to screen
    __printData()
    # end of main fn
    if __name__ == "__main__":
    main()

    Edit 1: -=:Updated 07/04/13 - to work with 1.1.27:=-

    Edit 2: -=:Updated 07/22/13 - to work with 1.1.42:=-