Skip to content

feat(bbb-web): let environment variables and system properties override the properties files - #26170

Merged
antobinary merged 2 commits into
bigbluebutton:v4.1.x-developfrom
tibroc:simplify/bbb-web-env
Oct 23, 2026
Merged

antobinary merged 2 commits into
bigbluebutton:v4.1.x-developfrom
tibroc:simplify/bbb-web-env

Conversation

@tibroc

@tibroc tibroc commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Environment variables and -D system properties can now override keys from the bbb-web properties files. Today they cannot, because Grails puts those files at the top of the Spring environment.

Change

  • An ApplicationContextInitializer in Application.main moves the system environment, then the system properties, back above the properties files.
  • New order: -D > environment > /etc/bigbluebutton/bbb-web.properties > bigbluebutton.properties; the order of the two files is unchanged.
  • Names that work: the key in upper case with . as _ (BIGBLUEBUTTON_WEB_SERVERURL, SECURITYSALT, REDISHOST), or the exact key name. A shortened name such as SERVERURL is ignored.

Package installs

  • Nothing the systemd unit sets (environment or -D) matches any of the 173 keys of bigbluebutton.properties.
  • /etc/bigbluebutton/bbb-web.env is empty by default.
  • Both sources also end up above command-line arguments, but the unit passes none.

Tested

  • Built the image and queried /bigbluebutton/api and getMeetings.
  • No environment: values come from a mounted bbb-web.properties, or the package defaults without one, as before.
  • BIGBLUEBUTTON_WEB_SERVERURL and REDISHOST override the file, and -D overrides the environment.

Question

  • Should the environment rank above /etc/bigbluebutton/bbb-web.properties, or only above the packaged bigbluebutton.properties?
  • Is Application.main the right place, or would you prefer the initializer registered in spring.factories?

Image follow-up: v4.1.x-develop...tibroc:bigbluebutton:images/bbb-web-env, which removes the entrypoint step that writes /etc/bigbluebutton/bbb-web.properties from environment variables at start. Images: #26141.

Details
  • Grails adds the grails.config.locations files (bigbluebutton.properties, /etc/bigbluebutton/bbb-web.properties) to the top of the Spring environment with addFirst, so no -D option or environment variable could override a key from them.
  • Environment set by the unit: MALLOC_ARENA_MAX, ENV, LISTEN_ADDRESS, LISTEN_PORT, INITIAL_HEAP_SIZE, MAX_HEAP_SIZE, HEAP_DUMP_PATH and systemd's own variables.
  • -D options set by the unit: grails.env, server.address, server.port, spring.main.allow-circular-references.
  • These were compared with all 173 keys of bigbluebutton.properties (upper case, .→_): no match.

…de the properties files

Grails adds the files of grails.config.locations (bigbluebutton.properties and
/etc/bigbluebutton/bbb-web.properties) at the top of the Spring environment, so
-D options and environment variables never took effect for these keys. Move
them back on top. Without such variables set nothing changes.
@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: 561c11ca-e03e-426a-b4ae-47e324b165c2

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.

@antobinary antobinary added this to the Release 4.1 milestone Oct 22, 2026
@imdt-claudiop

Copy link
Copy Markdown
Contributor

Verified this against the consumers of the properties files. The initializer also covers the Spring XML beans: doc-conversion.xml uses PropertySourcesPlaceholderConfigurer, which consults the Environment before its local locations, so the XML-configured conversion beans pick up the override too. Checked all single-word keys of bigbluebutton.properties against what systemd and container runtimes inject (ENV, LISTEN_*, INVOCATION_ID, HOSTNAME, Kubernetes service-link variables): no collision, so package installs resolve identically. On the ordering question: env above /etc/bigbluebutton/bbb-web.properties is the right call for containers, and on package installs nothing sets these variables, so neither audience regresses. The production entry point (WarLauncher -> Application.main) runs the initializer, so this works in the packaged service, not only in bootRun.

@imdt-claudiop

Copy link
Copy Markdown
Contributor

On your open question about ranking: keep the environment above /etc/bigbluebutton/bbb-web.properties, and let's make that the rule for the whole series. It is already the behavior of every component with env support today - bbb-webhooks, bbb-webrtc-sfu and bbb-webrtc-recorder through their config libraries, livekit-server through its CLI layer - so this PR as written conforms. The counterpart is #26171, where the operator file still beats the environment, and #26173, which chose the same file-wins order: with both merged as-is, SECURITYSALT set by env is honored by bbb-web but the same deployment's SHARED_SECRET is ignored by akka-apps whenever an operator file is present, and the two halves disagree on the secret. No change needed here; flagging it so the series lands with one precedence story. Please also add a line to docs/docs/administration/configuration-files.md stating the order (-D > env > /etc file > packaged defaults) once this merges.

@tibroc

tibroc commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review and for confirming the order.
I added the docs line in this PR rather than after the merge: docs/docs/administration/configuration-files.md now states -D > environment > /etc/bigbluebutton/bbb-web.properties > packaged bigbluebutton.properties, below the bbb-web.properties example.
It also says which variable names work: the key in upper case with . as _ (e.g. BIGBLUEBUTTON_WEB_SERVERURL), or the exact key name.
No code change.

@imdt-claudiop

Copy link
Copy Markdown
Contributor

Checked the docs line against the initializer rather than taking the description at face value: the stated order matches the addFirst sequence (system properties end up above the environment, both above the two files), and the naming rule matches SystemEnvironmentPropertySource resolution - upper case with dots as underscores works for any key, the exact name works for dot-free keys like securitySalt, and shortened names do not resolve, as documented. Placement under the bbb-web.properties example reads well. This closes my only remaining ask; approving.

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary
antobinary merged commit dd9d935 into bigbluebutton:v4.1.x-develop Oct 23, 2026
50 checks passed
antobinary added a commit that referenced this pull request Oct 30, 2026
build(docker): use the new config options of #26170-#26175 in the images
@TiagoJacobs TiagoJacobs mentioned this pull request Nov 24, 2026
@tibroc
tibroc deleted the simplify/bbb-web-env 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