zahmis 5 лет назад
Родитель
Сommit
ebdadb4fb6
2 измененных файлов с 13 добавлено и 14 удалено
  1. 7 7
      src/server/routes/apiv3/slack-bot-setting.js
  2. 6 7
      src/server/service/config-loader.js

+ 7 - 7
src/server/routes/apiv3/slack-bot-setting.js

@@ -68,20 +68,20 @@ module.exports = (crowi) => {
     const slackBotSettingParams = {
 
       generalSlackBot: {
-        isCustomNonProxyEnabled: await crowi.configManager.getConfig('crowi', ''),
-        // isCustomWithProxyEnabled: ,
-        // isOfficialEnabled: ,
+        isOfficialEnabled: await crowi.configManager.getConfig('crowi', 'slackbot:isOfficialEnabled'),
+        isCustomNonProxyEnabled: await crowi.configManager.getConfig('crowi', 'slackbot:isCustomNonProxyEnabled'),
+        isCustomWithProxyEnabled: await crowi.configManager.getConfig('crowi', 'slackbot:isCustomWithProxyEnabled'),
       },
       // TODO impl when creating official bot
-      // officialBotSettings: {
-      // },
+      officialBotSettings: {
+      },
       cusotmBotSettingsNonProxy: {
         slackSigningSecret: await crowi.configManager.getConfig('crowi', 'slackbot:signingSecret'),
         slackBotToken: await crowi.configManager.getConfig('crowi', 'slackbot:token'),
       },
       // TODO imple when creating with proxy
-      // cusotmBotSettingsWithProxy: {
-      // },
+      cusotmBotSettingsWithProxy: {
+      },
 
     };
     return res.apiv3({ slackBotSettingParams });

+ 6 - 7
src/server/service/config-loader.js

@@ -410,6 +410,12 @@ const ENV_VAR_NAME_TO_CONFIG_INFO = {
     type:    TYPES.STRING,
     default: null,
   },
+  OFFICIAL_BOT_ENABLED: {
+    ns:      'crowi',
+    key:     'slackbot:isOfficialEnabled',
+    type:    TYPES.BOOLEAN,
+    default: true,
+  },
   CUSTOM_BOT_NON_PROXY_ENABLED: {
     ns:      'crowi',
     key:     'slackbot:isCustomNonProxyEnabled',
@@ -422,13 +428,6 @@ const ENV_VAR_NAME_TO_CONFIG_INFO = {
     type:    TYPES.BOOLEAN,
     default: false,
   },
-  OFFICIAL_BOT_ENABLED: {
-    ns:      'crowi',
-    key:     'slackbot:isOfficialEnabled',
-    type:    TYPES.BOOLEAN,
-    default: false,
-  },
-
 };
 
 class ConfigLoader {