Просмотр исходного кода

Merge branch 'feat/GW-4172-control-priority-of-config-about-file-uploader' into feat/4172-4175-expand-form-for-local-gridfs

itizawa 5 лет назад
Родитель
Сommit
934b81e940

+ 10 - 10
.github/workflows/ci.yml

@@ -23,7 +23,7 @@ jobs:
         node-version: ${{ matrix.node-version }}
     - name: Cache/Restore node_modules
       id: cache-dependencies
-      uses: actions/cache@v1
+      uses: actions/cache@v2
       with:
         path: node_modules
         key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
@@ -33,7 +33,7 @@ jobs:
       run: echo "::set-output name=dir::$(yarn cache dir)"
     - name: Cache/Restore yarn cache
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
-      uses: actions/cache@v1
+      uses: actions/cache@v2
       with:
         path: ${{ steps.cache-yarn.outputs.dir }}
         key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
@@ -78,7 +78,7 @@ jobs:
         node-version: ${{ matrix.node-version }}
     - name: Cache/Restore node_modules
       id: cache-dependencies
-      uses: actions/cache@v1
+      uses: actions/cache@v2
       with:
         path: node_modules
         key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
@@ -88,7 +88,7 @@ jobs:
       run: echo "::set-output name=dir::$(yarn cache dir)"
     - name: Cache/Restore yarn cache
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
-      uses: actions/cache@v1
+      uses: actions/cache@v2
       with:
         path: ${{ steps.cache-yarn.outputs.dir }}
         key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
@@ -139,7 +139,7 @@ jobs:
         node-version: ${{ matrix.node-version }}
     - name: Cache/Restore node_modules
       id: cache-dependencies
-      uses: actions/cache@v1
+      uses: actions/cache@v2
       with:
         path: node_modules
         key: ${{ runner.OS }}-node_modules_dev-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
@@ -151,7 +151,7 @@ jobs:
         echo ::set-output name=Ym::$(date '+%Y%m')
         echo ::set-output name=Y::$(date '+%Y')
     - name: Cache/Restore node_modules/.cache/hard-source
-      uses: actions/cache@v1
+      uses: actions/cache@v2
       with:
         path: node_modules/.cache
         key: ${{ runner.OS }}-hard_source_webpack_dev-${{ matrix.node-version }}-${{ steps.date.outputs.YmdH }}
@@ -165,7 +165,7 @@ jobs:
       run: echo "::set-output name=dir::$(yarn cache dir)"
     - name: Cache/Restore yarn cache
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
-      uses: actions/cache@v1
+      uses: actions/cache@v2
       with:
         path: ${{ steps.cache-yarn.outputs.dir }}
         key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
@@ -216,7 +216,7 @@ jobs:
         echo ::set-output name=Ym::$(date '+%Y%m')
         echo ::set-output name=Y::$(date '+%Y')
     - name: Cache/Restore node_modules
-      uses: actions/cache@v1
+      uses: actions/cache@v2
       with:
         path: node_modules
         key: ${{ runner.OS }}-node_modules_prod-${{ matrix.node-version }}-${{ steps.date.outputs.YmdH }}
@@ -228,7 +228,7 @@ jobs:
       id: cache-yarn
       run: echo "::set-output name=dir::$(yarn cache dir)"
     - name: Cache/Restore yarn cache
-      uses: actions/cache@v1
+      uses: actions/cache@v2
       with:
         path: ${{ steps.cache-yarn.outputs.dir }}
         key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
@@ -265,7 +265,7 @@ jobs:
         MONGO_URI: mongodb://localhost:27017/growi
 
     - name: Upload report as artifact
-      uses: actions/upload-artifact@v1
+      uses: actions/upload-artifact@v2
       with:
         name: Report
         path: report

+ 1 - 1
.github/workflows/release-rc.yml

@@ -15,7 +15,7 @@ jobs:
     - uses: actions/checkout@v2
 
     - name: Set up Docker Buildx
-      uses: crazy-max/ghaction-docker-buildx@v3
+      uses: docker/setup-buildx-action@v1
 
     - name: Login to docker.io registry
       run: |

+ 7 - 7
.github/workflows/release.yml

@@ -72,7 +72,7 @@ jobs:
         echo ::set-env name=SUFFIX::$suffix
 
     - name: Set up Docker Buildx
-      uses: crazy-max/ghaction-docker-buildx@v3
+      uses: docker/setup-buildx-action@v1
 
     - name: Login to docker.io registry
       run: |
@@ -105,12 +105,12 @@ jobs:
         created_tag: 'v${{ needs.github-release.outputs.RELEASE_VERSION }}${{ env.SUFFIX }}'
 
     - name: Update Docker Hub Description
-      uses: peter-evans/dockerhub-description@v2.1.0
-      env:
-        DOCKERHUB_USERNAME: wsmoogle
-        DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
-        DOCKERHUB_REPOSITORY: weseek/growi
-        README_FILEPATH: ./docker/README.md
+      uses: peter-evans/dockerhub-description@v2
+      with:
+        username: wsmoogle
+        password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
+        repository: weseek/growi
+        readme-filepath: ./docker/README.md
 
     - name: Check whether workspace is clean
       run: |

+ 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)",
     "local_label": "Local",
     "gridfs_label": "MongoDB(GridFS)",
     "file_upload": "This is for uploading file settings. If you complete file upload settings, file upload function, profile picture function etc will be enabled.",
@@ -61,7 +61,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)",
     "local_label": "Local",
     "gridfs_label": "MongoDB(GridFS)",
     "fixed_by_env_var": "環境変数 <code>FILE_UPLOAD={{fileUploadType}}</code> により固定されています。",
@@ -61,7 +61,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 - 6
resource/locales/zh_CN/admin/admin.json

@@ -43,12 +43,10 @@
     "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)",
     "local_label": "Local",
     "gridfs_label": "MongoDB(GridFS)",
-		"fixed_by_env_var": "这是由env var<code>FILE_UPLOAD={{fileUploadType}}</code>修复的。",
-    "file_upload": "这是文件上传设定。完成了文件上传设定以后,文件上传功能、档案头像功能将会被开启。",
     "ses_settings":"SES设置",
     "test_connection": "测试邮件服务器连接",
 		"": "如果您没有SMTP设置,电子邮件将通过SES发送。您需要从电子邮件地址和生产设置进行验证。",
@@ -62,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', 'local', 'gridfs'];
+  const fileUploadTypes = ['aws', 'gcs', 'local', 'gridfs'];
 
   async function submitFileUploadTypeHandler() {
     const { t } = props;
@@ -78,7 +78,7 @@ function FileUploadSetting(props) {
       <AdminUpdateButtonRow onClick={submitFileUploadTypeHandler} disabled={adminAppContainer.state.retrieveError != null} />
 
       {fileUploadType === 'aws' && <AwsSetting />}
-      {fileUploadType === 'gcp' && <GcpSettings />}
+      {fileUploadType === 'gcs' && <GcsSettings />}
 
 
     </React.Fragment>

+ 23 - 43
src/client/js/components/Admin/App/GcpSettings.jsx → src/client/js/components/Admin/App/GcsSettings.jsx

@@ -4,38 +4,35 @@ import PropTypes from 'prop-types';
 import { withTranslation } from 'react-i18next';
 
 import { withUnstatedContainers } from '../../UnstatedUtils';
-import { toastSuccess, toastError } from '../../../util/apiNotification';
 
 import AppContainer from '../../../services/AppContainer';
 import AdminAppContainer from '../../../services/AdminAppContainer';
-import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
 
 
-function GcpSetting(props) {
+function GcsSetting(props) {
   const { t, adminAppContainer } = props;
-
-  async function submitHandler() {
-    const { t } = props;
-
-    try {
-      await adminAppContainer.updateGcpSettingHandler();
-      toastSuccess(t('toaster.update_successed', { target: t('admin:app_setting.file_upload_settings') }));
-    }
-    catch (err) {
-      toastError(err);
-    }
-  }
+  const { gcsUseOnlyEnvVars } = adminAppContainer.state;
 
   return (
     <>
-      <table className="table settings-table">
+      {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>
+          <tr>
+            <th></th>
+            <th>Database</th>
+            <th>Environment variables</th>
+          </tr>
         </thead>
         <tbody>
           <tr>
@@ -45,18 +42,13 @@ function GcpSetting(props) {
                 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"
-              />
+              <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' }) }} />
@@ -70,18 +62,13 @@ function GcpSetting(props) {
                 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"
-              />
+              <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' }) }} />
@@ -95,18 +82,13 @@ function GcpSetting(props) {
                 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"
-              />
+              <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' }) }} />
@@ -115,8 +97,6 @@ function GcpSetting(props) {
           </tr>
         </tbody>
       </table>
-
-      <AdminUpdateButtonRow onClick={submitHandler} disabled={adminAppContainer.state.retrieveError != null} />
     </>
   );
 
@@ -125,12 +105,12 @@ function GcpSetting(props) {
 /**
  * Wrapper component for using unstated
  */
-const GcpSettingWrapper = withUnstatedContainers(GcpSetting, [AppContainer, AdminAppContainer]);
+const GcsSettingWrapper = withUnstatedContainers(GcsSetting, [AppContainer, AdminAppContainer]);
 
-GcpSetting.propTypes = {
+GcsSetting.propTypes = {
   t: PropTypes.func.isRequired, // i18next
   appContainer: PropTypes.instanceOf(AppContainer).isRequired,
   adminAppContainer: PropTypes.instanceOf(AdminAppContainer).isRequired,
 };
 
-export default withTranslation()(GcpSettingWrapper);
+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}
             />

+ 1 - 1
src/client/js/components/Admin/MarkdownSetting/LineBreakForm.jsx

@@ -79,7 +79,7 @@ class LineBreakForm extends React.Component {
             onChange={() => { adminMarkDownContainer.setState({ isEnabledLinebreaksInComments: !isEnabledLinebreaksInComments }) }}
           />
           <label className="custom-control-label" htmlFor="isEnabledLinebreaksInComments">
-            {t('admin:markdown_setting.lineBreak_options.enable_lineBreak') }
+            {t('admin:markdown_setting.lineBreak_options.enable_lineBreak_for_comment') }
           </label>
         </div>
         <p className="form-text text-muted" dangerouslySetInnerHTML={helpLineBreakInComment} />

+ 9 - 13
src/client/js/services/AdminAppContainer.js

@@ -39,6 +39,7 @@ export default class AdminAppContainer extends Container {
       envFileUploadType: '',
       isFixedFileUploadByEnvVar: false,
 
+      gcsUseOnlyEnvVars: false,
       gcsApiKeyJsonPath: '',
       envGcsApiKeyJsonPath: '',
       gcsBucket: '',
@@ -91,12 +92,14 @@ export default class AdminAppContainer extends Container {
 
       fileUploadType: appSettingsParams.fileUploadType,
       envFileUploadType: appSettingsParams.envFileUploadType,
+      isFileUploadEnvPrioritized: appSettingsParams.isFileUploadEnvPrioritized,
 
       s3Region: appSettingsParams.s3Region,
       s3CustomEndpoint: appSettingsParams.s3CustomEndpoint,
       s3Bucket: appSettingsParams.s3Bucket,
       s3AccessKeyId: appSettingsParams.s3AccessKeyId,
       s3SecretAccessKey: appSettingsParams.s3SecretAccessKey,
+      gcsUseOnlyEnvVars: appSettingsParams.gcsUseOnlyEnvVars,
       gcsApiKeyJsonPath: appSettingsParams.gcsApiKeyJsonPath,
       gcsBucket: appSettingsParams.gcsBucket,
       gcsUploadNamespace: appSettingsParams.gcsUploadNamespace,
@@ -106,21 +109,14 @@ export default class AdminAppContainer extends Container {
       isEnabledPlugins: appSettingsParams.isEnabledPlugins,
     });
 
-    // check is file upload type forced
-    if (this.isFixedFileUploadByEnvVar(appSettingsParams.envFileUploadType)) {
+    // if isFileUploadEnvPrioritized is true, get fileUploadType from only env var and make the forms fixed.
+    // and if env var 'FILE_UPLOAD' is null, envFileUploadType is 'aws' that is default value of 'FILE_UPLOAD'.
+    if (appSettingsParams.isFileUploadEnvPrioritized) {
       this.setState({ fileUploadType: appSettingsParams.envFileUploadType });
       this.setState({ isFixedFileUploadByEnvVar: true });
     }
   }
 
-  /**
-   * get isFixedFileUploadByEnvVar
-   * @return {bool} isFixedFileUploadByEnvVar
-   */
-  isFixedFileUploadByEnvVar(envFileUploadType) {
-    return envFileUploadType != null;
-  }
-
   /**
    * Change title
    */
@@ -374,12 +370,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,

+ 17 - 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:
@@ -182,7 +182,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(),
@@ -236,12 +236,14 @@ module.exports = (crowi) => {
 
       fileUploadType: crowi.configManager.getConfig('crowi', 'app:fileUploadType'),
       envFileUploadType: crowi.configManager.getConfigFromEnvVars('crowi', 'app:fileUploadType'),
+      isFileUploadEnvPrioritized: crowi.configManager.getConfigFromEnvVars('crowi', 'app:isFileUploadEnvPrioritized'),
 
       s3Region: crowi.configManager.getConfig('crowi', 'aws:s3Region'),
       s3CustomEndpoint: crowi.configManager.getConfig('crowi', 'aws:s3CustomEndpoint'),
       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'),
@@ -614,28 +616,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,
@@ -643,16 +645,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'),

+ 1 - 1
src/server/routes/apiv3/users.js

@@ -156,7 +156,7 @@ module.exports = (crowi) => {
    *                      $ref: '#/components/schemas/PaginateResult'
    */
 
-  router.get('/', validator.statusList, apiV3FormValidator, async(req, res) => {
+  router.get('/', loginRequiredStrictly, validator.statusList, apiV3FormValidator, async(req, res) => {
 
     const page = parseInt(req.query.page) || 1;
     // status

+ 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')
       )
     ));
   }

+ 1 - 1
src/server/views/widget/user_page_content.html

@@ -32,7 +32,7 @@
         <div class="page-list-container">
           {# {% include 'page_list.html' with { pages: bookmarkList, pagePropertyName: 'page' } %} #}
         </div>
-        {# {% endif %} #}
+      {% endif %}
     </div>
 
     <div class="tab-pane user-created-list page-list" id="user-created-list">