Skip to content

Site modules

A site can be sold one product or several (today playout, tellyboard and spatio-view, alone or together). A module is one such product. The list lives in one file, setup-agent/modules.txt, and everything below reads it.

What is always installed

The shared base, whatever was sold: infrastructure (postgres, seaweedfs, zitadel, valkey, nats, vernemq, tusd), cproxy, authapi, mediasoup, coreapi, orgconsole, tellyid, playtellyinternal, the guest app and the ibc-agent. Login (tellyid + authapi + zitadel) is part of it, so it is the same for every product.

What a module adds

Module Argo CD apps APISIX routes
playout playoutadmin, streamer playout-route, streamer-management, streamer-http
tellyboard tellyboardadmin tellyboard-route
spatio-view spatioviewhotel spatioview-route (see Switch SpatioView Hotel on for a hotel)

How a site gets its modules

Not built yet

The edge API and the Playtelly Console screens it needs (approval tokens, license renewals, revoking a site) do not exist in coreapi yet. See Edge API. Until they do, a real install stops at Waiting for approval. For a test install, use the mock edge API in step 2.4.

Castis staff create an approval token with modules: ["playout"]   (the site name isn't known yet)
   → the installer enters the token in the wizard
   → coreapi's edge API signs a license with  "modules": ["playout"]
   → the wizard reads the claim and writes IBC_MODULES=playout to /etc/ibc/site.env
   → gitops/render.sh renders only the base + playout
  • Changing it later: staff change the hotel's modules in the Console. coreapi issues a new license version, the ibc-agent picks it up at its next check-in (≤ 1 h) and updates IBC_MODULES, and Argo CD adds or removes that product's apps. No login to the hotel.
  • A license with no modules claim (issued before this existed) means the legacy products only, the ones marked legacy in modules.txt (playout and tellyboard). It never means "everything in the list": adding spatio-view must not hand it to every old license.
  • A name this version doesn't know (a newer product on an old branch) is ignored with a warning, so an old branch never breaks on a newer license. If no known name is left, the render stops with an error and Argo CD keeps what is running.
  • Labs and sites installed before the license carried modules: set IBC_MODULES='playout' in sites/<hotel>/site.env. For a site with a modules claim in its license the machine value wins, so this folder has no effect there (site overrides).

Still to do: the license is not enforced when a product is used

Everything above is the install side: the license decides what Argo CD deploys. AuthAPI and CoreAPI do not read the license's modules claim yet, so nothing stops someone who installs a product the site didn't buy (for example tellyboard on a playout-only site) from logging in and using it. This repo can't close that gap. It needs:

  • AuthAPI: read modules, put them in the token, refuse login for a product the license doesn't include (task A11).
  • CoreAPI: refuse a product's API calls when its module isn't in the token (task C11).
  • Before that is trustworthy: AuthAPI must trust only public keys built into its code and must not hold a signing key (A4, A5), or a site operator can re-sign a license.
  • Open design point: how each app tells AuthAPI which product a login is for.

Specification, rollout order and tests: playtelly-iac/docs/edge/modules.md and developer-handover.md (A11, C11). Until they ship, treat IBC_MODULES as an install filter, not as protection.

What IBC_MODULES does and doesn't do

It decides what is deployed, which saves resources and hides pages. It does not stop anyone using a product: someone who edits the value could deploy a module they didn't buy. The real check is in authapi and coreapi, against the signed license (see playtelly-iac/docs/edge/modules.md).

Adding a product (for example spatio-view)

  1. Add a line to setup-agent/modules.txt, such as spatio-view /spatio-view. Do not mark it legacy.
  2. Tag the product's Argo CD app files and APISIX route files with the annotation ibc/module: <name> (a comma list such as playout,spatio-view means "either"). Untagged files stay in the base, so an untagged route goes live on every hotel.
  3. In application/orgconsole/overlays/configmap.yml, set VITE_SPATIO_URL: "${IBC_SPATIO_URL}". render.sh makes that value the product's address when the site has the module, and empty when it doesn't.
  4. Nothing else here changes: the wizard, the ibc-agent and the mock edge API accept any module name in modules.txt.
  5. On the Castis side, teach coreapi and authapi the new name (playtelly-iac/docs/edge/modules.md).

A product that needs another (spatio-view needing playout's streamer, say) is not modelled yet: put the shared piece in the base, or tag it ibc/module: playout,spatio-view.

The worked example, with every file added for SpatioView Hotel in ibc-iac, the app repo and playtelly-iac: Switch SpatioView Hotel on for a hotel.

Try it

One command runs the whole check (starts the mock on a spare port with a temporary state file, touches nothing else):

setup-agent/dev/test_modules.sh

It prints PASS/FAIL for 21 checks:

Part Checks
Tokens no modules gives the legacy products; an unknown name and an empty list are refused
One site, playout only the token approves; the license carries modules=playout; a used-up token is refused
Change later check-in at v1 gets nothing; after a modules change it returns license v2 with the new list; a bad change is refused; renewal keeps the modules
Wizard what IBC_MODULES a license gives: a claim, no claim (legacy), an unknown name (ignored), only unknown names (error)
Render the apps, routes and orgconsole launcher links for playout, tellyboard and both

By hand, with the mock running (python3 setup-agent/dev/mock_edge_api.py):

curl -X POST localhost:9900/admin/approval-tokens -d '{"modules":["playout"]}'            # a token for playout only
curl -X POST localhost:9900/admin/registrations/<id>/modules -d '{"modules":["playout","tellyboard"]}'   # change later
curl localhost:9900/admin/approval-tokens                                                 # each token's modules

Omitting modules gives the legacy products. That is a lab convenience: the real Console must make staff choose.

For a full install on a VM, point the wizard at the mock (IBC_CLOUD_URL='http://<machine>:9900'), create a token with the modules you want, and enter it at the wizard's waiting step. The license it gets back sets IBC_MODULES, and Argo CD deploys only those products.

Not covered: the license is not enforced when someone uses a product. AuthAPI and CoreAPI don't read modules yet (tasks A11 and C11 in playtelly-iac/docs/edge/developer-handover.md).