Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions api-backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ REDIS_PORT=
# AWS
AWS_ACCESS_KEY=
AWS_SECRET_KEY=
AWS_REGION=

## S3
AWS_BUCKET_REGION=
AWS_MEETING_BOT_BUCKET_NAME=

## S3 (aws S3 or Cloudflare R2)
S3_ACCESS_KEY=
S3_SECRET_KEY=
S3_ENDPOINT_URL= #use this only with R2
S3_BUCKET_NAME=
S3_REGION=

## ECS
AWS_ECS_CLUSTER_NAME=
Expand Down
11 changes: 7 additions & 4 deletions api-backend/src/aws/aws.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ export class AwsService {

constructor(readonly configService: ConfigService) {
this.s3 = new S3({
...(this.configService.get('s3.endpoint') && {
endpoint: this.configService.get('s3.endpoint'),
}),
credentials: {
accessKeyId: this.configService.get('aws.accessKey'),
secretAccessKey: this.configService.get('aws.secretKey'),
accessKeyId: this.configService.get('s3.accessKey'),
secretAccessKey: this.configService.get('s3.secretKey'),
},
region: this.configService.get('aws.bucketRegion'),
region: this.configService.get('s3.region'),
});
}

Expand All @@ -30,7 +33,7 @@ export class AwsService {

try {
const input: PutObjectCommandInput = {
Bucket: this.configService.get('aws.meetingBotBucketName'),
Bucket: this.configService.get('s3.bucketName'),
Key: objectName,
ContentType: contentType,
Metadata: metadata,
Expand Down
2 changes: 1 addition & 1 deletion api-backend/src/aws/ecs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class ECSClientService {
accessKeyId: this.configService.get('aws.accessKey'),
secretAccessKey: this.configService.get('aws.secretKey'),
},
region: this.configService.get('aws.bucketRegion'),
region: this.configService.get('aws.region'),
});
this.clusterName = this.configService.get('aws.ecsClusterName');
}
Expand Down
10 changes: 8 additions & 2 deletions api-backend/src/config/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,24 @@ export default () => ({
aws: {
accessKey: process.env.AWS_ACCESS_KEY,
secretKey: process.env.AWS_SECRET_KEY,
bucketRegion: process.env.AWS_BUCKET_REGION,
region: process.env.AWS_REGION,
ecsClusterName: process.env.AWS_ECS_CLUSTER_NAME,
securityGroup: process.env.AWS_SECURITY_GROUP,
vpsSubnet: process.env.AWS_VPS_SUBNET,
meetingBotBucketName: process.env.AWS_MEETING_BOT_BUCKET_NAME,
ecsTaskDefinitionGoogle: process.env.ECS_TASK_DEFINITION_GOOGLE,
ecsContainerNameGoogle: process.env.ECS_CONTAINER_NAME_GOOGLE,
ecsTaskDefinitionTeams: process.env.ECS_TASK_DEFINITION_TEAMS,
ecsContainerNameTeams: process.env.ECS_CONTAINER_NAME_TEAMS,
ecsTaskDefinitionZoom: process.env.ECS_TASK_DEFINITION_ZOOM,
ecsContainerNameZoom: process.env.ECS_CONTAINER_NAME_ZOOM,
},
s3: {
endpoint: process.env.S3_ENDPOINT_URL,
bucketName: process.env.S3_BUCKET_NAME,
accessKey: process.env.S3_ACCESS_KEY,
secretKey: process.env.S3_SECRET_KEY,
region: process.env.S3_REGION,
},
bot: {
meetingBotRetryCount:
parseInt(process.env.MEETING_BOT_RETRY_COUNT, 10) || 2,
Expand Down