Commit Graph

45 Commits

Author SHA1 Message Date
Jarek Kowalski
272b657508 upgrade all dependencies to latest versions 2020-03-15 23:40:58 -07:00
Jarek Kowalski
6ce8410a29 Added OpenCensus (#339)
* repo: added some initial metrics using OpenCensus

* cli: added flags to expose Prometheus metrics on a local endpoint

`--metrics-listen-addr=localhost:X` exposes prometheus metrics on
   http://localhost:X/metrics

Also, kopia server will automatically expose /metrics endpoint on the
same port it runs as, without authentication.
2020-03-11 22:07:31 -07:00
Jarek Kowalski
fb181257bf cli: implemented update check, fixes #119 2020-03-04 22:06:05 -08:00
Jarek Kowalski
ddd267accc crypto: deprecated crypto algorithms and replaced with better alternatives
New ciphers are using authenticated encryption with associated data
(AEAD) and per-content key derived using HMAC-SHA256:

* AES256-GCM-HMAC-SHA256
* CHACHA20-POLY1305-HMAC-SHA256

They support content IDs of arbitrary length and are quite fast:

On my 2019 MBP:

- BLAKE2B-256 + AES256-GCM-HMAC-SHA256 - 648.7 MiB / second
- BLAKE2B-256 + CHACHA20-POLY1305-HMAC-SHA256 - 597.1 MiB / second
- HMAC-SHA256 + AES256-GCM-HMAC-SHA256 351 MiB / second
- HMAC-SHA256 + CHACHA20-POLY1305-HMAC-SHA256 316.2 MiB / second

Previous ciphers had several subtle issues:

* SALSA20 encryption, used weak nonce (64 bit prefix of content ID),
  which means that for any two contents, whose IDs that have the same
  64-bit prefix, their plaintext can be decoded from the ciphertext
  alone.

* AES-{128,192,256}-CTR were not authenticated, so we were
  required to hash plaintext after decryption to validate. This is not
  recommended due to possibility of subtle timing attacks if an attacker
  controls the ciphertext.

* SALSA20-HMAC was only validating checksum and not that the ciphertext
  was for the correct content ID.

New repositories cannot be created using deprecated ciphers, but they
will still be supported for existing repositories, until at least 0.6.0.

The users are encouraged to migrate to one of new ciphers when 0.5.0 is
out.
2020-02-29 20:50:50 -08:00
Jarek Kowalski
4aa323a0a8 go.sum: cleaned up 2020-02-26 22:40:27 -08:00
Jarek Kowalski
0afc849f99 updated azure provider to match 2020-02-25 17:24:44 -08:00
Jarek Kowalski
c8fcae93aa logging: refactored logging
This is mostly mechanical and changes how loggers are instantiated.

Logger is now associated with a context, passed around all methods,
(most methods had ctx, but had to add it in a few missing places).

By default Kopia does not produce any logs, but it can be overridden,
either locally for a nested context, by calling

ctx = logging.WithLogger(ctx, newLoggerFunc)

To override logs globally, call logging.SetDefaultLogger(newLoggerFunc)

This refactoring allowed removing dependency from Kopia repo
and go-logging library (the CLI still uses it, though).

It is now also possible to have all test methods emit logs using
t.Logf() so that they show up in failure reports, which should make
debugging of test failures suck less.
2020-02-25 17:24:44 -08:00
Prasad Ghangal
c682fffdf2 Support for Azure blob storage (#271)
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2020-02-25 16:32:26 -08:00
Jarek Kowalski
ee88cfd229 server: switched from manual routing to github.com/gorilla/mux 2020-02-22 19:27:10 -08:00
Jarek Kowalski
8e812b76c0 blob: added retries to Filesystem provider, fixes #249 (#251)
Wrote a test first which failed 100% on Windows. After adding retries it passed 20 times in a row, execution time is ~10s.

Fixes #249
2020-02-19 13:17:47 -08:00
Jarek Kowalski
29db31d008 blob: fixed GCS post-submit test 2020-02-17 08:58:32 -08:00
Prasad Ghangal
28ab5e0e5f Add test for session token support
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2020-02-12 08:19:24 -08:00
Nick
383c042bf5 Adding low-level FSWalker walker/reporter functionality
Adds a wrapper around `Walk` that takes a Policy (protobuf definition) and performs a walk using it as configuration. The resulting Walk struct pointer is returned. The only exported functionality is unfortunately to read the Policy as a protobuf text file, so the implementation creates a temporary policy file whose lifetime is the duration of the call.

Adds a wrapper around the the FSWalker reporter `Compare` functionality. Takes a config file and two Walk pointers and compares the walks, returning the pb-defined Report struct. Again, the only exported functionality for reading config information is to read it as a protobuf text file. Creates a temporary config file, whose lifetime is the duration of the call, to pass in to the fswalker function.
2020-02-07 12:09:39 -08:00
Jarek Kowalski
2b07045ef9 travis: refactored release to be easier to understand
There's now one target, `travis-release` that can be run
locally, or on Travis CI except for:

- code signing (Travis on non-PR runs)
- publishing artifacts to GH releases (Travis on tagged releases)
- creating long-term repository for testing (Travis on tagged releases)
2020-02-02 22:23:08 -08:00
Julio Lopez
782ac3a228 Change import path to minio-go/v6
Follows the recommendations for importing dependencies with versions >= 2

https://tip.golang.org/cmd/go/#hdr-Module_compatibility_and_semantic_versioning
2020-01-30 21:18:04 -08:00
Jarek Kowalski
58759551b3 compression: added object.Compressor object and some implementations 2019-12-10 23:25:28 -08:00
Julio Lopez
ca9ba27c6f Use github.com/natefinch/atomic.WriteFile in copyFileContents 2019-12-10 22:22:32 -08:00
Julio Lopez
820b29cbf2 FS hasher testing helper 2019-12-10 22:22:32 -08:00
Jarek Kowalski
36859bdf8b server: removed dependency on pat 2019-11-20 15:49:40 -08:00
Jarek Kowalski
e8a1eaa9ee htmlui: added experimental HTML-based UI
This is enabled by `kopia server --ui` and can be viewed in a browser
at http://localhost:51515/

Right now it can only list snapshots and policies (barely).
2019-11-20 14:41:38 -08:00
Julio Lopez
3883c2751c Allow multiple simultaneous profilers (#122)
Allow multiple simultaneous profilers.
Also, allow specifying the memory sampling rate for
the memory profiler
2019-10-31 05:11:41 -07:00
Jarek Kowalski
93eb4530ef go.mod: added missing dependency 2019-09-10 21:08:16 -07:00
Jarek Kowalski
6170ffb117 travis: upgraded to go 1.13, updated go module dependencies 2019-09-06 21:46:13 -07:00
Jarek Kowalski
81ea751c0c cli: added profile flags, built only with 'profiling' tag 2019-08-24 10:42:12 -07:00
Juan B. Rodriguez
a24a2da3c0 Implement an sftp backed storage provider
Uses go/ssh and pkg/sftp as building blocks and implements the common
sharded.Storage interface, shared between the filesystem and webdav
providers.

A couple of notes:

- The provider assumes the user has a working public/private key
connection to the ssh server.
No other authentication method is supported

- The repository path must exist on the server

- (testing related) The pkg/sftp server doesn't offer a way to set a
server filesystem root, so, during testing, it runs from the local
directory which is repo/blob/sftp. So the tests leave some debris
behind. Additionally, that's the reason why id_rsa and known_hosts
are there at all.

- Encrypted keyfiles are currently not supported (but it could be done)
2019-07-04 11:14:05 -07:00
Jarek Kowalski
c4fd5bb606 go.mod: updated dependencies 2019-06-09 08:42:46 -07:00
Jarek Kowalski
543f34ea6b go.mod: added missing dependency 2019-05-30 23:42:15 -07:00
Jarek Kowalski
03339c18af [breaking change] deprecated DYNAMIC splitter due to license issue
The splitter in question was depending on
github.com/silvasur/buzhash which is not licensed according to FOSSA bot

Switched to new faster implementation of buzhash, which is
unfortunately incompatible and will split the objects in different
places.

This change is be semi-breaking - old repositories can be read, but
when uploading large objects they will be re-uploaded where previously
they would be de-duped.

Also added 'benchmark splitters' subcommand and moved 'block cryptobenchmark'
subcommand to 'benchmark crypto'.
2019-05-30 22:20:45 -07:00
Jarek Kowalski
09e12bec86 go.mod: update dependencies 2019-05-27 17:18:23 -07:00
Jarek Kowalski
0c41d41276 Fixed up paths after merge 2019-05-27 15:48:39 -07:00
Jarek Kowalski
a6a153b22e switched fmt.Errorf() to errors.Wrap() 2019-05-11 12:34:14 -07:00
Jarek Kowalski
2787011e02 Revamped kopia.io website.
Added build pipeline to keep the reference in sync with the code.
2019-05-09 22:11:03 -07:00
Jarek Kowalski
5b1c51bf76 go.mod: updated repo 2019-04-02 19:26:48 -07:00
Jarek Kowalski
0de3f57d25 go.mod: updated 2019-03-31 18:52:24 -07:00
Jarek Kowalski
5fc463f479 repo: upgraded to v0.3.0-pre1 2019-01-21 13:38:35 -08:00
Jarek Kowalski
df3a3124a6 go.mod: added commented-out 'replace' directive to facilitate working with repo 2019-01-21 13:12:51 -08:00
Jarek Kowalski
b37c29513b cli: added 'repo repair' subcommand which operates on the same arguments as 'repo connect', but it fixes contents of the repository by restoring missing kopia.repository file
tests: reorganized end-to-end tests
2019-01-19 05:48:40 -05:00
Jarek Kowalski
2e297dc60d repo: upgraded to latest version, removed format block settings from repository create, instead --encryption=NONE disables encryption of both blocks and format 2019-01-12 09:24:12 -08:00
Jarek Kowalski
db9759bf3a upgraded repo 2018-12-31 19:10:21 -08:00
Jarek Kowalski
0b89cbef3b cli: added 'repo upgrade' command that invokes Repository.Upgrade() 2018-12-31 17:12:30 -08:00
Jarek Kowalski
18932db45f Makefile: added build-all target, missing Windows and Linux-specific deps 2018-12-30 06:41:50 -08:00
Jarek Kowalski
a6a9729f71 upgraded repo to v0.2.0 2018-12-29 15:14:29 -08:00
Jarek Kowalski
43e58c5a4c upgraded repo to newest version 2018-12-22 20:07:34 -08:00
Jarek Kowalski
82b7a9653f go.mod: updated repo dependency 2018-10-27 12:28:45 -07:00
Jarek Kowalski
20a2980be4 added go1.11 module 2018-10-27 08:50:22 -07:00