Repository navigation
feat(bbb-web): let environment variables and system properties override the properties files - #26170
Conversation
…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.
|
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 this against the consumers of the properties files. The initializer also covers the Spring XML beans: |
|
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. |
|
Thanks for the review and for confirming the order. |
|
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. |
✅ Automated tests have passed! |
Environment variables and
-Dsystem 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
ApplicationContextInitializerinApplication.mainmoves the system environment, then the system properties, back above the properties files.-D> environment >/etc/bigbluebutton/bbb-web.properties>bigbluebutton.properties; the order of the two files is unchanged..as_(BIGBLUEBUTTON_WEB_SERVERURL,SECURITYSALT,REDISHOST), or the exact key name. A shortened name such asSERVERURLis ignored.Package installs
-D) matches any of the 173 keys ofbigbluebutton.properties./etc/bigbluebutton/bbb-web.envis empty by default.Tested
/bigbluebutton/apiandgetMeetings.bbb-web.properties, or the package defaults without one, as before.BIGBLUEBUTTON_WEB_SERVERURLandREDISHOSToverride the file, and-Doverrides the environment.Question
/etc/bigbluebutton/bbb-web.properties, or only above the packagedbigbluebutton.properties?Application.mainthe right place, or would you prefer the initializer registered inspring.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.propertiesfrom environment variables at start. Images: #26141.Details
grails.config.locationsfiles (bigbluebutton.properties,/etc/bigbluebutton/bbb-web.properties) to the top of the Spring environment withaddFirst, so no-Doption or environment variable could override a key from them.MALLOC_ARENA_MAX,ENV,LISTEN_ADDRESS,LISTEN_PORT,INITIAL_HEAP_SIZE,MAX_HEAP_SIZE,HEAP_DUMP_PATHand systemd's own variables.-Doptions set by the unit:grails.env,server.address,server.port,spring.main.allow-circular-references.bigbluebutton.properties(upper case,.→_): no match.