M8F-132 - Bugfix - Backend container issue on start up#71
Conversation
|
|
||
| python -m uvicorn extensions.app:app \ | ||
| --host 0.0.0.0 --port 8000 \ | ||
| --env-file "$repo_root/.env" \ |
There was a problem hiding this comment.
Just verifying whether removing this could result in local runs silently missing the configuration?
There was a problem hiding this comment.
--env-file "$repo_root/.env" made uvicorn load .env again after the wrapper script had already loaded it.
In the current launcher, .env is read manually in extensions/m8flow-backend/bin/run_m8flow_backend.sh:11 , and it only exports a key if that key is not already set in the environment at extensions/m8flow-backend/bin/run_m8flow_backend.sh:32
When uvicorn also got --env-file, it did a second .env load inside the server startup path. That bypassed the script’s “only if unset” rule, so values from .env could overwrite values already provided by Docker or the parent shell.
| export const M8FLOW_TENANT_STORAGE_KEY = 'm8flow_tenant'; | ||
|
|
||
| const getRedirectUrl = () => | ||
| encodeURIComponent(`${window.location.origin}/`); |
There was a problem hiding this comment.
can you check the sonar issue here
sonal-aot
left a comment
There was a problem hiding this comment.
Make sure all possible Sonar findings have been resolved.
|


JIRA Ticket
https://aottech.atlassian.net/browse/M8F-132
Description
This PR fixes tenant-aware login and stabilizes Docker runtime configuration for the backend, Celery worker, and Flower.
It also makes tenant realm creation in Keycloak use runtime backend/frontend URLs instead of placeholder-only defaults, and adds test coverage for that behavior.
Bugs Fixed
.env..enva second time and override container-provided environment values.What Changed
m8flow-celery-workerm8flow-celery-flowerkeycloak_service.pyto inject runtime backend/frontend redirect URIs, post-logout URIs, and web origins for generated clients.TenantSelectPage.tsxto redirect directly into/login?tenant=...&authentication_identifier=...after tenant validation.--env-fileusage from backend launch scripts.Type
Changes
Testing
docker compose -f docker/m8flow-docker-compose.yml down --volumes --remove-orphans --rmi localsample.envto.envand replace all <LOCAL_IP> to your local IP. Turn multi tenant on:MULTI_TENANT_ON=truedocker compose -f docker/m8flow-docker-compose.yml build --no-cachedocker compose -f docker/m8flow-docker-compose.yml up -dRelated Issues
Closes #