diff --git a/packages/nocodb/src/lib/noco/meta/helpers/NcPluginMgrv2.ts b/packages/nocodb/src/lib/noco/meta/helpers/NcPluginMgrv2.ts index 0f24a889e4..36d689a82a 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/NcPluginMgrv2.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/NcPluginMgrv2.ts @@ -80,6 +80,14 @@ class NcPluginMgrv2 { category: plugin.category, input_schema: JSON.stringify(plugin.inputs) }); + } else if (pluginConfig.version !== plugin.version) { + await ncMeta.metaUpdate( + null, + null, + MetaTable.PLUGIN, + plugin, + pluginConfig.id + ); } /* init only the active plugins */ diff --git a/packages/nocodb/src/plugins/gcs/Gcs.ts b/packages/nocodb/src/plugins/gcs/Gcs.ts index 3c97f1c5a5..b7fc9b4f7a 100644 --- a/packages/nocodb/src/plugins/gcs/Gcs.ts +++ b/packages/nocodb/src/plugins/gcs/Gcs.ts @@ -68,9 +68,16 @@ export default class Gcs implements IStorageAdapterV2 { // this.bucketName = process.env.NC_GCS_BUCKET; options.credentials = { client_email: this.input.client_email, - private_key: this.input.private_key + // replace \n with real line breaks to avoid + // error:0909006C:PEM routines:get_name:no start line + private_key: this.input.private_key.replace(/\\n/gm, '\n') }; + // default project ID would be used if it is not provided + if (this.input.project_id) { + options.projectId = this.input.project_id + } + this.bucketName = this.input.bucket; this.storageClient = new Storage(options); diff --git a/packages/nocodb/src/plugins/gcs/index.ts b/packages/nocodb/src/plugins/gcs/index.ts index 71984150ea..4b9ec5e26e 100644 --- a/packages/nocodb/src/plugins/gcs/index.ts +++ b/packages/nocodb/src/plugins/gcs/index.ts @@ -6,7 +6,7 @@ import GcsPlugin from './GcsPlugin'; const config: XcPluginConfig = { builder: GcsPlugin, title: 'GCS', - version: '0.0.1', + version: '0.0.2', logo: 'plugins/gcs.png', description: 'Google Cloud Storage is a RESTful online file storage web service for storing and accessing data on Google Cloud Platform infrastructure.', @@ -36,6 +36,13 @@ const config: XcPluginConfig = { placeholder: 'Private Key', type: XcType.Password, required: true + }, + { + key: 'project_id', + label: 'Project ID', + placeholder: 'Project ID', + type: XcType.SingleLineText, + required: false } ], actions: [