-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(nextjs): Add option for auto-generated random tunnel route #16626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
function generateRandomTunnelRoute(): string { | ||
// Generate a random 8-character alphanumeric string | ||
const randomString = Math.random().toString(36).substring(2, 10); | ||
return `/${randomString}`; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Purely out of interestet, because I don't have context on how the SDK works in this case - how do we make sure these routes don't show up as endpoints in the data? Is this done by setUpTunnelRewriteRules
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an event processor in place that will filter these out. That being said I still need to figure out some details regarding value injection and test this manually
// Update the global options object to use the resolved value everywhere | ||
userSentryOptions.tunnelRoute = resolvedTunnelRoute; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, is this the only way to pass the route around? Not a big fan of overwriting the passed in option but maybe this is bike-shedding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seemed to be the most KISS variant I could think of here, because we can prevent the case that we have two different values floating around for the route
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I guess fair enough.
This PR adds support for auto-generated tunnel paths to avoid ad-blocker detection.
/monitoring
tunnelRoute: true
for an auto-generated routeNote that every build will now create a different random path which should be quite unpredictable for ad-blockers