clear
This commit is contained in:
parent
7d93f0eef3
commit
530f594433
@ -25,7 +25,7 @@
|
|||||||
"start": "pm2 start dist/app.mjs --name codecenter",
|
"start": "pm2 start dist/app.mjs --name codecenter",
|
||||||
"release": "node ./config/release/index.mjs",
|
"release": "node ./config/release/index.mjs",
|
||||||
"pub": "envision pack -p -u",
|
"pub": "envision pack -p -u",
|
||||||
"ssh": "ssh -L 6379:localhost:6379 -L 5432:localhost:5432 light ",
|
"ssh": "ssh -L 6379:localhost:6379 -L 5432:localhost:5432 -L 9000:localhost:9000 light ",
|
||||||
"ssh:sky": "ssh -L 6379:172.21.32.13:6379 sky",
|
"ssh:sky": "ssh -L 6379:172.21.32.13:6379 sky",
|
||||||
"dev:lib": "turbo run dev:lib",
|
"dev:lib": "turbo run dev:lib",
|
||||||
"build:lib": "turbo run build",
|
"build:lib": "turbo run build",
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
import { Client, ClientOptions } from 'minio';
|
import { Client, ClientOptions } from 'minio';
|
||||||
|
import { config } from './config.ts';
|
||||||
const minioConfig = {
|
const minioConfig = {
|
||||||
endPoint: process.env.MINIO_ENDPOINT || 'localhost',
|
endPoint: config.MINIO_ENDPOINT || 'localhost',
|
||||||
port: parseInt(process.env.MINIO_PORT || '9000'),
|
port: parseInt(config.MINIO_PORT || '9000'),
|
||||||
useSSL: process.env.MINIO_USE_SSL === 'true',
|
useSSL: config.MINIO_USE_SSL === 'true',
|
||||||
accessKey: process.env.MINIO_ACCESS_KEY,
|
accessKey: config.MINIO_ACCESS_KEY,
|
||||||
secretKey: process.env.MINIO_SECRET_KEY,
|
secretKey: config.MINIO_SECRET_KEY,
|
||||||
};
|
};
|
||||||
export const minioClient = new Client(minioConfig);
|
export const minioClient = new Client(minioConfig);
|
||||||
|
|
||||||
export const bucketName = process.env.MINIO_BUCKET_NAME || 'resources';
|
export const bucketName = config.MINIO_BUCKET_NAME || 'resources';
|
||||||
if (!minioClient) {
|
if (!minioClient) {
|
||||||
throw new Error('Minio client not initialized');
|
throw new Error('Minio client not initialized');
|
||||||
}
|
}
|
||||||
// 验证权限
|
// 验证权限
|
||||||
// (async () => {
|
(async () => {
|
||||||
// const bucketExists = await minioClient.bucketExists(bucketName);
|
const bucketExists = await minioClient.bucketExists(bucketName);
|
||||||
// if (!bucketExists) {
|
if (!bucketExists) {
|
||||||
// await minioClient.makeBucket(bucketName);
|
await minioClient.makeBucket(bucketName);
|
||||||
// }
|
}
|
||||||
// const res = await minioClient.putObject(bucketName, 'private/test/a.b', 'test');
|
console.log('bucketExists', bucketExists);
|
||||||
// console.log('minio putObject', res);
|
// const res = await minioClient.putObject(bucketName, 'root/test/0.0.1/a.txt', 'test');
|
||||||
|
// console.log('minio putObject', res);
|
||||||
// })();
|
})();
|
||||||
|
1
submodules/code-center-module
Submodule
1
submodules/code-center-module
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 0f0a4cbd6a413b9c94b741c27f7f94803d47b708
|
Loading…
x
Reference in New Issue
Block a user