- 修复RDP协议连接导致的任意文件读取漏洞
- RDP协议增加「域」参数 - 增加安全访问功能 - 优化代码
This commit is contained in:
@ -4,18 +4,11 @@ import (
|
||||
"github.com/jordan-wright/email"
|
||||
"github.com/sirupsen/logrus"
|
||||
"net/smtp"
|
||||
"next-terminal/pkg/constant"
|
||||
"next-terminal/pkg/global"
|
||||
"next-terminal/pkg/guacd"
|
||||
)
|
||||
|
||||
const (
|
||||
SshMode = "ssh-mode"
|
||||
MailHost = "mail-host"
|
||||
MailPort = "mail-port"
|
||||
MailUsername = "mail-username"
|
||||
MailPassword = "mail-password"
|
||||
)
|
||||
|
||||
type Property struct {
|
||||
Name string `gorm:"primary_key" json:"name"`
|
||||
Value string `json:"value"`
|
||||
@ -74,10 +67,10 @@ func GetRecordingPath() (string, error) {
|
||||
|
||||
func SendMail(to, subject, text string) {
|
||||
propertiesMap := FindAllPropertiesMap()
|
||||
host := propertiesMap[MailHost]
|
||||
port := propertiesMap[MailPort]
|
||||
username := propertiesMap[MailUsername]
|
||||
password := propertiesMap[MailPassword]
|
||||
host := propertiesMap[constant.MailHost]
|
||||
port := propertiesMap[constant.MailPort]
|
||||
username := propertiesMap[constant.MailUsername]
|
||||
password := propertiesMap[constant.MailPassword]
|
||||
|
||||
if host == "" || port == "" || username == "" || password == "" {
|
||||
logrus.Debugf("邮箱信息不完整,跳过发送邮件。")
|
||||
|
Reference in New Issue
Block a user