Overview

Click here to have a look at the online demo. It is showing dummy statistics, simulating what the Icecast 2 system information looks like, without actually contacting an Icecast 2 server.

Corecast is a completely open source, LAMP-based user interface for managing an instance of the Icecast 2 streaming media server. Built atop the CakePHP framework, it is the first stage of a three-stage project I’ve taken up for myself in my available time, to provide a comprehensive user interface not only for the Icecast 2 streaming server, but also for the Ices 2 source server, the addition of which represents stage two of the project. The third and final stage will be the integration of the source server and streaming server with a database backend, program management and scheduling, using cron and scripts. The end result will be a fully open source radio station for GNU/Linux, and automation that makes third-party services like AutoDJ unnecessary.

Essentially, Corecast strives to encapsulate the actual and the the implied functionality associated with the Icecast 2 streaming server. That is to say, the Icecast 2 configuration allows for IP-based access control lists, the ability to use secure sockets, and certain logging parameters, but the Icecast 2 server itself does not provide a comprehensive suite of tools for browsing logs or actually using access control lists, for example. Corecast seeks to fill in all of the gaps, without adding anything beyond that, for simplicity’s sake. Corecast does not use a database. It uses the file system directly, and sends signals to the Icecast 2 server process using the command-line. It also uses the Icecast 2 admin interface remotely over HTTP/S, completely obsoleting the actual Icecast 2 administrative and public web interfaces.

 

What is the current status of the Corecast project?

I’m so glad you asked. The alpha of the first stage of three is working. I want you to download it and figure out how to make it work on your GNU/Linux system, and I will meanwhile begin to create tutorials for installing and using Corecast. I am making the code available via a Github repository, which I am not terribly comfortable using, yet, simply for lack of practice.

I have not written enough tests. In fact, I have only written unit tests for the validators I wrote for my custom modeling package. However, I have tested the code extensively around the house, using different configurations and stress-testing, and the code is fairly reliable once the working parameters of configuration and permissions are established.

 

Features

  • Open Source: Corecast is built atop CakePHP 3.3, a PHP web application framework. The client code is based on the free and open source design template SB Admin 2, which is itself based on Bootstrap 3.3.7 and jQuery 3.1.1. 
  • Dashboard: All of the disparate bits of statistical information provided by the Icecast 2 server have been abstracted into more logical groupings, and redundancies have been removed. An hierarchical dashboard object is made available, which contains the abstracted and aggregated statistical data, making it easy to pass to the View layer or to another machine. The application also provides controls for starting and stopping the Icecast 2 server, and sending it the SIGHUP signal, whose use this application actually does not require. 
  • Configuration: The Icecast 2 server is very simple. You pass it a configuration represented in XML upon startup, and then it either works or it does not. The impetus of this project was an original determination to build a set of web forms to abstract away having to manually use markup. More people would use this tool if it were more accessible to people who are unfamiliar with these development technologies, was and is my rationale. So, Corecast includes inline documentation, explaining the meaning of each control, it validates the input data, and it always exports well-formed XML. An arbitrary number of configurations can be stored for later use, and any can be committed to the production configuration file, which is never manipulated directly. 
  • Logs: Icecast 2 makes it possible to save three log files, representing access, errors, and playlists. Corecast parses these files and presents them in a user-friendly format. At this time, the pagination solution is allowing me to browse an access log having over 35,000 entries without bogging down. 
  • Access Control Lists: Icecast 2 allows the optional use of lists of IP addresses that can be used either as a whitelist, or a blacklist, or both a whitelist and a blacklist. Corecast provides methods for adding IP addresses to, or removing them from, each list, as required. 
  • Stream Players: In addition to presenting the stream metadata, Corecast makes use of the embedded HTML5 audio player available in modern browsers, so that any stream can be monitored. 
  • Compatible Fallbacks: Icecast 2 allows the administrator to assign a fallback stream to any other given stream, while already in operation. Because Icecast 2 allows multiple streams to be made available to listeners at different sample rates and with one or two channels, Corecast scans each stream for samplerate and channel information, and produces a pre-screened list of compatible streams from which an administrator may confidently choose a fallback stream without worry of a catastrophic settings mismatch. 
  • Move Clients: Icecast 2 allows an administrator to move the listeners of one stream over to another stream, and Corecast provides controls for this purpose. 
  • Metadata: Icecast 2 allows an administrator to update the “Now Playing” field associated with any stream, and Corecast provides controls for this purpose. 
  • Internationalization: The client-side code is set up for translation, already. All that is necessary for Corecast to be translated into another language is a translator willing to do the work. 

 

Requirements

  • GNU/Linux: Although CakePHP applications run on any operating system which supports PHP 7 web applications, Corecast is developed specifically against the GNU/Linux platform to a significant degree, and it only makes sense, as it is an open source project aimed at the open source ecosystem. I have tested Corecast on openSUSE Leap 42.2, and on Ubuntu 16.04, and it works the same on both systems, with the caveat that the name of the Icecast 2 server binary is different on these two systems, requiring a small tweak in the underlying command code. On openSUSE, the binary is called icecast, whereas on Ubuntu it is called icecast2
  • Icecast 2.4.2: Corecast must run on the same machine as the Icecast 2 server instance it is meant to manage, and that works out nicely, still allowing you to run the Icecast 2 server on a headless GNU/Linux box while also providing you with a graphical UI. 
  • PHP 7: Strictly speaking, the Corecast code requires only PHP 5.6 or better, but the CakePHP 3.3 framework itself is developed against PHP 7. CakePHP 3.3 has its own requirements. At this time, it is also critical that PHP be configured to allow URLs to be passed to the file_get_contents() function.

 

Recommended

  • SSL: For all its elegant simplicity, the Icecast 2 server was not built with security in mind, necessarily, and the administrative calls to the server over HTTP are in plain text, including passwords. It is critically important therefore to use SSL where possible, both for the Icecast 2 server and for the Corecast instance. If you are running the streaming server on your home or office network, it may not matter much, but if your Icecast 2 server is reachable from the Web then the usernames and their corresponding passwords may as well be handed out on 3″x5″ index cards to passers-by on the street. While the optimal solution is to have a commercially-signed SSL certificate, a self-signed certificate is often equally useful, depending on the context. Corecast is configured to allow self-signed certificates to work for remote calls to the Icecast 2 server

 

How does one download Corecast?

Again, another great question. The code is (or shortly will be) available on Github at the following location: https://github.com/Applebiter/corecast.

 

Okay, Corecast is downloaded. How do I get it working?

Well, help is on the way. As soon as the code is up on Github, I will begin producing tutorials with screen grabs and code that can be copy-pasted, here on Applebiter.com.

Share this:

Introducing Corecast: A LAMP-based UI for the Icecast 2 streaming server
Tagged on:             

Leave a Reply