Skip to content

Commit

Permalink
feat(config): allow custom admin and sendername for inbucket (#2908)
Browse files Browse the repository at this point in the history
* feat(config): allow custom admin and sendername for inbucket

* Update pkg/config/templates/config.toml

Co-authored-by: Han Qiao <sweatybridge@gmail.com>

---------

Co-authored-by: Han Qiao <sweatybridge@gmail.com>
  • Loading branch information
avallete and sweatybridge authored Nov 25, 2024
1 parent b9e89fc commit c1fb5d0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion internal/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ EOF
env = append(env,
"GOTRUE_SMTP_HOST="+utils.InbucketId,
"GOTRUE_SMTP_PORT=2500",
"GOTRUE_SMTP_ADMIN_EMAIL=admin@email.com",
fmt.Sprintf("GOTRUE_SMTP_ADMIN_EMAIL=%s", utils.Config.Inbucket.AdminEmail),
fmt.Sprintf("GOTRUE_SMTP_SENDER_NAME=%s", utils.Config.Inbucket.SenderName),
)
}

Expand Down
16 changes: 10 additions & 6 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@ type (
}

inbucket struct {
Enabled bool `toml:"enabled"`
Image string `toml:"-"`
Port uint16 `toml:"port"`
SmtpPort uint16 `toml:"smtp_port"`
Pop3Port uint16 `toml:"pop3_port"`
Enabled bool `toml:"enabled"`
Image string `toml:"-"`
Port uint16 `toml:"port"`
SmtpPort uint16 `toml:"smtp_port"`
Pop3Port uint16 `toml:"pop3_port"`
AdminEmail string `toml:"admin_email"`
SenderName string `toml:"sender_name"`
}

edgeRuntime struct {
Expand Down Expand Up @@ -327,7 +329,9 @@ func NewConfig(editors ...ConfigEditor) config {
JwtSecret: defaultJwtSecret,
},
Inbucket: inbucket{
Image: inbucketImage,
Image: inbucketImage,
AdminEmail: "admin@email.com",
SenderName: "Admin",
},
Studio: studio{
Image: studioImage,
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/templates/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ port = 54324
# Uncomment to expose additional ports for testing user applications that send emails.
# smtp_port = 54325
# pop3_port = 54326
# admin_email = "admin@email.com"
# sender_name = "Admin"

[storage]
enabled = true
Expand Down

0 comments on commit c1fb5d0

Please sign in to comment.