mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
Some checks are pending
Document deploy / sync-images (push) Waiting to run
Document deploy / generate-timestamp (push) Blocked by required conditions
Document deploy / build-images (map[domain:https://fastgpt.cn suffix:cn]) (push) Blocked by required conditions
Document deploy / build-images (map[domain:https://fastgpt.io suffix:io]) (push) Blocked by required conditions
Document deploy / update-images (map[deployment:fastgpt-docs domain:https://fastgpt.cn kube_config:KUBE_CONFIG_CN suffix:cn]) (push) Blocked by required conditions
Document deploy / update-images (map[deployment:fastgpt-docs domain:https://fastgpt.io kube_config:KUBE_CONFIG_IO suffix:io]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / get-vars (push) Waiting to run
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:amd64 runs-on:ubuntu-24.04]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:arm64 runs-on:ubuntu-24.04-arm]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / release-fastgpt-images (push) Blocked by required conditions
* perf: faq * index * delete dataset * delete dataset * perf: delete dataset * init * fix: outLink UID (#6048) * perf: query extension * fix: s3 configs (#6050) * fix: s3 configs * s3 --------- Co-authored-by: archer <545436317@qq.com> * s3 valid string check * perf: completion api * fix: model test * perf: init * fix: init * fix: init shell * fix: faq --------- Co-authored-by: Roy <whoeverimf5@gmail.com>
61 lines
2.0 KiB
TypeScript
61 lines
2.0 KiB
TypeScript
import { HttpProxyAgent } from 'http-proxy-agent';
|
|
import { HttpsProxyAgent } from 'https-proxy-agent';
|
|
import type { ClientOptions } from 'minio';
|
|
|
|
export const Mimes = {
|
|
'.gif': 'image/gif',
|
|
'.png': 'image/png',
|
|
'.jpg': 'image/jpeg',
|
|
'.jpeg': 'image/jpeg',
|
|
'.webp': 'image/webp',
|
|
'.svg': 'image/svg+xml',
|
|
|
|
'.csv': 'text/csv',
|
|
'.txt': 'text/plain',
|
|
|
|
'.pdf': 'application/pdf',
|
|
'.zip': 'application/zip',
|
|
'.json': 'application/json',
|
|
'.doc': 'application/msword',
|
|
'.js': 'application/javascript',
|
|
'.xls': 'application/vnd.ms-excel',
|
|
'.ppt': 'application/vnd.ms-powerpoint',
|
|
'.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
'.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
'.pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
|
|
} as const;
|
|
|
|
export const defaultS3Options: {
|
|
externalBaseURL?: string;
|
|
afterInit?: () => Promise<void> | void;
|
|
} & ClientOptions = {
|
|
useSSL: process.env.S3_USE_SSL === 'true',
|
|
endPoint: process.env.S3_ENDPOINT || 'localhost',
|
|
externalBaseURL: process.env.S3_EXTERNAL_BASE_URL,
|
|
accessKey: process.env.S3_ACCESS_KEY || 'minioadmin',
|
|
secretKey: process.env.S3_SECRET_KEY || 'minioadmin',
|
|
port: process.env.S3_PORT ? parseInt(process.env.S3_PORT) : 9000,
|
|
pathStyle: process.env.S3_PATH_STYLE === 'false' ? false : true,
|
|
transportAgent: process.env.HTTP_PROXY
|
|
? new HttpProxyAgent(process.env.HTTP_PROXY)
|
|
: process.env.HTTPS_PROXY
|
|
? new HttpsProxyAgent(process.env.HTTPS_PROXY)
|
|
: undefined
|
|
};
|
|
|
|
export const S3Buckets = {
|
|
public: process.env.S3_PUBLIC_BUCKET || 'fastgpt-public',
|
|
private: process.env.S3_PRIVATE_BUCKET || 'fastgpt-private'
|
|
} as const;
|
|
|
|
export const getSystemMaxFileSize = () => {
|
|
const config = global.feConfigs?.uploadFileMaxSize || 1024; // MB, default 1024MB
|
|
return config; // bytes
|
|
};
|
|
|
|
export const S3_KEY_PATH_INVALID_CHARS_MAP: Record<string, boolean> = {
|
|
'/': true,
|
|
'\\': true,
|
|
'|': true
|
|
};
|