Users, access and backups¶
5. Users and access¶
5.1 Users from the command line¶
On the page an admin adds and removes users and sets passwords (manual, section 11). On the box, as the user of the box:
tinyjukebox-users -f /srv/tinyjukebox/ssl/users.yaml list
tinyjukebox-users -f /srv/tinyjukebox/ssl/users.yaml add NAME --role admin
tinyjukebox-users -f /srv/tinyjukebox/ssl/users.yaml passwd NAME
tinyjukebox-users -f /srv/tinyjukebox/ssl/users.yaml role NAME admin
tinyjukebox-users -f /srv/tinyjukebox/ssl/users.yaml remove NAME
- Only here can a role be changed. The command removes neither the last admin nor makes them a
user. - A change takes effect at once, without a restart. A new password ends the other sessions of that user.
- For a library on a PC the file is
ssl/users.yamlin its folder. In Docker the image runs the command, with the volume of the library:docker run --rm -v library:/data ghcr.io/tgd1975/tinyjukebox tinyjukebox-users -f /data/ssl/users.yaml list. - The package on the NAS has no command
tinyjukebox-users: the call with the Python of the package is in operations.md, section 4.
5.2 A forgotten password¶
- Another admin sets a new password on the page, tab "System", section "Users".
- If no admin knows a password any more: log in on the box with SSH.
tinyjukebox-users -f /srv/tinyjukebox/ssl/users.yaml passwd admin– it asks for the new password twice.- Log in on the page with it.
5.3 SSH¶
The box is reached with ssh <user>@<hostname>.local, as the Imager set it up. If the name is not found, the address
of the box in the router helps. A card that was written anew has a new key: if the PC still knows the old one,
SSH refuses until the old entry is removed with ssh-keygen -R <hostname>.local.
5.4 The certificate of the page¶
Box and library make their own certificate, at their first start. The browser warns about it the first time.
- Compare the fingerprint the browser shows with the one in the log: the box writes it when the page starts
(
rest api listening on … fingerprint), the library into its log as well. - Or import the certificate of the box as trusted:
/srv/tinyjukebox/ssl/tinyjukebox.crt. - The commands on the PC,
tinyjukebox-backupandtinyjukebox-fill-library, show the fingerprint too and ask before they go on.
6. Data and backups¶
6.1 What a backup holds¶
A backup is one file with the data of a box or of the library, made while it runs:
- a box: tags, albums, stations and entries of Spotify, progress, volume limits and the covers
- the library: the catalog, the progress and settings of every box, the statistics, the states of the versions and the covers
- with "MP3s" also the albums – the file is then as large as all albums together
A box with a library needs no backup of its own: the library has everything, and a box that is set up again fetches it from there.
6.2 Making backups¶
| Way | Box | Library |
|---|---|---|
| page, tab "System", card "Backup" | "Download backup", "Download backup with MP3s" | the same |
| page, "Back up regularly" | a box without a library, into /srv/tinyjukebox/backups |
into the shared folder tinyjukebox on the NAS, which Hyper Backup includes |
| command on the PC | tinyjukebox-backup https://tinyjukebox.local --user admin [--albums] [FOLDER] |
tinyjukebox-backup https://<nas>:8866 --user admin [--albums] [FOLDER] |
Two schedules, one without and one with the albums, with their folder and how many are kept: manual, section 11.2. The backups of a box lie on its SD card: against a broken card only a backup helps that was fetched from it.
6.3 Putting a backup back¶
On the page, tab "System", card "Backup", "Put a backup back" – or tinyjukebox-backup … --restore FILE on the PC.
The page asks once, then the box or the library starts again with the data of the backup
(manual, section 11.3).
- A backup without the albums leaves the albums folder alone. Albums the data names but whose folder is missing are listed after the restore.
- On a box with a library the library wins at the next synchronization. A restore is meant for a box without a library and for the library.
- The library on another NAS, or by hand without the program: operations.md, section 10.3.
6.4 What no backup holds¶
- users, passwords, the certificate, tokens – in the library also
settings.jsonwith the bootstrap password - the key of the box and its link to the library
- the key, the player and the login of Spotify: the key is pasted again, the box fetches the player again and is connected again ("Connect")
- the config file