fix бага с настройками почты
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM;
|
||||
import Common.Utils.Vector_;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.Vector;
|
||||
public class Constants {
|
||||
@@ -39,6 +40,13 @@ public class Constants {
|
||||
public static final String MailAddress = "sapfor.tracker@internet.ru";
|
||||
// public static final String MailPassword = "3s4w9e5fs3c1a89AA"; основной пароль.
|
||||
public static final String MailPassword = "knKn2PpfrC348ZxHtMnT"; //пароль для сапфора как внешнего приложения.
|
||||
public static final String SMTPHost = "smtp.mail.ru";
|
||||
public static final int SMTPPort = 465;
|
||||
public static final int MailSocketPort = 465;
|
||||
//-
|
||||
public static final String ServerAddress = "alex-freenas.ddns.net";
|
||||
public static final String ServerUserName = "testuser";
|
||||
public static final int ServerUserSHHPort = 23;
|
||||
//--
|
||||
public static final String package_json = "package_json";
|
||||
public static final String results_json = "results_json";
|
||||
|
||||
@@ -28,8 +28,8 @@ public abstract class RepositoryServerSSHPass extends ConnectionPass {
|
||||
userHome = null;
|
||||
serverHome = null;
|
||||
//--
|
||||
machine = new Machine("alex", Global.normalProperties.ServerAddress, Global.normalProperties.ServerUserSHHPort, MachineType.Server);
|
||||
user = new User(Global.normalProperties.ServerUserName, "mprit_2011");
|
||||
machine = new Machine("alex", Constants.ServerAddress, Constants.ServerUserSHHPort, MachineType.Server);
|
||||
user = new User(Constants.ServerUserName, "mprit_2011");
|
||||
super.Connect();
|
||||
//--
|
||||
userHome = new RemoteFile(user.connection.sftpChannel.getHome(), true);
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Database.RepositoryRefuseException;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Passes.PassException;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Repository.RepositoryServer;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
@@ -37,7 +38,7 @@ public abstract class RepositoryPass<S extends RepositoryServer, T> extends Pass
|
||||
}
|
||||
//-
|
||||
protected void connect() throws Exception {
|
||||
clientSocket = Utils.createClientSocket(InetAddress.getByName(Global.properties.ServerAddress),
|
||||
clientSocket = Utils.createClientSocket(InetAddress.getByName(Constants.ServerAddress),
|
||||
server.getPort(),
|
||||
getTimeout()
|
||||
);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Visualiser extends Component {
|
||||
public ComponentType getComponentType() {
|
||||
return ComponentType.Visualiser;
|
||||
}
|
||||
//</editor-fold>
|
||||
//</editor-fold> //репозиторий не найден
|
||||
//<editor-fold desc="Методы">
|
||||
//</editor-// fold>
|
||||
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
||||
|
||||
@@ -87,14 +87,14 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
Thread thread = new Thread(() -> {
|
||||
try {
|
||||
Properties props = new Properties();
|
||||
props.put("mail.smtp.host", Global.normalProperties.SMTPHost);
|
||||
props.put("mail.smtp.host", Constants.SMTPHost);
|
||||
props.put("mail.smtp.auth", "true");
|
||||
props.put("mail.smtp.port", String.valueOf(Global.normalProperties.SMTPPort));
|
||||
props.put("mail.smtp.socketFactory.port", String.valueOf(Global.normalProperties.MailSocketPort));
|
||||
props.put("mail.smtp.port", String.valueOf(Constants.SMTPPort));
|
||||
props.put("mail.smtp.socketFactory.port", String.valueOf(Constants.MailSocketPort));
|
||||
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
|
||||
props.put("mail.smtp.connectiontimeout", String.valueOf(Global.normalProperties.SocketTimeout));
|
||||
props.put("mail.smtp.timeout", String.valueOf(Global.normalProperties.SocketTimeout));
|
||||
props.put("mail.smtp.writetimeout", String.valueOf(Global.normalProperties.SocketTimeout));
|
||||
props.put("mail.smtp.connectiontimeout", String.valueOf(Global.properties.SocketTimeout));
|
||||
props.put("mail.smtp.timeout", String.valueOf(Global.properties.SocketTimeout));
|
||||
props.put("mail.smtp.writetimeout", String.valueOf(Global.properties.SocketTimeout));
|
||||
//------------------------------
|
||||
LinkedHashMap<String, File> innerFiles = new LinkedHashMap<>();
|
||||
for (String aName : message_in.files.keySet()) {
|
||||
|
||||
@@ -79,7 +79,7 @@ public class MachineProcess extends DBObject {
|
||||
boolean local = false;
|
||||
try {
|
||||
InetAddress address = InetAddress.getByName(machineAddress);
|
||||
InetAddress localAddress = InetAddress.getByName(Global.normalProperties.ServerAddress);
|
||||
InetAddress localAddress = InetAddress.getByName(Constants.ServerAddress);
|
||||
local = localAddress.getHostAddress().equals(address.getHostAddress());
|
||||
} catch (Exception ex) {
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
|
||||
@@ -8,25 +8,12 @@ public class VisualDVMProperties extends Properties {
|
||||
public _VisualDVM.Mode Mode = _VisualDVM.Mode.Normal;
|
||||
//---
|
||||
@Expose
|
||||
public String ServerAddress = "alex-freenas.ddns.net";
|
||||
@Expose
|
||||
public String ServerUserName = "testuser";
|
||||
@Expose
|
||||
public int ServerUserSHHPort = 23;
|
||||
@Expose
|
||||
public int ComponentsServerPort = 7995;
|
||||
@Expose
|
||||
public int TestingServerPort = 7998;
|
||||
@Expose
|
||||
public int SocketTimeout = 5000;
|
||||
//--email
|
||||
@Expose
|
||||
public String SMTPHost = "smtp.mail.ru";
|
||||
@Expose
|
||||
public int SMTPPort = 465;
|
||||
@Expose
|
||||
public int MailSocketPort = 465;
|
||||
//---
|
||||
//--
|
||||
public VisualDVMProperties() {
|
||||
}
|
||||
public VisualDVMProperties(_VisualDVM.Mode mode_in, File file_in) {
|
||||
@@ -36,14 +23,8 @@ public class VisualDVMProperties extends Properties {
|
||||
//---
|
||||
public VisualDVMProperties(VisualDVMProperties src) {
|
||||
Mode = src.Mode;
|
||||
ServerAddress = src.ServerAddress;
|
||||
ServerUserName = src.ServerUserName;
|
||||
ServerUserSHHPort = src.ServerUserSHHPort;
|
||||
ComponentsServerPort = src.ComponentsServerPort;
|
||||
TestingServerPort = src.TestingServerPort;
|
||||
SocketTimeout = src.SocketTimeout;
|
||||
SMTPHost = src.SMTPHost;
|
||||
SMTPPort = src.SMTPPort;
|
||||
MailSocketPort = src.MailSocketPort;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user