Skip to content

Update - #197

Closed
ibonn wants to merge 11 commits into
Anyesh:mainfrom
ibonn:main
Closed

Update#197
ibonn wants to merge 11 commits into
Anyesh:mainfrom
ibonn:main

Conversation

@ibonn

@ibonn ibonn commented Sep 8, 2026

Copy link
Copy Markdown

Description

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or build changes

Checklist

  • I have read the CONTRIBUTING guide
  • My code follows the project's coding style
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation as needed
  • My changes don't introduce new warnings or errors

Testing

Test Environment

  • Docker Compose
  • Kubernetes
  • Local development

Tests Performed

Screenshots (if applicable)

Additional Notes

Summary by Sourcery

Adjust production Compose defaults and service exposure for easier local development and debugging.

Enhancements:

  • Enable configurable debug and development modes by default in the production Compose environment.
  • Expose the Nginx service on host port 8081 instead of binding it only to localhost port 8080.

Deployment:

  • Update production Docker Compose defaults and port mapping for development-oriented deployments.

@sourcery-ai

sourcery-ai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the production Docker Compose configuration with debug/development defaults and moves Nginx access from localhost:8080 to host port 8081, increasing accessibility while changing the stack’s default runtime behavior.

File-Level Changes

Change Details Files
Enable development-oriented defaults for the production Compose stack.
  • Add configurable backend debug mode, defaulting to enabled.
  • Add configurable frontend development mode, defaulting to enabled.
docker-compose.prod.yml
Change the host port used to access the Nginx reverse proxy.
  • Expose container port 80 on host port 8081 instead of binding port 8080 only to localhost.
docker-compose.prod.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for your first pull request to Wardrowbe! Please make sure you've read the CONTRIBUTING guide, especially the PR title format section. A maintainer will review this soon.

@github-actions github-actions Bot added the docker Pull requests that update docker code label Sep 8, 2026
@ibonn ibonn closed this Sep 8, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docker-compose.prod.yml" line_range="50" />
<code_context>
       - "host.docker.internal:host-gateway"
       - "${OIDC_HOST:-localhost}:${OIDC_HOST_IP:-127.0.0.1}"
     environment:
+      DEBUG: ${DEBUG:-true}
       DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-wardrobe}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-wardrobe}
       REDIS_URL: redis://redis:6379
</code_context>
<issue_to_address>
**🚨 issue (security):** The production backend starts with DEBUG enabled whenever `DEBUG` is absent, exposing FastAPI's `/docs`, `/redoc`, and `/openapi.json` endpoints in the production deployment.

**Triggers:** When the deployment does not explicitly set DEBUG=false.

**Suggested fix:** Default DEBUG to false in the production compose file and require operators to opt into it explicitly.
</issue_to_address>

### Comment 2
<location path="docker-compose.prod.yml" line_range="150" />
<code_context>
       NEXTAUTH_URL: ${NEXTAUTH_URL:-https://localhost:3000}
       NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:?Set NEXTAUTH_SECRET in .env}
       NEXT_PUBLIC_API_URL: ""
+      DEV_MODE: ${DEV_MODE:-true}
       # OIDC
       OIDC_ISSUER_URL: ${OIDC_ISSUER_URL:-}
</code_context>
<issue_to_address>
**🚨 issue (security):** The production frontend always registers the unrestricted `dev-credentials` NextAuth provider by default. With OIDC configured and a non-default backend secret, users can select Dev Login, but `/api/v1/auth/sync` rejects the resulting login with 503; with the default secret, this creates an authentication bypass accepting any email and name.

**Triggers:** When DEV_MODE is not explicitly set to false.

**Suggested fix:** Default DEV_MODE to false in the production compose file and enable it only in local development.
</issue_to_address>

### Comment 3
<location path="docker-compose.prod.yml" line_range="172-174" />
<code_context>
     container_name: wardrobe_nginx
     restart: unless-stopped
     ports:
-      - "127.0.0.1:8080:80"
+      - "8081:80"
     volumes:
       - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
</code_context>
<issue_to_address>
**issue (broader_impact):** The nginx listener changes from host-local port 8080 to host-wide port 8081. This breaks existing reverse proxies and bookmarks targeting `127.0.0.1:8080`, while the new all-interface binding allows clients to reach nginx directly and bypass the external authentication proxy described immediately above the service.

**Triggers:** When an external proxy is configured for the previous localhost:8080 endpoint, or when the host is reachable from an untrusted network.

**Suggested fix:** Preserve the expected port and bind it to localhost, or update every proxy configuration and explicitly ensure direct access cannot bypass authentication.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 3 findings to address first, and the production stack now defaults DEBUG and DEV_MODE to true and binds nginx on all host interfaces at port 8081, potentially exposing development behavior or sensitive diagnostics to network clients. Reverting stops the exposure, but any access or information disclosed while it is live cannot be recovered, and these defaults take effect for every deployment that does not override them.

Blocking findings: docker-compose.prod.yml:50, docker-compose.prod.yml:150, docker-compose.prod.yml:174


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread docker-compose.prod.yml
- "host.docker.internal:host-gateway"
- "${OIDC_HOST:-localhost}:${OIDC_HOST_IP:-127.0.0.1}"
environment:
DEBUG: ${DEBUG:-true}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): The production backend starts with DEBUG enabled whenever DEBUG is absent, exposing FastAPI's /docs, /redoc, and /openapi.json endpoints in the production deployment.

Triggers: When the deployment does not explicitly set DEBUG=false.

Suggested fix: Default DEBUG to false in the production compose file and require operators to opt into it explicitly.

Comment thread docker-compose.prod.yml
NEXTAUTH_URL: ${NEXTAUTH_URL:-https://localhost:3000}
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:?Set NEXTAUTH_SECRET in .env}
NEXT_PUBLIC_API_URL: ""
DEV_MODE: ${DEV_MODE:-true}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): The production frontend always registers the unrestricted dev-credentials NextAuth provider by default. With OIDC configured and a non-default backend secret, users can select Dev Login, but /api/v1/auth/sync rejects the resulting login with 503; with the default secret, this creates an authentication bypass accepting any email and name.

Triggers: When DEV_MODE is not explicitly set to false.

Suggested fix: Default DEV_MODE to false in the production compose file and enable it only in local development.

Comment thread docker-compose.prod.yml
Comment on lines -172 to 174
- "127.0.0.1:8080:80"
- "8081:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (broader_impact): The nginx listener changes from host-local port 8080 to host-wide port 8081. This breaks existing reverse proxies and bookmarks targeting 127.0.0.1:8080, while the new all-interface binding allows clients to reach nginx directly and bypass the external authentication proxy described immediately above the service.

Triggers: When an external proxy is configured for the previous localhost:8080 endpoint, or when the host is reachable from an untrusted network.

Suggested fix: Preserve the expected port and bind it to localhost, or update every proxy configuration and explicitly ensure direct access cannot bypass authentication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Pull requests that update docker code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants