Skip to content

fix (shared-notes-server/cluster): Use $bbb_cors_origin for shared-notes-server Allow-Origin (CORS) - #25194

Merged
antobinary merged 1 commit into
bigbluebutton:v3.0.x-developfrom
gustavotrott:shared-notes-cors-from-var
May 29, 2026
Merged

antobinary merged 1 commit into
bigbluebutton:v3.0.x-developfrom
gustavotrott:shared-notes-cors-from-var

Conversation

@gustavotrott

Copy link
Copy Markdown
Contributor

Now Docs will recommend to set $bbb_cors_origin for cluster/proxy setups.
So bbb-shared-notes-server can benefit from it instead of allowing $http_origin always.

More info: #25108

@gustavotrott gustavotrott added this to the Release 3.0 milestone May 28, 2026
@gustavotrott
gustavotrott requested a review from antobinary May 28, 2026 23:08
@coderabbitai

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR refactors CORS origin handling in the nginx template for the shared notes server. It replaces direct use of $http_origin with a configurable $bbb_cors_origin variable that defaults to '*' when unset. This enables cluster-proxy configurations to override the CORS origin via /etc/bigbluebutton/nginx/bbb-cluster.nginx while maintaining consistent CORS behavior for both preflight and regular requests to the /hocuspocus/api/ endpoint.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • antobinary
  • GuiLeme
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: implementing configurable CORS origin handling for shared-notes-server via $bbb_cors_origin variable.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation for using $bbb_cors_origin in cluster/proxy setups instead of $http_origin.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@build/packages-template/bbb-shared-notes-server/bbb-shared-notes-server.nginx`:
- Around line 1-4: The nginx config sets $bbb_cors_origin to '*' when empty
which conflicts with credentialed CORS because /hocuspocus/api/ returns
Access-Control-Allow-Origin: $bbb_cors_origin together with
Access-Control-Allow-Credentials: true; change the fallback behavior so that
when $bbb_cors_origin is empty you set it to the incoming request origin
($http_origin) or implement an origin allowlist/denylist check and only emit '*'
for responses that do not return Access-Control-Allow-Credentials, ensuring
Access-Control-Allow-Origin is never '*' when Access-Control-Allow-Credentials:
true for routes like /hocuspocus/api/.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: be1d3b83-2ccd-46ef-b595-c74cbfeda45c

📥 Commits

Reviewing files that changed from the base of the PR and between f9c58b0 and f0154f5.

📒 Files selected for processing (1)
  • build/packages-template/bbb-shared-notes-server/bbb-shared-notes-server.nginx

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary
antobinary merged commit aa68a81 into bigbluebutton:v3.0.x-develop May 29, 2026
34 checks passed
@antobinary antobinary mentioned this pull request May 29, 2026
16 of 17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants