9 Commits
1.3.2 ... Dev

Author SHA1 Message Date
mohammed jasem alaajel
bae2d970bb added jedis stuff 2021-03-16 18:05:20 +04:00
Govindass
141357b353 make encryption even more informative 2021-02-12 13:03:29 +02:00
Govindass
c89e4f1310 Make encryption config more informative & some other things 2021-02-12 12:59:28 +02:00
Govindass
8cda727799 Update config.yml 2021-02-12 12:51:00 +02:00
Govindass
ee5a9459bf Update config to be more informative 2021-02-12 12:48:39 +02:00
Govindass
b482e0fa7a update siv-mode 2021-02-09 11:55:21 +02:00
Govindass
d23956460f 1.3.3 2021-01-26 12:22:53 +02:00
Govindass
470104fc93 Fix set operation on {var::*} 2021-01-26 11:54:49 +02:00
Govindass
0f3ab74d98 Various fixes and improvements 2021-01-26 10:51:31 +02:00
10 changed files with 213 additions and 119 deletions

View File

@@ -17,6 +17,7 @@
<orderEntry type="library" scope="PROVIDED" name="Maven: org.ow2.asm:asm-analysis:7.1" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: org.ow2.asm:asm-analysis:7.1" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" /> <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains:annotations:19.0.0" level="project" /> <orderEntry type="library" name="Maven: org.jetbrains:annotations:19.0.0" level="project" />
<orderEntry type="library" name="Maven: redis.clients:jedis:3.4.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.SkriptLang:Skript:2.5.3" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: com.github.SkriptLang:Skript:2.5.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.destroystokyo.paper:paper-api:1.16.4-R0.1-SNAPSHOT" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: com.destroystokyo.paper:paper-api:1.16.4-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
@@ -58,16 +59,16 @@
<orderEntry type="library" scope="PROVIDED" name="Maven: ant-contrib:ant-contrib:1.0b3" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: ant-contrib:ant-contrib:1.0b3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:Vault:1.7.1" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:Vault:1.7.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: io.papermc:paperlib:1.0.5" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: io.papermc:paperlib:1.0.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:21.0" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.0" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.16-R0.3" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.16-R0.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.26" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.27" level="project" />
<orderEntry type="library" name="Maven: redis.clients:jedis:3.4.0" level="project" /> <orderEntry type="library" name="Maven: redis.clients:jedis:3.5.1" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" /> <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20190722" level="project" /> <orderEntry type="library" name="Maven: org.json:json:20201115" level="project" />
<orderEntry type="library" name="Maven: org.cryptomator:siv-mode:1.4.0" level="project" /> <orderEntry type="library" name="Maven: org.cryptomator:siv-mode:1.4.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.6.2" level="project" /> <orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.6.2" level="project" />
</component> </component>
</module> </module>

10
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>net.limework</groupId> <groupId>net.limework</groupId>
<artifactId>RediSkript</artifactId> <artifactId>RediSkript</artifactId>
<version>1.3.2</version> <version>1.3.3</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<build> <build>
@@ -87,25 +87,25 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.16.4-R0.1-SNAPSHOT</version> <version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>redis.clients</groupId> <groupId>redis.clients</groupId>
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>3.4.1</version> <version>3.5.1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.json</groupId> <groupId>org.json</groupId>
<artifactId>json</artifactId> <artifactId>json</artifactId>
<version>20190722</version> <version>20201115</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.cryptomator</groupId> <groupId>org.cryptomator</groupId>
<artifactId>siv-mode</artifactId> <artifactId>siv-mode</artifactId>
<version>1.4.0</version> <version>1.4.1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 --> <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 -->

View File

@@ -79,7 +79,11 @@ public class RediSkript extends JavaPlugin {
@Override @Override
public void onDisable() { public void onDisable() {
if (redisController != null) redisController.shutdown(); if (redisController != null) {
redisController.shutdown();
}
getServer().getPluginCommand("reloadredis").setExecutor(null);
} }
public RedisController getRC() { public RedisController getRC() {

View File

@@ -17,7 +17,7 @@ public class Encryption {
public Encryption(Configuration config){ public Encryption(Configuration config){
encryptionEnabled = config.getBoolean("Redis.EncryptMessages"); encryptionEnabled = config.getBoolean("Redis.EncryptMessages");
if (encryptionEnabled) { if (encryptionEnabled) {
// AES-128 encryption // AES encryption
encryptionKey = config.getString("Redis.EncryptionKey"); encryptionKey = config.getString("Redis.EncryptionKey");
macKey = config.getString("Redis.MacKey"); macKey = config.getString("Redis.MacKey");
} }

View File

@@ -6,7 +6,6 @@ import net.limework.rediskript.RediSkript;
import net.limework.rediskript.data.Encryption; import net.limework.rediskript.data.Encryption;
import net.limework.rediskript.events.RedisMessageEvent; import net.limework.rediskript.events.RedisMessageEvent;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.Configuration; import org.bukkit.configuration.Configuration;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import org.cryptomator.siv.UnauthenticCiphertextException; import org.cryptomator.siv.UnauthenticCiphertextException;
@@ -35,7 +34,6 @@ public class RedisController extends BinaryJedisPubSub implements Runnable {
private final AtomicBoolean isConnectionBroken; private final AtomicBoolean isConnectionBroken;
private final AtomicBoolean isConnecting; private final AtomicBoolean isConnecting;
private final RediSkript plugin; private final RediSkript plugin;
private final boolean debugMode = false; //todo: will be later in the config in future release.
private final BukkitTask ConnectionTask; private final BukkitTask ConnectionTask;
@@ -44,9 +42,10 @@ public class RedisController extends BinaryJedisPubSub implements Runnable {
Configuration config = plugin.getConfig(); Configuration config = plugin.getConfig();
JedisPoolConfig JConfig = new JedisPoolConfig(); JedisPoolConfig JConfig = new JedisPoolConfig();
int maxConnections = config.getInt("Redis.MaxConnections"); int maxConnections = config.getInt("Redis.MaxConnections");
if (maxConnections < 2) {
maxConnections = 2; //do not allow less than 2 max connections as that causes issues
} if (maxConnections < 2) { maxConnections = 2; }
JConfig.setMaxTotal(maxConnections); JConfig.setMaxTotal(maxConnections);
JConfig.setMaxIdle(maxConnections); JConfig.setMaxIdle(maxConnections);
JConfig.setMinIdle(1); JConfig.setMinIdle(1);
@@ -70,121 +69,125 @@ public class RedisController extends BinaryJedisPubSub implements Runnable {
if (!isConnectionBroken.get() || isConnecting.get()) { if (!isConnectionBroken.get() || isConnecting.get()) {
return; return;
} }
plugin.sendLogs("Connecting to redis......"); plugin.sendLogs("Connecting to Redis server...");
isConnecting.set(true); isConnecting.set(true);
try (Jedis jedis = jedisPool.getResource()) { try (Jedis jedis = jedisPool.getResource()) {
isConnectionBroken.set(false); isConnectionBroken.set(false);
plugin.sendLogs("&aConnection to redis has established!"); plugin.sendLogs("&aConnection to Redis server has established! Success!");
jedis.subscribe(this, channelsInByte); jedis.subscribe(this, channelsInByte);
} catch (Exception e) { } catch (Exception e) {
isConnecting.set(false); isConnecting.set(false);
isConnectionBroken.set(true); isConnectionBroken.set(true);
plugin.sendErrorLogs("Connection has &lFAILED &cor Unable to connect to redis retrying to make connection..."); plugin.sendErrorLogs("Connection to Redis server has failed! Please check your details in the configuration.");
if (debugMode) { e.printStackTrace();
e.printStackTrace();
}
} }
} }
public void shutdown() { public void shutdown() {
ConnectionTask.cancel(); ConnectionTask.cancel();
try { if (this.isSubscribed()) {
this.unsubscribe(); try {
} catch (Exception e) { this.unsubscribe();
plugin.sendErrorLogs("Something went wrong during unsubscribing..."); } catch (Exception e) {
if (debugMode) { plugin.sendErrorLogs("Something went wrong during unsubscribing...");
e.printStackTrace(); e.printStackTrace();
} }
} }
jedisPool.close(); jedisPool.close();
} }
@Override @Override
public void onMessage(byte[] channel, byte[] message) { public void onMessage(byte[] channel, byte[] message){
String channelString = new String(channel, StandardCharsets.UTF_8); String channelString = new String(channel, StandardCharsets.UTF_8);
String receivedMessage = null; String receivedMessage = null;
try { try {
//if encryption is enabled, decrypt the message, else just convert binary to string //if encryption is enabled, decrypt the message, else just convert binary to string
if (this.encryption.isEncryptionEnabled()) { if (this.encryption.isEncryptionEnabled()) {
try { try {
receivedMessage = encryption.decrypt(message); receivedMessage = encryption.decrypt(message);
} catch (UnauthenticCiphertextException | IllegalBlockSizeException e) { } catch (UnauthenticCiphertextException | IllegalBlockSizeException e) {
e.printStackTrace(); e.printStackTrace();
}
} else {
//encryption is disabled, so let's just get the string
receivedMessage = new String(message, StandardCharsets.UTF_8);
} }
if (receivedMessage != null) {
} else { JSONObject j = new JSONObject(receivedMessage);
//encryption is disabled, so let's just get the string if (j.get("Type").equals("Skript")) {
receivedMessage = new String(message, StandardCharsets.UTF_8); JSONArray messages = j.getJSONArray("Messages");
} RedisMessageEvent event;
if (receivedMessage != null) { for (int i = 0; i < messages.length(); i++) {
JSONObject j = new JSONObject(receivedMessage); event = new RedisMessageEvent(channelString, messages.get(i).toString(), j.getLong("Date"));
if (j.get("Type").equals("Skript")) { //if plugin is disabling, don't call events anymore
JSONArray messages = j.getJSONArray("Messages"); if (plugin.isEnabled()) {
RedisMessageEvent event; RedisMessageEvent finalEvent = event;
for (int i = 0; i < messages.length(); i++) { Bukkit.getScheduler().runTask(plugin, () -> plugin.getServer().getPluginManager().callEvent(finalEvent));
event = new RedisMessageEvent(channelString, messages.get(i).toString(), j.getLong("Date")); }
//if plugin is disabling, don't call events anymore
if (plugin.isEnabled()) {
RedisMessageEvent finalEvent = event;
Bukkit.getScheduler().runTask(plugin, () -> plugin.getServer().getPluginManager().callEvent(finalEvent));
} }
} } else if (j.get("Type").equals("SkriptVariables")) {
} else if (j.get("Type").equals("SkriptVariables")) {
//Transfer variables between servers //Transfer variables between servers
JSONArray variableNames = j.getJSONArray("Names"); JSONArray variableNames = j.getJSONArray("Names");
Object inputValue; Object inputValue;
String changeValue = null; String changeValue = null;
JSONArray variableValues = null; JSONArray variableValues = null;
if (!j.isNull("Values")) { if (!j.isNull("Values")) {
variableValues = j.getJSONArray("Values"); variableValues = j.getJSONArray("Values");
} }
for (int i = 0; i < variableNames.length(); i++) { for (int i = 0; i < variableNames.length(); i++) {
if (j.isNull("Values")) { if (j.isNull("Values")) {
//only check for SET here, because null has to be ignored in all other cases //only check for SET here, because null has to be ignored in all other cases
if (j.getString("Operation").equals("SET")) { if (j.getString("Operation").equals("SET")) {
Variables.setVariable(variableNames.get(i).toString(), null, null, false); Variables.setVariable(variableNames.get(i).toString(), null, null, false);
} }
} else { } else {
if (!variableValues.isNull(i)) { if (!variableValues.isNull(i)) {
changeValue = variableValues.get(i).toString(); changeValue = variableValues.get(i).toString();
} }
String[] inputs = changeValue.split("\\^", 2); String[] inputs = changeValue.split("\\^", 2);
inputValue = Classes.deserialize(inputs[0], Base64.getDecoder().decode(inputs[1])); inputValue = Classes.deserialize(inputs[0], Base64.getDecoder().decode(inputs[1]));
switch (j.getString("Operation")) { switch (j.getString("Operation")) {
case "ADD": case "ADD":
//I will add this once someone tells me how to remove from Skript variable //I will add this once someone tells me how to remove from Skript variable
//because using SET operation has issues with inconvertible types (Double and Long) //because using SET operation has issues with inconvertible types (Double and Long)
//variable = (Variable) Variables.getVariable(variableNames.get(i).toString(), null, false); //variable = (Variable) Variables.getVariable(variableNames.get(i).toString(), null, false);
// variable.change(null, (Object[]) inputValue, Changer.ChangeMode.REMOVE); // variable.change(null, (Object[]) inputValue, Changer.ChangeMode.REMOVE);
case "REMOVE": case "REMOVE":
//I will add this once someone tells me how to remove from Skript variable //I will add this once someone tells me how to remove from Skript variable
//because using SET operation has issues with inconvertible types (Double and Long) //because using SET operation has issues with inconvertible types (Double and Long)
//variable = (Variable) Variables.getVariable(variableNames.get(i).toString(), null, false); //variable = (Variable) Variables.getVariable(variableNames.get(i).toString(), null, false);
// variable.change(null, (Object[]) inputValue, Changer.ChangeMode.REMOVE); // variable.change(null, (Object[]) inputValue, Changer.ChangeMode.REMOVE);
break; break;
case "SET": case "SET":
Variables.setVariable(variableNames.get(i).toString(), inputValue, null, false); String variableName = variableNames.get(i).toString();
//this is needed, because setting a {variable::*} causes weird behavior, like
//1st set operation is no data, 2nd has data, etc.
//if you set it to null before action, it works correctly
if (variableName.charAt(variableName.length()-1) == '*') {
Variables.setVariable(variableName, null, null, false);
}
Variables.setVariable(variableNames.get(i).toString(), inputValue, null, false);
}
} }
} }
} }
} }
} } catch (Exception e) {
} catch (Exception e) { plugin.sendErrorLogs("&cI got a message that was empty from channel " + channelString + " please check your code that you used to send the message. Message content:");
plugin.sendErrorLogs("&cI got a message that was empty from channel " + channelString + " please check your code that you used to send the message. Message content:");
if (debugMode) {
e.printStackTrace();
plugin.sendErrorLogs(receivedMessage); plugin.sendErrorLogs(receivedMessage);
e.printStackTrace();
} }
} }
}
public void sendMessage(String[] message, String channel) { public void sendMessage(String[] message, String channel) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("Messages", new JSONArray(message)); json.put("Messages", new JSONArray(message));
@@ -222,12 +225,9 @@ public class RedisController extends BinaryJedisPubSub implements Runnable {
try (BinaryJedis j = jedisPool.getResource()) { try (BinaryJedis j = jedisPool.getResource()) {
j.publish(channel.getBytes(StandardCharsets.UTF_8), message); j.publish(channel.getBytes(StandardCharsets.UTF_8), message);
} catch (Exception e) { } catch (Exception e) {
System.out.println("Error sending redis message!"); plugin.sendErrorLogs("Error sending redis message!");
if (debugMode) { e.printStackTrace();
e.printStackTrace();
} }
}
}); });
} else { } else {
//execute sending of redis message on the main thread if plugin is disabling //execute sending of redis message on the main thread if plugin is disabling

View File

@@ -25,9 +25,7 @@ public class ExprChannel extends SimpleExpression<String> {
} }
@Override @Override
public String toString(Event event, boolean b) { public String toString(Event event, boolean b) { return "redis channel"; }
return "redis channel";
}
@Override @Override
public boolean init(final Expression<?>[] expressions, final int matchedPattern, final Kleenean isDelayed, final SkriptParser.ParseResult parseResult) { public boolean init(final Expression<?>[] expressions, final int matchedPattern, final Kleenean isDelayed, final SkriptParser.ParseResult parseResult) {

View File

@@ -0,0 +1,46 @@
package net.limework.rediskript.skript.elements;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;
import redis.clients.jedis.Jedis;
@SuppressWarnings("unchecked")
public class ExprJedis extends SimpleExpression<Jedis> {
static {
}
private Jedis jedis;
@Nullable
@Override
protected Jedis[] get(Event event) {
return new Jedis[]{jedis};
}
@Override
public boolean isSingle() {
return true;
}
@Override
public Class<? extends Jedis> getReturnType() {
return Jedis.class;
}
@Override
public String toString(@Nullable Event event, boolean b) {
return null;
}
@Override
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
return false;
}
}

View File

@@ -1,12 +1,9 @@
package net.limework.rediskript.skript.elements; package net.limework.rediskript.skript.elements;
import ch.njol.skript.Skript;
import ch.njol.skript.classes.Changer; import ch.njol.skript.classes.Changer;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser; import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.lang.Variable;
import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.skript.log.ErrorQuality;
import ch.njol.skript.registrations.Classes; import ch.njol.skript.registrations.Classes;
import ch.njol.skript.variables.SerializedVariable; import ch.njol.skript.variables.SerializedVariable;
import ch.njol.util.Kleenean; import ch.njol.util.Kleenean;
@@ -49,7 +46,7 @@ public class ExprVariableInChannel extends SimpleExpression<Object> {
} }
@Override @Override
public void change(Event e, Object[] changer, Changer.ChangeMode mode) { public void change(Event e, Object[] changer, Changer.ChangeMode mode) {
RediSkript plugin = (RediSkript) Bukkit.getPluginManager().getPlugin("RediSkript"); RediSkript plugin = RediSkript.getPlugin(RediSkript.class);
switch (mode) { switch (mode) {
case ADD: case ADD:
case SET: case SET:

View File

@@ -0,0 +1,33 @@
package net.limework.rediskript.skript.elements;
import ch.njol.skript.classes.ClassInfo;
import ch.njol.skript.classes.Parser;
import ch.njol.skript.registrations.Classes;
import redis.clients.jedis.Jedis;
public class Types {
static {
Classes.registerClass(
new ClassInfo<>(Jedis.class, "jedis")
.user("JedisInstances?")
.parser(new Parser<Jedis>() {
@Override
public String toString(Jedis t, int i) {
return t.toString();
}
@Override
public String toVariableNameString(Jedis t) {
return t.toString();
}
@Override
public String getVariableNamePattern() {
return "jedis:+";
}
}));
}
}

View File

@@ -2,28 +2,43 @@ Redis:
#a secure password that cannot be cracked, please change it! #a secure password that cannot be cracked, please change it!
#it is also recommended to firewall your redis server with iptables so it can only be accessed by specific IP addresses #it is also recommended to firewall your redis server with iptables so it can only be accessed by specific IP addresses
Password: "yHy0d2zdBlRmaSPj3CiBwEv5V3XxBTLTrCsGW7ntBnzhfxPxXJS6Q1aTtR6DSfAtCZr2VxWnsungXHTcF94a4bsWEpGAvjL9XMU" Password: "yHy0d2zdBlRmaSPj3CiBwEv5V3XxBTLTrCsGW7ntBnzhfxPxXJS6Q1aTtR6DSfAtCZr2VxWnsungXHTcF94a4bsWEpGAvjL9XMU"
#hostname of your redis server, you can use free redis hosting (search for it online) if you do not have the ability to host your own redis server
#redis server is very lightweight, takes under 30 MB of RAM usually
Host: "127.0.0.1" Host: "127.0.0.1"
#must be 2 or higher, if you set to lower, the addon will automatically use 2 as a minimum #must be 2 or higher, if you set to lower, the addon will automatically use 2 as a minimum
#do not edit MaxConnections if you do not know what you're doing
#it is only useful to increase this number to account for PING between distant servers and when you are sending a lot of messages constantly
MaxConnections: 2 MaxConnections: 2
#the default Redis port #the default Redis port
Port: 6379 Port: 6379
#time out in milliseconds, how long it should take before it decides that it is unable to connect when sending a message #time out in milliseconds, how long it should take before it decides that it is unable to connect when sending a message
#90000 = 90 seconds #9000 = 9 seconds
TimeOut: 90000 TimeOut: 9000
#also known as SSL, only use this if you're running Redis 6.0.6 or higher, older versions will not work correctly #also known as SSL, only use this if you're running Redis 6.0.6 or higher, older versions will not work correctly
#it encrypts your traffic and makes data exchange between distant servers completely secure #it encrypts your traffic and makes data exchange between distant servers secure
useTLS: false useTLS: false
#may be useful if you cannot use TLS due to use of older version of Redis #EncryptMessages may be useful if you cannot use TLS due to use of older version of Redis or if you're paranoid about privacy and want to double encrypt your messages
#however this will not encrypt the initial authentication password, only the messages sent #however this will not encrypt the initial authentication password, only the messages sent (use TLS for initial authentication password encryption)
#it uses AES-128 SIV encryption which is secure enough for this
#the encryption configuration must be the same across all servers in order to communicate
#use 16 characters long key for AES-128 encryption
#32 characters long key for AES-256 encryption
#AES-128 is faster, but less secure (but it is not crackable by today's technology as of 2020, may be crackable by quantum computers)
#the AES implementation used in RediSkript uses SIV mode, which makes the same key resistant to cracking for a big count of messages without the need of changing the key very often
EncryptMessages: true EncryptMessages: true
#EncryptionKey and MacKey must be different
EncryptionKey: "16CHARACTERS KEY" EncryptionKey: "16CHARACTERS KEY"
MacKey: "16CHARACTERS KEY" MacKey: "16CHARACTERS KEY"
#the channels from which this server can receive messages #the channels from which this server can receive messages
#you can always send messages to all channels! #you can always send messages to all channels!
#you can add as many channels as you wish! #you can add as many channels as you wish!
#ideal setup is having one global channel and having one channel that represents server name, so you know who to send messages to
#then a few other utility channels up to your needs
Channels: Channels:
- "Channel1" - "global"
- "Channel2" - "servername"
- "Channel3" - "Channel3"