Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement librespot credential caching #13

Open
ironcrafter54 opened this issue Sep 28, 2024 · 3 comments
Open

Implement librespot credential caching #13

ironcrafter54 opened this issue Sep 28, 2024 · 3 comments

Comments

@ironcrafter54
Copy link

Currently if you restart the container the cached librespot credentials will not be stored, if implementation/documentation on how to properly make these cached credentials persistent that would be great. This is what the librespot readme says about this:
Usage
A sample program implementing a headless Spotify Connect receiver is provided. Once you've built librespot, run it using :

target/release/librespot --name DEVICENAME
The above is a minimal example. Here is a more fully fledged one:

target/release/librespot -n "Librespot" -b 320 -c ./cache --enable-volume-normalisation --initial-volume 75 --device-type avr
The above command will create a receiver named Librespot, with bitrate set to 320 kbps, initial volume at 75%, with volume normalisation enabled, and the device displayed in the app as an Audio/Video Receiver. A folder named cache will be created/used in the current directory, and be used to cache audio data and credentials.

A full list of runtime options is available here.

Please Note: When using the cache feature, an authentication blob is stored for your account in the cache directory. For security purposes, we recommend that you set directory permissions on the cache directory to 700.

@sweisgerber
Copy link
Owner

This configuration can get done in snapserver.conf.

My image starts snapserver with: /usr/bin/snapserver --config /config/snapserver.conf $SNAPSERVER_OPTS

This file should be accessible in your mounted config folder, if you used

- /<path>/<to>/<snapcast>/config/:/config/

as a template.

Simply configure your desired params as documented here: https://github.com/badaix/snapcast/blob/develop/doc/configuration.md#librespot, e.g. by placing them in -c ./config/librespot-cache

It's all in a snapcast source = ... line

@sweisgerber
Copy link
Owner

https://github.com/sweisgerber/docker-snapcast/blob/main/root/defaults/snapserver.conf
gets copied to /config/snapserver.conf on container first-boot.

@ironcrafter54
Copy link
Author

Thanks I will try to set this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants