Skip to content

feat: update TrustedHostMiddleware to allow localhost and 127.0.0.1 in production - #15

Merged
ronibhakta1 merged 2 commits into
readium:mainfrom
ronibhakta1:chores/cors
Jul 8, 2026
Merged

feat: update TrustedHostMiddleware to allow localhost and 127.0.0.1 in production#15
ronibhakta1 merged 2 commits into
readium:mainfrom
ronibhakta1:chores/cors

Conversation

@ronibhakta1

@ronibhakta1 ronibhakta1 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This pull request makes several improvements to the Docker build process and application security configuration. The most important changes are grouped below.

Docker build and runtime improvements:

  • The uv sync command now uses the --no-dev flag to exclude development dependencies from the production build, reducing image size and attack surface. (Dockerfile)
  • All files copied into the runtime image are now owned by the appuser user and group, improving container security by preventing file access by unintended users. (Dockerfile)
  • The recursive chown command was removed from the runtime image build, as file ownership is now set during the COPY step. (Dockerfile)

Application middleware configuration:

  • The TrustedHostMiddleware in FastAPI now allows requests from localhost and 127.0.0.1 in addition to the configured domain, improving local development and testing experience. (app/main.py)

@ronibhakta1
ronibhakta1 merged commit 8530713 into readium:main Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant