diff --git a/core/src/main/java/org/geysermc/geyser/configuration/ConfigMigrations.java b/core/src/main/java/org/geysermc/geyser/configuration/ConfigMigrations.java index 46241e3a3..198ab842e 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/ConfigMigrations.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/ConfigMigrations.java @@ -113,15 +113,15 @@ public class ConfigMigrations { // Bedrock .addAction(path("bedrock", "broadcast-port"), moveTo("advanced", "bedrock")) - .addAction(path("bedrock", "compression-level"), renameAndMove("advanced", "bedrock", "compression-level")) + .addAction(path("bedrock", "compression-level"), moveTo("advanced", "bedrock")) .addAction(path("bedrock", "enable-proxy-protocol"), renameAndMove("advanced", "bedrock", "use-haproxy-protocol")) - .addAction(path("bedrock", "proxy-protocol-whitelisted-ips"), renameAndMove("advanced", "bedrock", "proxy-protocol-whitelisted-ips")) + .addAction(path("bedrock", "proxy-protocol-whitelisted-ips"), renameAndMove("advanced", "bedrock", "haproxy-protocol-whitelisted-ips")) .addAction(path("mtu"), moveTo("advanced", "bedrock")) // Java .addAction(path("remote", "use-proxy-protocol"), renameAndMove("advanced", "java", "use-haproxy-protocol")) - .addAction(path("disable-compression"), renameAndMove("advanced", "java", "disable-compression")) - .addAction(path("use-direct-connection"), renameAndMove("advanced", "java", "use-direct-connection")) + .addAction(path("disable-compression"), moveTo("advanced", "java")) + .addAction(path("use-direct-connection"), moveTo("advanced", "java")) // Other .addAction(path("default-locale"), (path, value) -> { diff --git a/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java b/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java index c80f965ea..5d2031991 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java @@ -367,7 +367,7 @@ public interface GeyserConfig { should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.). Keeping this list empty means there is no IP address whitelist. IP addresses, subnets, and links to plain text files are supported.""") - default List proxyProtocolWhitelistedIps() { + default List haproxyProtocolWhitelistedIps() { return Collections.emptyList(); } diff --git a/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java b/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java index c96a6d8d7..4fe0b3802 100644 --- a/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java +++ b/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java @@ -169,7 +169,7 @@ public final class GeyserServer { channel.pipeline().addFirst("proxy-protocol-decoder", new ProxyServerHandler()); } - boolean isWhitelistedProxyProtocol = isProxyProtocol && !this.geyser.config().advanced().bedrock().proxyProtocolWhitelistedIps().isEmpty(); + boolean isWhitelistedProxyProtocol = isProxyProtocol && !this.geyser.config().advanced().bedrock().haproxyProtocolWhitelistedIps().isEmpty(); if (Boolean.parseBoolean(System.getProperty("Geyser.RakRateLimitingDisabled", "false")) || isWhitelistedProxyProtocol) { // We would already block any non-whitelisted IP addresses in onConnectionRequest so we can remove the rate limiter channel.pipeline().remove(RakServerRateLimiter.NAME); @@ -242,7 +242,7 @@ public final class GeyserServer { } public boolean onConnectionRequest(InetSocketAddress inetSocketAddress) { - List allowedProxyIPs = geyser.config().advanced().bedrock().proxyProtocolWhitelistedIps(); + List allowedProxyIPs = geyser.config().advanced().bedrock().haproxyProtocolWhitelistedIps(); if (geyser.config().advanced().bedrock().useHaproxyProtocol() && !allowedProxyIPs.isEmpty()) { boolean isWhitelistedIP = false; for (CIDRMatcher matcher : getWhitelistedIPsMatchers()) { @@ -392,7 +392,7 @@ public final class GeyserServer { private List whitelistedIPsMatchers = null; /** - * @return Unmodifiable list of {@link CIDRMatcher}s from {@link GeyserConfig.AdvancedBedrockConfig#proxyProtocolWhitelistedIps()} + * @return Unmodifiable list of {@link CIDRMatcher}s from {@link GeyserConfig.AdvancedBedrockConfig#haproxyProtocolWhitelistedIps()} */ public List getWhitelistedIPsMatchers() { // Effective Java, Third Edition; Item 83: Use lazy initialization judiciously @@ -401,7 +401,7 @@ public final class GeyserServer { synchronized (this) { // Check if proxyProtocolWhitelistedIPs contains URLs we need to fetch and parse by line List whitelistedCIDRs = new ArrayList<>(); - for (String ip: geyser.config().advanced().bedrock().proxyProtocolWhitelistedIps()) { + for (String ip: geyser.config().advanced().bedrock().haproxyProtocolWhitelistedIps()) { if (!ip.startsWith("http")) { whitelistedCIDRs.add(ip); continue; diff --git a/core/src/test/resources/configuration/all-changed/plugin.yml b/core/src/test/resources/configuration/all-changed/plugin.yml index bc8d0e208..fdcaa57c6 100644 --- a/core/src/test/resources/configuration/all-changed/plugin.yml +++ b/core/src/test/resources/configuration/all-changed/plugin.yml @@ -211,7 +211,7 @@ advanced: # should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.). # Keeping this list empty means there is no IP address whitelist. # IP addresses, subnets, and links to plain text files are supported. - proxy-protocol-whitelisted-ips: + haproxy-protocol-whitelisted-ips: - 127.0.0.1 - 172.18.0.0/13 diff --git a/core/src/test/resources/configuration/all-changed/remote.yml b/core/src/test/resources/configuration/all-changed/remote.yml index 27eec69dc..dfbdf8422 100644 --- a/core/src/test/resources/configuration/all-changed/remote.yml +++ b/core/src/test/resources/configuration/all-changed/remote.yml @@ -201,7 +201,7 @@ advanced: # should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.). # Keeping this list empty means there is no IP address whitelist. # IP addresses, subnets, and links to plain text files are supported. - proxy-protocol-whitelisted-ips: + haproxy-protocol-whitelisted-ips: - 127.0.0.1 - 172.18.0.0/13 diff --git a/core/src/test/resources/configuration/default/plugin.yml b/core/src/test/resources/configuration/default/plugin.yml index cb989670e..32e0ed564 100644 --- a/core/src/test/resources/configuration/default/plugin.yml +++ b/core/src/test/resources/configuration/default/plugin.yml @@ -211,7 +211,7 @@ advanced: # should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.). # Keeping this list empty means there is no IP address whitelist. # IP addresses, subnets, and links to plain text files are supported. - proxy-protocol-whitelisted-ips: [] + haproxy-protocol-whitelisted-ips: [] # The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation. # 1400 is the default. diff --git a/core/src/test/resources/configuration/default/remote.yml b/core/src/test/resources/configuration/default/remote.yml index acb48487b..7fdc8c0f6 100644 --- a/core/src/test/resources/configuration/default/remote.yml +++ b/core/src/test/resources/configuration/default/remote.yml @@ -201,7 +201,7 @@ advanced: # should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.). # Keeping this list empty means there is no IP address whitelist. # IP addresses, subnets, and links to plain text files are supported. - proxy-protocol-whitelisted-ips: [] + haproxy-protocol-whitelisted-ips: [] # The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation. # 1400 is the default. diff --git a/core/src/test/resources/configuration/legacy/plugin.yml b/core/src/test/resources/configuration/legacy/plugin.yml index cb989670e..32e0ed564 100644 --- a/core/src/test/resources/configuration/legacy/plugin.yml +++ b/core/src/test/resources/configuration/legacy/plugin.yml @@ -211,7 +211,7 @@ advanced: # should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.). # Keeping this list empty means there is no IP address whitelist. # IP addresses, subnets, and links to plain text files are supported. - proxy-protocol-whitelisted-ips: [] + haproxy-protocol-whitelisted-ips: [] # The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation. # 1400 is the default. diff --git a/core/src/test/resources/configuration/legacy/remote.yml b/core/src/test/resources/configuration/legacy/remote.yml index acb48487b..7fdc8c0f6 100644 --- a/core/src/test/resources/configuration/legacy/remote.yml +++ b/core/src/test/resources/configuration/legacy/remote.yml @@ -201,7 +201,7 @@ advanced: # should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.). # Keeping this list empty means there is no IP address whitelist. # IP addresses, subnets, and links to plain text files are supported. - proxy-protocol-whitelisted-ips: [] + haproxy-protocol-whitelisted-ips: [] # The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation. # 1400 is the default.