Commit Graph

2139 Commits

Author SHA1 Message Date
Jarek Kowalski
7d1bfb2070 feat(ci): automatically publish official releases (#1693) v0.10.2 2022-01-30 11:00:51 -08:00
Jarek Kowalski
f7b0ee52c3 fix(ci): improve changelog readability (#1692) 2022-01-30 10:05:16 -08:00
Jarek Kowalski
fd163cfc20 feat(kopiaui): connect to repository asynchronously on startup (#1691)
This allows KopiaUI server to start when the repository directory
is not mounted or otherwise unavailable. Connection attempts will
be retried indefinitely and user will see new `Initializing` page.

This also exposes `Open` and `Connect` as tasks allowing the user to see
logs directly in the UI and cancel the operation.
2022-01-29 18:28:52 -08:00
Jarek Kowalski
8555853973 build(deps): upgrade go-fuse to support /bin/fusermount3 (#1690)
Fixes #1648
2022-01-29 15:53:33 -08:00
Jarek Kowalski
f67274e229 fix(providers): fixed DoNotRecreate and tests for gcs (#1688)
Also simplified validation test suite, which will simply test whether
the provider supports DoNotRecreate or properly rejects it without
external configuration.
2022-01-29 09:12:07 -08:00
Jarek Kowalski
f404806557 fix(ci): fixed linter issue, do not ignore in workflow (#1687) 2022-01-29 08:15:24 -08:00
Jarek Kowalski
9cad0edb53 test(ui): added end-to-end HTML UI test (#1686)
* test(general): refactored parsing of server output

* test(ui): added experimental end-to-end test using chromedp
2022-01-29 01:34:45 -08:00
Jarek Kowalski
16ffe7b5a2 fix(provider): fixed b2 provider failure (#1685)
There was a small regression in #1654 - only in negative tests.

Also removed unnecessary retries on ErrUnsupportedPutBlobOption
+ switched provider test to run once per day, instead of 12 times/day.
2022-01-28 23:19:52 -08:00
Jarek Kowalski
400b3c5ed5 fix(server): sleep 30m after failed maintenance (#1684)
Fixes #1651
Fixes #1652
2022-01-27 18:27:40 -08:00
Jarek Kowalski
525d161f48 docs(site): updated apt installation instructions (#1683) 2022-01-27 09:22:59 -08:00
Ali Dowair
7ca8b85a57 feat(providers): expand PutBlob API to allow for idempotent puts (#1654)
* Add a new PutBlob option and blob error type

When `DoNotRecreate` is set as true, the blob put operation should
only succeed if no blob with the given blob ID already exists.
Othwerwise, `ErrBlobAlreadyExists` is returned.

* Validate default storage providers' support

By default, storage providers should not support idempotent creates.
This commit adds error handling to exit early if `DoNotRecreate` is
set to true. The commit also verifies this behavior in the provider
validation test.

* Implement support for new option in GCS storage

* Push PutBlob option handling down to Impl

When PutBlob options were introduced, error handling logic for them
was implemented for the Sharded storage interface. However, the
behavior of different providers that implement Sharded can be
different, so it's better to push the options down to be processed in
the provider implementations.

* Introduce new error type for unsupported put opts

To unify error handling code and make it more maintainable, introduce
a new error type `blob.ErrUnsupportedPutBlobOption`, which is to be
returned whenever a storage provider implementation is given put
options it does not support.
2022-01-27 08:49:06 -08:00
Jarek Kowalski
e67f84e0ba chore(general): updated linter to 1.44.0 (#1681) 2022-01-25 21:21:13 -08:00
Jarek Kowalski
e030c15803 fix(ci): generate changelog as part of the build (#1679) 2022-01-23 16:58:33 -08:00
Jarek Kowalski
c2ab5020dc build(ci): auto-generate change log (#1678) 2022-01-23 15:22:11 -08:00
Jarek Kowalski
9cb2a40816 feat(providers): improved sharded directory creation (#1665)
When a sharded directory is missing do not attempt to create all
its parents, but only children of the repository root.

This way when a top-level directory is unmounted, we won't recreate
it unnecessarily.

This is implemented for filesystem and SFTP providers.
2022-01-23 14:56:35 -08:00
Jarek Kowalski
41a62a7139 chore(ci): do not linter on linux/{arm,arm64} (#1677) 2022-01-23 14:56:13 -08:00
Jarek Kowalski
8451c622ef chore(ci): enforce pull request titles using deepakputhraya/action-pr-title (#1676) 2022-01-23 12:20:00 -08:00
Shikhar Mall
b592776edf feat(repository): persistence for blob-retention configuration (#1596)
* feat: persisting retention options in repository blob

 - plumb retention parameters through wrapped storage
 - generalize aes encryption mechanism
 - rewrite the retention blob on password change
 - do not write retention blob when empty

* handle retention-blob not-found failures

* cli params to set retention modes on repository create

* enable versioned map mock storage with retention settings

* adding unit tests

* write format and retention blob with retention settings if available

* rename certain functions and constants specific to format blob

* delete retention cache on password-change

* fix: replace SetTime() api call with TouchBlob()

* Update repo/repository_test.go

Co-authored-by: Nick <nick@kasten.io>

* pr feedback and codecov improvements

* fix: rename retention-blob structures to generic blob-cfg

* fix: remove minio dependency on retention constants

Co-authored-by: Shikhar Mall <shikhar@kasten.io>
Co-authored-by: Nick <nick@kasten.io>
2022-01-22 08:37:00 -08:00
Jarek Kowalski
aeb483a081 fix(testing): fixed robustness tests (#1661)
Fixes #1660
Broken by #1644
2022-01-19 17:12:23 -08:00
Aaron Jorgensen
0f4eb06369 Use gpg instead of apt-key (#1667)
Use gpg to install signing key. `apt-key` is deprecated and will be removed after Ubuntu 22.04.
2022-01-16 15:39:17 -08:00
Jarek Kowalski
32ed220a6c build(lint): enabled gochecknoglobals and tagged existing globals (#1664) 2022-01-15 12:54:56 -08:00
Jarek Kowalski
c129f28b16 chore(ci): moved tests to standalone GHA workflow that runs in parallel (#1663) 2022-01-15 12:12:18 -08:00
Jarek Kowalski
003b150a0e fix(ui): fixed HTTP 400 response when repository is not connected (#1659) v0.10.1 2022-01-14 08:47:41 -08:00
Jarek Kowalski
6438d28094 fix(ci): fix regression when publishing APT repository (#1658) 2022-01-14 08:06:51 -08:00
Jarek Kowalski
b615a5554a feat(ui): embed version info in index.html (#1656) v0.10.0 2022-01-13 20:11:03 -08:00
Jarek Kowalski
32d95145b1 feat(kopiaui): added menu option prompting users to manually upgrade when auto-update fails (#1655)
Temporary workaround for #1630
2022-01-13 19:35:23 -08:00
Jarek Kowalski
3d58566644 fix(security): prevent cross-site request forgery in the UI website (#1653)
* fix(security): prevent cross-site request forgery in the UI website

This fixes a [cross-site request forgery (CSRF)](https://en.wikipedia.org/wiki/Cross-site_request_forgery)
vulnerability in self-hosted UI for Kopia server.

The vulnerability allows potential attacker to make unauthorized API
calls against a running Kopia server. It requires an attacker to trick
the user into visiting a malicious website while also logged into a
Kopia website.

The vulnerability only affected self-hosted Kopia servers with UI. The
following configurations were not vulnerable:

* Kopia Repository Server without UI
* KopiaUI (desktop app)
* command-line usage of `kopia`

All users are strongly recommended to upgrade at the earliest
convenience.

* pr feedback
2022-01-13 11:31:51 -08:00
Jarek Kowalski
2385ab19c9 chore(infra): added git message linter (#1646) 2022-01-04 17:32:11 -08:00
dependabot[bot]
4dd4a8adb7 build(deps): bump github.com/aws/aws-sdk-go from 1.42.23 to 1.42.25 (#1641)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.42.23 to 1.42.25.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.42.23...v1.42.25)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 21:33:05 -08:00
Jarek Kowalski
f54049aed7 testing: fixed test flake in TestSnapshotCounters (#1645)
* testing: added logging to figure out root cause of the flake in TestSnapshotCounters

* fixed test flake caused by not waiting for upload task to be created
2022-01-03 21:32:44 -08:00
dependabot[bot]
16a31c7247 build(deps): bump github.com/minio/minio-go/v7 from 7.0.18 to 7.0.20 (#1642)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.18 to 7.0.20.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.18...v7.0.20)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 20:20:33 -08:00
Jarek Kowalski
2e9a57f0b4 server: support for server control APIs and tooling (#1644)
This adds new set of APIs `/api/v1/control/*` which can be used to administratively control a running server.

Once the server is started, the administrative user can control it
using CLI commands:

export KOPIA_SERVER_ADDRESS=...
export KOPIA_SERVER_CERT_FINGERPRINT=...
export KOPIA_SERVER_PASSWORD=...

* `kopia server status` - displays status of sources managed by the server
* `kopia server snapshot` - triggers server-side upload of snapshots for managed sources
* `kopia server cancel` - cancels upload of snapshots for managed sources
* `kopia server pause` - pauses scheduled snapshots for managed sources
* `kopia server resume` - resumes scheduled snapshots for managed sources
* `kopia server refresh` - causes server to resynchronize with externally-made changes, such as policies or new sources
* `kopia server flush` - causes server to flush all pending writes
* `kopia server shutdown` - graceful shutdown of the server

Authentication uses new user `server-control` and is disabled
by default. To enable it when starting the server, provide the password
using one of the following methods:

* `--server-control-password`
* `--random-server-control-password`
* `.htpasswd` file
* `KOPIA_SERVER_CONTROL_PASSWORD` environment variable

This change allows us to tighten the API security and remove some
methods that UI user was able to call, but which were not needed.
2022-01-03 18:48:38 -08:00
dependabot[bot]
33b6fb9cda build(deps): bump electron-log from 4.4.3 to 4.4.4 in /app (#1639)
Bumps [electron-log](https://github.com/megahertz/electron-log) from 4.4.3 to 4.4.4.
- [Release notes](https://github.com/megahertz/electron-log/releases)
- [Changelog](https://github.com/megahertz/electron-log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/megahertz/electron-log/compare/v4.4.3...v4.4.4)

---
updated-dependencies:
- dependency-name: electron-log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 18:31:40 -08:00
dependabot[bot]
272018dfd6 build(deps-dev): bump concurrently from 6.5.0 to 6.5.1 in /app (#1638)
Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 6.5.0 to 6.5.1.
- [Release notes](https://github.com/open-cli-tools/concurrently/releases)
- [Commits](https://github.com/open-cli-tools/concurrently/compare/v6.5.0...v6.5.1)

---
updated-dependencies:
- dependency-name: concurrently
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-01 17:01:38 -08:00
dependabot[bot]
c00fa1f90a build(deps-dev): bump electron-builder from 22.14.6 to 22.14.11 in /app (#1640)
Bumps [electron-builder](https://github.com/electron-userland/electron-builder/tree/HEAD/packages/electron-builder) from 22.14.6 to 22.14.11.
- [Release notes](https://github.com/electron-userland/electron-builder/releases)
- [Changelog](https://github.com/electron-userland/electron-builder/blob/master/packages/electron-builder/CHANGELOG.md)
- [Commits](https://github.com/electron-userland/electron-builder/commits/v22.14.11/packages/electron-builder)

---
updated-dependencies:
- dependency-name: electron-builder
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-01 15:06:45 -08:00
Jarek Kowalski
c66b1c3e76 server: moved serving of static files to internal/server package (#1637) 2022-01-01 13:07:47 -08:00
Jarek Kowalski
4227de1a4b nit: fixed benign test data race (#1635)
* nit: fixed benign test data race

* run race detector tests in sequence
2021-12-30 18:20:28 -08:00
Jarek Kowalski
a223fb8bdc ci: do not upload armv7 deb packages (kopia-ui) into the apt repository bucket 2021-12-29 10:43:51 -08:00
Jarek Kowalski
014953847a logging: log maximum concurrency level when talking to backend storage (#1629) 2021-12-29 07:28:25 -08:00
Jarek Kowalski
13ed6bb81c app: fix macOS autoupdate regression (#1631)
Fixes #1630
2021-12-28 21:27:11 -08:00
Janne Johansson
024df695f7 small error on domain name example at the end. (#1627) 2021-12-28 08:11:59 -08:00
Jarek Kowalski
fb7d66ceaf ui: cleaned up task details page (#1623) v0.9.8 2021-12-25 16:37:15 -08:00
Jarek Kowalski
f56ad31d41 ui: apply dark mode default and persist user choice (#1621) 2021-12-23 12:09:55 -08:00
Jarek Kowalski
76fcf5ac66 ui: added preliminary dark mode support (the choice is not persistent yet) (#1619) 2021-12-22 23:40:44 -08:00
Julio Lopez
e4c7fc7b52 s3/test: cleanup blob versions (#1618)
additional nit: use testing context for cleanup task
2021-12-22 22:30:17 -08:00
Jarek Kowalski
d9afb15e4d maintenance: moved costly epoch manager cleanup to maintenance (#1616) 2021-12-22 21:34:26 -08:00
Julio Lopez
01d7d109cb s3/test: fix minio bucket creation in tests (#1617) 2021-12-22 20:40:56 -08:00
Julio Lopez
294f053a3e s3/test: refactor retention tests (#1615)
Coalesce retention period tests. This has the following effects:
- serializes the tests
- reuses the bucket and reduces bucket creation calls

Also:
- check whether bucket exists before attempting to create it
- nit: rename test for clarity and rename non-AWS specific tests
- nit: cleanup test logging and contexts
2021-12-22 18:05:26 -08:00
Julio Lopez
5bf8e7c570 Allow building without UI (#1614) 2021-12-21 20:19:27 -08:00
dependabot[bot]
c641559284 build(deps): bump google.golang.org/api from 0.60.0 to 0.63.0 (#1607)
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.60.0 to 0.63.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.60.0...v0.63.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-18 17:44:45 -08:00