Commit Graph

14 Commits

Author SHA1 Message Date
Julio Lopez
86afca6c1f fix(server): add empty line between headers and body in email payload (#4545)
Add empty line between headers and body in email payload.
Fix tests

- Original change: #4414
- Fixes: #4420

---------

Authored-by: Alexandr Kostiuchenko <a.kastsiuchenka>
2025-04-30 22:55:35 -07:00
Julio Lopez
8098f49c90 chore(ci): remove exclusion for unused ctx parameters (#4530)
Remove unused-parameter exclusion for `ctx` in revive linter.

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-26 23:11:36 -07:00
Julio Lopez
aa40c14e01 chore(ci): replace multierr with errors.Join (#4529)
- Replace multierr with errors.Join for error handling
- Remove now unused //nolint annotations
- Ref: #4527

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-26 22:19:16 -07:00
Matthieu MOREL
8a176255c0 fix(general): enable wsl for all go files (#4524)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-26 13:01:20 -07:00
Julio López
09b88d3860 chore(general): minor cleanups and other nits (#4507)
* use uint8 for clarity
* unexport writeContentAsyncAndVerify
* fix typo in test function name
* remove commented interface functions
* use atomic.Int32
* cleanups in socket server activation test
* leverage stdlib's maps and slices packages
  replace uses of `golang.org/x/exp/maps`
* nit: leverage `maps.Values`
2025-04-16 23:25:01 -07:00
Jarek Kowalski
e6e2870319 feat(notifications): tweak snapshot report template (#4338)
* feat(notifications): tweak snapshot report template

* test fix
2025-01-09 18:45:51 -08:00
Jarek Kowalski
ef01650665 feat(server): emit notifications as JSON to stderr when running under KopiaUI (#4322)
* feat(server): emit notifications as JSON to stderr when running under KopiaUI

* added tests
2024-12-30 15:06:11 -08:00
Jarek Kowalski
f8bed5dafa feat(notifications): improved notification templates (#4321) 2024-12-29 16:11:59 -08:00
Jarek Kowalski
c1757a0c67 feat(general): misc notifications improvements (#4319)
* feat(general): various notifications improvements

* added API to test notification profiles
* added --http-header to webhook notification configuration
* refactored configuration to always apply defaults before persisting options in the repository
* added 'notification profile show --profile-name=X' command

* more tests

* more test coverage

* report notification code coverage
2024-12-29 09:50:20 -08:00
Jarek Kowalski
c6a4248c91 fix(notifications): fixed headers for email notifications (#4258) 2024-11-18 01:47:13 +00:00
Jarek Kowalski
eb1cf64c27 chore(ci): upgraded linter to 1.62.0 (#4250) 2024-11-16 07:16:50 -08:00
Jarek Kowalski
f73887f4d6 feat(cli): improved snapshot reports (#4244) 2024-11-15 22:09:07 -08:00
Jarek Kowalski
afb85cbb34 feat(cli): send error notifications and snapshot reports (#4233)
* feat(cli): send error notifications and snapshot reports

Notifications will be sent to all configured notification profiles
according to their severity levels.

The following events will trigger notifications:

- Snapshot is created (CLI only, severity >= report)
- Server Maintenance error occurs (CLI, server and UI, severity >= error)
- Any other CLI error occurs (CLI only, severity >= error).

A flag `--no-error-notifications` can be used to disable error notifications.

* added template tests

* improved time formatting in templates

* plumb through notifytemplate.Options

* more testing for formatting options

* fixed default date format to RFC1123
2024-11-11 17:53:50 -08:00
Jarek Kowalski
c0bd372d29 feat(cli): support for defining notification profiles and templates via CLI (#4034)
* feat(cli): support for defining notification profiles via CLI

Profile management:

```
$ kopia notification profile configure email \
    --profile-name=X \
    --smtp-server=smtp.gmail.com \
    --smtp-port=587 \
    --smtp-username=X \
    --smtp-password=X \
    --mail-from=X \
    --mail-to=X \
    --format=html|txt \
    [--send-test-notification]

$ kopia notification profile configure pushover --profile-name=X \
    --user-key=X \
    --app-token=X \
    --format=html|txt \
    [--send-test-notification]

$ kopia notification profile configure webhook --profile-name=X \
    --endpooint=http://some-address:port/path \
    --method=POST|PUT \
    --format=html|txt \
    [--send-test-notification]

$ kopia notification profile test --profile-name=X

$ kopia notification profile delete --profile-name=X

$ kopia notification profile list
```

Template management:

```
$ kopia notification template show X

$ kopia notification template set X \
   --from-stdin | --from-file=X | --editor

$ kopia notification template remove X

$ kopia notification template list

```

Implements #1958

* additional refactoring for testability, various naming tweaks
2024-10-06 16:28:39 +00:00