Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies with security fixes #2596

Merged
merged 10 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"hostRequirements": {
"cpus": 4
},
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm",
"image": "mcr.microsoft.com/devcontainers/python:1-3.13-bookworm",
sainak marked this conversation as resolved.
Show resolved Hide resolved
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/node:1": {},
Expand All @@ -20,5 +20,5 @@
},
"postCreateCommand": "echo 'eval \"$(direnv hook bash)\"' >> ~/.bashrc && cp .env.example .env",
"postStartCommand": "make up",
"forwardPorts": [8000, 9000, 4000]
"forwardPorts": [4566, 8000, 9000, 4000]
}
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default_stages: [commit]
default_stages: [pre-commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -17,7 +17,7 @@ repos:
- id: check-toml

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
rev: v0.7.3
hooks:
- id: ruff
args: [ --fix ]
Expand Down
34 changes: 17 additions & 17 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ name = "pypi"
[packages]
argon2-cffi = "==23.1.0"
authlib = "==1.3.2"
boto3 = "==1.35.49"
boto3 = "==1.35.59"
celery = "==5.4.0"
django = "==5.1.2"
django = "==5.1.3"
django-environ = "==0.11.2"
django-cors-headers = "==4.5.0"
django-cors-headers = "==4.6.0"
django-filter = "==24.3"
django-maintenance-mode = "==0.21.1"
django-queryset-csv = "==1.1.0"
django-ratelimit = "==4.1.0"
django-redis = "==5.4.0"
django-rest-passwordreset = "==1.4.2"
django-rest-passwordreset = "==1.5.0"
django-simple-history = "==3.7.0"
djangoql = "==0.18.1"
djangorestframework = "==3.15.2"
Expand All @@ -35,34 +35,34 @@ pydantic = "==1.10.18" # fix for fhir.resources < 7.0.2
pyjwt = "==2.9.0"
python-slugify = "==8.0.4"
pywebpush = "==2.0.1"
redis = { extras = ["hiredis"], version = "==5.0.8" } # constraint for redis-om
redis-om = "==0.3.1" # > 0.3.1 broken with pydantic < 2
redis = { extras = ["hiredis"], version = "==5.2.0" }
redis-om = "==0.3.3"
requests = "==2.32.3"
sentry-sdk = "==2.17.0"
whitenoise = "==6.7.0"
sentry-sdk = "==2.18.0"
whitenoise = "==6.8.2"

[dev-packages]
boto3-stubs = { extras = ["s3", "boto3"], version = "==1.35.49" }
boto3-stubs = { extras = ["s3", "boto3"], version = "*" }
sainak marked this conversation as resolved.
Show resolved Hide resolved
coverage = "==7.6.4"
debugpy = "==1.8.7"
debugpy = "==1.8.8"
django-coverage-plugin = "==3.1.0"
django-extensions = "==3.2.3"
django-silk = "==5.2.0"
django-silk = "==5.3.1"
djangorestframework-stubs = "==3.15.1"
factory-boy = "==3.3.1"
freezegun = "==1.5.1"
ipython = "==8.28.0"
mypy = "==1.12.1"
ipython = "==8.29.0"
mypy = "==1.13.0"
pre-commit = "==4.0.1"
requests-mock = "==1.12.1"
tblib = "==3.0.0"
watchdog = "==5.0.3"
werkzeug = "==3.0.6"
ruff = "==0.7.0"
watchdog = "==6.0.0"
werkzeug = "==3.1.3"
ruff = "==0.7.3"

[docs]
furo = "==2024.8.6"
sphinx = "==8.0.2"
sphinx = "==8.1.3"
myst-parser = "==4.0.0"

[requires]
sainak marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
546 changes: 272 additions & 274 deletions Pipfile.lock

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion care/users/tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ def test_forgot_password_with_valid_input(self):
self.assertTrue(ResetPasswordToken.objects.filter(user=self.user).exists())
self.assertTrue(ResetPasswordToken.objects.filter(user=self.user).exists())

@override_settings(IS_PRODUCTION=True)
@override_settings(
IS_PRODUCTION=True,
EMAIL_HOST="",
EMAIL_HOST_USER="",
EMAIL_HOST_PASSWORD="",
)
def test_forgot_password_without_email_configration(self):
response = self.client.post(
"/api/v1/password_reset/",
Expand Down
25 changes: 15 additions & 10 deletions docker/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
FROM python:3.13-slim-bookworm

ARG TYPST_VERSION=0.11.0
ARG APP_HOME=/app

ENV PATH=/venv/bin:$PATH
WORKDIR $APP_HOME

ENV PATH=$APP_HOME/.venv/bin:$PATH
ENV PIPENV_VENV_IN_PROJECT=1
ENV PIPENV_CACHE_DIR=/root/.cache/pip

RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential libjpeg-dev zlib1g-dev libgmp-dev \
Expand All @@ -27,21 +32,21 @@ RUN ARCH=$(dpkg --print-architecture) && \
rm -rf typst.tar.xz typst-${TYPST_ARCH}

# use pipenv to manage virtualenv
RUN python -m venv /venv
RUN pip install pipenv==2024.2.0
RUN pip install pipenv

COPY Pipfile Pipfile.lock ./
RUN pipenv install --system --categories "packages dev-packages"
RUN mkdir -p $APP_HOME/.venv
COPY Pipfile Pipfile.lock $APP_HOME/
RUN --mount=type=cache,target=/root/.cache/pip pipenv sync --categories "packages dev-packages docs"

COPY . /app
COPY plugs/ $APP_HOME/plugs/
COPY install_plugins.py plug_config.py $APP_HOME/
RUN --mount=type=cache,target=/root/.cache/pip python3 $APP_HOME/install_plugins.py

RUN python3 /app/install_plugins.py
COPY . $APP_HOME/
sainak marked this conversation as resolved.
Show resolved Hide resolved

HEALTHCHECK \
--interval=10s \
--timeout=5s \
--start-period=10s \
--retries=48 \
CMD ["/app/scripts/healthcheck.sh"]

WORKDIR /app
CMD ["./scripts/healthcheck.sh"]
19 changes: 11 additions & 8 deletions docker/prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ ARG BUILD_ENVIRONMENT="production"
ARG APP_VERSION="unknown"
ARG ADDITIONAL_PLUGS=""

WORKDIR $APP_HOME

ENV BUILD_ENVIRONMENT=$BUILD_ENVIRONMENT
ENV APP_VERSION=$APP_VERSION
ENV ADDITIONAL_PLUGS=$ADDITIONAL_PLUGS
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PATH=/venv/bin:$PATH
ENV PIPENV_VENV_IN_PROJECT=1
ENV PIPENV_CACHE_DIR=/root/.cache/pip
ENV PATH=$APP_HOME/.venv/bin:$PATH

WORKDIR $APP_HOME

# ---
FROM base AS builder
Expand All @@ -40,11 +43,11 @@ RUN ARCH=$(dpkg --print-architecture) && \
rm -rf typst.tar.xz typst-${TYPST_ARCH}

# use pipenv to manage virtualenv
RUN python -m venv /venv
RUN pip install pipenv==2024.2.0
RUN pip install pipenv

COPY Pipfile Pipfile.lock $APP_HOME
RUN pipenv sync --system --categories "packages"
RUN mkdir -p $APP_HOME/.venv
COPY Pipfile Pipfile.lock $APP_HOME/
RUN pipenv install --deploy --categories "packages"
sainak marked this conversation as resolved.
Show resolved Hide resolved

COPY plugs/ $APP_HOME/plugs/
COPY install_plugins.py plug_config.py $APP_HOME
Expand All @@ -60,7 +63,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \

COPY --from=builder --chmod=0755 /usr/local/bin/typst /usr/local/bin/typst

COPY --from=builder /venv /venv
COPY --from=builder $APP_HOME/.venv $APP_HOME/.venv

COPY --chmod=0755 ./scripts/*.sh $APP_HOME

Expand All @@ -71,6 +74,6 @@ HEALTHCHECK \
--timeout=5s \
--start-period=10s \
--retries=12 \
CMD ["/app/healthcheck.sh"]
CMD ["./healthcheck.sh"]
sainak marked this conversation as resolved.
Show resolved Hide resolved

EXPOSE 9000
Loading