Skip to content

Commit f67adbb

Browse files
chore: remove react dependency and monitoring state endpoint. (#93)
Co-authored-by: Thibaut FARCIN <[email protected]>
1 parent de2f569 commit f67adbb

File tree

10 files changed

+4
-285
lines changed

10 files changed

+4
-285
lines changed

.env.development

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ EMAIL_DOMAINS=my-domain.com,ext.my-domain.com
33
GITLAB_SECRET=GITLAB_SECRET
44
GITLAB_TOKEN=GITLAB_TOKEN
55
GITLAB_URL=https://my-git.domain.com
6-
MONITORING_ENABLED=true
76
NODE_ENV=development
87
POSTGRES_DATABASE_NAME=homer
98
POSTGRES_HOST=localhost

.env.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ EMAIL_DOMAINS=my-domain.com,ext.my-domain.com
44
GITLAB_SECRET=GITLAB_SECRET
55
GITLAB_TOKEN=GITLAB_TOKEN
66
GITLAB_URL=https://my-git.domain.com
7-
MONITORING_ENABLED=true
87
NODE_ENV=test
98
POSTGRES_DATABASE_NAME=homer
109
POSTGRES_HOST=localhost

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,6 @@ the following variables:
253253
- `POSTGRES_PORT`: port where the database listens.
254254
- `POSTGRES_USER`: username used when connecting to the database.
255255

256-
For debug purposes:
257-
258-
- `MONITORING_ENABLED`: expose monitoring at `/api/monitoring/state`. Defaults to `true`.
259-
260-
🔒 Monitoring is exposing sensitive data. Please be aware of it if you expose it publicly (see [this issue](https://github.com/ManoManoTech/homer/issues/89)).
261-
262-
⚠️ We will move this value to `false` by default in a new breaking change version soon.
263-
264256
### 5. Install and run
265257

266258
```bash

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
"pg": "8.9.0",
3333
"pg-hstore": "2.3.4",
3434
"pino": "8.10.0",
35-
"prismjs": "1.29.0",
36-
"react": "18.2.0",
37-
"react-dom": "18.2.0",
3835
"sequelize": "6.28.0",
3936
"slackify-markdown": "4.3.1",
4037
"source-map-support": "0.5.21",
@@ -47,9 +44,6 @@
4744
"@types/node": "18.13.0",
4845
"@types/node-fetch": "2.6.2",
4946
"@types/pg": "8.6.6",
50-
"@types/prismjs": "1.26.0",
51-
"@types/react": "18.0.27",
52-
"@types/react-dom": "18.0.10",
5347
"@types/signale": "1.4.4",
5448
"@typescript-eslint/eslint-plugin": "5.62.0",
5549
"@typescript-eslint/parser": "5.51.0",

src/core/requestHandlers/stateRequestHandler/Highlight.tsx

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/core/requestHandlers/stateRequestHandler/State.tsx

Lines changed: 0 additions & 85 deletions
This file was deleted.

src/core/requestHandlers/stateRequestHandler/stateRequestHandler.tsx

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/core/services/data.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,6 @@ export async function getProjectReleases(
140140
).map(formatRelease);
141141
}
142142

143-
export async function getProjects(): Promise<DataProject[]> {
144-
return (await Project.findAll({ order: [['createdAt', 'DESC']] })).map(
145-
toJSON
146-
);
147-
}
148-
149143
export async function getProjectsByChannelId(
150144
channelId: string
151145
): Promise<DataProject[]> {
@@ -163,10 +157,6 @@ export async function getReleases(
163157
).map(formatRelease);
164158
}
165159

166-
export async function getReviews(): Promise<DataReview[]> {
167-
return (await Review.findAll({ order: [['createdAt', 'DESC']] })).map(toJSON);
168-
}
169-
170160
export async function getReviewsByChannelId(
171161
channelId: string
172162
): Promise<DataReview[]> {

src/start.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ import helmet from 'helmet';
44
import { errorMiddleware } from '@/core/middlewares/errorMiddleware';
55
import { securityMiddleware } from '@/core/middlewares/securityMiddleware';
66
import { healthCheckRequestHandler } from '@/core/requestHandlers/healthCheckRequestHandler';
7-
import { stateRequestHandler } from '@/core/requestHandlers/stateRequestHandler/stateRequestHandler';
87
import { connectToDatabase } from '@/core/services/data';
98
import { logger } from '@/core/services/logger';
10-
import { catchAsyncRouteErrors } from '@/core/utils/catchAsyncRouteErrors';
119
import { waitForNonReadyReleases } from '@/release/commands/create/utils/waitForNonReadyReleases';
1210
import { REQUEST_BODY_SIZE_LIMIT } from './constants';
1311
import { getEnvVariable } from './core/utils/getEnvVariable';
@@ -33,20 +31,6 @@ export async function start(): Promise<() => Promise<void>> {
3331
app.use(express.urlencoded({ extended: true, verify }));
3432
app.get('/api/monitoring/healthcheck', healthCheckRequestHandler);
3533

36-
let enableMonitoring = true;
37-
try {
38-
enableMonitoring = getEnvVariable('MONITORING_ENABLED') === 'true';
39-
} catch (error) {
40-
logger.warn(
41-
`Monitoring is enabled by default. Not defining MONITORING_ENABLED is deprecated and will throw an error in 1.0.0`
42-
);
43-
}
44-
if (enableMonitoring) {
45-
app.get(
46-
'/api/monitoring/state',
47-
catchAsyncRouteErrors(stateRequestHandler)
48-
);
49-
}
5034
app.use(securityMiddleware);
5135
app.use(getEnvVariable('API_BASE_PATH'), router);
5236
app.use(errorMiddleware);

0 commit comments

Comments
 (0)