Commit Graph

727 Commits

Author SHA1 Message Date
Thomas Waldmann 6e6819e626 attic delete: add repository + local cache deletion 2015-03-09 16:02:06 +01:00
Thomas Waldmann d3fe74d4c0 Cache: do not try to release the lock twice
If Cache was already closed and __del__ was called, it called close() again
and crashed when trying to release the lock again.
2015-03-09 15:17:56 +01:00
Thomas Waldmann 9841af5542 better attic create -v output
Added a indicator character to the left for (A)dded, (M)odified, (U)nchanged status
of regular files. Lowercase indicators are for special files.

You may or may not want to use grep to filter out U and d.
2015-03-08 19:18:21 +01:00
Thomas Waldmann d9cfca8989 PR #223 - Merge branch 'fix_45' of https://github.com/ThomasWaldmann/attic into merge 2015-03-08 15:09:01 +01:00
Thomas Waldmann 4633931413 add global option --no-cache-files to lower memory consumption
When given, attic does not use the "files" cache. Saves about 240B RAM per file
(that sounds only a little, but consider that backups nowadays are often millions of files).

So try this if attic eats more memory than you have as RAM (usually means paging or
MemoryErrors). Of course, saving memory is not for free. In my one experiment, run time
increased from 3.5 to 23 minutes (my system has enough RAM).
2015-03-08 15:01:24 +01:00
Thomas Waldmann 084f6e1602 PR #222 - Merge branch 'issue_189' of https://github.com/ThomasWaldmann/attic into merge 2015-03-08 04:20:13 +01:00
Thomas Waldmann be29e5f6f4 fix traceback when trying to do unsupported passphrase change, fixes #189 2015-03-08 04:19:25 +01:00
Thomas Waldmann c8b23b507d PR #221 - Merge branch 'issue_139' of https://github.com/ThomasWaldmann/attic into merge 2015-03-08 02:37:43 +01:00
Thomas Waldmann e425545c10 datetime does not like the year 10.000, fixes issue #139 2015-03-08 02:32:33 +01:00
Thomas Waldmann 70e907f4ed PR #184 - Merge branch 'fuse-filesizes' of https://github.com/dnnr/attic into merge 2015-03-07 00:09:51 +01:00
Thomas Waldmann 0d2cd28c19 PR #214 - Merge branch 'crypto_cleanup' of https://github.com/thomaswaldmann/attic into merge 2015-03-06 23:50:15 +01:00
Thomas Waldmann 29449e40bc PR #208 - Merge branch 'stdin_stdout_support' of https://github.com/thomaswaldmann/attic into merge 2015-03-06 23:28:00 +01:00
Thomas Waldmann fbaa505191 PR #206 - Merge branch 'fixes' of https://github.com/thomaswaldmann/attic into merge 2015-03-06 23:18:08 +01:00
Thomas Waldmann 8c4d290a93 PR #173 - Merge branch 'rpc-whitelist' of https://github.com/dnnr/attic into merge 2015-03-06 22:55:53 +01:00
Thomas Waldmann a5fe6160ba PR #150 - Merge branch 'normalize_paths' of https://github.com/wavexx/attic into merge 2015-03-06 22:35:16 +01:00
Thomas Waldmann edb8f21411 PR #198 - Merge https://github.com/evanhempel/attic into merge 2015-03-06 21:57:06 +01:00
Thomas Waldmann 7555792b4f PR #191 - Merge https://github.com/rpodgorny/attic into merge 2015-03-06 21:50:29 +01:00
Thomas Waldmann 2fbef266f9 PR #156 - Merge branch 'doc-multi' of https://github.com/anarcat/attic into merge 2015-03-06 21:46:02 +01:00
Thomas Waldmann 9e77251d8c PR #155 - Merge branch 'doc-encryption' of https://github.com/anarcat/attic into merge 2015-03-06 21:44:47 +01:00
Thomas Waldmann c191ab189f PR #153 - Merge branch 'dependencies' of https://github.com/anarcat/attic into merge 2015-03-06 21:36:44 +01:00
Thomas Waldmann dd641ddc5b PR #152 - Merge branch 'patch-1' of https://github.com/anarcat/attic into merge 2015-03-06 21:32:31 +01:00
anarcat effab97d11 clarify that simultaneous backups may be a problem 2015-03-05 09:06:20 -05:00
anarcat ecee5a0b51 PDKF is a key derivation function
do not use the word "encryption", as it is actually closer to "hashing" anyways.
2015-03-05 09:00:06 -05:00
anarcat 5f882e976d clarify the index memory usage analysis
it seems I extracted that data from [this mailing list post][] which
in turn takes it from [this github comment][].

 [this mailing list post]: http://librelist.com/browser/attic/2014/5/6/questions-and-suggestions-about-inner-working-of-attic/
 [this github comment]: https://github.com/jborg/attic/issues/26#issuecomment-35439254
2015-03-05 08:57:52 -05:00
anarcat 0ba86357d7 clarify that 4095 bytes is not a typo
i am actually assuming this right now, i haven't double-checked
2015-03-05 08:51:26 -05:00
anarcat 87cb4a4813 expand on the chunk id hash mechanism
according to @ThomasWaldmann, the algorithm varies according to whether encryption is enabled.
2015-03-05 08:48:23 -05:00
anarcat 8f8a035e93 fix a bunch of typos
this should fix the comments identified as `typo` and other small quirks found by @ThomasWaldmann.
2015-03-05 08:41:48 -05:00
Thomas Waldmann 1f4077d870 crypto.pyx: adapt to strange requirements found in the openssl docs
https://www.openssl.org/docs/crypto/EVP_aes_256_cbc.html

EVP_DecryptInit_ex(), EVP_DecryptUpdate() and EVP_DecryptFinal_ex() are the corresponding decryption operations. EVP_DecryptFinal() will return an error code if padding is enabled and the final block is not correctly formatted. The parameters and restrictions are identical to the encryption operations except that if padding is enabled the decrypted data buffer out passed to EVP_DecryptUpdate() should have sufficient room for (inl + cipher_block_size) bytes unless the cipher block size is 1 in which case inl bytes is sufficient.

I doubt this is correct, but let's rather be defensive here.
2015-03-03 20:18:28 +01:00
Thomas Waldmann 550320535c crypto.pyx: cosmetic changes, added comments 2015-03-03 20:11:28 +01:00
Thomas Waldmann 6c7c2e2e40 cleanup crypto.pyx, make it easier to adapt to other modes
There were some small issues:

 a) it never called EVP_EncryptFinal_ex.
For CTR mode, this had no visible consequences as EVP_EncryptUpdate already yielded all ciphertext.
For cleanliness and to have correctness even in other modes, the missing call was added.

b) decrypt = encrypt hack
This is a nice hack to abbreviate, but it only works for modes without padding and without authentication.
For cleanliness and to have correctness even in other modes, the missing usage of the decrypt api was added.

c) outl == inl assumption
Again, True for CTR mode, but not for padding or authenticating modes.
Fixed so it computes the ciphertext / plaintext length based on api return values.

Other changes:
As encrypt and decrypt API calls are different even for initialization/reset, added a is_encrypt flag.

Defensive output buffer allocation. Added the length of one extra AES block (16bytes) so it would
work even with padding modes. 16bytes are needed because a full block of padding might get
added when the plaintext was a multiple of aes block size.

These changes are based on some experimental code I did for aes-cbc and aes-gcm.
While we likely won't ever want aes-cbc in attic (maybe gcm though?), I think it is cleaner
to not make too many mode specific assumptions and hacks, but just use the API as it
was meant to be used.
2015-03-03 19:19:28 +01:00
Thomas Waldmann aab900b169 extract: if --stdout is given, write all extracted binary data to stdout 2015-03-01 05:07:29 +01:00
Thomas Waldmann a3f335e0ff create: if "-" is given as path, read binary from stdin 2015-03-01 04:29:44 +01:00
Thomas Waldmann db7ce095d2 fix typos / spelling 2015-02-28 03:43:08 +01:00
Thomas Waldmann 8ffd4c4926 convert docstrings to triple-double-quoted 2015-02-28 03:24:30 +01:00
Thomas Waldmann a8ce0b8b8a remove unused imports 2015-02-28 03:09:01 +01:00
Thomas Waldmann 74768511e1 do os.fsync like recommended in the python docs (gets a fileno, not file object, also do a flush first) 2015-02-28 02:45:21 +01:00
Thomas Waldmann 0e5ef376bf add .idea/ to gitignore, so PyCharm stuff does not get accidentally added/committed 2015-02-28 02:33:35 +01:00
Evan Hempel b425950f8b Extra debug information for 'fread failed' 2015-02-12 20:32:20 -05:00
Radek Podgorny 939e75467e add more .c files to .gitigore 2015-02-04 00:04:22 +01:00
Daniel Danner bffc419615 FUSE: reflect deduplication in allocated blocks
Instead of giving all files a fixed block count of 1, this assigns each
deduplicated chunk to a certain file. In effect, the cumulative file
size that is shown in the mountpoint accurately reflects the amount of
actual disk space needed for the repository (barring metadata overhead).

Although the block assignment is done arbitrarily, depending on the
user's access pattern, the sizes will be consistent within the entire
mount point. This facilitates the use of tools like du and ncdu for
inspecting the actual disk usage in a repository as opposed to just
looking at the original, uncompressed, non-deduplicated file sizes.
2015-01-23 16:43:45 +01:00
Daniel Danner 046b196bab Only allow whitelisted RPC calls in server mode
Without this check, the client is able to call any method of
RepositoryServer and Repository, potentially circumventing
restrict_to_paths or even run arbitrary code.
2015-01-11 14:06:59 +01:00
Jonas Borgström 4ab4ecc7af hashindex: Fix issue with file sizes larger than 2GB.
See: http://librelist.com/browser//attic/2015/1/6/does-attic-have-an-upper-data-size-limit/
2015-01-06 22:28:04 +01:00
Jonas Borgström df6324b725 Include missing pyx files in dist file.
Closes #168
2015-01-04 22:25:11 +01:00
Jonas Borgström 77bd65aa03 Merge pull request #165 from brodul/docs
Fix documentation 'snapshot' to 'checkpoint'
2015-01-03 23:14:13 +01:00
Jonas Borgström b5a9085717 Fix Python 3.2 compatibility issue with noatime open().
Closes #164.
2015-01-03 23:12:47 +01:00
Andraz Brodnik 6d64a1c76b Fix documentation 'snapshot' to 'checkpoint'
In the code the string `checkpoint` is appended.
./attic/archive.py:137
2014-12-25 13:23:30 +01:00
Jonas Borgström f342621dff Preparing release 2014-12-17 23:19:22 +01:00
Jonas Borgström add59e4ab3 Prepare for future payload format change 2014-12-17 21:55:33 +01:00
anarcat b7718f044d Update internals.rst 2014-12-17 10:11:02 -05:00
Antoine Beaupré 2676c5fae8 document that multiple clients can backup to a single remote
answer comes from author here: http://librelist.com/browser//attic/2014/11/11/backing-up-multiple-servers-into-a-single-repository/#e96345aa5a3469a87786675d65da492b

this should address the last remaining issue in #60
2014-12-16 11:16:30 -05:00