Skip to content
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

Sentry 8.15 #64

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ADD sentry_run /usr/local/bin/

ENTRYPOINT ["/usr/local/bin/sentry_run"]

CMD ["start"]
CMD ["run", "web"]

ADD scripts/create_team_or_project.py /conf/
ADD scripts/check_db_isalive.py /conf/
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Sentry in Docker

Latest changes introduced some new build tags:

* **8.0** - current stable version (8.0.X)
* **8.15.0** - current stable version (8.15.0)
* **8.0** - old stable version (8.0.X) - no longer updated
* **7.7** - old stable version (7.7.4) - no longer updated
* **7.6** - old stable version (7.6.2) - no longer updated
* **7.5** - old stable version (7.5.6) - no longer updated
Expand All @@ -16,7 +17,7 @@ Latest changes introduced some new build tags:
* **7.0** - older stable version (7.0.2) - no longer updated
* **6.4** - even older stable version (6.4.4) - no longer updated
* **dev** - current master on github (infrequent builds)
* **latest** (the default one used earlier) - is now the same as **8.0**
* **latest** (the default one used earlier) - is now the same as **8.15.0**

if you want to keep your builds same as before update your Dockerfiles and change
```FROM slafs/sentry``` to ```FROM slafs/sentry:6.4```.
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ django-redis==4.3.0
hiredis==0.2.0

# sentry
sentry[postgres]==8.0.6
sentry[postgres]==8.15.0

# ldap user store
django-auth-ldap==1.2.7

# plugins (i.e. Jira)
sentry-plugins==8.19.0
2 changes: 2 additions & 0 deletions scripts/create_team_or_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def create_project(team_name, project_name):
defaults = {'organization': team.organization}
project, new = Project.objects.get_or_create(name=project_name, team=team,
defaults=defaults)
project.update_option('sentry:scrub_data', False)
project.update_option('sentry:scrub_defaults', False)

return project, new

Expand Down
80 changes: 40 additions & 40 deletions sentry_docker_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,6 @@

SENTRY_PUBLIC = config('SENTRY_PUBLIC', default=False, cast=bool)

def nydus_config(from_env_var):
"""
Generate a Nydus Redis configuration from an ENV variable of the form "server:port,server:port..."
Default to REDIS_HOST:REDIS_PORT if the ENV variable is not provided.
"""
redis_servers_cast = lambda x: list(r.split(':') for r in x.split(','))
servers = config(from_env_var, default='{0}:{1}'.format(REDIS_HOST, REDIS_PORT), cast=redis_servers_cast)
_redis_hosts = {}

for r_index, r_host_pair in enumerate(servers):
_redis_hosts[r_index] = {'host': r_host_pair[0], 'port': int(r_host_pair[1])}

return {
'hosts': _redis_hosts
}


############################
# General Sentry options ##
Expand All @@ -57,6 +41,27 @@ def nydus_config(from_env_var):
# You MUST configure the absolute URI root for Sentry:
'system.url-prefix': config('SENTRY_URL_PREFIX'),
'system.admin-email': config('SENTRY_ADMIN_EMAIL', default='root@localhost'),
# If this file ever becomes compromised, it's important to regenerate your SECRET_KEY
# Changing this value will result in all current sessions being invalidated
'system.secret-key': config('SECRET_KEY'),
# Mail Settings
# For more information check Django's documentation:
# https://docs.djangoproject.com/en/1.3/topics/email/?from=olddocs#e-mail-backends
'mail.backend': config('SENTRY_EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend'),
'mail.host': config('SENTRY_EMAIL_HOST', default='localhost'),
'mail.port': config('SENTRY_EMAIL_PORT', default=25, cast=int),
'mail.password': config('SENTRY_EMAIL_HOST_PASSWORD', default=''),
'mail.username': config('SENTRY_EMAIL_HOST_USER', default=''),
'mail.use-tls': config('SENTRY_EMAIL_USE_TLS', default=False, cast=bool),
# The email address to send on behalf of
'mail.from': config('SENTRY_SERVER_EMAIL', default='root@localhost'),
'redis.clusters': {
'default': {
'hosts': {
0: {'host': REDIS_HOST, 'port': REDIS_PORT},
}
}
}
}

###########
Expand All @@ -69,7 +74,8 @@ def nydus_config(from_env_var):

# You can enable queueing of jobs by turning off the always eager setting:
CELERY_ALWAYS_EAGER = config('CELERY_ALWAYS_EAGER', default=True, cast=bool)
DEFAULT_BROKER_URL = 'redis://{0}:{1}/1'.format(REDIS_HOST, REDIS_PORT)
REDIS_BROKER_DATABASE=config('REDIS_BROKER_DATABASE', default='1')
DEFAULT_BROKER_URL = 'redis://{0}:{1}/{2}'.format(REDIS_HOST, REDIS_PORT, REDIS_BROKER_DATABASE)

BROKER_URL = config('SENTRY_BROKER_URL', default=DEFAULT_BROKER_URL)

Expand All @@ -94,7 +100,6 @@ def nydus_config(from_env_var):

if SENTRY_USE_REDIS_BUFFERS:
SENTRY_BUFFER = 'sentry.buffer.redis.RedisBuffer'
SENTRY_REDIS_OPTIONS = nydus_config('SENTRY_REDIS_BUFFERS')
SENTRY_CACHE = 'sentry.cache.redis.RedisCache'

#######################
Expand All @@ -108,7 +113,23 @@ def nydus_config(from_env_var):

if SENTRY_USE_REDIS_TSDB:
SENTRY_TSDB = 'sentry.tsdb.redis.RedisTSDB'
SENTRY_TSDB_OPTIONS = nydus_config('SENTRY_REDIS_TSDBS')
SENTRY_TSDB_OPTIONS = {'cluster': 'default'}


############
# Digests ##
############

SENTRY_USE_REDIS_DIGESTS = config('SENTRY_USE_REDIS_DIGESTS', default=False, cast=bool)
if SENTRY_USE_REDIS_DIGESTS:
SENTRY_DIGESTS = 'sentry.digests.backends.redis.RedisBackend'
SENTRY_DIGESTS_OPTIONS = {'cluster': 'default'}


SENTRY_USE_REDIS_QUOTAS = config('SENTRY_USE_REDIS_QUOTAS', default=False, cast=bool)
if SENTRY_USE_REDIS_QUOTAS:
SENTRY_QUOTAS = 'sentry.quotas.redis.RedisQuota'
SENTRY_QUOTA_OPTIONS = {'cluster': 'default'}

################
# Web Server ##
Expand All @@ -132,34 +153,13 @@ def nydus_config(from_env_var):
# allows JavaScript clients to submit cross-domain error reports. Useful for local development
SENTRY_ALLOW_ORIGIN = config('SENTRY_ALLOW_ORIGIN', default=None)

#################
# Mail Server ##
#################

# For more information check Django's documentation:
# https://docs.djangoproject.com/en/1.3/topics/email/?from=olddocs#e-mail-backends

EMAIL_BACKEND = config('SENTRY_EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend')

EMAIL_HOST = config('SENTRY_EMAIL_HOST', default='localhost')
EMAIL_HOST_PASSWORD = config('SENTRY_EMAIL_HOST_PASSWORD', default='')
EMAIL_HOST_USER = config('SENTRY_EMAIL_HOST_USER', default='')
EMAIL_PORT = config('SENTRY_EMAIL_PORT', default=25, cast=int)
EMAIL_USE_TLS = config('SENTRY_EMAIL_USE_TLS', default=False, cast=bool)

# The email address to send on behalf of
SERVER_EMAIL = config('SENTRY_SERVER_EMAIL', default='root@localhost')

###########
# etc. ##
###########

SENTRY_FEATURES['auth:register'] = config('SENTRY_ALLOW_REGISTRATION', default=False, cast=bool)

# If this file ever becomes compromised, it's important to regenerate your SECRET_KEY
# Changing this value will result in all current sessions being invalidated
SECRET_KEY = config('SECRET_KEY')

# http://twitter.com/apps/new
# It's important that input a callback URL, even if its useless. We have no idea why, consult Twitter.
TWITTER_CONSUMER_KEY = config('TWITTER_CONSUMER_KEY', default='')
Expand Down
2 changes: 1 addition & 1 deletion sentry_run
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export SENTRY_CONF=$SENTRY_CONF_FILE
SCRIPTS_DIR=${SENTRY_SCRIPTS_DIR:-/conf}

# if starting the web worker then try to initialize DB and superuser
if [ "$1" == "start" ] || [ "$1" == "prepare" ]; then
if [ "$1" == "run" -a "$2" == "web" ] || [ "$1" == "prepare" ]; then

# check DB health if "SENTRY_DOCKER_DO_DB_CHECK" is set
if [ -n "$SENTRY_DOCKER_DO_DB_CHECK" ]; then
Expand Down