فهرست منبع

Merge branch 'feat/GW-3658-can-use-GCP-from-db-vars' into feat/GW-4172-control-priority-of-config-about-file-uploader

# Conflicts:
#	src/server/service/config-loader.js
#	src/server/service/config-manager.js
yusuketk 5 سال پیش
والد
کامیت
755f98fca5

+ 4 - 3
resource/locales/en_US/admin/admin.json

@@ -44,8 +44,8 @@
     "file_upload_settings":"File Upload Settings",
     "file_upload_method":"File Upload Method",
     "fixed_by_env_var": "This is fixed by the env var <code>FILE_UPLOAD={{fileUploadType}}</code>.",
-    "gcp_label": "GCP",
-    "aws_label": "AWS",
+    "gcs_label": "GCP(GCS)",
+    "aws_label": "AWS(S3)",
     "file_upload": "This is for uploading file settings. If you complete file upload settings, file upload function, profile picture function etc will be enabled.",
     "ses_settings":"SES settings",
     "test_connection": "Test connection to mail",
@@ -59,7 +59,8 @@
     "load_plugins": "Load_plugins",
     "enable": "Enable",
     "disable": "Disable",
-    "use_env_var_if_empty": "If the value in the database is empty, the value of the environment variable <cod>{{variable}}</code> is used."
+    "use_env_var_if_empty": "If the value in the database is empty, the value of the environment variable <cod>{{variable}}</code> is used.",
+    "note_for_the_only_env_option": "The GCS Settings is limited by the value of environment variable.<br>To change this setting, please change to false or delete the value of the environment variable <code>{{env}}</code> ."
   },
   "markdown_setting": {
     "lineBreak_header": "Line break setting",

+ 1 - 1
resource/locales/en_US/translation.json

@@ -535,7 +535,7 @@
     "missing mandatory configs": "The following mandatory items are not set in either database nor environment variables.",
     "Local": {
       "name": "ID/Password",
-      "note for the only env option": "The LOCAL authentication is limited by the value of environment variable.<br>To change this setting, please change to false or delete the value of the environment variable <code>{{env}}/code> .",
+      "note for the only env option": "The LOCAL authentication is limited by the value of environment variable.<br>To change this setting, please change to false or delete the value of the environment variable <code>{{env}}</code> .",
       "enable_local": "Enable ID/Password"
     },
     "ldap": {

+ 4 - 3
resource/locales/ja_JP/admin/admin.json

@@ -43,8 +43,8 @@
     "confirm_to_initialize_mail_settings": "一度初期化した設定は戻せません。本当に初期化しますか?",
     "file_upload_settings":"ファイルアップロード設定",
     "file_upload_method":"ファイルアップロード方法",
-    "gcp_label": "GCP",
-    "aws_label": "AWS",
+    "gcs_label": "GCP(GCS)",
+    "aws_label": "AWS(S3)",
     "fixed_by_env_var": "環境変数 <code>FILE_UPLOAD={{fileUploadType}}</code> により固定されています。",
     "file_upload": "ファイルをアップロードするための設定を行います。ファイルアップロードの設定を完了させると、ファイルアップロード機能、プロフィール写真機能などが有効になります。",
     "ses_settings":"SES設定",
@@ -59,7 +59,8 @@
     "load_plugins": "プラグインを読み込む",
     "enable": "有効",
     "disable": "無効",
-    "use_env_var_if_empty": "データベース側の値が空の場合、環境変数 <code>{{variable}}</code> の値を利用します"
+    "use_env_var_if_empty": "データベース側の値が空の場合、環境変数 <code>{{variable}}</code> の値を利用します",
+    "note_for_the_only_env_option": "現在GCS設定は環境変数の値によって制限されています<br>この設定を変更する場合は環境変数 <code>{{env}}</code> の値をfalseに変更もしくは削除してください"
   },
   "markdown_setting": {
     "lineBreak_header": "Line Break設定",

+ 5 - 4
resource/locales/zh_CN/admin/admin.json

@@ -43,8 +43,8 @@
     "confirm_to_initialize_mail_settings": "当前设置将被清空且不可恢复。确认重置?",
     "file_upload_settings":"文件上传设置",
     "file_upload_method":"文件上传方法",
-    "gcp_label": "GCP",
-    "aws_label": "AWS",
+    "gcs_label": "GCP(GCS)",
+    "aws_label": "AWS(S3)",
 		"fixed_by_env_var": "这是由env var<code>FILE_UPLOAD={{fileUploadType}}</code>修复的。",
     "file_upload": "这是文件上传设定。完成了文件上传设定以后,文件上传功能、档案头像功能将会被开启。",
     "ses_settings":"SES设置",
@@ -60,8 +60,9 @@
 		"load_plugins": "加载插件",
 		"enable": "启用",
 		"disable": "停用",
-		"use_env_var_if_empty": "如果数据库中的值为空,则环境变量的值 <cod>{{variable}}</code> 启用。"
-	},
+		"use_env_var_if_empty": "如果数据库中的值为空,则环境变量的值 <cod>{{variable}}</code> 启用。",
+    "note_for_the_only_env_option": "The GCS settings is limited by the value of environment variable.<br>To change this setting, please change to false or delete the value of the environment variable <code>{{env}}</code> ."
+  },
 	"markdown_setting": {
 		"lineBreak_header": "换行设置",
 		"lineBreak_desc": "您可以更改换行设置。",

+ 1 - 1
resource/locales/zh_CN/translation.json

@@ -522,7 +522,7 @@
 		"missing mandatory configs": "The following mandatory items are not set in either database nor environment variables.",
 		"Local": {
 			"name": "ID/Password",
-			"note for the only env option": "The LOCAL authentication is limited by the value of environment variable.<br>To change this setting, please change to false or delete the value of the environment variable <code>{{env}}/code> .",
+			"note for the only env option": "The LOCAL authentication is limited by the value of environment variable.<br>To change this setting, please change to false or delete the value of the environment variable <code>{{env}}</code> .",
 			"enable_local": "Enable ID/Password"
 		},
 		"ldap": {

+ 3 - 3
src/client/js/components/Admin/App/FileUploadSetting.jsx

@@ -10,13 +10,13 @@ import AdminAppContainer from '../../../services/AdminAppContainer';
 import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
 
 import AwsSetting from './AwsSetting';
-import GcpSettings from './GcpSettings';
+import GcsSettings from './GcsSettings';
 
 function FileUploadSetting(props) {
 
   const { t, adminAppContainer } = props;
   const { fileUploadType } = adminAppContainer.state;
-  const fileUploadTypes = ['aws', 'gcp'];
+  const fileUploadTypes = ['aws', 'gcs'];
 
   async function submitHandler() {
     const { t } = props;
@@ -78,7 +78,7 @@ function FileUploadSetting(props) {
       </div>
 
       {fileUploadType === 'aws' && <AwsSetting />}
-      {fileUploadType === 'gcp' && <GcpSettings />}
+      {fileUploadType === 'gcs' && <GcsSettings />}
 
       <AdminUpdateButtonRow onClick={submitHandler} disabled={adminAppContainer.state.retrieveError != null} />
 

+ 0 - 118
src/client/js/components/Admin/App/GcpSettings.jsx

@@ -1,118 +0,0 @@
-
-import React from 'react';
-import PropTypes from 'prop-types';
-import { withTranslation } from 'react-i18next';
-
-import { withUnstatedContainers } from '../../UnstatedUtils';
-
-import AppContainer from '../../../services/AppContainer';
-import AdminAppContainer from '../../../services/AdminAppContainer';
-
-
-function GcpSetting(props) {
-  const { t, adminAppContainer } = props;
-
-  return (
-    <table className="table settings-table">
-      <colgroup>
-        <col className="item-name" />
-        <col className="from-db" />
-        <col className="from-env-vars" />
-      </colgroup>
-      <thead>
-        <tr><th></th><th>Database</th><th>Environment variables</th></tr>
-      </thead>
-      <tbody>
-        <tr>
-          <th>Api Key Json Path</th>
-          <td>
-            <input
-              className="form-control"
-              type="text"
-              name="gcsApiKeyJsonPath"
-              defaultValue={adminAppContainer.state.gcsApiKeyJsonPath}
-              onChange={e => adminAppContainer.changeGcsApiKeyJsonPath(e.target.value)}
-            />
-          </td>
-          <td>
-            <input
-              className="form-control"
-              type="text"
-              value={adminAppContainer.state.envGcsApiKeyJsonPath || ''}
-              readOnly
-              tabIndex="-1"
-            />
-            <p className="form-text text-muted">
-              {/* eslint-disable-next-line react/no-danger */}
-              <small dangerouslySetInnerHTML={{ __html: t('admin:app_setting.use_env_var_if_empty', { variable: 'GCS_API_KEY_JSON_PATH' }) }} />
-            </p>
-          </td>
-        </tr>
-        <tr>
-          <th>{t('admin:app_setting.bucket_name')}</th>
-          <td>
-            <input
-              className="form-control"
-              type="text"
-              name="gcsBucket"
-              defaultValue={adminAppContainer.state.gcsBucket}
-              onChange={e => adminAppContainer.changeGcsBucket(e.target.value)}
-            />
-          </td>
-          <td>
-            <input
-              className="form-control"
-              type="text"
-              value={adminAppContainer.state.envGcsBucket || ''}
-              readOnly
-              tabIndex="-1"
-            />
-            <p className="form-text text-muted">
-              {/* eslint-disable-next-line react/no-danger */}
-              <small dangerouslySetInnerHTML={{ __html: t('admin:app_setting.use_env_var_if_empty', { variable: 'GCS_BUCKET' }) }} />
-            </p>
-          </td>
-        </tr>
-        <tr>
-          <th>Name Space</th>
-          <td>
-            <input
-              className="form-control"
-              type="text"
-              name="gcsUploadNamespace"
-              defaultValue={adminAppContainer.state.gcsUploadNamespace}
-              onChange={e => adminAppContainer.changeGcsUploadNamespace(e.target.value)}
-            />
-          </td>
-          <td>
-            <input
-              className="form-control"
-              type="text"
-              value={adminAppContainer.state.envGcsUploadNamespace || ''}
-              readOnly
-              tabIndex="-1"
-            />
-            <p className="form-text text-muted">
-              {/* eslint-disable-next-line react/no-danger */}
-              <small dangerouslySetInnerHTML={{ __html: t('admin:app_setting.use_env_var_if_empty', { variable: 'GCS_UPLOAD_NAMESPACE' }) }} />
-            </p>
-          </td>
-        </tr>
-      </tbody>
-    </table>
-  );
-
-}
-
-/**
- * Wrapper component for using unstated
- */
-const GcpSettingWrapper = withUnstatedContainers(GcpSetting, [AppContainer, AdminAppContainer]);
-
-GcpSetting.propTypes = {
-  t: PropTypes.func.isRequired, // i18next
-  appContainer: PropTypes.instanceOf(AppContainer).isRequired,
-  adminAppContainer: PropTypes.instanceOf(AdminAppContainer).isRequired,
-};
-
-export default withTranslation()(GcpSettingWrapper);

+ 116 - 0
src/client/js/components/Admin/App/GcsSettings.jsx

@@ -0,0 +1,116 @@
+
+import React from 'react';
+import PropTypes from 'prop-types';
+import { withTranslation } from 'react-i18next';
+
+import { withUnstatedContainers } from '../../UnstatedUtils';
+
+import AppContainer from '../../../services/AppContainer';
+import AdminAppContainer from '../../../services/AdminAppContainer';
+
+
+function GcsSetting(props) {
+  const { t, adminAppContainer } = props;
+  const { gcsUseOnlyEnvVars } = adminAppContainer.state;
+
+  return (
+    <>
+      {gcsUseOnlyEnvVars && (
+        <p
+          className="alert alert-info"
+          dangerouslySetInnerHTML={{ __html: t('admin:app_setting.note_for_the_only_env_option', { env: 'IS_GCS_ENV_PRIORITIZED' }) }}
+        />
+      )}
+      <table className={`table settings-table ${gcsUseOnlyEnvVars && 'use-only-env-vars'}`}>
+        <colgroup>
+          <col className="item-name" />
+          <col className="from-db" />
+          <col className="from-env-vars" />
+        </colgroup>
+        <thead>
+          <tr>
+            <th></th>
+            <th>Database</th>
+            <th>Environment variables</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr>
+            <th>Api Key Json Path</th>
+            <td>
+              <input
+                className="form-control"
+                type="text"
+                name="gcsApiKeyJsonPath"
+                readOnly={gcsUseOnlyEnvVars}
+                defaultValue={adminAppContainer.state.gcsApiKeyJsonPath}
+                onChange={e => adminAppContainer.changeGcsApiKeyJsonPath(e.target.value)}
+              />
+            </td>
+            <td>
+              <input className="form-control" type="text" value={adminAppContainer.state.envGcsApiKeyJsonPath || ''} readOnly tabIndex="-1" />
+              <p className="form-text text-muted">
+                {/* eslint-disable-next-line react/no-danger */}
+                <small dangerouslySetInnerHTML={{ __html: t('admin:app_setting.use_env_var_if_empty', { variable: 'GCS_API_KEY_JSON_PATH' }) }} />
+              </p>
+            </td>
+          </tr>
+          <tr>
+            <th>{t('admin:app_setting.bucket_name')}</th>
+            <td>
+              <input
+                className="form-control"
+                type="text"
+                name="gcsBucket"
+                readOnly={gcsUseOnlyEnvVars}
+                defaultValue={adminAppContainer.state.gcsBucket}
+                onChange={e => adminAppContainer.changeGcsBucket(e.target.value)}
+              />
+            </td>
+            <td>
+              <input className="form-control" type="text" value={adminAppContainer.state.envGcsBucket || ''} readOnly tabIndex="-1" />
+              <p className="form-text text-muted">
+                {/* eslint-disable-next-line react/no-danger */}
+                <small dangerouslySetInnerHTML={{ __html: t('admin:app_setting.use_env_var_if_empty', { variable: 'GCS_BUCKET' }) }} />
+              </p>
+            </td>
+          </tr>
+          <tr>
+            <th>Name Space</th>
+            <td>
+              <input
+                className="form-control"
+                type="text"
+                name="gcsUploadNamespace"
+                readOnly={gcsUseOnlyEnvVars}
+                defaultValue={adminAppContainer.state.gcsUploadNamespace}
+                onChange={e => adminAppContainer.changeGcsUploadNamespace(e.target.value)}
+              />
+            </td>
+            <td>
+              <input className="form-control" type="text" value={adminAppContainer.state.envGcsUploadNamespace || ''} readOnly tabIndex="-1" />
+              <p className="form-text text-muted">
+                {/* eslint-disable-next-line react/no-danger */}
+                <small dangerouslySetInnerHTML={{ __html: t('admin:app_setting.use_env_var_if_empty', { variable: 'GCS_UPLOAD_NAMESPACE' }) }} />
+              </p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </>
+  );
+
+}
+
+/**
+ * Wrapper component for using unstated
+ */
+const GcsSettingWrapper = withUnstatedContainers(GcsSetting, [AppContainer, AdminAppContainer]);
+
+GcsSetting.propTypes = {
+  t: PropTypes.func.isRequired, // i18next
+  appContainer: PropTypes.instanceOf(AppContainer).isRequired,
+  adminAppContainer: PropTypes.instanceOf(AdminAppContainer).isRequired,
+};
+
+export default withTranslation()(GcsSettingWrapper);

+ 4 - 4
src/client/js/components/Admin/Customize/CustomizeFunctionSetting.jsx

@@ -83,28 +83,28 @@ class CustomizeFunctionSetting extends React.Component {
             <PagingSizeUncontrolledDropdown
               label={t('admin:customize_setting.function_options.list_num_s')}
               desc={t('admin:customize_setting.function_options.list_num_desc_s')}
-              toggleLabel={adminCustomizeContainer.state.pageLimitationS}
+              toggleLabel={adminCustomizeContainer.state.pageLimitationS || 20}
               dropdownItemSize={[10, 20, 50, 100]}
               onChangeDropdownItem={adminCustomizeContainer.switchPageListLimitationS}
             />
             <PagingSizeUncontrolledDropdown
               label={t('admin:customize_setting.function_options.list_num_m')}
               desc={t('admin:customize_setting.function_options.list_num_desc_m')}
-              toggleLabel={adminCustomizeContainer.state.pageLimitationM}
+              toggleLabel={adminCustomizeContainer.state.pageLimitationM || 10}
               dropdownItemSize={[5, 10, 20, 50, 100]}
               onChangeDropdownItem={adminCustomizeContainer.switchPageListLimitationM}
             />
             <PagingSizeUncontrolledDropdown
               label={t('admin:customize_setting.function_options.list_num_l')}
               desc={t('admin:customize_setting.function_options.list_num_desc_l')}
-              toggleLabel={adminCustomizeContainer.state.pageLimitationL}
+              toggleLabel={adminCustomizeContainer.state.pageLimitationL || 50}
               dropdownItemSize={[20, 50, 100, 200]}
               onChangeDropdownItem={adminCustomizeContainer.switchPageListLimitationL}
             />
             <PagingSizeUncontrolledDropdown
               label={t('admin:customize_setting.function_options.list_num_xl')}
               desc={t('admin:customize_setting.function_options.list_num_desc_xl')}
-              toggleLabel={adminCustomizeContainer.state.pageLimitationXL}
+              toggleLabel={adminCustomizeContainer.state.pageLimitationXL || 20}
               dropdownItemSize={[5, 10, 20, 50, 100]}
               onChangeDropdownItem={adminCustomizeContainer.switchPageListLimitationXL}
             />

+ 6 - 4
src/client/js/services/AdminAppContainer.js

@@ -39,6 +39,7 @@ export default class AdminAppContainer extends Container {
       envFileUploadType: '',
       isFixedFileUploadByEnvVar: false,
 
+      gcsUseOnlyEnvVars: false,
       gcsApiKeyJsonPath: '',
       envGcsApiKeyJsonPath: '',
       gcsBucket: '',
@@ -97,6 +98,7 @@ export default class AdminAppContainer extends Container {
       s3Bucket: appSettingsParams.s3Bucket,
       s3AccessKeyId: appSettingsParams.s3AccessKeyId,
       s3SecretAccessKey: appSettingsParams.s3SecretAccessKey,
+      gcsUseOnlyEnvVars: appSettingsParams.gcsUseOnlyEnvVars,
       gcsApiKeyJsonPath: appSettingsParams.gcsApiKeyJsonPath,
       gcsBucket: appSettingsParams.gcsBucket,
       gcsUploadNamespace: appSettingsParams.gcsUploadNamespace,
@@ -364,7 +366,7 @@ export default class AdminAppContainer extends Container {
     if (this.state.fileUploadType === 'aws') {
       return this.updateAwsSettingHandler();
     }
-    return this.updateGcpSettingHandler();
+    return this.updateGcsSettingHandler();
   }
 
   /**
@@ -386,12 +388,12 @@ export default class AdminAppContainer extends Container {
   }
 
   /**
-   * Update GCP setting
+   * Update GCS setting
    * @memberOf AdminAppContainer
    * @return {Array} Appearance
    */
-  async updateGcpSettingHandler() {
-    const response = await this.appContainer.apiv3.put('/app-settings/gcp-setting', {
+  async updateGcsSettingHandler() {
+    const response = await this.appContainer.apiv3.put('/app-settings/gcs-setting', {
       fileUploadType: this.state.fileUploadType,
       gcsApiKeyJsonPath: this.state.gcsApiKeyJsonPath,
       gcsBucket: this.state.gcsBucket,

+ 4 - 4
src/client/js/services/AdminCustomizeContainer.js

@@ -28,10 +28,10 @@ export default class AdminCustomizeContainer extends Container {
       isSavedStatesOfTabChanges: false,
       isEnabledAttachTitleHeader: false,
 
-      pageLimitationS: 20,
-      pageLimitationM: 10,
-      pageLimitationL: 50,
-      pageLimitationXL: 20,
+      pageLimitationS: null,
+      pageLimitationM: null,
+      pageLimitationL: null,
+      pageLimitationXL: null,
 
       isEnabledStaleNotification: false,
       isAllReplyShown: false,

+ 16 - 15
src/server/routes/apiv3/app-settings.js

@@ -105,8 +105,8 @@ const ErrorV3 = require('../../models/vo/error-apiv3');
  *          secretAccessKey:
  *            type: string
  *            description: secret key for authentification of AWS
- *      GcpSettingParams:
- *        description: GcpSettingParams
+ *      GcsSettingParams:
+ *        description: GcsSettingParams
  *        type: object
  *        properties:
  *          gcsApiKeyJsonPath:
@@ -175,7 +175,7 @@ module.exports = (crowi) => {
       body('s3AccessKeyId').trim().if(value => value !== '').matches(/^[\da-zA-Z]+$/),
       body('s3SecretAccessKey').trim(),
     ],
-    gcpSetting: [
+    gcsSetting: [
       body('gcsApiKeyJsonPath').trim(),
       body('gcsBucket').trim(),
       body('gcsUploadNamespace').trim(),
@@ -232,6 +232,7 @@ module.exports = (crowi) => {
       s3Bucket: crowi.configManager.getConfig('crowi', 'aws:s3Bucket'),
       s3AccessKeyId: crowi.configManager.getConfig('crowi', 'aws:s3AccessKeyId'),
       s3SecretAccessKey: crowi.configManager.getConfig('crowi', 'aws:s3SecretAccessKey'),
+      gcsUseOnlyEnvVars: crowi.configManager.getConfig('crowi', 'gcs:isGcsEnvPrioritizes'),
       gcsApiKeyJsonPath: crowi.configManager.getConfig('crowi', 'gcs:apiKeyJsonPath'),
       gcsBucket: crowi.configManager.getConfig('crowi', 'gcs:bucket'),
       gcsUploadNamespace: crowi.configManager.getConfig('crowi', 'gcs:uploadNamespace'),
@@ -604,28 +605,28 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /app-settings/gcp-setting:
+   *    /app-settings/gcs-setting:
    *      put:
    *        tags: [AppSettings]
-   *        operationId: updateAppSettingGcpSetting
-   *        summary: /app-settings/gcp-setting
-   *        description: Update gcp setting
+   *        operationId: updateAppSettingGcsSetting
+   *        summary: /app-settings/gcs-setting
+   *        description: Update gcs setting
    *        requestBody:
    *          required: true
    *          content:
    *            application/json:
    *              schema:
-   *                $ref: '#/components/schemas/GcpSettingParams'
+   *                $ref: '#/components/schemas/GcsSettingParams'
    *        responses:
    *          200:
-   *            description: Succeeded to update gcp setting
+   *            description: Succeeded to update gcs setting
    *            content:
    *              application/json:
    *                schema:
-   *                  $ref: '#/components/schemas/GcpSettingParams'
+   *                  $ref: '#/components/schemas/GcsSettingParams'
    */
-  router.put('/gcp-setting', loginRequiredStrictly, adminRequired, csrf, validator.gcpSetting, apiV3FormValidator, async(req, res) => {
-    const requestGcpSettingParams = {
+  router.put('/gcs-setting', loginRequiredStrictly, adminRequired, csrf, validator.gcsSetting, apiV3FormValidator, async(req, res) => {
+    const requestGcsSettingParams = {
       'app:fileUploadType': req.body.fileUploadType,
       'gcs:apiKeyJsonPath': req.body.gcsApiKeyJsonPath,
       'gcs:bucket': req.body.gcsBucket,
@@ -633,16 +634,16 @@ module.exports = (crowi) => {
     };
 
     try {
-      await crowi.configManager.updateConfigsInTheSameNamespace('crowi', requestGcpSettingParams, true);
+      await crowi.configManager.updateConfigsInTheSameNamespace('crowi', requestGcsSettingParams, true);
       await crowi.setUpFileUpload(true);
       crowi.fileUploaderSwitchService.publishUpdatedMessage();
 
-      const gcpSettingParams = {
+      const gcsSettingParams = {
         gcsApiKeyJsonPath: crowi.configManager.getConfig('crowi', 'gcs:apiKeyJsonPath'),
         gcsBucket: crowi.configManager.getConfig('crowi', 'gcs:bucket'),
         gcsUploadNamespace: crowi.configManager.getConfig('crowi', 'gcs:uploadNamespace'),
       };
-      return res.apiv3({ gcpSettingParams });
+      return res.apiv3({ gcsSettingParams });
     }
     catch (err) {
       const msg = 'Error occurred in updating aws setting';

+ 4 - 4
src/server/routes/apiv3/customize-setting.js

@@ -156,10 +156,10 @@ module.exports = (crowi) => {
       isEnabledTimeline: await crowi.configManager.getConfig('crowi', 'customize:isEnabledTimeline'),
       isSavedStatesOfTabChanges: await crowi.configManager.getConfig('crowi', 'customize:isSavedStatesOfTabChanges'),
       isEnabledAttachTitleHeader: await crowi.configManager.getConfig('crowi', 'customize:isEnabledAttachTitleHeader'),
-      pageLimitationS: await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationS') || 20,
-      pageLimitationM: await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationM') || 10,
-      pageLimitationL: await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationL') || 50,
-      pageLimitationXL: await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationXL') || 20,
+      pageLimitationS: await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationS'),
+      pageLimitationM: await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationM'),
+      pageLimitationL: await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationL'),
+      pageLimitationXL: await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationXL'),
       isEnabledStaleNotification: await crowi.configManager.getConfig('crowi', 'customize:isEnabledStaleNotification'),
       isAllReplyShown: await crowi.configManager.getConfig('crowi', 'customize:isAllReplyShown'),
       styleName: await crowi.configManager.getConfig('crowi', 'customize:highlightJsStyle'),

+ 2 - 2
src/server/service/config-loader.js

@@ -350,9 +350,9 @@ const ENV_VAR_NAME_TO_CONFIG_INFO = {
     type:    TYPES.STRING,
     default: null,
   },
-  IS_GCP_ENV_PRIORITIZED: {
+  IS_GCS_ENV_PRIORITIZED: {
     ns:      'crowi',
-    key:     'gcs:isGcpEnvPrioritized',
+    key:     'gcs:isGcsEnvPrioritized',
     type:    TYPES.BOOLEAN,
     default: false,
   },

+ 4 - 4
src/server/service/config-manager.js

@@ -28,7 +28,7 @@ const KEYS_FOR_FIEL_UPLOAD_USE_ONLY_ENV_OPTION = [
   'app:fileUploadType',
 ];
 
-const KEYS_FOR_GCP_USE_ONLY_ENV_OPTION = [
+const KEYS_FOR_GCS_USE_ONLY_ENV_OPTION = [
   'gcs:apiKeyJsonPath',
   'gcs:bucket',
   'gcs:uploadNamespace',
@@ -233,10 +233,10 @@ class ConfigManager extends S2sMessageHandlable {
         KEYS_FOR_FIEL_UPLOAD_USE_ONLY_ENV_OPTION.includes(key)
         && this.searchOnlyFromEnvVarConfigs('crowi', 'app:isFileUploadEnvPrioritized')
       )
-      // gcp option
+      // gcs option
       || (
-        KEYS_FOR_GCP_USE_ONLY_ENV_OPTION.includes(key)
-        && this.searchOnlyFromEnvVarConfigs('crowi', 'gcs:isGcpEnvPrioritized')
+        KEYS_FOR_GCS_USE_ONLY_ENV_OPTION.includes(key)
+        && this.searchOnlyFromEnvVarConfigs('crowi', 'gcs:isGcsEnvPrioritized')
       )
     ));
   }