Browse Source

refs 114331: get actual val for wikiType

Futa Arai 3 years ago
parent
commit
ad6de9d8d1

+ 1 - 1
packages/app/src/interfaces/questionnaire/growi-info.ts

@@ -6,7 +6,7 @@ export const GrowiServiceType = {
   onPremise: 'on-premise',
   others: 'others',
 } as const;
-const GrowiWikiType = { open: 'open', closed: 'closed' } as const;
+export const GrowiWikiType = { open: 'open', closed: 'closed' } as const;
 const GrowiAttachmentType = {
   aws: 'aws',
   gcs: 'gcs',

+ 5 - 2
packages/app/src/server/service/questionnaire.ts

@@ -1,7 +1,7 @@
 import crypto from 'crypto';
 import * as os from 'node:os';
 
-import { IGrowiInfo } from '~/interfaces/questionnaire/growi-info';
+import { GrowiWikiType, IGrowiInfo } from '~/interfaces/questionnaire/growi-info';
 import { StatusType } from '~/interfaces/questionnaire/questionnaire-answer-status';
 import { IUserInfo, UserType } from '~/interfaces/questionnaire/user-info';
 import { IUserHasId } from '~/interfaces/user';
@@ -31,6 +31,9 @@ class QuestionnaireService {
     const currentUsersCount = await User.countDocuments();
     const currentActiveUsersCount = await User.countActiveUsers();
 
+    const wikiMode = this.crowi.configManager.getConfig('crowi', 'security:wikiMode');
+    const wikiType = wikiMode === 'private' ? GrowiWikiType.closed : GrowiWikiType.open;
+
     return {
       version: this.crowi.version,
       osInfo: {
@@ -44,7 +47,7 @@ class QuestionnaireService {
       type: this.crowi.configManager.getConfig('crowi', 'app:serviceType'),
       currentUsersCount,
       currentActiveUsersCount,
-      wikiType: 'open', // TODO: set actual value
+      wikiType,
       attachmentType: this.crowi.configManager.getConfig('crowi', 'app:fileUploadType'),
       activeExternalAccountTypes: undefined, // TODO: set actual value
       deploymentType: this.crowi.configManager.getConfig('crowi', 'app:deploymentType'),