Updating, moving, removing

Everything that happens to an install after day one: updating it, backing up the one file that cannot be regenerated, getting back in after a forgotten password, carrying the whole thing to another computer, and removing it without touching anybody's media.

Updating is installing again, from a signed release

There is no separate update path: an update is the installer run again from the newest signed release, which pulls the newer images and restarts, keeping the library, accounts and settings. Every way of updating checks the release's signed list of files first (see Installing), so nothing the release key did not sign is ever run:

Computers update themselves at night, on unless turned off: Windows has a scheduled task of the person's own, "EmberStorm update", the Mac a LaunchAgent with a switch in its menu, Linux a cron line - each at a time chosen once between 2 and 5 in the morning. The night's run does nothing unless the install is finished, the setting (SOUNDSTORM_AUTO_UPDATE) is not off, and the signed release is newer than the one installed; it asks nothing and opens no window. If the new version does not start and answer, the compose file from before is put back and the old version started again. Settings → About tells the owner when a newer release is out (the server looks at the signed list twice a day; SOUNDSTORM_UPDATE_CHECK=off stops it) and says which build the server is. The card for the computer EmberStorm runs on says how to turn the night's update off.

A box with EmberStorm preinstalled updates differently: its caretaker installs signed releases from its own channel between 2 and 5 at night, snapshotting the data first and putting everything back if a release is not healthy, and the owner can check and update from Settings. The phone apps do not update themselves: an Android release is installed over the last by hand, and the Apple apps come through TestFlight.

EmberStorm itself cannot update itself, and should not learn how. It has no access to the Docker socket, which is the reason a compromised EmberStorm cannot reach the host; the updates above are run by the installers on the host, never by the server. An in-app update button would mean handing it that socket.

An update whose image download fails - a registry rate limit, a dropped connection - starts the version already installed with the compose file it had, instead of stopping, since nothing about the install is broken.

Backup and restore

One file holds every account, sessions, everyone's favorites and playlists (as one extra field), and the passwords EmberStorm generated for each media server. Those passwords exist nowhere else. If a media server's data survives but EmberStorm's does not, that server has an account whose password nobody holds - the one failure provisioning cannot recover from by itself. Keep a copy somewhere other than the server, and treat it like a password.

# Mac and Linux, in the install folder
(umask 077; docker compose run --rm -T soundstorm backup - > soundstorm-backup.json)
docker compose run --rm -T soundstorm restore - < soundstorm-backup.json

# Windows (PowerShell), in the install folder
docker compose run --rm -v "${PWD}:/backup" soundstorm backup /backup/soundstorm-backup.json
docker compose run --rm -v "${PWD}:/backup" soundstorm restore /backup/soundstorm-backup.json

Some details that matter:

What a backup does not carry: covers somebody set by hand, the listen log behind the year-in-music recap, and media. A move (below) carries everything.

A forgotten password

Sign-up closes once the first account exists, so a forgotten owner password used to mean hand-editing the state file inside a container. Now:

docker compose down
docker compose run --rm soundstorm reset-password        # or: reset-password alex
docker compose up -d

It prints a new password. Two things about it were found by doing it to a live install:

Sessions are left alone: recovering your own password is not evidence of a break-in, and signing out every device in the house would be its own small disaster. Changing a password from inside the app is different - it asks for the current one and signs out every other device.

The server treats any unknown argument as an error. It used to fall through to starting normally, so backup against an image too old to know the command quietly started a second EmberStorm on the same state.

Moving to another computer

For the steps alone, in plain words, see Moving to a new computer. This section is how it works.

The installers pack an install into one folder, EmberStorm-move, to carry on a USB drive or over the network between Windows, Mac and Linux in any direction:

# Windows: Start menu, "Move EmberStorm to another computer", or
.\soundstorm.ps1 -Export E:\

# Mac and Linux
curl -fsSL .../install.sh | sh -s -- --export /media/usb      # --no-library leaves media out

On the new computer, the folder carries a launcher for each kind of computer that installs from the folder it sits in.

Rehearsals between throwaway projects in all four directions found real bugs: Windows wrote the manifest with CRLF line endings that Linux refused; one file name a Windows-formatted drive cannot hold stopped a whole export (now everything that can be copied is, and problem names are listed in windows-name-problems.txt); and a drive root such as E:\ broke the relaunch, because a trailing backslash escaped the closing quote.

Uninstalling: never touch library/

Windows registers EmberStorm under the current user's uninstall key, so it appears in Settings → Apps like anything else, with no administrator needed - from the moment setup starts, so a setup stopped part way can be removed the same way. On a Mac set up with the EmberStorm app, the cloud it keeps in the menu bar has Uninstall EmberStorm…; on Linux it is sh emberstorm-uninstall.sh in the install folder, Uninstall in the app-menu entry's right-click menu, or install.sh --uninstall, which finds the install from any folder.

The aim is to leave only what the person keeps. The uninstaller asks first, one choice per change the setup made and recorded: keep a copy of the accounts (ticked), remove the downloaded programs (ticked; Windows always removes them), and, unticked, remove Docker (offered only when the setup installed it), let the computer sleep on its own again, put the lid setting back, and on Windows ask for a password at sign-in again. With no window to ask in, it takes those defaults. It then runs docker compose down -v - which removes the named volumes: accounts and each media server's database - removes the compose file, the .env, the saved scripts, the shortcuts and its own firewall rules, and says where the media was left. If EmberStorm cannot be stopped, nothing else is taken back, so it keeps working and uninstalling again can finish.

The install folder itself is never deleted, because the library is inside it by default. Deleting the folder wholesale would take somebody's media with it. A test puts a marker file in library/music and requires it to be readable after uninstalling.

One consequence of the design: an install can only be removed by a version of the script that knows how, because the uninstall entry points at the copy saved in the install folder.

Deleting media from the app

Separately from uninstalling, the owner can delete items from inside the app. Nothing is deleted at once: files move into library/.trash/ with a record of what they were, Undo puts them back without ever overwriting, and a daily sweep empties entries older than 30 days. The bin is a hidden top-level folder that no media server has mounted, so a binned item leaves every server's view at once.