@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 开发快照(云对象存储寻址兼容)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 整库发布与恢复按存储提供方选择寻址方式:MinIO 保留路径式,OSS/S3 使用虚拟主机式,不再因强制路径式而被 OSS 拒绝资源上传。
|
||||||
|
|
||||||
## 开发快照(跨库分块序列分配)
|
## 开发快照(跨库分块序列分配)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ func scopeConfigOf(config appconfig.Config, scope string) (scopeConfig, error) {
|
|||||||
Region: config.LibraryProductionS3Region, Bucket: config.LibraryProductionS3Bucket,
|
Region: config.LibraryProductionS3Region, Bucket: config.LibraryProductionS3Bucket,
|
||||||
AccessKeyID: config.LibraryProductionS3AccessKey, SecretAccessKey: config.LibraryProductionS3SecretKey,
|
AccessKeyID: config.LibraryProductionS3AccessKey, SecretAccessKey: config.LibraryProductionS3SecretKey,
|
||||||
Secure: strings.HasPrefix(config.LibraryProductionS3Endpoint, "https://"),
|
Secure: strings.HasPrefix(config.LibraryProductionS3Endpoint, "https://"),
|
||||||
ForcePathStyle: true, MaxObjectBytes: 256 * 1024 * 1024,
|
ForcePathStyle: config.LibraryProductionS3Provider == "minio", MaxObjectBytes: 256 * 1024 * 1024,
|
||||||
},
|
},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package librarystack
|
||||||
|
|
||||||
|
import (
|
||||||
|
"knowledge-governance/internal/appconfig"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestObjectAddressingMatchesProvider(t *testing.T) {
|
||||||
|
for _, provider := range []string{"oss", "s3", "minio"} {
|
||||||
|
t.Run(provider, func(t *testing.T) {
|
||||||
|
config := appconfig.Config{LibraryProductionDatabaseURL: "configured", LibraryProductionElasticURL: "configured", LibraryProductionTenantID: 1, LibraryProductionInternalKB: "kb-target", LibraryProductionS3Endpoint: "https://storage.example", LibraryProductionS3Bucket: "test-bucket", LibraryProductionS3AccessKey: "fixture", LibraryProductionS3SecretKey: "fixture", LibraryProductionS3Provider: provider}
|
||||||
|
scope, err := scopeConfigOf(config, "internal")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if scope.s3.ForcePathStyle != (provider == "minio") {
|
||||||
|
t.Fatalf("provider %s: ForcePathStyle=%v", provider, scope.s3.ForcePathStyle)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user