[FIX] Функциональность сертификатов обернута

This commit is contained in:
Gravit 2019-08-13 21:13:51 +07:00
parent d0c16f2835
commit ed239cc3c2
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -157,6 +157,7 @@ public AuthProviderPair getAuthProviderPair() {
public String whitelistRejectString; public String whitelistRejectString;
public LauncherConf launcher; public LauncherConf launcher;
public CertificateConf certificate;
public String startScript; public String startScript;
@ -269,6 +270,11 @@ public static class ExeConf {
public String txtProductVersion; public String txtProductVersion;
} }
public static class CertificateConf
{
public boolean enabled;
}
public static class NettyUpdatesBind { public static class NettyUpdatesBind {
public String url; public String url;
public boolean zip; public boolean zip;
@ -608,6 +614,8 @@ public LaunchServer(Path dir, boolean testEnv, String[] args) throws IOException
certificateManager = new CertificateManager(); certificateManager = new CertificateManager();
//Generate or set new Certificate API //Generate or set new Certificate API
certificateManager.orgName = config.projectName; certificateManager.orgName = config.projectName;
if(config.certificate != null && config.certificate.enabled)
{
if(IOHelper.isFile(caCertFile) && IOHelper.isFile(caKeyFile)) if(IOHelper.isFile(caCertFile) && IOHelper.isFile(caKeyFile))
{ {
certificateManager.ca = certificateManager.readCertificate(caCertFile); certificateManager.ca = certificateManager.readCertificate(caCertFile);
@ -640,7 +648,7 @@ public LaunchServer(Path dir, boolean testEnv, String[] args) throws IOException
LogHelper.error(e); LogHelper.error(e);
} }
} }
}
GarbageManager.registerNeedGC(sessionManager); GarbageManager.registerNeedGC(sessionManager);
reloadManager.registerReloadable("launchServer", this); reloadManager.registerReloadable("launchServer", this);
registerObject("permissionsHandler", config.permissionsHandler); registerObject("permissionsHandler", config.permissionsHandler);
@ -816,6 +824,9 @@ private void generateConfigIfNotExists(boolean testEnv) throws IOException {
newConfig.launcher.stripLineNumbers = true; newConfig.launcher.stripLineNumbers = true;
newConfig.launcher.proguardGenMappings = true; newConfig.launcher.proguardGenMappings = true;
newConfig.certificate = new CertificateConf();
newConfig.certificate.enabled = false;
newConfig.components = new HashMap<>(); newConfig.components = new HashMap<>();
AuthLimiterComponent authLimiterComponent = new AuthLimiterComponent(); AuthLimiterComponent authLimiterComponent = new AuthLimiterComponent();
authLimiterComponent.rateLimit = 3; authLimiterComponent.rateLimit = 3;