Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-28 17:10:19 +01:00
DumpInfo: Mark internal IP as sensitive (#1264)
Sometimes the internal IP is the external IP of the server.
Dieser Commit ist enthalten in:
Ursprung
b13f5e900f
Commit
1e1402a23f
@ -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,16 +113,21 @@ public class DumpInfo {
|
|||||||
private final boolean dockerCheck;
|
private final boolean dockerCheck;
|
||||||
|
|
||||||
NetworkInfo() {
|
NetworkInfo() {
|
||||||
try {
|
if (AsteriskSerializer.showSensitive) {
|
||||||
// This is the most reliable for getting the main local IP
|
|
||||||
Socket socket = new Socket();
|
|
||||||
socket.connect(new InetSocketAddress("geysermc.org", 80));
|
|
||||||
this.internalIP = socket.getLocalAddress().getHostAddress();
|
|
||||||
} catch (IOException e1) {
|
|
||||||
try {
|
try {
|
||||||
// Fallback to the normal way of getting the local IP
|
// This is the most reliable for getting the main local IP
|
||||||
this.internalIP = InetAddress.getLocalHost().getHostAddress();
|
Socket socket = new Socket();
|
||||||
} catch (UnknownHostException ignored) { }
|
socket.connect(new InetSocketAddress("geysermc.org", 80));
|
||||||
|
this.internalIP = socket.getLocalAddress().getHostAddress();
|
||||||
|
} catch (IOException e1) {
|
||||||
|
try {
|
||||||
|
// Fallback to the normal way of getting the local IP
|
||||||
|
this.internalIP = InetAddress.getLocalHost().getHostAddress();
|
||||||
|
} catch (UnknownHostException ignored) { }
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Sometimes the internal IP is the external IP...
|
||||||
|
this.internalIP = "***";
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dockerCheck = DockerCheck.checkBasic();
|
this.dockerCheck = DockerCheck.checkBasic();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren