| 1 | # Configuration for xorg_sentry. |
| 2 | |
| 3 | from sentry.conf.server import * |
| 4 | |
| 5 | |
| 6 | # Cleanup social_auth-related stuff |
| 7 | # ================================= |
| 8 | |
| 9 | EXCLUDED_APPS = ('djcelery', 'kombu.transport.django', 'social_auth', 'django_social_auth_trello') |
| 10 | INSTALLED_APPS = tuple(app for app in INSTALLED_APPS if app not in EXCLUDED_APPS) |
| 11 | |
| 12 | TEMPLATE_CONTEXT_PROCESSORS = tuple( |
| 13 | tcp for tcp in TEMPLATE_CONTEXT_PROCESSORS if 'social_auth' not in tcp) |
| 14 | |
| 15 | |
| 16 | # Reading password |
| 17 | # ================ |
| 18 | |
| 19 | import os.path |
| 20 | |
| 21 | CONF_ROOT = os.path.dirname(__file__) |
| 22 | |
| 23 | def get_password(filename): |
| 24 | with open(os.path.join(CONF_ROOT, 'private', filename)) as f: |
| 25 | return f.readline().strip() |
| 26 | |
| 27 | |
| 28 | # Actual configuration |
| 29 | # ==================== |
| 30 | |
| 31 | AUTHENTICATION_BACKENDS = ( |
| 32 | #'sentry.utils.auth.EmailAuthBackend', |
| 33 | 'django_authgroupex.auth.AuthGroupeXBackend', |
| 34 | ) |
| 35 | |
| 36 | DATABASES = { |
| 37 | 'default': { |
| 38 | # You can swap out the engine for MySQL easily by changing this value |
| 39 | # to ``django.db.backends.mysql`` or to PostgreSQL with |
| 40 | # ``django.db.backends.postgresql_psycopg2`` |
| 41 | 'ENGINE': 'django.db.backends.mysql', |
| 42 | 'NAME': 'sentry', |
| 43 | 'USER': 'sentry', |
| 44 | 'PASSWORD': get_password('mysql_key'), |
| 45 | 'HOST': '', |
| 46 | 'PORT': '', |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | INSTALLED_APPS = ( |
| 51 | 'django_authgroupex', |
| 52 | 'xorg_sentry', |
| 53 | ) + INSTALLED_APPS |
| 54 | |
| 55 | ROOT_URLCONF = 'xorg_sentry.urls' |
| 56 | |
| 57 | SENTRY_KEY = get_password('secret_key') |
| 58 | |
| 59 | # Set this to false to require authentication |
| 60 | SENTRY_PUBLIC = True |
| 61 | |
| 62 | # You should configure the absolute URI to Sentry. It will attempt to guess it if you don't |
| 63 | # but proxies may interfere with this. |
| 64 | # SENTRY_URL_PREFIX = 'http://sentry.example.com' # No trailing slash! |
| 65 | SENTRY_URL_PREFIX = 'https://errors.polytechnique.org' |
| 66 | |
| 67 | SENTRY_WEB_HOST = '0.0.0.0' |
| 68 | SENTRY_WEB_PORT = 9000 |
| 69 | SENTRY_WEB_OPTIONS = { |
| 70 | 'workers': 3, # the number of gunicorn workers |
| 71 | # 'worker_class': 'gevent', |
| 72 | } |
| 73 | |
| 74 | # Mail server configuration |
| 75 | |
| 76 | # For more information check Django's documentation: |
| 77 | # https://docs.djangoproject.com/en/1.3/topics/email/?from=olddocs#e-mail-backends |
| 78 | |
| 79 | EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' |
| 80 | |
| 81 | EMAIL_HOST = 'localhost' |
| 82 | EMAIL_HOST_PASSWORD = '' |
| 83 | EMAIL_HOST_USER = '' |
| 84 | EMAIL_PORT = 25 |
| 85 | EMAIL_USE_TLS = False |
| 86 | |
| 87 | |
| 88 | AUTHGROUPEX_KEY = get_password('authgroupex_key') |
| 89 | AUTHGROUPEX_SUPERADMIN_PERMS = ('admin',) |
| 90 | AUTHGROUPEX_STAFF_PERMS = ('admin',) |
| 91 | AUTHGROUPEX_RETURN_URL = 'https://errors.polytechnique.org/xorgauth/' |
| 92 | AUTHGROUPEX_FIELDS = ('username', 'firstname', 'lastname', 'perms') |