Skip to content

feat(graphql-middleware, shared-notes): read the listen address from SERVER_HOST - #26173

Merged
antobinary merged 3 commits into
bigbluebutton:v4.1.x-developfrom
tibroc:simplify/listen-host
Oct 23, 2026
Merged

antobinary merged 3 commits into
bigbluebutton:v4.1.x-developfrom
tibroc:simplify/listen-host

Conversation

@tibroc

@tibroc tibroc commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

bbb-graphql-middleware and bbb-shared-notes-server can now take their listen address from SERVER_HOST, the name bbb-graphql-actions already reads (bbb-graphql-actions/src/config.ts:5).

Change

  • Both listen on 127.0.0.1 from their default YAML. A non-empty SERVER_HOST now replaces that default listen host.
  • It is applied after the default file and the override file in /etc/bigbluebutton are merged, so a set SERVER_HOST wins, as for the other components (-D > environment > /etc file > defaults).

Package installs

  • No package sets SERVER_HOST, so both services keep listening on 127.0.0.1; the YAML defaults only get a trailing comment.
  • The middleware unit has no Environment or EnvironmentFile; the shared-notes unit sets only NODE_ENV and reads the optional /etc/bigbluebutton/bbb-shared-notes-server.env.
  • On bare metal, shared-notes admins could now also set SERVER_HOST in that env file; the middleware has no env file.

Tested

  • go vet and go test for the middleware config package; npm run typecheck, eslint and npm run build for shared-notes.
  • Config probes: no variable gives 127.0.0.1, SERVER_HOST=0.0.0.0 gives 0.0.0.0, an override file with 10.1.2.3 gives 10.1.2.3, and SERVER_HOST=0.0.0.0 together with that file gives 0.0.0.0.
  • Both images listen on 0.0.0.0 and are reachable from another container.

Question

  • Is SERVER_HOST fine, or do you prefer an app-specific name?

Image follow-up: v4.1.x-develop...tibroc:bigbluebutton:images/listen-host, which removes the build-time sed of 127.0.0.1 to 0.0.0.0 in both default files. Images: #26141.

The default listen_host stays 127.0.0.1. SERVER_HOST, as already read by
bbb-graphql-actions, replaces that default; /etc/bigbluebutton/bbb-graphql-middleware.yml
still takes precedence.
The default expressServer.host stays 127.0.0.1. SERVER_HOST, as already read by
bbb-graphql-actions, replaces that default; /etc/bigbluebutton/bbb-shared-notes-server.yml
still takes precedence.
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 4
  • v3.0.x-release
  • v3.0.x-develop
  • v4.0.x-release
  • v4.0.x-develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dd623879-b5bf-4918-8f43-74108ec833a9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@imdt-claudiop

Copy link
Copy Markdown
Contributor

Verified the precedence in both services: the env var is applied to the freshly loaded defaults before the override file is merged, so default < SERVER_HOST < override file holds. On the Go side mergo with WithOverride only replaces with non-zero values, so an override file that does not set listen_host keeps the env value; on the TS side deepMerge behaves the same for absent keys. Both guards skip an empty SERVER_HOST, the name matches graphql-actions' existing variable, and with the variable unset the resolved config is byte-identical to today, so package installs are unaffected. LGTM.

@imdt-claudiop

Copy link
Copy Markdown
Contributor

Align the precedence with the rest of the series: environment above the override file, as #26170 does for bbb-web and as webhooks, webrtc-sfu, webrtc-recorder and livekit already behave. As written, SERVER_HOST is ignored whenever the override file sets the listen address, so the same deployment pattern (mounted file plus env tweak) works for bbb-web but not here. The fix is small in both services: in bbb-graphql-middleware/config/Config.go, move the SERVER_HOST block below the mergo.Merge call; in bbb-shared-notes-server/src/config/index.ts, apply SERVER_HOST to the merged result before returning instead of before the deepMerge. Update the two code comments ("the override file still wins") accordingly.

…verride file

Apply SERVER_HOST after merging /etc/bigbluebutton/bbb-graphql-middleware.yml and
/etc/bigbluebutton/bbb-shared-notes-server.yml, so a set environment variable takes
precedence over the operator file. Unset or empty, nothing changes.
@tibroc

tibroc commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review, agreed: the environment should win here like everywhere else in the series.
I added a commit that applies SERVER_HOST after the override file is merged, in both Config.go (below mergo.Merge) and src/config/index.ts (on the deepMerge result), and updated the two comments.
Checked with each service's config loader: nothing set still gives 127.0.0.1, and an override file alone still applies; SERVER_HOST=0.0.0.0 together with an override file that sets another host now gives 0.0.0.0; an empty SERVER_HOST is ignored.
go test for the middleware and typecheck, lint and build for shared-notes pass.

@imdt-claudiop

Copy link
Copy Markdown
Contributor

Re-checked the new revision against both code paths. In Config.go the SERVER_HOST block now sits after the mergo.Merge, mutating the already-merged struct just before it is copied into the singleton, and the old pre-merge application is gone, so there is no double write and nothing in the merge can reinstate the file value. In index.ts the env is applied to the deepMerge result (or the plain defaults when no override exists), the truthy check still skips an empty SERVER_HOST, and the mutated object is the function-local config, so nothing else observes a half-applied state. Both comments now state that the environment wins over the default and the override file. Precedence matches #26170 and the rest of the series. Approving.

@github-actions

Copy link
Copy Markdown

🚨 Automated tests failed

@antobinary antobinary added this to the Release 4.1 milestone Oct 23, 2026
@antobinary
antobinary merged commit 5f73ec4 into bigbluebutton:v4.1.x-develop Oct 23, 2026
48 of 50 checks passed
@tibroc
tibroc deleted the simplify/listen-host branch November 26, 2026 10:25
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.

3 participants