mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-04-07 14:04:35 +08:00
[bug] Move "enable" flag to every rule; For bug 70325
This commit is contained in:
@ -35,9 +35,9 @@
|
||||
}
|
||||
},
|
||||
"notification": {
|
||||
"enable": false,
|
||||
"rules": {
|
||||
"licenseExpirationWarning": {
|
||||
"enable": true,
|
||||
"transportType": [
|
||||
"email"
|
||||
],
|
||||
@ -50,6 +50,7 @@
|
||||
}
|
||||
},
|
||||
"licenseExpirationError": {
|
||||
"enable": false,
|
||||
"transportType": [
|
||||
"email"
|
||||
],
|
||||
@ -62,6 +63,7 @@
|
||||
}
|
||||
},
|
||||
"licenseLimitEdit": {
|
||||
"enable": true,
|
||||
"transportType": [
|
||||
"email"
|
||||
],
|
||||
@ -74,6 +76,7 @@
|
||||
}
|
||||
},
|
||||
"licenseLimitLiveViewer": {
|
||||
"enable": true,
|
||||
"transportType": [
|
||||
"email"
|
||||
],
|
||||
@ -347,11 +350,11 @@
|
||||
"forcesave": 604800,
|
||||
"forcesaveLock": 5000,
|
||||
"saved": 3600,
|
||||
"documentsCron": "0 */2 * * * *",
|
||||
"documentsCron": "*/10 * * * * *",
|
||||
"files": 86400,
|
||||
"filesCron": "00 00 */1 * * *",
|
||||
"filesremovedatonce": 100,
|
||||
"sessionidle": "1h",
|
||||
"sessionidle": "10s",
|
||||
"sessionabsolute": "30d",
|
||||
"sessionclosecommand": "2m",
|
||||
"pemStdTTL": "1h",
|
||||
@ -452,7 +455,7 @@
|
||||
"license" : {
|
||||
"license_file": "",
|
||||
"warning_limit_percents": 70,
|
||||
"packageType": 0,
|
||||
"packageType": 1,
|
||||
"warning_license_expiration": "30d"
|
||||
},
|
||||
"FileConverter": {
|
||||
|
||||
@ -39,7 +39,6 @@ const mailService = require('./mailService');
|
||||
|
||||
const cfgMailServer = config.get('email.smtpServerConfiguration');
|
||||
const cfgMailMessageDefaults = config.get('email.contactDefaults');
|
||||
const cfgNotificationEnable = config.get('notification.enable');
|
||||
const cfgEditorDataStorage = config.get('services.CoAuthoring.server.editorDataStorage');
|
||||
const cfgEditorStatStorage = config.get('services.CoAuthoring.server.editorStatStorage');
|
||||
const editorStatStorage = require('./../../DocService/sources/' + (cfgEditorStatStorage || cfgEditorDataStorage));
|
||||
@ -108,14 +107,9 @@ class Transport {
|
||||
}
|
||||
|
||||
async function notify(ctx, notificationType, message, opt_cacheKey = undefined) {
|
||||
const tenNotificationEnable = ctx.getCfg('notification.enable', cfgNotificationEnable);
|
||||
if (!tenNotificationEnable) {
|
||||
return;
|
||||
}
|
||||
ctx.logger.debug('Notification service: notify "%s"', notificationType);
|
||||
|
||||
const tenRule = ctx.getCfg(`notification.rules.${notificationType}`, config.get(`notification.rules.${notificationType}`));
|
||||
if (tenRule) {
|
||||
if (tenRule?.enable) {
|
||||
ctx.logger.debug('Notification service: notify "%s"', notificationType);
|
||||
let checkRes = await checkRulePolicies(ctx, notificationType, tenRule, opt_cacheKey);
|
||||
if (checkRes) {
|
||||
await notifyRule(ctx, tenRule, message);
|
||||
|
||||
Reference in New Issue
Block a user