You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-47Lines changed: 26 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,8 +65,8 @@ The following tables reports all the currently supported environment variables.
65
65
66
66
VARIABLE|DEFAULT|NOTES
67
67
:---|:---|:---
68
-
SPOTIFY_USERNAME||Your Spotify username. Required only if you want to disable discovery.
69
-
SPOTIFY_PASSWORD||Your Spotify password. Required only if you want to disable discovery.
68
+
SPOTIFY_USERNAME||Your Spotify username. Required only if you want to disable discovery (DEPRECATED).
69
+
SPOTIFY_PASSWORD||Your Spotify password. Required only if you want to disable discovery (DEPRECATED).
70
70
BITRATE|160|Bitrate (kbps): `96`, `160`, `320`. Defaults to `160`.
71
71
BACKEND|alsa|Audio backend to use. Use `?` to list options. Currently possible values are `alsa` and `pulseaudio`.
72
72
INITIAL_VOLUME||Initial volume in % from 0-100. Default for softvol: `50`. For the `alsa` mixer: the current volume.
@@ -109,6 +109,7 @@ AUDIO_GID||Specifies the gid for the group `audio`, it is required if you want t
109
109
PARAMETER_PRIORITY||Where to look for a parameter first: `env` or `file`. For example, the `credentials.txt` file compared to `SPOTIFY_USERNAME` and `SPOTIFY_PASSWORD` environment variables. Defaults to `file`, meaning that each file is considered if it exists and if it contains the required values.
110
110
ONEVENT_COMMAND||Specifies the name of a user defined script/executable that will be executed whenever a player event occurs. User defined scripts must be mounted to the `/userscripts/` folder and be made executable via `chmod u+x`. Internally maps to the `--onevent` flag of `librespot`. More info about usage can be found in [librespot's player event handler](https://github.com/librespot-org/librespot/blob/dev/src/player_event_handler.rs).
111
111
ONEVENT_POST_ENDPOINT||Send a `POST` request with event data to the specified endpoint URL whenever a player event occurs. Request body is `json` encoded and contains all available fields specified by the [librespot's player event handler](https://github.com/librespot-org/librespot/blob/dev/src/player_event_handler.rs). Will be ignored if `ONEVENT_COMMAND` is set.
112
+
ENABLE_OAUTH||Set to `headless` to enable OAUTH authentication. You will need to run the container interactively the first time. Recommended to enable when caching is also enabled.
112
113
LOG_COMMAND_LINE||Set to `Y` or `y` to enable, `N` or `n` to disable. Defaults to `Y`.
113
114
114
115
### Volumes
@@ -134,6 +135,8 @@ SPOTIFY_USERNAME=myusername
134
135
SPOTIFY_PASSWORD=mypassword
135
136
```
136
137
138
+
Please note that username and password is deprecated as an authentication method in librespot.
139
+
137
140
##### Docker-compose in Alsa mode
138
141
139
142
With credentials:
@@ -143,9 +146,8 @@ With credentials:
143
146
version: "3"
144
147
145
148
services:
146
-
librespot-u12:
149
+
librespot:
147
150
image: giof71/librespot:latest
148
-
container_name: librespot-u12
149
151
devices:
150
152
- /dev/snd:/dev/snd
151
153
environment:
@@ -165,9 +167,8 @@ Discovery mode:
165
167
version: "3"
166
168
167
169
services:
168
-
librespot-u12:
170
+
librespot:
169
171
image: giof71/librespot:latest
170
-
container_name: librespot-u12
171
172
network_mode: host
172
173
devices:
173
174
- /dev/snd:/dev/snd
@@ -188,9 +189,8 @@ With credentials:
188
189
version: "3"
189
190
190
191
services:
191
-
librespot-pulse:
192
+
librespot:
192
193
image: giof71/librespot:latest
193
-
container_name: librespot-pulse
194
194
environment:
195
195
- SPOTIFY_USERNAME=${SPOTIFY_USERNAME}
196
196
- SPOTIFY_PASSWORD=${SPOTIFY_PASSWORD}
@@ -209,9 +209,8 @@ Discovery mode:
209
209
version: "3"
210
210
211
211
services:
212
-
librespot-pulse:
212
+
librespot:
213
213
image: giof71/librespot:latest
214
-
container_name: librespot-pulse
215
214
network_mode: host
216
215
environment:
217
216
- BACKEND=pulseaudio
@@ -226,25 +225,7 @@ services:
226
225
227
226
##### Docker run in Alsa mode
228
227
229
-
With credentials:
230
-
231
-
```text
232
-
docker run -d --name librespot \
233
-
--device /dev/snd \
234
-
-e DEVICE_NAME=kodi-living-pi4-tuner \
235
-
-e INITIAL_VOLUME=100 \
236
-
-e BACKEND=alsa \
237
-
-e DEVICE=hw:D10,0 \
238
-
-e FORMAT=S32 \
239
-
-e BITRATE=320 \
240
-
-e INITIAL_VOLUME=100 \
241
-
-e SPOTIFY_USERNAME=myusername \
242
-
-e SPOTIFY_PASSWORD=mypassword \
243
-
--restart unless-stopped \
244
-
giof71/librespot:latest
245
-
```
246
-
247
-
Discovery mode:
228
+
In discovery mode:
248
229
249
230
```text
250
231
docker run -d --name librespot \
@@ -269,22 +250,6 @@ Please note that with this DAC I had to specify S32 as the format. It would not
269
250
270
251
##### Docker run in PulseAudio mode
271
252
272
-
With credentials:
273
-
274
-
```text
275
-
docker run -d
276
-
-e PUID=1000 \
277
-
-e PGID=1000 \
278
-
-e BACKEND=pulseaudio \
279
-
-e BITRATE=320 \
280
-
-e SPOTIFY_USERNAME=myusername \
281
-
-e SPOTIFY_PASSWORD=mypassword \
282
-
-e DEVICE_NAME=librespot-pulse \
283
-
-v /run/user/1000/pulse:/run/user/1000/pulse \
284
-
--name librespot-pulse \
285
-
giof71/librespot:latest
286
-
```
287
-
288
253
Discovery mode:
289
254
290
255
```text
@@ -318,7 +283,20 @@ You can completely uninstall the service by running:
318
283
319
284
Of course, you might simply want run the Spotify binary client or the web player instead of this service, but this alternative will allow you to control the player on your desktop system from e.g. a smartphone or any Spotify client. And it will consume significantly less resources.
320
285
321
-
### Credentials file
286
+
### Running interactively
287
+
288
+
If you have set ENABLE_OAUTH to `headless`, you will need to run your docker-compose.yaml interactively the first time.
289
+
In order to do that, run your compose file using the following:
290
+
291
+
```text
292
+
docker-compose run librespot
293
+
```
294
+
295
+
assuming that `librespot` is the name of the service. Tune the command if needed.
296
+
This command will let you see the container logs. You will have to open your browser at the displayed link, authenticated with Spotify and authorize the device, then paste the redirect URL to the terminal.
297
+
After the first start, you can start the container as usual using `docker-compose up -d`.
298
+
299
+
### Credentials file (DEPRECATED)
322
300
323
301
Credentials can be stored on a separate file and mounted as `/user/config/credentials.txt`. The format is the same as the standard `.env` file.
324
302
By defaults, `SPOTIFY_USERNAME` and `SPOTIFY_PASSWORD` entries found in this file have the priority against the correspondent environment variables, unless you set the variable `PARAMETER_PRIORITY` to `env`.
@@ -328,7 +306,7 @@ By defaults, `SPOTIFY_USERNAME` and `SPOTIFY_PASSWORD` entries found in this fil
328
306
### Discovery
329
307
330
308
For discovery mode to work, you will need to specify `network_mode=host` on the compose file. Otherwise the player will not be discovered.
331
-
In this mode, you will not need to provide username and password, but OTOH any premium spotify user on your network will be able to use your Librespot Player.
309
+
In this mode, you will not need to provide username and password, but OTOH any premium spotify user on your network will be able to use your Librespot Player.
332
310
Please note that even in "discovery" mode, the premium account is always required for playback, but it would only not be required to provide the credentials to the container.
333
311
334
312
### Dependency on Raspotify
@@ -350,6 +328,7 @@ Just be careful to use the tag you have built.
350
328
351
329
Change Date|Major Changes
352
330
---|---
331
+
2024-11-22|Add support for OAUTH authentication (see [#96](https://github.com/GioF71/librespot-docker/issues/96))
353
332
2024-11-17|Fix docker warning (see [#94](https://github.com/GioF71/librespot-docker/issues/94))
354
333
2024-11-16|Add support for `-onevent` (see [#91](https://github.com/GioF71/librespot-docker/issues/91)), thanks to [@QuadratClown](https://github.com/QuadratClown)
0 commit comments