Ako sa da dostat ku cloudovym zaloham?

Je prosim nejaky sposob ako si stiahnem z webu cloudove zalohy bez toho, aby som robil full restore? Dakujem, jose

Tak aby som to upresnil. Zo zdrojakov som vystudoval REST API a podarilo sa mi zalohu stiahnut.

REG_CODE=$(cat /usr/share/server-uplink/registration_code)
URL="https://rb.turris.cz"

# list backups with ids
curl 'Content-Type: application/json'  -H "Authorization:Token ${REG_CODE}" "${URL}/backups/"

# download a backup with specified id
id=XXXXXX
curl -o turris_cloud_backup.tbz.gpg -H 'Content-Type: application/json' -H "Authorization:Token ${REG_CODE}" "${URL}/backups/${id}/"

Bohuzial pokus o dekodovanie skonci s chybou. Poradite?

echo "MYPASSWORD" | gpg --batch -d -o turris_cloud_backup.tbz --passphrase-fd 0 turris_cloud_backup.tbz.gpg
gpg: AES256 encrypted data
gpg: encrypted with 1 passphrase
gpg: decryption failed: bad key

Rovnako neuspesny som pri pouziti hashovaneho hesla z /etc/config/ssbackups

Tak nakoniec toto zafungovalo:

# python3
import ssbackups_client

reg_code = ssbackups_client.get_registration_code('/usr/share/server-uplink/registration_code')
url = "https://rb.turris.cz"
ssbackups_client.backup_list(reg_code, url)
latest_backup_id = ssbackups_client.backup_list(reg_code, url)[0]['id']
password = [x.split()[-1].replace("'", "") for x in open('/etc/config/ssbackups').readlines() if 'option password' in x][0]
ssbackups_client.backup_retrieve(reg_code, url, latest_backup_id, '/tmp/mybackup.tbz', password)
2 Likes

Tak uz viem, kde bol problem zakopany. Nejak som si neuvedomil, ze $ v hashovanom hesle shell expanduje. Toto teda funguje:

echo '$MY$HASHED$PWD' | gpg --batch -d -o turris_cloud_backup.tbz --passphrase-fd 0 turris_cloud_backup.tbz.gpg
2 Likes

Related wiki entries:
https://wiki.turris.cz/doc/en/public/cloud_backup_retrieval
https://wiki.turris.cz/doc/cs/public/cloud_backups_access