Esempio n. 1
0
        elif opt == '--force-profile':
            force_profile = True
            conf.force_profile = val

        elif opt == "--solo":
            solo = True

    if args:
        if len(args) != 1:
            usage()

        apikey = args[0]

    if not registry.registry.secret:
        registry.registry.secret = generate_secret()
        registry.registry.key = keypacket.fmt(registry.registry.secret, "")
        print """\
Generated backup encryption key:

    For extra security run "tklbam-passphrase" to cryptographically protect it
    with a passphrase, which will be needed later to restore. If you use lose
    the passphrase it will be impossible to restore your backup and you may
    suffer data loss. To safeguard against this you may want to create an
    escrow key with "tklbam-escrow".
"""

    if solo:
        if registry.registry.sub_apikey:
            print "Broken TKLBAM link to your Hub account (--solo mode)"
            registry.registry.sub_apikey = None
            registry.registry.credentials = None
Esempio n. 2
0
        if opt in ('-h', '--help'):
            usage()

        if opt == '--random':
            opt_random = True

    hb = hub_backups()

    if opt_random:
        passphrase = random_passphrase()
        print passphrase
    else:
        print "(For no passphrase, just press Enter)"
        passphrase = get_passphrase()

    key = keypacket.fmt(registry.secret, passphrase)
    hbr = registry.hbr

    # after we setup a backup record
    # only save key to registry if update_key works
    if hbr:
        try:
            hb.update_key(hbr.backup_id, key)
            registry.key = key

            print ("Updated" if passphrase else "Removed") + \
                    " passphrase - uploaded key to Hub."

        except hub.Error:
            raise
    else:
Esempio n. 3
0
        if opt in ('-h', '--help'):
            usage()

        if opt == '--random':
            opt_random = True

    hb = hub.Backups(registry.sub_apikey)

    if opt_random:
        passphrase = random_passphrase()
        print passphrase
    else:
        print "(For no passphrase, just press Enter)"
        passphrase = get_passphrase()

    key = keypacket.fmt(registry.secret, passphrase)
    hbr = registry.hbr

    # after we setup a backup record
    # only save key to registry if update_key works
    if hbr:
        try:
            hb.update_key(hbr.backup_id, key)
            registry.key = key

            print ("Updated" if passphrase else "Removed") + \
                    " passphrase - uploaded key to Hub."

        except hub.Error:
            raise
    else:
Esempio n. 4
0
        elif opt == '--force-profile':
            force_profile = True
            conf.force_profile = val

        elif opt == "--solo":
            solo = True

    if args:
        if len(args) != 1:
            usage()

        apikey = args[0]

    if not registry.registry.secret:
        registry.registry.secret = generate_secret()
        registry.registry.key = keypacket.fmt(registry.registry.secret, "")
        print """\
Generated backup encryption key:

    For extra security run "tklbam-passphrase" to cryptographically protect it
    with a passphrase, which will be needed later to restore. If you use lose
    the passphrase it will be impossible to restore your backup and you may
    suffer data loss. To safeguard against this you may want to create an
    escrow key with "tklbam-escrow".
"""

    if solo:
        if registry.registry.sub_apikey:
            print "Broken TKLBAM link to your Hub account (--solo mode)"
            registry.registry.sub_apikey = None
            registry.registry.credentials = None