Skip to content

Commit 4689e5b

Browse files
nit: re-add default for CODER_EMAIL_HELLO
temporarily using new branch from coder/serpent for this
1 parent 66d1a69 commit 4689e5b

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

codersdk/deployment.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,7 @@ when required by your organization's security policy.`,
10371037
Description: "The hostname identifying the SMTP server.",
10381038
Flag: "email-hello",
10391039
Env: "CODER_EMAIL_HELLO",
1040+
Default: "localhost",
10401041
Value: &c.Notifications.SMTP.Hello,
10411042
Group: &deploymentGroupEmail,
10421043
YAML: "hello",
@@ -2625,6 +2626,7 @@ Write out the current server config as YAML to stdout.`,
26252626
Description: "The hostname identifying the SMTP server.",
26262627
Flag: "notifications-email-hello",
26272628
Env: "CODER_NOTIFICATIONS_EMAIL_HELLO",
2629+
Default: "localhost",
26282630
Value: &c.Notifications.SMTP.Hello,
26292631
Group: &deploymentGroupNotificationsEmail,
26302632
YAML: "hello",

codersdk/deployment_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,30 @@ func TestEmailValuesTakeCorrectPrecedent(t *testing.T) {
619619
newEnv: "CODER_EMAIL_SMARTHOST",
620620
expectedValue: "localhost:1000",
621621
},
622+
{
623+
name: "CODER_NOTIFICATIONS_EMAIL_HELLO is not discarded",
624+
envs: []serpent.EnvVar{
625+
{
626+
Name: "CODER_NOTIFICATIONS_EMAIL_HELLO",
627+
Value: "not-localhost",
628+
},
629+
},
630+
oldEnv: "CODER_NOTIFICATIONS_EMAIL_HELLO",
631+
newEnv: "CODER_EMAIL_HELLO",
632+
expectedValue: "not-localhost",
633+
},
634+
{
635+
name: "CODER_EMAIL_HELLO is not discarded",
636+
envs: []serpent.EnvVar{
637+
{
638+
Name: "CODER_EMAIL_HELLO",
639+
Value: "not-localhost",
640+
},
641+
},
642+
oldEnv: "CODER_NOTIFICATIONS_EMAIL_HELLO",
643+
newEnv: "CODER_EMAIL_HELLO",
644+
expectedValue: "not-localhost",
645+
},
622646
}
623647

624648
for _, tt := range tests {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ require (
204204
github.com/charmbracelet/bubbles v0.20.0
205205
github.com/charmbracelet/bubbletea v1.2.1
206206
github.com/charmbracelet/lipgloss v1.0.0
207-
github.com/coder/serpent v0.8.0
207+
github.com/coder/serpent v0.8.1-0.20241113113009-ad8fe148f0d8
208208
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21
209209
github.com/emersion/go-smtp v0.21.2
210210
github.com/go-jose/go-jose/v4 v4.0.2

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ github.com/coder/retry v1.5.1 h1:iWu8YnD8YqHs3XwqrqsjoBTAVqT9ml6z9ViJ2wlMiqc=
230230
github.com/coder/retry v1.5.1/go.mod h1:blHMk9vs6LkoRT9ZHyuZo360cufXEhrxqvEzeMtRGoY=
231231
github.com/coder/serpent v0.8.0 h1:6OR+k6fekhSeEDmwwzBgnSjaa7FfGGrMlc3GoAEH9dg=
232232
github.com/coder/serpent v0.8.0/go.mod h1:cZFW6/fP+kE9nd/oRkEHJpG6sXCtQ+AX7WMMEHv0Y3Q=
233+
github.com/coder/serpent v0.8.1-0.20241113113009-ad8fe148f0d8 h1:xBsCXOg2KBd5eq2uJFjXjVEJCZn6QaflS7qgzzipqZE=
234+
github.com/coder/serpent v0.8.1-0.20241113113009-ad8fe148f0d8/go.mod h1:cZFW6/fP+kE9nd/oRkEHJpG6sXCtQ+AX7WMMEHv0Y3Q=
233235
github.com/coder/ssh v0.0.0-20231128192721-70855dedb788 h1:YoUSJ19E8AtuUFVYBpXuOD6a/zVP3rcxezNsoDseTUw=
234236
github.com/coder/ssh v0.0.0-20231128192721-70855dedb788/go.mod h1:aGQbuCLyhRLMzZF067xc84Lh7JDs1FKwCmF1Crl9dxQ=
235237
github.com/coder/tailscale v1.1.1-0.20241003034647-02286e537fc2 h1:mBbPFyJ2i9o490IwWGvWgtG0qmvIk45R7GWJpoaXotI=

0 commit comments

Comments
 (0)