Release 4.0.0
This release follows Identity 3.0.0, Media 3.0.0, the administration app 3.0.0 and the mobile app 3.0.9. All components are released as 4.0.0.
Highlights:
- Records can be synchronized with partner instances (federation).
- Users can share searches, playbacks and download links.
- Admins can send announcements to the mobile app and change covers of records.
- TLS can be terminated at the reverse proxy or at an external proxy.
- The services use .NET 10 and a new message bus library.
Existing installations follow the upgrade guide at the end of this page.
Media
New features
- Federation of partner instances with invitation codes, rotating signing keys, chunked record transfers, transfer progress, revoking a synchronization, address changes of partners and an audit log.
- Share links for searches, playbacks and downloads with share rules per group. Download and landing pages are served under
/media/s/and can be styled withstyling.json. - Announcements for the mobile app.
- Covers can be changed and are stored as files instead of base64. Covers of existing records are moved into files on the first start. Unused covers are cleaned up automatically.
- Every record knows the instance it belongs to (
INSTANCE). - Indexing runs in the service instead of through the message bus.
- MP3 files are accepted with all common MIME types.
- TLS is optional. Without
TLS:Certthe service listens on http and trusts the forwarded headers of the reverse proxy from private networks or the networks inForwardedHeaders:KnownNetworks. - The secret of the federation keys can be read from a file in
FEDERATION_KEY_SECRET_FILE. - The Docker image contains the third-party notices of all packages.
- Updated dependencies, e.g. OpenIddict 7.8 and xFFmpeg.NET 7.4. No configuration or database change is needed.
- The API version in the url is validated. Requests with a version an endpoint does not provide return 404. All versions used by the apps, the admin app and federation partners stay supported.
- The optional setting
Connection:ServerNameannounces a new domain to the apps and the admin app, so registered devices move to another domain without registering again.
Bugfixes
- Locked records can not be deleted anymore.
- Share pages open without an app key, and records contain the id of their album.
Breaking changes
- .NET 10 and Rebus instead of MassTransit. The configuration section
MassTransitis renamed toMessageBusand the service uses the queuemml.media.queue. OpenId:EncryptionCertis removed. Media validates the JSON Web Tokens of Identity with its public keys.INSTANCEis required and can not be changed after the first start.- Apps before 3.0 receive records without covers, since they can not load cover files. Playback is not affected.
- The reverse proxy has to forward
/hub/federationand/media/s/to the service.
Identity
New features
- Identity issues JSON Web Tokens instead of opaque tokens.
- The encryption and signing certificates are created automatically in
IDENTITY_SECRETS_PATHand can be protected with secrets. The secrets can be read from files inENCRYPT_SECRET_FILEandSIGN_SECRET_FILE. - Filter for inactive clients.
- TLS is optional. Without
TLS:Certthe service listens on http and trusts the forwarded headers of the reverse proxy from private networks or the networks inForwardedHeaders:KnownNetworks. - The Docker image contains the third-party notices of all packages and of content embedded in them, e.g. the EFF wordlist of PasswordGenerator under CC BY 3.0.
- Updated dependencies, e.g. OpenIddict 7.8 and Quartz.NET 4. Existing client secrets stay valid and no database migration is needed.
- The API version in the url is validated. The client endpoints accept
v1.0andv2.0, which the app uses since 3.0, all other endpointsv1.0. Requests with another version return 404.
Bugfixes
- Certificates created without secret are protected, when a secret is configured later.
- The encryption secret is read from
ENCRYPT_SECRET. - The example connection string of Redis uses port 6379 without TLS like the Redis configuration of the deployment.
Breaking changes
- .NET 10 and Rebus instead of MassTransit. The configuration section
MassTransitis renamed toMessageBus. OpenId:EncryptionCertandOpenId:SigningCertare removed. The certificates are read fromIDENTITY_SECRETS_PATH.INSTANCEis required.- Admins have to log in again, if the existing certificates are not copied during the upgrade.
App
New features
- Share searches, playbacks and download links, open shared links and continue the last playback.
- Show announcements of the admins.
- Filter records by the group of a list.
- Android Auto works.
- The player uses the dark surface in dark mode, and the color scheme template is updated.
- Updated to Flutter 3.47, material_ui and current packages. Android is built with Gradle 9.3.1, the Android Gradle plugin 9.1.0, Kotlin 2.4.0 and Java 17.
- The app is shown edge-to-edge on Android and can be used in landscape on Android and iOS. On low screens the player uses a compact layout.
- The privacy policy and the legal information open in the in-app browser.
- The licenses page lists the licenses of all packages and libraries bundled with the app.
- Favorites appear immediately after a playlist was created or imported.
- The app moves to another domain of the server in the background, after it checked that it is registered there.
Bugfixes
- The player heats the device less, uses less battery and loads records with less work.
- The Android media notification is removed when the player is closed and no longer gets stuck.
- The app is offered for opening
.mmlfiles on Android and iOS, also on Android 16, which detects them astext/mathml. - Offline records stay playable, when the device is registered again without removing the registration before. Records, that already became unplayable this way, have to be downloaded again.
- The play button switches to pause, when the playback starts.
- The back button of the device leaves an opened folder first.
- The date filter of the records opens without a crash.
- A message is shown, if a link can not be opened.
- The app launches on iOS 27 with the UIScene lifecycle.
- The playback state is shown correctly.
- Updating the connection settings by scanning the QR code of the admin app succeeds again for registered clients. The registration check used a url without API version, which Identity answers with 404.
Breaking changes
- None. Sharing and announcements need the services of this release.
- The app requires iOS 15 or Android 7 (API 24). Devices with older versions keep the installed version.
- Forks: building needs Flutter 3.47 and Java 17. The privacy policy is only shown, if
privacyUrlis set inapp.cfg, see Customize.
Admin app
New features
- Sync area to administrate federation partners with transfer progress, revoking a synchronization, address changes and an audit log table.
- Instance name and sync overview.
- Download links, share rules and share settings for sharing.
- Send announcements, change covers and show the licenses of the used packages.
- Filter for inactive clients and filter records by the group of a list.
- Login and form dialogs can be submitted with Enter.
- Covers load faster.
- The color scheme is updated and animations use Lottie instead of Rive.
- Registration and connection settings QR codes use the domain announced by the server in
Connection:ServerName. - The update check shows the changelog in the language of the app and opens the downloaded installer.
- Updated to Flutter 3.47 and current packages. The macOS app is built with the Swift Package Manager instead of CocoaPods.
Bugfixes
- The app stays usable with servers without synchronization, and sharing is hidden on servers without sharing.
- The registration socket is closed when the dialog is closed.
- Records, that can not be deleted, are shown with their icon, and the folder filter works.
- Closing the upload dialog cancels the running upload without an error.
- The Windows app closes immediately.
- The filter field of the lists does not overflow next to the navigation.
- The
customizescript keeps the Windows window, when it sets the title.
Breaking changes
- The admin app works with servers of the previous release, but federation and sharing need the services of this release.
- Forks: the Linux build job needs the packages
libx11-devandlibxi-dev, see the workflow.
Deployment
New features
- TLS can be terminated by the reverse proxy (
PROXY_TLS=true, default) or by an external proxy (PROXY_TLS=false). Behind an external proxy the reverse proxy takes the client ip fromX-Forwarded-Forof the proxies inTRUSTED_PROXY. PROXY_TLS=bothaccepts direct clients with TLS onSSL_PORTand an external proxy over http onHTTP_PORTat the same time, e.g. while moving to another domain.- The reverse proxy forwards Identity routes to Identity and all other requests to Media, and passes
X-Forwarded-Prototo the services. - The reverse proxy writes its logs to files in
PROXY_LOGSinstead of the console. Share links are not logged. - Secrets of Identity and Media are read from files, see Encryption and Signing.
Breaking changes
- The reverse proxy needs the new
default.conf.templateand the executable script15-mml-listen.shnext to it. The container stops with a hint, if the script is missing. - The access log of the reverse proxy is not shown by
docker logsanymore. ENCRYPT_SECRET,SIGN_SECRETandFEDERATION_KEY_SECRETare deprecated. They still work, if no secret file is configured.
Upgrade from 3.x
This guide describes the changes admins have to make when updating an existing backend from 3.x to 4.0.0. New installations follow the backend setup instead.
Create a backup of the databases, the records folder and the certificates before updating. See Update database on how to create database dumps.
1. Stop the services
cd ~/medialib
sudo docker compose stop wekode.mml.reverseproxy wekode.mml.media wekode.mml.identity
2. Update the deployment files
Copy the new docker-compose.yml, default.conf.template and 15-mml-listen.sh to the server. The template and the script belong into the folder CONF_TEMPLATE. Make the script executable and create the folder of the proxy logs:
chmod +x proxy/15-mml-listen.sh
mkdir -p proxy/logs
sudo chown -R 1001:1001 proxy/
The template contains the routes /hub/federation and /media/s/ of the Media service. The script generates the listen configuration of the reverse proxy, see SSL/TLS. Set up the rotation of the proxy logs as described in Logs.
Add the new values to the existing .env file and set the new image versions in IDENTITY_VERSION and MEDIA_VERSION:
## The system tenant name to be used e.g in federation. The INSTANCE value should not contain spaces.
INSTANCE=my-media-lib
## identity configuration section
## Optional. Paths to the files on host with the secrets to protect the encryption and signing certificates.
#ENCRYPT_SECRET_FILE=/home/mml/medialib/identity/encrypt.secret
#SIGN_SECRET_FILE=/home/mml/medialib/identity/sign.secret
## The path where the certificates of the identity are stored.
IDENTITY_SECRETS_PATH=/home/mml/medialib/identity/secrets
## media configuration section
## The path where the federation keys of the media service are stored.
MEDIA_SECRETS_PATH=/home/mml/medialib/media/secrets
## Optional. Path to the file on host with the secret to encrypt the federation keys stored in MEDIA_SECRETS_PATH.
#FEDERATION_KEY_SECRET_FILE=/home/mml/medialib/media/federation.secret
## proxy configuration section
## true: the proxy terminates TLS with the certificate CERT_NAME. false: TLS is terminated by an external proxy.
# PROXY_TLS=true
## Only used with PROXY_TLS=false. Ips or CIDRs of the external proxies.
# TRUSTED_PROXY=
## Path to the folder on host where the access.log and error.log of the proxy are written.
PROXY_LOGS=/home/mml/medialib/proxy/logs
On the first start the Media service marks all existing records as owned by INSTANCE. Set the final name before starting the services and do not change it afterwards. The Media service stores the name on the first start and refuses to start with another name, see Instance name. The name may contain letters, digits, ., _ and - with up to 64 characters and must be unique among your partner instances.
Create the secrets folders and set the user rights:
mkdir -p identity/secrets media/secrets
sudo chown -R 1001:1001 identity/secrets media/secrets
If you used ENCRYPT_SECRET, SIGN_SECRET or FEDERATION_KEY_SECRET before, move each secret unchanged into a file and set the matching _FILE variable instead, see Encryption and Signing. The variables still work, but the secrets are then visible in the environment of the containers.
3. Keep the identity certificates
Identity stores its certificates in IDENTITY_SECRETS_PATH and no longer reads them from the paths in OpenId:EncryptionCert and OpenId:SigningCert. Copy the existing certificates with the new file names, so existing logins stay valid:
cp certs/identity.sign.pfx identity/secrets/wekode.mml.signing.pfx
cp certs/identity.encrypt.pfx identity/secrets/wekode.mml.encryption.pfx
sudo chown 1001:1001 identity/secrets/*.pfx
If you skip this step, new certificates are created on the first start and all admins have to log in again. Registered clients are not affected, since they get new tokens with their client credentials.
When ENCRYPT_SECRET_FILE or SIGN_SECRET_FILE is set, the copied certificates are protected with the secret on the first start. Do not change the secrets afterwards.
4. Update the appsettings
Identity
In identity/appsettings.json:
- Remove
EncryptionCertandSigningCertfrom theOpenIdsection. - Rename the section
MassTransittoMessageBus. - Use the Redis connection string without TLS:
"DistributedCache": "wekode.mml.cache:6379,password=<password>". - Optional: remove the
TLSsection, if TLS is terminated by the reverse proxy or an external proxy, see SSL/TLS.
"OpenId": {
"AccessTokenLifetimeMinutes": "60",
"RefreshTokenLifetimeMinutes": "43200",
"RefreshTokenReuseLeewaySeconds": "10",
"TokenLifespanMinutes": "15",
"CleanOrphanTokenDays": "1",
"Issuer": "https://<url>:<port>/"
},
"MessageBus": {
...
},
Media
In media/appsettings.json:
- Remove
EncryptionCertfrom theOpenIdsection. Media validates the tokens with the public keys of Identity. - Rename the section
MassTransittoMessageBus. - Add the
Federationsection. Federation is always enabled and uses the address ofOpenId:Issuer; setPublicUrlonly if partners reach this instance at another address, see Federation. - Optional: remove the
TLSsection, if TLS is terminated by the reverse proxy or an external proxy, see SSL/TLS.
"OpenId": {
"Issuer": "https://<url>:<port>/"
},
"Federation": {
"PublicUrl": "",
"AllowPrivateNetworks": false,
"KeysPath": "/secrets/federation",
"KeyRotationDays": 90,
"KeyPublishLeadDays": 7,
"KeyRetireDays": 14,
"ChunkSizeMb": 32,
"MaxRecordSizeMb": 2048,
"UploadPath": "/tmp/records/federation",
"UploadRetentionDays": 7,
"MaxOpenTransfers": 10
},
"MessageBus": {
...
},
The certificate identity.encrypt.pfx is not needed by Media anymore.
5. Start the services
sudo docker compose pull
sudo docker compose up -d
The databases are migrated automatically on the first start. Check the logs of Identity and Media for errors:
sudo docker compose logs wekode.mml.identity wekode.mml.media
The queues of the previous message bus library are not used anymore. They can be removed from RabbitMQ after the services started successfully.
6. Update the apps
Install the 4.0.0 release of the administration app and the mobile app. Admins may have to log in again.
7. Use federation
Federation is enabled after the update without further configuration. Nobody can register without an invitation code created by an admin of this instance. To synchronize records:
- Make sure
FILE_UPLOAD_LIMITin the.envfile is larger thanChunkSizeMbof your partners (32 MB by default). - Register partners as described in Federation.
8. Use sharing
Sharing needs the route /media/s/ of the new reverse proxy template. Without it, links to searches and downloads do not work. Afterwards:
- Create share rules for the groups whose users should be allowed to share. Without rules users can not share.
- Optional: adjust the look of the share pages in
styling.json, e.g. if you customized your app. The compose file of the deployment mounts the file fromMEDIA_STYLING. Without the file the pages look like the unchanged app.