Git Product home page Git Product logo

cloudflare-access-for-sentry's Introduction

Cloudflare Access for Sentry

Repository for Cloudflare Access for Sentry plugin development.

Install on your On-Premise Sentry instance

To enable this plugin on your On-Premise installation of Sentry you need to install via pip and update your sentry.conf.py

The Access Audience and Auth Domain may be set in your OS environment or directly in Sentry conf file.

Install with pip

When it become public can change to:

pip install "git+https://github.com/cloudflare/cloudflare-access-for-sentry@master#egg=sentry_cloudflare_access_auth&subdirectory=src"

And restart your Sentry after updating the configuration.

Configuration For Sentry 9.x

####################################################
# Cloudflare Access Plugin Setup and Configuration #
####################################################
from sentry_cloudflare_access_auth.helper import setup_cloudflare_access_for_sentry_9x
MIDDLEWARE_CLASSES, AUTHENTICATION_BACKENDS, TEMPLATE_DIRS = setup_cloudflare_access_for_sentry_9x(MIDDLEWARE_CLASSES, AUTHENTICATION_BACKENDS, TEMPLATE_DIRS)

CLOUDFLARE_ACCESS_POLICY_AUD = os.getenv("CF_POLICY_AUD")
CLOUDFLARE_ACCESS_AUTH_DOMAIN = os.getenv("CF_AUTH_DOMAIN")

# Emails that match this domain will authorize with their Access JWT. 
# All other emails will be required authorize again with their Sentry credentials.
#CLOUDFLARE_ACCESS_ALLOWED_DOMAIN = None

Configuration For Sentry 10.x

####################################################
# Cloudflare Access Plugin Setup and Configuration #
####################################################
from sentry_cloudflare_access_auth.helper import setup_cloudflare_access_for_sentry_10x
MIDDLEWARE_CLASSES, AUTHENTICATION_BACKENDS, TEMPLATES = setup_cloudflare_access_for_sentry_10x(MIDDLEWARE_CLASSES, AUTHENTICATION_BACKENDS, TEMPLATES)

CLOUDFLARE_ACCESS_POLICY_AUD = os.getenv("CF_POLICY_AUD")
CLOUDFLARE_ACCESS_AUTH_DOMAIN = os.getenv("CF_AUTH_DOMAIN")

# Emails that match this domain will authorize with their Access JWT. 
# All other emails will be required authorize again with their Sentry credentials.
#CLOUDFLARE_ACCESS_ALLOWED_DOMAIN = None

Plugin Development

Prepare your python environment to build the plugin:

pip install setuptools
pip install wheel

If you want to have code completion on your IDE probably is a good idea to also run:

pip install 'django<1.10'

Create a sentry-docker-9x/.env and sentry-docker-10x/sentry.env files with your Cloudflare Access test credentials like:

CF_POLICY_AUD="YOUR POLICY AUDIENCE VALUE"
CF_AUTH_DOMAIN="YOUR ACCESS LOGIN PAGE DOMAIN"

Prepare your Sentry on Docker environment:

#Or replace 9x with 10x
cd sentry-docker-9x
./install.sh
docker-compose up -d

To reload the plugin code:

#Or replace 9x with 10x
./build-docker-9x.sh

Running tests

Running tests for Sentry 9.x:

./test.sh -t 9

Running tests for Sentry 10.x:

./test.sh -t 10

Cleanup tests for 9.x or 10.x:

./test.sh -t 10 -c

Django version

Sentry 9.x is based on Django 1.7 .

Sentry 10.x is based on Django 1.9 .

cloudflare-access-for-sentry's People

Contributors

felipebn avatar

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.