Skip to content

Commit 8f08ec2

Browse files
committed
chore: bump storage sdk version
1 parent 1f859e3 commit 8f08ec2

File tree

5 files changed

+37
-8
lines changed

5 files changed

+37
-8
lines changed

bun.lock

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "1.0.0",
55
"description": "FastGPT Plugins",
66
"dependencies": {
7-
"@fastgpt-sdk/storage": "^0.6.6",
7+
"@fastgpt-sdk/storage": "^0.6.12",
88
"@opentelemetry/api": "^1.9.0",
99
"@opentelemetry/api-logs": "^0.203.0",
1010
"@opentelemetry/exporter-logs-otlp-http": "^0.203.0",

lib/s3/config.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function createDefaultStorageOptions() {
2727
case 'minio': {
2828
return {
2929
vendor: 'minio',
30-
forcePathStyle: true,
30+
forcePathStyle: process.env.STORAGE_S3_FORCE_PATH_STYLE === 'true' ? true : false,
3131
externalBaseUrl: process.env.STORAGE_EXTERNAL_ENDPOINT || undefined,
3232
endpoint: process.env.STORAGE_S3_ENDPOINT || 'http://localhost:9000',
3333
region: process.env.STORAGE_REGION || 'us-east-1',
@@ -70,6 +70,29 @@ export function createDefaultStorageOptions() {
7070
};
7171
}
7272

73+
case 'huarun-oss': {
74+
return {
75+
vendor: 'huarun-oss',
76+
forcePathStyle: process.env.STORAGE_S3_FORCE_PATH_STYLE === 'true' ? true : false,
77+
externalBaseUrl: process.env.STORAGE_EXTERNAL_ENDPOINT || undefined,
78+
endpoint: process.env.STORAGE_S3_ENDPOINT || '',
79+
region: process.env.STORAGE_REGION || 'us-east-1',
80+
publicBucket: process.env.STORAGE_PUBLIC_BUCKET || 'fastgpt-public',
81+
privateBucket: process.env.STORAGE_PRIVATE_BUCKET || 'fastgpt-private',
82+
credentials: {
83+
accessKeyId: process.env.STORAGE_ACCESS_KEY_ID || '',
84+
secretAccessKey: process.env.STORAGE_SECRET_ACCESS_KEY || ''
85+
},
86+
maxRetries: process.env.STORAGE_S3_MAX_RETRIES
87+
? parseInt(process.env.STORAGE_S3_MAX_RETRIES)
88+
: 3
89+
} satisfies Omit<IAwsS3CompatibleStorageOptions, 'bucket'> & {
90+
publicBucket: string;
91+
privateBucket: string;
92+
externalBaseUrl?: string;
93+
};
94+
}
95+
7396
case 'cos': {
7497
return {
7598
vendor: 'cos',
@@ -115,6 +138,7 @@ export function createDefaultStorageOptions() {
115138
};
116139
}
117140

141+
118142
default: {
119143
throw new Error(`Unsupported storage vendor: ${vendor}`);
120144
}

lib/s3/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ const getConfig = () => {
2626
publicBucket
2727
});
2828

29-
if (vendor === 'minio' || vendor === 'aws-s3') {
29+
if (vendor === 'minio' || vendor === 'aws-s3' || vendor === 'huarun-oss') {
3030
const config: Omit<IAwsS3CompatibleStorageOptions, 'bucket'> = {
3131
region,
3232
vendor,
3333
credentials,
34-
forcePathStyle: vendor === 'minio' ? true : options.forcePathStyle,
34+
forcePathStyle: options.forcePathStyle,
3535
endpoint: options.endpoint!,
3636
maxRetries: options.maxRetries!
3737
};
@@ -68,6 +68,7 @@ const getConfig = () => {
6868
return buildResult(config);
6969
}
7070

71+
7172
throw new Error(`Not supported vendor: ${vendor}`);
7273
};
7374

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@
5555
]
5656
},
5757
"dependencies": {
58-
"@fastgpt-sdk/storage": "^0.6.6",
58+
"@fastgpt-sdk/storage": "^0.6.12",
5959
"@ts-rest/core": "3.52.1",
6060
"@ts-rest/express": "3.52.1",
6161
"@ts-rest/open-api": "3.52.1",
6262
"@types/cheerio": "^0.22.35",
6363
"@types/marked": "^5.0.2",
6464
"cheerio": "^1.1.0",
65+
"fastgpt-plugins": ".",
6566
"marked": "^17.0.1",
6667
"proxy-agent": "^6.5.0"
6768
}

0 commit comments

Comments
 (0)