用户id默认使用uuid
This commit is contained in:
@@ -68,6 +68,10 @@ token.key testim
|
||||
##是否使用AES256加密。默认客户端和服务器都是AES128加密,如果需要开启AES256,需要客户端和IM服务同时开通。
|
||||
#encrypt.use_aes256 true
|
||||
|
||||
##当创建一个对象时(用户,群组,频道,机器人等),如果没有传入ID,野火会为这个对象生成一个ID。如果id.use_uuid为true,会使用uuid作为对象ID,否则会使用野火短ID,默认为false。
|
||||
## 短ID有个很大的风险是容易被人穷举进行攻击。建议用UUID。
|
||||
id.use_uuid true
|
||||
|
||||
##首次登录,是否接收之前的历史消息。
|
||||
##0 不接收历史消息,只接收${message.compensate_time_limit}毫秒以内的消息,由于服务器没有保存已经收取记录,所以如果有超过${message.compensate_time_limit}毫秒之前未收取的消息也不会收取下拉;
|
||||
##1接收,会接收 message.max_queue 配置的条数的历史消息
|
||||
|
||||
@@ -115,6 +115,8 @@ public final class BrokerConstants {
|
||||
public static final String CONNECT_CLIENT_SIGNATURE_LIST = "connect.client_signature_list";
|
||||
public static final String CONNECT_REJECT_EMPTY_SIGNATURE = "connect.reject_empty_signature";
|
||||
|
||||
public static final String ID_USE_UUID = "id.use_uuid";
|
||||
|
||||
public static final String EMBED_DB_PROPERTY_NAME = "embed.db";
|
||||
public static final String DB_AUTO_CLEAN_HISTORY_MESSAGES = "db.auto_clean_history_messages";
|
||||
public static final String H2DB_PATH = "h2db.path";
|
||||
|
||||
@@ -166,6 +166,8 @@ public class MemoryMessagesStore implements IMessagesStore {
|
||||
private Set<String> mAllowStrangerChatSet = new HashSet<>();
|
||||
private boolean mDisableStrangerAddGroup = false;
|
||||
|
||||
private boolean mIDUseUUID = true;
|
||||
|
||||
private Set<String> mClientSignatureSet = new HashSet<>();
|
||||
private boolean mRejectEmptySignature = true;
|
||||
|
||||
@@ -614,6 +616,11 @@ public class MemoryMessagesStore implements IMessagesStore {
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
mIDUseUUID = Boolean.parseBoolean(server.getConfig().getProperty(BrokerConstants.ID_USE_UUID, "false"));
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
private void printMissConfigLog(String config, String defaultValue) {
|
||||
@@ -4791,10 +4798,12 @@ public class MemoryMessagesStore implements IMessagesStore {
|
||||
|
||||
@Override
|
||||
public String getShortUUID(){
|
||||
if(!mIDUseUUID) {
|
||||
int id = databaseStore.getGeneratedId();
|
||||
if (id > 0) {
|
||||
return IDUtils.toUid(id);
|
||||
}
|
||||
}
|
||||
return UUIDGenerator.getUUID();
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,10 @@ token.key testim
|
||||
##是否使用AES256加密。默认客户端和服务器都是AES128加密,如果需要开启AES256,需要客户端和IM服务同时开通。
|
||||
#encrypt.use_aes256 true
|
||||
|
||||
##当创建一个对象时(用户,群组,频道,机器人等),如果没有传入ID,野火会为这个对象生成一个ID。如果id.use_uuid为true,会使用uuid作为对象ID,否则会使用野火短ID,默认为false。
|
||||
## 短ID有个很大的风险是容易被人穷举进行攻击。建议用UUID。
|
||||
id.use_uuid true
|
||||
|
||||
##首次登录,是否接收之前的历史消息。
|
||||
##0 不接收历史消息,只接收${message.compensate_time_limit}毫秒以内的消息,由于服务器没有保存已经收取记录,所以如果有超过${message.compensate_time_limit}毫秒之前未收取的消息也不会收取下拉;
|
||||
##1接收,会接收 message.max_queue 配置的条数的历史消息
|
||||
|
||||
Reference in New Issue
Block a user