Fix Xbox authentication and add support for proxies (#1162)

Waterdog and ProxyPass will work when `enable-proxy-connections` is set to true at the expense of security.
This commit is contained in:
Camotoy 2020-08-17 12:04:09 -04:00 committed by GitHub
parent b07433698a
commit 8c514d9feb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 6 deletions

View File

@ -258,6 +258,11 @@ public class GeyserSpongeConfiguration implements GeyserConfiguration {
} }
} }
@Override
public boolean isEnableProxyConnections() {
return node.getNode("enable-proxy-connections").getBoolean(false);
}
@Override @Override
public int getMtu() { public int getMtu() {
return node.getNode("mtu").getInt(1400); return node.getNode("mtu").getInt(1400);

View File

@ -36,7 +36,7 @@ import java.util.Map;
public interface GeyserConfiguration { public interface GeyserConfiguration {
// Modify this when you update the config // Modify this when you update the config
int CURRENT_CONFIG_VERSION = 3; int CURRENT_CONFIG_VERSION = 4;
IBedrockConfiguration getBedrock(); IBedrockConfiguration getBedrock();
@ -120,6 +120,9 @@ public interface GeyserConfiguration {
String getUniqueId(); String getUniqueId();
} }
// if u have offline mode enabled pls be safe
boolean isEnableProxyConnections();
int getMtu(); int getMtu();
int getConfigVersion(); int getConfigVersion();

View File

@ -143,6 +143,9 @@ public abstract class GeyserJacksonConfiguration implements GeyserConfiguration
private String uniqueId; private String uniqueId;
} }
@JsonProperty("enable-proxy-connections")
private boolean enableProxyConnections = false;
@JsonProperty("mtu") @JsonProperty("mtu")
private int mtu = 1400; private int mtu = 1400;

View File

@ -72,7 +72,7 @@ public class LoginEncryptionUtils {
} }
if (lastKey != null) { if (lastKey != null) {
EncryptionUtils.verifyJwt(jwt, lastKey); if (!EncryptionUtils.verifyJwt(jwt, lastKey)) return false;
} }
JsonNode payloadNode = JSON_MAPPER.readTree(jwt.getPayload().toString()); JsonNode payloadNode = JSON_MAPPER.readTree(jwt.getPayload().toString());
@ -105,7 +105,7 @@ public class LoginEncryptionUtils {
connector.getLogger().debug(String.format("Is player data valid? %s", validChain)); connector.getLogger().debug(String.format("Is player data valid? %s", validChain));
if (!validChain) { if (!validChain && !session.getConnector().getConfig().isEnableProxyConnections()) {
session.disconnect(LanguageUtils.getLocaleStringLog("geyser.network.remote.invalid_xbox_account")); session.disconnect(LanguageUtils.getLocaleStringLog("geyser.network.remote.invalid_xbox_account"));
return; return;
} }

View File

@ -117,9 +117,14 @@ metrics:
# UUID of server, don't change! # UUID of server, don't change!
uuid: generateduuid uuid: generateduuid
# ADVANCED OPTIONS - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING! # ADVANCED OPTIONS - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING!
# Allow connections from ProxyPass and Waterdog.
# See https://www.spigotmc.org/wiki/firewall-guide/ for assistance - use UDP instead of TCP.
enable-proxy-connections: false
# The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation. # The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
# 1400 is the default. # 1400 is the default.
# mtu: 1400 # mtu: 1400
config-version: 3 config-version: 4

@ -1 +1 @@
Subproject commit 94d30c1c6c4518932b813826bfcef680575a3c9c Subproject commit 88678e69bf358cd562bd410a2459384aeb7ba482