This commit is contained in:
2026-01-17 20:19:07 +08:00
parent 2cb12644ea
commit 5395449751
5 changed files with 34 additions and 93 deletions

View File

@@ -143,19 +143,29 @@ export type AssistantConfigData = {
enabled?: boolean;
token?: string;
}
/**
* 自定义脚本, asst 启动时会执行这些脚本
*/
scripts?: {
[key: string]: string;
};
/**
* 认证和权限配置
* share: protected 需要认证代理访问(默认) public 公开访问, private 私有访问
* share 是对外共享 pages 目录下的页面
*/
auth?: AuthPermission;
storage?: AssistantStorage[];
};
type AssistantStorage = FileStorage | S3Storage;
type FileStorage = {
id: string;
path: string;
type: 'local'
}
type S3Storage = {
id: string;
bucket: string;
region: string;
accessKeyId: string;
secretAccessKey: string;
endpoint?: string;
type: 's3' | 'minio';
}
let assistantConfig: AssistantConfigData;
type AssistantConfigOptions = {
configDir?: string;

View File

@@ -23,7 +23,7 @@ export const defaultApiProxy = [
* @param paths ['/api/router', '/v1' ]
* @returns
*/
export const createApiProxy = (api: string, paths: string[] = ['/api', '/v1']) => {
export const createApiProxy = (api: string, paths: string[] = ['/api', '/v1']): ProxyInfo[] => {
const pathList = paths.map((item) => {
return {
path: item,

View File

@@ -36,10 +36,14 @@ export type ProxyInfo = {
*/
rootPath?: string;
s3?: {
bucket: string;
region: string;
accessKeyId: string;
secretAccessKey: string;
/**
* 如何id存在使用assistan-config的storage配置
*/
id?: string;
bucket?: string;
region?: string;
accessKeyId?: string;
secretAccessKey?: string;
endpoint?: string;
}
};