Skip to content

feat(docker): docker compose setup for one server - #26186

Merged
TiagoJacobs merged 23 commits into
bigbluebutton:v4.1.x-developfrom
tibroc:compose-4.1
Nov 24, 2026
Merged

TiagoJacobs merged 23 commits into
bigbluebutton:v4.1.x-developfrom
tibroc:compose-4.1

Conversation

@tibroc

@tibroc tibroc commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

A compose file that runs BigBlueButton on one server with the images of #26141, as CI publishes them to ghcr.io/bigbluebutton/bigbluebutton, plus a small install script and files for development. Commits on v4.1.x-develop: the compose file, the install script, the docs, the graphql-middleware through nginx's Hasura balancer, then three for development, a check for an empty domain in the install script, and five from the review: coturn's relay port range as bbb-install's, rotated container logs, webrtc-sfu without the FreeSWITCH adapter, no certbot RSA key size, and coturn options plus a README line on UDP buffers; then four for the docs: an install page, the links to it, a sample override file and a section in the development guide; then two that follow upstream changes: bbb-web's page token secret and the PDF conversion of the shared notes.

Install

curl -fsSL https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/v4.1.x-develop/docker/compose/install.sh | sh -s -- <domain> [email]
cd bigbluebutton    # review .env
docker compose up -d

install.sh checks Docker (Engine 28+, compose 2.35+), downloads the compose files and writes .env with the domain, its address, the e-mail (not needed with your own certificate) and new random secrets. It never overwrites an existing .env and installs nothing.

What is in it

  • The BBB images plus official images for Redis, PostgreSQL, LiveKit, coturn, haproxy and certbot.
  • TLS and TURN on 443 as bbb-install sets them up: haproxy terminates TLS and passes TURN to coturn; certbot gets and renews a Let's Encrypt certificate, or uses your own from ./data/certs, and reloads haproxy, no Docker socket.
  • Configuration through environment variables where the components read them (feat(bbb-web): let environment variables and system properties override the properties files #26170–feat(export-annotations): merge an override file into the default settings #26174), otherwise files at the bare-metal paths: per-server values as inline configs: from .env, the rest in docker/compose/. A docker-compose.override.yml can replace any of them.
  • Persistent data in ./data (presentations, recordings, certificate); PostgreSQL holds only meeting state and stays a volume. A one-shot init creates the data directories and the databases as the packages do.
  • bbb-web's own pageTokenSecret (required since ea269eb) from BBB_PAGE_TOKEN_SECRET in .env; install.sh generates it with the other secrets.
  • The shared-notes PDF export: since 6840cdf it goes through /run/bbb-shared-notes-conversion.sock, which systemd serves on bare metal. The shared-notes-server image gets a small listener, bbb-shared-notes-conversion.js, that does the same (the unit's wkhtmltopdf command, 30 s limit, at most 8 at once, a private directory each). Compose runs it as shared-notes-conversion: no network, read-only root, 1 GB memory limit, the socket on a tmpfs volume shared with shared-notes-server.
  • Profiles: recording (on by default) and webhooks.

Docs

  • docs/docs/administration/docker-compose.md ("Install with Docker Compose"): the admin text, moved from docker/README.md, plus what is not covered yet, the differences from a package install, the compose equivalents of common bbb-conf commands, the API URL and secret for Greenlight, and troubleshooting. Listed under "Other installation options" in install.md and linked from the root README.
  • For developers: docker-compose.override.sample.yml (one commented block per BBB image, with pull_policy: never so docker compose pull skips local images) and a "Develop with Docker Compose" section in the development guide, next to docker-dev.
  • docker/compose/setup-dev.sh sets up a local development environment in one step:
    • .env with new secrets;
    • a local CA limited to the dev domain by a name constraint, and a certificate for that domain;
    • a Java truststore for bbb-web;
    • a minimal docker-compose.override.yml.
  • The docs page also shows how to enable more recording formats (notes, podcast, ...) in recording.yml, and that a changed inline config needs up -d --force-recreate.
  • docker/README.md keeps the image reference. The docs build passes (onBrokenLinks: 'throw').

Tested

  • Current head (7c078fdc33). The compose file is unchanged since f543a48227, and the later commits change only docs and the development script.
    • Stack: with the shared-notes-server image built from this branch and the published v4.1.x-develop images for the rest, all containers healthy and the join path passes, including the notes PDF export.
    • Development script: shellcheck; first and second runs; an existing override is left unchanged; docker compose config -q with the generated override; bbb-web's Java accepts the local CA in a TLS handshake.
    • Until this is merged, the published shared-notes-server image lacks the PDF listener, so with only published images shared-notes-conversion restarts and the notes PDF export fails.
    • The failing Automated tests shard is a chat test of the package install. It fails on v4.1.x-develop too.
  • After following the upstream changes (head 4b1787466b), with the shared-notes-server image built from this branch and the published images of v4.1.x-develop-20261121T141509-42abd16 for the rest: all 25 containers healthy; the join path including the notes PDF export; two exports at the same time do not interfere; the 30 s and the 8-connection limits hold; 8 large exports at once peak at 261 MiB.
  • After the review (head 152e63c280), with the published images of v4.1.x-develop-20261109T095709-b68145f: all containers healthy; create, join, GraphQL, notes PDF export, LiveKit; a recording through to playback. coturn: turnutils_uclient --no-even-port -c -m 45 gets 40 allocations and then 508 with the old range, 90 of 90 with the new one. local logging on every service except init; no FreeSWITCH errors from the sfu.
  • With the published images of v4.1.x-develop after build(docker): use the new config options of #26170-#26175 in the images #26217 (v4.1.x-develop-c90e70a, nothing built locally): all 24 containers healthy, none restarted; create, join, GraphQL, notes PDF export, LiveKit; a meeting with microphone and webcam in headless Chromium recorded through to playback.
  • Fresh install on a Rocky Linux 10 VM with the install script, images built in my fork: Let's Encrypt, audio, video and screen share with a second participant on another network (TURN), shared notes PDF export, PDF upload, a recording through to playback.
  • Earlier, with the six changed images of build(docker): use the new config options of #26170-#26175 in the images #26217 built locally, in Docker Engine 29 / Compose v5: also the learning dashboard, default slides, STUN over TLS on 443, and coturn relaying only to LiveKit.
  • Own certificate in ./data/certs: served on 443, and a replaced one is picked up with haproxy reloaded.
  • Recording switched on after a first start without it; down/up and down -v keep ./data.

Development

docker-compose.yml stays the file for servers; development only adds files next to it (development guide, "Develop with Docker Compose"):

  • Locally: BBB_DOMAIN=bbb.localhost, a certificate from a local CA (mkcert) in ./data/certs, BBB_PUBLIC_IP=127.0.0.1. bbb-web needs a truststore with that CA for the default slides (one keytool command and a small override).
  • Own build of one component: docker buildx bake -f docker-bake.hcl --load <target> with BBB_IMAGE_REGISTRY=localhost BBB_IMAGE_TAG=dev, and that image for the service in docker-compose.override.yml. Rebuild after a one-line change: bbb-web about 3 min, akka-apps about 1 min.
  • html5 client with live reload: webpack's dev server runs on your machine (npm ci && npm start, Node 24), and docker/compose/dev/html5.yml (14 lines, picked with COMPOSE_FILE in .env) sends /html5client/ to it, as run-dev.sh does. html5-container.yml runs the dev server in a container for machines without Node. The production html5-client image is unchanged.

Tested: a join through each variant, and a source change in the browser after about 2.5 s without restarting anything.

Not included

Office conversion (no image provides convert.sh yet), FreeSWITCH and dial-in, more than one server, Kubernetes, an existing reverse proxy.

Questions

  • db-init: a script on the official postgres image creates the roles and databases from the schemas in the bbb-graphql-server and bbb-shared-notes-server images. Unlike the packages, it recreates bbb_graphql and blocknote_app only when their schema changed and never drops hasura_app or the roles, as the bootstrap of the Kubernetes chart does. Should this live in one place for both, e.g. a script in the bbb-graphql-server image?
  • LiveKit: the official livekit/livekit-server:v1.13.11 instead of the 4.1 package's v1.9.12, because the bridge network needs rtc.advertise_internal_ip, which v1.9.12 lacks. OK?
  • Default slides: bbb-web fetches https://<domain>/default.pdf through the host (extra_hosts: host-gateway), as a package install fetches it from itself.
Details
  • haproxy listens on 8443, published as 443, and runs as its own user; nginx on 8080 behind it.
  • LiveKit uses one UDP port (7882) and a fixed address in the compose subnet 172.30.82.0/24; coturn relays only to that address.
  • nginx uses the image's location files and upstreams unchanged; the compose setup adds only its site (haproxy in front, ACME on port 80) and the playback location.
  • Bind mounts carry :z for SELinux hosts.
  • graphql-middleware connects to Hasura through nginx's balancer (port 8185), as on bare metal, so more Hasura instances work with docker compose up -d --scale graphql-server=2 and an nginx reload.
  • docker buildx bake also reads a docker-compose.yml next to docker-bake.hcl and fails on its required variables, so the image workflow and the build commands in the README now pass -f docker-bake.hcl. Without that, the workflow's target list came out empty and no image was built, while the job still passed; it now fails when bake fails.

@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: 19b69459-7f2d-4a50-85d2-1eedb40c5ec1

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

@tibroc

tibroc commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

Tested a fresh install on Rocky Linux 10 with this branch on top of #26217 and #26219, and images built from that (in my fork):
the install script, Let's Encrypt, audio, video and screen share with a second participant on another
network (TURN), shared notes with PDF export, PDF upload, and a recording through to playback. All
services came up healthy.

@github-actions

Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@antobinary antobinary left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I installed this on a fresh Ubuntu 24.04 server (DigitalOcean, 16 vCPU, 32 GB) with Docker 29.9.3 and compose 5.7.0 from Docker's apt repository. I used install.sh from 1ecff08 and the images of today's v4.1.x-develop (v4.1.x-develop-20261109T095709-b68145f, 612 commits after this PR's base). The PR still merges cleanly onto that commit.

Check Result
install.sh from this head with BBB_DIR set: the version checks accept compose 5.7.0, and .env is written with mode 600 and new secrets PASS
docker compose up -d: all 23 services up, the 11 with a health check healthy, init exited 0 PASS
Let's Encrypt certificate issued, haproxy reloaded through its master socket PASS
TLS 1.1 refused, 1.2 and 1.3 accepted; ALPN http/1.1 and stun.turn both answered PASS
Port 80 redirects to https and serves the ACME challenge path PASS
nginx logs the client's real address (PROXY protocol from haproxy) PASS
Default slides through extra_hosts: host-gateway (open question 3): all 15 pages converted in a new meeting PASS
Browser join: connected to LiveKit 1.13.11 directly over UDP 7882 (open question 2) PASS
coturn relays to LiveKit's address and refuses the redis container, the network gateway, the host's public address, loopback and 169.254.169.254 PASS
TURN relays when several people join at once FAIL, see 1

1. coturn has 40 relay ports, which run out when about 7 people join at once. turnserver.conf sets min-port=49160 and max-port=49199. A browser allocates a relay on every TURN server while it connects, even when it ends up connecting directly. One browser join here took 6 allocations and released them 45 s later. So about 7 people joining in the same minute (the start of a class) use up all 40 ports. People who do connect through TURN keep their allocations for the whole meeting, which lowers that number further. Anyone who joins in that window and needs TURN gets no relay. coturn answers 508 Cannot create socket and logs no available ports.

I checked this with coturn's own test client (turnutils_uclient --no-even-port, 45 clients, two allocations each) against two containers on a separate network:

  • the turnserver.conf of this PR: 40 allocations succeeded, then 508;
  • the same file with bbb-install's range, min-port=32769 and max-port=65535: 90 of 90 succeeded.

I then changed the two lines on this server and recreated the services. The same test against the live coturn succeeded, 90 of 90.

The fix is two lines in the inline turnserver.conf, using bbb-install's range (also in the combined diff below):

       listening-port=3478
-      min-port=49160
-      max-port=49199
+      min-port=32769
+      max-port=65535

Why this range:

  • It costs nothing here. The relay ports are not published: coturn may relay only to LiveKit's address on the compose network. So the wider range needs no ports: mapping, no docker-proxy and no firewall rule. coturn picks one port per allocation; it does not reserve the range up front.
  • It matches the comment above the block, "The turnserver.conf bbb-install writes". bbb-install writes min-port=32769 and max-port=65535.
  • Fewer allocations per join is not the way. One could hand out one TURN URL instead of two, but browsers gather candidates on every TURN server they are given; that is how ICE works. Both URLs are needed: UDP 3478 for most users, TLS 443 for restrictive networks.
  • coturn's default would also do. Leaving out both lines gives 49152-65535, which is enough too. But it would differ from bare metal, and I tested only bbb-install's range.

Is there a reason for 40 ports that I am missing? A small range matters only when the ports are published.

2. Container logs are never rotated. Docker's default json-file driver keeps everything. In this setup every service logs to stdout:

  • nginx's access log, including the client's rtt-check every 10 s per user;
  • haproxy's tcplog, one line per connection;
  • coturn, with verbose;
  • webrtc-sfu (see 3).

On a busy server the logs grow until the disk is full, and docker compose logs gets slower over time. The local driver rotates by default (5 files of 20 MB per container, compressed), and docker compose logs works with it. Set in the x-bbb anchor, it covers every service except the one-shot init.

Part of the volume is the nginx warning using uninitialized "bbb_cors_origin" variable. It is logged once per request, so at least 360 lines per user per hour from rtt-check alone. It comes from the server-level if ($bbb_cors_origin = '') in bbb-shared-notes-server.nginx (#25194). A package install has the same if but does not log the warning: nginx there logs at the default error level (checked on a 4.0.2 server), and the image's nginx.conf sets notice. The if itself is for a separate fix.

3. webrtc-sfu retries FreeSWITCH every 5 s. FreeSWITCH is not part of this setup, but the image's default adapters include it. So the sfu logs FSESL connection received error ECONNREFUSED (127.0.0.1:8021) every 5 s, about 17,000 error lines a day. Without FreeSWITCH, nothing here can use that adapter. With MEDIA_SERVER_ADAPTERS listing only Kurento and mediasoup, the errors stop. I checked the image with that variable on a separate network: 0 lines in 32 s instead of 8, and the other two adapters loaded as before.

Notes 1 to 3 as one diff. It applies to 1ecff08 (git apply --check), and docker compose config accepts the result:

--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -5,6 +5,10 @@
 
 x-bbb: &bbb
   restart: unless-stopped
+  # rotated container logs (5 files of 20 MB per container, compressed); the json-file default
+  # never rotates
+  logging:
+    driver: local
 
 x-recording: &recording
   <<: *bbb
@@ -274,6 +278,9 @@
       LIVEKIT_HOST: http://livekit:7880
       LIVEKIT_KEY: ${LIVEKIT_API_KEY:?}
       LIVEKIT_SECRET: ${LIVEKIT_API_SECRET:?}
+      # no FreeSWITCH in this setup: without its adapter the sfu stops retrying ESL on
+      # 127.0.0.1:8021 every 5 s
+      MEDIA_SERVER_ADAPTERS: '[{"path":"kurento/kurento.js","name":"Kurento"},{"path":"mediasoup/mediasoup-adapter.js","name":"mediasoup"}]'
 
   html5-client:
     <<: *bbb
@@ -442,8 +449,8 @@
   turnserver.conf:
     content: |
       listening-port=3478
-      min-port=49160
-      max-port=49199
+      min-port=32769
+      max-port=65535
       log-file=stdout
       pidfile=/tmp/turnserver.pid
       verbose

4. Small things:

  • certbot.sh passes --rsa-key-size 4096, but certbot 5 issues ECDSA keys unless --key-type rsa is given as well. The certificate here is ECDSA (issuer YE2). Either drop the flag, or add --key-type rsa if RSA is intended.
  • coturn 4.16 logs ERROR: no-cli option is deprecated at start, and warns about lt-cred-mech together with use-auth-secret. I tested a copy of turnserver.conf without both lines:
    • the error and that warning are gone (the other four start-up warnings are unchanged);
    • the CLI stays off: 4.16 has it off by default (turnserver --help), and nothing listens on port 5766;
    • allocations with bbb-web's REST-style credentials still succeed.
  • LiveKit warns UDP receive buffer is too small for a production set-up (current 425984, suggested 5000000). That is the host's net.core.rmem_max. Bare metal does not set it either, but a line in the README next to the list of ports would help operators.

I did not test these here: recording end to end, the webhooks profile, an upgrade from one image tag to another, a host reboot, or an own certificate. Recording and the own certificate were covered in your runs.

1 is the one I would fix before this leaves draft. The rest is optional.

@tibroc

tibroc commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the thorough test. I took your diff as written and split it into one commit per point:

  1. Relay ports, 9c2cc33: min-port=32769, max-port=65535, as bbb-install writes. There was no reason for 40 ports: the small range was chosen while publishing the relay ports was still an option, and they are not published now. Test against the stack's coturn, with turnutils_uclient --no-even-port -c -m 45 (90 allocations): the old range gives 40, then 508; the new one gives 90/90.
  2. Log rotation, 27393ad: logging: driver: local in x-bbb, with your comment. The README says it overrides the host's daemon.json default. docker inspect shows local on every service except init.
  3. FreeSWITCH adapter, 759c25b: MEDIA_SERVER_ADAPTERS as in your diff, with a comment naming the default list it replaces. FSESL lines in 60 s: 12 before, 0 after. The sfu loads ["Kurento","mediasoup"].
  4. Small things:
    • dd2b817 drops --rsa-key-size 4096 (certbot 5.8.0 defaults to ECDSA).
    • 152e63c drops no-cli and lt-cred-mech: the error and the warning are gone, nothing listens on 5766, and allocations with the REST credentials still work.
    • The same commit adds a README line next to the open ports on net.core.rmem_max/wmem_max (5000000, the value in LiveKit's warning).

@tibroc

tibroc commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

I added four commits to make the compose setup easier to find and use:

  • a docs page "Install with Docker Compose" (administration), with the text moved out of
    docker/README.md plus differences from a package install, bbb-conf equivalents and
    troubleshooting;
  • a short "Docker Compose" entry under "Other installation options" and one sentence in the
    root README;
  • docker-compose.override.sample.yml for running locally built images;
  • a "Develop with Docker Compose" section in the development guide, next to docker-dev.
    The branch is rebased on v4.1.x-develop; the docs build passes. Happy to move or trim any of it.

@tibroc

tibroc commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

Two upstream changes in v4.1.x-develop broke the compose setup; the branch now follows both:

  1. bbb-web's page token secret (ea269eb): bbb-web refuses to start without its own pageTokenSecret. Compose passes BBB_PAGE_TOKEN_SECRET from .env, and install.sh generates it. Existing installs add it once:
    echo "BBB_PAGE_TOKEN_SECRET=$(openssl rand -hex 32)" >> .env
    Until then, docker compose stops and names the variable.
  2. Shared-notes PDF export (6840cdf): the export now goes through /run/bbb-shared-notes-conversion.sock, which systemd socket activation serves on bare metal. The shared-notes-server image gets a small node listener, bbb-shared-notes-conversion.js, that does the same: per connection the unit's wkhtmltopdf command, 30 s limit, at most 8 at once, a private directory each. Compose runs it as a second container of that image, shared-notes-conversion, with no network, a read-only root, a 1 GB memory limit and the socket on a tmpfs volume shared with the notes server.

Tested with the notes image built from this branch and the published images for the rest: all containers healthy, the join path including the PDF export, parallel exports, and the time and connection limits.

Note for testing: the published v4.1.x-develop notes image does not have the listener yet, so until this is merged the notes image has to be built from the branch with BBB_IMAGE_REGISTRY=localhost BBB_IMAGE_TAG=dev docker buildx bake --load shared-notes-server, and that image set for both shared-notes-server and shared-notes-conversion in a docker-compose.override.yml.

tibroc and others added 5 commits November 24, 2026 14:16
…cording

haproxy terminates TLS on 443 and passes TURN to coturn. certbot hands
haproxy the operator's own certificate from ./data/certs, or obtains and
renews one from Let's Encrypt. A one-shot service creates the data
directories and the databases. Recording and webhooks are compose
profiles.

docker buildx bake also reads a docker-compose.yml next to
docker-bake.hcl, and fails on its required variables, so the image
workflow and the build commands name docker-bake.hcl explicitly. The
workflow's target list now fails the job when bake fails.

Co-authored-by: Samuel Weirich <[email protected]>
docker/compose/install.sh checks Docker and the compose plugin, downloads
the compose files from a branch or tag and writes .env with the domain,
its public address, the ACME e-mail (optional with an own certificate)
and new random secrets. An existing .env is left unchanged; the admin
reviews it before the first start.
As on bare metal, the middleware connects to nginx's Hasura balancer
(port 8185), so more graphql-server instances can be added with
docker compose up --scale.
FreeSWITCH is not part of this setup, but the image's default adapters
include it, so the sfu logs an ESL connection error for 127.0.0.1:8021
every 5 s. MEDIA_SERVER_ADAPTERS lists only Kurento and mediasoup.
certbot 2.0 and later issue ECDSA keys unless --key-type rsa is given,
so --rsa-key-size 4096 has no effect. bbb-install passes the same flag
and gets ECDSA too.
…DP buffers

coturn 4.16 logs an error for no-cli, which is deprecated (the CLI is
off by default), and warns about lt-cred-mech together with
use-auth-secret. Allocations with bbb-web's REST-style credentials work
without both. The README asks operators to raise the host's UDP buffer
limits, as LiveKit suggests at start.
Move the admin part of "Running with docker compose" from docker/README.md
to the administration docs, and add what differs from a package install,
the compose equivalents of common bbb-conf commands, the API URL for front
ends and a troubleshooting section. docker/README.md links to the page.
A commented block per BBB service to run a locally built image, and the
Java truststore for a local CA. pull_policy: never keeps
`docker compose pull` from failing on the local images.
Move "On your own machine" and "Development" from docker/README.md to the
development guide, as an alternative next to docker-dev: a checkout with
.env, a local CA for bbb.localhost, the sample override, a local build of
one component and the HTML5 client's live reload.
bbb-web refuses to start without a pageTokenSecret of its own (BootStrap.groovy);
a package install generates one on install. Compose now passes
BBB_PAGE_TOKEN_SECRET from .env as PAGETOKENSECRET. install.sh generates it
with the other *_SECRET values. Existing installs add the line to .env; until
then compose stops and names the variable.
The notes server sends the HTML for a PDF export to
/run/bbb-shared-notes-conversion.sock, which a package install serves with the
socket-activated bbb-shared-notes-conversion units. A container has no systemd
for them, so the image now carries a small node listener that does the same:
per connection the unit's wkhtmltopdf command, at most 30 s and 8 connections,
a directory per connection. Deployments run it as a second container of the
image; the isolation of the unit is theirs to set.
Since the PDF export goes through /run/bbb-shared-notes-conversion.sock,
which a package install serves with the socket-activated
bbb-shared-notes-conversion units, the export failed with HTTP 500 in compose.

The shared-notes-conversion service runs the listener of the
shared-notes-server image in place of those units, with their isolation as far
as compose has it: no network, a read-only root file system, a private /tmp,
the image's user, and 1 GB of memory for up to 8 conversions. Both services
mount the socket's tmpfs volume at /run, so the notes server keeps its default
conversionSocket.

The runnerScript setting, which the notes server no longer reads, is removed,
and docker/README.md describes the socket instead.
Recordings are processed as presentation only, as on a package install. Show how to add notes and podcast to the steps in recording.yml, and that a changed inline config needs up -d --force-recreate, since compose does not recreate a service when only the content of its config changed.
danimo and others added 2 commits November 24, 2026 16:11
setup-dev.sh appended a services: block to a copy of the sample override,
below its commented one. Uncommenting services: there, as the sample and
the development guide describe for local builds, then made compose stop
with "mapping key services already defined". A new override now gets only
the truststore settings; an existing one is left unchanged, with a note on
what to add. yq is no longer needed.

The local CA, which developers trust in their browser or system, is kept
in data/dev-ca instead of data/certs, which is mounted into the certbot
container, and its name constraint limits it to the domain.

Also: cd to the checkout from any working directory, and drop a leftover
pwd and a typo. The development guide describes what the script does.
@github-actions

Copy link
Copy Markdown

🚨 Automated tests failed

@tibroc
tibroc marked this pull request as ready for review November 24, 2026 16:51
@TiagoJacobs
TiagoJacobs merged commit 63b93a4 into bigbluebutton:v4.1.x-develop Nov 24, 2026
51 of 54 checks passed

@antobinary antobinary left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second look, at 7c078fd (23 commits on 14a60b9).

The points of my Nov 9 review are all in. Commits 1 to 13 are the ones I checked then, unchanged by the rebase (git range-diff), so that change request is resolved from my side.

This time I went through the ten new commits. I did not set up a whole server again: I ran the new pieces one at a time on Docker Engine 29.9.2 with compose 5.6.1 and the published v4.1.x-develop images of 14a60b9. That commit is this PR's base, so the published notes image is this PR's image minus the listener file, which I mounted into it.

What works as described

  • install.sh at this head fills all eleven generated values in .env, BBB_PAGE_TOKEN_SECRET among them. With an .env from before the change, compose stops with required variable BBB_PAGE_TOKEN_SECRET is missing a value, and the line from the docs fixes it.

  • Sample override: with every block uncommented, docker compose config accepts it, and all 19 services that run a BigBlueButton image use localhost/...:dev, shared-notes-conversion included.

  • shared-notes-conversion, with the service definition taken from this PR's compose file:

    Check Result
    one export PDF after about 0.3 s
    8 exports at once 8 PDFs
    9 at once, 20 at once 8 PDFs each time, the others refused (the 9th after 9 ms)
    a connection that never finishes sending closed after 30.0 s
    a document with <script>for(;;){}</script> closed after 30.0 s
    processes and directories left behind after these none
    8 exports of a 309-page document at once 8 PDFs within 2.3 s, 229 MiB peak of the 1 GiB
  • setup-dev.sh in a clean checkout creates .env, the CA, the certificate, the truststore and the override; a second run keeps .env and the CA. The Java of the bbb-web image (21.0.13) accepts the certificate with that truststore and refuses it without, so the name constraint on the CA is no obstacle for bbb-web. openssl refuses a certificate for another name from the same CA (permitted subtree violation).

1. setup-dev.sh: three cases that go wrong

a. Starting over fails and leaves a directory owned by root. With data/ removed and the docker-compose.override.yml of an earlier run still there:

$ ./docker/compose/setup-dev.sh
Picked up JAVA_TOOL_OPTIONS: -Djavax.net.ssl.trustStore=/etc/ssl/local/cacerts
Certificate was added to keystore
keytool error: java.io.FileNotFoundException: /certs/cacerts (Is a directory)

docker compose run web reads the override. Its ./data/certs/cacerts mount has no file yet, so Docker creates a directory there, owned by root; cp then copies into it and keytool cannot write the keystore. Another run fails the same way until the directory is removed with sudo. It happens whenever the override mounts the truststore and the file is not there. Reading only docker-compose.yml in that call avoids it.

b. The domain comes from the argument even when .env has another one. With BBB_DOMAIN=dev.example.test already in .env and no argument, the CA and the certificate are made for bbb.localhost, and the script ends with "Configured the Docker Compose development environment for https://dev.example.test". And after setup-dev.sh dev.example.test, a later run without the argument stops with "The CA in data/dev-ca is not for bbb.localhost. Remove data/dev-ca (and the CA from your browser) and run again.", which is the wrong advice there. Without an argument the script could take the domain from .env.

c. A last line of .env without a newline is dropped, because read returns false on it. Only an .env edited by hand ends that way.

This diff fixes the three. I ran the cases above and a clean checkout with it:

--- a/docker/compose/setup-dev.sh
+++ b/docker/compose/setup-dev.sh
@@ -66,6 +66,15 @@
   done
 }
 
+# Without an argument, a domain already set in .env is the one to set up.
+use_env_domain() {
+  local env_domain=
+  [[ ! -e .env ]] || env_domain=$(sed -n 's/^BBB_DOMAIN=//p' .env | tail -n 1)
+  if (($# == 0)) && [[ -n $env_domain ]]; then DOMAIN=$env_domain; fi
+  [[ -z $env_domain || $env_domain == "$DOMAIN" ]] ||
+    fail ".env is set up for $env_domain, not $DOMAIN. Change BBB_DOMAIN in .env first."
+}
+
 # Fills the empty settings of .env (created from .env.sample if missing); keeps values already set.
 configure_env() {
   [[ -e .env ]] || cp .env.sample .env
@@ -74,7 +83,7 @@
   local tmp line
   tmp=$(mktemp .env.XXXXXX)
   trap 'rm -f "$tmp"' EXIT
-  while IFS= read -r line; do
+  while IFS= read -r line || [[ -n $line ]]; do
     case "$line" in
       BBB_DOMAIN=) line="BBB_DOMAIN=$DOMAIN" ;;
       BBB_PUBLIC_IP=) line="BBB_PUBLIC_IP=127.0.0.1" ;;
@@ -122,8 +131,10 @@
 }
 
 # bbb-web loads the default slides from https://$DOMAIN, so it has to trust the CA.
+# Only docker-compose.yml is read here: an override that already mounts the truststore would
+# make Docker create data/certs/cacerts as a directory while the file is not there yet.
 create_truststore() {
-  docker compose run --rm --no-deps --user 0 -v "$PWD/$CERTS:/certs" -v "$PWD/$CA/rootCA.pem:/ca.pem:ro" \
+  docker compose -f docker-compose.yml run --rm --no-deps --user 0 -v "$PWD/$CERTS:/certs" -v "$PWD/$CA/rootCA.pem:/ca.pem:ro" \
     --entrypoint sh web -c \
     'cp "$JAVA_HOME/lib/security/cacerts" /certs/cacerts &&
      keytool -importcert -noprompt -alias local-ca -file /ca.pem -keystore /certs/cacerts -storepass changeit'
@@ -167,6 +178,7 @@
 parse_args "$@"
 check_tools
 cd "$(dirname "${BASH_SOURCE[0]}")/../.."
+use_env_domain "$@"
 configure_env
 create_certs
 create_truststore

2. Docs

  • Podcast is not in the recording image yet. docker-compose.md says the image has video, notes, screenshare and podcast, and its example enables process:podcast. record-and-playback/Dockerfile copies the scripts of presentation, video, notes and screenshare only, and the nginx image has no podcast.nginx. #26702 adds both. Either that one merges first, or the example enables only notes until it does. (Read from the two Dockerfiles; I did not process a recording.)
  • Three links answer 404: blob/v4.1.x-release/docker/README.md, once plain and twice with an anchor. v4.1.x-release has no docker/ directory yet. The install command on the same page uses v4.1.x-develop; the links could use it too until the release branch has the files.
  • Small ones: the development guide still says "Start from a checkout and a .env", and the script writes the .env now. In install.md the sentence "There are members of the community that provide other installation options" ended up under the Ansible heading. Line 1 of docker-compose.yml and line 2 of .env.sample point to "Running with docker compose" in docker/README.md, which is now only a pointer to the docs page.

3. Notes PDF export: the image has only the DejaVu fonts

I found this while testing the new service; the cause is in the notes image, not in this PR. The same HTML through the conversion socket of this PR's container:

01-notes-pdf-compose-image.png:

01-notes-pdf-compose-image

and of a 4.0.3 package install:

02-notes-pdf-package-install.png:

02-notes-pdf-package-install

In the container's PDF the Chinese, Japanese and Korean text is missing, and Hindi and Thai are boxes. A package install has the fonts as dependencies of bbb-web (fonts-noto) and bbb-libreoffice-docker (fonts-noto-cjk). With fonts-noto-core and fonts-noto-cjk in the notes image (tested as a layer on top of the published image, which grows from 728 MB to 867 MB) the container's PDF has them all:

03-notes-pdf-compose-image-with-noto-fonts.png:

03-notes-pdf-compose-image-with-noto-fonts
RUN apt-get update && apt-get install -y --no-install-recommends wkhtmltopdf fonts-noto-core fonts-noto-cjk \

Here or in a follow-up, as you prefer.

4. Optional: the conversion service a little closer to the unit

The unit also drops all capabilities, sets NoNewPrivileges, allows no swap and limits the number of tasks. Compose has a setting for each:

    mem_limit: 1g
    memswap_limit: 1g   # MemorySwapMax=0; without it the container may use 1 GiB of swap on top
    pids_limit: 256     # TasksMax=32 per conversion, times 8
    cap_drop:
      - ALL             # CapabilityBoundingSet=
    security_opt:
      - no-new-privileges:true

With these added I repeated one export, nine at once, eight large ones at once and the connection that never finishes: same results, 233 MiB peak, at most 69 tasks.

What stays different from the unit: all conversions run as one user with one /tmp, and that user can write to the socket's directory. The unit gives each conversion its own user and /tmp, and an empty read-only /run. Maybe worth half a sentence under "Differences from a package install".

CI

"Automated tests" is red on this head because of install-and-run-bbb-tests (2), on chat.spec.ts › Copy chat. Nothing in this PR reaches that test: the listener file is not part of the notes package (its build.sh does not copy docker/). The image build (15 targets) and the docs build pass. Worth a re-run.

Not covered this time

A whole server on this head (joining, the notes export through the client, the default slides with the local CA), the recording formats, the html5 dev files, and an upgrade of an existing install.

@TiagoJacobs

Copy link
Copy Markdown
Member

(follow up PR coming tonight covering these and other little topics)

@TiagoJacobs TiagoJacobs mentioned this pull request Nov 24, 2026
@tibroc

tibroc commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

Update 2026-11-26: the follow-ups listed here are merged, after #26734: #26719, #26694, #26695, #26703, #26710, #26692 and #26693. Thanks, Tiago, for the fixes on top.

Still open:

The test branch integration/compose-next is deleted, since develop now has all of it.

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.

4 participants