Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
deeplearning
DolphinScheduler
提交
df008322
DolphinScheduler
项目概览
deeplearning
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
24
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
df008322
编写于
5月 24, 2019
作者:
Q
qiaozhanwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mail support ssl and install.sh update
上级
ec3c0f26
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
31 addition
and
3 deletion
+31
-3
escheduler-alert/src/main/java/cn/escheduler/alert/utils/Constants.java
...rt/src/main/java/cn/escheduler/alert/utils/Constants.java
+2
-0
escheduler-alert/src/main/java/cn/escheduler/alert/utils/MailUtils.java
...rt/src/main/java/cn/escheduler/alert/utils/MailUtils.java
+14
-2
escheduler-alert/src/main/resources/alert.properties
escheduler-alert/src/main/resources/alert.properties
+5
-0
install.sh
install.sh
+9
-0
sql/escheduler.sql
sql/escheduler.sql
+1
-1
未找到文件。
escheduler-alert/src/main/java/cn/escheduler/alert/utils/Constants.java
浏览文件 @
df008322
...
...
@@ -59,6 +59,8 @@ public class Constants {
public
static
final
String
MAIL_SMTP_STARTTLS_ENABLE
=
"mail.smtp.starttls.enable"
;
public
static
final
String
MAIL_SMTP_SSL_ENABLE
=
"mail.smtp.ssl.enable"
;
public
static
final
String
TEXT_HTML_CHARSET_UTF_8
=
"text/html;charset=utf-8"
;
public
static
final
String
STRING_TRUE
=
"true"
;
...
...
escheduler-alert/src/main/java/cn/escheduler/alert/utils/MailUtils.java
浏览文件 @
df008322
...
...
@@ -33,6 +33,7 @@ import org.springframework.util.ResourceUtils;
import
javax.mail.*
;
import
javax.mail.internet.*
;
import
java.io.*
;
import
java.security.Security
;
import
java.util.*
;
import
static
cn
.
escheduler
.
alert
.
utils
.
PropertyUtils
.
getInt
;
...
...
@@ -58,6 +59,10 @@ public class MailUtils {
public
static
final
String
xlsFilePath
=
getString
(
Constants
.
XLS_FILE_PATH
);
public
static
final
String
starttlsEnable
=
getString
(
Constants
.
MAIL_SMTP_STARTTLS_ENABLE
);
public
static
final
String
sslEnable
=
getString
(
Constants
.
MAIL_SMTP_SSL_ENABLE
);
private
static
Template
MAIL_TEMPLATE
;
static
{
...
...
@@ -122,7 +127,10 @@ public class MailUtils {
//set charset
email
.
setCharset
(
Constants
.
UTF_8
);
// TLS verification
email
.
setTLS
(
true
);
email
.
setTLS
(
Boolean
.
valueOf
(
starttlsEnable
));
// SSL verification
email
.
setSSL
(
Boolean
.
valueOf
(
sslEnable
));
if
(
CollectionUtils
.
isNotEmpty
(
receivers
)){
// receivers mail
for
(
String
receiver
:
receivers
)
{
...
...
@@ -269,11 +277,15 @@ public class MailUtils {
* @throws MessagingException
*/
private
static
MimeMessage
getMimeMessage
(
Collection
<
String
>
receivers
)
throws
MessagingException
{
// Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
// final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
Properties
props
=
new
Properties
();
props
.
setProperty
(
Constants
.
MAIL_HOST
,
mailServerHost
);
props
.
setProperty
(
Constants
.
MAIL_SMTP_AUTH
,
Constants
.
STRING_TRUE
);
props
.
setProperty
(
Constants
.
MAIL_TRANSPORT_PROTOCOL
,
mailProtocol
);
props
.
setProperty
(
Constants
.
MAIL_SMTP_STARTTLS_ENABLE
,
Constants
.
STRING_TRUE
);
props
.
setProperty
(
Constants
.
MAIL_SMTP_STARTTLS_ENABLE
,
starttlsEnable
);
props
.
setProperty
(
"mail.smtp.ssl.enable"
,
sslEnable
);
Authenticator
auth
=
new
Authenticator
()
{
@Override
protected
PasswordAuthentication
getPasswordAuthentication
()
{
...
...
escheduler-alert/src/main/resources/alert.properties
浏览文件 @
df008322
...
...
@@ -8,6 +8,11 @@ mail.server.port=25
mail.sender
=
xxxxxxx
mail.passwd
=
xxxxxxx
# TLS
mail.smtp.starttls.enable
=
false
# SSL
mail.smtp.ssl.enable
=
true
#xls file path,need create if not exist
xls.file.path
=
/tmp/xls
...
...
install.sh
浏览文件 @
df008322
...
...
@@ -96,6 +96,13 @@ mailSender="xxxxxxxxxx"
# 发送人密码
mailPassword
=
"xxxxxxxxxx"
# TLS邮件协议支持
starttlsEnable
=
"false"
# SSL邮件协议支持
# 注意:默认开启的是SSL协议,TLS和SSL只能有一个处于true状态
sslEnable
=
"true"
# 下载Excel路径
xlsFilePath
=
"/tmp/xls"
...
...
@@ -307,6 +314,8 @@ sed -i ${txt} "s#mail.server.host.*#mail.server.host=${mailServerHost}#g" conf/a
sed
-i
${
txt
}
"s#mail.server.port.*#mail.server.port=
${
mailServerPort
}
#g"
conf/alert.properties
sed
-i
${
txt
}
"s#mail.sender.*#mail.sender=
${
mailSender
}
#g"
conf/alert.properties
sed
-i
${
txt
}
"s#mail.passwd.*#mail.passwd=
${
mailPassword
}
#g"
conf/alert.properties
sed
-i
${
txt
}
"s#mail.smtp.starttls.enable.*#mail.smtp.starttls.enable=
${
starttlsEnable
}
#g"
conf/alert.properties
sed
-i
${
txt
}
"s#mail.smtp.ssl.enable.*#mail.smtp.ssl.enable=
${
sslEnable
}
#g"
conf/alert.properties
sed
-i
${
txt
}
"s#xls.file.path.*#xls.file.path=
${
xlsFilePath
}
#g"
conf/alert.properties
...
...
sql/escheduler.sql
浏览文件 @
df008322
...
...
@@ -426,7 +426,7 @@ CREATE TABLE `t_escheduler_worker_server` (
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- Records of t_escheduler_user,user : admin , password : escheduler123
INSERT
INTO
`t_escheduler_user`
VALUES
(
'1'
,
'admin'
,
'055a97b5fcd6d120372ad1976518f371'
,
'0'
,
'
825193156@qq.com'
,
'15001335629
'
,
'0'
,
'2018-03-27 15:48:50'
,
'2018-10-24 17:40:22'
);
INSERT
INTO
`t_escheduler_user`
VALUES
(
'1'
,
'admin'
,
'055a97b5fcd6d120372ad1976518f371'
,
'0'
,
'
xxx@qq.com'
,
'xxxx
'
,
'0'
,
'2018-03-27 15:48:50'
,
'2018-10-24 17:40:22'
);
INSERT
INTO
`t_escheduler_alertgroup`
VALUES
(
1
,
'escheduler管理员告警组'
,
'0'
,
'escheduler管理员告警组'
,
'2018-11-29 10:20:39'
,
'2018-11-29 10:20:39'
);
INSERT
INTO
`t_escheduler_relation_user_alertgroup`
VALUES
(
'1'
,
'1'
,
'1'
,
'2018-11-29 10:22:33'
,
'2018-11-29 10:22:33'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录