├── DOKKU_SCALE ├── .github └── header.png ├── Dockerfile ├── .dockerignore ├── requirements.txt ├── Procfile ├── app.json ├── uwsgi.ini ├── .gitignore ├── config.yml ├── README.md └── sentry.conf.py /DOKKU_SCALE: -------------------------------------------------------------------------------- 1 | web=1 2 | worker=1 3 | beat=1 -------------------------------------------------------------------------------- /.github/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mimischi/dokku-sentry/HEAD/.github/header.png -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM sentry:9.1-onbuild 2 | 3 | RUN groupadd -r dokku && useradd -r -m -u 32768 -g dokku dokku 4 | USER dokku 5 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | .dockerignore 4 | Makefile 5 | README.md 6 | *.pyc 7 | *.tar 8 | docker-compose.yml 9 | data/ 10 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # WSGI handler 2 | uWSGI==2.0.18 3 | 4 | # Sentry plugins 5 | sentry-plugins==9.1.0 6 | 7 | # Environment variables for Django 8 | django-environ==0.4.5 9 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: uwsgi --ini=uwsgi.ini --http=0.0.0.0:9000 2 | worker: sentry --config=sentry.conf.py run worker --loglevel=INFO 3 | beat: sentry --config=sentry.conf.py run cron --loglevel=INFO 4 | release: sentry --config=sentry.conf.py upgrade --noinput 5 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Sentry", 3 | "description": "Sentry is a realtime event logging and aggregation platform", 4 | "repository": "https://github.com/mimischi/dokku-sentry", 5 | "website": "http://getsentry.com", 6 | "keywords": [ 7 | "logging", 8 | "error" 9 | ], 10 | "addons": [], 11 | "env": {}, 12 | "scripts": { 13 | "dokku": { 14 | "postdeploy": "sentry --config=sentry.conf.py upgrade --noinput" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /uwsgi.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | env = SENTRY_CONF=sentry.conf.py 3 | module = sentry.wsgi 4 | 5 | ; spawn the master and 4 processes with 8 threads each 6 | master = true 7 | processes = 4 8 | threads = 8 9 | 10 | ; allow longer headers for raven.js if applicable 11 | ; default: 4096 12 | buffer-size = 32768 13 | 14 | ; allow large file uploads 15 | limit-post = 20971520 16 | 17 | ; various other explicit defaults 18 | post-buffering = 65536 19 | thunder-lock = true 20 | disable-logging = true 21 | enable-threads = true 22 | single-interpreter = true 23 | lazy-apps = true 24 | log-x-forwarded-for = true 25 | 26 | ; Run nightly cron 27 | cron = 0 3 -1 -1 -1 sentry cleanup --days=90 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | local_settings.py 55 | 56 | # Sphinx documentation 57 | docs/_build/ 58 | 59 | # PyBuilder 60 | target/ 61 | 62 | # Ipython Notebook 63 | .ipynb_checkpoints 64 | 65 | # pyenv 66 | .python-version 67 | 68 | *.tar 69 | data/ 70 | -------------------------------------------------------------------------------- /config.yml: -------------------------------------------------------------------------------- 1 | # While a lot of configuration in Sentry can be changed via the UI, for all 2 | # new-style config (as of 8.0) you can also declare values here in this file 3 | # to enforce defaults or to ensure they cannot be changed via the UI. For more 4 | # information see the Sentry documentation. 5 | 6 | ############### 7 | # Mail Server # 8 | ############### 9 | 10 | # mail.backend: 'smtp' # Use dummy if you want to disable email entirely 11 | # mail.host: 'localhost' 12 | # mail.port: 25 13 | # mail.username: '' 14 | # mail.password: '' 15 | # mail.use-tls: false 16 | # The email address to send on behalf of 17 | # mail.from: 'root@localhost' 18 | 19 | # If you'd like to configure email replies, enable this. 20 | # mail.enable-replies: false 21 | 22 | # When email-replies are enabled, this value is used in the Reply-To header 23 | # mail.reply-hostname: '' 24 | 25 | # If you're using mailgun for inbound mail, set your API key and configure a 26 | # route to forward to /api/hooks/mailgun/inbound/ 27 | # mail.mailgun-api-key: '' 28 | 29 | ################### 30 | # System Settings # 31 | ################### 32 | 33 | # If this file ever becomes compromised, it's important to regenerate your a new key 34 | # Changing this value will result in all current sessions being invalidated. 35 | # A new key can be generated with `$ sentry config generate-secret-key` 36 | # system.secret-key: 'changeme' 37 | 38 | # The ``redis.clusters`` setting is used, unsurprisingly, to configure Redis 39 | # clusters. These clusters can be then referred to by name when configuring 40 | # backends such as the cache, digests, or TSDB backend. 41 | # redis.clusters: 42 | # default: 43 | # hosts: 44 | # 0: 45 | # host: 127.0.0.1 46 | # port: 6379 47 | 48 | ################ 49 | # File storage # 50 | ################ 51 | 52 | # Uploaded media uses these `filestore` settings. The available 53 | # backends are either `filesystem` or `s3`. 54 | 55 | # filestore.backend: 'filesystem' 56 | # filestore.options: 57 | # location: '/tmp/sentry-files' 58 | 59 | # filestore.backend: 's3' 60 | # filestore.options: 61 | # access_key: 'AKIXXXXXX' 62 | # secret_key: 'XXXXXXX' 63 | # bucket_name: 's3-bucket-name' 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Project logo](.github/header.png) 2 | 3 | ![Sentry version](https://img.shields.io/badge/Sentry-9.1-blue.svg) ![Dokku version](https://img.shields.io/badge/Dokku-v0.14.6-blue.svg) 4 | 5 | # Run Sentry on Dokku 6 | 7 | Deploy your own instance of [Sentry](https://sentry.io) onto 8 | [Dokku](https://github.com/dokku/dokku)! 9 | 10 | This project is a clone of the official bootstrap repository 11 | ([getsentry/onpremise](https://github.com/getsentry/onpremise)) with a few 12 | modifications for a seamless deploy to Dokku. 13 | 14 | ## What you get 15 | 16 | This repository will deploy [Sentry 17 | 9.1](https://github.com/getsentry/sentry/releases/tag/9.1.0). It has been tested 18 | with Dokku 0.10+. 19 | 20 | ## Requirements 21 | 22 | * [Dokku](https://github.com/dokku/dokku) 23 | * [dokku-postgres](https://github.com/dokku/dokku-postgres) 24 | * [dokku-redis](https://github.com/dokku/dokku-redis) 25 | * [dokku-memcached](https://github.com/dokku/dokku-memcached) 26 | * [dokku-letsencrypt](https://github.com/dokku/dokku-letsencrypt) 27 | 28 | # Upgrading 29 | 30 | When upgrading to a newer version, e.g. 8.22 to 9.1.0, you just need to follow 31 | the following steps: 32 | 33 | First get the newest version of this repository from GitHub and push it to you 34 | Dokku host: 35 | 36 | ```bash 37 | git pull 38 | git push dokku master 39 | ``` 40 | 41 | During the deploy, Dokku will run all commands that are necessary to upgrade the 42 | database to the newest version. You do not need to do anything else. 43 | 44 | # Setup 45 | 46 | This will guide you through the set up of a new Sentry instance. Make sure to 47 | follow these steps one after another. 48 | 49 | ## App and databases 50 | 51 | First create a new Dokku app. We'll call it `sentry`. 52 | 53 | ``` 54 | dokku apps:create sentry 55 | ``` 56 | 57 | Next we create the databases needed by Sentry and link them. 58 | 59 | ``` 60 | dokku postgres:create sentry_postgres 61 | dokku postgres:link sentry_postgres sentry 62 | 63 | dokku redis:create sentry_redis 64 | dokku redis:link sentry_redis sentry 65 | 66 | dokku memcached:create sentry_memcached 67 | dokku memcached:link sentry_memcached sentry 68 | ``` 69 | 70 | ## Configuration 71 | 72 | ### Set a secret key 73 | 74 | ``` 75 | dokku config:set --no-restart sentry SENTRY_SECRET_KEY=$(echo `openssl rand -base64 64` | tr -d ' ') 76 | ``` 77 | 78 | ### Email settings 79 | 80 | If you want to receive emails from sentry (notifications, activation mails), you 81 | need to set the following settings accordingly. 82 | 83 | ``` 84 | dokku config:set --no-restart sentry SENTRY_EMAIL_HOST=smtp.example.com 85 | dokku config:set --no-restart sentry SENTRY_EMAIL_USER= 86 | dokku config:set --no-restart sentry SENTRY_EMAIL_PASSWORD= 87 | dokku config:set --no-restart sentry SENTRY_EMAIL_PORT=25 88 | dokku config:set --no-restart sentry SENTRY_SERVER_EMAIL=sentry@example.com 89 | dokku config:set --no-restart sentry SENTRY_EMAIL_USE_TLS=True 90 | ``` 91 | 92 | ## Persistent storage 93 | 94 | To persists user uploads (e.g. avatars) between restarts, we create a folder on 95 | the host machine and tell Dokku to mount it to the app container. 96 | 97 | ``` 98 | sudo mkdir -p /var/lib/dokku/data/storage/sentry 99 | sudo chown 32768:32768 /var/lib/dokku/data/storage/sentry 100 | dokku storage:mount sentry /var/lib/dokku/data/storage/sentry:/var/lib/sentry/files 101 | ``` 102 | 103 | ## Domain setup 104 | 105 | To get the routing working, we need to apply a few settings. First we set 106 | the domain. 107 | 108 | ``` 109 | dokku domains:set sentry sentry.example.com 110 | ``` 111 | 112 | The parent Dockerfile, provided by the sentry project, exposes port `9000` for 113 | web requests. Dokku will set up this port for outside communication, as 114 | explained in [its 115 | documentation](http://dokku.viewdocs.io/dokku/advanced-usage/proxy-management/#proxy-port-mapping). 116 | Because we want Sentry to be available on the default port `80` (or `443` for 117 | SSL), we need to fiddle around with the proxy settings. 118 | 119 | First add the proxy mapping that sentry uses. 120 | 121 | ``` 122 | dokku proxy:ports-add sentry http:80:9000 123 | ``` 124 | 125 | Then, remove the proxy mapping added by Dokku. 126 | 127 | ``` 128 | dokku proxy:ports-remove sentry http:80:5000 129 | ``` 130 | 131 | If `dokku proxy:report sentry` shows more than one port mapping, 132 | remove all port mappings except the added above. 133 | 134 | ## Push Sentry to Dokku 135 | 136 | ### Grabbing the repository 137 | 138 | First clone this repository onto your machine. 139 | 140 | #### Via SSH 141 | 142 | ``` 143 | git clone git@github.com:mimischi/dokku-sentry.git 144 | ``` 145 | 146 | #### Via HTTPS 147 | 148 | ``` 149 | git clone https://github.com/mimischi/dokku-sentry.git 150 | ``` 151 | 152 | ### Set up git remote 153 | 154 | Now you need to set up your Dokku server as a remote. 155 | 156 | ``` 157 | git remote add dokku dokku@example.com:sentry 158 | ``` 159 | 160 | ### Push Sentry 161 | 162 | Now we can push Sentry to Dokku (_before_ moving on to the [next part](#domain-and-ssl-certificate)). 163 | 164 | ``` 165 | git push dokku master 166 | ``` 167 | 168 | ## SSL certificate 169 | 170 | Last but not least, we can go an grab the SSL certificate from [Let's 171 | Encrypt](https://letsencrypt.org/). 172 | 173 | ``` 174 | dokku config:set --no-restart sentry DOKKU_LETSENCRYPT_EMAIL=you@example.com 175 | dokku config:set --no-restart sentry SENTRY_USE_SSL=True 176 | dokku letsencrypt sentry 177 | ``` 178 | 179 | ## Create a user 180 | 181 | Sentry is now up and running on your domain ([https://sentry.example.com](#)). 182 | Before you're able to use it, you need to create a user. 183 | 184 | ``` 185 | dokku run sentry sentry createuser 186 | ``` 187 | 188 | This will prompt you to enter an email, password and whether the user should be a superuser. 189 | -------------------------------------------------------------------------------- /sentry.conf.py: -------------------------------------------------------------------------------- 1 | # This file is just Python, with a touch of Django which means 2 | # you can inherit and tweak settings to your hearts content. 3 | 4 | # For Docker, the following environment variables are supported: 5 | # SENTRY_POSTGRES_HOST 6 | # SENTRY_POSTGRES_PORT 7 | # SENTRY_DB_NAME 8 | # SENTRY_DB_USER 9 | # SENTRY_DB_PASSWORD 10 | # SENTRY_RABBITMQ_HOST 11 | # SENTRY_RABBITMQ_USERNAME 12 | # SENTRY_RABBITMQ_PASSWORD 13 | # SENTRY_RABBITMQ_VHOST 14 | # SENTRY_REDIS_HOST 15 | # SENTRY_REDIS_PASSWORD 16 | # SENTRY_REDIS_PORT 17 | # SENTRY_REDIS_DB 18 | # SENTRY_MEMCACHED_HOST 19 | # SENTRY_MEMCACHED_PORT 20 | # SENTRY_FILESTORE_DIR 21 | # SENTRY_SERVER_EMAIL 22 | # SENTRY_EMAIL_HOST 23 | # SENTRY_EMAIL_PORT 24 | # SENTRY_EMAIL_USER 25 | # SENTRY_EMAIL_PASSWORD 26 | # SENTRY_EMAIL_USE_TLS 27 | # SENTRY_ENABLE_EMAIL_REPLIES 28 | # SENTRY_SMTP_HOSTNAME 29 | # SENTRY_MAILGUN_API_KEY 30 | 31 | # GITHUB_APP_ID 32 | # GITHUB_API_SECRET 33 | import os 34 | # SENTRY_SINGLE_ORGANIZATION 35 | # SENTRY_SECRET_KEY 36 | import os.path 37 | 38 | import environ 39 | from sentry.conf.server import * # NOQA 40 | 41 | # Use django-environ to easily parse environment variables 42 | eenv = environ.Env() 43 | CONF_ROOT = os.path.dirname(__file__) 44 | 45 | # Looks for "DATABASE_URL" in environment variables 46 | DATABASES = {'default': eenv.db()} 47 | 48 | # You should not change this setting after your database has been created 49 | # unless you have altered all schemas first 50 | SENTRY_USE_BIG_INTS = True 51 | 52 | # If you're expecting any kind of real traffic on Sentry, we highly recommend 53 | # configuring the CACHES and Redis settings 54 | 55 | ########### 56 | # General # 57 | ########### 58 | 59 | # Instruct Sentry that this install intends to be run by a single organization 60 | # and thus various UI optimizations should be enabled. 61 | SENTRY_SINGLE_ORGANIZATION = env('SENTRY_SINGLE_ORGANIZATION', True) 62 | 63 | ######### 64 | # Redis # 65 | ######### 66 | 67 | # Generic Redis configuration used as defaults for various things including: 68 | # Buffers, Quotas, TSDB 69 | 70 | REDIS_URL = eenv.url('REDIS_URL') 71 | REDIS_HOSTNAME = REDIS_URL.hostname 72 | REDIS_PASSWORD = REDIS_URL.password 73 | REDIS_PORT = REDIS_URL.port 74 | REDIS_DB = REDIS_URL.path[1:] or '0' 75 | 76 | SENTRY_OPTIONS.update({ 77 | 'redis.clusters': { 78 | 'default': { 79 | 'hosts': { 80 | 0: { 81 | 'host': REDIS_HOSTNAME, 82 | 'password': REDIS_PASSWORD, 83 | 'port': REDIS_PORT, 84 | 'db': REDIS_DB, 85 | }, 86 | }, 87 | }, 88 | }, 89 | }) 90 | 91 | ######### 92 | # Cache # 93 | ######### 94 | 95 | # Sentry currently utilizes two separate mechanisms. While CACHES is not a 96 | # requirement, it will optimize several high throughput patterns. 97 | 98 | MEMCACHED_URL = eenv.url('MEMCACHED_URL', None) 99 | if MEMCACHED_URL: 100 | MEMCACHED_HOST = MEMCACHED_URL.hostname 101 | MEMCACHED_PORT = MEMCACHED_URL.port 102 | CACHES = { 103 | 'default': { 104 | 'BACKEND': 105 | 'django.core.cache.backends.memcached.MemcachedCache', 106 | 'LOCATION': 107 | '{host}:{port}'.format(host=MEMCACHED_HOST, port=MEMCACHED_PORT), 108 | 'TIMEOUT': 109 | 3600, 110 | } 111 | } 112 | 113 | # A primary cache is required for things such as processing events 114 | SENTRY_CACHE = 'sentry.cache.redis.RedisCache' 115 | 116 | ######### 117 | # Queue # 118 | ######### 119 | 120 | # See https://docs.getsentry.com/on-premise/server/queue/ for more 121 | # information on configuring your queue broker and workers. Sentry relies 122 | # on a Python framework called Celery to manage queues. 123 | 124 | RABBITMQ_URL = eenv.url('RABBITMQ_URL', None) 125 | 126 | if RABBITMQ_URL: 127 | BROKER_URL = (RABBITMQ_URL.geturl()) 128 | else: 129 | BROKER_URL = (REDIS_URL.geturl()) 130 | 131 | ############### 132 | # Rate Limits # 133 | ############### 134 | 135 | # Rate limits apply to notification handlers and are enforced per-project 136 | # automatically. 137 | 138 | SENTRY_RATELIMITER = 'sentry.ratelimits.redis.RedisRateLimiter' 139 | 140 | ################## 141 | # Update Buffers # 142 | ################## 143 | 144 | # Buffers (combined with queueing) act as an intermediate layer between the 145 | # database and the storage API. They will greatly improve efficiency on large 146 | # numbers of the same events being sent to the API in a short amount of time. 147 | # (read: if you send any kind of real data to Sentry, you should enable buffers) 148 | 149 | SENTRY_BUFFER = 'sentry.buffer.redis.RedisBuffer' 150 | 151 | ########## 152 | # Quotas # 153 | ########## 154 | 155 | # Quotas allow you to rate limit individual projects or the Sentry install as 156 | # a whole. 157 | 158 | SENTRY_QUOTAS = 'sentry.quotas.redis.RedisQuota' 159 | 160 | ######## 161 | # TSDB # 162 | ######## 163 | 164 | # The TSDB is used for building charts as well as making things like per-rate 165 | # alerts possible. 166 | 167 | SENTRY_TSDB = 'sentry.tsdb.redis.RedisTSDB' 168 | 169 | ########### 170 | # Digests # 171 | ########### 172 | 173 | # The digest backend powers notification summaries. 174 | 175 | SENTRY_DIGESTS = 'sentry.digests.backends.redis.RedisBackend' 176 | 177 | ################ 178 | # File storage # 179 | ################ 180 | 181 | # Uploaded media uses these `filestore` settings. The available 182 | # backends are either `filesystem` or `s3`. 183 | 184 | SENTRY_OPTIONS['filestore.backend'] = 'filesystem' 185 | SENTRY_OPTIONS['filestore.options'] = { 186 | 'location': env('SENTRY_FILESTORE_DIR'), 187 | } 188 | 189 | ############## 190 | # Web Server # 191 | ############## 192 | 193 | # If you're using a reverse SSL proxy, you should enable the X-Forwarded-Proto 194 | # header and set `SENTRY_USE_SSL=1` 195 | 196 | if env('SENTRY_USE_SSL', False): 197 | SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') 198 | SESSION_COOKIE_SECURE = True 199 | CSRF_COOKIE_SECURE = True 200 | SOCIAL_AUTH_REDIRECT_IS_HTTPS = True 201 | 202 | SENTRY_WEB_HOST = '0.0.0.0' 203 | SENTRY_WEB_PORT = 9000 204 | SENTRY_WEB_OPTIONS = { 205 | # 'workers': 3, # the number of web workers 206 | } 207 | 208 | ############### 209 | # Mail Server # 210 | ############### 211 | 212 | email = env('SENTRY_EMAIL_HOST') or (env('SMTP_PORT_25_TCP_ADDR') and 'smtp') 213 | if email: 214 | SENTRY_OPTIONS['mail.backend'] = 'smtp' 215 | SENTRY_OPTIONS['mail.host'] = email 216 | SENTRY_OPTIONS['mail.password'] = env('SENTRY_EMAIL_PASSWORD') or '' 217 | SENTRY_OPTIONS['mail.username'] = env('SENTRY_EMAIL_USER') or '' 218 | SENTRY_OPTIONS['mail.port'] = int(env('SENTRY_EMAIL_PORT') or 25) 219 | SENTRY_OPTIONS['mail.use-tls'] = env('SENTRY_EMAIL_USE_TLS', False) 220 | else: 221 | SENTRY_OPTIONS['mail.backend'] = 'dummy' 222 | 223 | # The email address to send on behalf of 224 | SENTRY_OPTIONS['mail.from'] = env('SENTRY_SERVER_EMAIL') or 'root@localhost' 225 | 226 | # If you're using mailgun for inbound mail, set your API key and configure a 227 | # route to forward to /api/hooks/mailgun/inbound/ 228 | SENTRY_OPTIONS['mail.mailgun-api-key'] = env('SENTRY_MAILGUN_API_KEY') or '' 229 | 230 | # If you specify a MAILGUN_API_KEY, you definitely want EMAIL_REPLIES 231 | if SENTRY_OPTIONS['mail.mailgun-api-key']: 232 | SENTRY_OPTIONS['mail.enable-replies'] = True 233 | else: 234 | SENTRY_OPTIONS['mail.enable-replies'] = env('SENTRY_ENABLE_EMAIL_REPLIES', 235 | False) 236 | 237 | if SENTRY_OPTIONS['mail.enable-replies']: 238 | SENTRY_OPTIONS['mail.reply-hostname'] = env('SENTRY_SMTP_HOSTNAME') or '' 239 | 240 | # If this value ever becomes compromised, it's important to regenerate your 241 | # SENTRY_SECRET_KEY. Changing this value will result in all current sessions 242 | # being invalidated. 243 | secret_key = env('SENTRY_SECRET_KEY') 244 | if not secret_key: 245 | raise Exception( 246 | 'Error: SENTRY_SECRET_KEY is undefined, run `generate-secret-key` and set to -e SENTRY_SECRET_KEY' 247 | ) 248 | 249 | if 'SENTRY_RUNNING_UWSGI' not in os.environ and len(secret_key) < 32: 250 | print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') 251 | print('!! CAUTION !!') 252 | print('!! Your SENTRY_SECRET_KEY is potentially insecure. !!') 253 | print('!! We recommend at least 32 characters long. !!') 254 | print('!! Regenerate with `generate-secret-key`. !!') 255 | print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') 256 | 257 | SENTRY_OPTIONS['system.secret-key'] = secret_key 258 | 259 | if 'GITHUB_APP_ID' in os.environ: 260 | GITHUB_EXTENDED_PERMISSIONS = ['repo'] 261 | GITHUB_APP_ID = env('GITHUB_APP_ID') 262 | GITHUB_API_SECRET = env('GITHUB_API_SECRET') 263 | 264 | if 'BITBUCKET_CONSUMER_KEY' in os.environ: 265 | BITBUCKET_CONSUMER_KEY = env('BITBUCKET_CONSUMER_KEY') 266 | BITBUCKET_CONSUMER_SECRET = env('BITBUCKET_CONSUMER_SECRET') 267 | --------------------------------------------------------------------------------