23 lines
858 B
TypeScript
23 lines
858 B
TypeScript
import fs from 'fs'
|
|
import path from 'path'
|
|
|
|
describe('docker-compose.prod.yml', () => {
|
|
const compose = fs.readFileSync(
|
|
path.join(process.cwd(), 'docker-compose.prod.yml'),
|
|
'utf8'
|
|
)
|
|
|
|
it('MinIO 初始化默认关闭素材桶匿名访问', () => {
|
|
expect(compose).toContain('S3_SET_ACL: ${S3_SET_ACL:-0}')
|
|
expect(compose).toContain('S3_PUBLIC_READ: ${S3_PUBLIC_READ:-0}')
|
|
expect(compose).toContain('mc anonymous set none "myminio/$${S3_BUCKET}"')
|
|
expect(compose).toContain('MinIO bucket anonymous access disabled')
|
|
})
|
|
|
|
it('只有显式兼容公开模式时才打开匿名下载', () => {
|
|
expect(compose).toContain('WARNING: S3 public read compatibility is enabled')
|
|
expect(compose).toContain('mc anonymous set download "myminio/$${S3_BUCKET}"')
|
|
expect(compose).toContain('- S3_SET_ACL=${S3_SET_ACL:-0}')
|
|
})
|
|
})
|