Move SMTP credentials to .env file

This commit is contained in:
2024-04-27 15:43:11 +07:00
parent 2e48192a35
commit dfaf8e999f
4 changed files with 13 additions and 2 deletions

View File

@ -15,6 +15,7 @@ import (
forgotPasswordView "github.com/fossyy/filekeeper/view/forgotPassword"
"gorm.io/gorm"
"net/http"
"strconv"
"sync"
"time"
)
@ -34,7 +35,8 @@ var UserForgotPassword = make(map[string]string)
func init() {
log = logger.Logger()
ListForgotPassword = make(map[string]*ForgotPassword)
mailServer = email.NewSmtpServer("mail.fossy.my.id", 25, "test@fossy.my.id", "Test123456")
smtpPort, _ := strconv.Atoi(utils.Getenv("SMTP_PORT"))
mailServer = email.NewSmtpServer(utils.Getenv("SMTP_HOST"), smtpPort, utils.Getenv("SMTP_USER"), utils.Getenv("SMTP_PASSWORD"))
ticker := time.NewTicker(time.Minute)
go func() {
for {