Overview
Check the FAQ if you have any issues after configuration!
Configuration Types
Sources and Clients are configured using:
- environmental (ENV) variables
- client/source specific json config files
- an all-in-one json config file
MS will parse configuration from all configuration types. You can mix and match configurations but it is generally better to stick to one or the other.
- ENV
- File
- File AIO
MS will parse environmental variables present in the OS/container when it is run. This method means MS does not require files to run.
Use ENV-based configuration if...
Config Example
For Docker container...
docker run -e "SPOTIFY_CLIENT_ID=yourId" -e "SPOTIFY_CLIENT_SECRET=yourSecret" ...
For Docker Compose
services:
multi-scrobbler:
image: foxxmd/multi-scrobbler
environment:
- SPOTIFY_CLIENT_ID=yourId
- SPOTIFY_CLIENT_SECRET=yourSecret
- MALOJA_URL=http://domain.tld:42010
- MALOJA_API_KEY=1234
# ...
# ...
For a local/node installation export variables before running...
SPOTIFY_CLIENT_ID=yourId SPOTIFY_CLIENT_SECRET=yourSecret npm run start
MS will parse configuration files located in the directory specified by the CONFIG_DIR environmental variable. This variable defaults to:
- Local installation ->
PROJECT_DIR/config - Docker ->
/config(in the container) -- see the install docs for how to configure this correctly
Use File-based configuration if...
- You have many Sources
- You have many of each type of Source you want to scrobble from IE 2x Plex accounts, 3x Spotify accounts, 1x Funkwhale...
- You have more than one scrobble Client you want to scrobble to IE multiple Maloja servers
- You want only to scrobble to specific Clients
- You need to setup more advanced configuration for a Source/Client
- Most Source/Clients only support basic configuration through ENV, all configuration is possible using File/AIO
- There are example configurations for all Source/Client types and AIO config located in the
/configdirectory of this project. These can be used as-is by renaming them to.json. - For docker installations these examples are copied to your configuration directory on first-time use.
- There is also a kitchensink example that provides examples of using all sources/clients in a complex configuration.
Each file is named by the type of the Client/Source found in below sections. Each file as an array of that type of Client/Source.
Example directory structure:
/CONFIG_DIR
plex.json
spotify.json
maloja.json
Config Example
[
{
"name": "MySpotify",
"enable": true,
"clients": [],
"data": {
"clientId": "a89cba1569901a0671d5a9875fed4be1",
"clientSecret": "ec42e09d5ae0ee0f0816ca151008412a",
"redirectUri": "http://localhost:9078/callback",
"interval": 60
}
}
]
MS will parse an all-in-one configuration file located in the directory specified by the CONFIG_DIR environmental variable. This variable defaults to:
- Local installation ->
PROJECT_DIR/config/config.json - Docker ->
/config/config.json(in the container) -- see the install docs for how to configure this correctly
Use AIO-based configuration if...
- You have many Sources
- You have many of each type of Source you want to scrobble from IE 2x Plex accounts, 3x Spotify accounts, 1x Funkwhale...
- You have more than one scrobble Client you want to scrobble to IE multiple Maloja servers
- You want only to scrobble to specific Clients
- You need to setup monitoring/webhooks
- You want to setup defaults for all Sources/Clients
The AIO config also enables setting default options for sources/clients as well as global options for MS itself.
- An example AIO config files can be found in the project directory at
/config/config.json.example - For docker installations this example is copied to your configuration directory on first-time use.
- There is also a kitchensink example that provides examples of using all sources/clients in a complex configuration.
Explore the schema for this configuration, along with an example generator and validator, here
Config Example
{
"debugMode": false,
"disableWeb": false,
"sourceDefaults": {
"logPayload": false,
"logFilterFailure": "warn",
"logPlayerState": false,
"scrobbleThresholds": {
"duration": 30,
"percent": 50
},
"maxPollRetries": 1,
"maxRequestRetries": 1,
"retryMultiplier": 1.5
},
"clientDefaults": {
"maxRequestRetries": 1,
"retryMultiplier": 1.5
},
"sources": [
{
"type": "spotify",
"enable": true,
"clients": ["myConfig"],
"name": "mySpotifySource",
"data": {
"clientId": "a89cba1569901a0671d5a9875fed4be1",
"clientSecret": "ec42e09d5ae0ee0f0816ca151008412a",
"redirectUri": "http://localhost:9078/callback"
}
}
],
"clients": [
{
"type": "maloja",
"enable": true,
"name": "myConfig",
"data": {
"url": "http://localhost:42010",
"apiKey": "myMalojaKey"
}
}
],
"webhooks": [
{
"name": "FirstGotifyServer",
"type": "gotify",
"url": "http://localhost:8070",
"token": "MyGotifyToken",
"priorities": {
"info": 5,
"warn": 7,
"error": 10
}
},
{
"type": "ntfy",
"name": "MyNtfyFriendlyNameForLogs",
"url": "http://localhost:9991",
"topic": "MyMultiScrobblerTopic",
"username": "Optional",
"password": "Optional",
"priorities": {
"info": 3,
"warn": 4,
"error": 5
}
}
]
}
Setup Sources and Clients
See the Configuration Types above for your options for creating Source and Client configurations.
- Reference Scrobble Sources for what Sources are available
- Reference Scrobble Clients for what Clients are available
Each entry for a Source/Client includes a Configuration section that describes how to configure it using a configuration type.
Application Options
These options affect multi-scrobbler's behavior and are not specific to any source/client.
Base URL
Defines the URL that is used to generate default redirect URLs for authentication on spotify and lastfm -- as well as some logging hints.
- Default =>
http://localhost:9078 - Set with ENV
BASE_URLorbaseUrlall-in-one configuration - If protocol is
httpor no protocol is specified MS will try to use port9078-- to override this explicitly set the port or usehttps
Useful when running with docker so that you do not need to specify redirect URLs for each configuration.
Example
EX Lastfm Redirect Url is BASE_URL:PORT/lastfm/callback (when no other redirectUri is specified for lastfm configuration)
BASE_URL | Redirect URL |
|---|---|
192.168.0.101 | http://192.168.0.101:9078/lastfm/callback |
http://my.domain.local | http://my.domain.local:9078/lastfm/callback |
http://192.168.0.101/my/subfolder | http://192.168.0.101:9078/my/subfolder/lastfm/callback |
BASE_URL | Redirect URL |
|---|---|
my.domain.local:80 | http://192.168.0.101:80/lastfm/callback |
my.domain.local:9000 | http://my.domain.local:9000/lastfm/callback |
192.168.0.101:4000/my/subfolder | http://192.168.0.101:4000/my/subfolder/lastfm/callback |
https://192.168.0.101 | https://192.168.0.101:443/lastfm/callback |
Caching
Multi-scrobbler can cache some of its data for the purpose of persisting queued and dead scrobbles after restarting.
It supports caching using either:
- File cache stored in the
CONFIG_DIRdirectory (next to your File/AIO file) - Valkey, an open-source fork of Redis.
File caching is enabled by default when no other configuration is present.
The type of cache used, and it's connection properties, can be configured through ENV or AIO config.
Caching Configuration
- File
- Valkey
File cache is stored in the CONFIG_DIR directory using the pre-defined file name ms-scrobble.cache.
It is enabled by default if CACHE_SCROBBLE, or the respective AIO configuration, is not defined.
- ENV
- AIO
| Environmental Variable | Required? | Default | Description |
|---|---|---|---|
CACHE_SCROBBLE | No | file | The cache type to use |
CACHE_SCROBBLE_CONN | No | The config directory | The directory, within the container, to store the cache file |
{
"cache": {
"scrobble": {
"provider": "file",
"connection": "/config"
}
},
// ...
}
- ENV
- AIO
| Environmental Variable | Required? | Default | Description |
|---|---|---|---|
CACHE_SCROBBLE | Yes | valkey | The cache type to use |
CACHE_SCROBBLE_CONN | Yes | The host/IP and port to connect to, prefixed with redis:// -- EX: redis://192.168.0.120:6379 |
{
"cache": {
"scrobble": {
"provider": "valkey",
"connection": "redis://192.168.0.120:6379"
}
},
// ...
}
Debug Mode
Turning on Debug Mode will
- override and enable all optional "debugging" options found in configuration
- set log output to DEBUG
Use this as a shortcut for enabling output that can be used for troubleshooting and issue reporting. Be aware that logs will likely be VERY noisy while Debug Mode is on. You should only have this mode on while gathering logs for troubleshooting and then turn it off afterwards.
To set debug mode either add it to AIO config.json
{
"debugMode": true,
"sources": [...],
// ...
}
or set the ENV DEBUG_MODE=true
Disable Web
If you do not need the dashboard and/or ingress sources, or have security concerns about ingress and cannot control your hosting environment, the web server and API can be disabled.
Any ingress-based sources will be unusable (Webscrobbler, etc...) if this is disabled.
Disable using either:
- ENV
DISABLE_WEB=true - In All-in-One File use the top-level property
"disableWeb": true
Monitoring
Multi-scrobbler supports some common webhooks and a healthcheck endpoint in order to monitor Sources and Clients for errors.
Webhook Configurations
Webhooks will push a notification to your configured servers on these events:
- Source polling started
- Source polling retry
- Source polling stopped on error
- Scrobble client scrobble failure
Webhooks are configured in the AIO config.json file under the webhook top-level property. Multiple webhooks may be configured for each webhook type.
Example
{
"sources": [
//...
],
"clients": [
//...
],
"webhooks": [
{
"name": "FirstGotifyServer",
"type": "gotify",
"url": "http://192.168.0.100:8070",
"token": "abcd"
},
{
"name": "SecondGotifyServer",
"type": "gotify",
//...
},
{
"name": "NtfyServerOne",
"type": "ntfy",
//...
},
//...
]
}
Gotify
Refer to the config schema for GotifyConfig
multi-scrobbler optionally supports setting message notification priority via info warn and error mappings.
Example
{
"type": "gotify",
"name": "MyGotifyFriendlyNameForLogs",
"url": "http://192.168.0.100:8070",
"token": "AQZI58fA.rfSZbm",
"priorities": {
"info": 5,
"warn": 7,
"error": 10
}
}
Ntfy
Refer to the config schema for NtfyConfig
multi-scrobbler optionally supports setting message notification priority via info warn and error mappings.
Example
{
"type": "ntfy",
"name": "MyNtfyFriendlyNameForLogs",
"url": "http://192.168.0.100:9991",
"topic": "RvOwKJ1XtIVMXGLR",
"username": "Optional",
"password": "Optional",
"priorities": {
"info": 3,
"warn": 4,
"error": 5
}
}
Apprise
Refer to the config schema for AppriseConfig
multi-scrobbler supports stateless and persistent storage endpoints as well as tags/
Example
{
"type": "apprise",
"name": "MyAppriseFriendlyNameForLogs",
"host": "http://192.168.0.100:8080",
"urls": ["gotify://192.168.0.101:8070/MyToken"], // stateless endpoints
"keys": ["e90b20526808373353afad7fb98a201198c0c3e0555bea19f182df3388af7b17"], //persistent storage endpoints
"tags": ["my","optional","tags"]
}
Health Endpoint
An endpoint for monitoring the health of sources/clients is available at GET http://YourMultiScrobblerDomain/health
- Returns
200 OKwhen everything is working or500 Internal Server Errorif anything is not - The plain url (
/health) aggregates status of all clients/sources -- so any failing client/source will make status return 500- Use query params
typeornameto restrict client/sources aggregated IE/health?type=spotifyor/health?name=MyMaloja
- Use query params
- On 500 the response returns a JSON payload with
messagesarray that describes any issues- For any clients/sources that require authentication
/healthwill return 500 if they are not authenticated - For sources that poll (spotify, yt music, subsonic)
/healthwill 500 if they are not polling
- For any clients/sources that require authentication