diff --git a/dashboard/src/components/BackupSiteConfigDialog.vue b/dashboard/src/components/BackupSiteConfigDialog.vue index ef1a48bfa..7f4755cf3 100644 --- a/dashboard/src/components/BackupSiteConfigDialog.vue +++ b/dashboard/src/components/BackupSiteConfigDialog.vue @@ -54,17 +54,12 @@ async function onSubmit() { return console.error(error); } - const data = {}; + const data = site.value.config; // TODO maybe deal with gcs?? if (s3like(provider.value)) { - data.bucket = bucket.value; - data.region = region.value; - data.prefix = prefix.value; - if (accessKeyId.value !== site.value.config.accessKeyId || secretAccessKey.value) { - data.accessKeyId = accessKeyId.value; - data.secretAccessKey = secretAccessKey.value; - } + data.accessKeyId = accessKeyId.value; + if (secretAccessKey.value) data.secretAccessKey = secretAccessKey.value; } if (provider.value === 'cifs') { diff --git a/src/storage/s3.js b/src/storage/s3.js index 1bcc83605..49be62ed0 100644 --- a/src/storage/s3.js +++ b/src/storage/s3.js @@ -635,6 +635,7 @@ async function verifyConfig({ id, provider, config }) { if (typeof config.prefix !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'prefix must be a string'); if ('signatureVersion' in config && typeof config.signatureVersion !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'signatureVersion must be a string'); if ('endpoint' in config && typeof config.endpoint !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'endpoint must be a string'); + if ('region' in config && typeof config.region !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'region must be a string'); if ('acceptSelfSignedCerts' in config && typeof config.acceptSelfSignedCerts !== 'boolean') throw new BoxError(BoxError.BAD_FIELD, 'acceptSelfSignedCerts must be a boolean'); if ('s3ForcePathStyle' in config && typeof config.s3ForcePathStyle !== 'boolean') throw new BoxError(BoxError.BAD_FIELD, 's3ForcePathStyle must be a boolean');