diff --git a/.env.example b/.env.example index 618199d..8f91446 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,9 @@ ICECAST_PORT=8000 ICECAST_SOURCE_PASSWORD=ASourcePassword ICECAST_ADMIN_PASSWORD=AnAdminPassword +ICECAST_RELAY_PASSWORD=APasswordForRelaysIGuess +ICECAST_HOSTNAME=localhost STREAM_NAME=Radio STREAM_DESC=Our selection of music -STREAM_URL=https://google.com \ No newline at end of file +STREAM_URL=https://google.com +STREAM_MOUNTPOINT=live diff --git a/README.md b/README.md index 264d6cb..97b0e88 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,19 @@ ## Install - Copy `.env.example` to `.env` and edit it - Put music inside `music/` -- Run `docker-compose up -d --build` +- Run `docker-compose up -d` - Listen to `http://localhost:8000/live` (if you changed `ICECAST_PORT`, edit the port in the URL) ## Config -Everything is set in the `.env` file (or your shell environment). -All settings are optional but please set the two passwords or it will stay to the default, `hackme`. +Everything is set in the `.env` file (or in your shell environment). +All settings are optional but please set the passwords or they will stay to the default, `hackme`. - `ICECAST_PORT`: The port to bind Icecast in the open. - `ICECAST_SOURCE_PASSWORD`: The password to stream audio to Icecast. - `ICECAST_ADMIN_PASSWORD`: The password for Icecast's administration. +- `ICECAST_RELAY_PASSWORD`: The password for Icecast's relays. +- `ICECAST_HOSTNAME`: The hostname of your Icecast installation. - `STREAM_NAME`: A title for your stream. - `STREAM_DESC`: A description for your stream. - `STREAM_URL`: A URL (like your website) to show on the stream details. +- `STREAM_MOUNTPOINT`: The name of the mountpoint that Liquidsoap will use. diff --git a/docker-compose.yml b/docker-compose.yml index 9f66f09..c89db4e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,8 @@ services: environment: - ICECAST_SOURCE_PASSWORD - ICECAST_ADMIN_PASSWORD + - ICECAST_RELAY_PASSWORD + - ICECAST_HOSTNAME liquidsoap: image: "phasecorex/liquidsoap" @@ -17,8 +19,9 @@ services: - STREAM_NAME - STREAM_DESC - STREAM_URL + - STREAM_MOUNTPOINT depends_on: - icecast volumes: - ./music:/music:ro - - ./script.liq:/script.liq:ro \ No newline at end of file + - ./script.liq:/script.liq:ro diff --git a/script.liq b/script.liq index a987e1d..8195ca1 100644 --- a/script.liq +++ b/script.liq @@ -8,6 +8,9 @@ end if getenv("STREAM_DESC") == "" then setenv("STREAM_DESC", "Our selection of music") end +if getenv("STREAM_MOUNTPOINT") == "" then + setenv("STREAM_MOUNTPOINT", "live") +end # Playlist i_playlist = normalize( @@ -37,9 +40,10 @@ output.icecast( name = getenv("STREAM_NAME"), description = getenv("STREAM_DESC"), url = getenv("STREAM_URL"), - mount = "live", + mount = getenv("STREAM_MOUNTPOINT"), password = getenv("ICECAST_SOURCE_PASSWORD"), host = "icecast", port = 8000, + encoding = "UTF-8", radio -) \ No newline at end of file +)