Skip to content

feat!: allow disabling notifications #15509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5c36c93
fix: remove defaults for CODER_EMAIL_ options
DanielleMaywood Nov 12, 2024
196f538
fix: failing tests
DanielleMaywood Nov 12, 2024
b670009
fix: tests (again)
DanielleMaywood Nov 12, 2024
19398cc
fix: run 'make gen'
DanielleMaywood Nov 12, 2024
4175bc8
fix: consistency
DanielleMaywood Nov 13, 2024
66d1a69
nit: trim smarthost
DanielleMaywood Nov 13, 2024
4689e5b
nit: re-add default for CODER_EMAIL_HELLO
DanielleMaywood Nov 13, 2024
01d4957
fix: run 'make {update-golden-files,gen}'
DanielleMaywood Nov 13, 2024
27fa5bf
fix: run 'make fmt'
DanielleMaywood Nov 13, 2024
6ca7844
feat: allow disabling notifications entirely
DanielleMaywood Nov 13, 2024
fb54e45
Merge branch 'main' into dm-fix-defaults-notifications
DanielleMaywood Nov 14, 2024
d5aff28
chore: re-add default for smarthost
DanielleMaywood Nov 14, 2024
01cb999
fix: remove default for deprecated option
DanielleMaywood Nov 14, 2024
c513113
chore: revert change
DanielleMaywood Nov 14, 2024
a8b5a61
chore: remove unrelated test changes
DanielleMaywood Nov 14, 2024
1711e68
revert: more changes
DanielleMaywood Nov 14, 2024
2e03ed1
chore: simplify description
DanielleMaywood Nov 14, 2024
28ec1b7
Merge branch 'main' into dm-fix-defaults-notifications
DanielleMaywood Nov 14, 2024
7ba3a6c
chore: make {gen,update-golden-files}
DanielleMaywood Nov 14, 2024
4a72e4f
chore: rename cfg to notificationsCfg
DanielleMaywood Nov 14, 2024
9c02842
chore: drop enabled flag
DanielleMaywood Nov 18, 2024
dd527f9
fix: invalid test
DanielleMaywood Nov 18, 2024
77d1803
chore: improve info message and add to docs
DanielleMaywood Nov 19, 2024
5fd03b3
test: notifications.Enabled()
DanielleMaywood Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert: more changes
  • Loading branch information
DanielleMaywood committed Nov 14, 2024
commit 1711e68bfbd7cef91f766b5175a1cbd2e48c1a60
90 changes: 45 additions & 45 deletions cli/testdata/server-config.yaml.golden
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,51 @@ userQuietHoursSchedule:
# compatibility reasons, this will be removed in a future release.
# (default: false, type: bool)
allowWorkspaceRenames: false
# Configure how emails are sent.
email:
# The sender's address to use.
# (default: <unset>, type: string)
from: ""
# The intermediary SMTP host through which emails are sent.
# (default: localhost:587, type: host:port)
smarthost: localhost:587
# The hostname identifying the SMTP server.
# (default: localhost, type: string)
hello: localhost
# Force a TLS connection to the configured SMTP smarthost.
# (default: false, type: bool)
forceTLS: false
# Configure SMTP authentication options.
emailAuth:
# Identity to use with PLAIN authentication.
# (default: <unset>, type: string)
identity: ""
# Username to use with PLAIN/LOGIN authentication.
# (default: <unset>, type: string)
username: ""
# File from which to load password for use with PLAIN/LOGIN authentication.
# (default: <unset>, type: string)
passwordFile: ""
# Configure TLS for your SMTP server target.
emailTLS:
# Enable STARTTLS to upgrade insecure SMTP connections using TLS.
# (default: <unset>, type: bool)
startTLS: false
# Server name to verify against the target certificate.
# (default: <unset>, type: string)
serverName: ""
# Skip verification of the target server's certificate (insecure).
# (default: <unset>, type: bool)
insecureSkipVerify: false
# CA certificate file to use.
# (default: <unset>, type: string)
caCertFile: ""
# Certificate file to use.
# (default: <unset>, type: string)
certFile: ""
# Certificate key file to use.
# (default: <unset>, type: string)
certKeyFile: ""
# Configure how notifications are processed and delivered.
notifications:
# Controls if notifications are enabled.
Expand Down Expand Up @@ -612,48 +657,3 @@ notifications:
# How often to query the database for queued notifications.
# (default: 15s, type: duration)
fetchInterval: 15s
# Configure how emails are sent.
email:
# The sender's address to use.
# (default: <unset>, type: string)
from: ""
# The intermediary SMTP host through which emails are sent.
# (default: localhost:587, type: host:port)
smarthost: localhost:587
# The hostname identifying the SMTP server.
# (default: localhost, type: string)
hello: localhost
# Force a TLS connection to the configured SMTP smarthost.
# (default: false, type: bool)
forceTLS: false
# Configure SMTP authentication options.
emailAuth:
# Identity to use with PLAIN authentication.
# (default: <unset>, type: string)
identity: ""
# Username to use with PLAIN/LOGIN authentication.
# (default: <unset>, type: string)
username: ""
# File from which to load password for use with PLAIN/LOGIN authentication.
# (default: <unset>, type: string)
passwordFile: ""
# Configure TLS for your SMTP server target.
emailTLS:
# Enable STARTTLS to upgrade insecure SMTP connections using TLS.
# (default: <unset>, type: bool)
startTLS: false
# Server name to verify against the target certificate.
# (default: <unset>, type: string)
serverName: ""
# Skip verification of the target server's certificate (insecure).
# (default: <unset>, type: bool)
insecureSkipVerify: false
# CA certificate file to use.
# (default: <unset>, type: string)
caCertFile: ""
# Certificate file to use.
# (default: <unset>, type: string)
certFile: ""
# Certificate key file to use.
# (default: <unset>, type: string)
certKeyFile: ""
30 changes: 15 additions & 15 deletions codersdk/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -2597,6 +2597,21 @@ Write out the current server config as YAML to stdout.`,
YAML: "thresholdDatabase",
Annotations: serpent.Annotations{}.Mark(annotationFormatDuration, "true"),
},
// Email options
emailFrom,
emailSmarthost,
emailHello,
emailForceTLS,
emailAuthIdentity,
emailAuthUsername,
emailAuthPassword,
emailAuthPasswordFile,
emailTLSStartTLS,
emailTLSServerName,
emailTLSSkipCertVerify,
emailTLSCertAuthorityFile,
emailTLSCertFile,
emailTLSCertKeyFile,
// Notifications Options
{
Name: "Notifications: Enabled",
Expand Down Expand Up @@ -2868,21 +2883,6 @@ Write out the current server config as YAML to stdout.`,
Annotations: serpent.Annotations{}.Mark(annotationFormatDuration, "true"),
Hidden: true, // Hidden because most operators should not need to modify this.
},
// Email options
emailFrom,
emailSmarthost,
emailHello,
emailForceTLS,
emailAuthIdentity,
emailAuthUsername,
emailAuthPassword,
emailAuthPasswordFile,
emailTLSStartTLS,
emailTLSServerName,
emailTLSSkipCertVerify,
emailTLSCertAuthorityFile,
emailTLSCertFile,
emailTLSCertKeyFile,
}

return opts
Expand Down
Loading
Loading