Code Monkey home page Code Monkey logo

sentry-tunneler's Introduction

sentry-tunneler

Sentry tunneler is a proxy that forwards requests to Sentry-compatible services. This was heavily inspired by https://github.com/gbip/sentry_tunnel.

As the official Sentry documentation notes:

A tunnel is an HTTP endpoint that acts as a proxy between Sentry and your application. Because you control this server, there is no risk of any requests sent to it being blocked. When the endpoint lives under the same origin (although it does not have to in order for the tunnel to work), the browser will not treat any requests to the endpoint as a third-party request. As a result, these requests will have different security measures applied which, by default, don't trigger ad-blockers.

Why not just use sentry_tunnel?

The original sentry_tunnel is also a Rust project, but it is using gotham which doesn't have an easy way to enable CORS for some reason. This project instead uses axum, which allows for a much less involved setup.

Configuration

The following environment variables are used to configure the tunneler:

CORS_ALLOWED_ORIGINS=https://example.com
ALLOWED_SENTRY_HOSTS=https://sentry.example.com
ALLOWED_PROJECT_IDS=1,2,3
TUNNEL_PATH="/tunnel"
LISTEN_PORT=3000

CORS_ALLOWED_ORIGINS, ALLOWED_SENTRY_HOSTS, and ALLOWED_PROJECT_IDS are all comma-separated lists of values. TUNNEL_PATH is the path that the tunneler will listen on. LISTEN_PORT is the port that the tunneler will listen on.

If CORS_ALLOWED_ORIGINS is not set, Access-Control-Allow-Origin will be set to *. If ALLOWED_SENTRY_HOSTS is not set, all hosts will be allowed. If ALLOWED_PROJECT_IDS is not set, all projects will be allowed. This is a depature from the original sentry_tunnel which required all of these to be set.

Running

This project is designed to be run as a docker container:

docker run --rm -p 3000:3000 ghcr.io/joeyeamigh/sentry-tunneler:latest

Building

Running locally is easiest if you enable the dotenv feature and copy .env.example to .env:

cargo run --features dotenv

sentry-tunneler's People

Contributors

joeyeamigh avatar

Stargazers

Ryan Hiebert avatar Oscar MARIE--TAILLEFER avatar Kirsten Laskoski avatar

Watchers

 avatar

Forkers

leduythuccs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.