feat(rustfs): add RustFS configuration schema and manager support
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -94,6 +94,14 @@ const DEFAULT_CONFIG: FullConfig = {
|
|||||||
level: 'info',
|
level: 'info',
|
||||||
auditRetention: 30,
|
auditRetention: 30,
|
||||||
appRetention: 14
|
appRetention: 14
|
||||||
|
},
|
||||||
|
rustfs: {
|
||||||
|
enabled: false,
|
||||||
|
endpoint: '',
|
||||||
|
accessKey: '',
|
||||||
|
secretKey: '',
|
||||||
|
bucket: 'erpauto',
|
||||||
|
region: 'us-east-1'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,18 @@ export const loggingConfigSchema = z.object({
|
|||||||
appRetention: z.number().int().min(1).max(365).default(14)
|
appRetention: z.number().int().min(1).max(365).default(14)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RustFS 对象存储配置 Schema
|
||||||
|
*/
|
||||||
|
export const rustfsConfigSchema = z.object({
|
||||||
|
enabled: z.boolean().default(false),
|
||||||
|
endpoint: z.string().min(1, 'RustFS endpoint is required'),
|
||||||
|
accessKey: z.string().min(1, 'RustFS access key is required'),
|
||||||
|
secretKey: z.string().min(1, 'RustFS secret key is required'),
|
||||||
|
bucket: z.string().min(1, 'RustFS bucket is required'),
|
||||||
|
region: z.string().default('us-east-1')
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 完整应用配置 Schema
|
* 完整应用配置 Schema
|
||||||
*/
|
*/
|
||||||
@@ -142,7 +154,8 @@ export const fullConfigSchema = z.object({
|
|||||||
validation: validationConfigSchema,
|
validation: validationConfigSchema,
|
||||||
cleaner: cleanerConfigSchema,
|
cleaner: cleanerConfigSchema,
|
||||||
orderResolution: orderResolutionSchema,
|
orderResolution: orderResolutionSchema,
|
||||||
logging: loggingConfigSchema
|
logging: loggingConfigSchema,
|
||||||
|
rustfs: rustfsConfigSchema.optional()
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -154,6 +167,7 @@ export type MySqlConfig = z.infer<typeof mysqlConfigSchema>
|
|||||||
export type SqlServerConfig = z.infer<typeof sqlServerConfigSchema>
|
export type SqlServerConfig = z.infer<typeof sqlServerConfigSchema>
|
||||||
export type ErpSystemConfig = z.infer<typeof erpSystemConfigSchema>
|
export type ErpSystemConfig = z.infer<typeof erpSystemConfigSchema>
|
||||||
export type LoggingConfig = z.infer<typeof loggingConfigSchema>
|
export type LoggingConfig = z.infer<typeof loggingConfigSchema>
|
||||||
|
export type RustfsConfig = z.infer<typeof rustfsConfigSchema>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证并解析配置
|
* 验证并解析配置
|
||||||
|
|||||||
Reference in New Issue
Block a user