mirror of
https://github.com/fosrl/pangolin.git
synced 2025-12-17 13:35:38 +00:00
Make no-reply email address required when email is enabled
- Added helpful hint in prompt suggesting to use SMTP username - Added validation to ensure no-reply email is not empty when email is enabled - Applied gofmt formatting improvements Co-authored-by: oschwartz10612 <4999704+oschwartz10612@users.noreply.github.com>
This commit is contained in:
@@ -359,7 +359,7 @@ func collectUserInput(reader *bufio.Reader) Config {
|
||||
config.EmailSMTPPort = readInt(reader, "Enter SMTP port (default 587)", 587)
|
||||
config.EmailSMTPUser = readString(reader, "Enter SMTP username", "")
|
||||
config.EmailSMTPPass = readString(reader, "Enter SMTP password", "") // Should this be readPassword?
|
||||
config.EmailNoReply = readString(reader, "Enter no-reply email address", "")
|
||||
config.EmailNoReply = readString(reader, "Enter no-reply email address (often the same as SMTP username)", "")
|
||||
}
|
||||
|
||||
// Validate required fields
|
||||
@@ -371,6 +371,10 @@ func collectUserInput(reader *bufio.Reader) Config {
|
||||
fmt.Println("Error: Let's Encrypt email is required")
|
||||
os.Exit(1)
|
||||
}
|
||||
if config.EnableEmail && config.EmailNoReply == "" {
|
||||
fmt.Println("Error: No-reply email address is required when email is enabled")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Advanced configuration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user