Skip to content

Commit a1ecb95

Browse files
authored
release 8.2612.110
release 8.2612.110
2 parents 200f693 + 69c8ae1 commit a1ecb95

File tree

34 files changed

+4976
-4454
lines changed

34 files changed

+4976
-4454
lines changed

.github/workflows/docker-dev-image.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
uses: actions/checkout@v6
1414

1515
- name: Set up Docker Buildx
16-
uses: docker/setup-buildx-action@v3
16+
uses: docker/setup-buildx-action@v4
1717
with:
1818
driver: docker-container
1919

2020
- name: Docker meta for API
2121
id: api-meta
22-
uses: docker/metadata-action@v5
22+
uses: docker/metadata-action@v6
2323
with:
2424
images: line/abc-user-feedback-api
2525
tags: |
@@ -29,7 +29,7 @@ jobs:
2929
3030
- name: Docker meta for Web
3131
id: web-meta
32-
uses: docker/metadata-action@v5
32+
uses: docker/metadata-action@v6
3333
with:
3434
images: line/abc-user-feedback-web
3535
tags: |
@@ -39,13 +39,13 @@ jobs:
3939
4040
- name: Login to DockerHub
4141
if: github.event_name != 'pull_request'
42-
uses: docker/login-action@v3
42+
uses: docker/login-action@v4
4343
with:
4444
username: ${{ secrets.DOCKERHUB_USERNAME }}
4545
password: ${{ secrets.DOCKERHUB_TOKEN }}
4646

4747
- name: Bake and push multi-platform Docker images
48-
uses: docker/bake-action@v6
48+
uses: docker/bake-action@v7
4949
with:
5050
files: |
5151
./docker/docker-bake.hcl

.github/workflows/docker-prod-image.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,39 @@ jobs:
1515
uses: actions/checkout@v6
1616

1717
- name: Set up Docker Buildx
18-
uses: docker/setup-buildx-action@v3
18+
uses: docker/setup-buildx-action@v4
1919
with:
2020
driver: docker-container
2121

2222
- name: Docker meta for API
2323
id: api-meta
24-
uses: docker/metadata-action@v5
24+
uses: docker/metadata-action@v6
2525
with:
2626
images: line/abc-user-feedback-api
27-
bake-target: api
2827
tags: |
2928
type=ref,event=branch
3029
type=ref,event=tag
3130
type=semver,pattern={{version}}
3231
3332
- name: Docker meta for Web
3433
id: web-meta
35-
uses: docker/metadata-action@v5
34+
uses: docker/metadata-action@v6
3635
with:
3736
images: line/abc-user-feedback-web
38-
bake-target: web
3937
tags: |
4038
type=ref,event=branch
4139
type=ref,event=tag
4240
type=semver,pattern={{version}}
4341
4442
- name: Login to DockerHub
4543
if: github.event_name != 'pull_request'
46-
uses: docker/login-action@v3
44+
uses: docker/login-action@v4
4745
with:
4846
username: ${{ secrets.DOCKERHUB_USERNAME }}
4947
password: ${{ secrets.DOCKERHUB_TOKEN }}
5048

5149
- name: Bake and push multi-platform Docker images
52-
uses: docker/bake-action@v6
50+
uses: docker/bake-action@v7
5351
with:
5452
files: |
5553
./docker/docker-bake.hcl

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24.13.0
1+
24.14.0

apps/api/.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ SMTP_SENDER=user@feedback.com # required
3636
# MASTER_API_KEY= # default: none
3737

3838
# AUTO_FEEDBACK_DELETION_ENABLED=false # default: false
39-
# AUTO_FEEDBACK_DELETION_PERIOD_DAYS=365*5
39+
# AUTO_FEEDBACK_DELETION_PERIOD_DAYS=365*5
40+
41+
# OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://localhost:4319/v1/logs
42+
# OTEL_RESOURCE_ATTRIBUTES=service.name=abc-user-feedback-api,service.version=1.0.0

apps/api/README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,55 +14,55 @@ You can find a full list of targets in the [package.json](./package.json) file.
1414

1515
Runs the app in development mode.
1616

17-
```
17+
```sh
1818
pnpm dev
1919
```
2020

2121
### `test`
2222

2323
Executes tests. This command applies to the environment variables in `.env.test` file.
2424

25-
```
25+
```sh
2626
pnpm test
2727
```
2828

2929
### `test:e2e`
3030

3131
Executes e2e tests. This command applies to the environment variables in `.env.test` file.
3232

33-
```
33+
```sh
3434
pnpm test:e2e
3535
```
3636

3737
### `lint`
3838

3939
Performs a linting check using ESLint.
4040

41-
```
41+
```sh
4242
pnpm lint
4343
```
4444

4545
### `build`
4646

47-
Builds the app for production. The distributable is expored to the `dist` folder in the repository's root folder.<br />
47+
Builds the app for production. The distributable is expored to the `dist` folder in the repository's root folder.
4848

49-
```
49+
```sh
5050
pnpm build
5151
```
5252

5353
### `migration:generate`
5454

5555
Generate the migration file using typeorm. The file is generated in `src/configs/modules/typeorm-config/migrations`
5656

57-
```
57+
```sh
5858
npm run migration:generate --name={NAME}
5959
```
6060

6161
### `migration:run`
6262

6363
Run the migration files for database migrations
6464

65-
```
65+
```sh
6666
npm run migration:run
6767
```
6868

@@ -82,6 +82,8 @@ The following is a list of environment variables used by the application, along
8282

8383
### Optional Environment Variables
8484

85+
<!-- markdownlint-disable MD060 -->
86+
8587
| Environment | Description | Default Value |
8688
| ------------------------------------ | -------------------------------------------------------------- | ---------------------------------------------- |
8789
| `ADMIN_WEB_URL` | Admin Web URL | `http://localhost:3000` |
@@ -102,11 +104,17 @@ The following is a list of environment variables used by the application, along
102104
| `MASTER_API_KEY` | Master API key for privileged operations | _none_ |
103105
| `AUTO_FEEDBACK_DELETION_ENABLED` | Enable auto old feedback deletion cron on application start | `false` |
104106
| `AUTO_FEEDBACK_DELETION_PERIOD_DAYS` | Auto old feedback deletion period (in days) | _required if `AUTO_FEEDBACK_DELETION_ENABLED`_ |
107+
| `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` | OTLP HTTP logs endpoint that enables API log export when set | _optional_ |
108+
| `OTEL_RESOURCE_ATTRIBUTES` | OpenTelemetry resource attributes for exported logs | _optional_ |
105109
| `ACCESS_TOKEN_EXPIRED_TIME` | Duration until the access token expires | `10m` |
106110
| `REFRESH_TOKEN_EXPIRED_TIME` | Duration until the refresh token expires | `1h` |
107111

112+
<!-- markdownlint-enable MD060 -->
113+
108114
Please ensure that you set the required environment variables before starting the application. Optional variables can be set as needed based on your specific configuration and requirements.
109115

116+
If you want to export API logs through OpenTelemetry locally, set `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://localhost:4319/v1/logs`. You can also set `OTEL_RESOURCE_ATTRIBUTES=service.name=abc-user-feedback-api,service.version=1.1.1` to attach standard OpenTelemetry resource metadata to the exported logs. When this endpoint is configured, the API keeps writing pretty console logs and also sends the same logs to the OTLP HTTP endpoint. The `pino-opentelemetry-transport` package reads these standard OTEL environment variables directly, so no additional application configuration is required. For the full setup and verification flow, refer to the [developer guide configuration document](../docs/i18n/en/docusaurus-plugin-content-docs/current/02-developer-guide/01-installation/05-configuration.md).
117+
110118
## Swagger
111119

112120
The swagger documentation can be found on the `/docs` endpoint.

apps/api/package.json

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,51 +26,56 @@
2626
},
2727
"prettier": "@ufb/prettier-config",
2828
"dependencies": {
29-
"@aws-sdk/client-s3": "^3.971.0",
30-
"@aws-sdk/s3-request-presigner": "^3.971.0",
29+
"@aws-sdk/client-s3": "^3.1014.0",
30+
"@aws-sdk/s3-request-presigner": "^3.1014.0",
3131
"@fastify/multipart": "^9.4.0",
3232
"@fastify/static": "^9.0.0",
3333
"@nestjs-modules/mailer": "^2.0.2",
3434
"@nestjs/axios": "^4.0.1",
35-
"@nestjs/common": "^11.1.12",
36-
"@nestjs/config": "^4.0.2",
37-
"@nestjs/core": "^11.1.12",
35+
"@nestjs/common": "^11.1.17",
36+
"@nestjs/config": "^4.0.3",
37+
"@nestjs/core": "^11.1.17",
3838
"@nestjs/event-emitter": "^3.0.1",
3939
"@nestjs/jwt": "^11.0.2",
4040
"@nestjs/passport": "^11.0.5",
41-
"@nestjs/platform-express": "^11.1.12",
42-
"@nestjs/platform-fastify": "^11.1.12",
41+
"@nestjs/platform-express": "^11.1.17",
42+
"@nestjs/platform-fastify": "^11.1.17",
4343
"@nestjs/schedule": "^6.0.1",
44-
"@nestjs/swagger": "^11.2.5",
45-
"@nestjs/terminus": "^11.0.0",
44+
"@nestjs/swagger": "^11.2.6",
45+
"@nestjs/terminus": "^11.1.1",
4646
"@nestjs/typeorm": "^11.0.0",
4747
"@opensearch-project/opensearch": "^3.5.1",
48+
"@opentelemetry/exporter-logs-otlp-http": "^0.213.0",
49+
"@opentelemetry/resources": "^2.6.0",
50+
"@opentelemetry/sdk-logs": "^0.213.0",
51+
"@opentelemetry/semantic-conventions": "^1.40.0",
4852
"@types/passport-jwt": "^4.0.1",
4953
"@types/passport-local": "^1.0.38",
5054
"@ufb/shared": "workspace:*",
5155
"@willsoto/nestjs-prometheus": "^6.0.2",
52-
"axios": "^1.13.2",
56+
"axios": "^1.13.6",
5357
"bcrypt": "^6.0.0",
5458
"class-transformer": "^0.5.1",
55-
"class-validator": "^0.14.3",
59+
"class-validator": "^0.15.1",
5660
"cron": "^4.3.3",
57-
"dotenv": "^17.2.3",
61+
"dotenv": "^17.3.1",
5862
"exceljs": "^4.4.0",
5963
"fast-csv": "^5.0.5",
60-
"fastify": "^5.7.1",
64+
"fastify": "^5.8.4",
6165
"joi": "^18.0.2",
6266
"luxon": "^3.7.2",
63-
"magic-bytes.js": "^1.12.1",
64-
"mysql2": "^3.16.1",
67+
"magic-bytes.js": "^1.13.0",
68+
"mysql2": "^3.20.0",
6569
"nestjs-cls": "^6.2.0",
66-
"nestjs-pino": "^4.5.0",
70+
"nestjs-pino": "^4.6.1",
6771
"nestjs-typeorm-paginate": "^4.1.0",
68-
"nodemailer": "^7.0.12",
72+
"nodemailer": "^8.0.3",
6973
"passport": "^0.7.0",
7074
"passport-custom": "^1.1.1",
7175
"passport-jwt": "^4.0.1",
7276
"passport-local": "^1.0.0",
7377
"pino-http": "^11.0.0",
78+
"pino-opentelemetry-transport": "^3.0.0",
7479
"pino-pretty": "^13.1.3",
7580
"prom-client": "^15.1.3",
7681
"reflect-metadata": "^0.2.2",
@@ -82,28 +87,28 @@
8287
"uuid": "^13.0.0"
8388
},
8489
"devDependencies": {
85-
"@faker-js/faker": "^10.2.0",
90+
"@faker-js/faker": "^10.3.0",
8691
"@nestjs/cli": "^11.0.16",
8792
"@nestjs/schematics": "^11.0.9",
88-
"@nestjs/testing": "^11.1.12",
93+
"@nestjs/testing": "^11.1.17",
8994
"@swc-node/jest": "^1.9.1",
90-
"@swc/cli": "0.7.10",
95+
"@swc/cli": "0.8.0",
9196
"@swc/core": "1.13.5",
92-
"@swc/helpers": "^0.5.18",
97+
"@swc/helpers": "^0.5.19",
9398
"@types/bcrypt": "^6.0.0",
9499
"@types/express": "^5.0.6",
95100
"@types/jest": "^30.0.0",
96101
"@types/luxon": "^3.7.1",
97-
"@types/node": "24.10.8",
98-
"@types/nodemailer": "^7.0.5",
102+
"@types/node": "24.12.0",
103+
"@types/nodemailer": "^7.0.11",
99104
"@types/passport-jwt": "*",
100-
"@types/supertest": "^6.0.3",
105+
"@types/supertest": "^7.2.0",
101106
"@typescript-eslint/parser": "^8.46.0",
102107
"@ufb/eslint-config": "workspace:*",
103108
"@ufb/prettier-config": "workspace:*",
104109
"@ufb/tsconfig": "workspace:*",
105110
"eslint": "catalog:",
106-
"jest": "^30.2.0",
111+
"jest": "^30.3.0",
107112
"mockdate": "^3.0.5",
108113
"prettier": "catalog:",
109114
"supertest": "^7.2.2",

apps/api/src/app.module.ts

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { PrometheusModule } from '@willsoto/nestjs-prometheus';
2121
import { Request } from 'express';
2222
import { ClsModule } from 'nestjs-cls';
2323
import { LoggerModule } from 'nestjs-pino';
24+
import pino from 'pino';
2425

2526
import { appConfig, appConfigSchema } from './configs/app.config';
2627
import { jwtConfig, jwtConfigSchema } from './configs/jwt.config';
@@ -34,6 +35,7 @@ import {
3435
opensearchConfig,
3536
opensearchConfigSchema,
3637
} from './configs/opensearch.config';
38+
import { createOtelLogTransport } from './configs/otel-log.config';
3739
import { smtpConfig, smtpConfigSchema } from './configs/smtp.config';
3840
import { AuthModule } from './domains/admin/auth/auth.module';
3941
import { ChannelModule } from './domains/admin/channel/channel/channel.module';
@@ -103,29 +105,39 @@ export const domainModules = [
103105
.concat(opensearchConfigSchema),
104106
validationOptions: { abortEarly: true },
105107
}),
106-
LoggerModule.forRoot({
107-
pinoHttp: {
108-
transport: { target: 'pino-pretty', options: { singleLine: true } },
109-
autoLogging: {
110-
ignore: (req: Request) => req.originalUrl === '/api/health',
111-
},
112-
customLogLevel: (req, res, err) => {
113-
if (process.env.NODE_ENV === 'test') {
114-
return 'silent';
115-
}
108+
LoggerModule.forRootAsync({
109+
useFactory: () => {
110+
const transport: pino.TransportMultiOptions = {
111+
targets: [
112+
{ target: 'pino-pretty', options: { singleLine: true } },
113+
createOtelLogTransport(),
114+
],
115+
};
116+
return {
117+
pinoHttp: {
118+
transport,
119+
autoLogging: {
120+
ignore: (req: Request) => req.originalUrl === '/api/health',
121+
},
122+
customLogLevel: (req, res, err) => {
123+
if (process.env.NODE_ENV === 'test') {
124+
return 'silent';
125+
}
116126

117-
if (res.statusCode === 401) {
118-
return 'silent';
119-
}
120-
if (res.statusCode >= 400 && res.statusCode < 500) {
121-
return 'warn';
122-
} else if (res.statusCode >= 500) {
123-
return 'error';
124-
} else if (err != null) {
125-
return 'error';
126-
}
127-
return 'info';
128-
},
127+
if (res.statusCode === 401) {
128+
return 'silent';
129+
}
130+
if (res.statusCode >= 400 && res.statusCode < 500) {
131+
return 'warn';
132+
} else if (res.statusCode >= 500) {
133+
return 'error';
134+
} else if (err != null) {
135+
return 'error';
136+
}
137+
return 'info';
138+
},
139+
},
140+
};
129141
},
130142
}),
131143
ClsModule.forRoot({

0 commit comments

Comments
 (0)