Commit Graph

1299 Commits

Author SHA1 Message Date
Julio López
0875939d56 dep: upgrade protobuf dependents (#442)
Upgrade cloud.google.com/go/storage to v1.8.0 from version 1.6.0

Change logs:
- https://github.com/googleapis/google-cloud-go/releases/tag/storage%2Fv1.8.0
- https://github.com/googleapis/google-cloud-go/releases/tag/storage%2Fv1.7.0

Protobuf from 1.3.5 to 1.4.2
- https://github.com/golang/protobuf/releases
- https://github.com/golang/protobuf/releases/tag/v1.4.2

Use google.golang.org/protobuf version 1.23.0
Instead of github.com/golang/protobuf/proto which has been superseded
- https://github.com/protocolbuffers/protobuf-go/releases

cloud.google.com/go from 0.54.0 to 0.57.0
- https://github.com/googleapis/google-cloud-go/releases/tag/v0.57.0
- https://github.com/googleapis/google-cloud-go/releases/tag/v0.56.0
- https://github.com/googleapis/google-cloud-go/releases/tag/v0.55.0

google.golang.org/api from 0.20 to 0.25.0
- https://github.com/googleapis/google-api-go-client/releases

github.com/prometheus/client_golang to 1.6.0
- https://github.com/prometheus/client_golang/releases

Required changes:
- Fix import paths for protobuf imports
- Add linter exception
- Use prototext package to marshal to text
2020-05-21 13:22:59 -07:00
Julio López
23c12125d8 Build test/tools in Darwin as well (#447)
Upgrade github.com/google/fswalker to get fixes for Darwin/macOS

#212 
google/fswalker#25
2020-05-21 12:02:27 -07:00
Julio Lopez
0c2ad9973f Upgrade github.com/minio/minio-go/v6
Change log:
https://github.com/minio/minio-go/releases

Upgrade github.com/minio/minio

Change log:
https://github.com/minio/minio/releases

Also: `go mod tidy`
2020-05-20 22:36:35 -07:00
Julio López
53b82c9366 dep: upgrade various dependencies (#445)
* Upgrade various golang.org/x/* modules

golang.org/x/mod to 0.3.0 from 0.2.0
https://github.com/golang/mod/releases/tag/v0.3.0

* Upgrade gopkg.in/ini.v1 to 1.56.0

Change log:
https://github.com/go-ini/ini/releases

* Upgrade github.com/pkg/profile to 1.5.0

Change log:
https://github.com/pkg/profile/releases

* Upgrade github.com/mattn/go-ieproxy

Change log:
https://github.com/mattn/go-ieproxy/releases
2020-05-20 18:06:04 -07:00
Julio Lopez
0a6a0d4ffb Upgrade AWS SDK to 1.31.1
From version 1.28.13 to 1.31.1

Change log:

https://github.com/aws/aws-sdk-go/releases

Also upgrade github.com/stretchr/testify to 1.5.1 from 1.4.0

https://github.com/stretchr/testify/releases
2020-05-20 08:24:10 -07:00
Julio López
ea681e40c2 deps: Upgrade compress package to 1.10.5 (#443)
* Upgrade compress package to 1.10.5

Change log
https://github.com/klauspost/compress/releases

* Upgrade github.com/klauspost/pgzip to 1.2.4

Change log:
https://github.com/klauspost/pgzip/releases
2020-05-19 05:29:52 -07:00
Julio López
e493177236 Remove legacy flags from snapshot create command (#441)
Remove `--hostname` and `--username` flags
2020-05-18 22:48:18 -07:00
Jarek Kowalski
8c4fb53c96 blob: support for GetMetadata() to get server-side timestamp and blob length (#440) 2020-05-18 11:06:34 -07:00
Jarek Kowalski
ca28469706 cli: improved 'snapshot delete' usage (#436)
New usage:

```
kopia snapshot delete manifestID... [--delete]
kopia snapshot delete rootObjectID... [--delete]
```

Fixes #435

cli: added --unsafe-ignore-source as alias for `--delete`
This is a hidden flag for backwards compatibility. It will be removed.
2020-05-13 23:43:45 -07:00
Samuel BENARD
7e5fc52ce8 removal of unnecessary extra )} 2020-05-12 17:12:11 -07:00
Samuel BENARD
f3359d78f6 add sftp and webdav as repositories to "Getting started" documentation page, "Setting Up Repository" chapter 2020-05-12 17:12:11 -07:00
Jarek Kowalski
993c3bfb3e linter: fixed how linter is installed on Darwin and Linux since it was getting wrong version 2020-05-11 23:58:41 -07:00
Jarek Kowalski
d657415817 testing: added blob.Storage wrapper that simulates eventual consistency (#434)
This is done by introducing N unsynchronized caches, which simulate
what frontend of a cloud storage system might do, that causes eventual
consistency behavior.
2020-05-09 12:19:32 -07:00
Jarek Kowalski
200ef57cf7 app: portability fixes (#431)
- create default config in portable mode
- override userData to make sure cached data is written outside of
%APPDATA%
2020-05-03 12:20:29 -07:00
Jarek Kowalski
be4b897579 Support for remote repository (#427)
Support for remote content repository where all contents and
manifests are fetched over HTTP(S) instead of locally
manipulating blob storage

* server: implement content and manifest access APIs
* apiclient: moved Kopia API client to separate package
* content: exposed content.ValidatePrefix()
* manifest: added JSON serialization attributes to EntryMetadata
* repo: changed repo.Open() to return Repository instead of *DirectRepository
* repo: added apiServerRepository
* cli: added 'kopia repository connect server'
  This sets up repository connection via the API server instead of
  directly-manipulated storage.
* server: add support for specifying a list of usernames/password via --htpasswd-file
* tests: added API server repository E2E test
* server: only return manifests (policies and snapshots) belonging to authenticated user
2020-05-02 21:41:49 -07:00
Jarek Kowalski
1377d057e4 Maintenance changes (#423)
* maintenance: encrypt maintenance schedule block

* maintenance: created snapshotmaintenance package that wraps maintenance and performs snapshot GC + regular maintenance in one shot, used in CLI and server

* PR feedback.
2020-05-02 20:40:16 -07:00
Jarek Kowalski
4f6dd94766 Maintenance: report and record record maintenance run timings (#422)
* mechanical rename of package snapshot/gc => snapshot/snapshotgc

* maintenance: record maintenance run times and statuses

Also stopped dropping deleted contents during quick maintenance, since
doing this safely requires coordinating with snapshot GC which is
part of full maintenance.

* cli: 'maintenance info' outputs maintenance run history

* maintenance: only drop index entries when it's safe to do so

This is based on the timestamp of previous successful GC that's old
enough to resolve all race conditions between snapshot creation and GC.

* maintenance: added internal flush to RewriteContents() to better measure its time
2020-04-20 08:30:03 -07:00
Jarek Kowalski
a462798b28 content: added blob-level metadata cache (#421)
Unlike regular cache, which caches segments of blobs on a per-content
basis, metadata cache will fetch and store the entire metadata blob (q)
when any of the contents in it is accessed.

Given that there are relatively few metadata blobs compared to data (p)
blobs, this will reduce the traffic to the underlying store and improve
performance of Snapshot GC which only relies on metadata contents.
2020-04-20 02:18:43 -07:00
Julio López
d707f3615a GC content repair (#420)
Add content.Manager.UndeleteContent()
Implementation based on RewriteContent()

Undelete re-referenced content in snapshot GC
2020-04-17 21:47:50 -07:00
Jarek Kowalski
2b8e882b22 filesystem: added retry which addresses the macOS race condition
Ran TestFileStorageConcurrency 1000 times and it passed on macOS.
2020-04-16 23:09:42 -07:00
Jarek Kowalski
4b4628a21e Repository maintenance support (#411)
Maintenance: support for automatic GC

Moved maintenance algorithms from 'cli' to 'repo/maintenance' package

Added support for CLI commands:

kopia gc - performs quick maintenance
kopia gc --full- perform full maintenance

Full maintenance performs snapshot gc, but it's not safe to do this automatically possibly in parallel to snapshots being taken. This will be addressed ~0.7 timeframe.
2020-04-14 00:11:41 -07:00
Jarek Kowalski
573d10422a object: ensure that all I objects have a content prefix
When prefix is not specified on ObjectWriter, we force
'x' content prefix on intermediate contents, so object IDs
will look like:

Ix{hash}

This ensures the index contents will be stored in `q` blobs,
making `snapshot gc` easier.
2020-04-12 23:55:09 -07:00
Jarek Kowalski
b671bda152 cli: add missing options for configuring sftp known_hosts
Possibly the cause of #414
2020-04-12 14:59:24 -07:00
Jarek Kowalski
14fb49a82b content: asynchronous cache sweep
With large cache sizes it takes several seconds to perform the initial
sweep. This change only checks that the cache is functional without
full sweep.

Also cleaned up contentCache by introducing interface and having
two implementation - one which does caching, and one that does not.
2020-04-12 14:57:58 -07:00
Julio Lopez
e50b5ec2cd Trivial: Add package alias to silence IDE/gopls warning 2020-04-10 17:22:49 -07:00
Jarek Kowalski
1f1682b2cc Snapshot checkpointing (#410)
* snapshot: support for periodic checkpointing of snapshots in progress

For each snapshot that takes longer than 45 minutes, we trigger
internal cancellation, save the manifest and restart the snapshot
at which point all files will be cached.

This helps ensure the property that no file or directory objects
in the repository remain unreachable from a snapshot root for more than
one hour, which is important from GC perspective.

* nit: unified spelling 'cancelled' => 'canceled'
2020-04-07 17:54:21 -07:00
Jarek Kowalski
70d4c8764a cli: improvements to content selection for list/rewrite/stats/verify (#409)
They now uniformly support 3 flags:

--prefix=P       selects contents with the specified prefix
--prefixed       selects contents with ANY prefix
--non-prefixed   selects non-prefixed contents

Also changed content manager iteration API to support ranges.

cli: add --prefix to 'blob gc' and 'blob stats'
2020-04-06 18:43:41 -07:00
Jarek Kowalski
057c2789d8 Kopia UI: support for multiple repositories + portability (#398)
* server: when serving HTML UI, prefix the title with string from KOPIA_UI_TITLE_PREFIX envar

* kopia-ui: support for multiple repositories + portability

This is a major rewrite of the app/ codebase which changes
how configuration for repositories is maintained and how it flows
through the component hierarchy.

Portable mode is enabled by creating 'repositories' subdirectory before
launching the app.

on macOS:
  <parent>/KopiaUI.app
  <parent>/repositories/

On Windows, option #1 - nested directory
  <parent>\KopiaUI.exe
  <parent>\repositories\

On Windows, option #2 - parallel directory
  <parent>\some-dir\KopiaUI.exe
  <parent>\repositories\

In portable mode, repositories will have 'cache' and 'logs' nested
in it.
2020-04-04 17:18:37 -07:00
Jarek Kowalski
45195fabce appveyor: moved WINDOWS_CERT_SHA1 to secure variable so that we don't sign PRs 2020-04-04 12:01:46 -07:00
Jarek Kowalski
c89b1a7c87 appveyor: added GH_TOKEN variable, disabled RDP 2020-04-03 23:56:40 -07:00
Jarek Kowalski
01f52f8c05 appveyor: fixed secure variable 2020-04-03 23:45:53 -07:00
Jarek Kowalski
24f6720c61 enable RDP on appveyor worker until it's stable 2020-04-03 23:42:12 -07:00
Jarek Kowalski
0017f59add Makefile: fix travis-setup on Windows 2020-04-03 23:11:29 -07:00
Jarek Kowalski
2055fe3cca Makefile: support Windows Appveyor environment (#407)
* Makefile: support Windows Appveyor environment

* appveyor: added .appveyor.yml

* travis: disable windows environment

* Makefile: do not run vet-time-inject on Windows

* Makefile: removed the use of backtick invocation of subshell which does not work on windows

* Makefile: make integration-tests work on Windows outside of Travis
2020-04-03 23:03:42 -07:00
Jarek Kowalski
16275a15b7 Makefile: changed how build number is calculated
Instead of taking timestamp + TRAVIS_BUILD_NUMBER at build time,
we take the time of the commit, to be deterministic. This requires
a little bit of makefile magic to strip leading zeroes to make the
version number that's semver compliant.

This will allow coordinating the build between different CI tools,
so that Windows can be built on AppVeyor and macOS/Linux on Travis CI.
2020-04-02 22:05:37 -07:00
Jarek Kowalski
37b69d8e23 site: tweaked layout and options for cookie consent popup 2020-04-02 08:17:35 -07:00
Jarek Kowalski
e0984641ba improved logging for sign.js 2020-03-31 21:21:32 -07:00
Jarek Kowalski
6ad927384b travis: setup tools to support signing Windows binaries 2020-03-31 19:41:55 -07:00
Jarek Kowalski
05ea35fcff testing: retry around B2 test 2020-03-31 08:06:43 -07:00
Andreas Schneider
567bd33e8a added b2 to repository creation ui 2020-03-28 09:07:44 -07:00
Andreas Schneider
4bed45114d implemented b2 backend 2020-03-28 09:07:44 -07:00
Julio López
3924fb247a Minor cleanup for snapshot time override (#392)
* Simplify cli.parseTimestamp
* nit: move duration var closer to where it is used
2020-03-27 00:19:16 -07:00
Jarek Kowalski
6cb9b8fa4f repo: refactored public API (#318)
* This is 99% mechanical:

Extracted repo.Repository interface that only exposes high-level object and manifest management methods, but not blob nor content management.

Renamed old *repo.Repository to *repo.DirectRepository

Reviewed codebase to only depend on repo.Repository as much as possible, but added way for low-level CLI commands to use DirectRepository.

* PR fixes
2020-03-26 08:04:01 -07:00
Jarek Kowalski
10bb492926 repo: deprecated NONE algorithm, will not be available for new repositories (#395)
* repo: deprecated NONE algorithm, will not be available for new repositories

Co-authored-by: Julio López <julio+gh@kasten.io>
2020-03-24 23:19:20 -07:00
Jarek Kowalski
60977812f0 Support for gather writes (#373)
, where blob.Storage.PutBlob gets a list of slices and writes them sequentially 
* performance: added gather.Bytes and gather.WriteBuffer

They are similar to bytes.Buffer but instead of managing a single
byte slice, they maintain a list of slices that and when they run out of
space they allocate new fixed-size slice from a free list.

This helps keep memory allocations completely under control regardless
of the size of data written.

* switch from byte slices and bytes.Buffer to gather.Bytes.

This is mostly mechanical, the only cases where it's not involve blob
storage providers, where we leverage the fact that we don't need to
ever concatenate the slices into one and instead we can do gather
writes.

* PR feedback
2020-03-24 15:05:52 -07:00
Jarek Kowalski
b08d394864 policy: deduplicate multiple policies for the same source in policy manager, fixes #391 2020-03-23 23:52:23 -07:00
Nick
393d273e5a Policy set: fix nil pointer dereference #385 (#387)
* Policy set: fix nil pointer dereference #385
2020-03-23 18:32:36 -07:00
Jarek Kowalski
ea510f30fa repo: fixed race condition during Open() where we may read incomplete file 2020-03-23 18:14:33 -07:00
Jarek Kowalski
f2e6d51530 repo: persist relative path to cache if possible, this allows config directory to be partially portable 2020-03-22 15:36:43 -07:00
Jarek Kowalski
9b68a631e6 Highlight snapshot errors in the UI and CLI (#376)
* upload: exposed numFailed and failedEntries on directory summary

* cli: better present snapshot errors

* htmlui: display snapshot errors
2020-03-22 14:18:47 -07:00