Skip to content

Commit

Permalink
Merge pull request #206 from kenellorando/5.0.1
Browse files Browse the repository at this point in the history
5.0.1 - Software Versioning
  • Loading branch information
kenellorando authored Oct 9, 2022
2 parents 707b678 + 74539e9 commit ff3db37
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 32 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ build-init:
docker buildx create --platform linux/arm/v7,linux/amd64 --use --name multiarch

build-cadence:
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag kenellorando/cadence:latest --file ./cadence/Dockerfile.multiarch ./cadence/
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag kenellorando/cadence:latest --tag kenellorando/cadence:$(VERSION) --file ./cadence/Dockerfile.multiarch ./cadence/

build-cadence_icecast2:
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag kenellorando/cadence_icecast2:latest ./cadence_icecast2/
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag kenellorando/cadence_icecast2:latest --tag kenellorando/cadence_icecast2:$(VERSION) --file ./cadence_icecast2/Dockerfile ./cadence_icecast2/

build-cadence_liquidsoap:
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag kenellorando/cadence_liquidsoap:latest ./cadence_liquidsoap/
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag kenellorando/cadence_liquidsoap:latest --tag kenellorando/cadence_liquidsoap:$(VERSION) --file ./cadence_liquidsoap/Dockerfile ./cadence_liquidsoap/

build-all: build-init build-cadence build-cadence_icecast2 build-cadence_liquidsoap
build-all: build-cadence build-cadence_icecast2 build-cadence_liquidsoap
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# CadenceRadio

**Cadence** is a fully-featured HTTP API web radio software suite.
**Cadence** is a fully-featured REST API web radio software suite.

It ships everything you need to start a web radio station, including:
- an API server (with search, request, now playing, artwork, and stream information functions)
It ships everything needed to run a web radio station, including:

- an API server with search, request, now playing, artwork, and stream information
- an interactive browser UI
- an autopopulating music-metadata database
- custom built-in _Icecast_ and _Liquidsoap_ integration

These features allow your audiences to interact with your web radio much like a call-in radio station. The project ships all components pre-configured to work with each each other so there is hardly any configuration to do.
These features allow your audiences to interact with your web radio much like a traditional call-in radio station. The project ships all components pre-configured to work with each each other so there is hardly any configuration to do.

To start your own instance of Cadence, set a target directory containing your music, set a few service passwords and hostnames, and you're good to go! Cadence has builds available for amd64 and armv7 systems. All components are containerized, and a Compose file will set the entire radio stack up in minutes.
To start your own instance of Cadence, set a target directory containing your music, set a few service passwords and hostnames, and you're good to go! All components have multi-architecture containers, and a Compose file will set the entire radio stack up in minutes.

**See a live demo on [cadenceradio.com](https://cadenceradio.com/)!**

Expand All @@ -26,6 +27,10 @@ To start your own instance of Cadence, set a target directory containing your mu

> **Warning**: The way this repo currently handles configuration involves adding passwords to files which you may accidentally commit, so be careful.
## Prerequisites
1. You must have Docker Compose installed.

## Installation
1. Edit the `cadence/config/cadence.env` file:
1. Set the `CSERVER_MUSIC_DIR` value to an absolute path of a directory on your local system which you want to play music. The target is not recursively searched. The default location is `/music/`.
2. Set the `CSERVER_REQRATELIMIT` to the number of seconds you wish to timeout users after they make song requests. Setting this value to `0` will disable rate limiting.
Expand All @@ -34,19 +39,21 @@ To start your own instance of Cadence, set a target directory containing your mu
2. Set the `<hostname>` value to the endpoint you expect your audience to connect to. Cadence uses this value to set the stream source in the UI. This can be a DNS name, an IP address, or leave it default `localhost` to run locally.
3. Configure the `cadence_liquidsoap/config/cadence.liq` file.
1. Change all instances of `hackme` to a new password.
4. `docker compose up`

Running `docker compose up` will start all Cadence services.
4. `docker compose up`.

- The UI is accessible by default at `localhost:8080`.
- The stream endpoint is accessible by default at `localhost:8000/cadence1`.
That's all. All Cadence services will start up linked with each other.

If you are developing and need to rebuild exactly what you have locally:
## Accessing Services
- The UI is accessible in a browser by default at `localhost:8080`.
- API server requests may sent to the `localhost:8080` path by default. See API Documentation below.
- The stream endpoint is accessible at `localhost:8000/cadence1` by default.

## Building the Stack Locally
If you are developing and need to rebuild all services exactly as you have locally:
1. `docker compose up --build`

# API Reference
See the `API` tab on https://cadenceradio.com for more details and request/response examples.
See [Cadence's GitHub Wiki for API Documentation](https://github.com/kenellorando/cadence/wiki/API-Reference) or the `API` tab on https://cadenceradio.com for complete details and request/response examples.

# Container Repositories
- https://hub.docker.com/r/kenellorando/cadence
Expand Down
8 changes: 7 additions & 1 deletion cadence/Dockerfile.multiarch
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ LABEL maintainer="Ken Ellorando (kenellorando.com)"
LABEL source="github.com/kenellorando/cadence"
COPY --from=builder /cadence/public /cadence/server/public
COPY --from=builder /cadence-server /cadence/cadence-server

RUN useradd -s /bin/bash cadence
RUN touch /cadence/music-metadata.db
RUN chown cadence:cadence /cadence/ /cadence/* /cadence/cadence-server
RUN chmod u+wrx /cadence/ /cadence/*

EXPOSE 8080
# TODO: use non-root user
USER cadence
CMD [ "/cadence/cadence-server" ]
2 changes: 1 addition & 1 deletion cadence/config/cadence.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CSERVER_REQRATELIMIT=180
# If you are running Cadence through Docker simply as a user,
# you are unlikely to ever need to change anything below.

CSERVER_VERSION=5.0.0
CSERVER_VERSION=5.0.1
CSERVER_LOGLEVEL=4
CSERVER_SOURCEADDRESS=liquidsoap:1234
CSERVER_SOURCEPORT=
Expand Down
21 changes: 9 additions & 12 deletions cadence/server/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@

<div id="tab-content">
<section data-content="about" class="content is-active">
<p><b>Cadence</b> is a fully-featured HTTP API web radio software suite.</p>
<p>It ships everything you need to run an internet radio station, including:</p>
<p><b>Cadence</b> is a fully-featured REST API web radio software suite. </p>
<p>It ships everything you need to run an web radio station, including:</p>
<ul>
<li>... an API server providing music search, request, now playing, artwork, and stream information functions.</li>
<li>... an API server with search, request, now playing, artwork, and stream information.</li>
<li>... an interactive browser UI.</li>
<li>... an auto-populating music metadata database.</li>
<li>... custom built-in <i>Icecast</i> and <i>Liquidsoap</i> integration.</li>
<li>... containerization of all components (this demo even runs on a Kubernetes cluster).</li>
</ul>
<p>To configure Cadence, set a music directory (with some music files inside it), set a few service passwords and hostnames, and you're good to go! Cadence has releases for amd64 and armv7. A Compose file will build the entire radio stack for you in minutes. Leave a star on <a href="https://github.com/kenellorando/cadence">GitHub</a>!</p>

<p>These features allow your audiences to interact with your web radio much like a traditional call-in radio station. The project ships all components pre-configured to work with each each other so there is hardly any configuration to do.</p>

<p>To start your own instance of Cadence, set a target directory containing your music, set a few service passwords and hostnames, and you're good to go! All components have multi-architecture containers, and a Compose file will set the entire radio stack up in minutes. Leave a star on <a href="https://github.com/kenellorando/cadence">GitHub</a>!</p>
</section>
<section data-content="request" class="content">
<p>Submit a song request to enter the play queue.</p>
Expand Down Expand Up @@ -197,13 +197,10 @@ <h2 class="title is-3"><span class="tag is-success block">GET</span> <code>/api/
</pre>
</section>
</div>
<footer>
<figure class="image">
<img src="/static/cadence.png">
</figure>
<div>Cadence Radio Version: <span id="release">-</span></div>
<footer>
<div>Cadence Radio <span id="release">-</span></div>
<div>
<a href="https://github.com/kenellorando/cadence">GitHub</a> 👨‍💻 <a href="https://kenellorando.com">Ken Ellorando</a>
<a href="https://github.com/kenellorando/cadence">GitHub</a>
</div>
</footer>
</body>
Expand Down
Binary file removed cadence/server/public/static/cadence.png
Binary file not shown.
2 changes: 1 addition & 1 deletion cadence_icecast2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG ARCH=
FROM ${ARCH}alpine:3.14
LABEL maintainer="Ken Ellorando (kenellorando.com)"
LABEL source="github.com/kenellorando/cadence"
RUN apk update && apk add icecast
RUN apk update && apk add icecast=2.4.4-r5
EXPOSE 8000
USER icecast
CMD [ "icecast", "-c", "/etc/icecast/cadence.xml" ]
2 changes: 1 addition & 1 deletion cadence_liquidsoap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN ln -s /usr/bin/dpkg-split /usr/sbin/dpkg-split && \
ln -s /bin/tar /usr/sbin/tar

RUN apt update
RUN apt install liquidsoap -y
RUN apt install liquidsoap=1.4.3-3 -y
RUN apt clean
EXPOSE 1234
USER liquidsoap
Expand Down

0 comments on commit ff3db37

Please sign in to comment.