1#!/usr/bin/liquidsoap
2# Allow root for official docker image
3set("init.allow_root", true)
4
5# Set environments if empty
6if getenv("ICECAST_SOURCE_PASSWORD") == "" then
7 setenv("ICECAST_SOURCE_PASSWORD", "hackme")
8end
9if getenv("STREAM_NAME") == "" then
10 setenv("STREAM_NAME", "Radio")
11end
12if getenv("STREAM_DESC") == "" then
13 setenv("STREAM_DESC", "Our selection of music")
14end
15if getenv("STREAM_MOUNTPOINT") == "" then
16 setenv("STREAM_MOUNTPOINT", "live")
17end
18
19# Playlist
20i_playlist = normalize(
21 playlist(
22 id="playlist",
23 mode="random",
24 reload=600,
25 "/music"
26 )
27)
28
29# Silence
30i_silence = blank(id="blank")
31
32# Fallback to Silence if Playlist dies for some reason
33radio = fallback(
34 track_sensitive=false,
35 [ i_playlist, i_silence ]
36)
37
38# Output
39output.icecast(
40 %mp3(
41 bitrate=128,
42 id3v2=true
43 ),
44 name = getenv("STREAM_NAME"),
45 description = getenv("STREAM_DESC"),
46 url = getenv("STREAM_URL"),
47 mount = getenv("STREAM_MOUNTPOINT"),
48 password = getenv("ICECAST_SOURCE_PASSWORD"),
49 host = "icecast",
50 port = 8000,
51 encoding = "UTF-8",
52 radio
53)