Compare commits
4 Commits
v2.4.35
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
| a5776f24d7 | |||
| 19ccd90070 | |||
| c1cad7b99b | |||
| cbda41ee95 |
2
.env
2
.env
@@ -27,7 +27,7 @@ UMAMI_API_ENDPOINT=https://analytics.infra.mintel.me
|
||||
# Error Tracking (GlitchTip/Sentry)
|
||||
# ────────────────────────────────────────────────────────────────────────────
|
||||
# Optional: Leave empty to disable error tracking
|
||||
SENTRY_DSN=https://dcb81958-dbf2-4a3d-b422-875f4672c14b@glitchtip.infra.mintel.me/5
|
||||
SENTRY_DSN=https://dcb81958dbf24a3db422875f4672c14b@errors.infra.mintel.me/5
|
||||
|
||||
# ────────────────────────────────────────────────────────────────────────────
|
||||
# Email Configuration (SMTP)
|
||||
|
||||
@@ -16,7 +16,7 @@ UMAMI_WEBSITE_ID=d773ea10-a3b3-4ccf-9024-987e14c4d669
|
||||
UMAMI_API_ENDPOINT=https://analytics.infra.mintel.me
|
||||
|
||||
# Error Tracking (GlitchTip/Sentry)
|
||||
SENTRY_DSN=https://dcb81958-dbf2-4a3d-b422-875f4672c14b@glitchtip.infra.mintel.me/5
|
||||
SENTRY_DSN=https://dcb81958dbf24a3db422875f4672c14b@errors.infra.mintel.me/5
|
||||
|
||||
# Email Configuration (Mailgun)
|
||||
MAIL_HOST=smtp.eu.mailgun.org
|
||||
|
||||
@@ -49,6 +49,7 @@ const mdxComponents = {
|
||||
JsonLd,
|
||||
Button,
|
||||
Badge,
|
||||
Heading,
|
||||
AnimatedCounter,
|
||||
GrowthChart,
|
||||
DeepDrillAnimation,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import https from 'https';
|
||||
|
||||
const ALLOWED_HOSTS = ['glitchtip.infra.mintel.me', 'errors.infra.mintel.me'];
|
||||
|
||||
@@ -36,21 +37,45 @@ export async function POST(req: Request) {
|
||||
const sentryIngestUrl = `https://${host}/api/${projectId}/envelope/`;
|
||||
const payloadToForward = items.join('\n');
|
||||
|
||||
const response = await fetch(sentryIngestUrl, {
|
||||
method: 'POST',
|
||||
body: payloadToForward,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-sentry-envelope',
|
||||
},
|
||||
return new Promise<NextResponse>((resolve) => {
|
||||
const req = https.request(
|
||||
sentryIngestUrl,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-sentry-envelope',
|
||||
},
|
||||
// Bypass self-signed cert error since glitchtip.infra.mintel.me uses an internal CA
|
||||
// that the Next.js docker container doesn't trust by default.
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
(res) => {
|
||||
res.on('data', () => {
|
||||
// Consume data to free up memory
|
||||
});
|
||||
res.on('end', () => {
|
||||
if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {
|
||||
resolve(NextResponse.json({ success: true }));
|
||||
} else {
|
||||
resolve(
|
||||
NextResponse.json(
|
||||
{ error: `Relay rejected (${res.statusCode})` },
|
||||
{ status: res.statusCode || 500 }
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
req.on('error', (err) => {
|
||||
console.error('[Sentry Tunnel] https.request failed', err);
|
||||
resolve(NextResponse.json({ error: 'Relay failed' }, { status: 500 }));
|
||||
});
|
||||
|
||||
req.write(payloadToForward);
|
||||
req.end();
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text();
|
||||
console.error(`[Sentry Tunnel] Relay rejected (${response.status}):`, errorText);
|
||||
return NextResponse.json({ error: 'Sentry rejection' }, { status: response.status });
|
||||
}
|
||||
|
||||
return NextResponse.json({ success: true });
|
||||
} catch (e) {
|
||||
console.error("[Sentry Tunnel] Failed to parse or relay body", e);
|
||||
return NextResponse.json({ error: 'Relay failed' }, { status: 500 });
|
||||
|
||||
@@ -39,6 +39,7 @@ const mdxComponents = {
|
||||
ul: (props: any) => <ul className="grid grid-cols-1 gap-2 mb-6" {...props} />,
|
||||
li: CustomLi,
|
||||
p: (props: any) => <p className="text-neutral-600 text-sm mb-4 leading-relaxed" {...props} />,
|
||||
Heading,
|
||||
};
|
||||
|
||||
interface PageProps {
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
"prepare": "husky",
|
||||
"preinstall": "npx only-allow pnpm"
|
||||
},
|
||||
"version": "2.4.35",
|
||||
"version": "2.4.36",
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"@parcel/watcher",
|
||||
|
||||
Reference in New Issue
Block a user