fix: make OPS_FRONTEND_URL configurable via environment variable#5469
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the backend’s expected frontend origin (OPS_FRONTEND_URL) configurable via environment variable (defaulting to http://localhost:3000) to prevent CORS / Referer-origin mismatches when running the stack on alternate ports.
Changes:
- Read
OPS_FRONTEND_URLfrom the environment in backend default settings with a localhost fallback. - Pass a derived
OPS_FRONTEND_URLinto the backend container viadocker-compose.ymlbased onFRONTEND_PORT. - Update
AGENTS.mdto documentOPS_FRONTEND_URLfor alternate-port workflows.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
backend/ops_api/ops/environment/default_settings.py |
Switches OPS_FRONTEND_URL from hardcoded to env-driven with a default. |
docker-compose.yml |
Injects OPS_FRONTEND_URL into the backend container derived from FRONTEND_PORT. |
AGENTS.md |
Documents OPS_FRONTEND_URL and adds it to the alternate-port example. |
frontend/src/pages/help/HelpCenter.jsx |
Updates Help Center “Open in SharePoint” link styling/icon (unrelated to PR purpose). |
backend/ops_api/Pipfile.lock |
Updates lockfile with multiple dependency version changes (unrelated to PR purpose). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Read OPS_FRONTEND_URL from the environment in default_settings.py with http://localhost:3000 as the fallback, matching the pattern used by all Azure environment configs. docker-compose.yml passes OPS_FRONTEND_URL using defaulted substitution so FRONTEND_PORT auto-derives the value and an explicit host override is honored when set. AGENTS.md documents OPS_FRONTEND_URL in the alternate-port example and clarifies that FRONTEND_PORT alone is sufficient for localhost workflows. Closes #5454
52b70aa to
d96a0d1
Compare
The pre-commit hook regenerated the lock file hash using local Python 3.14.4, but CI builds with python:3.14.2-alpine3.22 which computes a different hash. Restoring to the main baseline so pipenv install --deploy succeeds in CI.
weimiao67
approved these changes
Apr 10, 2026
Santi-3rd
approved these changes
Apr 13, 2026
Contributor
|
🎉 This PR is included in version 1.355.11 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
OPS_FRONTEND_URLwas hardcoded tohttp://localhost:3000inbackend/ops_api/ops/environment/default_settings.py. It is now read from the environment withhttp://localhost:3000as the fallback default, matching the pattern already used by all Azure environment configs.docker-compose.ymlnow passesOPS_FRONTEND_URL=http://localhost:${FRONTEND_PORT:-3000}to the backend container so the value automatically tracksFRONTEND_PORTwith no extra override needed.AGENTS.mdhas been updated to includeOPS_FRONTEND_URLin the alternate-port worktree example command and the port variables reference table.Issue
Closes #5454
How to test
http://localhost:53000and log in — should succeed with no CORS or 401 errors.docker compose --profile setup up --build) and confirm login still works athttp://localhost:3000.A11y impact
Screenshots
N/A — backend config and Docker Compose change only
Definition of Done Checklist
Links