Skip to content

Commit

Permalink
🐛 Add PGP Fix for New Email API (#180)
Browse files Browse the repository at this point in the history
* 🐛 Add PGP Fix for New Email API

* 🐳 new platform-dev image

* 🧹 chore(lint)

---------

Co-authored-by: Eunsoo Shin <[email protected]>
  • Loading branch information
joyliu-q and esinx authored Sep 22, 2024
1 parent 5d53110 commit adfedec
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ docker-compose.yml

# Uploaded media files
backend/accounts/mediafiles

.env
8 changes: 3 additions & 5 deletions backend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM pennlabs/django-base:b269ea1613686b1ac6370154debbb741b012de1a-3.9.14
FROM pennlabs/django-base:b269ea1613686b1ac6370154debbb741b012de1a-3.11

LABEL maintainer="Penn Labs"

Expand All @@ -11,10 +11,8 @@ RUN pipenv install --system
# Copy project files
COPY . /app/

ENV DJANGO_SETTINGS_MODULE Platform.settings.production
ENV DJANGO_SETTINGS_MODULE Platform.settings.staging
ENV SECRET_KEY 'temporary key just to build the docker image'
ENV IDENTITY_RSA_PRIVATE_KEY 'temporary private key just to build the docker image'
ENV OIDC_RSA_PRIVATE_KEY 'temporary private key just to build the docker image'

# Collect static files
RUN python3 /app/manage.py collectstatic --noinput
RUN python3 /app/manage.py collectstatic --noinput
47 changes: 47 additions & 0 deletions backend/Platform/settings/staging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import os

import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration

from Platform.settings.base import * # noqa
from Platform.settings.base import DOMAINS


DEBUG = False

# Honour the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")

# Allow production host headers
ALLOWED_HOSTS = DOMAINS

# SECRET_KEY = os.environ.get("SECRET_KEY", None)

# IDENTITY_RSA_PRIVATE_KEY = os.environ.get("IDENTITY_RSA_PRIVATE_KEY", None)

# OIDC_RSA_PRIVATE_KEY = os.environ.get("OIDC_RSA_PRIVATE_KEY", None)

# Sentry settings
SENTRY_URL = os.environ.get("SENTRY_URL", "")
sentry_sdk.init(dsn=SENTRY_URL, integrations=[DjangoIntegration()])

# CORS settings
CORS_ALLOW_ALL_ORIGINS = True
CORS_ALLOW_METHODS = ["GET", "POST"]
CORS_URLS_REGEX = r"^(/options/)|(/accounts/token/)$"

# Email client settings
EMAIL_HOST = os.getenv("SMTP_HOST")
EMAIL_PORT = int(os.getenv("SMTP_PORT", 587))
EMAIL_HOST_USER = os.getenv("SMTP_USERNAME")
EMAIL_HOST_PASSWORD = os.getenv("SMTP_PASSWORD")
EMAIL_USE_TLS = True

IS_DEV_LOGIN = os.environ.get("DEV_LOGIN", "False") in ["True", "TRUE", "true"]

# AWS S3
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID")
AWS_ACCESS_SECRET_ID = os.getenv("AWS_SECRET_ACCESS_KEY")
AWS_STORAGE_BUCKET_NAME = os.getenv("AWS_STORAGE_BUCKET_NAME")
AWS_QUERYSTRING_AUTH = False

0 comments on commit adfedec

Please sign in to comment.