Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
DolphinScheduler
提交
ae8076a7
DolphinScheduler
项目概览
apache
/
DolphinScheduler
上一次同步 1 年多
通知
706
Star
9572
Fork
3514
代码
文件
提交
分支
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
ae8076a7
编写于
5月 24, 2019
作者:
journey2018
提交者:
GitHub
5月 24, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #351 from qiaozhanwei/branch-1.0.2
mail support ssl and install.sh update and user queue display
上级
79722252
6b5706d6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
39 addition
and
5 deletion
+39
-5
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
escheduler-api/src/main/java/cn/escheduler/api/service/UsersService.java
...src/main/java/cn/escheduler/api/service/UsersService.java
+3
-0
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java
...ain/java/cn/escheduler/dao/mapper/UserMapperProvider.java
+5
-2
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
浏览文件 @
ae8076a7
...
@@ -59,6 +59,8 @@ public class Constants {
...
@@ -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_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
TEXT_HTML_CHARSET_UTF_8
=
"text/html;charset=utf-8"
;
public
static
final
String
STRING_TRUE
=
"true"
;
public
static
final
String
STRING_TRUE
=
"true"
;
...
...
escheduler-alert/src/main/java/cn/escheduler/alert/utils/MailUtils.java
浏览文件 @
ae8076a7
...
@@ -33,6 +33,7 @@ import org.springframework.util.ResourceUtils;
...
@@ -33,6 +33,7 @@ import org.springframework.util.ResourceUtils;
import
javax.mail.*
;
import
javax.mail.*
;
import
javax.mail.internet.*
;
import
javax.mail.internet.*
;
import
java.io.*
;
import
java.io.*
;
import
java.security.Security
;
import
java.util.*
;
import
java.util.*
;
import
static
cn
.
escheduler
.
alert
.
utils
.
PropertyUtils
.
getInt
;
import
static
cn
.
escheduler
.
alert
.
utils
.
PropertyUtils
.
getInt
;
...
@@ -58,6 +59,10 @@ public class MailUtils {
...
@@ -58,6 +59,10 @@ public class MailUtils {
public
static
final
String
xlsFilePath
=
getString
(
Constants
.
XLS_FILE_PATH
);
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
;
private
static
Template
MAIL_TEMPLATE
;
static
{
static
{
...
@@ -122,7 +127,10 @@ public class MailUtils {
...
@@ -122,7 +127,10 @@ public class MailUtils {
//set charset
//set charset
email
.
setCharset
(
Constants
.
UTF_8
);
email
.
setCharset
(
Constants
.
UTF_8
);
// TLS verification
// TLS verification
email
.
setTLS
(
true
);
email
.
setTLS
(
Boolean
.
valueOf
(
starttlsEnable
));
// SSL verification
email
.
setSSL
(
Boolean
.
valueOf
(
sslEnable
));
if
(
CollectionUtils
.
isNotEmpty
(
receivers
)){
if
(
CollectionUtils
.
isNotEmpty
(
receivers
)){
// receivers mail
// receivers mail
for
(
String
receiver
:
receivers
)
{
for
(
String
receiver
:
receivers
)
{
...
@@ -269,11 +277,15 @@ public class MailUtils {
...
@@ -269,11 +277,15 @@ public class MailUtils {
* @throws MessagingException
* @throws MessagingException
*/
*/
private
static
MimeMessage
getMimeMessage
(
Collection
<
String
>
receivers
)
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
();
Properties
props
=
new
Properties
();
props
.
setProperty
(
Constants
.
MAIL_HOST
,
mailServerHost
);
props
.
setProperty
(
Constants
.
MAIL_HOST
,
mailServerHost
);
props
.
setProperty
(
Constants
.
MAIL_SMTP_AUTH
,
Constants
.
STRING_TRUE
);
props
.
setProperty
(
Constants
.
MAIL_SMTP_AUTH
,
Constants
.
STRING_TRUE
);
props
.
setProperty
(
Constants
.
MAIL_TRANSPORT_PROTOCOL
,
mailProtocol
);
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
()
{
Authenticator
auth
=
new
Authenticator
()
{
@Override
@Override
protected
PasswordAuthentication
getPasswordAuthentication
()
{
protected
PasswordAuthentication
getPasswordAuthentication
()
{
...
...
escheduler-alert/src/main/resources/alert.properties
浏览文件 @
ae8076a7
...
@@ -8,6 +8,11 @@ mail.server.port=25
...
@@ -8,6 +8,11 @@ mail.server.port=25
mail.sender
=
xxxxxxx
mail.sender
=
xxxxxxx
mail.passwd
=
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,need create if not exist
xls.file.path
=
/tmp/xls
xls.file.path
=
/tmp/xls
...
...
escheduler-api/src/main/java/cn/escheduler/api/service/UsersService.java
浏览文件 @
ae8076a7
...
@@ -115,6 +115,9 @@ public class UsersService extends BaseService {
...
@@ -115,6 +115,9 @@ public class UsersService extends BaseService {
user
.
setUserType
(
UserType
.
GENERAL_USER
);
user
.
setUserType
(
UserType
.
GENERAL_USER
);
user
.
setCreateTime
(
now
);
user
.
setCreateTime
(
now
);
user
.
setUpdateTime
(
now
);
user
.
setUpdateTime
(
now
);
if
(
StringUtils
.
isEmpty
(
queue
)){
queue
=
""
;
}
user
.
setQueue
(
queue
);
user
.
setQueue
(
queue
);
// save user
// save user
...
...
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java
浏览文件 @
ae8076a7
...
@@ -203,7 +203,9 @@ public class UserMapperProvider {
...
@@ -203,7 +203,9 @@ public class UserMapperProvider {
public
String
queryUserPaging
(
Map
<
String
,
Object
>
parameter
)
{
public
String
queryUserPaging
(
Map
<
String
,
Object
>
parameter
)
{
return
new
SQL
()
{
return
new
SQL
()
{
{
{
SELECT
(
"u.*,t.tenant_name,q.queue_name"
);
SELECT
(
"u.id,u.user_name,u.user_password,u.user_type,u.email,u.phone,u.tenant_id,u.create_time,u.update_time,t.tenant_name,"
+
"case when u.queue <> '' then u.queue else q.queue_name end as queue,"
+
"q.queue_name"
);
FROM
(
TABLE_NAME
+
" u "
);
FROM
(
TABLE_NAME
+
" u "
);
LEFT_OUTER_JOIN
(
"t_escheduler_tenant t on u.tenant_id = t.id"
);
LEFT_OUTER_JOIN
(
"t_escheduler_tenant t on u.tenant_id = t.id"
);
LEFT_OUTER_JOIN
(
"t_escheduler_queue q on t.queue_id = q.id"
);
LEFT_OUTER_JOIN
(
"t_escheduler_queue q on t.queue_id = q.id"
);
...
@@ -228,7 +230,8 @@ public class UserMapperProvider {
...
@@ -228,7 +230,8 @@ public class UserMapperProvider {
public
String
queryDetailsById
(
Map
<
String
,
Object
>
parameter
)
{
public
String
queryDetailsById
(
Map
<
String
,
Object
>
parameter
)
{
return
new
SQL
()
{
return
new
SQL
()
{
{
{
SELECT
(
"u.*,q.queue_name,t.tenant_name"
);
SELECT
(
"u.*, t.tenant_name,"
+
"case when u.queue <> '' then u.queue else q.queue_name end as queue_name"
);
FROM
(
TABLE_NAME
+
" u,t_escheduler_tenant t,t_escheduler_queue q"
);
FROM
(
TABLE_NAME
+
" u,t_escheduler_tenant t,t_escheduler_queue q"
);
...
...
install.sh
浏览文件 @
ae8076a7
...
@@ -96,6 +96,13 @@ mailSender="xxxxxxxxxx"
...
@@ -96,6 +96,13 @@ mailSender="xxxxxxxxxx"
# 发送人密码
# 发送人密码
mailPassword
=
"xxxxxxxxxx"
mailPassword
=
"xxxxxxxxxx"
# TLS邮件协议支持
starttlsEnable
=
"false"
# SSL邮件协议支持
# 注意:默认开启的是SSL协议,TLS和SSL只能有一个处于true状态
sslEnable
=
"true"
# 下载Excel路径
# 下载Excel路径
xlsFilePath
=
"/tmp/xls"
xlsFilePath
=
"/tmp/xls"
...
@@ -307,6 +314,8 @@ sed -i ${txt} "s#mail.server.host.*#mail.server.host=${mailServerHost}#g" conf/a
...
@@ -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.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.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.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
sed
-i
${
txt
}
"s#xls.file.path.*#xls.file.path=
${
xlsFilePath
}
#g"
conf/alert.properties
...
...
sql/escheduler.sql
浏览文件 @
ae8076a7
...
@@ -426,7 +426,7 @@ CREATE TABLE `t_escheduler_worker_server` (
...
@@ -426,7 +426,7 @@ CREATE TABLE `t_escheduler_worker_server` (
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- Records of t_escheduler_user,user : admin , password : escheduler123
-- 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_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'
);
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录