Advanced customization
Everything here is for people who are comfortable on a command line and want more than the Debian package ships. Nothing in it is needed to use the speaker.
Adding your own extensions
Packages that are not in the .deb (TYPO3 extensions, or any Composer package) go into one file, which an upgrade never touches:
/var/www/boombox/shared/composer.user.jsonIt is a plain composer file. Only require is read, and the speaker creates it, empty, on the first release.
Require a package
Run these on the speaker as root (ssh root@boombox.local):
# Add the package to the file. --no-update matters: it only edits the file.
COMPOSER=/var/www/boombox/shared/composer.user.json \
/usr/bin/php-zts /usr/lib/boombox/composer.phar require vendor/package:^1.0 --no-update --no-plugins
# Build a release that includes it, and switch to it
boombox-install --releaseCOMPOSER= is composer's own variable for which composer.json to use. You can also edit the file by hand:
{
"require": {
"vendor/package": "^1.0"
}
}A package that is not on Packagist needs a repository, added the same way:
COMPOSER=/var/www/boombox/shared/composer.user.json \
/usr/bin/php-zts /usr/lib/boombox/composer.phar config repositories.mine vcs https://git.example/me/package.git --no-pluginsA package on the speaker itself, say an extension you copied to /var/www/boombox/shared/my-extension/, is a path repository. Its URL is relative to the directory of composer.user.json (shared/), even an absolute one is read that way:
{
"repositories": [{"type": "path", "url": "my-extension", "options": {"symlink": false}}],
"require": {"vendor/my-extension": "*"}
}Keep it below shared/, not in the release, and leave symlink off: the release gets a copy, so the package stays after the folder is changed or removed.
To remove a package, remove it from require and run boombox-install --release again. With nothing left in require, the release is the shipped one.
What happens on a release
Every release (boombox-install --release, and every upgrade of the package) builds its vendor/ from the shipped composer.json plus your file, merged by wikimedia/composer-merge-plugin. Only require and repositories are merged: no scripts, no extra, no dev packages. Composer runs as the web user, without scripts, and needs the network. The release then runs extension:setup as for the shipped extensions, so a TYPO3 extension is set up by the same command.
The result is locked in /var/www/boombox/shared/composer.lock, which is yours too:
- Nothing required: composer does not run. No network, nothing kept.
- The same overlay and the same app as last time: installed from the kept lock, so the versions do not move.
- A changed overlay: the packages you added are resolved again, and their dependencies when that is the only way. Everything else stays as locked.
- A new version of the speaker's package: the lock is made again from the shipped one, and your packages are resolved again within your constraints. Their versions can move then.
Updating your packages
Your packages do not update by themselves. As long as the overlay and the speaker's package are unchanged, every release installs the versions in shared/composer.lock, so a new release of the speaker, or a reboot, never moves them. To update:
# Newest versions your constraints allow, for every package you require:
rm /var/www/boombox/shared/composer.lock /var/www/boombox/shared/composer.inputs
boombox-install --releaseA new constraint (
^1.0to^2.0) incomposer.user.jsondoes the same without deleting anything: a changed overlay resolves all your packages again. There is no way to update just one. To hold a package at a version through that, require it exactly ("vendor/package": "1.4.2").After updating the speaker (
apt install ./boombox_*.deb, or the update in the backend), your packages are resolved again within their constraints, because the shipped lock is new. Their versions can move then. Checkextensions.statusafterwards.TYPO3 itself (every package the speaker requires directly) moves only with the speaker's package, never because of a package of yours. Libraries below it, such as Symfony components, can move when your package needs a newer one. A package that needs a newer TYPO3 than the one shipped fails to resolve: the release comes without it, and
extensions.lognames the conflict. Wait for a speaker package with that TYPO3, or pick an older version of the package.A release that fails keeps the lock as it was, so the next try starts from the same versions.
Never run
composerinside/var/www/boombox/currentor a release. It changes that release'svendor/(TYPO3 included) while its compiled caches still describe the old code, which ends in a 500 such as "Too few arguments to function BookmarkService::__construct()". If it happened: flush the caches as the web user, restart the web server, and make a new release, which starts from the shipped vendor again:shcd /var/www/boombox/current runuser -u www-data -- /usr/bin/php-zts vendor/bin/typo3 cache:flush rm -f var/cache/code/di/DependencyInjectionContainer_*.php systemctl restart boombox-frankenphp boombox-install --release
When it fails
The speaker always comes up. If composer cannot install your packages (no network, a package that does not exist, a version conflict, a file that is not JSON), the release is made without them and says why while it is built. Afterwards:
cat /var/www/boombox/shared/extensions.status # none, ok <packages> or failed: <reason>
less /var/www/boombox/shared/extensions.log # composer's own outputFix the file and run boombox-install --release again. If a package installs but breaks TYPO3, typo3 extension:setup fails and the running release stays live. A package that installs and sets up but breaks a page is not caught: go back by pointing current at the previous release (see Updating) or remove the package and make a new release.
What an extension can do
Plugins other than the ones the app itself needs (the TYPO3 installers, the class alias loader and the dotenv connector) are refused by composer, as are scripts.
An extension is PHP code running as the web user. It can read and write the database, shared/.env (the encryption and Mercure keys), the playlists and everything below /media/boombox, and it can reach the network. Install only what you trust, as on any TYPO3 site.
It cannot reach the root agent's code: the agent loads its own vendor/ (packages/boombox-agent/vendor) and never the app's. It can still ask the agent for what the web app may ask for, through the socket.
Trying it without a speaker
deploy/device/test/overlay.sh runs the same build against a copy of a checkout, with packagist and no device.