mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-23 20:13:21 +03:00
parent
cce9bf5730
commit
afb3f4b7b7
@ -220,6 +220,16 @@ export class EnvironmentVariables {
|
||||
@IsOptional()
|
||||
STORAGE_S3_ENDPOINT: string;
|
||||
|
||||
@ValidateIf((env) => env.STORAGE_TYPE === StorageDriverType.S3)
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
STORAGE_S3_ACCESS_KEY_ID: string;
|
||||
|
||||
@ValidateIf((env) => env.STORAGE_TYPE === StorageDriverType.S3)
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
STORAGE_S3_SECRET_ACCESS_KEY: string;
|
||||
|
||||
@IsString()
|
||||
@ValidateIf((env) => env.STORAGE_TYPE === StorageDriverType.Local)
|
||||
STORAGE_LOCAL_PATH = '.local-storage';
|
||||
|
@ -32,15 +32,24 @@ export const fileStorageModuleFactory = async (
|
||||
const bucketName = environmentService.get('STORAGE_S3_NAME');
|
||||
const endpoint = environmentService.get('STORAGE_S3_ENDPOINT');
|
||||
const region = environmentService.get('STORAGE_S3_REGION');
|
||||
const accessKeyId = environmentService.get('STORAGE_S3_ACCESS_KEY_ID');
|
||||
const secretAccessKey = environmentService.get(
|
||||
'STORAGE_S3_SECRET_ACCESS_KEY',
|
||||
);
|
||||
|
||||
return {
|
||||
type: StorageDriverType.S3,
|
||||
options: {
|
||||
bucketName: bucketName ?? '',
|
||||
endpoint: endpoint,
|
||||
credentials: fromNodeProviderChain({
|
||||
clientConfig: { region },
|
||||
}),
|
||||
credentials: accessKeyId
|
||||
? {
|
||||
accessKeyId,
|
||||
secretAccessKey,
|
||||
}
|
||||
: fromNodeProviderChain({
|
||||
clientConfig: { region },
|
||||
}),
|
||||
forcePathStyle: true,
|
||||
region: region ?? '',
|
||||
},
|
||||
|
@ -142,6 +142,8 @@ yarn command:prod cron:calendar:google-calendar-sync
|
||||
['STORAGE_S3_REGION', '', 'Storage Region'],
|
||||
['STORAGE_S3_NAME', '', 'Bucket Name'],
|
||||
['STORAGE_S3_ENDPOINT', '', 'Use if a different Endpoint is needed (for example Google)'],
|
||||
['STORAGE_S3_ACCESS_KEY_ID', '', 'Optional depending on the authentication method'],
|
||||
['STORAGE_S3_SECRET_ACCESS_KEY', '', 'Optional depending on the authentication method'],
|
||||
['STORAGE_LOCAL_PATH', '.local-storage', 'data path (local storage)'],
|
||||
]}></ArticleTable>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user