From 30b77c2a3750414d3774ab318320ff7c991d748f Mon Sep 17 00:00:00 2001 From: Krystle Salazar Date: Mon, 8 Aug 2022 11:01:18 -0400 Subject: [PATCH] Remove the SENTRY_DSN value (#860) --- api/catalog/settings.py | 8 ++-- api/env.docker | 22 +++++----- api/env.template | 92 ++++++++++++++++++++--------------------- 3 files changed, 60 insertions(+), 62 deletions(-) diff --git a/api/catalog/settings.py b/api/catalog/settings.py index 3af838aca..71bfd52f2 100644 --- a/api/catalog/settings.py +++ b/api/catalog/settings.py @@ -337,13 +337,11 @@ # https://docs.djangoproject.com/en/4.0/releases/4.0/#csrf-trusted-origins-changes-4-0 CSRF_TRUSTED_ORIGINS = ["https://*.openverse.engineering"] -SENTRY_DSN = config( - "SENTRY_DSN", - default="https://08f4706d16004f57bcd37eb907bfc2e7@o787041.ingest.sentry.io/6107216", -) +SENTRY_DSN = config("SENTRY_DSN", default="") + SENTRY_SAMPLE_RATE = config("SENTRY_SAMPLE_RATE", default=1.0, cast=float) -if not DEBUG: +if not DEBUG and SENTRY_DSN: sentry_sdk.init( dsn=SENTRY_DSN, integrations=[DjangoIntegration()], diff --git a/api/env.docker b/api/env.docker index 611478150..65db473de 100644 --- a/api/env.docker +++ b/api/env.docker @@ -1,20 +1,20 @@ -PYTHONUNBUFFERED="0" +PYTHONUNBUFFERED=0 -DJANGO_SETTINGS_MODULE="catalog.settings" +DJANGO_SETTINGS_MODULE=catalog.settings DJANGO_SECRET_KEY="ny#b__$$f6ry4wy8oxre97&-68u_0lk3gw(z=d40_dxey3zw0v1" -DJANGO_DEBUG_ENABLED="True" +DJANGO_DEBUG_ENABLED=True -ALLOWED_HOSTS="api.openverse.engineering,api-dev.openverse.engineering" +ALLOWED_HOSTS=api.openverse.engineering,api-dev.openverse.engineering,host.docker.internal -REDIS_HOST="cache" +REDIS_HOST=cache -THUMBNAIL_PROXY_URL="http://thumbnails:8222" +THUMBNAIL_PROXY_URL=http://thumbnails:8222 -DJANGO_DATABASE_HOST="db" +DJANGO_DATABASE_HOST=db -UPSTREAM_DATABASE_HOST="upstream_db" -UPSTREAM_DATABASE_PORT="5432" +UPSTREAM_DATABASE_HOST=upstream_db +UPSTREAM_DATABASE_PORT=5432 -SEMANTIC_VERSION="1.0.0" +SEMANTIC_VERSION=1.0.0 -ELASTICSEARCH_URL="es" +ELASTICSEARCH_URL=es diff --git a/api/env.template b/api/env.template index ef928d5dc..4c229bc02 100644 --- a/api/env.template +++ b/api/env.template @@ -1,67 +1,67 @@ -PYTHONUNBUFFERED="0" +PYTHONUNBUFFERED=0 -DJANGO_SETTINGS_MODULE="catalog.settings" -DJANGO_SECRET_KEY="ny#b__$$f6ry4wy8oxre97&-68u_0lk3gw(z=d40_dxey3zw0v1" -DJANGO_DEBUG_ENABLED="True" +DJANGO_SETTINGS_MODULE=catalog.settings +DJANGO_SECRET_KEY= +DJANGO_DEBUG_ENABLED=True -# List of comma-separated hosts/domain names, e.g., "127.17.0.1,local.app" -ALLOWED_HOSTS="172.17.0.1,host.docker.internal" +# List of comma-separated hosts/domain names, e.g., 127.17.0.1,local.app +ALLOWED_HOSTS=172.17.0.1,host.docker.internal -#LOAD_BALANCER_URL="" +#LOAD_BALANCER_URL= -#USE_S3="False" -#LOGOS_BUCKET="openverse-api-logos-prod" +#USE_S3=False +#LOGOS_BUCKET=openverse-api-logos-prod -#DISABLE_GLOBAL_THROTTLING="True" +#DISABLE_GLOBAL_THROTTLING=True -#REDIS_HOST="cache" -#REDIS_PORT="6379" -#REDIS_PASSWORD="" +#REDIS_HOST=cache +#REDIS_PORT=6379 +#REDIS_PASSWORD= -#THUMBNAIL_PROXY_URL="http://thumbnails:8222" +#THUMBNAIL_PROXY_URL=http://thumbnails:8222 -#THUMBNAIL_WIDTH_PX="600" -#THUMBNAIL_JPG_QUALITY="80" -#THUMBNAIL_PNG_COMPRESSION="6" +#THUMBNAIL_WIDTH_PX=600 +#THUMBNAIL_JPG_QUALITY=80 +#THUMBNAIL_PNG_COMPRESSION=6 -#DJANGO_DATABASE_HOST="db" -#DJANGO_DATABASE_PORT="5432" -#DJANGO_DATABASE_USER="deploy" -#DJANGO_DATABASE_PASSWORD="deploy" -#DJANGO_DATABASE_NAME="openledger" +#DJANGO_DATABASE_HOST=db +#DJANGO_DATABASE_PORT=5432 +#DJANGO_DATABASE_USER=deploy +#DJANGO_DATABASE_PASSWORD=deploy +#DJANGO_DATABASE_NAME=openledger -#UPSTREAM_DATABASE_HOST="upstream_db" -#UPSTREAM_DATABASE_PORT="5432" -#UPSTREAM_DATABASE_USER="deploy" -#UPSTREAM_DATABASE_PASSWORD="deploy" -#UPSTREAM_DATABASE_NAME="openledger" +#UPSTREAM_DATABASE_HOST=upstream_db +#UPSTREAM_DATABASE_PORT=5432 +#UPSTREAM_DATABASE_USER=deploy +#UPSTREAM_DATABASE_PASSWORD=deploy +#UPSTREAM_DATABASE_NAME=openledger -SEMANTIC_VERSION="1.0.0" +SEMANTIC_VERSION=1.0.0 -#WATERMARK_ENABLED="False" +#WATERMARK_ENABLED=False -#ELASTICSEARCH_URL="es" -#ELASTICSEARCH_PORT="9200" -#ELASTICSEARCH_AWS_REGION="us-east-1" +#ELASTICSEARCH_URL=es +#ELASTICSEARCH_PORT=9200 +#ELASTICSEARCH_AWS_REGION=us-east-1 -#IMAGE_INDEX_NAME="image" -#AUDIO_INDEX_NAME="audio" +#IMAGE_INDEX_NAME=image +#AUDIO_INDEX_NAME=audio -#AWS_ACCESS_KEY_ID="" -#AWS_SECRET_ACCESS_KEY="" +#AWS_ACCESS_KEY_ID= +#AWS_SECRET_ACCESS_KEY= -#CONTACT_EMAIL="openverse@wordpress.org" +#CONTACT_EMAIL=openverse@wordpress.org -#EMAIL_SENDER="" -#EMAIL_HOST="" -#EMAIL_PORT="25" -#EMAIL_HOST_USER="" -#EMAIL_HOST_PASSWORD="" +#EMAIL_SENDER= +#EMAIL_HOST= +#EMAIL_PORT=25 +#EMAIL_HOST_USER= +#EMAIL_HOST_PASSWORD= -#DEBUG_SCORES="False" -#USE_RANK_FEATURES="True" +#DEBUG_SCORES=False +#USE_RANK_FEATURES=True -IS_PROXIED="False" +IS_PROXIED=False #SENTRY_SAMPLE_RATE=1.0 -#SENTRY_DSN="https://08f4706d16004f57bcd37eb907bfc2e7@o787041.ingest.sentry.io/6107216" +#SENTRY_DSN=