Commit Graph

1178 Commits

Author SHA1 Message Date
Jarek Kowalski
cc888fb76b travis: removed deployment to GH pages after switching to netlify 2020-03-02 21:51:56 -08:00
Jarek Kowalski
9198dcc98e README: added netlify badge 2020-03-02 21:51:56 -08:00
Nick
8e0167027d Use bytes buffer to capture stderr instead of reading pipe
Give a `*bytes.Buffer` to the command and let `package exec` read from the pipe into the buffer for us.

The current use of the `StderrPipe()` method was problematic; the documentation for os/exec states:

> Wait will close the pipe after seeing the command exit, so most callers need not close the pipe themselves. It is thus incorrect to call Wait before all reads from the pipe have completed. For the same reason, it is incorrect to use Run when using StderrPipe.
2020-03-02 17:04:46 -08:00
Jarek Kowalski
a47052f49f site: added 'Hosted on Netlify' to be able to qualify for their free Open Source license 2020-03-02 17:00:18 -08:00
Jarek Kowalski
d95e6a3d09 sftp: Fixed issues in SFTP provider, Fixes #216
- did not work on windows due to use of filepath which uses backslash
  instead of slash
- added support for embedding SFTP key
- fixed UI controls
- misc fixes for KopiaUI
- added progress reporting
2020-03-01 18:56:06 -08:00
Jarek Kowalski
faa7225c23 testing: better fix for ignoring ErrClosed 2020-03-01 10:53:52 -08:00
Jarek Kowalski
38862a7bf9 kopia-ui: fixed redirection to /repo not working (404) 2020-02-29 21:55:06 -08:00
Jarek Kowalski
943e38f75b kopia-ui: added UI for configuring Azure provider 2020-02-29 21:55:06 -08:00
Jarek Kowalski
d75bef7a79 crypto: ensured that we generate random nonces for all ciphertexts of non-deprecated encryption algorithms 2020-02-29 20:50:50 -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
5e1b03dcba test: ignore ErrClose when reading from stderr to fix text flake 2020-02-29 20:07:45 -08:00
Nick
835d0b259c Fix error clobbering in kopia cli runner
Error variable was being shared between c.Output and
ioutil.ReadAll. The two could race to set err, and if
Output() finishes first with an error, ReadAll could overwrite
it with nil. Fix is to delegate an independent error for
the pipe read, and fail the test if it is non-nil.
2020-02-29 13:58:10 -08:00
Jarek Kowalski
fd91186ead travis: used own retry script, since travis_retry does not work in makefile 2020-02-29 10:55:46 -08:00
Jarek Kowalski
007890ebfd travis: used own retry script, since travis_retry does not work in makefile 2020-02-29 10:46:42 -08:00
Jarek Kowalski
6d4d66621e travis: wrap setup and release steps with travis_retry to reduce flakes 2020-02-29 10:33:46 -08:00
Nick
173e18c97d Fix typo in makefile so CI can pass (upload-coverage target)
Fixing a typo in the Makefile target upload-coverage. Without fix, the target it is not found if Travis is running against a PR.
2020-02-28 18:10:10 -08:00
Prasad Ghangal
882a4e1e5b Add a way to execute S3 storage test on AWS
Create kopia bucket and user with unique ID on minio
Create AWS bucket before running tests

Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2020-02-28 06:30:39 -08:00
Jarek Kowalski
c55e53041c travis: fixed --skip-publish logic 2020-02-27 21:49:00 -08:00
Jarek Kowalski
7512f581f1 travis: checkout go.mod/go.sum at the end of travis-setup 2020-02-27 21:30:35 -08:00
Jarek Kowalski
2d214d2670 Makefile: refactored travis-release to run goreleaser first, which should avoid dirty git state 2020-02-27 21:04:57 -08:00
Jarek Kowalski
d181403284 crypto: refactored encryption, hashing and splitter into separate packages (#274)
Added some tests, deleted XSALSA20 which never worked E2E
2020-02-27 12:36:49 -08:00
Jarek Kowalski
c159569070 changed how go-bindata is installed to avoid go.mod 2020-02-26 22:54:53 -08:00
Jarek Kowalski
4aa323a0a8 go.sum: cleaned up 2020-02-26 22:40:27 -08:00
Jarek Kowalski
4ca9bee898 Makefile: print git diff before goreleaser 2020-02-26 22:22:19 -08:00
Jarek Kowalski
1b4e200836 fixed missing go.sum entry 2020-02-26 21:54:23 -08:00
Jarek Kowalski
f9359a6788 kopia-ui: disable linux snap build 2020-02-26 21:42:15 -08:00
Jarek Kowalski
9079418c7c kopia-ui: simplified handling of Mac menu bar 2020-02-26 21:42:15 -08:00
Jarek Kowalski
765bff8e0b cli: restored snapshot create --hostname and --username flags 2020-02-25 20:40:23 -08:00
Jarek Kowalski
e3854f7773 BREAKING: changed how hostname/username are handled
The hostname/username are now persisted when connecting to repository
in a local config file.

This prevents weird behavior changes when hostname is suddenly changed,
such as when moving between networks.

repo.Repository will now expose Hostname/Username properties which
are always guarnateed to be set, and are used throughout.

Removed --hostname/--username overrides when taking snapshot et.al.
2020-02-25 20:40:23 -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
897483299f Kopia UI & CLI: support for progress indicator (#268)
Percentage based on last-known snapshot size

* server: exposed last completed snapshot size in the API
* cli: added support for progress indicator (percentage based on last-known snapshot size)
* htmlui: added progress indicator in the UI (percentage based on last-known snapshot size)
2020-02-24 17:55:02 -08:00
Jarek Kowalski
65e54fc180 travis: skip_cleanup was not working, restoring old form 2020-02-22 22:38:44 -08:00
Jarek Kowalski
b80e4272d0 added missing go.sum entry on Linux 2020-02-22 22:37:28 -08:00
Jarek Kowalski
3ce46e2c45 ui: few more tweaks
- better initial configuration flow
- fixed few fields that were mistakenly marked as required
2020-02-22 22:05:19 -08:00
Jarek Kowalski
5412d75f79 htmlui: approaching usability by mere mortals
- added ability to make new snapshots from the UI
- added directory picker
- hide/show macOS dock icon automatically
- fixed copy/paste on Mac (apparently if you don't have 'Edit' menu
  in your app, copy/paste and many other shortcut keys simply don't
  work)
- added smart time formatting ("X minutes ago", etc.) in lists
  using 'moment' library
- added progress information to snapshots
2020-02-22 20:03:57 -08:00
Jarek Kowalski
e573548b93 server: fixed race between shutdown and syncSourcesLocked() 2020-02-22 19:27:10 -08:00
Jarek Kowalski
985fc0ad12 server: fixed /objects/ path mapping, added tests 2020-02-22 19:27:10 -08:00
Jarek Kowalski
27854d85ed server: report local username and hostname when listing sources 2020-02-22 19:27:10 -08:00
Jarek Kowalski
3e58911cf3 tests: de-parallelized server tests 2020-02-22 19:27:10 -08:00
Jarek Kowalski
9b50a6e891 test: increased e2e test timeout
Added linear retry support when waiting for snapshots
2020-02-22 19:27:10 -08:00
Jarek Kowalski
fde2f2e0e6 server: additional status code from CreateSnapshotSource, more tests 2020-02-22 19:27:10 -08:00
Jarek Kowalski
ab2c906f2c server: implemented remaining server API methods
CreateSnapshotSource API for ensuring source exists
Upload - starts upload on a given source or matching sources
Cancel - cancels upload on a given source or matching sources
2020-02-22 19:27:10 -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
7efe83cbe8 travis: mac notarization setup 2020-02-22 19:09:17 -08:00
Jarek Kowalski
8c28d8e139 travis: mac notarization setup 2020-02-22 19:09:17 -08:00
Jarek Kowalski
22a00452b0 travis: added macOS app notarization 2020-02-22 18:34:34 -08:00
Julio López
e8b68e7829 Cleanup Travis config (#262)
Travis YAML cleanup

Removes warnings in Travis v2 config validation:

 root: duplicate key: addons
 deploy: deprecated key skip_cleanup (not supported in dpl v2, use cleanup)
 deploy: deprecated key skip_cleanup (not supported in dpl v2, use cleanup)
 addons.snaps: unknown key confinement (classic)
 deploy: key github_token is an alias for token, using token
 deploy: key api_key is an alias for token, using token

Changes:

- remove duplicate 'addons' key
- replace 'github_token' with 'token' in deploy.provider:"pages"
- replace 'api_key' with 'token' in deploy.provider:"release"
- replace 'skip_cleanup:true' with 'cleanup:false' in deploy.provider.*
- replace 'confinement:classic' with 'classic:true' in addons.snaps[0]

Ref:
- https://docs.travis-ci.com/user/deployment-v2/providers/pages/
- https://docs.travis-ci.com/user/deployment-v2/providers/releases/
- https://config.travis-ci.com/ref/job/addons/snaps
2020-02-20 23:40:06 -08:00
Jarek Kowalski
1e3100a88b Misc Kopia UI changes:
- disabled MacOS dock icon
- cleaned up MacOS menu bar
- added retry when opening main window, which is unavailable shortly
  after starting up server
- open main window on first run
- retry checking for updates every 24h
- fixed bug preventing Repository tab from finishing loading
- updated to latest package versions
2020-02-20 22:53:34 -08:00