From b53ac936d947ffed135bf5ebde50e043a56adbb2 Mon Sep 17 00:00:00 2001 From: scragly <29337040+scragly@users.noreply.github.com> Date: Mon, 19 Oct 2020 22:25:02 +1000 Subject: Allow requesting API data from internal DNS --- pydis_site/settings.py | 1 + 1 file changed, 1 insertion(+) (limited to 'pydis_site/settings.py') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 1ae97b86..2b9f77fb 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -80,6 +80,7 @@ else: 'api.pydis.com', 'admin.pydis.com', 'staff.pydis.com', + 'api.site', ] ) SECRET_KEY = env('SECRET_KEY') -- cgit v1.2.3 From d1dfcc15afef1953b6bede65ff61ccfc1918669e Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 15 Nov 2020 20:16:20 +0000 Subject: Default to HTTPS for account URLs --- pydis_site/settings.py | 1 + 1 file changed, 1 insertion(+) (limited to 'pydis_site/settings.py') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 2b9f77fb..204ce58f 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -393,6 +393,7 @@ AUTHENTICATION_BACKENDS = ( ACCOUNT_ADAPTER = "pydis_site.utils.account.AccountAdapter" ACCOUNT_EMAIL_REQUIRED = False # Undocumented allauth setting; don't require emails ACCOUNT_EMAIL_VERIFICATION = "none" # No verification required; we don't use emails for anything +ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https" # We use this validator because Allauth won't let us actually supply a list with no validators # in it, and we can't just give it a lambda - that'd be too easy, I suppose. -- cgit v1.2.3 From e2e4222ecc52a8743a3829454261ce549bd2408c Mon Sep 17 00:00:00 2001 From: Sebastiaan Zeeff <33516116+SebastiaanZ@users.noreply.github.com> Date: Sat, 12 Dec 2020 00:37:55 +0100 Subject: Change env var from SITE_SENTRY_DSN to SITE_DSN The name of the environment variable was shortened during our refactor of the Sentry secrets. Changed `settings.py` to reflect that change. --- pydis_site/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site/settings.py') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 204ce58f..2b1bfa58 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -28,7 +28,7 @@ if typing.TYPE_CHECKING: env = environ.Env( DEBUG=(bool, False), - SITE_SENTRY_DSN=(str, "") + SITE_DSN=(str, "") ) sentry_sdk.init( -- cgit v1.2.3 From 233c7904e1e276d78d96dd1c26594f19c162f1f0 Mon Sep 17 00:00:00 2001 From: Sebastiaan Zeeff <33516116+SebastiaanZ@users.noreply.github.com> Date: Sat, 12 Dec 2020 00:42:36 +0100 Subject: Fix incorrectly specified environment variable When I changed the name of SITE_SENTRY_DSN to SITE_DSN, I accidentally left an old reference in place. --- pydis_site/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site/settings.py') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 2b1bfa58..449a343f 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -32,7 +32,7 @@ env = environ.Env( ) sentry_sdk.init( - dsn=env('SITE_SENTRY_DSN'), + dsn=env('SITE_DSN'), integrations=[DjangoIntegration()], send_default_pii=True, release=f"pydis-site@{GIT_SHA}" -- cgit v1.2.3 From ad6d901a8d2713107d8adf99a9545984106a0683 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Mon, 21 Dec 2020 16:52:55 +0200 Subject: Change pydis-site to site in Sentry SDK initialization --- pydis_site/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site/settings.py') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 449a343f..9b840406 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -35,7 +35,7 @@ sentry_sdk.init( dsn=env('SITE_DSN'), integrations=[DjangoIntegration()], send_default_pii=True, - release=f"pydis-site@{GIT_SHA}" + release=f"site@{GIT_SHA}" ) # Build paths inside the project like this: os.path.join(BASE_DIR, ...) -- cgit v1.2.3 From 57f389d396ea96b563206935a1d73837b98895ed Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 4 Jan 2021 16:58:41 -0800 Subject: Use wildcard for ALLOWED_HOSTS in debug mode --- pydis_site/settings.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'pydis_site/settings.py') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 9b840406..50caab80 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -47,21 +47,7 @@ DEBUG = env('DEBUG') # SECURITY WARNING: keep the secret key used in production secret! if DEBUG: - ALLOWED_HOSTS = env.list( - 'ALLOWED_HOSTS', - default=[ - 'pythondiscord.local', - 'api.pythondiscord.local', - 'admin.pythondiscord.local', - 'staff.pythondiscord.local', - '0.0.0.0', # noqa: S104 - 'localhost', - 'web', - 'api.web', - 'admin.web', - 'staff.web' - ] - ) + ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=['*']) SECRET_KEY = "yellow polkadot bikini" # noqa: S105 elif 'CI' in os.environ: -- cgit v1.2.3 From c00aeb96e1566b7f71ef15cd840895f4e44d5181 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 10 Feb 2021 00:36:43 +0000 Subject: Update ALLOWED_HOSTS Add internal domain for API routing and remove legacy routes for pydis.com domains (which are now redirected at the edge) --- pydis_site/settings.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'pydis_site/settings.py') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 50caab80..300452fa 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -62,11 +62,7 @@ else: 'admin.pythondiscord.com', 'api.pythondiscord.com', 'staff.pythondiscord.com', - 'pydis.com', - 'api.pydis.com', - 'admin.pydis.com', - 'staff.pydis.com', - 'api.site', + 'pydis-api.default.svc.cluster.local', ] ) SECRET_KEY = env('SECRET_KEY') -- cgit v1.2.3