A worker that takes new posts from StackOverflow, of a certain tag, and writes it to a Discord channel.
You can see it in action on Sentry's Discord:
https://hub.docker.com/r/brunogarcia/oxideoverflow/tags
For example:
docker run --rm \
--env SENTRY_DSN=https://[email protected]/5536978 \
--env OXIDEOVERFLOW_TAG=sentry \
--env OXIDEOVERFLOW_DISCORD_URL=https://discord.com/api/webhooks/your-personal-url \
brunogarcia/oxideoverflow:edge
This project uses Sentry to track errors and crashes. When a docker image is built, in the build phase of the Dockerfile
the debug files are uploaded to Sentry in order to get the proper line numbers of crashes. That's done with sentry-cli
and requires a Sentry auth key. The container will initialize Sentry if a DSN is defined via environment variable SENTRY_DSN
. That's used by the Sentry SDK in the process to knows what Sentry instance (your own, or sentry.io) and which project within it to send the error information to.
docker build -t oxideoverflow \
--build-arg SENTRY_RELEASE=1.0 \
--build-arg SENTRY_AUTH_TOKEN=your-sentry-auth-token \
--build-arg SENTRY_ORG=your-sentry-project \
--build-arg SENTRY_PROJECT=oxideoverflow \
.
You can run the container by providing a few arguments to it. The parameters are described below.
At a minimum you need OXIDEOVERFLOW_TAG
and OXIDEOVERFLOW_DISCORD_URL
:
docker run --rm \
--env OXIDEOVERFLOW_TAG=sentry \
--env OXIDEOVERFLOW_DISCORD_URL=https://discord.com/api/webhooks/your-personal-url \
oxideoverflow
Where sentry
and https://discord.com/api/webhooks/your-personal-url
would be replaced with the information relevant to you.
Alternatively you can provide more information:
docker run --rm --env SENTRY_ENVIRONMENT=test \
--env SENTRY_DSN=https://[email protected]/5536978 \
--env OXIDEOVERFLOW_TAG=sentry \
--env OXIDEOVERFLOW_DISCORD_URL=https://discord.com/api/webhooks/your-personal-url \
--env OXIDEOVERFLOW_STACKOVERFLOW_KEY='my-token' \
oxideoverflow
OXIDEOVERFLOW_DISCORD_URL
- The URL you get from your Discord server, that tells oxideoverflow which channel to send the question to.
OXIDEOVERFLOW_STACKOVERFLOW_KEY
- To be able to hit the StackOverflow API more often, an API key can optionally be used. That increases the rate limite from the default 1000 per 24 hours to 10000 for that time range. You can register for an API token by creating a Stack App.
OXIDEOVERFLOW_TAG
- Which tag you want to monitor for questions on StackOverflow.
SENTRY_ENVIRONMENT
- The environment. If nothing is passed, it's prodution.
SENTRY_RELEASE
- The release name. For example 1.0 or a git SHA.
SENTRY_DSN
- The DSN of the Sentry project to send errors.