feat!: allow disabling notifications (#15509)

Resolves https://github.com/coder/coder/issues/15513

Disables notifications when both `$CODER_NOTIFICATIONS_WEBHOOK_ENDPOINT` and `$CODER_EMAIL_SMARTHOST` are unset.

Breaking change: `$CODER_EMAIL_SMARTHOST` is no longer set by default as `localhost:587`, meaning any deployments that make use of this default value will need to add it back.

---------

Co-authored-by: Danny Kopping <danny@coder.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
This commit is contained in:
Danielle Maywood
2024-11-19 15:05:12 +00:00
committed by GitHub
co-authored by Danny Kopping Mathias Fredriksson
parent 1c08580f23
commit 576e1f48fe
15 changed files with 155 additions and 101 deletions
+7 -6
View File
@@ -74,7 +74,8 @@ flags.
Notifications can currently be delivered by either SMTP or webhook. Each message
can only be delivered to one method, and this method is configured globally with
[`CODER_NOTIFICATIONS_METHOD`](../../../reference/cli/server.md#--notifications-method)
(default: `smtp`).
(default: `smtp`). When there are no delivery methods configured, notifications
will be disabled.
Premium customers can configure which method to use for each of the supported
[Events](#workspace-events); see the
@@ -89,11 +90,11 @@ existing one.
**Server Settings:**
| Required | CLI | Env | Type | Description | Default |
| :------: | ------------------- | ----------------------- | ----------- | ----------------------------------------- | ------------- |
| ✔️ | `--email-from` | `CODER_EMAIL_FROM` | `string` | The sender's address to use. | |
| ✔️ | `--email-smarthost` | `CODER_EMAIL_SMARTHOST` | `host:port` | The SMTP relay to send messages through. | localhost:587 |
| ✔️ | `--email-hello` | `CODER_EMAIL_HELLO` | `string` | The hostname identifying the SMTP server. | localhost |
| Required | CLI | Env | Type | Description | Default |
| :------: | ------------------- | ----------------------- | -------- | ----------------------------------------- | --------- |
| ✔️ | `--email-from` | `CODER_EMAIL_FROM` | `string` | The sender's address to use. | |
| ✔️ | `--email-smarthost` | `CODER_EMAIL_SMARTHOST` | `string` | The SMTP relay to send messages |
| ✔️ | `--email-hello` | `CODER_EMAIL_HELLO` | `string` | The hostname identifying the SMTP server. | localhost |
**Authentication Settings:**