Skip to content

Configuration keys

Every key of the config file of a box, generated from docs/config_schema.json, the schema the box checks its config against when it starts. The keys are explained with their context in Configuration; an example is docs/config.example.yaml.

tinyjukebox

Tiny Jukebox box

Key Type Required Description
tinyjukebox.albums-folder string yes root folder of all albums - album folders in the targets json are relative to it
tinyjukebox.backups-folder string folder of the backups that a box without a library makes by itself, until another folder is set on its page (optional, default: folder 'backups' beside the albums folder)
tinyjukebox.playlist-filename string yes name of the m3u playlist in each album folder (e.g. playlist.m3u)
tinyjukebox.volume object yes
tinyjukebox.volume.max-volume number yes maximum volume in %
tinyjukebox.volume.default-volume number yes volume on startup in %
tinyjukebox.volume.volume-step number yes change of the volume per button press in %
tinyjukebox.volume.volume-step-hold number change of the volume in % per hold event of a volume button that is kept pressed (optional, default: 1) - 'hold_timeout' and 'hold_repeat' of its input driver say how often
tinyjukebox.volume.mixer-control string alsa mixer control of the default card (default: Master) - list: 'amixer scontrols'
tinyjukebox.bluetooth object volume of the bluetooth headset (optional) - start value and maximum of speaker and headset can be changed at runtime (web page, command line); the changed values are stored in the volume json file and apply instead of the config
tinyjukebox.bluetooth.default-volume number volume in % whenever the headset connects (default: 40)
tinyjukebox.bluetooth.max-volume number maximum volume of the headset in % (default: 75) - 100: the box does not limit it
tinyjukebox.albumplayer object yes
tinyjukebox.albumplayer.rewind-max-time number yes 'previous' within this many seconds of a track goes to the previous track, later it restarts the current track
tinyjukebox.albumplayer.update-schedule number yes store the playback position every n seconds
tinyjukebox.albumplayer.pause-between-tracks number yes pause between two tracks in seconds
tinyjukebox.albumplayer.buffer-time number alsa buffer of aplay in ms (optional, default: aplay's default, usually 500 ms) - smaller starts the sound faster; raise it if the sound stutters
tinyjukebox.json object yes
tinyjukebox.json.tags string yes tags json file, e.g. /srv/tinyjukebox/json/tags.json
tinyjukebox.json.targets string yes targets (albums) json file, e.g. /srv/tinyjukebox/json/targets.json
tinyjukebox.json.activities string yes activities json file, e.g. /srv/tinyjukebox/json/activity.json
tinyjukebox.json.volume string start value and maximum of the volumes changed at runtime (optional, default: volume.json next to the tags json)
tinyjukebox.sync object synchronization with the library (optional) - the box works with a library as soon as its address was entered (web page, or the file 'library' in the identity folder)
tinyjukebox.sync.folder string what the library delivered, the changes of this box that it has not confirmed, the journal (default: folder 'sync' next to the folder of the tags json)
tinyjukebox.sync.identity string what identifies this box: its id, its key, address and certificate of the library (default: folder 'identity' next to the folder of the tags json)
tinyjukebox.sync.retry-seconds number how often the library is tried again while it cannot be reached (default: 30)
tinyjukebox.sync.keep-free number MB that stay free on the card of a box that works with a library (default: 500, 0: never delete): when less is free, the audio files of albums are deleted here, the album not played for the longest time first - the library has them, and they are fetched again when their tag is placed
tinyjukebox.sync.stage1-seconds number health check of a new version: seconds after the start in which no unexpected exception may occur and everything must run (default: 10)
tinyjukebox.sync.stage2-seconds number health check of a new version: seconds an album must have played without an unexpected exception before the version is confirmed (default: 60)
tinyjukebox.sync.look-hours number a box with slots and without a library: hours between two looks for a new version at the releases of the git server (default: 24)
tinyjukebox.rest-api object https rest api and web page (optional)
tinyjukebox.rest-api.enabled boolean default: true
tinyjukebox.rest-api.host string address to listen on (default: 0.0.0.0)
tinyjukebox.rest-api.port integer default: 8443
tinyjukebox.rest-api.certificate string certificate file (pem) - a self signed certificate is created if it does not exist (default: ~/.config/tinyjukebox/tinyjukebox.crt)
tinyjukebox.rest-api.private-key string private key file (pem, default: ~/.config/tinyjukebox/tinyjukebox.key)
tinyjukebox.rest-api.hostnames list of string additional host names / ip addresses for the self signed certificate
tinyjukebox.rest-api.users-file string users and password hashes - manage with 'tinyjukebox-users' (default: ~/.config/tinyjukebox/users.yaml)
tinyjukebox.rest-api.images-folder string covers of albums, radio stations and entries of Spotify (default: folder 'images' next to the tags json)
tinyjukebox.rest-api.session-timeout number logout after this many seconds without request (default: 604800 = 7 days)
tinyjukebox.rest-api.idle-timeout number logout after this many seconds in which the user of the page did nothing (default: 1800 = 30 minutes; 0: never)
tinyjukebox.rest-api.max-upload-size number maximum size of an uploaded mp3 file in MB (default: 500)

logger

Logger configuration

Key Type Required Description
logger.log-level DEBUG / INFO / WARNING / ERROR / CRITICAL yes Log level to be used.
logger.log-file string yes File name for the logger.
logger.log-rotation object Parameters for log rotation (optional).
logger.log-rotation.maxbytes integer yes Rollover occurs whenever the current log file is nearly maxbytes in length.
logger.log-rotation.backupcount integer yes With a backupcount of 5 and a base file name of app.log, you would get app.log, app.log.1, app.log.2, up to app.log.5.

drivers

Drivermanager configuration.

A list; every entry has a type, and the type decides the other keys.

type input

Key Type Required Description
name string yes name of driver
type input yes type of driver
pin integer yes gpio pin
hold_timeout number yes hold time in seconds until the hold event is triggered
button volume-up / volume-down / next / prev / play / pause yes which button of the box
hold_repeat boolean repeat the hold event every hold_timeout seconds while the button stays pressed (optional, default: false)
active boolean yes if set to false, the driver is not loaded

type rfid

Key Type Required Description
name string yes name of driver
type rfid yes type of driver
pins object yes rfid reader pins (BCM numbers); two different ones, none of 9, 10, 11 (SPI0)
pins.pin_rst integer yes reset pin
pins.pin_cs integer yes chip select - rfid-reader drives it itself, any free pin; e.g. 8 for SPI0 CE0
command list of string command that starts rfid-reader (optional, default: sudo -n /usr/local/bin/rfid-reader); the pins are appended as arguments
active boolean yes if set to false, the driver is not loaded

type rgbled

Key Type Required Description
name string yes name of driver
type rgbled yes type of driver
initial-color BLACK / WHITE / RED / GREEN / BLUE / YELLOW / AQUA / MAGENTA yes color at startup
pin-red integer yes gpio pin red
physical-closed-red low / high yes low/high - gpio level that switches the color on
pin-green integer yes gpio pin green
physical-closed-green low / high yes low/high - gpio level that switches the color on
pin-blue integer yes gpio pin blue
physical-closed-blue low / high yes low/high - gpio level that switches the color on
active boolean yes if set to false, the driver is not loaded

type bluetooth

Key Type Required Description
name string yes name of driver
type bluetooth yes type of driver
adapter string bluetooth adapter (optional, default: hci0)
avrcp player / input how the buttons of the headset arrive (optional, default: player) - player: BlueZ calls the media player the box registers; input: BlueZ passes them to the linux input device ' (AVRCP)' (the user needs the group input)
play-pause-toggle boolean play and pause of the headset both switch between play and pause (optional, default: false) - for headsets that send the same button for both
active boolean yes if set to false, the driver is not loaded