Skip to content

Commit e648468

Browse files
committed
feat(s3): add S3 connection configuration options
Add S3_MAX_ATTEMPTS, S3_MAX_SOCKETS and S3_CONNECTION_TIMEOUT env variables to configure S3 client connection settings. This improves reliability and performance of S3 operations. ci: remove temporary testing branch from workflow refactor(incubator): add title prop and Typography component
1 parent 50049cc commit e648468

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

.github/workflows/trustlab-deploy-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: TrustLab | Deploy | DEV
22

33
on:
44
push:
5-
branches: [main, ft/upgrade-payload] # temporary testing fix for ft/upgrade-payload
5+
branches: [main]
66
paths:
77
- "apps/trustlab/**"
88
- "Dockerfile"

apps/trustlab/.env.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ S3_BUCKET=
1111
S3_ACCESS_KEY_ID=
1212
S3_SECRET_ACCESS_KEY=
1313
S3_REGION=
14+
S3_MAX_ATTEMPTS=3
15+
S3_MAX_SOCKETS=1000
16+
S3_CONNECTION_TIMEOUT=5000
1417

1518
# Sentry
1619
NEXT_PUBLIC_SENTRY_DSN=

apps/trustlab/src/components/Incubator/Incubator.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Section } from "@commons-ui/core";
22
import { Figure, Link } from "@commons-ui/next";
33
import { LexicalRichText } from "@commons-ui/payload";
4-
import { Grid, Box, Button, SvgIcon } from "@mui/material";
4+
import { Grid, Box, Button, SvgIcon, Typography } from "@mui/material";
55
import React, { forwardRef } from "react";
66

77
import VisitIcon from "@/trustlab/assets/icons/Type=visit, Size=20, Color=CurrentColor.svg";
@@ -13,6 +13,7 @@ const Incubator = forwardRef((props, ref) => {
1313
buttonLink,
1414
image,
1515
content,
16+
title,
1617
} = props;
1718

1819
if (!content && !image) {
@@ -28,6 +29,9 @@ const Incubator = forwardRef((props, ref) => {
2829
ref={ref}
2930
>
3031
<Section sx={{ py: 8, px: { xs: 2.5, md: 0 } }}>
32+
<Typography sx={{ whiteSpace: "nowrap", mb: 2 }} variant="display4">
33+
{title}
34+
</Typography>
3135
<Grid container spacing={2} alignItems="center">
3236
<Grid item xs={12} sm={7}>
3337
<LexicalRichText

apps/trustlab/src/payload/plugins/index.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ const bucket = process.env.S3_BUCKET ?? "";
1414
const region = process.env.S3_REGION ?? "";
1515
const secretAccessKey = process.env.S3_SECRET_ACCESS_KEY ?? "";
1616
const s3Enabled = !!accessKeyId && !!region && !!secretAccessKey;
17+
const s3MaxAttempts = Number(process.env.S3_MAX_ATTEMPTS) || 3;
18+
const s3MaxSockets = Number(process.env.S3_MAX_SOCKETS) || 1000;
19+
const s3ConnectionTimeout = Number(process.env.S3_CONNECTION_TIMEOUT) || 5000;
1720

1821
const plugins = [
1922
nestedDocsPlugin({
@@ -32,10 +35,21 @@ const plugins = [
3235
secretAccessKey,
3336
},
3437
region,
35-
maxAttempts: 3,
38+
maxAttempts: s3MaxAttempts,
39+
requestHandler: {
40+
httpAgent: {
41+
maxSockets: s3MaxSockets,
42+
keepAlive: true,
43+
},
44+
httpsAgent: {
45+
maxSockets: s3MaxSockets,
46+
keepAlive: true,
47+
},
48+
connectionTimeout: s3ConnectionTimeout,
49+
requestTimeout: s3ConnectionTimeout,
50+
},
3651
},
3752
enabled: s3Enabled,
38-
signedDownloads: true,
3953
}),
4054
sentryPlugin({
4155
options: {

apps/trustlab/turbo.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"S3_BUCKET",
1111
"S3_REGION",
1212
"S3_SECRET_ACCESS_KEY",
13+
"S3_MAX_ATTEMPTS",
14+
"S3_MAX_SOCKETS",
15+
"S3_CONNECTION_TIMEOUT",
1316
"SENTRY_ENVIRONMENT"
1417
]
1518
}

0 commit comments

Comments
 (0)