Skip to content
Draft
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
2 changes: 0 additions & 2 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ GOOGLE_API_KEY=AIzaserejejadejedejebetudejeberesebiuno

PAYMENT_INVOICE_RECAP_CC_EMAIL=it+administration@unguess.io

SENTRY_ENVIRONMENT=local


CAMPAIGN_CREATION_WEBHOOK=https://webhook.site/11111111-1111-1111-1111-11111111111
STATUS_CHANGE_WEBHOOK=https://webhook.site/11111111-1111-1111-1111-11111111111
Expand Down
4 changes: 0 additions & 4 deletions deployment/after-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ services:
CONNECTION_COUNT: ${CONNECTION_COUNT}
GOOGLE_API_KEY: '${GOOGLE_API_KEY}'
PAYMENT_INVOICE_RECAP_CC_EMAIL: '${PAYMENT_INVOICE_RECAP_CC_EMAIL}'
SENTRY_ENVIRONMENT: ${ENVIRONMENT}
ENVIRONMENT: ${ENVIRONMENT}
SENTRY_RELEASE: ${DOCKER_IMAGE}
SENTRY_DSN: ${SENTRY_DSN}
SENTRY_SAMPLE_RATE: ${SENTRY_SAMPLE_RATE:-1}
CLOUDFRONT_KEY_ID: ${CLOUDFRONT_KEY_ID}
JOTFORM_APIKEY: ${JOTFORM_APIKEY}
WORDPRESS_API_URL: ${WORDPRESS_API_URL}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@aws-sdk/util-format-url": "^3.821.0",
"@googlemaps/google-maps-services-js": "^3.3.7",
"@sendgrid/mail": "^7.6.0",
"@sentry/node": "^7.83.0",
"avatar-initials": "^5.0.0",
"aws-sdk": "^2.1087.0",
"axios": "^0.25.0",
Expand Down
3 changes: 0 additions & 3 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import express from "express";
import morgan from "morgan";
import OpenAPIBackend, { Options, Request } from "openapi-backend";
import config from "./config";
import Sentry from "./features/sentry";
import middleware from "./middleware";
import getExample from "./middleware/getExample";
import routes from "./routes";
Expand Down Expand Up @@ -36,7 +35,6 @@ routes(api);
api.init();

const app = express();
const sentry = new Sentry(app);

app.use(
busboy({
Expand Down Expand Up @@ -100,5 +98,4 @@ app.use((req, res) => {
return api.handleRequest(req as Request, req, res);
});

sentry.setErrorHandler();
export default app;
2 changes: 0 additions & 2 deletions src/features/routes/Route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Sentry from "@sentry/node";
import debugMessage from "@src/features/debugMessage";
import OpenapiError from "../OpenapiError";

Expand Down Expand Up @@ -104,7 +103,6 @@ export default class Route<T extends RouteClassTypes> {
try {
await this.prepare();
} catch (e) {
Sentry.captureException(e as Error);
if (e instanceof OpenapiError) {
return this.responseData;
} else {
Expand Down
41 changes: 0 additions & 41 deletions src/features/sentry/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/middleware/jwtSecurityHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Sentry from "@src/features/sentry";
import { checkCookies } from "@src/middleware/checkCookies";
import jwt from "jsonwebtoken";
import { Context } from "openapi-backend";
Expand Down Expand Up @@ -26,6 +25,5 @@ export default async (
const decoded = jwt.verify(token, config.jwt.secret);
req.user = decoded as unknown as UserType;

Sentry.identifyUser(req.user.user_login);
return req.user;
};
15 changes: 0 additions & 15 deletions src/middleware/postResponseHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Sentry from "@sentry/node";
import { Request } from "express";
import { Context } from "openapi-backend";
import process from "process";
Expand All @@ -15,20 +14,6 @@ export default (c: Context, req: Request, res: OpenapiResponse) => {
if (process.env && process.env.DEBUG) {
console.log(c.response);
}
Sentry.addBreadcrumb({
category: "Response Validation Failed",
message: `Validation failed for endpoint ${req.baseUrl + req.path}`,
level: "warning",
});
Sentry.addBreadcrumb({
category: "Invalid Data",
message: JSON.stringify(valid.errors),
level: "info",
});
Sentry.captureMessage(
`Response Validation error on ${req.method} ${req.baseUrl + req.path}`,
"warning"
);
return res.status(502).json({
status: 502,
err: valid.errors,
Expand Down
15 changes: 0 additions & 15 deletions src/middleware/validationFail.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
import * as Sentry from "@sentry/node";
import { Request } from "express";
import { Context } from "openapi-backend";

export default (c: Context, req: Request, res: OpenapiResponse) => {
res.skip_post_response_handler = true;
Sentry.addBreadcrumb({
category: "Request Validation Failed",
message: `Validation failed for endpoint ${req.baseUrl + req.path}`,
level: "warning",
});
Sentry.addBreadcrumb({
category: "Invalid Data",
message: JSON.stringify(c.validation.errors),
level: "info",
});
Sentry.captureMessage(
`Request Validation error on ${req.method} ${req.baseUrl + req.path}`,
"warning"
);
return res.status(400).json({
err: c.validation.errors,
});
Expand Down
Loading