Upgrade Notes
- Router results from
Send,SendContext,SendItems, andSendItemsContextnow line up with the configured URLs, and each failure is a*types.TargetErrorwhoseIndexfield gives the URL's position. - Errors and logs no longer contain service URLs or credentials. Errors keep the scheme and host, and the underlying cause text is unchanged.
shoutrrr.Sendnow runs through a one-shot router, so each service's send budget applies (10 seconds by default) and the service is closed afterwards.- Undeclared
title,message, andlevelparams are now accepted instead of failing the send, and params no longer change a service's stored config between sends. - Matrix logs in on the first send instead of during initialization, so creating a sender to validate a URL no longer contacts the server.
- MQTT keeps its connection open between sends, disconnects after 60 seconds idle, and disconnects when the sender is closed. Call
Closeon long-lived senders when you are done with them. - Default HTTP clients now honor the
HTTP_PROXY,HTTPS_PROXY, andNO_PROXYenvironment variables, and the generic service's default client has a 10 second timeout. - The CLI reads every flag from a
SHOUTRRR_<FLAG>environment variable. Positional arguments no longer override flags, and extra arguments are an error. CreateSender,NewSender,router.New, theSendWithContextmethods, bark'sSendItems, andjsonclient.NewClientare deprecated. Rungo fix ./...to migrate callers.
Features
- feat: add context-aware sends and closing to the router and root API by @nicholas-fedor in #1464
- feat: add context-aware sends to json client services by @nicholas-fedor in #1469
- feat: add context-aware sends to the push services by @nicholas-fedor in #1510
- feat: add context-aware sends to the chat webhook services by @nicholas-fedor in #1512
- feat: add context-aware sends to the remaining services by @nicholas-fedor in #1516
- chore: let go fix migrate the remaining deprecated constructors by @nicholas-fedor in #1527
Fixes
- fix(router): stop custom url panic and url leaks by @nicholas-fedor in #1422
- fix(router): return send errors in url order by @nicholas-fedor in #1424
- fix(util): keep lines intact when batching messages by @nicholas-fedor in #1426
- fix(discord): count the title toward each batch's embed limit by @nicholas-fedor in #1428
- fix(format): accept reserved params that a service does not declare by @nicholas-fedor in #1430
- fix: redact service urls from errors by @nicholas-fedor in #1432
- fix(services): redact credentials from service errors and logs by @nicholas-fedor in #1441
- fix(services): keep http client injection safe and authenticated by @nicholas-fedor in #1443
- fix(telegram): report failed requests instead of success by @nicholas-fedor in #1445
- fix(matrix): log in on first send instead of during initialize by @nicholas-fedor in #1447
- fix(mqtt): keep connections open between sends and close them when idle by @nicholas-fedor in #1451
- fix(services): apply send params to a per-send config copy by @nicholas-fedor in #1455
- fix(services): match the capability interfaces the router dispatches on by @nicholas-fedor in #1459
- fix: honor proxy environment variables in default http clients by @nicholas-fedor in #1479
- fix(cli): read every flag from the environment and stop prompts at end of input by @nicholas-fedor in #1481
- fix(cli): close services after sending so MQTT disconnects cleanly by @nicholas-fedor in #1508
- fix: restore the default client when a nil *http.Client is set by @nicholas-fedor in #1518
- fix(join): send the icon without requiring a title by @nicholas-fedor in #1525
Dependency Updates
- chore(deps): update go toolchain directive to v1.27.2 by @renovate[bot] in #1453
- fix(deps): update module github.com/onsi/ginkgo/v2 to v2.33.1 by @renovate[bot] in #1505
- fix(deps): update module github.com/mattn/go-colorable to v0.1.16 by @renovate[bot] in #1414
- chore(deps): update module github.com/stretchr/objx to v0.7.0 by @renovate[bot] in #1547
- chore(deps): update module golang.org/x/crypto to v0.58.0 by @renovate[bot] in #1499
- chore(deps): update module golang.org/x/mod to v0.42.0 by @renovate[bot] in #1506
- chore(deps): update module golang.org/x/net to v0.61.0 by @renovate[bot] in #1502
- chore(deps): update module golang.org/x/sync to v0.24.0 by @renovate[bot] in #1482
- fix(deps): update module golang.org/x/sys to v0.49.0 by @renovate[bot] in #1483
- fix(deps): update module golang.org/x/term to v0.47.0 by @renovate[bot] in #1491
- chore(deps): update module golang.org/x/text to v0.43.0 by @renovate[bot] in #1490
- chore(deps): update module golang.org/x/tools to v0.52.0 by @renovate[bot] in #1534
- chore(deps): update github.com/google/pprof digest to 2af12c3 by @renovate[bot] in #1541
Full Changelog: v0.21.2...v0.22.0