Repository navigation
feat(graphql-middleware, shared-notes): read the listen address from SERVER_HOST - #26173
Conversation
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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 4
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
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. |
|
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.
|
Thanks for the review, agreed: the environment should win here like everywhere else in the series. |
|
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. |
🚨 Automated tests failed |
5f73ec4
into
bigbluebutton:v4.1.x-develop
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
SERVER_HOSTnow replaces that default listen host./etc/bigbluebuttonare merged, so a setSERVER_HOSTwins, as for the other components (-D> environment >/etcfile > defaults).Package installs
SERVER_HOST, so both services keep listening on 127.0.0.1; the YAML defaults only get a trailing comment.EnvironmentorEnvironmentFile; the shared-notes unit sets onlyNODE_ENVand reads the optional/etc/bigbluebutton/bbb-shared-notes-server.env.SERVER_HOSTin that env file; the middleware has no env file.Tested
go vetandgo testfor the middleware config package;npm run typecheck, eslint andnpm run buildfor shared-notes.127.0.0.1,SERVER_HOST=0.0.0.0gives0.0.0.0, an override file with10.1.2.3gives10.1.2.3, andSERVER_HOST=0.0.0.0together with that file gives0.0.0.0.0.0.0.0and are reachable from another container.Question
SERVER_HOSTfine, 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
sedof127.0.0.1to0.0.0.0in both default files. Images: #26141.