1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2026-01-04 15:31:36 +00:00

Rename and migrate proxy-protocol-whitelisted-ips to haproxy-protocol-whitelisted-ips

This commit is contained in:
onebeastchris
2025-11-03 15:25:34 +01:00
parent d748d826d1
commit 73087851d7
9 changed files with 15 additions and 15 deletions

View File

@@ -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) -> {

View File

@@ -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<String> proxyProtocolWhitelistedIps() {
default List<String> haproxyProtocolWhitelistedIps() {
return Collections.emptyList();
}

View File

@@ -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<String> allowedProxyIPs = geyser.config().advanced().bedrock().proxyProtocolWhitelistedIps();
List<String> 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<CIDRMatcher> 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<CIDRMatcher> 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<String> 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;

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.