yusuketk 5 лет назад
Родитель
Сommit
f23c7dc948
2 измененных файлов с 22 добавлено и 0 удалено
  1. 6 0
      src/client/js/services/AdminAppContainer.js
  2. 16 0
      src/server/routes/apiv3/app-settings.js

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

@@ -37,6 +37,9 @@ export default class AdminAppContainer extends Container {
       bucket: '',
       bucket: '',
       accessKeyId: '',
       accessKeyId: '',
       secretAccessKey: '',
       secretAccessKey: '',
+      envGcsApiKeyJsonPath: '',
+      envGcsBucket: '',
+      envGcsUploadNamespace: '',
       isEnabledPlugins: true,
       isEnabledPlugins: true,
     };
     };
 
 
@@ -78,6 +81,9 @@ export default class AdminAppContainer extends Container {
       bucket: appSettingsParams.bucket,
       bucket: appSettingsParams.bucket,
       accessKeyId: appSettingsParams.accessKeyId,
       accessKeyId: appSettingsParams.accessKeyId,
       secretAccessKey: appSettingsParams.secretAccessKey,
       secretAccessKey: appSettingsParams.secretAccessKey,
+      envGcsApiKeyJsonPath: appSettingsParams.envGcsApiKeyJsonPath,
+      envGcsBucket: appSettingsParams.envGcsBucket,
+      envGcsUploadNamespace: appSettingsParams.envGcsUploadNamespace,
       isEnabledPlugins: appSettingsParams.isEnabledPlugins,
       isEnabledPlugins: appSettingsParams.isEnabledPlugins,
     });
     });
   }
   }

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

@@ -105,6 +105,19 @@ const ErrorV3 = require('../../models/vo/error-apiv3');
  *          secretAccessKey:
  *          secretAccessKey:
  *            type: string
  *            type: string
  *            description: secret key for authentification of AWS
  *            description: secret key for authentification of AWS
+ *      FileUploadSettingParams:
+ *        description: FileUploadSettingParams
+ *        type: object
+ *        properties:
+ *          envGcsApiKeyJsonPath:
+ *            type: string
+ *            description: Path of the JSON file that contains service account key to authenticate to GCP API
+ *          envGcsBucket:
+ *            type: string
+ *            description: Name of the GCS bucket
+ *          envGcsUploadNamespace:
+ *            type: string
+ *            description: Directory name to create in the bucket
  *      PluginSettingParams:
  *      PluginSettingParams:
  *        description: PluginSettingParams
  *        description: PluginSettingParams
  *        type: object
  *        type: object
@@ -200,6 +213,9 @@ module.exports = (crowi) => {
       bucket: crowi.configManager.getConfig('crowi', 'aws:bucket'),
       bucket: crowi.configManager.getConfig('crowi', 'aws:bucket'),
       accessKeyId: crowi.configManager.getConfig('crowi', 'aws:accessKeyId'),
       accessKeyId: crowi.configManager.getConfig('crowi', 'aws:accessKeyId'),
       secretAccessKey: crowi.configManager.getConfig('crowi', 'aws:secretAccessKey'),
       secretAccessKey: crowi.configManager.getConfig('crowi', 'aws:secretAccessKey'),
+      envGcsApiKeyJsonPath: crowi.configManager.getConfigFromEnvVars('crowi', 'gcs:apiKeyJsonPath'),
+      envGcsBucket: crowi.configManager.getConfigFromEnvVars('crowi', 'gcs:bucket'),
+      envGcsUploadNamespace: crowi.configManager.getConfigFromEnvVars('crowi', 'gcs:uploadNamespace'),
       isEnabledPlugins: crowi.configManager.getConfig('crowi', 'plugin:isEnabledPlugins'),
       isEnabledPlugins: crowi.configManager.getConfig('crowi', 'plugin:isEnabledPlugins'),
     };
     };
     return res.apiv3({ appSettingsParams });
     return res.apiv3({ appSettingsParams });