registration/email_from -> email/from (#178)

This commit is contained in:
Michael Quigley 2023-01-23 16:52:13 -05:00
parent 1043b16d5d
commit 685683312b
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
4 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,9 @@
# v0.3.0-rc3 (WiP) # v0.3.0-rc3 (WiP)
> This release increments the configuration version from `1` to `2`. See the note below.
CHANGE: The email "from" configuration moved from `registration/email_from` to `email/from`. **NOTE: This change increments the configuration `V` from `1` to `2`.**
CHANGE: Replaced un-salted sha512 password hashing with salted hashing based on Argon2 **NOTE: This version will _invalidate_ all account passwords, and will require all users to use the 'Forgot Password?' function to reset their password.** (https://github.com/openziti/zrok/issues/156) CHANGE: Replaced un-salted sha512 password hashing with salted hashing based on Argon2 **NOTE: This version will _invalidate_ all account passwords, and will require all users to use the 'Forgot Password?' function to reset their password.** (https://github.com/openziti/zrok/issues/156)
FIX: Fixed log message in `resetPasswordRequest.go` (https://github.com/openziti/zrok/issues/175) FIX: Fixed log message in `resetPasswordRequest.go` (https://github.com/openziti/zrok/issues/175)

View File

@ -8,11 +8,10 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
const ConfigVersion = 1 const ConfigVersion = 2
type Config struct { type Config struct {
V int V int
ResetPassword *ResetPasswordConfig
Admin *AdminConfig Admin *AdminConfig
Endpoint *EndpointConfig Endpoint *EndpointConfig
Email *EmailConfig Email *EmailConfig
@ -21,6 +20,7 @@ type Config struct {
Maintenance *MaintenanceConfig Maintenance *MaintenanceConfig
Metrics *MetricsConfig Metrics *MetricsConfig
Registration *RegistrationConfig Registration *RegistrationConfig
ResetPassword *ResetPasswordConfig
Store *store.Config Store *store.Config
Ziti *ZitiConfig Ziti *ZitiConfig
} }
@ -39,10 +39,10 @@ type EmailConfig struct {
Port int Port int
Username string Username string
Password string `cf:"+secret"` Password string `cf:"+secret"`
From string
} }
type RegistrationConfig struct { type RegistrationConfig struct {
EmailFrom string
RegistrationUrlTemplate string RegistrationUrlTemplate string
TokenStrategy string TokenStrategy string
} }

View File

@ -35,7 +35,7 @@ func sendResetPasswordEmail(emailAddress, token string) error {
} }
msg := mail.NewMsg() msg := mail.NewMsg()
if err := msg.From(cfg.Registration.EmailFrom); err != nil { if err := msg.From(cfg.Email.From); err != nil {
return errors.Wrap(err, "failed to set from address in reset password email") return errors.Wrap(err, "failed to set from address in reset password email")
} }
if err := msg.To(emailAddress); err != nil { if err := msg.To(emailAddress); err != nil {

View File

@ -34,7 +34,7 @@ func sendVerificationEmail(emailAddress, token string) error {
} }
msg := mail.NewMsg() msg := mail.NewMsg()
if err := msg.From(cfg.Registration.EmailFrom); err != nil { if err := msg.From(cfg.Email.From); err != nil {
return errors.Wrap(err, "failed to set from address in verification email") return errors.Wrap(err, "failed to set from address in verification email")
} }
if err := msg.To(emailAddress); err != nil { if err := msg.To(emailAddress); err != nil {