fix godforsaken nullpointer issue caused by missing ssl config values in default config
This commit is contained in:
@@ -20,6 +20,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.code.gson:gson:2.10.1'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
|
||||
@@ -5,9 +5,9 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import com.gregor_lohaus.gtransfer.config.types.Config;
|
||||
|
||||
// import com.google.gson.Gson;
|
||||
// import com.google.gson.GsonBuilder;
|
||||
import org.springframework.boot.EnvironmentPostProcessor;
|
||||
// import org.springframework.boot.env.EnvironmentPostProcessor;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
|
||||
@@ -41,6 +41,10 @@ public class ConfigEnvironmentPostProcessor implements EnvironmentPostProcessor
|
||||
System.exit(1);
|
||||
}
|
||||
Config defaultConfig = DefaultConfig.config;
|
||||
// Gson gson = new GsonBuilder().setPrettyPrinting().serializeNulls().create();
|
||||
// String json = gson.toJson(defaultConfig);
|
||||
// System.out.println(json);
|
||||
|
||||
table = ConfigSerializer.toToml(defaultConfig);
|
||||
toml.write(CONFIG_FILE_PATH, table);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,8 @@ public class DefaultConfig {
|
||||
svc2.port = 8080;
|
||||
SslConfig ssl = new SslConfig();
|
||||
ssl.enabled = false;
|
||||
ssl.certificatePrivateKey = "";
|
||||
ssl.certificate = "";
|
||||
svc2.sslConfig = ssl;
|
||||
c.serverConfig = svc2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user