diff --git a/docs/arguments.md b/docs/arguments.md index 36739d2..414eace 100644 --- a/docs/arguments.md +++ b/docs/arguments.md @@ -98,8 +98,8 @@ Environment Variable: WATCHTOWER_REMOVE_VOLUMES ## Debug Enable debug mode with verbose logging. -!!! note "Notes" - Alias for `--log-level debug`. See [Maximum log level](#maximum-log-level). +!!! note "Notes" + Alias for `--log-level debug`. See [Maximum log level](#maximum-log-level). Does _not_ take an argument when used as an argument. Using `--debug true` will **not** work. ```text @@ -112,8 +112,8 @@ Environment Variable: WATCHTOWER_DEBUG ## Trace Enable trace mode with very verbose logging. Caution: exposes credentials! -!!! note "Notes" - Alias for `--log-level trace`. See [Maximum log level](#maximum-log-level). +!!! note "Notes" + Alias for `--log-level trace`. See [Maximum log level](#maximum-log-level). Does _not_ take an argument when used as an argument. Using `--trace true` will **not** work. ```text @@ -226,8 +226,8 @@ Environment Variable: WATCHTOWER_LABEL_ENABLE ``` ## Filter by disable label -__Do not__ Monitor and update containers that have `com.centurylinklabs.watchtower.enable` label set to false and -no `--label-enable` argument is passed. Note that only one or the other (targeting by enable label) can be +__Do not__ Monitor and update containers that have `com.centurylinklabs.watchtower.enable` label set to false and +no `--label-enable` argument is passed. Note that only one or the other (targeting by enable label) can be used at the same time to target containers. ## Filter by disabling specific container names @@ -324,7 +324,7 @@ Environment Variable: WATCHTOWER_RUN_ONCE ``` ## HTTP API Mode -Runs Watchtower in HTTP API mode, only allowing image updates to be triggered by an HTTP request. +Runs Watchtower in HTTP API mode, only allowing image updates to be triggered by an HTTP request. For details see [HTTP API](https://watchtower.devcdn.net/http-api-mode). ```text @@ -346,7 +346,7 @@ Environment Variable: WATCHTOWER_HTTP_API_TOKEN ``` ## HTTP API periodic polls -Keep running periodic updates if the HTTP API mode is enabled, otherwise the HTTP API would prevent periodic polls. +Keep running periodic updates if the HTTP API mode is enabled, otherwise the HTTP API would prevent periodic polls. ```text Argument: --http-api-periodic-polls @@ -356,7 +356,7 @@ Environment Variable: WATCHTOWER_HTTP_API_PERIODIC_POLLS ``` ## Filter by scope -Update containers that have a `com.centurylinklabs.watchtower.scope` label set with the same value as the given argument. +Update containers that have a `com.centurylinklabs.watchtower.scope` label set with the same value as the given argument. This enables [running multiple instances](https://watchtower.devcdn.net/running-multiple-instances). !!! note "Filter by lack of scope" @@ -369,10 +369,10 @@ This enables [running multiple instances](https://watchtower.devcdn.net/running- Environment Variable: WATCHTOWER_SCOPE Type: String Default: - -``` +``` ## HTTP API Metrics -Enables a metrics endpoint, exposing prometheus metrics via HTTP. See [Metrics](metrics.md) for details. +Enables a metrics endpoint, exposing prometheus metrics via HTTP. See [Metrics](metrics.md) for details. ```text Argument: --http-api-metrics @@ -450,8 +450,8 @@ Returns a success exit code to enable usage with docker `HEALTHCHECK`. This chec ## Programatic Output (porcelain) -Writes the session results to STDOUT using a stable, machine-readable format (indicated by the argument VERSION). - +Writes the session results to STDOUT using a stable, machine-readable format (indicated by the argument VERSION). + Alias for: ```text diff --git a/docs/notifications.md b/docs/notifications.md index 2a5fc01..f4e0bf1 100644 --- a/docs/notifications.md +++ b/docs/notifications.md @@ -1,11 +1,11 @@ # Notifications Watchtower can send notifications when containers are updated. Notifications are sent via hooks in the logging -system, [logrus](http://github.com/sirupsen/logrus). +system, [logrus](http://github.com/sirupsen/logrus). !!! note "Using multiple notifications with environment variables" There is currently a bug in Viper (https://github.com/spf13/viper/issues/380), which prevents comma-separated slices to - be used when using the environment variable. + be used when using the environment variable. A workaround is available where we instead put quotes around the environment variable value and replace the commas with spaces: ``` @@ -54,7 +54,7 @@ outputs timestamp and log level. !!! tip "Custom date format" If you want to adjust the date/time format it must show how the [reference time](https://golang.org/pkg/time/#pkg-constants) (_Mon Jan 2 15:04:05 MST 2006_) would be displayed in your - custom format. + custom format. i.e., The day of the year has to be 1, the month has to be 2 (february), the hour 3 (or 15 for 24h time) etc. !!! note "Skipping notifications" @@ -179,7 +179,7 @@ Example using a custom report template that always sends a session report after ## Legacy notifications -For backwards compatibility, the notifications can also be configured using legacy notification options. These will automatically be converted to shoutrrr URLs when used. +For backwards compatibility, the notifications can also be configured using legacy notification options. These will automatically be converted to shoutrrr URLs when used. The types of notifications to send are set by passing a comma-separated list of values to the `--notifications` option (or corresponding environment variable `WATCHTOWER_NOTIFICATIONS`), which has the following valid values: @@ -249,6 +249,7 @@ You can then copy this file from the container (a message with the full command To receive notifications by email, the following command-line options, or their corresponding environment variables, can be set: - `--notification-email-from` (env. `WATCHTOWER_NOTIFICATION_EMAIL_FROM`): The e-mail address from which notifications will be sent. +- `--notification-email-from-name` (env. `WATCHTOWER_NOTIFICATION_EMAIL_FROM_NAME`): The name from which notifications will be sent. - `--notification-email-to` (env. `WATCHTOWER_NOTIFICATION_EMAIL_TO`): The e-mail address to which notifications will be sent. - `--notification-email-server` (env. `WATCHTOWER_NOTIFICATION_EMAIL_SERVER`): The SMTP server to send e-mails through. - `--notification-email-server-tls-skip-verify` (env. `WATCHTOWER_NOTIFICATION_EMAIL_SERVER_TLS_SKIP_VERIFY`): Do not verify the TLS certificate of the mail server. This should be used only for testing. @@ -387,4 +388,3 @@ docker run -d \ `-e WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN` or `--notification-gotify-token` can also reference a file, in which case the contents of the file are used. If you want to disable TLS verification for the Gotify instance, you can use either `-e WATCHTOWER_NOTIFICATION_GOTIFY_TLS_SKIP_VERIFY=true` or `--notification-gotify-tls-skip-verify`. - diff --git a/pkg/notifications/notifier_test.go b/pkg/notifications/notifier_test.go index 61ff789..12a5894 100644 --- a/pkg/notifications/notifier_test.go +++ b/pkg/notifications/notifier_test.go @@ -308,6 +308,8 @@ var _ = Describe("notifications", func() { "email", "--notification-email-from", fromAddress, + "--notification-email-from-name", + "Watchtower1", "--notification-email-to", "mail@example.com", "--notification-email-server-user", @@ -334,6 +336,8 @@ var _ = Describe("notifications", func() { "email", "--notification-email-from", fromAddress, + "--notification-email-from-name", + "Watchtower1", "--notification-email-to", toAddress, "--notification-email-server-user", @@ -342,7 +346,7 @@ var _ = Describe("notifications", func() { "secret-password", "--notification-email-server", "mail.containrrr.dev", - "--notification-email-delay", + "--notifications-delay", fmt.Sprint(expectedDelay.Seconds()), } @@ -353,7 +357,7 @@ var _ = Describe("notifications", func() { }) func buildExpectedURL(username string, password string, host string, port int, from string, to string, auth string) string { - var template = "smtp://%s:%s@%s:%d/?auth=%s&fromaddress=%s&fromname=Watchtower&subject=&toaddresses=%s" + var template = "smtp://%s:%s@%s:%d/?auth=%s&fromaddress=%s&fromname=Watchtower1&subject=&toaddresses=%s" return fmt.Sprintf(template, url.QueryEscape(username), url.QueryEscape(password),