mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-17 01:58:03 +00:00
config log changes, introduction of new env REDISBUNGEE_PROXY_ID
This commit is contained in:
parent
96e620622a
commit
c333cf0163
@ -54,7 +54,8 @@ public interface ConfigLoader {
|
|||||||
final boolean kickWhenOnline = node.getNode("kick-when-online").getBoolean(true);
|
final boolean kickWhenOnline = node.getNode("kick-when-online").getBoolean(true);
|
||||||
String redisPassword = node.getNode("redis-password").getString("");
|
String redisPassword = node.getNode("redis-password").getString("");
|
||||||
String redisUsername = node.getNode("redis-username").getString("");
|
String redisUsername = node.getNode("redis-username").getString("");
|
||||||
String proxyId = node.getNode("proxy-id").getString("test-1");
|
String proxyId = node.getNode("proxy-id").getString("proxy-1");
|
||||||
|
|
||||||
final int maxConnections = node.getNode("max-redis-connections").getInt(10);
|
final int maxConnections = node.getNode("max-redis-connections").getInt(10);
|
||||||
List<String> exemptAddresses;
|
List<String> exemptAddresses;
|
||||||
try {
|
try {
|
||||||
@ -71,9 +72,11 @@ public interface ConfigLoader {
|
|||||||
if ((redisUsername.isEmpty() || redisUsername.equals("none"))) {
|
if ((redisUsername.isEmpty() || redisUsername.equals("none"))) {
|
||||||
redisUsername = null;
|
redisUsername = null;
|
||||||
}
|
}
|
||||||
|
// env var
|
||||||
if (useSSL) {
|
String proxyIdFromEnv = System.getenv("REDISBUNGEE_PROXY_ID");
|
||||||
plugin.logInfo("Using ssl");
|
if (proxyIdFromEnv != null) {
|
||||||
|
plugin.logInfo("Overriding current configured proxy id {} and been set to {} by Environment variable REDISBUNGEE_PROXY_ID", proxyId, proxyIdFromEnv);
|
||||||
|
proxyId = proxyIdFromEnv;
|
||||||
}
|
}
|
||||||
// Configuration sanity checks.
|
// Configuration sanity checks.
|
||||||
if (proxyId == null || proxyId.isEmpty()) {
|
if (proxyId == null || proxyId.isEmpty()) {
|
||||||
@ -88,10 +91,15 @@ public interface ConfigLoader {
|
|||||||
}
|
}
|
||||||
boolean reconnectToLastServer = node.getNode("reconnect-to-last-server").getBoolean();
|
boolean reconnectToLastServer = node.getNode("reconnect-to-last-server").getBoolean();
|
||||||
boolean handleMotd = node.getNode("handle-motd").getBoolean(true);
|
boolean handleMotd = node.getNode("handle-motd").getBoolean(true);
|
||||||
|
plugin.logInfo("handle reconnect to last server: {}", reconnectToLastServer);
|
||||||
|
plugin.logInfo("handle motd: {}", handleMotd);
|
||||||
|
|
||||||
RedisBungeeConfiguration configuration = new RedisBungeeConfiguration(proxyId, exemptAddresses, registerLegacyCommands, overrideBungeeCommands, kickWhenOnline, reconnectToLastServer, handleMotd);
|
RedisBungeeConfiguration configuration = new RedisBungeeConfiguration(proxyId, exemptAddresses, registerLegacyCommands, overrideBungeeCommands, kickWhenOnline, reconnectToLastServer, handleMotd);
|
||||||
Summoner<?> summoner;
|
Summoner<?> summoner;
|
||||||
RedisBungeeMode redisBungeeMode;
|
RedisBungeeMode redisBungeeMode;
|
||||||
|
if (useSSL) {
|
||||||
|
plugin.logInfo("Using ssl");
|
||||||
|
}
|
||||||
if (node.getNode("cluster-mode-enabled").getBoolean(false)) {
|
if (node.getNode("cluster-mode-enabled").getBoolean(false)) {
|
||||||
plugin.logInfo("RedisBungee MODE: CLUSTER");
|
plugin.logInfo("RedisBungee MODE: CLUSTER");
|
||||||
Set<HostAndPort> hostAndPortSet = new HashSet<>();
|
Set<HostAndPort> hostAndPortSet = new HashSet<>();
|
||||||
|
@ -43,7 +43,9 @@ max-redis-connections: 10
|
|||||||
useSSL: false
|
useSSL: false
|
||||||
|
|
||||||
# An identifier for this BungeeCord / Velocity instance. Will randomly generate if leaving it blank.
|
# An identifier for this BungeeCord / Velocity instance. Will randomly generate if leaving it blank.
|
||||||
proxy-id: "test-1"
|
# Tip: you can set proxy id using Environment variable REDISBUNGEE_PROXY_ID which will override this config option
|
||||||
|
# before launch
|
||||||
|
proxy-id: "proxy-1"
|
||||||
|
|
||||||
# since version 0.8.0 Internally now uses JedisPooled instead of Jedis, JedisPool.
|
# since version 0.8.0 Internally now uses JedisPooled instead of Jedis, JedisPool.
|
||||||
# which will break compatibility with old plugins that uses RedisBungee JedisPool
|
# which will break compatibility with old plugins that uses RedisBungee JedisPool
|
||||||
|
@ -44,6 +44,7 @@ tasks {
|
|||||||
}
|
}
|
||||||
runWaterfall {
|
runWaterfall {
|
||||||
waterfallVersion("1.20")
|
waterfallVersion("1.20")
|
||||||
|
environment.put("REDISBUNGEE_PROXY_ID", "bungeecord-1")
|
||||||
}
|
}
|
||||||
compileJava {
|
compileJava {
|
||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
|
@ -50,6 +50,7 @@ tasks {
|
|||||||
}
|
}
|
||||||
runVelocity {
|
runVelocity {
|
||||||
velocityVersion("3.2.0-SNAPSHOT")
|
velocityVersion("3.2.0-SNAPSHOT")
|
||||||
|
environment.put("REDISBUNGEE_PROXY_ID", "velocity-1")
|
||||||
}
|
}
|
||||||
compileJava {
|
compileJava {
|
||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
|
Loading…
Reference in New Issue
Block a user