commit 654f3b26c2073f167dc88546e1b78a4f7038737f Author: Sean Clarke Date: Wed Oct 6 00:15:32 2021 -0400 initial push diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3c7d574 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu:latest +LABEL maintainer "me@seanland.ca" + +RUN apt-get -y update; \ + apt-get -y upgrade; \ + apt-get install -y ices2 icecast2 sudo; \ + apt-get clean; + +COPY ./ices.xml /ices.xml +COPY ./start-icecast.sh /start-icecast.sh +COPY ./start-ices.sh /start-ices.sh + +ADD ./etc /etc + +EXPOSE 8000 + +VOLUME ["/config"] + +CMD ["/start-icecast.sh"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..39db4b4 --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# One Container Radio +Using Ices2 and Icecast, the goal is to build a simple, single container deployment. One should be able to fill few parameters and direct the container to a music folder or share giving them a basic self hosted random music stream. (Reword) + +__ Note: Usernames / Passwords are defaulted currently. Change them if you decide to use this... + +__Warning: Work in progress, Docker experimenting. Please improve if you would like! Thanks :) __ + +## Usage ## +- Set the port +- Set the external share (only finds .oggs right now) +- Execute the command +- Navigate to 127.0.0.1:8080 +- Enjoy your music + +(Below is based on a local build) + +```bash +docker run -p 8080:8000 -v d:/music:/media -t docker-one-container-radio:latest +``` + +## To Do ## + - [] Update parameters for username and passwords + - [] Add Customizations + - [] Update Readme + - [] Add Parameters + - [] Build Docker Compose (other forms to deploy) + - [] Modify exposed volumes for log access / addition information + +## Influenced By: ## +The below repositories helped shape this repo; please check them out. +- https://github.com/moul/docker-icecast +- https://github.com/infiniteproject/icecast diff --git a/etc/icecast2/admin/listclients.xsl b/etc/icecast2/admin/listclients.xsl new file mode 100644 index 0000000..a945bc8 --- /dev/null +++ b/etc/icecast2/admin/listclients.xsl @@ -0,0 +1,95 @@ + + + + + + Icecast Streaming Media Server + + + + +

Icecast2 Admin

+ + + +

Listener Stats

+ +
+
+

Mountpoint

+
+ + + Login + + + + + +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + +
IPSec. connectedUser AgentAction
+ + + () + + Kick
+
+
+ +

No listeners connected

+
+
+
+
+
+ + + +
+
diff --git a/etc/icecast2/admin/listmounts.xsl b/etc/icecast2/admin/listmounts.xsl new file mode 100644 index 0000000..8e241e5 --- /dev/null +++ b/etc/icecast2/admin/listmounts.xsl @@ -0,0 +1,61 @@ + + + + + + Icecast Streaming Media Server + + + + +

Icecast2 Admin

+ + + +

Active Mountpoints

+ +
+
+

Mountpoint

+
+ + + Login + + + + + +
+
+ +
+
+ + + +
+
diff --git a/etc/icecast2/admin/manageauth.xsl b/etc/icecast2/admin/manageauth.xsl new file mode 100644 index 0000000..3f8b8d6 --- /dev/null +++ b/etc/icecast2/admin/manageauth.xsl @@ -0,0 +1,91 @@ + + + + + + Icecast Streaming Media Server + + + + +

Icecast2 Admin

+ + + +

Manage Authentication

+ +
+

Message

+ +
+
+
+
+ +
+

Mountpoint + + + +

+ + + + + + + + + + + + + + + + + + +
UserAction
+ + + Delete +
+
+
+
+ Add new user +

+ + +

+

+ + +

+ + + +
+
+
+
+ + + +
+
diff --git a/etc/icecast2/admin/moveclients.xsl b/etc/icecast2/admin/moveclients.xsl new file mode 100644 index 0000000..74b5de1 --- /dev/null +++ b/etc/icecast2/admin/moveclients.xsl @@ -0,0 +1,39 @@ + + + + + + Icecast Streaming Media Server + + + + +

Icecast2 Admin

+ + + + +

Moving listeners from

+
+

Move to which mountpoint?

+ +

+ Move from to
+ listeners
+ Move clients +

+
+
+ + + +
+
diff --git a/etc/icecast2/admin/response.xsl b/etc/icecast2/admin/response.xsl new file mode 100644 index 0000000..806e8b8 --- /dev/null +++ b/etc/icecast2/admin/response.xsl @@ -0,0 +1,35 @@ + + + + + + Icecast Streaming Media Server + + + + +

Icecast2 Admin

+ + + +

Icecast Server Response

+ +
+

Response

+

Message:

+

Return Code:

+
+
+ + + +
+
diff --git a/etc/icecast2/admin/stats.xsl b/etc/icecast2/admin/stats.xsl new file mode 100644 index 0000000..c2a399f --- /dev/null +++ b/etc/icecast2/admin/stats.xsl @@ -0,0 +1,100 @@ + + + + + + Icecast Streaming Media Server + + + + +

Icecast2 Admin

+ + + + +
+

Global Server Stats

+ + + + + + + + + + + + + +
+
+ + + + + +
+
+

Mountpoint

+
+ + + Login + + + + + +
+
+
+ + +
+ +
+
+ + + + + + + + + +
+
+
+
+
+ + + + +
+
diff --git a/etc/icecast2/admin/updatemetadata.xsl b/etc/icecast2/admin/updatemetadata.xsl new file mode 100644 index 0000000..416cc97 --- /dev/null +++ b/etc/icecast2/admin/updatemetadata.xsl @@ -0,0 +1,49 @@ + + + + + + Icecast Streaming Media Server + + + + +

Icecast2 Admin

+ + + +

Update Metadata

+ +
+

Mountpoint + + + +

+
+

+ + +

+

+ + + + +

+
+
+
+ + + +
+
diff --git a/etc/icecast2/admin/vclt.xsl b/etc/icecast2/admin/vclt.xsl new file mode 100644 index 0000000..c637717 --- /dev/null +++ b/etc/icecast2/admin/vclt.xsl @@ -0,0 +1,54 @@ + + + + + +STREAMURL= + +ARTIST= + +TITLE= + + +SERVER_NAME= + +DESCRIPTION= +SIGNALINFO= + + + codec:ogg_vorbis + + codec:ogg_general + + + + +GENRE= +== + + + diff --git a/etc/icecast2/admin/xspf.xsl b/etc/icecast2/admin/xspf.xsl new file mode 100644 index 0000000..d94f8fd --- /dev/null +++ b/etc/icecast2/admin/xspf.xsl @@ -0,0 +1,73 @@ + + + + + + + <xsl:value-of select="server" /> + + + + + + + + + + + +<xsl:value-of select="title" /> + + +Stream Title: + +Stream Description: +Content Type: + +Bitrate: + +Quality: + +Video Quality: + +Framesize: + +Framerate: + +Current Listeners: + +Peak Listeners: + +Stream Genre: + + + + + + + + + + + + diff --git a/etc/icecast2/icecast.xml b/etc/icecast2/icecast.xml new file mode 100644 index 0000000..0d94aba --- /dev/null +++ b/etc/icecast2/icecast.xml @@ -0,0 +1,244 @@ + + + Earth + your@email.com + + + + + 100 + 2 + 524288 + 30 + 15 + 10 + + 1 + + 65535 + + + + + password + + password + + + admin + password + + + + + + + + + localhost + + + + 8000 + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + /usr/share/icecast2 + + + /var/log/icecast2 + /usr/share/icecast2/web + /usr/share/icecast2/admin + + + + + + + + + + + access.log + error.log + + 3 + 10000 + + + + + + 0 + + + diff --git a/etc/icecast2/web/auth.xsl b/etc/icecast2/web/auth.xsl new file mode 100644 index 0000000..4c1a40c --- /dev/null +++ b/etc/icecast2/web/auth.xsl @@ -0,0 +1,59 @@ + + + + + + Icecast Streaming Media Server + + + + +

Icecast2 Status

+ + + +

Authorization Page

+ + + + +
+

+ Mount Point + + + +

+
+

+ + +

+

+ + +

+ + +
+
+
+
+ +

- Not Connected

+
+
+
+ + + +
+
diff --git a/etc/icecast2/web/server_version.xsl b/etc/icecast2/web/server_version.xsl new file mode 100644 index 0000000..b6ca046 --- /dev/null +++ b/etc/icecast2/web/server_version.xsl @@ -0,0 +1,73 @@ + + + + + + Icecast Streaming Media Server + + + + +

Server Information

+ + + + +
+

Server Information

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Location
Admin
Host
Version
Downloadicecast.org
Source codeicecast.org/download/#git
Documentationicecast.org/docs
Stream Directorydir.xiph.org
Communityicecast.org/contact
+
+ + + +
+
diff --git a/etc/icecast2/web/status-json.xsl b/etc/icecast2/web/status-json.xsl new file mode 100644 index 0000000..96dae5c --- /dev/null +++ b/etc/icecast2/web/status-json.xsl @@ -0,0 +1,24 @@ + + + + + + +true + + +"dummy":null} +"dummy":null} +"dummy":null} +"dummy":null} +"dummy":null} +"dummy":null} + + +"dummy":null} +"dummy":null} +"dummy":null} +"dummy":null} +"dummy":null} + + diff --git a/etc/icecast2/web/status.xsl b/etc/icecast2/web/status.xsl new file mode 100644 index 0000000..b4f51e2 --- /dev/null +++ b/etc/icecast2/web/status.xsl @@ -0,0 +1,167 @@ + + + + + + Icecast Streaming Media Server + + + + +

Icecast2 Status

+ + + + + <!-- WARNING: + DO NOT ATTEMPT TO PARSE ICECAST HTML OUTPUT! + The web interface may change completely between releases. + If you have a need for automatic processing of server data, + please read the appropriate documentation. Latest docs: + https://icecast.org/docs/icecast-latest/icecast2_stats.html + --> + + + + + +
+
+

Mount Point

+
+ + + Login + + + + + +
+
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Stream Name:
Stream Description:
Content Type:
Stream started:
Bitrate:
Quality:
Video Quality:
Framesize:
Framerate:
Listeners (current):
Listeners (peak):
Genre:
Stream URL: + +
Currently playing: + + - + + +
+
+
+
+ +

- Not Connected

+
+
+
+ + + +
+
diff --git a/etc/icecast2/web/style.css b/etc/icecast2/web/style.css new file mode 100644 index 0000000..fb6ed01 --- /dev/null +++ b/etc/icecast2/web/style.css @@ -0,0 +1,274 @@ +html { + margin: 0; + padding: 0; + background-color: #000; +} + +body { + padding: 0 25px 0 50px; + background-color: #000; + font-family: Verdana, sans-serif; + text-decoration: none; + color: #fff; +} + +a { + color: #f8ef64; + text-decoration: none; + border-bottom: 1px dotted #f8ef64; +} + +a:hover { + color: #f8ef64; + text-decoration: none; + border-bottom: 1px solid #f8ef64; +} + +h1 { + font-family: Verdana, sans-serif; + text-decoration: none; + font-weight: bold; + font-size: 3em; + color: #fff; + margin-top: 3px; +} + +h3 { + margin: 0px; + padding: 0px; + font-family: Verdana, sans-serif; + font-weight: bold; + font-size: 110%; + color: #f8ef64; +} + +h1#header{ + padding: 10px 0px 10px 80px; + background: transparent url(/icecast.png) no-repeat scroll left center; +} + +h3 small { + color: #fff; + font-size: 70%; + padding-left: 15px; +} + +form.alignedform label { + text-align: right; + display: inline-block; + vertical-align: middle; + width: 10em; + margin: 0 1em 0 0; +} + +form.alignedform input { + display: inline-block; + vertical-align: middle; + border: 1px solid #f8ef64; + background-color: #333; + color: #f8ef64; + padding: 5px; +} + +#menu { + border-top: 3px solid #7B96C6; + border-bottom: 3px solid #7B96C6; + text-align: center; + margin-bottom: 35px; +} + +#menu ul { + margin: 0; + padding: 0; + list-style: none; + display: inline-block; + vertical-align: middle; +} + +#menu ul li { + float: left; + padding-left: 25px; + padding-right: 25px; +} + +#menu ul li a { + font-family: Verdana, sans-serif; + text-decoration: none; + color: #fff; + font-size: 18px; + border: none; +} + +#menu ul li a:hover { + color: #f8ef64; +} + +.roundbox { + width: 90%; + background-color: #656565; + border-radius: 10px; + padding: 15px 20px; + margin-bottom: 35px; +} + +.roundbox h3 { + margin-bottom: 10px; + border-bottom: 1px groove #ACACAC; +} + +.roundbox table.yellowkeys tr td:last-child { + color: #f8ef64; +} + +table.colortable { + border-collapse: collapse; + padding: 20px 0 20px 0; + margin: 0 auto; +} + +table.colortable td { + border: 1px solid #000; + text-align: center; + padding: 5px; +} + +table.colortable thead tr td { + color: #656565; + background: #f8ef64; + border-color: white; +} + +.roundbox table.yellowkeys tr td { + padding: 5px 5px 0 0; + word-wrap: break-word; + word-break: break-all; +} + +.right { + float: right; +} + +.mounthead h3 { + float: left; + margin-bottom: 0px; + border-bottom: none; +} + +.mountcont { + border-top: 1px groove #ACACAC; + clear: both; +} + +ul.mountlist { + margin: 0; + padding: 0; + list-style: none; + text-align: right; +} + +.mountlist li { + display: inline; +} + +a.play { + padding-left: 22px; + margin-left: 25px; + border: none; + background: transparent url(/tunein.png) no-repeat scroll left center; + background-size: auto 100%; +} + +a.auth { + padding-left: 22px; + margin-left: 25px; + border: none; + background: transparent url(/key.png) no-repeat scroll left top; + background-size: auto 100%; +} + +/* Admin navigation */ + +ul.nav { + margin: 0; + padding: 5px 0 10px 0; + clear: both; + list-style: none; + text-align: center; +} + +ul.nav li { + display: inline; +} + +ul.nav li a { + border: none; + display: inline-block; + padding: .2em .7em; + margin-top: .2em; + background-color: #333; + white-space: nowrap; +} + +ul.nav li a:hover { + color: #fff; +} + +/* Footer */ + +#footer { + border-top: 1px groove #ACACAC; + margin-top: 20px; + font-size: 80%; +} + +@media (max-width: 800px) { + + body { + padding: 0; + } + + .roundbox { + width: auto; + border-radius: 0; + } + + .roundbox table.yellowkeys tr td { + display: block; + padding: 5px 5px 0 0; + } + + .roundbox table.yellowkeys tr td:last-child { + margin-bottom: 5px; + margin-left: 5px; + } + + .scrolltable { + overflow: auto; + } + +} + +@media (max-width: 320px) { + + ul.nav, #menu ul { + display: block; + } + + ul.nav li, #menu ul li { + float: none; + } + + ul.nav li a, #menu ul li a { + display: block; + } + + ul.nav li + li, #menu ul li + li { + border-top: 1px solid #ACACAC; + } + + a.play { + margin-left: 15px; + } + +} + diff --git a/ices.xml b/ices.xml new file mode 100644 index 0000000..aab3b86 --- /dev/null +++ b/ices.xml @@ -0,0 +1,100 @@ + + + + 0 + + /var/log/ices + ices.log + + 1 + + 0 + + + + + + + + One Container Radio + Your Music + You are playing your music with one deployed container! + + + + + + playlist + basic + playlist.txt + + 1 + + 0 + + 0 + + + + + + localhost + 8000 + password + /radio.ogg + + 2 + 5 + + + 80 + + + + 64000 + 44100 + 2 + + + + + diff --git a/start-icecast.sh b/start-icecast.sh new file mode 100644 index 0000000..7a1b5d8 --- /dev/null +++ b/start-icecast.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo -Eu icecast2 icecast2 -n -c /etc/icecast2/icecast.xml & + +bash ./start-ices.sh diff --git a/start-ices.sh b/start-ices.sh new file mode 100644 index 0000000..38943f2 --- /dev/null +++ b/start-ices.sh @@ -0,0 +1,7 @@ +#!/bin/bash +sudo mkdir -p /var/log/ices +sudo touch /var/log/ices/ices.log + +find /media -type f -name "*.ogg" > /playlist.txt + +sudo ices2 /ices.xml