fix бага с настройками почты

This commit is contained in:
2025-01-23 17:40:52 +03:00
parent 6c0c103804
commit 94208ec25c
9 changed files with 25 additions and 40 deletions

1
.gitignore vendored
View File

@@ -36,6 +36,7 @@ BackUps/*
*.ilk *.ilk
Bugs/* Bugs/*
Archives/* Archives/*
Downloads/*
Temp/* Temp/*
Projects/* Projects/*
CompilationTasks/* CompilationTasks/*

View File

@@ -1,6 +1,6 @@
{ {
"Workspace": "E:\\Tests", "Workspace": "E:\\Tests",
"ProjectsSearchDirectory": "C:\\Users\\misha\\Documents\\visual_sapfor_2023\\Downloads", "ProjectsSearchDirectory": "C:\\Users\\misha\\Documents\\visual_sapfor_2023\\Downloads\\JAC_1737641430\\JAC\\v1\\v1\\v1",
"VisualiserPath": "C:\\Users\\misha\\Downloads", "VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F", "Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
"Visualizer_2Path": "C:\\Users\\misha\\Documents", "Visualizer_2Path": "C:\\Users\\misha\\Documents",
@@ -23,7 +23,7 @@
"LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe", "LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe",
"CheckTestingIntervalSeconds": 10, "CheckTestingIntervalSeconds": 10,
"AutoCheckTesting": true, "AutoCheckTesting": true,
"EmailOnTestingProgress": false, "EmailOnTestingProgress": true,
"lastMachineId": 13, "lastMachineId": 13,
"lastUserId": 34, "lastUserId": 34,
"lastCompilerId": 52, "lastCompilerId": 52,
@@ -40,13 +40,7 @@
"FastAccessPassesCount": 10, "FastAccessPassesCount": 10,
"LastOpenedProjectsCount": 10, "LastOpenedProjectsCount": 10,
"Mode": "Normal", "Mode": "Normal",
"ServerAddress": "alex-freenas.ddns.net",
"ServerUserName": "testuser",
"ServerUserSHHPort": 2000,
"ComponentsServerPort": 7995, "ComponentsServerPort": 7995,
"TestingServerPort": 7998, "TestingServerPort": 7998,
"SocketTimeout": 5000, "SocketTimeout": 5000
"SMTPHost": "smtp.mail.ru",
"SMTPPort": 465,
"MailSocketPort": 465
} }

View File

@@ -1,5 +1,6 @@
package _VisualDVM; package _VisualDVM;
import Common.Utils.Vector_; import Common.Utils.Vector_;
import com.google.gson.annotations.Expose;
import java.util.Vector; import java.util.Vector;
public class Constants { public class Constants {
@@ -39,6 +40,13 @@ public class Constants {
public static final String MailAddress = "sapfor.tracker@internet.ru"; public static final String MailAddress = "sapfor.tracker@internet.ru";
// public static final String MailPassword = "3s4w9e5fs3c1a89AA"; основной пароль. // public static final String MailPassword = "3s4w9e5fs3c1a89AA"; основной пароль.
public static final String MailPassword = "knKn2PpfrC348ZxHtMnT"; //пароль для сапфора как внешнего приложения. 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 package_json = "package_json";
public static final String results_json = "results_json"; public static final String results_json = "results_json";

View File

@@ -28,8 +28,8 @@ public abstract class RepositoryServerSSHPass extends ConnectionPass {
userHome = null; userHome = null;
serverHome = null; serverHome = null;
//-- //--
machine = new Machine("alex", Global.normalProperties.ServerAddress, Global.normalProperties.ServerUserSHHPort, MachineType.Server); machine = new Machine("alex", Constants.ServerAddress, Constants.ServerUserSHHPort, MachineType.Server);
user = new User(Global.normalProperties.ServerUserName, "mprit_2011"); user = new User(Constants.ServerUserName, "mprit_2011");
super.Connect(); super.Connect();
//-- //--
userHome = new RemoteFile(user.connection.sftpChannel.getHome(), true); userHome = new RemoteFile(user.connection.sftpChannel.getHome(), true);

View File

@@ -4,6 +4,7 @@ import Common.Database.RepositoryRefuseException;
import Common.Passes.Pass; import Common.Passes.Pass;
import Common.Passes.PassException; import Common.Passes.PassException;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import _VisualDVM.Constants;
import _VisualDVM.Global; import _VisualDVM.Global;
import _VisualDVM.Repository.RepositoryServer; import _VisualDVM.Repository.RepositoryServer;
import _VisualDVM.Repository.Server.ServerCode; import _VisualDVM.Repository.Server.ServerCode;
@@ -37,7 +38,7 @@ public abstract class RepositoryPass<S extends RepositoryServer, T> extends Pass
} }
//- //-
protected void connect() throws Exception { protected void connect() throws Exception {
clientSocket = Utils.createClientSocket(InetAddress.getByName(Global.properties.ServerAddress), clientSocket = Utils.createClientSocket(InetAddress.getByName(Constants.ServerAddress),
server.getPort(), server.getPort(),
getTimeout() getTimeout()
); );

View File

@@ -54,7 +54,7 @@ public class Visualiser extends Component {
public ComponentType getComponentType() { public ComponentType getComponentType() {
return ComponentType.Visualiser; return ComponentType.Visualiser;
} }
//</editor-fold> //</editor-fold> //репозиторий не найден
//<editor-fold desc="Методы"> //<editor-fold desc="Методы">
//</editor-// fold> //</editor-// fold>
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html //http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html

View File

@@ -87,14 +87,14 @@ public abstract class RepositoryServer<D extends Database> {
Thread thread = new Thread(() -> { Thread thread = new Thread(() -> {
try { try {
Properties props = new Properties(); 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.auth", "true");
props.put("mail.smtp.port", String.valueOf(Global.normalProperties.SMTPPort)); props.put("mail.smtp.port", String.valueOf(Constants.SMTPPort));
props.put("mail.smtp.socketFactory.port", String.valueOf(Global.normalProperties.MailSocketPort)); props.put("mail.smtp.socketFactory.port", String.valueOf(Constants.MailSocketPort));
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.connectiontimeout", String.valueOf(Global.normalProperties.SocketTimeout)); props.put("mail.smtp.connectiontimeout", String.valueOf(Global.properties.SocketTimeout));
props.put("mail.smtp.timeout", String.valueOf(Global.normalProperties.SocketTimeout)); props.put("mail.smtp.timeout", String.valueOf(Global.properties.SocketTimeout));
props.put("mail.smtp.writetimeout", String.valueOf(Global.normalProperties.SocketTimeout)); props.put("mail.smtp.writetimeout", String.valueOf(Global.properties.SocketTimeout));
//------------------------------ //------------------------------
LinkedHashMap<String, File> innerFiles = new LinkedHashMap<>(); LinkedHashMap<String, File> innerFiles = new LinkedHashMap<>();
for (String aName : message_in.files.keySet()) { for (String aName : message_in.files.keySet()) {

View File

@@ -79,7 +79,7 @@ public class MachineProcess extends DBObject {
boolean local = false; boolean local = false;
try { try {
InetAddress address = InetAddress.getByName(machineAddress); InetAddress address = InetAddress.getByName(machineAddress);
InetAddress localAddress = InetAddress.getByName(Global.normalProperties.ServerAddress); InetAddress localAddress = InetAddress.getByName(Constants.ServerAddress);
local = localAddress.getHostAddress().equals(address.getHostAddress()); local = localAddress.getHostAddress().equals(address.getHostAddress());
} catch (Exception ex) { } catch (Exception ex) {
Utils_.MainLog.PrintException(ex); Utils_.MainLog.PrintException(ex);

View File

@@ -8,25 +8,12 @@ public class VisualDVMProperties extends Properties {
public _VisualDVM.Mode Mode = _VisualDVM.Mode.Normal; public _VisualDVM.Mode Mode = _VisualDVM.Mode.Normal;
//--- //---
@Expose @Expose
public String ServerAddress = "alex-freenas.ddns.net";
@Expose
public String ServerUserName = "testuser";
@Expose
public int ServerUserSHHPort = 23;
@Expose
public int ComponentsServerPort = 7995; public int ComponentsServerPort = 7995;
@Expose @Expose
public int TestingServerPort = 7998; public int TestingServerPort = 7998;
@Expose @Expose
public int SocketTimeout = 5000; 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() {
} }
public VisualDVMProperties(_VisualDVM.Mode mode_in, File file_in) { public VisualDVMProperties(_VisualDVM.Mode mode_in, File file_in) {
@@ -36,14 +23,8 @@ public class VisualDVMProperties extends Properties {
//--- //---
public VisualDVMProperties(VisualDVMProperties src) { public VisualDVMProperties(VisualDVMProperties src) {
Mode = src.Mode; Mode = src.Mode;
ServerAddress = src.ServerAddress;
ServerUserName = src.ServerUserName;
ServerUserSHHPort = src.ServerUserSHHPort;
ComponentsServerPort = src.ComponentsServerPort; ComponentsServerPort = src.ComponentsServerPort;
TestingServerPort = src.TestingServerPort; TestingServerPort = src.TestingServerPort;
SocketTimeout = src.SocketTimeout; SocketTimeout = src.SocketTimeout;
SMTPHost = src.SMTPHost;
SMTPPort = src.SMTPPort;
MailSocketPort = src.MailSocketPort;
} }
} }