Skip to content
/ scastd Public

**scastd** is the original streaming audio cast daemon that predated the CastIt Win32 MFC application. It is a UNIX-compatible daemon for handling audio stream broadcast logistics, control, and metadata interfacing.

License

GPL-2.0 and 2 other licenses found

Licenses found

GPL-2.0
LICENSE.md
GPL-3.0
COPYING
GPL-2.0
COPYING.md
Notifications You must be signed in to change notification settings

davestj/scastd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

328 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
SCASTD Typing Banner
Header Banner

🚦 Build Status & Development Pipeline

Production Build Development Build Future Build

πŸ“Š Project Status & Compatibility

License Version Last Commit Contributors

🎡 Streaming Protocol Support

SHOUTcast v1 SHOUTcast v2 Icecast2 ICY Protocol

πŸ’Ύ Database Support

MySQL MariaDB PostgreSQL SQLite

πŸ—οΈ Platform Support

Linux Ubuntu Debian macOS

πŸ” Verify Downloads

Releases ship Debian .deb packages, a macOS .pkg installer, and a Homebrew formula (scastd.rb). SHA256 checksums for all artifacts are provided in CHECKSUMS.txt. Verify package integrity before installation:

sha256sum -c CHECKSUMS.txt

macOS users can run:

shasum -a 256 -c CHECKSUMS.txt

🎯 What is SCASTD?

SCASTD (Statistical Casting Daemon) is a lightweight, high-performance statistics collection and analytics engine we designed specifically for streaming media infrastructure. Unlike traditional streaming servers, we built SCASTD to be the definitive monitoring solution that bridges legacy and modern streaming protocols, providing unified analytics across your entire streaming ecosystem.

Why We Built This

As DevSecOps professionals with over 20 years of combined experience in streaming media infrastructure, we consistently encountered the challenge of collecting unified statistics from diverse streaming server implementations. Traditional monitoring tools either focused on single protocols or provided basic metrics without the depth needed for professional streaming operations. That's why we created SCASTD - to provide:

/*
 * scastd_core.h - Statistical Collection Engine Architecture
 * Authors: oddsock, dstjohn (David St. John)
 * Created: Project inception
 * Purpose: We designed this daemon to efficiently collect statistics from multiple
 *          streaming protocols and provide unified analytics through modern APIs
 * 
 * Key Design Principles We Implemented:
 * - Protocol-agnostic statistics collection
 * - Real-time data aggregation and analysis
 * - Modern RESTful API with JSON/XML output
 * - Multi-database backend support for scalability
 * - Enterprise-grade logging and monitoring
 * - Security-first approach with authentication
 */

// We structured the daemon with these core capabilities:
typedef struct {
    char* target_servers[];      // We monitor multiple server types simultaneously
    int polling_intervals[];     // We configure collection frequency per server
    database_config_t backends; // We support multiple database backends
    api_config_t rest_api;      // We serve statistics via modern HTTP APIs
    logging_config_t logging;   // We provide comprehensive operational logging
    security_config_t auth;     // We implement token-based authentication
} scastd_engine_t;

✨ Core Features & Capabilities

πŸ”§ Statistics Collection Engine

Real-time Collection Multi-Protocol Historical Analysis Performance Metrics

🌐 API & Integration

RESTful API JSON/XML Output WebSocket Support Prometheus Compatible

πŸ”’ Security & Operations

JWT Authentication HTTPS/TLS Audit Logging Rate Limiting

What Makes SCASTD Unique

Based on our decades of experience with streaming infrastructure, we engineered SCASTD with these distinguishing characteristics that set it apart from traditional monitoring solutions:

Protocol Unification: We implement native support for SHOUTcast v1/v2, Icecast2, and legacy ICY protocols, providing a single interface to monitor heterogeneous streaming environments. This eliminates the need for multiple monitoring tools and provides consistent metrics across different server types.

Real-time Analytics Engine: We built a sophisticated statistics aggregation system that not only collects current metrics but also performs historical analysis, trend detection, and predictive analytics. This gives streaming operators the insights they need to optimize performance and plan capacity.

Enterprise Integration Ready: We designed SCASTD with modern DevOps practices in mind, providing native integration with Prometheus, Grafana, ELK stack, and other monitoring platforms. The RESTful API design ensures seamless integration with existing infrastructure monitoring systems.

Scalable Architecture: We implemented a multi-threaded collection engine with configurable polling intervals and database connection pooling, allowing SCASTD to monitor hundreds of streaming servers while maintaining low resource consumption.


πŸš€ Quick Start Guide

Understanding Our Development Workflow

Before diving into installation, it's important to understand how we structure our development process. We maintain three distinct branches that serve different purposes in our engineering pipeline:

  • master Branch: Our production-ready code that undergoes our ProductionBuildDeployment pipeline
  • dev Branch: Our active development branch running the DevelopmentBuildPipeline for integration testing
  • future Branch: Our experimental features branch using the FutureBuildPipeline for cutting-edge development

This three-tier approach allows us to maintain stability in production while continuously innovating and testing new features.

Prerequisites We Recommend

Before building SCASTD, we suggest ensuring your system has the necessary development tools and libraries. Based on our experience across different platforms, here's what you'll need:

πŸ“¦ Debian/Ubuntu Installation
# install_dependencies_debian.sh - Debian/Ubuntu dependency installation
# Authors: SCASTD Development Team
# Purpose: We streamline the build process on Debian-based systems

#!/bin/bash
# We always start with system updates to ensure package compatibility
sudo apt-get update && sudo apt-get install -y \
    build-essential \
    autoconf \
    automake \
    libtool \
    pkg-config \
    libxml2-dev \
    libcurl4-openssl-dev \
    libmysqlclient-dev \
    libpq-dev \
    libmicrohttpd-dev \
    libssl-dev \
    libyaml-dev

echo "βœ… All dependencies installed successfully"
echo "πŸš€ Ready to build SCASTD"
🍎 macOS arm64 Installation
# install_dependencies_macos.sh - macOS dependency installation  
# Authors: SCASTD Development Team
# Purpose: We optimize this for Apple Silicon Macs based on our development experience

#!/bin/bash
# We use Homebrew for consistent package management on macOS
brew update
brew install autoconf automake libtool pkg-config libxml2 curl mysql-client libpq libmicrohttpd libyaml

# We set PKG_CONFIG_PATH so the build system can locate all libraries
export PKG_CONFIG_PATH="/opt/homebrew/opt/libpq/lib/pkgconfig:/opt/homebrew/opt/mysql-client/lib/pkgconfig:/opt/homebrew/opt/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH"

echo "βœ… macOS dependencies installed"
echo "πŸ“ PKG_CONFIG_PATH configured for build"

Building SCASTD

We designed our build process to be straightforward while maintaining professional standards. Here's how to compile SCASTD from source:

# build_scastd.sh - Complete build script
# Authors: SCASTD Development Team
# Purpose: We provide this comprehensive build script for reliable compilation

#!/bin/bash
set -e  # We enable strict error handling

echo "πŸ”§ Generating build system files..."
# We generate the configure script and Makefiles using autotools
./autogen.sh

echo "πŸ” Configuring build with optimizations..."
# We configure with C++17 support and optimization flags
./configure CXXFLAGS='-std=c++17 -g -O2 -Wall -Werror'

echo "⚑ Building SCASTD..."
# We use parallel compilation to speed up the build process
make -j$(nproc)

echo "πŸ§ͺ Running test suite..."
# We always run tests to ensure build quality
make check

echo "βœ… Build completed successfully!"
echo "πŸ“ Binary location: ./src/scastd"

πŸ“₯ Installing Pre-built Packages

Debian/Ubuntu (.deb)

sudo dpkg -i scastd_<version>_amd64.deb
sudo apt-get install -f

macOS (.pkg installer)

sudo installer -pkg scastd-<version>.pkg -target /

macOS (Homebrew)

Release archives include a scastd.rb Homebrew formula. To test it locally:

brew install --formula ./scastd.rb
brew services start scastd

Once verified, install from the official tap:

brew tap davestj/scastd
brew install scastd

To update the formula later:

brew upgrade scastd

To remove it:

brew uninstall scastd

For details on creating the macOS package or Homebrew formula yourself, see packaging/macos/README.md.

πŸš€ Post-Installation Steps

Edit scastd.conf

  • Debian/Ubuntu: sudo nano /etc/scastd/scastd.conf
  • macOS (.pkg): sudo nano /usr/local/etc/scastd.conf
  • macOS (Homebrew): nano /opt/homebrew/etc/scastd.conf

Update absolute paths for databases and certificates as needed.

Start and verify the service

  • Debian/Ubuntu
sudo systemctl enable scastd
sudo systemctl start scastd
  • macOS (Homebrew)
brew services start scastd
  • macOS (.pkg)
sudo launchctl load -w /Library/LaunchDaemons/com.scastd.plist

Confirm the daemon responds:

curl http://localhost:8000/v1/status.json
curl http://localhost:8000/v1/status.xml

Expected responses:

{"status":"ok"}
<status>ok</status>

Troubleshooting tips if unreachable:

  • Check service state: sudo systemctl status scastd or brew services list
  • Ensure the configured port matches the curl command
  • Verify no firewall or other service blocks the port
  • Review logs in /var/log/scastd or with journalctl -u scastd

Explore command-line options

scastd --help
Usage: scastd [options]
  -h, --help           Show this help and exit
  -c, --config PATH    Configuration file
  -D, --daemon         Run as a daemon
      --pid-file PATH  PID file path (used with --daemon)
      --ip ADDRESS     Bind IP address
      --port PORT      HTTP server port
      --debug LEVEL    Debug level
      --poll INTERVAL  Poll interval (e.g., 60s, 5m)
      --test-mode      Validate configuration and exit
      --db-host HOST   Database host
      --db-port PORT   Database port
      --db-name NAME   Database name
      --db-user USER   Database user
      --db-pass PASS   Database password
      --sqlite-db PATH SQLite database file
      --setupdb TYPE   Initialize database of specified type
      --ssl-cert PATH  SSL certificate file
      --ssl-key PATH   SSL key file
      --ssl-enable     Enable SSL
      --dump           Dump database and exit
      --dump-dir DIR   Directory for database dump

Enable HTTPS mode

Run with certificate options:

scastd --ssl-enable \
       --ssl-cert /etc/letsencrypt/live/example.com/fullchain.pem \
       --ssl-key /etc/letsencrypt/live/example.com/privkey.pem

Or configure scastd.conf:

ssl_enable     true
ssl_cert       /etc/letsencrypt/live/example.com/fullchain.pem
ssl_key        /etc/letsencrypt/live/example.com/privkey.pem

On macOS the Homebrew prefix contains the certificates:

ssl_enable     true
ssl_cert       /usr/local/etc/letsencrypt/live/example.com/fullchain.pem
ssl_key        /usr/local/etc/letsencrypt/live/example.com/privkey.pem
# Use /opt/homebrew on AppleΒ Silicon

Test HTTP/HTTPS endpoints

curl http://localhost:8000/v1/status.json
curl http://localhost:8000/v1/status.xml
curl http://localhost:8000/v1/uptime
curl -k https://localhost:8000/v1/status.json
curl https://example.com:8000/v1/status.json

Obtain TLS certificates

Debian/Ubuntu

sudo certbot certonly --standalone -d example.com

macOS (Homebrew)

brew install certbot
sudo certbot certonly --standalone -d example.com

Certificates are placed under the Let's Encrypt directory for your platform:

Platform Certificate path
Debian/Ubuntu /etc/letsencrypt/live/example.com/
macOS (Intel) /usr/local/etc/letsencrypt/live/example.com/
macOS (Apple Silicon) /opt/homebrew/etc/letsencrypt/live/example.com/

Reference fullchain.pem and privkey.pem from that directory in scastd.conf and restart the daemon:

sudo systemctl restart scastd      # or reload
brew services restart scastd       # macOS

βš™οΈ Configuration Management

We designed SCASTD's configuration system to be both powerful and intuitive. The daemon supports multiple configuration methods to accommodate different deployment scenarios and security requirements.

Configuration Files We Support

SCASTD reads settings from configuration files that support environment variable overrides - a pattern we've found essential in containerized and cloud-native environments:

  • scastd.conf - Main configuration file with comprehensive settings
  • scastd_pg.conf - PostgreSQL-specific configuration example

Console logging is enabled by default when SCASTD runs in the foreground. Running with --daemon disables console output unless log_console true is set in the configuration. Set log_console false to silence console logs even in foreground mode.

Environment Variable Integration

We implement robust environment variable support for sensitive data and containerized deployments:

# Environment variables we recognize for secure configuration
export SCASTD_USERNAME="statistics_user"
export SCASTD_PASSWORD_FILE="/run/secrets/db_password"
export SCASTD_DATABASE_HOST="mysql-cluster.internal"
export SCASTD_API_TOKEN_SECRET="your-jwt-secret-here"
export ICEADMINUSER="admin"
export ICEUSERPASS="hackme"

These credentials configure access to the Icecast administrative interface. If ICEADMINUSER or ICEUSERPASS are not provided, the daemon falls back to the legacy SCASTD_ADMINUSER and SCASTD_USERPASS variables.

For detailed configuration instructions, please refer to our comprehensive Installation Guide.


πŸ”Œ API Reference & Integration

We designed SCASTD's HTTP API following RESTful principles with comprehensive authentication and rate limiting. The API serves statistics on port 8333 by default, with versioned endpoints to ensure backward compatibility.

Core API Endpoints We Provide

Our API offers several categories of endpoints designed for different use cases:

Statistics Collection Endpoints: Access real-time and historical streaming server metrics Health Monitoring Endpoints: Check daemon status and perform health verification Configuration Endpoints: Manage monitored servers and collection settings Export Endpoints: Generate reports in various formats (JSON, XML, CSV)

Integration Examples We Support

We provide ready-to-use integration examples for popular monitoring platforms:

  • Prometheus Integration: Native metrics export for Prometheus scraping
  • Grafana Dashboards: Pre-built dashboards for streaming analytics
  • ELK Stack Integration: Structured logging for Elasticsearch ingestion
  • Custom API Clients: Example implementations in Python, PHP, and Node.js

For complete API documentation and integration examples, see our API Documentation.


πŸ§ͺ Testing & Quality Assurance

We implement comprehensive testing to ensure SCASTD's reliability across different environments and use cases. Our testing strategy covers multiple layers from unit tests to full integration scenarios.

Test Categories We Maintain

Unit Tests: We test individual components and functions in isolation Integration Tests: We verify correct interaction between system components
Protocol Tests: We validate compatibility with different streaming server types Performance Tests: We benchmark performance under various load conditions Security Tests: We verify authentication, authorization, and data protection

Running Our Test Suite

# We provide a comprehensive testing framework
make check                    # Run all unit tests
./tests/integration_tests.sh  # Run integration test suite
./tests/performance_tests.sh  # Run performance benchmarks
./tests/security_tests.sh     # Run security validation tests

πŸ“Š Project Analytics & Community

πŸ“ˆ Project Statistics

GitHub Stars GitHub Forks GitHub Issues GitHub Pull Requests

πŸ“Š Development Activity

Development Activity

πŸ† Release Information

Latest Release Release Date Downloads


πŸ“š Documentation & Resources

We maintain comprehensive documentation to support different user needs and experience levels. Our documentation is organized into practical guides that build understanding progressively.

πŸ“– Core Documentation

Document Purpose Audience
Installation Guide Step-by-step setup instructions for all platforms System Administrators
Contributing Guide Development workflow and coding standards Developers
Change Log Version history and feature updates All Users
License Information Legal terms and GPL v2.0 details All Users
Authors & Credits Project contributors and acknowledgments Community
Release Notes Latest updates and announcements All Users

πŸ”§ Technical Documentation

Document Purpose Audience
Continuous Integration Build pipeline and automation details DevOps Engineers
CI Secrets Management Secure credential handling in pipelines DevOps Engineers
Database Migration Database setup and migration procedures Database Administrators
PostgreSQL Configuration PostgreSQL-specific setup and tuning Database Administrators
HTTPS Configuration SSL/TLS setup and certificate management System Administrators
Logging Configuration Log management and analysis setup Operations Teams
Resource Limits Performance tuning and resource management System Administrators
Packaging Guide Distribution and deployment packaging Release Engineers
Icecast2 Integration Specific Icecast2 monitoring setup Streaming Engineers

πŸ”¨ Configuration & Deployment

File Purpose Environment
scastd.conf Main configuration template Production/Development
scastd_pg.conf PostgreSQL-specific configuration PostgreSQL Environments
scastd.service Systemd service configuration Linux Systems
Agent Configuration Build agent and automation setup CI/CD Systems

🀝 Contributing to SCASTD

We welcome contributions from the streaming media and DevOps communities. Having maintained open source projects for over two decades, we believe in fostering collaborative development while maintaining high code quality standards.

How We Prefer Contributions

Our contribution process follows established DevSecOps best practices:

  1. Fork & Branch: We suggest forking the repository and working in feature branches based on our three-tier system
  2. Code Standards: We require adherence to our coding standards outlined in CONTRIBUTING.md
  3. Testing Requirements: We expect all contributions to include appropriate tests and documentation
  4. Security Review: We mandate security review for all code changes affecting authentication or data handling
  5. Documentation Updates: We require documentation updates for new features and API changes

Areas Where We Need Help

We actively seek contributions in these key areas:

  • Protocol Extensions: Expanding compatibility with additional streaming protocols and metadata formats
  • Monitoring Integrations: New exporters for monitoring systems like DataDog, New Relic, and CloudWatch
  • Database Backends: Additional database driver implementations and optimization
  • Performance Optimization: Improving collection efficiency and reducing resource consumption
  • Documentation: User guides, tutorials, and deployment examples for different environments
  • Testing: Expanding test coverage and adding performance benchmarks

πŸ”§ Deployment & Operations

Production Deployment Options

We provide several deployment options to accommodate different infrastructure requirements:

Containerized Deployment: Docker and Kubernetes configurations for cloud-native environments Traditional Installation: System packages and service configurations for bare-metal deployments Cloud Integration: Native integration examples for AWS, Azure, and Google Cloud Platform

Monitoring SCASTD Itself

As a monitoring tool, SCASTD includes comprehensive self-monitoring capabilities:

  • Health Endpoints: Built-in health checks for load balancers and monitoring systems
  • Metrics Export: Prometheus-compatible metrics about SCASTD's own performance
  • Audit Logging: Detailed logging of all API access and configuration changes
  • Performance Monitoring: Real-time visibility into collection performance and resource usage

For deployment guides and operational procedures, see our Installation Guide and Logging Documentation.


πŸ“ž Support & Community

πŸ› οΈ Technical Support

We provide support through multiple channels based on your needs:

GitHub Issues Email Support Project Website

πŸ’Ό Professional Services

DevSecOps Consulting Streaming Architecture Team Training

Community Resources

We maintain several community resources to support SCASTD users and contributors:

  • GitHub Discussions: Community Q&A, feature requests, and general discussion
  • Project Wiki: Extended documentation, tutorials, and community-contributed guides
  • Issue Tracking: Bug reports, feature requests, and development coordination
  • Release Notifications: Automated notifications for new releases and security updates

πŸ“ License & Legal

This project is licensed under the GNU General Public License v2.0. We chose this license to ensure SCASTD remains open source and benefits the entire streaming media community while protecting contributors' rights and maintaining compatibility with enterprise environments.

Copyright (C) 2025 oddsock, David St. John (dstjohn)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

For complete license terms, see LICENSE.md and COPYING.md.


πŸ”„ Development Roadmap

Current Release (v2.0.0)

We focus on core functionality and stability in our current release:

  • βœ… Multi-protocol statistics collection (SHOUTcast v1/v2, Icecast2, ICY)
  • βœ… RESTful API with JSON/XML output formats
  • βœ… Multi-database backend support (MySQL, MariaDB, PostgreSQL, SQLite)
  • βœ… Comprehensive logging and monitoring capabilities
  • βœ… JWT-based authentication and security features

Next Release (v2.1.0)

Our next release will focus on enhanced analytics and integration:

  • πŸ”§ Real-time WebSocket streaming of statistics
  • πŸ”§ Advanced analytics engine with trend analysis
  • πŸ”§ Native Prometheus metrics export
  • πŸ”§ Enhanced ICY2 protocol support
  • πŸ”§ Grafana dashboard templates

Future Releases (v3.0.0+)

Our long-term roadmap includes advanced features for enterprise deployments:

  • πŸ“‹ Machine learning-based anomaly detection
  • πŸ“‹ Multi-tenant support for service providers
  • πŸ“‹ Advanced reporting and alerting capabilities
  • πŸ“‹ Cloud-native scaling and orchestration
  • πŸ“‹ Enhanced security features and compliance tools

Footer

Created by oddsock & David St. John | DevSecOps Professionals | 20+ Years Streaming Infrastructure Experience

About

**scastd** is the original streaming audio cast daemon that predated the CastIt Win32 MFC application. It is a UNIX-compatible daemon for handling audio stream broadcast logistics, control, and metadata interfacing.

Resources

License

GPL-2.0 and 2 other licenses found

Licenses found

GPL-2.0
LICENSE.md
GPL-3.0
COPYING
GPL-2.0
COPYING.md

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •