Skip to content

feat(akka-apps): read secret, service URLs and database hosts from the environment - #26171

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

antobinary merged 3 commits into
bigbluebutton:v4.1.x-developfrom
tibroc:simplify/akka-apps-env

Conversation

@tibroc

@tibroc tibroc commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

akka-apps can now take its shared secret, service URLs and database hosts from environment variables, using optional HOCON substitutions like the existing http.interface = ${?INTERFACE}.

Change

  • services.sharedSecret (SHARED_SECRET), services.bbbWebAPI (BBB_WEB_API), services.graphqlMiddlewareAPI (GRAPHQL_MIDDLEWARE_API).
  • redis.host (REDIS_HOST), redis.password (REDIS_PASSWORD), postgres.properties.serverName (POSTGRES_HOST) and postgres.properties.password (POSTGRES_PASSWORD).
  • A set variable wins over /etc/bigbluebutton/bbb-apps-akka.conf: the services block that preinst writes there ends each line with the same optional substitution.

Package installs

  • An unset ${?VAR} drops the assignment, so the resolved config is the same as before, with and without the /etc override file.
  • bbbWebAPI and sharedSecret use the one-line form key = "default", key = ${?VAR}, so the grep/sed in bbb-config/after-install.sh, bbb-conf (--setsecret, --setip) and the package preinst give the same output as before. bigbluebutton-tests/gns3/testcreds.sh now stops at the comma.

Tested

  • Resolved the old and new file with Typesafe Config 1.4.2 under env -i, alone and with an override file as preinst writes it: identical.
  • Ran the after-install and preinst commands on both files; the image resolves the variables when they are set.

Question

  • Is the one-line form acceptable? The alternative is to anchor the greps in after-install.sh and preinst (for example on ^\s*sharedSecret\s*=\s*") and use the plain two-line form; that is a larger packaging change.

Image follow-up: v4.1.x-develop...tibroc:bigbluebutton:images/akka-apps-env, which removes the image's own /etc/bigbluebutton/bbb-apps-akka.conf that only adds these ${?VAR} lines. Images: #26141.

Details
  • The after-install changeme check still prints changeme, and its sed -i still replaces the quoted value.
  • That check was already fragile: after-install.sh:79 prints every line that contains sharedSecret. Any second line or comment with that key name in application.conf makes the output differ from changeme, and the secret sync is then skipped silently. That is why the new comment does not repeat the key names.

…e environment

Use the HOCON ${?VAR} style of http.interface/port for services.sharedSecret
(SHARED_SECRET), services.bbbWebAPI (BBB_WEB_API), services.graphqlMiddlewareAPI
(GRAPHQL_MIDDLEWARE_API), redis.host (REDIS_HOST) and postgres serverName/password
(POSTGRES_HOST, POSTGRES_PASSWORD). Unset variables change nothing, and
/etc/bigbluebutton/bbb-apps-akka.conf still overrides them.
@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: 5dd858b4-2c05-48c1-acf1-24ef54ca9e21

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
  1. Add password=${?REDIS_PASSWORD} to the redis block. The PR makes the shared secret and the Postgres password injectable but leaves the Redis password file-only, so a deployment with Redis auth still has to mount a config file for that single key, which defeats the purpose of the change for one of the three credentials this service holds.

The rest checked out: the one-line form survives every consumer I could find - the changeme detector and sed -i in bbb-config/after-install.sh, the bbb-conf --setip/--setsecret seds (they only touch /etc/bigbluebutton/bbb-apps-akka.conf), the package preinst migration grep, and the exact-match seds in run-dev.sh:9-10, which still find their substrings inside the combined line.

@imdt-claudiop

Copy link
Copy Markdown
Contributor

Align the precedence with #26170 and the components that already read env today (webhooks, webrtc-sfu, webrtc-recorder, livekit): environment above the operator file, not below it. As written, SHARED_SECRET et al. are dead on any install where /etc/bigbluebutton/bbb-apps-akka.conf sets the same keys - which is every package install, since the preinst writes that file - while bbb-web after #26170 honors the env var in the same situation; a deployment setting the secret by env for both services ends up with a checksum mismatch. Smallest fix: extend the heredoc in akka-bbb-apps/src/debian/DEBIAN/preinst (the services block it writes) with the same optional substitutions after the literals, e.g. bbbWebAPI=${?BBB_WEB_API} and sharedSecret=${?SHARED_SECRET}, so the operator file keeps its defaults but yields to an explicitly set variable. The packaged application.conf changes in this PR stay as they are; container images without the operator file already behave correctly.

The services block that preinst writes to /etc/bigbluebutton/bbb-apps-akka.conf
now ends each line with the optional substitution (bbbWebAPI=${?BBB_WEB_API},
sharedSecret=${?SHARED_SECRET}), so a set variable wins over the file while the
file keeps its values otherwise. Also read redis.password from REDIS_PASSWORD.
Only fresh installs get the new lines; existing files are not rewritten.
The sharedSecret line that preinst writes now ends with
", sharedSecret=${?SHARED_SECRET}". Take the value after the first "="
and stop at the comma, so the script prints the secret again.
@tibroc

tibroc commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review, both points make sense.
I added a commit: redis.password now reads REDIS_PASSWORD, and the services block that preinst writes to /etc/bigbluebutton/bbb-apps-akka.conf ends each line with the optional substitution (bbbWebAPI=… , bbbWebAPI=${?BBB_WEB_API}, same for sharedSecret), so a set variable wins over the file and the file keeps its values otherwise.
I ran the bbb-conf changeme check and --setsecret/--setip seds, the after-install check and seds, the preinst migration and run-dev.sh on the new content: same results as before. With nothing set the resolved config is unchanged; with the variables set they win.
A second small commit fixes bigbluebutton-tests/gns3/testcreds.sh, which read the secret after the last = and would otherwise print ${?SHARED_SECRET}.

@imdt-claudiop

Copy link
Copy Markdown
Contributor

Re-checked the new head against the packaging consumers rather than the PR description: the changeme detectors in bbb-config/after-install.sh and bbb-conf still print the bare literal on the combined lines, the --setsecret/--setip seds rewrite only the quoted literal and leave the ${?VAR} tail in place, the preinst heredoc escapes the substitutions correctly for an unquoted heredoc, and the resulting operator file resolves to env-over-file for BBB_WEB_API and SHARED_SECRET while staying byte-equivalent when nothing is set. The testcreds.sh fix also holds: the old greedy sed would have returned ${?SHARED_SECRET} on the new format, the first-equals/first-comma version returns the quoted secret as before. This addresses both points; approving once the re-triggered image build for apps-akka is green.

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary
antobinary merged commit 3ca4602 into bigbluebutton:v4.1.x-develop Oct 23, 2026
49 of 50 checks passed
@tibroc
tibroc deleted the simplify/akka-apps-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