Skip to content

Backup ​

Settings → Backup (the owner's alone: an archive holds every key and password on the speaker) makes, lists and deletes backups, and says what is in them, how many are kept, where they are stored and when one is made by itself. The aim: a speaker that is lost or reflashed comes back as it was from a backup and a fresh image.

What is in a backup ​

Every part is in by default. Each can be switched off; a part a later release adds is in until it is switched off.

PartWhat it holdsWhere on the speaker
TYPO3 databasePages, content, accountsshared/var/sqlite/*.sqlite
TYPO3 fileadminThe files of the web app: music, covers, uploads, and the music folder on a card. Not the recordings, and not TYPO3's processed copiesshared/public/fileadmin, the music folder below /media/boombox
TYPO3 shared filesThe web app's settings and keys, the site configuration, the storages and their passwordsshared/.env, php.ini, Caddyfile, config/system/settings.php, file-storages.yaml, file-storage-secrets.json, config/sites
Own packages and Composer filesThe Composer overlay with its lock, auth.json, and every folder you keep in shared/ for a path repository (Advanced customization)shared/composer.user.json, composer.lock, composer.inputs, auth.json, shared/<your folders>, /var/cache/boombox/composer/home/auth.json
Boombox configurationThe speaker's settings (Wi-Fi fallback, Home Assistant key, MQTT, Spotify account, cards), sounds, the display logo, and the keys and secrets of the device/etc/boombox, /var/lib/boombox/{config.json,sounds,display}
PlaylistsThe speaker's own playlists/var/lib/boombox/playlists.sqlite
HistoryThe songs that were played/var/lib/boombox/history.sqlite
RecordingsWhat phones played and was recorded, and what waits to be storedthe recordings folder (shared/public/fileadmin/recordings, or on a card), /var/spool/boombox
Spotify receiverThe receiver's login/var/lib/boombox-spotify
Wi-Fi networksThe saved networks and their passwords/etc/NetworkManager/system-connections
Bluetooth pairingsThe phones paired with the speaker/var/lib/bluetooth

The music and the recordings follow their folders. On a card they go into the backup, and are restored only while that card is plugged in (the restore says which one it left out). On a server (a storage made under Boombox → Storages) they are not copied: the backup names them, and the list of backups says "Not in it: the music on NAS (SMB)". Back the server up on its own. The playback cache (shared/var/boombox-cache) is never in a backup.

shared is /var/www/boombox/shared. The TYPO3 database, History and Playlists are copied with SQLite's own backup, so a backup made while the speaker plays is consistent. Logs, caches and the release itself are not in a backup: the package brings the release, and the Composer overlay brings back the packages you added.

A backup is private: the archive and its description are readable by root only.

Making backups ​

  • Back up now makes one at once. The page shows its progress and the result. One backup is made at a time.
  • Keep the newest is how many stay (1 to 100, 5 at first). When a new backup is done, older ones are deleted.
  • Store them on is the speaker's own card (/var/backups/boombox, the default), or a card or stick you included under Storage, in the folder boombox-backups on it. A backup on the card it protects is lost with the card, so put them on a stick or copy them to a server when you can.
  • Also copy them to a server an administrator added in the backend under Boombox → Storages (SMB, SFTP, WebDAV, FTP, S3): each backup goes to its folder boombox-backups as well, which keeps as many as the speaker. The copy is made by the web app (speaker:backup:store), which holds the server's password; boombox-backup hands it the archive on stdin as root. A server that cannot be reached fails the backup, which stays on the speaker. To restore one, download it from the server and use Restore from a file.
  • Back up by itself makes one at the times of a crontab time, in the speaker's time zone: minute, hour, day of month, month, day of week. 0 3 * * * is every night at 3, 30 2 * * 0 Sundays at 2:30, 0 */6 * * * every six hours. Lists (1,15), ranges (1-5), steps (*/10), month and weekday names (mon-fri) and @daily, @weekly, @monthly work as in cron. It is off until you switch it on: a first backup of a large library can fill a small card. A backup whose time passes while the speaker is off, or while another is made, is skipped.
  • Download saves a backup to your computer, so it survives the speaker. It is the same file the speaker keeps; restore it later with Restore from a file. The archive holds every key and password on the speaker: keep it where only you can read it. The speaker makes the file available for 15 minutes for the click, then closes the link.
  • Delete… asks first, then removes the backup.

Space is checked before the archive is written; a backup that would not fit fails with a note saying so. Music files do not shrink in an archive, so a large library needs room for itself once per backup you keep.

Encrypted backups ​

A backup holds the Wi-Fi passwords, the accounts and every key of the speaker. Under How many, and where, Encrypt with a passphrase (at least 8 characters) makes every backup from then on, scheduled ones too, an encrypted one: AES-256 with a key stretched from the passphrase (PBKDF2, 600,000 rounds), by openssl. The list marks them Encrypted. The speaker keeps the passphrase in /etc/boombox/backup-passphrase, for root only; the page never shows it. Without one, the page says that backups are not encrypted.

Keep the passphrase somewhere safe. A backup restored on this speaker opens with the one it keeps; on a new speaker, or after the passphrase changed, it has to be typed: in Passphrase of the backup before choosing the file, or with --passphrase-file on the command line (on a terminal the restore asks for it). Without it the backup cannot be opened. An encrypted archive keeps its .tar.gz name; to look into one by hand (head -c -84 leaves out the signature, below):

sh
head -c -84 boombox-backup-….tar.gz | openssl enc -d -aes-256-cbc -pbkdf2 -iter 600000 -md sha256 | tar -tz

Signed backups ​

A restore puts files back as root, anywhere on the speaker. So every backup is signed: its last line is an HMAC-SHA256 of the archive under a key only root can read (/etc/boombox/backup-signing.key), made at the speaker's first backup and kept in its configuration part.

  • A speaker with a key restores only its own backups: not one someone changed, put on a server or made on another speaker. The page says so and changes nothing.
  • A speaker without a key (a new card) restores any backup, and gets the key back with the backup's configuration: from then on it signs as the speaker it replaces.
  • A backup made before backups were signed is refused on a speaker that has a key. Root puts it back on the command line with --unsigned; the page has no way past the signature.

To look into an unencrypted backup by hand: head -c -84 boombox-backup-….tar.gz | tar -tz.

Restoring ​

In the page ​

  • Restore… next to a backup in the list puts that one back.
  • Restore from a file sends a backup you have on your computer (the .tar.gz a backup made, for example one copied off the speaker, or from an older speaker) and restores it. The file is sent in pieces, so a large one works and a lost connection is retried; once it is there, the page asks before it restores.

Both ask first, then restore in the background: the speaker checks the backup, stops its agent and web server, puts the files back, builds the release again with the restored Composer overlay (it needs the network if you required packages) and starts again. The page is unavailable for a few minutes; it reloads by itself when the speaker is back, and you log in with the restored accounts. Progress is in /var/lib/boombox/backup/log.

A restore runs as root and replaces files that decide how the speaker runs. Before it changes anything, the speaker reads the whole archive and refuses one that holds anything outside the places a backup comes from (the web app's shared files, /etc/boombox, /var/lib/boombox, the Spotify, Wi-Fi and Bluetooth folders), links that point out of them, or files with a set-user-id or set-group-id bit (a folder may have the latter: the web app's file folders do). The speaker checks and restores from a private copy that only root can reach, so the file you uploaded (or the one on a card) cannot be changed between the check and the restore. A restore leaves agent.env, epaper.env and egress.nft in /etc/boombox as the installer made them: root reads those as its own settings, so a backup does not bring them. Still: restore only backups you made yourself. Anyone who can change a backup you restore can change what runs on the speaker.

Onto a new image, on the command line ​

A restore needs a speaker that has the package installed and has been through its first boot, so a fresh image is set up first:

  1. Flash the image, boot it and let it finish its first start, or install the package on an existing system (Device setup).

  2. Copy the backup to the speaker, for example with a stick, or scp boombox-backup-20261111-030000.tar.gz root@boombox.local:/root/.

  3. As root on the speaker:

    sh
    boombox-backup restore /root/boombox-backup-20261111-030000.tar.gz

    It names the speaker, the version and the parts the backup holds, asks before it changes anything, stops the agent and the web server, puts the files back, builds the release again with the restored Composer overlay (the speaker needs the network if you required packages), and starts the services. Reboot afterwards.

    • --only database,fileadmin puts back only those parts (not in the page).
    • --passphrase-file FILE opens an encrypted backup with the passphrase in FILE; without it the restore asks.
    • --unsigned puts back a backup that is not this speaker's own (see Signed backups): only for one you made yourself.
    • --yes does not ask.
    • --no-release leaves out building the release.

Notes:

  • Restore all the parts that belong together. The keys in shared/.env and /etc/boombox/agent.env are a pair (the Mercure hub and the agent share them); the database holds the accounts that the settings refer to.
  • The Bluetooth pairings and the hardware options in /etc/boombox (DAC, antenna, display) are the old speaker's. On other hardware, leave out bluetooth and config, or run install.sh --system with the new hardware's options afterwards.
  • The restore replaces what is there. A speaker that matters should be backed up first.

For the curious ​

The agent keeps the settings and the schedule, and starts boombox-backup.service (root, outside the agent's sandbox), which makes the archive. Progress goes to /var/lib/boombox/backup/ (state.json and log); journalctl -u boombox-backup shows the rest. An archive is a gzip-compressed tar named boombox-backup-YYYYMMDD-HHMMSS.tar.gz, with paths relative to / and boombox-backup.json at its root, so it can be read with tar -tzf. Next to it is a small .json with what the page lists. boombox-backup parts names the parts.