Refactor storage integration from MinIO to S3

- Removed MinIO client and related imports from various modules.
- Introduced S3 client and OSS integration for object storage.
- Updated all references to MinIO methods with corresponding S3 methods.
- Added new flowme table schema to the database.
- Adjusted upload and download routes to utilize S3 for file operations.
- Removed obsolete MinIO-related files and routes.
- Ensured compatibility with existing application logic while transitioning to S3.
This commit is contained in:
2026-01-31 05:12:56 +08:00
parent 08023d6878
commit 6100e9833d
24 changed files with 1440 additions and 328 deletions

View File

@@ -1,5 +1,4 @@
import { minioClient } from '@/app.ts';
import { bucketName } from '@/modules/minio.ts';
import { oss } from '@/app.ts';
import { fileIsExist } from '@kevisual/use-config';
import { spawn, spawnSync } from 'child_process';
import { getFileStat, getMinioList, MinioFile } from '@/routes/file/index.ts';
@@ -8,6 +7,7 @@ import fs from 'fs';
import path from 'path';
import { appsPath } from '../lib/index.ts';
import { installAppFromKey } from './manager.ts';
import { Readable } from 'stream';
export type InstallAppOpts = {
needInstallDeps?: boolean;
// minio中
@@ -46,7 +46,7 @@ export const installApp = async (opts: InstallAppOpts) => {
if (!fileIsExist(dir)) {
fs.mkdirSync(dir, { recursive: true });
}
const fileStream = await minioClient.getObject(bucketName, `${name}`);
const fileStream = (await oss.getObject(`${name}`)).Body as Readable;
const writeStream = fs.createWriteStream(outputPath);
fileStream.pipe(writeStream);