aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/settings.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-07-12 09:25:05 +0400
committerGravatar Hassan Abouelela <[email protected]>2022-07-12 14:54:34 +0400
commitfe4def75dc0a316789cec068a574713a2b2af92f (patch)
treebec3f37fc390219b6ea616c48240841a9f2d39d7 /pydis_site/settings.py
parentMerge pull request #740 from python-discord/update-django (diff)
Add GitHub Artifact API View
Adds an API route to fetch GitHub build artifacts through a GitHub app. Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/settings.py')
-rw-r--r--pydis_site/settings.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pydis_site/settings.py b/pydis_site/settings.py
index 03c16f4b..f382b052 100644
--- a/pydis_site/settings.py
+++ b/pydis_site/settings.py
@@ -21,7 +21,6 @@ import environ
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
-
env = environ.Env(
DEBUG=(bool, False),
SITE_DSN=(str, ""),
@@ -30,10 +29,19 @@ env = environ.Env(
GIT_SHA=(str, 'development'),
TIMEOUT_PERIOD=(int, 5),
GITHUB_TOKEN=(str, None),
+ GITHUB_OAUTH_APP_ID=(str, None),
+ GITHUB_OAUTH_KEY=(str, None),
)
GIT_SHA = env("GIT_SHA")
+GITHUB_API = "https://api.github.com"
GITHUB_TOKEN = env("GITHUB_TOKEN")
+GITHUB_OAUTH_APP_ID = env("GITHUB_OAUTH_APP_ID")
+GITHUB_OAUTH_KEY = env("GITHUB_OAUTH_KEY")
+
+if GITHUB_OAUTH_KEY and (oauth_file := Path(GITHUB_OAUTH_KEY)).is_file():
+ # Allow the OAuth key to be loaded from a file
+ GITHUB_OAUTH_KEY = oauth_file.read_text(encoding="utf-8")
sentry_sdk.init(
dsn=env('SITE_DSN'),