-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add support for more ENVs #3664
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -22,3 +22,14 @@ HEALTHCHECK_RETRIES=10 | |||||
POSTGRES_MAX_CONNECTIONS=100 | ||||||
# Set SETUP_JS_SDK_ASSETS to 1 to enable the setup of JS SDK assets | ||||||
# SETUP_JS_SDK_ASSETS=1 | ||||||
# You can also override the default value for the assets URL | ||||||
# JS_SDK_LOADER_DEFAULT_SDK_URL=https://sentry.example.com/js-sdk/%s/bundle%s.min.js | ||||||
|
||||||
# To enabled the memcached cache store | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
# ENABLE_MEMCACHED=true | ||||||
|
||||||
# You can disable features | ||||||
# SENTRY_DISABLE_FEATURES=organizations:sso-rippling,organizations:sso-saml2 | ||||||
|
||||||
# Or enable features | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each variable and its comment should be used and defined regardless of other variables.
Suggested change
|
||||||
# SENTRY_ENABLE_FEATURES=projects:sample-events |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -45,11 +45,11 @@ def get_internal_network(): | |||||
DATABASES = { | ||||||
"default": { | ||||||
"ENGINE": "sentry.db.postgres", | ||||||
"NAME": "postgres", | ||||||
"USER": "postgres", | ||||||
"PASSWORD": "", | ||||||
"HOST": "postgres", | ||||||
"PORT": "", | ||||||
"NAME": env("SENTRY_DB_NAME", "postgres"), | ||||||
"USER": env("SENTRY_DB_USER", "postgres"), | ||||||
"PASSWORD": env("SENTRY_DB_PASSWORD", ""), | ||||||
"HOST": env("SENTRY_DB_HOST", "postgres"), | ||||||
"PORT": env("SENTRY_DB_PORT", ""), | ||||||
Comment on lines
+48
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mind renaming these to |
||||||
} | ||||||
} | ||||||
|
||||||
|
@@ -66,7 +66,7 @@ def get_internal_network(): | |||||
|
||||||
# Instruct Sentry that this install intends to be run by a single organization | ||||||
# and thus various UI optimizations should be enabled. | ||||||
SENTRY_SINGLE_ORGANIZATION = True | ||||||
SENTRY_SINGLE_ORGANIZATION = env("SENTRY_SINGLE_ORGANIZATION", "false").lower() in ("true") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
oops There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If they enable multi-organization, they need to enable another feature flag though. See https://github.com/getsentry/sentry/blob/89479bb784838445845564e0fba06b19190aa573/src/sentry/features/temporary.py#L41-L42 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd also make it accept |
||||||
|
||||||
SENTRY_OPTIONS["system.event-retention-days"] = int( | ||||||
env("SENTRY_EVENT_RETENTION_DAYS", "90") | ||||||
|
@@ -123,14 +123,17 @@ def get_internal_network(): | |||||
# Sentry currently utilizes two separate mechanisms. While CACHES is not a | ||||||
# requirement, it will optimize several high throughput patterns. | ||||||
|
||||||
CACHES = { | ||||||
"default": { | ||||||
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache", | ||||||
"LOCATION": ["memcached:11211"], | ||||||
"TIMEOUT": 3600, | ||||||
"OPTIONS": {"ignore_exc": True}, | ||||||
# If you wish to use memcached, use ENABLE_MEMCACHED=true | ||||||
|
||||||
if env("ENABLE_MEMCACHED", "false").lower() in ("true"): | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should also default to true, right? |
||||||
CACHES = { | ||||||
"default": { | ||||||
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache", | ||||||
"LOCATION": ["memcached:11211"], | ||||||
"TIMEOUT": 3600, | ||||||
"OPTIONS": {"ignore_exc": True}, | ||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
# A primary cache is required for things such as processing events | ||||||
SENTRY_CACHE = "sentry.cache.redis.RedisCache" | ||||||
|
@@ -213,8 +216,8 @@ def get_internal_network(): | |||||
# Web Server # | ||||||
############## | ||||||
|
||||||
SENTRY_WEB_HOST = "0.0.0.0" | ||||||
SENTRY_WEB_PORT = 9000 | ||||||
SENTRY_WEB_HOST = env("SENTRY_WEB_HOST", "0.0.0.0") | ||||||
SENTRY_WEB_PORT = env("SENTRY_WEB_PORT", 9000) | ||||||
Comment on lines
+219
to
+220
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should almost never be modifying these as they don't do what you expect with a docker-compose setup. |
||||||
SENTRY_WEB_OPTIONS = { | ||||||
"http": "%s:%s" % (SENTRY_WEB_HOST, SENTRY_WEB_PORT), | ||||||
"protocol": "uwsgi", | ||||||
|
@@ -265,13 +268,18 @@ def get_internal_network(): | |||||
######## | ||||||
|
||||||
SENTRY_OPTIONS["mail.list-namespace"] = env("SENTRY_MAIL_HOST", "localhost") | ||||||
SENTRY_OPTIONS["mail.from"] = f"sentry@{SENTRY_OPTIONS['mail.list-namespace']}" | ||||||
SENTRY_OPTIONS["mail.from"] = env('SENTRY_MAIL_FROM', f"sentry@{SENTRY_OPTIONS['mail.list-namespace']}") | ||||||
SENTRY_OPTIONS["mail.port"] = env('SENTRY_MAIL_PORT', 465) | ||||||
SENTRY_OPTIONS["mail.username"] = env('SENTRY_MAIL_USERNAME', '') | ||||||
SENTRY_OPTIONS["mail.password"] = env('SENTRY_MAIL_PASSWORD', '') | ||||||
SENTRY_OPTIONS["mail.use-tls"] = env('SENTRY_MAIL_USE_TLS', 'false').lower() in ('true') | ||||||
SENTRY_OPTIONS["mail.use-ssl"] = env('SENTRY_MAIL_USE_SSL', 'false').lower() in ('true') | ||||||
Comment on lines
+271
to
+276
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't these defined on the |
||||||
|
||||||
############ | ||||||
# Features # | ||||||
############ | ||||||
|
||||||
SENTRY_FEATURES["projects:sample-events"] = False | ||||||
# Enable features | ||||||
SENTRY_FEATURES.update( | ||||||
{ | ||||||
feature: True | ||||||
|
@@ -284,6 +292,7 @@ def get_internal_network(): | |||||
"organizations:integrations-issue-sync", | ||||||
"organizations:invite-members", | ||||||
"organizations:metric-alert-builder-aggregate", | ||||||
# Required feature ! | ||||||
"organizations:sso-basic", | ||||||
"organizations:sso-rippling", | ||||||
"organizations:sso-saml2", | ||||||
|
@@ -338,6 +347,24 @@ def get_internal_network(): | |||||
} | ||||||
) | ||||||
|
||||||
# Disable features | ||||||
SENTRY_FEATURES.update( | ||||||
{ | ||||||
feature: False | ||||||
for feature in tuple(part for part in env("SENTRY_DISABLE_FEATURES", "").split(',') if part) + ( | ||||||
"projects:sample-events", | ||||||
) | ||||||
} | ||||||
) | ||||||
|
||||||
# Enable features | ||||||
SENTRY_FEATURES.update( | ||||||
{ | ||||||
feature: True | ||||||
for feature in tuple(part for part in env("SENTRY_ENABLE_FEATURES", "").split(',') if part) | ||||||
} | ||||||
) | ||||||
|
||||||
####################### | ||||||
# MaxMind Integration # | ||||||
####################### | ||||||
|
@@ -387,7 +414,7 @@ def get_internal_network(): | |||||
# to keep the old assets, set `SETUP_JS_SDK_KEEP_OLD_ASSETS` environment variable to any value on | ||||||
# your `.env` or `.env.custom` file. The files should only be a few KBs, and this might be useful | ||||||
# if you're using it directly like a CDN instead of using the loader script. | ||||||
JS_SDK_LOADER_DEFAULT_SDK_URL = "https://browser.sentry-cdn.com/%s/bundle%s.min.js" | ||||||
JS_SDK_LOADER_DEFAULT_SDK_URL = env("JS_SDK_LOADER_DEFAULT_SDK_URL", "https://browser.sentry-cdn.com/%s/bundle%s.min.js") | ||||||
|
||||||
##################### | ||||||
# Insights Settings # | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.