π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Restrict Sentry reporter upstream hosts
Manav Rathiad593c6f8b6a
diff --git a/infra/workers/sentry-reporter/src/index.ts b/infra/workers/sentry-reporter/src/index.tsindex f09cd6e9aa..bfe8eeef23 100644--- a/infra/workers/sentry-reporter/src/index.ts+++ b/infra/workers/sentry-reporter/src/index.ts@@ -26,6 +26,7 @@ const handlePOST = async (request: Request) => {const originalBody = await request.text();const originalDSNString = extractDSN(originalBody);const { body, dsn } = mapDSN(originalBody, originalDSNString);+ if (!isEnteSentryDSN(dsn)) return new Response(null, { status: 400 });const projectId = parseInt(dsn.pathname?.slice(1)?.split("/")[0] ?? "1");@@ -82,6 +83,10 @@ const mapDSN = (originalBody: string, originalDSNString: string) => {return { body, dsn };};+const isEnteSentryDSN = (dsn: URL) =>+ dsn.protocol === "https:" &&+ (dsn.hostname === "sentry.ente.com" || dsn.hostname === "sentry.ente.io");+const dsnMappings: Record<string, string> = {// photos-mobile"https://[email protected]/4":