[CLD-7029] Add a new system console page for configuring custom export FileSettings (#26034)
* Add a new system console page for configuring custom export FileSettings * Remove NONE option for ExportDriverName dropdown * Fix tests * Fix i18n * Update webapp/channels/src/components/admin_console/admin_definition.tsx Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com> * PR Feedback * Fix formatting * gofmt --------- Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
@@ -57,7 +57,13 @@ func (a *App) ExportFileBackend() filestore.FileBackend {
|
||||
}
|
||||
|
||||
func (a *App) CheckMandatoryS3Fields(settings *model.FileSettings) *model.AppError {
|
||||
fileBackendSettings := filestore.NewFileBackendSettingsFromConfig(settings, false, false)
|
||||
var fileBackendSettings filestore.FileBackendSettings
|
||||
if a.License().IsCloud() && a.Config().FeatureFlags.CloudDedicatedExportUI && a.Config().FileSettings.DedicatedExportStore != nil && *a.Config().FileSettings.DedicatedExportStore {
|
||||
fileBackendSettings = filestore.NewExportFileBackendSettingsFromConfig(settings, false, false)
|
||||
} else {
|
||||
fileBackendSettings = filestore.NewFileBackendSettingsFromConfig(settings, false, false)
|
||||
}
|
||||
|
||||
err := fileBackendSettings.CheckMandatoryS3Fields()
|
||||
if err != nil {
|
||||
return model.NewAppError("CheckMandatoryS3Fields", "api.admin.test_s3.missing_s3_bucket", nil, "", http.StatusBadRequest).Wrap(err)
|
||||
@@ -87,7 +93,15 @@ func (a *App) TestFileStoreConnection() *model.AppError {
|
||||
func (a *App) TestFileStoreConnectionWithConfig(cfg *model.FileSettings) *model.AppError {
|
||||
license := a.Srv().License()
|
||||
insecure := a.Config().ServiceSettings.EnableInsecureOutgoingConnections
|
||||
backend, err := filestore.NewFileBackend(filestore.NewFileBackendSettingsFromConfig(cfg, license != nil && *license.Features.Compliance, insecure != nil && *insecure))
|
||||
var backend filestore.FileBackend
|
||||
var err error
|
||||
complianceEnabled := license != nil && *license.Features.Compliance
|
||||
if license.IsCloud() && a.Config().FeatureFlags.CloudDedicatedExportUI && a.Config().FileSettings.DedicatedExportStore != nil && *a.Config().FileSettings.DedicatedExportStore {
|
||||
allowInsecure := a.Config().ServiceSettings.EnableInsecureOutgoingConnections != nil && *a.Config().ServiceSettings.EnableInsecureOutgoingConnections
|
||||
backend, err = filestore.NewFileBackend(filestore.NewExportFileBackendSettingsFromConfig(cfg, complianceEnabled && license.IsCloud(), allowInsecure))
|
||||
} else {
|
||||
backend, err = filestore.NewFileBackend(filestore.NewFileBackendSettingsFromConfig(cfg, complianceEnabled, insecure != nil && *insecure))
|
||||
}
|
||||
if err != nil {
|
||||
return model.NewAppError("FileBackend", "api.file.no_driver.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user