From 2a1e821143a7fa2608005003cc8f8b52170bd450 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Fri, 14 May 2021 19:02:32 +0100 Subject: Revert "fix: USE_FAKEREDIS is uppercase" --- .../apps/content/resources/guides/pydis-guides/contributing/bot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site/apps') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 0948e513..a48b7300 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -110,7 +110,7 @@ The following is a list of all available environment variables used by the bot: --- -If you are running on the host, while not required, we advise you set `USE_FAKEREDIS` to `true` in the config file during development to avoid the need of setting up a Redis server. +If you are running on the host, while not required, we advise you set `use_fakeredis` to `true` in the config file during development to avoid the need of setting up a Redis server. It does mean you may lose persistent data on restart but this is non-critical. Otherwise, you should set up a Redis instance and fill in the necessary config. {: .notification .is-warning } -- cgit v1.2.3 From bde67e0e911502cfc83533a4d8949bfbf8cf41ed Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Fri, 14 May 2021 19:06:24 +0100 Subject: Explicitly state which config file should be used for use_fakeredis --- .../apps/content/resources/guides/pydis-guides/contributing/bot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site/apps') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index a48b7300..169eb945 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -110,7 +110,7 @@ The following is a list of all available environment variables used by the bot: --- -If you are running on the host, while not required, we advise you set `use_fakeredis` to `true` in the config file during development to avoid the need of setting up a Redis server. +If you are running on the host, while not required, we advise you set `use_fakeredis` to `true` in your `config.yml` file during development to avoid the need of setting up a Redis server. It does mean you may lose persistent data on restart but this is non-critical. Otherwise, you should set up a Redis instance and fill in the necessary config. {: .notification .is-warning } -- cgit v1.2.3 From 2b0411cfd09466959f283e535ebe6ac566934779 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Fri, 14 May 2021 21:05:59 +0100 Subject: Enable permanent redirects for redirect app After monitoring traffic ingressing and confirming redirects are working as expected, I'm happy to switch redirects from the redirect app to using 301 permanent redirect. --- pydis_site/apps/redirect/views.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'pydis_site/apps') diff --git a/pydis_site/apps/redirect/views.py b/pydis_site/apps/redirect/views.py index 9dc9881a..21180cdf 100644 --- a/pydis_site/apps/redirect/views.py +++ b/pydis_site/apps/redirect/views.py @@ -6,9 +6,7 @@ from django.views.generic import RedirectView class CustomRedirectView(RedirectView): """Extended RedirectView for manual route args.""" - # We want temporary redirects for the time being, after this is running on prod and - # stable we can enable permanent redirects. - permanent = False + permanent = True static_args = () prefix_redirect = False -- cgit v1.2.3 From b625468a4cecbaf73b3e5228b19f449e7ff87262 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Fri, 14 May 2021 21:09:09 +0100 Subject: Update redirect tests to use 301 --- pydis_site/apps/redirect/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site/apps') diff --git a/pydis_site/apps/redirect/tests.py b/pydis_site/apps/redirect/tests.py index fce2642f..2cfa3478 100644 --- a/pydis_site/apps/redirect/tests.py +++ b/pydis_site/apps/redirect/tests.py @@ -56,6 +56,6 @@ class RedirectTests(TestCase): f"home:{data['redirect_route']}", args=expected_args ), - status_code=302 + status_code=301 ) self.assertEqual(resp.status_code, 200) -- cgit v1.2.3 From 0900c9e066ea0c74dc4d71253f00b6b752383792 Mon Sep 17 00:00:00 2001 From: dawnofmidnight Date: Fri, 14 May 2021 16:09:52 -0400 Subject: Modify env vars list for Lancebot and Python --- .../apps/content/resources/guides/pydis-guides/contributing/bot.md | 3 +-- .../guides/pydis-guides/contributing/sir-lancebot/env-var-reference.md | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'pydis_site/apps') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md index 0948e513..df17ce2f 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md @@ -103,9 +103,8 @@ The following is a list of all available environment variables used by the bot: | -------- | -------- | -------- | | `BOT_TOKEN` | Always | Your Discord bot account's token (see [Test server and bot account](#test-server-and-bot-account)). | | `BOT_API_KEY` | When running bot without Docker | Used to authenticate with the site's API. When using Docker to run the bot, this is automatically set. By default, the site will always have the API key shown in the example below. | -| `REDDIT_CLIENT_ID` | reddit cog | OAuth2 client ID for authenticating with the [reddit API](https://github.com/reddit-archive/reddit/wiki/OAuth2). | -| `REDDIT_SECRET` | reddit cog | OAuth2 secret for authenticating with the reddit API. *Leave empty if you're not using the reddit API.* | | `BOT_SENTRY_DSN` | When connecting the bot to sentry | The DSN of the sentry monitor. | +| `BOT_TRACE_LOGGERS ` | When you wish to see specific or all trace logs | Comma separated list that specifies which loggers emit trace logs through the listed names. If the ! prefix is used, all of the loggers except the listed ones are set to the trace level. If * is used, the root logger is set to the trace level. | | `REDIS_PASSWORD` | When not using FakeRedis | The password to connect to the redis database. *Leave empty if you're not using REDIS.* | --- diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/sir-lancebot/env-var-reference.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/sir-lancebot/env-var-reference.md index 066b703e..47f01f44 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/sir-lancebot/env-var-reference.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/sir-lancebot/env-var-reference.md @@ -43,6 +43,9 @@ If you will be working with an external service, you might have to set one of th | `GITHUB_TOKEN` | Personal access token for GitHub, raises rate limits from 60 to 5000 requests per hour. | | `GIPHY_TOKEN` | Required for API access. [Docs](https://developers.giphy.com/docs/api) | | `OMDB_API_KEY` | Required for API access. [Docs](http://www.omdbapi.com/) | +| `REDDIT_CLIENT_ID` | OAuth2 client ID for authenticating with the [reddit API](https://github.com/reddit-archive/reddit/wiki/OAuth2). | +| `REDDIT_SECRET` | OAuth2 secret for authenticating with the reddit API. *Leave empty if you're not using the reddit API.* | +| `REDDIT_WEBHOOK` | Webhook ID for Reddit channel | | `YOUTUBE_API_KEY` | An OAuth Key or Token are required for API access. [Docs](https://developers.google.com/youtube/v3/docs#calling-the-api) | | `TMDB_API_KEY` | Required for API access. [Docs](https://developers.themoviedb.org/3/getting-started/introduction) | | `NASA_API_KEY` | Required for API access. [Docs](https://api.nasa.gov/) | -- cgit v1.2.3 From c2852bdf016c36f43b7c592345b3125bf1a1e25d Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Fri, 14 May 2021 21:11:14 +0100 Subject: Add good question guide redirect --- pydis_site/apps/redirect/redirects.yaml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pydis_site/apps') diff --git a/pydis_site/apps/redirect/redirects.yaml b/pydis_site/apps/redirect/redirects.yaml index ce789b61..c5f113fb 100644 --- a/pydis_site/apps/redirect/redirects.yaml +++ b/pydis_site/apps/redirect/redirects.yaml @@ -70,6 +70,12 @@ off-topic_redirect: redirect_route: "content:page_category" redirect_arguments: ["guides/pydis-guides/off-topic-etiquette"] +good_questions_redirect_alt: + # In a few places we were linking to a version outside of the guides app. + original_path: pages/asking-good-questions/ + redirect_route: "content:page_category" + redirect_arguments: ["guides/pydis-guides/asking-good-questions"] + # Resources resources_index_redirect: original_path: pages/resources/ -- cgit v1.2.3