Skip to content

Commit

Permalink
Integrade sendgrid API.
Browse files Browse the repository at this point in the history
  • Loading branch information
antarcticrainforest committed Aug 17, 2024
1 parent 2016b32 commit ff04ecd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ jobs:
with:
context: .
platforms: linux/amd64
build-args: VERSION=${{steps.repository.outputs.tag}}
build-args: |
VERSION=${{steps.repository.outputs.tag}}
EMAIL_HOST_PASSWORD=${{secrets.EMAIL_HOST_PASSWORD}}
push: true
tags: |
ghcr.io/${{ steps.repository.outputs.repo }}:${{ steps.repository.outputs.tag }}
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG CONDA_ENV_DIR=/opt/condaenv
ARG FREVA_WEB_DIR=/opt/freva_web
ARG EMAIL_HOST_PASSWORD=""
ARG VERSION

FROM condaforge/mambaforge
Expand All @@ -14,7 +15,8 @@ RUN set -e && \
WORKDIR ${FREVA_WEB_DIR}
COPY . .
ENV PATH=$CONDA_ENV_DIR/bin:$PATH\
DJANGO_SUPERUSER_EMAIL=freva@dkrz.de
DJANGO_SUPERUSER_EMAIL=freva@dkrz.de\
EMAIL_HOST_PASSWORD=$EMAIL_HOST_PASSWORD
RUN set -e && \
mamba env create -y -p ${CONDA_ENV_DIR} -f conda-env.yml &&\
mamba clean -afy &&\
Expand Down
16 changes: 5 additions & 11 deletions django_evaluation/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,11 @@ def _set_favicon(html_color: str, project_root: Path) -> None:
SERVER_EMAIL = os.environ.get("SERVER_EMAIL", "freva@dkrz.de")
DEFAULT_FROM_EMAIL = SERVER_EMAIL

EMAIL_HOST = os.environ.get("EMAIL_HOST", "mailhost.dkrz.de")

EMAIL_PORT = int(os.environ.get("EMAIL_PORT", "25"))
if EMAIL_PORT == 25:
EMAIL_HOST_USER = ""
EMAIL_HOST_PASSWORD = ""
else:
email_secrets = _read_secret()
EMAIL_HOST_USER = email_secrets.get("username")
EMAIL_HOST_PASSWORD = email_secrets.get("password")

EMAIL_HOST = "smtp.sendgrid.net"
EMAIL_PORT = "587"
EMAIL_USE_TLS = True
EMAIL_HOST_USER = "apikey"
EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD")

HOME_DIRS_AVAILABLE = False

Expand Down

0 comments on commit ff04ecd

Please sign in to comment.