tencentcloud-edgeone-migration-nodejs-v2
Version:
tencentcloud cdn config copy to edgeone
56 lines (51 loc) • 1.22 kB
JavaScript
const { t } = require("../../i18n/trans");
const genLog = require("../../logGenerator");
/**
* BotConfig
* @param {*} domain
* @param {*} domainConfig
* @returns Bot智能分析使用推荐配置
*/
function BotConfig(domain, domainConfig, eoPlanType, ruleTransferLog) {
const keyConfig = domainConfig;
if (!keyConfig || keyConfig.Switch === "off") {
ruleTransferLog.push({
config: t('BOT配置(BotConfig)'),
result: t('未配置'),
detail: ''
});
genLog.defaultLog(`${t('BOT配置(BotConfig)')}${t('未配置')}`)
return null;
}
ruleTransferLog.push({
config: t('BOT配置(BotConfig)'),
result: t('成功'),
detail: ''
});
genLog.successLog(`${t('BOT配置(BotConfig)')}${t('成功')}`)
return {
Switch: "on",
IntelligenceRule: {
Switch: "on",
IntelligenceRuleItems: [
{
Action: "drop",
Label: "evil_bot",
},
{
Action: "alg",
Label: "suspect_bot",
},
{
Action: "monitor",
Label: "good_bot",
},
{
Action: "trans",
Label: "normal",
},
],
},
};
}
module.exports = BotConfig;