Skip to content

Commit 6945d1e

Browse files
✨ feat(uploads): add minio to file uploads
1 parent efc4211 commit 6945d1e

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

src/backend/storage/integrations/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import type { IStorageIntegrationsImplemention } from "../types";
22
import { AWS_STORAGE_INTEGRATION } from "./aws";
33
import { CLOUDINARY_STORAGE_INTEGRATION } from "./cloudinary";
44
import { GOOGLE_STORAGE_INTEGRATION } from "./google";
5+
import { MINIO_STORAGE_INTEGRATION } from "./minio";
56
import { StorageIntegrations } from "./types";
67

78
export const STORAGE_INTEGRATIONS: Record<
89
StorageIntegrations,
910
IStorageIntegrationsImplemention<any>
1011
> = {
1112
[StorageIntegrations.S3]: AWS_STORAGE_INTEGRATION,
13+
[StorageIntegrations.MINIO]: MINIO_STORAGE_INTEGRATION,
1214
[StorageIntegrations.CLOUDINARY]: CLOUDINARY_STORAGE_INTEGRATION,
1315
[StorageIntegrations.GOOGLE]: GOOGLE_STORAGE_INTEGRATION,
1416
};
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { msg } from "@lingui/macro";
2+
3+
import type { IStorageIntegrationsImplemention } from "@/backend/storage/types";
4+
5+
export const MINIO_STORAGE_INTEGRATION: IStorageIntegrationsImplemention<{
6+
endpoint: string;
7+
port: string;
8+
accessKey: string;
9+
secretKey: string;
10+
}> = {
11+
title: "Minio",
12+
integrationConfigurationSchema: {
13+
endpoint: {
14+
label: msg`Endpoint`,
15+
type: "text",
16+
validations: [
17+
{
18+
validationType: "required",
19+
},
20+
],
21+
},
22+
port: {
23+
label: msg`Port`,
24+
type: "text",
25+
validations: [
26+
{
27+
validationType: "required",
28+
},
29+
],
30+
},
31+
accessKey: {
32+
label: msg`Access Key`,
33+
type: "text",
34+
validations: [
35+
{
36+
validationType: "required",
37+
},
38+
],
39+
},
40+
secretKey: {
41+
label: msg`Secret Key`,
42+
type: "text",
43+
validations: [
44+
{
45+
validationType: "required",
46+
},
47+
],
48+
},
49+
},
50+
store: async (integrationConfig, file: File) => {
51+
// const foo = new S3Client({
52+
// region: "string",
53+
// });
54+
// eslint-disable-next-line no-console
55+
console.log(integrationConfig, file);
56+
return "";
57+
},
58+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export enum StorageIntegrations {
22
S3 = "s3",
3+
MINIO = "minio",
34
CLOUDINARY = "cloudinary",
45
GOOGLE = "google",
56
}

0 commit comments

Comments
 (0)