diff --git a/BlueMapBukkit/src/main/resources/bluemap-bukkit.conf b/BlueMapBukkit/src/main/resources/bluemap-bukkit.conf index d5070bb3..c3a60ee9 100644 --- a/BlueMapBukkit/src/main/resources/bluemap-bukkit.conf +++ b/BlueMapBukkit/src/main/resources/bluemap-bukkit.conf @@ -47,8 +47,9 @@ webserver { enabled: true # The IP-Adress that the webserver binds to. - # If this setting is commented out, bluemap tries to find the default ip-adress of your system. + # Use "0.0.0.0" to bind to all available local adresses. # If you only want to access it locally use "localhost". + # Default is "0.0.0.0" #ip: "localhost" #ip: "127.0.0.1" diff --git a/BlueMapCLI/src/main/resources/bluemap-cli.conf b/BlueMapCLI/src/main/resources/bluemap-cli.conf index d2e1ee4f..5ee2904e 100644 --- a/BlueMapCLI/src/main/resources/bluemap-cli.conf +++ b/BlueMapCLI/src/main/resources/bluemap-cli.conf @@ -44,10 +44,11 @@ webserver { # With this setting you can enable the integrated web-server. # Default is disabled enabled: false - + # The IP-Adress that the webserver binds to. - # If this setting is commented out, bluemap tries to find the default ip-adress of your system. + # Use "0.0.0.0" to bind to all available local adresses. # If you only want to access it locally use "localhost". + # Default is "0.0.0.0" #ip: "localhost" #ip: "127.0.0.1" diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/config/MainConfig.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/config/MainConfig.java index 767be0d4..1e1b820e 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/config/MainConfig.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/config/MainConfig.java @@ -27,6 +27,7 @@ import java.io.File; import java.io.IOException; import java.net.InetAddress; +import java.net.InetSocketAddress; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -109,7 +110,9 @@ private void loadWebConfig(ConfigurationNode node) throws IOException { if (webserverEnabled) { //ip String webserverBindAdressString = node.getNode("ip").getString(""); - if (webserverBindAdressString.isEmpty()) { + if (webserverBindAdressString.isEmpty() || webserverBindAdressString.equals("0.0.0.0") || webserverBindAdressString.equals("::0")) { + webserverBindAdress = new InetSocketAddress(0).getAddress(); // 0.0.0.0 + } else if (webserverBindAdressString.equals("#getLocalHost")) { webserverBindAdress = InetAddress.getLocalHost(); } else { webserverBindAdress = InetAddress.getByName(webserverBindAdressString); diff --git a/BlueMapCore/src/main/webroot/js/libs/BlueMap.js b/BlueMapCore/src/main/webroot/js/libs/BlueMap.js index 235510f7..d91d423b 100644 --- a/BlueMapCore/src/main/webroot/js/libs/BlueMap.js +++ b/BlueMapCore/src/main/webroot/js/libs/BlueMap.js @@ -110,7 +110,7 @@ export default class BlueMap { await this.ui.load(); this.start(); }).catch(error => { - this.onLoadError("Initialization: " + error.toString()); + this.onLoadError("Initialization: " + (error ? error.toString() : "unknown")); }); } diff --git a/BlueMapFabric/src/main/resources/bluemap-fabric.conf b/BlueMapFabric/src/main/resources/bluemap-fabric.conf index 8b740ce2..af9edf92 100644 --- a/BlueMapFabric/src/main/resources/bluemap-fabric.conf +++ b/BlueMapFabric/src/main/resources/bluemap-fabric.conf @@ -47,8 +47,9 @@ webserver { enabled: true # The IP-Adress that the webserver binds to. - # If this setting is commented out, bluemap tries to find the default ip-adress of your system. + # Use "0.0.0.0" to bind to all available local adresses. # If you only want to access it locally use "localhost". + # Default is "0.0.0.0" #ip: "localhost" #ip: "127.0.0.1" diff --git a/BlueMapForge/src/main/resources/bluemap-forge.conf b/BlueMapForge/src/main/resources/bluemap-forge.conf index 8b740ce2..af9edf92 100644 --- a/BlueMapForge/src/main/resources/bluemap-forge.conf +++ b/BlueMapForge/src/main/resources/bluemap-forge.conf @@ -47,8 +47,9 @@ webserver { enabled: true # The IP-Adress that the webserver binds to. - # If this setting is commented out, bluemap tries to find the default ip-adress of your system. + # Use "0.0.0.0" to bind to all available local adresses. # If you only want to access it locally use "localhost". + # Default is "0.0.0.0" #ip: "localhost" #ip: "127.0.0.1" diff --git a/BlueMapSponge/src/main/resources/bluemap-sponge.conf b/BlueMapSponge/src/main/resources/bluemap-sponge.conf index 22784691..c97e6ea8 100644 --- a/BlueMapSponge/src/main/resources/bluemap-sponge.conf +++ b/BlueMapSponge/src/main/resources/bluemap-sponge.conf @@ -42,8 +42,9 @@ webserver { enabled: true # The IP-Adress that the webserver binds to. - # If this setting is commented out, bluemap tries to find the default ip-adress of your system. + # Use "0.0.0.0" to bind to all available local adresses. # If you only want to access it locally use "localhost". + # Default is "0.0.0.0" #ip: "localhost" #ip: "127.0.0.1"