From 813c0c65f36e56b62e204ff1feae6f880f1e455b Mon Sep 17 00:00:00 2001 From: qiaozhanwei Date: Thu, 4 Apr 2019 11:38:34 +0800 Subject: [PATCH 1/2] 1,outllok email TLS support 2,api-server and master-server start jar conflict 3,gRPC jar conflict 4,tenant create if not exists --- .../main/java/cn/escheduler/alert/utils/Constants.java | 2 ++ .../main/java/cn/escheduler/alert/utils/MailUtils.java | 3 +++ escheduler-common/pom.xml | 8 ++++++++ .../escheduler/server/worker/runner/FetchTaskThread.java | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/escheduler-alert/src/main/java/cn/escheduler/alert/utils/Constants.java b/escheduler-alert/src/main/java/cn/escheduler/alert/utils/Constants.java index 1f036af54b..07d1866a5d 100644 --- a/escheduler-alert/src/main/java/cn/escheduler/alert/utils/Constants.java +++ b/escheduler-alert/src/main/java/cn/escheduler/alert/utils/Constants.java @@ -57,6 +57,8 @@ public class Constants { public static final String MAIL_TRANSPORT_PROTOCOL = "mail.transport.protocol"; + public static final String MAIL_SMTP_STARTTLS_ENABLE = "mail.smtp.starttls.enable"; + public static final String TEXT_HTML_CHARSET_UTF_8 = "text/html;charset=utf-8"; public static final String STRING_TRUE = "true"; diff --git a/escheduler-alert/src/main/java/cn/escheduler/alert/utils/MailUtils.java b/escheduler-alert/src/main/java/cn/escheduler/alert/utils/MailUtils.java index 7746465e62..42fbebd2f2 100644 --- a/escheduler-alert/src/main/java/cn/escheduler/alert/utils/MailUtils.java +++ b/escheduler-alert/src/main/java/cn/escheduler/alert/utils/MailUtils.java @@ -117,6 +117,8 @@ public class MailUtils { email.setSmtpPort(mailServerPort); //set charset email.setCharset(Constants.UTF_8); + // TLS verification + email.setTLS(true); if (CollectionUtils.isNotEmpty(receivers)){ // receivers mail for (String receiver : receivers) { @@ -267,6 +269,7 @@ public class MailUtils { 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); Authenticator auth = new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { diff --git a/escheduler-common/pom.xml b/escheduler-common/pom.xml index 9cbc80b83f..719d46fc1a 100644 --- a/escheduler-common/pom.xml +++ b/escheduler-common/pom.xml @@ -148,6 +148,10 @@ javax.servlet.jsp jsp-api + + com.google.protobuf + protobuf-java + @@ -340,6 +344,10 @@ log4j-slf4j-impl org.apache.logging.log4j + + javax.servlet + org.eclipse.jetty.orbit + diff --git a/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java b/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java index 50402d4a3b..6a28e1bbdf 100644 --- a/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java +++ b/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java @@ -170,7 +170,7 @@ public class FetchTaskThread implements Runnable{ // check and create Linux users FileUtils.createWorkDirAndUserIfAbsent(execLocalPath, - processDefine.getUserName(), logger); + processInstance.getTenantCode(), logger); // submit task From a3952ea6cc6746357a5487edf0af9181920a1eb3 Mon Sep 17 00:00:00 2001 From: qiaozhanwei Date: Thu, 4 Apr 2019 13:56:49 +0800 Subject: [PATCH 2/2] update servlet jar conflict --- escheduler-common/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/escheduler-common/pom.xml b/escheduler-common/pom.xml index 719d46fc1a..e06b344c4f 100644 --- a/escheduler-common/pom.xml +++ b/escheduler-common/pom.xml @@ -348,6 +348,10 @@ javax.servlet org.eclipse.jetty.orbit + + servlet-api-2.5 + org.mortbay.jetty +