zahmis 4 лет назад
Родитель
Сommit
767616b4a8

+ 1 - 0
config/env.dev.js

@@ -28,4 +28,5 @@ module.exports = {
   SALT_FOR_PTOG_TOKEN: 'growi',
   SALT_FOR_PTOG_TOKEN: 'growi',
   // GROWI_CLOUD_URI: 'http://growi.cloud',
   // GROWI_CLOUD_URI: 'http://growi.cloud',
   // GROWI_APP_ID_FOR_GROWI_CLOUD: '012345',
   // GROWI_APP_ID_FOR_GROWI_CLOUD: '012345',
+  OFFICIAL_BOT_PROXY_URL: 'https://slackbot-proxy.growi.org',
 };
 };

+ 0 - 1
packages/slackbot-proxy/.env

@@ -1,3 +1,2 @@
 SLACK_INSTALLPROVIDER_STATE_SECRET=change-it
 SLACK_INSTALLPROVIDER_STATE_SECRET=change-it
 OFFICIAL_MODE=false
 OFFICIAL_MODE=false
-OFFICIAL_BOT_PROXY_URL =https://slackbot-proxy.growi.org

+ 2 - 1
packages/slackbot-proxy/src/services/RegisterService.ts

@@ -8,6 +8,7 @@ import { Installation } from '~/entities/installation';
 import { InvalidUrlError } from '../models/errors';
 import { InvalidUrlError } from '../models/errors';
 
 
 const isProduction = process.env.NODE_ENV === 'production';
 const isProduction = process.env.NODE_ENV === 'production';
+const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
 
 
 @Service()
 @Service()
 export class RegisterService implements GrowiCommandProcessor {
 export class RegisterService implements GrowiCommandProcessor {
@@ -98,7 +99,7 @@ export class RegisterService implements GrowiCommandProcessor {
 
 
     const client = new WebClient(botToken, { logLevel: isProduction ? LogLevel.DEBUG : LogLevel.INFO });
     const client = new WebClient(botToken, { logLevel: isProduction ? LogLevel.DEBUG : LogLevel.INFO });
 
 
-    if (serverUri === process.env.OFFICIAL_BOT_PROXY_URL) {
+    if (isOfficialMode) {
       await client.chat.postEphemeral({
       await client.chat.postEphemeral({
         channel,
         channel,
         user: payload.user.id,
         user: payload.user.id,