Commit Graph

892 Commits

Author SHA1 Message Date
Juan B. Rodriguez
4e2ceea146 Improve sftp provider logic
Tests are failing because pkg/sftp won't overwrite an existing file
(Rename function) and the test is actually doing that with
blobtesting.VerifyStorage.

The solution is to use pkg/sftp's PosixRename function:
"PosixRename renames a file using the posix-rename@openssh.com
extension which will replace newname if it already exists."

Additionally, the provider now creates the path on the server, if it
doesn't exist.
2019-07-16 15:46:52 -10:00
Jarek Kowalski
41530777a7 travis: fixed GPG decryption 2019-07-14 19:52:34 -07:00
Jarek Kowalski
692c741fa3 travis: reencrypted kopia.gpg 2019-07-14 19:47:59 -07:00
Jarek Kowalski
769b3c5f12 travis: reencrypted credentials with fixed key/iv 2019-07-14 19:30:22 -07:00
Jarek Kowalski
975824768e sftp: added encrypted e2e test credentials 2019-07-14 10:25:10 -07:00
Juan B. Rodriguez
d9a1fc93b7 Add e2e tests for sftp storage provider
Uses environment variables from the CI server, to connect to a test
sftp server

This also removes the "localhost" test
2019-07-12 23:16:29 -07:00
Jarek Kowalski
e414e7a4d1 Added support for reconnect tokens
Repository.Token() generates a base64-encoded token that can
be stored in password manager that fully describes repository connection
information (blob.ConnectionInfo) and optionally a password.

Use `kopia repo status -t` to print the token.
Use `kopia repo status -t -s` to print the token that also includes
repository password.

Use `kopia repo connect from-config --token T` to reconnect using the
token.
2019-07-10 21:03:40 -07:00
Jarek Kowalski
89469e74f2 goreleaser: fixed brews deprecation 2019-07-04 11:14:38 -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
b16e19dc64 fixing gcs credentials, try #3 - regenerated new SA JSON key 2019-07-04 10:56:50 -07:00
Jarek Kowalski
cb7127ac4a fixed credentials path, try #2 2019-07-04 10:20:25 -07:00
Jarek Kowalski
27f5b0540d fixed installation of GCS credentials for testing, which was silently being ignored 2019-07-04 10:13:21 -07:00
Jarek Kowalski
2512b7edeb refactored common bits of blob providers that use sharding (filesystem,webdav and upcoming sftp) into shared package 2019-07-01 18:32:38 -07:00
Jarek Kowalski
d569e6e12d added forgotten GA snippet 2019-06-23 12:18:17 -07:00
Jarek Kowalski
caad03b12c getting started guide v0.3.0-rc1 2019-06-22 21:59:37 -07:00
Jarek Kowalski
22170b4832 cli: changed 'cache set' subcommand to support changing individual parameters 2019-06-11 22:08:52 -07:00
Jarek Kowalski
c4fd5bb606 go.mod: updated dependencies v0.3.0-pre10 2019-06-09 08:42:46 -07:00
Jarek Kowalski
23d979f290 deleted jsonstream 2019-06-08 22:47:05 -07:00
Jarek Kowalski
c9da993e7b snapshot: removed depdendency on jsonstream from dir reader and writer 2019-06-08 22:47:05 -07:00
Jarek Kowalski
0d89ae3f79 Changed upload allow specifying N previous manifests
This avoids re-hashing of files previously partially uploaded
no matter where the upload was interrupted.
2019-06-08 18:01:47 -07:00
Jarek Kowalski
ae1510b65c Deprecate hashcache and replace it with simply walking previous snapshot directory tree.
This cleans up the code a lot and removes many ugly hacks.
The performance is pretty reasonable and with separate metadata cache it's likely to stay that way.
2019-06-08 18:01:47 -07:00
Jarek Kowalski
9b87c32570 improved cache info command to show all caches 2019-06-08 17:42:44 -07:00
Jarek Kowalski
bf311400f4 Added separate cache for metadata.
All blocks with a non-empty prefix land in that cache which has its own
size and expires independently from content cache.
2019-06-08 11:57:23 -07:00
Jarek Kowalski
533ae88460 travis: added stress test 2019-06-03 06:56:38 -07:00
Jarek Kowalski
72520029b0 golangci-lint: added more linters
Also fixed pre-existing lint errors.
2019-06-02 22:56:57 -07:00
Jarek Kowalski
54edb97b3a refactoring: renamed repo/block to repo/content
Also introduced strongly typed content.ID and manifest.ID (instead of string)

This aligns identifiers across all layers of repository:

blob.ID
content.ID
object.ID
manifest.ID
2019-06-01 22:24:19 -07:00
Jarek Kowalski
916da07e0f deprecate block format v0 2019-06-01 16:40:51 -07:00
Jarek Kowalski
9e5d0beccd refactoring: renamed storage.Storage to blob.Storage
This updates the terminology everywhere - blocks become blobs and
`storage.Storage` becomes `blob.Storage`.

Also introduced blob.ID which is a specialized string type, that's
different from CABS block ID.

Also renamed CLI subcommands from `kopia storage` to `kopia blob`.

While at it introduced `block.ErrBlockNotFound` and
`object.ErrObjectNotFound` that do not leak from lower layers.
2019-06-01 14:10:35 -07:00
Jarek Kowalski
1a7a02ddbe cleanup imports by grouping all local imports together 2019-06-01 10:57:55 -07:00
Jarek Kowalski
63303904e1 switched remaining fmt.Errorf to errors.Wrap() 2019-06-01 10:57:05 -07:00
Jarek Kowalski
82345c2b9f Added support for encryption with padding.
This allows authenticated encryption, custom IVs and checksums.
Implemented SALSA20-HMAC and XSALSA20-HMAC which append HMAC-SHA256
checksum to the ciphertext.
2019-06-01 10:12:03 -07:00
Jarek Kowalski
a6377540e2 travis: switched to latest 1.12 version 2019-06-01 10:06:09 -07:00
Jarek Kowalski
e111821b8d Makefile: added include for Makefile.local which can be used to create custom targets and overrides 2019-05-31 20:59:06 -07:00
Jarek Kowalski
698d2feb66 initialization improvements:
- create filesystem directory if it does not exists
- removed dangerous --overwrite option
- changed default splitter to a non-deprecated one
2019-05-31 20:12:46 -07:00
Jarek Kowalski
6678c01f46 object_splitter_test: added baseline test 2019-05-31 06:49:54 -07:00
Jarek Kowalski
543f34ea6b go.mod: added missing dependency v0.3.0-pre9 2019-05-30 23:42:15 -07:00
Jarek Kowalski
06418404f2 added logo in PNG format 2019-05-30 22:42:21 -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
2f0ff90c1a travis: install GCP service account after merge 2019-05-28 19:13:08 -07:00
Jarek Kowalski
09e12bec86 go.mod: update dependencies 2019-05-27 17:18:23 -07:00
Jarek Kowalski
d2b58c14a3 skip signing for pull requests 2019-05-27 16:26:28 -07:00
Jarek Kowalski
480c4de443 fixed deprecated 'nfpm' in .goreleaser.yml 2019-05-27 16:26:28 -07:00
Jarek Kowalski
3c54cb187a Update README.md 2019-05-27 16:24:20 -07:00
Jarek Kowalski
14b15be746 Merge pull request #26 from jkowalski/import-repo
Merged 'repo' repository back to this one. It's too tedious to maintain two separate repositories.
2019-05-27 16:00:23 -07:00
Jarek Kowalski
0c41d41276 Fixed up paths after merge 2019-05-27 15:48:39 -07:00
Jarek Kowalski
b6abef96e6 Merge github.com:kopia/repo into import-repo 2019-05-27 15:41:55 -07:00
Jarek Kowalski
a177394cde docs: added installation instructions using RPM and DEB 2019-05-15 22:05:22 -07:00
Jarek Kowalski
e8c32f414d travis: install keyring via /tmp v0.3.0-pre8 2019-05-15 21:39:39 -07:00
Jarek Kowalski
5fdc25b574 added docs for verifying downloaded packages 2019-05-15 21:00:30 -07:00
Jarek Kowalski
c286d5bd75 goreleaser: use detached ASCII signature 2019-05-15 21:00:30 -07:00