Commit Graph

1422 Commits

Author SHA1 Message Date
Jarek Kowalski
d0d6ac4767 SFTP connectivity and docs improvements (#623)
* sftp: support for external SSH command and host verfication improvements

- removed custom parsing of hostnames and verification and replaced with
  standard 'knownhosts' implementation.

- added option to launch external SSH command which supports
  aliases, agent, etc.

NOTE, we're still not supporting any cases where password needs to be
entered on the command line, since that would be incompatible with
the UI which uses client-server model.

Fixes #500
Fixes #414

* site: updated SFTP repository connection instructions

Fixes #590
v0.7.0
2020-09-20 11:10:13 -07:00
Jarek Kowalski
0595213d79 upload: fixed armhf alignment issue (#632)
Fixes: #631
2020-09-20 10:19:03 -07:00
Jarek Kowalski
04fcddeff0 webdav: prevent webdav client race condition (#626)
The race is described in
https://github.com/studio-b12/gowebdav/issues/36

We need this workaround until the fix is merged upstream,
to avoid maintaining a webdav client fork.

Fixes #624
2020-09-19 11:47:57 -07:00
Jarek Kowalski
538c644586 cli: don't ask for password if repository is not connected (#627) 2020-09-19 11:45:03 -07:00
Jarek Kowalski
fce9497375 restore: support for symlinks (experimental) (#621) v0.7.0-rc2 2020-09-18 10:29:20 -07:00
Jarek Kowalski
98a2bc6f6d testing: increase sleep time to fix flaky arm64 test 2020-09-18 08:25:17 -07:00
Nick
7f61dc6637 [Robustness] Add command line parameters for kopia snapshotter (#576)
* [Robustness] Add command line parameters for kopia snapshotter

Add flags for:
- no-progress
- parallel
- cache sizes
- no update check

Add an integration test to validate snapshotter expected output
against a kopia executable.
2020-09-18 01:15:19 -07:00
Jarek Kowalski
9551d2495d upload: scan the directory to be uploaded in parallel to estimate the amount of data to be uploaded (#622)
This allows better progress indicator in the CLI and UI.
The percentage completed is not displayed until estimate is available.

Quick demo: https://asciinema.org/a/O7ktcWSgaGUPfJwhzc65mMWM1
2020-09-17 23:59:18 -07:00
Jarek Kowalski
7cdb75ab79 fuse: changed file read implementation to avoid OOM (#620)
Changed file read implementation from ReadAll() to a Handle to avoid OOMing

We don't have automated tests for this but I verified this by restoring
13GB file over fuse and memory usage never exceeded 400MB.
2020-09-16 23:04:22 -07:00
Jarek Kowalski
f2cf71d914 logging: revamped logs from content manager to be machine parseable (#617)
* logging: revamped logs from content manager to be machine parseable

Logs from the content manager (except reads) are sent to separate log
file that is always free from personally-identifiable information
(e.g. no file names, just content IDs and blob IDs).

Also moved CLI logs to a subdirectory (cli-logs) and put content logs
in a parallel directory (content-logs)

Also, the log file name will now include the type of the command that
was invoked:

   kopia-20200913-134157-16110-snapshot-create.log

Fixes #588

* tests: moved all logs from tests to a separate directory
2020-09-16 20:04:26 -07:00
Jarek Kowalski
c7be3a0c87 testing: added performance benchmark (#618)
The benchmarks creates 20 GB of files in different configurations

* 10 x 2 GB files
* 100 x 200 MB files
* 1000 x 20 MB files

and backs them up to a local filesystem repository measuring time,
CPU and RAM usage.

The benchmarking script uses GCP instance (n1-standard-8) with fast NVME
flash to eliminate local filesystem latency.

Current performance numbers show major improvement in latency in
0.7.0-rc1 due to splitter throughput optimization (#606).
2020-09-15 21:30:08 -07:00
Jarek Kowalski
b71e551fd5 app: changed releaseType to release to fix publishing artifacts to GitHub, 2nd try v0.7.0-rc1 2020-09-13 18:47:05 -07:00
Jarek Kowalski
a5f275b2f5 app: changed releaseType to release to fix publishing artifacts to GitHub 2020-09-13 18:26:45 -07:00
Jarek Kowalski
8febe90e61 goreleaser: switch draft mode to off as it interferers with scoop publishing 2020-09-13 17:32:12 -07:00
Jarek Kowalski
44968af7b6 release: fixed RPM signing by moving all of this to a single invocation of sign.sh 2020-09-13 17:07:49 -07:00
Julio López
67ed3a9f96 Remove maintenance lock file on disconnect (#616)
* Remove maintenance lock file on disconnect

* Remove workaround for maintenance lock file in repotesting
2020-09-13 11:18:29 -07:00
Jarek Kowalski
9faf6b33d0 cli: fixed snapshot delete to support deleting file (not directory) snapshots by object ID (#613) 2020-09-12 22:36:47 -07:00
Jarek Kowalski
f0b97b960b Fixed checkpointing to not restart the entire upload process (#594)
* object: added Checkpoint() method to object writer

* upload: refactored code structure to allow better checkpointing

* upload: removed Checkpoint() method from UploadProgress

* Update fs/entry.go

Co-authored-by: Julio López <julio+gh@kasten.io>
2020-09-12 22:36:22 -07:00
Jarek Kowalski
6a14ac8a2a cli: ensure advanced commands are not accidentally used (#611)
* cli: ensure advanced commands are not accidentally used

This prints an error when a dangerous command is used without
first setting KOPIA_ADVANCED_COMMANDS=enabled environment variable.

Co-authored-by: Julio López <julio+gh@kasten.io>
2020-09-12 20:31:25 -07:00
Jarek Kowalski
5784d68766 site: edited installation page and switched Download link to point at it (#603)
* site: edited installation page and switched Download link to point at it.

Emphasized the use of package managers to download and keep Kopia up-to-date.
Added instructions for using Scoop on Windows.

Co-authored-by: Julio López
2020-09-12 19:30:49 -07:00
Julio López
64b6018140 Test for directory reuse after GC (#601)
content:Allow returning deleted content in GetContent
maintenance: check deleted contents as well
maintenance: test for when a directory content is reused after deletion

testing: add support for repo open options in repotesting
* Allow passing repo options to MustReopen
* Add repotesting.Environment.MustConnectOpenAnother
* Remove kopia.config.mlock file
* snapshot create helper
* Fix content delete related and e2e tests
2020-09-12 19:28:52 -07:00
Jarek Kowalski
e22d22dba2 object: implemented fast concatenation of objects by merging their index entries (#607) 2020-09-11 20:12:01 -07:00
Jarek Kowalski
faf280616a Splitter throughput improvements (#606)
* object: refactored writer to detect split points before writing

This introduces new primitive that will be moved into splitters
themselves in subsequent commits. I'm doing this in small steps to
ensure we don't regress at any time.

* splitter: refactored TestSplitters test

This is use slow (byte-by-byte) and fast (nextSplitPoint) methods of
determining split points.

Note nextSplitPoint is not implemented by splitters yet, but this
verifies that the test is expecting the right thing.

* object: splitter refactoring - replaced ShouldSplit() with NextSplitPoint() everywhere, still not optimized

* splitter: added additional dimension to splitter_test

We split either in large chunks or one byte at a time to catch
the corner cases in the splitter implementation.

* splitter: optimized splitters using NextSplitPoint primitive

This improves splitter performance by about 40% (buzhash) and makes
it virtually free for FIXED splitter.
2020-09-11 19:45:48 -07:00
Julio López
aebf8616a2 object: loadSeekTable helper (#608) 2020-09-11 19:12:13 -07:00
Jarek Kowalski
57888a81eb travis: disable publishing RPM on pull requests since it needs credentials 2020-09-11 09:21:14 -07:00
Jarek Kowalski
e4077674c9 build: publishing of scoop Windows packages via goreleaser
This is not really testable outside of building a tag.
2020-09-10 22:22:36 -07:00
Jarek Kowalski
f3fc2ea3b7 tools: misc fixes to RPM publishing 2020-09-10 22:11:33 -07:00
Jarek Kowalski
5494746e67 tools: clean up repomd directory before updating 2020-09-10 18:59:52 -07:00
Jarek Kowalski
17764567ab travis: update RPM and APT repos on linux/amd64 even for non-tagged commits 2020-09-10 17:30:17 -07:00
Julio López
acc98d89b7 Trivial test nits (#602)
* Ensure other repo is closed

* Prefer testlogging.Context in tests

* Prefer T.TempDir() in repotesting.Environment.Setup()
2020-09-10 17:26:03 -07:00
Julio López
70df5f738c testing: Refactor faketime (#597)
* Allow auto-advance in faketime.TimeAdvance
* Leverage TimeAdvance in faketime.AutoAdvance
* Concurrent test for faketime.AdvanceTime
2020-09-10 00:52:14 -07:00
Jarek Kowalski
f8d0abb020 Makefile: fixed publishing logic 2020-09-09 23:38:10 -07:00
Jarek Kowalski
4ef314bee5 Added RPM repository (#600)
* goreleaser: added signatures to RPM binaries

Currently goreleaser does not support it, so we're overriding
signing script and signing all RPMs that it produces.

Also changed goreleaser parameters to only publish binaries
when running on linux/amd64.

* build: added automatic publishing of RPMs to a YUM repository

Also fixed RPM file names to match local conventions.
2020-09-09 23:18:20 -07:00
Julio López
9d0b8081e9 Go 1.15 (#598)
* Use Go 1.15 in Travis
* Require Go 1.15 for building
2020-09-09 22:36:27 -07:00
Jarek Kowalski
913b3bbdd3 object: fixed splitter reset on reuse (#596)
This did not properly reset the splitter state for buzhash32 and
rabinkarp64, so object writer did not achieve perfect deduplication.

Fixes #595
2020-09-09 19:33:19 -07:00
Jarek Kowalski
640eb5ddf0 Update BUILD.md 2020-09-08 23:08:30 -07:00
Jarek Kowalski
3b87902433 Kopia UI improvements for repository management (#592)
* cli: added --tls-print-server-cert flag

This prints complete server certificate that is base64 and PEM-encoded.

It is needed for Electron to securely connect to the server outside of
the browser, since there's no way to trust certificate by fingerprint.

* server: added repo/exists API

* server: added ClientOptions to create and connect API

* server: exposed current-user API

* server: API to change description of a repository

* htmlui: refactored connect/create flow

This cleaned up the code a lot and made UX more obvious.

* kopia-ui: simplified repository management UX

Removed repository configuration window which was confusing due to
the notion of 'server'.

Now KopiaUI will automatically launch 'kopia server --ui' for each
config found in the kopia config directory and shut it down every
time repository is disconnected.

See https://youtu.be/P4Ll_LR4UVM for a quick demo.

Fixes #583
2020-09-07 08:00:19 -07:00
Jarek Kowalski
29ce1819cb Added support for setting and changing repository client options (description, read-only, hostname, username) (#589)
* repo: refactored client-specific options (hostname,username,description,readonly) into new struct that is JSON-compatible with current config

* cli: added 'repository set-client' to configure parameters of connected repository

* cli: cleaned up 'repository status' output
2020-09-04 13:57:15 -07:00
Jarek Kowalski
a5838ff34c Improvements to UX for mounting directories (both CLI and KopiaUI) (#573)
* cli: simplified mount command

See https://youtu.be/1Nt_HIl-NWQ

It will always use WebDAV on Windows and FUSE on Unix. Removed
confusing options.

New usage:

$ kopia mount [--browse]
    Mounts all snapshots in a temporary filesystem directory
    (both Unix and Windows).

$ kopia mount <object> [--browse]
    Mounts given object in a temporary filesystem directory
    (both Unix and Windows).

$ kopia mount <object> z: [--browse]
    Mounts given object as a given drive letter in Windows (using
    temporary WebDAV mount).

$ kopia mount <object> * [--browse]
    Mounts given object as a random drive letter in Windows.

$ kopia mount <object> /mount/path [--browse]
    Mounts given object in given path in Unix.

<object> can be the ID of a directory 'k<hash>' or 'all'

Optional --browse automatically opens OS-native file browser.

* htmlui: added UI for mounting directories

See https://youtu.be/T-9SshVa1d8 for a quick demo.

Also replaced some UI text with icons.

* lint: windows-specific fix
2020-09-03 17:46:48 -07:00
Jarek Kowalski
90a9cf1143 cli: plumbed through missing --server-cert-fingerprint option (#580)
Fixes: #577
2020-09-01 19:57:14 -07:00
Jarek Kowalski
a3be1e5cfe upload: fixed ForceHashPercentage behavior to be non-deterministic (#579)
Fixes #578
2020-09-01 17:36:24 -07:00
Jarek Kowalski
5e2994b4a9 content: fixed index compaction that would resurrect content entry during full maintenance (#563)
The problem was that while dropping deleted entries from the index
we were looking at index-local and nor merged result.

Say index1 has content1 created at t0.
Say index2 has content1 deleted at t1 > t0.

And we're compacting and dropping index entries deleted before t2,
such that t2 > t1.

Because create and delete records are in separate index files, the
compacted file would preserve "created t0" which is wrong.

This fix changes index compaction to always look at resolved content
status.

Co-authored-by: Julio López <julio+gh@kasten.io>
2020-09-01 01:29:18 -07:00
Jarek Kowalski
ded1ecf936 implemented Cache Directory Tagging Specification + CLI + UI (#565)
Fixes #564

cli: added 'kopia policy set --ignore-cache-dirs' option to control
whether to ignore caches (global default=true)

ui: added checkbox to control 'Ignore Cache Dirs' in policy editor

ignorefs: moved ignoring cache directories to ignorefs layer

Co-authored-by: Julio López <julio+gh@kasten.io>
2020-08-31 21:35:26 -07:00
Jarek Kowalski
c242235a32 blob: added SetTime() method which may be optionally implemented by blob.Storage (#575)
cli: added --times option to 'repository sync'
2020-08-31 19:50:15 -07:00
Jarek Kowalski
3d24fd8875 apt-publish: publish dummy i386 release, even though we don't make packages for it as Ubuntu on amd64 is sometimes confused and tries downloading i386 anyway (#574) 2020-08-31 17:22:17 -07:00
daniel-eys
39f1fae8a3 Set BuildVersion during repo initialization. (#572) 2020-08-30 17:29:28 -07:00
Jarek Kowalski
965160dba1 cli: ignore trailing / in repository server URL (#569)
Fixes #557
2020-08-30 16:10:26 -07:00
Jarek Kowalski
0dbaae1fa4 ui: fixed typo (#570) 2020-08-30 15:48:39 -07:00
Jarek Kowalski
bce4d78a6f site: fixed edit link (#568)
Fixes #567
2020-08-30 15:36:50 -07:00
phonovision
62c1a77520 Doc: fix create B2 repository cmd (#566)
Fix command line: "create" instead of "connect"
2020-08-30 15:22:54 -07:00