Commit Graph

3660 Commits

Author SHA1 Message Date
Jarek Kowalski
7f79c77d73 Makefile: refactored tools to be installable on Windows with only minimal deps (make/curl/unzip)
This allows full kopia and kopia-ui to be built on Windows along with
running lint and integration tests.
2020-02-17 18:45:08 -08:00
Jarek Kowalski
930927547c makefile: fixed support for PATH that includes directories with spaces
Verified with:

make website PATH="/tmp/With Space:$PATH"
2020-02-17 11:23:38 -08:00
Jarek Kowalski
29db31d008 blob: fixed GCS post-submit test 2020-02-17 08:58:32 -08:00
Jarek Kowalski
47ba37f9d0 blob: fixed GCS post-submit test 2020-02-17 08:45:33 -08:00
Jarek Kowalski
022d223e1d blob: fixed GCS post-submit test 2020-02-17 08:31:39 -08:00
Prasad Ghangal
a3a55f4fa3 Add retries when creating S3 Storage obj in test
It is observed that travis CI fails sometimes due
to access key validation issue in TestS3StorageWithSessionToken.
Assuming this issue is due to eventual consistency,
we have added retries while creating S3 Storage obj

Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2020-02-17 08:16:24 -08:00
Jarek Kowalski
03dad366e1 htmlui: added first version of UI policy editor 2020-02-16 23:04:17 -08:00
Jarek Kowalski
c42b5cd89f server: API server for CRUD on individual Policies 2020-02-16 23:04:17 -08:00
Jarek Kowalski
9a96a8a770 snapshot: fixed casing of 'errorHandling' in JSON 2020-02-16 23:04:17 -08:00
Jarek Kowalski
515748a6ca htmlui: prevent flicker when refreshing snapshot sources 2020-02-16 22:43:36 -08:00
Jarek Kowalski
cc5597ed6d server: set default policy after repo creation 2020-02-16 22:43:36 -08:00
Jarek Kowalski
a7a3cd3282 htmlui: new UI flow for connecting to and creating repository 2020-02-16 22:43:36 -08:00
Jarek Kowalski
a21da7b960 cli: fixed double-close of repository during 'server start' 2020-02-16 22:43:36 -08:00
Jarek Kowalski
4cb898927c server: new APIs and error codes to support UI flow for connecting to repository 2020-02-16 22:43:36 -08:00
Jarek Kowalski
cf4f79a4d1 repo: introduced well-known error codes for connecting to repository
also disconnect from repository after connection is unsuccessful,
to prevent stale config files
2020-02-16 22:43:36 -08:00
Jarek Kowalski
0163a2da97 blob: check that GCS/S3 bucket is present when the storage is opened 2020-02-16 22:43:36 -08:00
Julio López
a9670762fd Generate shorter file names, and thus paths, in E2E tests (#229)
- Reduces name lengths by ~ 1/2
- Generate file names up to maxNameLength

Co-Authored-By: Nick <nick@kasten.io>
2020-02-14 22:25:50 -08:00
Nick
3a5d3179e7 Add WalkCrossDevice option to walk policy
Add the walk policy flag WalkCrossDevice to the fswalker Walk calls. This will avoid potential issues when running in a docker container where a FS tree is made of many overlays. Without the flag set, the Walk operation skips over files on devices that do not match the device at the base path.
2020-02-14 21:18:41 -08:00
Jarek Kowalski
8bdd5caf7e server: added retry loop when launching server 2020-02-13 17:23:50 -08:00
Jarek Kowalski
4c35ed82b9 linter fixes 2020-02-13 17:23:50 -08:00
Jarek Kowalski
0f79279f5e server: added support for new verbs in the API
/api/v1/repo/create
/api/v1/repo/connect
/api/v1/repo/disconnect

Refactored server code and fixed a number of outstanding robustness
issues. Tweaked the API responses a bit to make more sense when consumed
by the UI.
2020-02-13 17:23:50 -08:00
Jarek Kowalski
69d1ccbedf upload: Added CountingUploadProgress and new methods to UploadProgress 2020-02-13 17:23:50 -08:00
Nick
3cb7e37fc1 Add comparer interface and fswalker implementation (#226)
Add comparer interface which gathers data on a path and
compares that data to a new path, returning error if the path
differs in any way from the input data. The details of what
constitutes a difference is left to the implementation.

FSWalker implementation uses Walk and Report to do the data
gathering and comparison. Filters are applied to sort out any
differences that might be expected (e.g. ctime, atime, mtime,
rename of root directory after restore).
2020-02-13 17:07:18 -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
Prasad Ghangal
1c3858a906 Add AWS Session Token support to Kopia
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2020-02-12 08:19:24 -08:00
Jarek Kowalski
a8503a007c server: allow starting server on randomly-allocated port by specifing port 0 (#224)
allow starting server on randomly-allocated port by specifing port 0
2020-02-11 17:08:50 -08:00
Jarek Kowalski
862fc69bff cli: marked --ignore-{file,dir}-errors as enums, so that CLI parser enforces correct values 2020-02-11 06:41:20 -08:00
Nick
162db3e861 [minor] Fix error handling policy print (#221)
Fixes print for error handling policy. Previously was printing
pointer address, now dereference pointer to print boolean itself.
Nil check in case the caller passes a policy with nil. In that
case print "false" which is the behavior in uploader for nil
pointer.
2020-02-10 20:22:55 -08:00
Jarek Kowalski
f8720eda62 travis: re-enabled integration tests on Windows after disabling GPG 2020-02-10 19:13:43 -08:00
Jarek Kowalski
4736e9037e revamped progress output and cleaned up logging
See https://asciinema.org/a/ykx6uzEhKY3451fWEnX9nm9uo
2020-02-10 19:08:35 -08:00
Jarek Kowalski
8d9a042a44 travis: don't run GPG on Windows 2020-02-10 18:57:58 -08:00
Jarek Kowalski
24c425ab2f travis: disable integration tests on windows to see if that fixes builds hanging 2020-02-10 18:42:17 -08:00
Jarek Kowalski
0d9f1dc043 temporary: print task list after running tests on windows, some left-over process may be causing travis builds to fail 2020-02-10 17:52:08 -08:00
Nick
1a24c34df8 Ignore read errors based on policy settings (#207)
* Ignore read errors based on policy settings

Added an error handling policy section. Can independently control error handling for directory and file read errors, toggle-able from the `policy set` command to either "true", "false", or "inherit". If any read error is hit, the error handling will check the effective policy on whether to ignore it or not. Currently there is no differentiation between read error types, though in the future we may want to add the `errors.Is(err, os.ErrPermission)` conditional.

Fix was implemented such that the policy ignores read errors ONLY on child entries of the source. So a snapshot will still fail if the source root directory itself can't be read, but you can ignore the error if a file or a subdirectory in the snapshot source root can't be read. I did this to address some otherwise strange behavior where you would successfully snapshot (because you ignored the error), but couldn't restore that snapshot because nothing really happened during the operation.
2020-02-10 17:35:53 -08:00
Jarek Kowalski
90bd51df14 disable failing sftp test on Windows, to be investigated 2020-02-09 22:54:25 -08:00
Jarek Kowalski
75929f65e9 travis: add integration tests and install-noui on Windows 2020-02-09 22:46:19 -08:00
Jarek Kowalski
edca1733b6 repo: moved password persistence to repository layer 2020-02-09 20:55:07 -08:00
Jarek Kowalski
29e5750686 travis: added bare-bones Windows build that does go test
fixed some issues that prevented go test from passing on Windows:

- webdav client used \ instead of /
- need retries around mmap.Open()
- paths are prefixed with C:\ on windows
- time.Now() does not always move forward on Windows
2020-02-09 20:22:14 -08:00
Jarek Kowalski
729c1e0314 lint: upgrade to 1.23.3 2020-02-09 19:46:27 -08:00
Nick Wright
67e8b6d262 Add lint and test to osx travis-releaser target
Add lint and test to the travis-releaser target for osx.
2020-02-09 18:42:38 -08:00
Nick Wright
6b96f6c019 Place fswalker packages behind build flag
Temporary workaround for compile issues on MacOS and Windows due
to upstream fswalker bug. Only build the reporter and walker
packages as GOOS=linux for now.
2020-02-09 18:42:38 -08:00
Julio Lopez
c247258f41 Simply count medium-sized index blobs
The slice of medium-sized blobs is used to obtain the count of such
blobs from the length of the slice, but it is not used otherwise.
2020-02-08 08:51:37 -08:00
Niraj Tolia
2dc8982485 Website tweaks
- Make sure Slack is front-and-center for users too (community page)
- Tweak homepage
2020-02-07 18:38:38 -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
Julio Lopez
4625e5ba9e Remove content.CompactOptions.MinSmallBlobs
Use MaxSmallBlobs instead. MaxSmallBlobs was not being really used.
Replaced uses of MinSmallBlobs with MaxSmallBlobs and removed
MinSmallBlobs
2020-02-06 21:51:51 -08:00
Niraj Tolia
f509c46a3d Website text edits for clarity 2020-02-06 21:43:06 -08:00
Niraj Tolia
ac19fe5ec3 Use Kopia favicons instead of docsy ones (#204)
Use Kopia favicons instead of docsy ones
Generated based on docs from https://www.docsy.dev/docs/adding-content/iconsimages/
2020-02-06 21:42:12 -08:00
Niraj Tolia
171dfd9f4b nit 2020-02-06 16:50:57 -08:00
Niraj Tolia
d9724b5a62 Make subtext bold for visibility 2020-02-06 16:50:57 -08:00
Niraj Tolia
37af12e61c Darken image a bit 2020-02-06 16:50:57 -08:00