_Mirrored from the GitHub release v2.4.0; the downloads are served from https://download.waveflow.app._

# WaveFlow Server 2.4.0

WaveFlow Server 2.4.0 lets you sign in with the identity provider your homelab already uses: Authentik, Keycloak, Authelia, Pocket ID or any other OpenID Connect provider. It can sit beside local passwords, or be the only way in. The web player now opens in Home Assistant's sidebar.

Administrators can delete accounts and open a library to uploads from the web, and a fresh install makes its first library at setup. This release migrates the database and changes the Docker Compose files: read [Upgrading](#upgrading-from-230) before you update an existing install.

## New

- **OpenID Connect (OIDC) sign-in.** Set `WAVEFLOW_OIDC_ISSUER`, `WAVEFLOW_OIDC_CLIENT_ID` and `WAVEFLOW_OIDC_CLIENT_SECRET`, and the sign-in page shows *Sign in with …* above the password form. The desktop app signs in through the server's own pages, so it gets the button too, with nothing to change.
  - **An account is linked to its identity at the provider**, its issuer and `sub`, never to a name or an email address. The first sign-in of someone the provider admits creates their account, unless `WAVEFLOW_OIDC_AUTO_CREATE=false`. An identity whose username names an existing account is refused: that account is never taken over.
  - **Groups decide who gets in and who administers, at sign-in.** `WAVEFLOW_OIDC_ALLOWED_GROUPS` refuses anyone outside the listed groups. With `WAVEFLOW_OIDC_ADMIN_GROUP`, a linked account's role follows that group at each sign-in, and the last enabled administrator is never demoted by it. A change of groups at the provider revokes nothing already open: sessions, API tokens and Subsonic passwords go on until they expire or an administrator disables the account.
  - **An account that already exists is linked in one of three ways:**
    - its owner links it from *Settings*;
    - an administrator sends an invitation link, valid for 24 hours;
    - an administrator types the account's `sub`.

    Administrators can also manage links from the command line, with `account oidc-invite`, `account link-oidc` and `account unlink-oidc`.
  - **`WAVEFLOW_OIDC_ONLY=true` makes the provider the only way in.**
    - No password signs anyone in, and the first administrator is made through the provider, with the setup token.
    - Anything that opens a new way in needs a session the provider opened: pairing a device, issuing an API token, setting a Subsonic password, creating an account.
    - Each start revokes the sessions and the unredeemed device authorization codes the provider did not open. API tokens and Subsonic passwords stay valid until they are revoked or expire.
    - If the provider becomes unavailable, set the variable back to `false` and restart: accounts with a password can sign in again. If no administrator has a password anyone knows, create one with `waveflow-server account create-admin --username <name>`, the password taken from `WAVEFLOW_ACCOUNT_PASSWORD`.

  **Before you turn the provider-only mode on**, link the existing accounts and review their API tokens. An account that is not linked can no longer sign in at all.
  - The Android app still signs in with a username and a password, so it cannot sign in while the mode is on. It also cannot sign in an account the provider created, which has no password anyone knows.
  - Home Assistant's panel cannot start a sign-in through the provider: open the server's own address.

  The [operations guide](https://github.com/InstaZDLL/waveflow-server/blob/v2.4.0/docs/guides/operations.md#signing-in-through-an-identity-provider-oidc) has every setting, what to register at the provider, and the pitfalls. One example: with Authentik, the provider's *Encryption Key* must stay empty. The decisions are in [RFC-031](https://github.com/InstaZDLL/waveflow-server/blob/v2.4.0/docs/rfcs/RFC-031-oidc-sign-in.md), and the changes are [#476](https://github.com/InstaZDLL/waveflow-server/pull/476), [#477](https://github.com/InstaZDLL/waveflow-server/pull/477), [#479](https://github.com/InstaZDLL/waveflow-server/pull/479) and [#483](https://github.com/InstaZDLL/waveflow-server/pull/483).
- **The Subsonic API can be turned off.** An instance used only from the web player and the desktop app can set `WAVEFLOW_SUBSONIC_ENABLED=false`. `/rest` is then not served at all, and no Subsonic password is read or set ([#476](https://github.com/InstaZDLL/waveflow-server/pull/476)).
- **The web player inside Home Assistant.** The [WaveFlow app for Home Assistant](https://github.com/InstaZDLL/waveflow-home-assistant) can show the player in Home Assistant's sidebar, through its ingress. `WAVEFLOW_INGRESS_BIND` opens a second listener, which only the peers of `WAVEFLOW_INGRESS_PEERS` may reach: Home Assistant's Supervisor by default. Port 4533 is unchanged. Inside the panel, offline listening, linking Last.fm, signing in through a provider and, without `WAVEFLOW_PUBLIC_URL`, making a share are not offered, and the panel says why ([RFC-030](https://github.com/InstaZDLL/waveflow-server/blob/v2.4.0/docs/rfcs/RFC-030-home-assistant-ingress.md), [#473](https://github.com/InstaZDLL/waveflow-server/pull/473)).
- **Deleting an account from Administration.** Each account ends with *Delete account*, and a confirmation that lists what goes with it. It is not offered for your own account. The owner of a library is refused and told to disable the account instead. Every deletion is recorded in the audit log ([#484](https://github.com/InstaZDLL/waveflow-server/pull/484)).
- **The first library is made at setup.** `WAVEFLOW_MUSIC_DIR` names a folder, and setup registers it as the administrator's first library, `Music`, and starts its scan. The Docker image sets it to `/music`, where the compose file mounts your music, so a fresh install no longer opens on empty pages ([#464](https://github.com/InstaZDLL/waveflow-server/pull/464)).
- **Administrators can open a library to uploads from the web**, in the library's settings under Administration. Until now only `library set-uploads` on the command line could. In Docker, the folder must be mounted without `:ro` to receive anything ([#465](https://github.com/InstaZDLL/waveflow-server/pull/465)).
- **Picking several tracks in a folder.** A checkbox leads each row of a folder and of *To sort*, Shift takes a range, and *Select all* takes what is loaded. The picked tracks can be played, queued, moved to a folder or added to a playlist together ([#467](https://github.com/InstaZDLL/waveflow-server/pull/467)).
- **A clip plays in the immersive view and from a track's menu.** *Watch the clip* in a track's menu opens it in a dialog of its own, without changing the queue ([#471](https://github.com/InstaZDLL/waveflow-server/pull/471)).
- **An account with no library is told so**, instead of seeing empty pages. An administrator is pointed to Administration ([#464](https://github.com/InstaZDLL/waveflow-server/pull/464)).

## Fixed

- **A browser on the wrong address is told so.** With `WAVEFLOW_PUBLIC_URL` set, signing in from any other address said "Wrong username or password", and setup said "Setup failed", although both were right. Both screens now name the address the page is on and the setting to correct ([#469](https://github.com/InstaZDLL/waveflow-server/pull/469)).
- **A sync connection ends once its sign-in is revoked.** A desktop app's live sync connection stayed open after its session was signed out, its API token revoked or its account disabled. It now closes within 30 seconds ([#478](https://github.com/InstaZDLL/waveflow-server/issues/478), [#484](https://github.com/InstaZDLL/waveflow-server/pull/484)).
- **A library registered or deleted in Administration shows at once**, where it appeared only after a reload ([#464](https://github.com/InstaZDLL/waveflow-server/pull/464)).
- **A folder lists its tracks album by album.** A compilation, or an album with a guest on one song, no longer comes apart among the other albums ([#467](https://github.com/InstaZDLL/waveflow-server/pull/467)).
- **A clip no longer plays on, out of sight, behind the immersive view.** Leaving a clip open no longer leaves the track paused ([#471](https://github.com/InstaZDLL/waveflow-server/pull/471)).
- **Scrobbling asks for each destination's secret by its own name**: a user token for ListenBrainz, an API key for Maloja ([#466](https://github.com/InstaZDLL/waveflow-server/pull/466)).
- **The web client refuses a return address that holds a control character**, which the browser could otherwise have read as another site ([#475](https://github.com/InstaZDLL/waveflow-server/pull/475)).

## Upgrading from 2.3.0

Pull `2.4.0` and start it on the same data volume. With an archive, use the new folder in place of the old one, and carry over what you changed in `laptop.env`: your data is kept apart from that folder.

- **The database schema gains two tables, two columns and an index.** The tables hold the links to the provider and the link invitations. The columns record how each session and each device authorization began. The index speeds up a read of the audit log.
  - Going back takes a restore: `2.3.0` refuses to start on a database `2.4.0` has migrated.
  - Before migrating, the server copies the database and its key into `pre-migration-<epoch ms>/` in the data directory. If that copy cannot be made, a full disk for instance, the server stops before applying anything.
  - [`waveflow-server database restore`](https://github.com/InstaZDLL/waveflow-server/blob/v2.4.0/docs/guides/operations.md#a-copy-before-every-upgrade) puts that copy back. Anything written since the copy is lost.
  - With `WAVEFLOW_MIGRATION_BACKUPS=0` the server takes no copy, and the way back is a backup of your own.
- **Signing in works as it did until you configure a provider.** Sessions open before the upgrade keep working. If you later set `WAVEFLOW_OIDC_ONLY=true`, they are revoked at that start, since the provider did not open them.
- **With Docker Compose, `WAVEFLOW_MUSIC_PATH` is now required.** Until now, an unset value mounted `./music`, and Docker refused to start when that folder did not exist. Compose now stops before starting anything, and says which line to add to `.env`. The compose files also pass the optional settings on from `.env`: before this release, a metadata, lyrics, podcast or scrobbling variable written there never reached the server ([#468](https://github.com/InstaZDLL/waveflow-server/pull/468)).

Coming from 2.2.2 or earlier, read the [2.3.0 notes](https://github.com/InstaZDLL/waveflow-server/blob/v2.4.0/docs/releases/v2.3.0.md#upgrading-from-222) first.

## For client authors

- **New sign-in routes.** `GET /api/v2/web/auth/methods` says whether passwords are on and which provider is offered (`available_here` is `false` inside Home Assistant). `POST /api/v2/web/auth/oidc/start` and `/complete` run the provider round trip. The desktop app needs none of them: its browser sign-in goes through the server's pages.
- **Linking routes.** `GET` and `DELETE /api/v2/account/oidc` (the account's own link). For administrators, `PUT` and `DELETE /api/v2/admin/users/{username}/oidc` and `POST …/oidc/invitation`. An account in the administration listing carries `oidc`, `created_by_provider` and `role_managed_by_provider`.
- **New error codes**, the main ones:
  - `origin_rejected` (403), a browser on another address than `WAVEFLOW_PUBLIC_URL`;
  - `password_sign_in_disabled` and `provider_sign_in_required` (403), in the provider-only mode;
  - `interactive_session_required` (403), linking from an API token or a session one opened;
  - `oidc_link_conflict`, `role_managed_by_provider`, `subsonic_disabled` and `oidc_unavailable_here` (409);
  - for a sign-in through the provider that did not go through: `oidc_cancelled` (declined at the provider), `oidc_not_allowed` (outside the allowed groups), `oidc_account_unavailable` (no account to sign in or create), `oidc_setup_closed` (the server was set up meanwhile), `oidc_failed` and `oidc_unavailable`.
- **The sync socket closes once its credential no longer authenticates**, with close code `1008`, or `1011` when the server could not check. A refresh does not close it. Reconnect once either way: only a `401` on the upgrade means signing in again.
- **`DELETE /api/v2/admin/users/{username}`** answers `409` for the owner of a library, and records `account.deleted`.
- **New response fields**: `POST /api/v2/setup` answers `library`, and a library's settings carry `accepts_uploads`, which `PATCH /api/v2/libraries/{id}` takes. Through Home Assistant's ingress without a public address, `POST /api/v2/shares` may answer `409 share_address_missing`.
- **The Subsonic API answers as it did**, unless the server turns it off.

## Thanks

To [Danguilhen](https://github.com/Danguilhen), whose request ([WaveFlow#1188](https://github.com/InstaZDLL/WaveFlow/issues/1188)) started RFC-031, and who built and tested a provider-only mode with Authelia and LLDAP in a homelab of their own.

## Install

```bash
docker run -d --name waveflow \
  -p 4533:4533 \
  -v waveflow-data:/data \
  -v /path/to/music:/music:ro \
  ghcr.io/instazdll/waveflow-server:2.4.0
```

The image runs on `linux/amd64` and `linux/arm64`. It is the same, digest for digest, on Docker Hub as `instazdll/waveflow-server:2.4.0`, and `latest` now follows this release.

The standalone archives for Windows, macOS and Linux are attached below, with `SHA256SUMS` over all of them. The same files are linked from [this release's notes on download.waveflow.app](https://download.waveflow.app/server/releases/v2.4.0/RELEASE-NOTES.md), which stay available even when GitHub does not answer.

On Home Assistant, the [WaveFlow app](https://github.com/InstaZDLL/waveflow-home-assistant) moves to this release with its own update, which turns the sidebar panel on.

**Full changelog**: [CHANGELOG.md](https://github.com/InstaZDLL/waveflow-server/blob/v2.4.0/CHANGELOG.md) · https://github.com/InstaZDLL/waveflow-server/compare/v2.3.0...v2.4.0

## Download

The server for one computer, without Docker: extract the archive and start `waveflow-server` inside it. Each archive holds the server, its own FFmpeg and a `README.txt` to read first.

| System | Archive |
| --- | --- |
| Windows (x86_64) | [waveflow-server-2.4.0-windows-x86_64.zip](https://download.waveflow.app/server/releases/v2.4.0/waveflow-server-2.4.0-windows-x86_64.zip) |
| macOS (Apple silicon) | [waveflow-server-2.4.0-macos-arm64.zip](https://download.waveflow.app/server/releases/v2.4.0/waveflow-server-2.4.0-macos-arm64.zip) |
| macOS (Intel) | [waveflow-server-2.4.0-macos-x86_64.zip](https://download.waveflow.app/server/releases/v2.4.0/waveflow-server-2.4.0-macos-x86_64.zip) |
| Linux (x86_64) | [waveflow-server-2.4.0-linux-x86_64.tar.gz](https://download.waveflow.app/server/releases/v2.4.0/waveflow-server-2.4.0-linux-x86_64.tar.gz) |
| Linux (arm64) | [waveflow-server-2.4.0-linux-arm64.tar.gz](https://download.waveflow.app/server/releases/v2.4.0/waveflow-server-2.4.0-linux-arm64.tar.gz) |

The Windows executables carry a self-signed certificate and the macOS ones an ad-hoc signature, which neither system trusts, so both warn on the first launch: `README.txt` says what to click past. [`SHA256SUMS`](https://download.waveflow.app/server/releases/v2.4.0/SHA256SUMS) holds the checksums of them all, and [`ffmpeg-8.1.3-sources.tar.gz`](https://download.waveflow.app/server/releases/v2.4.0/ffmpeg-8.1.3-sources.tar.gz) the source of the FFmpeg they carry.

## Container image

```bash
docker pull ghcr.io/instazdll/waveflow-server:2.4.0
```

The same image, digest for digest, is on Docker Hub:

```bash
docker pull instazdll/waveflow-server:2.4.0
```

Also published as `latest` in both, for `linux/amd64` and `linux/arm64` (a Raspberry Pi 4 or 5 on a 64-bit system).

