Skip to content

Commit c52684e

Browse files
authored
Merge pull request #208 from CloudNetService/installer-fix
Fix wrong ip as hostAddress on first setup
2 parents 44f3aac + c5977aa commit c52684e

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

cloudnet/src/main/java/de/dytanic/cloudnet/DefaultInstallation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public List<String> getCompletableAnswers() {
198198
if (animation.hasResult("internalHost")) {
199199
HostAndPort defaultHost = (HostAndPort) animation.getResult("internalHost");
200200

201-
this.cloudNet.getConfig().setDefaultHostAddress(defaultHost.getHost());
201+
this.cloudNet.getConfig().setHostAddress(defaultHost.getHost());
202202
this.cloudNet.getConfig().setIdentity(new NetworkClusterNode(
203203
animation.hasResult("nodeId") ? (String) animation.getResult("nodeId") : "Node-" + UUID.randomUUID().toString().split("-")[0],
204204
new HostAndPort[]{defaultHost}

cloudnet/src/main/java/de/dytanic/cloudnet/conf/IConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public interface IConfiguration {
1818

1919
String getHostAddress();
2020

21+
void setHostAddress(String hostAddress);
22+
2123
NetworkClusterNode getIdentity();
2224

2325
void setIdentity(NetworkClusterNode identity);

cloudnet/src/main/java/de/dytanic/cloudnet/conf/JsonConfiguration.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public final class JsonConfiguration implements IConfiguration {
2626
}.getType(),
2727
CLUSTER = new TypeToken<NetworkCluster>() {
2828
}.getType(),
29-
COLLECTION_STRING = new TypeToken<Collection<String>>() {
29+
SET_STRING = new TypeToken<Set<String>>() {
3030
}.getType(),
3131
HOST_AND_PORT_COLLECTION = new TypeToken<Collection<HostAndPort>>() {
3232
}.getType();
@@ -105,7 +105,7 @@ public void load() {
105105
addresses.addAll(Arrays.asList(System.getenv("CLOUDNET_DEFAULT_IP_WHITELIST").split(",")));
106106
}
107107

108-
this.ipWhitelist = this.document.get("ipWhitelist", COLLECTION_STRING, addresses);
108+
this.ipWhitelist = this.document.get("ipWhitelist", SET_STRING, addresses);
109109

110110
this.clusterConfig = this.document.get("cluster", CLUSTER, new NetworkCluster(
111111
System.getenv("CLOUDNET_CLUSTER_ID") != null ?
@@ -303,6 +303,11 @@ public void setHttpListeners(Collection<HostAndPort> httpListeners) {
303303
this.save();
304304
}
305305

306+
@Override
307+
public void setHostAddress(String hostAddress) {
308+
this.hostAddress = hostAddress;
309+
}
310+
306311
public ConfigurationOptionSSL getClientSslConfig() {
307312
return this.clientSslConfig;
308313
}

0 commit comments

Comments
 (0)