mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
DumpInfo: Mark internal IP as sensitive (#1264)
Sometimes the internal IP is the external IP of the server.
This commit is contained in:
parent
b13f5e900f
commit
1e1402a23f
1 changed files with 15 additions and 9 deletions
|
@ -31,6 +31,7 @@ import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.geysermc.connector.GeyserConnector;
|
import org.geysermc.connector.GeyserConnector;
|
||||||
|
import org.geysermc.connector.common.serializer.AsteriskSerializer;
|
||||||
import org.geysermc.connector.configuration.GeyserConfiguration;
|
import org.geysermc.connector.configuration.GeyserConfiguration;
|
||||||
import org.geysermc.connector.network.BedrockProtocol;
|
import org.geysermc.connector.network.BedrockProtocol;
|
||||||
import org.geysermc.connector.network.session.GeyserSession;
|
import org.geysermc.connector.network.session.GeyserSession;
|
||||||
|
@ -112,6 +113,7 @@ public class DumpInfo {
|
||||||
private final boolean dockerCheck;
|
private final boolean dockerCheck;
|
||||||
|
|
||||||
NetworkInfo() {
|
NetworkInfo() {
|
||||||
|
if (AsteriskSerializer.showSensitive) {
|
||||||
try {
|
try {
|
||||||
// This is the most reliable for getting the main local IP
|
// This is the most reliable for getting the main local IP
|
||||||
Socket socket = new Socket();
|
Socket socket = new Socket();
|
||||||
|
@ -123,6 +125,10 @@ public class DumpInfo {
|
||||||
this.internalIP = InetAddress.getLocalHost().getHostAddress();
|
this.internalIP = InetAddress.getLocalHost().getHostAddress();
|
||||||
} catch (UnknownHostException ignored) { }
|
} catch (UnknownHostException ignored) { }
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Sometimes the internal IP is the external IP...
|
||||||
|
this.internalIP = "***";
|
||||||
|
}
|
||||||
|
|
||||||
this.dockerCheck = DockerCheck.checkBasic();
|
this.dockerCheck = DockerCheck.checkBasic();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue