diff --git a/src/main/java/com/mageddo/dnsproxyserver/config/dataprovider/mapper/ConfigJsonV2EnvsMapper.java b/src/main/java/com/mageddo/dnsproxyserver/config/dataprovider/mapper/ConfigJsonV2EnvsMapper.java index 67f9a14ff..2915ef4e1 100644 --- a/src/main/java/com/mageddo/dnsproxyserver/config/dataprovider/mapper/ConfigJsonV2EnvsMapper.java +++ b/src/main/java/com/mageddo/dnsproxyserver/config/dataprovider/mapper/ConfigJsonV2EnvsMapper.java @@ -20,6 +20,9 @@ public static Config.Env toDomainEnv(ConfigJsonV2.Env env) { } public static List toDomainEntries(List hostnames) { + if (hostnames == null) { + return null; + } return hostnames .stream() .map(ConfigJsonV2EnvsMapper::toDomainEntry) diff --git a/src/main/java/com/mageddo/dnsproxyserver/config/dataprovider/mapper/ConfigJsonV2Mapper.java b/src/main/java/com/mageddo/dnsproxyserver/config/dataprovider/mapper/ConfigJsonV2Mapper.java index 7190b017c..c60e7f43e 100644 --- a/src/main/java/com/mageddo/dnsproxyserver/config/dataprovider/mapper/ConfigJsonV2Mapper.java +++ b/src/main/java/com/mageddo/dnsproxyserver/config/dataprovider/mapper/ConfigJsonV2Mapper.java @@ -48,6 +48,7 @@ public static Config toConfig(ConfigJson json, Path configFileAbsolutePath) { .configPath(configFileAbsolutePath) .solverRemote(toSolverRemote(json)) .solverStub(toSolverStub(json.getSolverStub())) + .activeEnv(json.getActiveEnv()) .envs(json.getEnvs()) .source(Config.Source.JSON) .build(); diff --git a/src/test/resources/configs-test/004.json b/src/test/resources/configs-test/004.json index 39086479c..e405b8c8e 100644 --- a/src/test/resources/configs-test/004.json +++ b/src/test/resources/configs-test/004.json @@ -6,6 +6,9 @@ "dnsServerPort" : 5391, "domain" : "acme", "dpsNetworkAutoConnect" : true, + "envs" : [ { + "name" : "MARROI" + } ], "hostMachineHostname" : "batata.com", "logFile" : "/var/log/dns-proxy-server.log", "logLevel" : "DEBUG",