Skip to content

[SHOT-97] fix: target container names instead of bare service hostnames#7894

Open
mimartin12 wants to merge 5 commits into
mainfrom
fix/SHOT-97-nginx-proxy-hostname-collision
Open

[SHOT-97] fix: target container names instead of bare service hostnames#7894
mimartin12 wants to merge 5 commits into
mainfrom
fix/SHOT-97-nginx-proxy-hostname-collision

Conversation

@mimartin12

@mimartin12 mimartin12 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/SHOT-97

📔 Objective

Fixes: #5692

nginx proxy_pass and the internal identity service URI used bare Docker service names, which can resolve to the wrong container when another container sharing the network answers to that name, returning 502s and misrouting auth traffic. Point them at the unique bitwarden-* container names.

  • NginxConfig.hbs: all proxy_pass upstreams use bitwarden-* names
  • EnvironmentFileBuilder.cs: pin internalIdentity and the Key Connector identityServerUri to http://bitwarden-identity:5000

📸 Screenshots

nginx proxy_pass and the internal identity service URI used bare Docker service names, which can resolve to the wrong container when another container sharing the network answers to that name, returning 502s and misrouting auth traffic. Point them at the unique bitwarden-* container names.

- NginxConfig.hbs: all proxy_pass upstreams use bitwarden-* names
- EnvironmentFileBuilder.cs: pin internalIdentity and the Key Connector identityServerUri to http://bitwarden-identity:5000
@mimartin12 mimartin12 added the ai-review Request a Claude code review label Jun 30, 2026
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the self-hosted networking fix that replaces bare Docker service names with unique bitwarden-* container names in the nginx template and the setup environment file builder. Verified every nginx proxy_pass target and each new internal baseServiceUri override maps exactly to a container_name in DockerCompose.hbs and to the correct getter name in GlobalSettings.cs. Confirmed existing installations pick up the new overrides on update, since Init() seeds the defaults before LoadExistingValues merges the prior file. No security, correctness, or breaking-change concerns found.

Code Review Details

No findings. The change is correctly scoped:

  • All 15 nginx proxy_pass upstreams (web, attachments, api, icons, notifications, events, sso, identity, admin, key-connector, scim) resolve to matching container_name entries.
  • The six new globalSettings__baseServiceUri__internal* overrides pin the internal URIs to bitwarden-* names, matching the BuildInternalUri service-name defaults they replace.
  • The Key Connector identityServerUri was updated consistently.

Both prior review threads are resolved.

Comment thread util/Setup/EnvironmentFileBuilder.cs
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.53%. Comparing base (8ba1421) to head (01d77f2).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7894      +/-   ##
==========================================
- Coverage   66.05%   61.53%   -4.53%     
==========================================
  Files        2256     2256              
  Lines       99391    99391              
  Branches     8984     8984              
==========================================
- Hits        65654    61156    -4498     
- Misses      31489    36083    +4594     
+ Partials     2248     2152      -96     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread util/Setup/EnvironmentFileBuilder.cs Outdated
@sonarqubecloud

Copy link
Copy Markdown

@mimartin12 mimartin12 added the t:bugfix Change Type - Bugfix label Jul 13, 2026
@mimartin12
mimartin12 marked this pull request as ready for review July 13, 2026 14:38
@mimartin12
mimartin12 requested review from a team as code owners July 13, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review needs-qa t:bugfix Change Type - Bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NGINX proxy config hostname collision

3 participants