[ISSUE #359] Fix Docker starts the dashboard page access address is localhost#360
[ISSUE #359] Fix Docker starts the dashboard page access address is localhost#360louyongjiu wants to merge 1 commit into
Conversation
oss-sentinel-ai
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #360 — [ISSUE #359] Fix Docker starts the dashboard page access address is localhost
Type: Bug fix (3 files, +25/-13)
Assessment
Fixes the dashboard access address issue when running in Docker. Changes include:
- Updated
remoteApi.jsto handle Docker environment correctly - Modified
SecurityConfig.javafor proper address binding - Updated
application.ymlconfiguration
Verdict
✅ Proper fix for Docker deployment address binding.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Fixes the dashboard access address issue when running in Docker by making the API base URL relative and updating CORS configuration.
Findings
-
[Critical]
SecurityConfig.java:60— ChangingsetAllowedOrigins(Arrays.asList("http://localhost:3003"))tosetAllowedOriginPatterns(Arrays.asList("*"))combined withsetAllowCredentials(true)is a security risk. This allows any origin to make credentialed cross-origin requests to the dashboard API. In a production deployment, this could enable CSRF-like attacks. Consider:- Making the allowed origins configurable via
application.yml(e.g.,rocketmq.dashboard.allowed-origins) - Or at minimum restricting to the actual deployment domain pattern
- Making the allowed origins configurable via
-
[Warning]
remoteApi.js— Replacingnew URL()+url.searchParams.append()with manual string concatenation (url += '?date=' + date) is a regression. The originalURLSearchParamsapproach properly handles URL encoding of special characters. The new code does not encode parameters inqueryBrokerHisData(line 831), which could break with date values containing special characters. ThequeryTopicHisDataandqueryBrokerConfigmethods do useencodeURIComponent, but the inconsistency is concerning. -
[Info]
remoteApi.js:19— ChangingapiBaseUrlfrom'http://localhost:8082'to''(empty/relative) is the correct fix for Docker deployments where the frontend and backend share the same host. This makes the API calls use the current page's origin.
Suggestions
- Do not merge with
allowedOriginPatterns("*")+allowCredentials(true). Make it configurable or restrict to specific patterns. - Restore
URL+searchParamspattern for consistency, or at minimum applyencodeURIComponentuniformly to all query parameters. - Consider adding a
dashboard.allowed-originsproperty inapplication.ymlfor deployment flexibility.
Automated review by github-manager-bot
Fix Docker starts the dashboard page access address is localhost