Skip to content

Commit adfedec

Browse files
joyliu-qesinx
andauthored
🐛 Add PGP Fix for New Email API (#180)
* 🐛 Add PGP Fix for New Email API * 🐳 new platform-dev image * 🧹 chore(lint) --------- Co-authored-by: Eunsoo Shin <[email protected]>
1 parent 5d53110 commit adfedec

File tree

3 files changed

+52
-5
lines changed

3 files changed

+52
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ docker-compose.yml
2828

2929
# Uploaded media files
3030
backend/accounts/mediafiles
31+
32+
.env

backend/Dockerfile.dev

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM pennlabs/django-base:b269ea1613686b1ac6370154debbb741b012de1a-3.9.14
1+
FROM pennlabs/django-base:b269ea1613686b1ac6370154debbb741b012de1a-3.11
22

33
LABEL maintainer="Penn Labs"
44

@@ -11,10 +11,8 @@ RUN pipenv install --system
1111
# Copy project files
1212
COPY . /app/
1313

14-
ENV DJANGO_SETTINGS_MODULE Platform.settings.production
14+
ENV DJANGO_SETTINGS_MODULE Platform.settings.staging
1515
ENV SECRET_KEY 'temporary key just to build the docker image'
16-
ENV IDENTITY_RSA_PRIVATE_KEY 'temporary private key just to build the docker image'
17-
ENV OIDC_RSA_PRIVATE_KEY 'temporary private key just to build the docker image'
1816

1917
# Collect static files
20-
RUN python3 /app/manage.py collectstatic --noinput
18+
RUN python3 /app/manage.py collectstatic --noinput

backend/Platform/settings/staging.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import os
2+
3+
import sentry_sdk
4+
from sentry_sdk.integrations.django import DjangoIntegration
5+
6+
from Platform.settings.base import * # noqa
7+
from Platform.settings.base import DOMAINS
8+
9+
10+
DEBUG = False
11+
12+
# Honour the 'X-Forwarded-Proto' header for request.is_secure()
13+
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
14+
15+
# Allow production host headers
16+
ALLOWED_HOSTS = DOMAINS
17+
18+
# SECRET_KEY = os.environ.get("SECRET_KEY", None)
19+
20+
# IDENTITY_RSA_PRIVATE_KEY = os.environ.get("IDENTITY_RSA_PRIVATE_KEY", None)
21+
22+
# OIDC_RSA_PRIVATE_KEY = os.environ.get("OIDC_RSA_PRIVATE_KEY", None)
23+
24+
# Sentry settings
25+
SENTRY_URL = os.environ.get("SENTRY_URL", "")
26+
sentry_sdk.init(dsn=SENTRY_URL, integrations=[DjangoIntegration()])
27+
28+
# CORS settings
29+
CORS_ALLOW_ALL_ORIGINS = True
30+
CORS_ALLOW_METHODS = ["GET", "POST"]
31+
CORS_URLS_REGEX = r"^(/options/)|(/accounts/token/)$"
32+
33+
# Email client settings
34+
EMAIL_HOST = os.getenv("SMTP_HOST")
35+
EMAIL_PORT = int(os.getenv("SMTP_PORT", 587))
36+
EMAIL_HOST_USER = os.getenv("SMTP_USERNAME")
37+
EMAIL_HOST_PASSWORD = os.getenv("SMTP_PASSWORD")
38+
EMAIL_USE_TLS = True
39+
40+
IS_DEV_LOGIN = os.environ.get("DEV_LOGIN", "False") in ["True", "TRUE", "true"]
41+
42+
# AWS S3
43+
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
44+
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID")
45+
AWS_ACCESS_SECRET_ID = os.getenv("AWS_SECRET_ACCESS_KEY")
46+
AWS_STORAGE_BUCKET_NAME = os.getenv("AWS_STORAGE_BUCKET_NAME")
47+
AWS_QUERYSTRING_AUTH = False

0 commit comments

Comments
 (0)