2019-06-02 05:03:08 +03:00
|
|
|
package pro.gravit.launchserver.config;
|
2019-04-12 00:58:45 +03:00
|
|
|
|
2021-05-10 10:34:27 +03:00
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
import org.apache.logging.log4j.Logger;
|
2019-06-02 05:03:08 +03:00
|
|
|
import pro.gravit.utils.helper.LogHelper;
|
|
|
|
import pro.gravit.utils.helper.SecurityHelper;
|
2019-04-12 00:58:45 +03:00
|
|
|
|
|
|
|
public class LaunchServerRuntimeConfig {
|
2019-10-16 12:38:44 +03:00
|
|
|
public String passwordEncryptKey;
|
2021-04-26 18:21:28 +03:00
|
|
|
public String runtimeEncryptKey;
|
2019-05-22 01:32:40 +03:00
|
|
|
public String oemUnlockKey;
|
2019-07-01 10:54:33 +03:00
|
|
|
public String registerApiKey;
|
2019-09-29 11:40:26 +03:00
|
|
|
public String clientCheckSecret;
|
2021-05-10 10:34:27 +03:00
|
|
|
private transient final Logger logger = LogManager.getLogger();
|
2019-05-15 14:11:22 +03:00
|
|
|
|
|
|
|
public void verify() {
|
2021-05-10 10:34:27 +03:00
|
|
|
if (passwordEncryptKey == null) logger.error("[RuntimeConfig] passwordEncryptKey must not be null");
|
2019-10-19 19:46:04 +03:00
|
|
|
if (clientCheckSecret == null) {
|
2021-05-10 10:34:27 +03:00
|
|
|
logger.warn("[RuntimeConfig] clientCheckSecret must not be null");
|
2019-10-19 19:46:04 +03:00
|
|
|
clientCheckSecret = SecurityHelper.randomStringToken();
|
|
|
|
}
|
2019-04-12 00:58:45 +03:00
|
|
|
}
|
2019-05-15 14:11:22 +03:00
|
|
|
|
|
|
|
public void reset() {
|
2019-10-16 12:38:44 +03:00
|
|
|
passwordEncryptKey = SecurityHelper.randomStringToken();
|
2021-04-26 18:21:28 +03:00
|
|
|
runtimeEncryptKey = SecurityHelper.randomStringAESKey();
|
2019-07-01 10:54:33 +03:00
|
|
|
registerApiKey = SecurityHelper.randomStringToken();
|
2019-09-29 11:40:26 +03:00
|
|
|
clientCheckSecret = SecurityHelper.randomStringToken();
|
2019-04-12 00:58:45 +03:00
|
|
|
}
|
|
|
|
}
|