### Install AzuraCast Development Environment Source: https://www.azuracast.com/docs/developers/getting-started Sets up the local development environment for AzuraCast using the provided Docker utility script. This script handles configuration file copying, repository cloning, and Docker installation if needed. The `make install` command is an alternative if Make is installed. ```shell cd AzuraCast bash docker.sh install-dev ``` ```shell # Alternatively, you can use `make install` if `make` is installed on your system ``` -------------------------------- ### Configure Environment Variables for Azuracast Installation Source: https://www.azuracast.com/docs/developers/getting-started Customize the `azuracast.env` file to set initial values for your Azuracast instance, such as base URL, instance name, and admin credentials. These 'fixtures' populate the database upon initial installation. Remove `INIT_` prefixed lines for a traditional post-installation setup. ```dotenv INIT_BASE_URL=http://azuracast.local INIT_INSTANCE_NAME="local development" INIT_ADMIN_EMAIL= INIT_ADMIN_PASSWORD= INIT_DEMO_API_KEY= INIT_ADMIN_API_KEY= INIT_MUSIC_PATH= INIT_PODCASTS_PATH= ``` -------------------------------- ### Update and Rebuild Azuracast Installation Source: https://www.azuracast.com/docs/developers/getting-started A convenience command that performs a full rebuild of Docker images, restarts services, and re-runs the setup process. Use this after significant changes to the Docker environment or for a clean re-initialization. ```makefile make update ``` -------------------------------- ### Download, Execute, and Install AzuraRelay Docker Script (Bash) Source: https://www.azuracast.com/docs/administration/azurarelay This sequence of bash commands downloads the AzuraRelay Docker utility script from GitHub, makes it executable, and then initiates the installation process. The script handles the setup of Docker and Docker Compose, simplifying the deployment. ```bash curl -L https://raw.githubusercontent.com/AzuraCast/AzuraRelay/main/docker.sh > docker.sh chmod a+x docker.sh ./docker.sh install ``` -------------------------------- ### Install AzuraCast with Docker Source: https://context7.com/context7/azuracast/llms.txt Installs AzuraCast using Docker on a Linux server. This process downloads a utility script, makes it executable, and then runs the installation, which prompts the user for setup details. It also installs Docker and Docker Compose if they are not already present. ```bash # Create base directory for AzuraCast mkdir -p /var/azuracast cd /var/azuracast # Download Docker utility script curl -fsSL https://raw.githubusercontent.com/AzuraCast/AzuraCast/main/docker.sh > docker.sh chmod a+x docker.sh # Run installation process ./docker.sh install # The installer will prompt you through the setup process # and automatically install Docker, Docker Compose, and AzuraCast ``` -------------------------------- ### Clone AzuraCast Core Repository Source: https://www.azuracast.com/docs/developers/getting-started Clones the main AzuraCast application repository from GitHub into your local development directory using Git. ```shell git clone https://github.com/AzuraCast/AzuraCast.git ``` -------------------------------- ### Download, Make Executable, and Run Docker Utility Script (Bash) Source: https://www.azuracast.com/docs/getting-started/installation/docker This sequence downloads the AzuraCast Docker utility script from GitHub, makes it executable, and then runs the installation command. This script automates the Docker and Docker Compose setup for AzuraCast. Ensure you have curl and a working internet connection. ```bash curl -fsSL https://raw.githubusercontent.com/AzuraCast/AzuraCast/main/docker.sh > docker.sh chmod a+x docker.sh ./docker.sh install ``` -------------------------------- ### Install AzuraCast using Docker Utility Script Source: https://www.azuracast.com/docs/administration/docker Installs AzuraCast by pulling the latest Docker images and setting up the database. This command initiates the full AzuraCast setup within a Docker environment. Requires the `docker.sh` script to be present and executable. ```shell ./docker.sh install ``` -------------------------------- ### Create AzuraRelay Directory and Navigate (Bash) Source: https://www.azuracast.com/docs/administration/azurarelay These bash commands create the recommended base directory for AzuraRelay and then navigate into it, preparing the environment for subsequent installation steps. This is a prerequisite for running the Docker utility script. ```bash mkdir -p /var/azurarelay cd /var/azurarelay ``` -------------------------------- ### Create AzuraCast Folder and Download Script Source: https://www.azuracast.com/docs/getting-started/installation/synology This sequence of commands creates the necessary directory structure for AzuraCast on a Synology NAS, typically within the Docker volume. It then downloads the official AzuraCast Docker setup script and makes it executable. This is a prerequisite for running the installation. ```bash mkdir -p /volume1/docker/azuracast cd /volume1/docker/azuracast curl -fsSL https://raw.githubusercontent.com/AzuraCast/AzuraCast/main/docker.sh > docker.sh chmod a+x docker.sh ``` -------------------------------- ### Unattended AzuraCast Installation with Docker Source: https://context7.com/context7/azuracast/llms.txt Automates the AzuraCast installation process using Docker, suitable for cloud-init scripts or CI/CD pipelines. It bypasses user prompts by pre-supplying input to the installation script. This method ensures a non-interactive setup. ```bash mkdir -p /var/azuracast cd /var/azuracast curl -fsSL https://raw.githubusercontent.com/AzuraCast/AzuraCast/main/docker.sh > docker.sh chmod a+x docker.sh # Optional: Switch to Stable release channel instead of Rolling Release # yes 'Y' | ./docker.sh setup-release # Run unattended installation yes '' | ./docker.sh install # Installation completes without user interaction # Access AzuraCast at http://your-server-ip ``` -------------------------------- ### Navigate to AzuraCast Directory Source: https://www.azuracast.com/docs/administration/multi-site-installation Changes the current directory to the AzuraCast installation path. This is the first step in configuring the multi-site setup. Assumes a standard installation path. ```shell cd /var/azuracast ``` -------------------------------- ### Generate Local SSL Certificate with mkcert Source: https://www.azuracast.com/docs/developers/getting-started Uses the `mkcert` tool to generate a local SSL certificate and key for the `azuracast.local` domain. This command should be run from the project root. After generation, Docker containers must be restarted for the new certificate to take effect. ```bash mkcert -cert-file util/local_ssl/azuracast.local.crt -key-file util/local_ssl/azuracast.local.key azuracast.local ``` -------------------------------- ### Configure AzuraCast Ports Source: https://www.azuracast.com/docs/getting-started/installation/synology This command executes the AzuraCast Docker setup script to configure the network ports that AzuraCast will use. It is important to run this before the main installation if you intend to use custom ports, especially if ports 80 and 443 are already in use by the Synology NAS. ```bash sudo ./docker.sh setup-ports ``` -------------------------------- ### Rebuild Docker Images for Azuracast Development Source: https://www.azuracast.com/docs/developers/getting-started Rebuilds the Docker images for Azuracast. This is necessary when making changes to the containers themselves or when they become out of sync with the repository. Typically followed by restarting the containers. ```bash docker-compose build ``` ```makefile make build ``` -------------------------------- ### Configure Git Line Endings for Windows Source: https://www.azuracast.com/docs/developers/getting-started Ensures Git does not automatically convert line endings from LF to CRLF, which can break AzuraCast on Windows. This configuration should be applied globally. ```shell git config --global core.autocrlf input ``` -------------------------------- ### Restart Azuracast Docker Containers Source: https://www.azuracast.com/docs/developers/getting-started Stops and then restarts the Azuracast Docker containers. This is usually performed after rebuilding Docker images or making significant configuration changes to ensure the new state is applied. ```bash docker-compose down docker-compose up -d ``` ```makefile make restart ``` -------------------------------- ### Install AzuraCast Source: https://www.azuracast.com/docs/getting-started/installation/synology This command initiates the installation of AzuraCast using the downloaded Docker script. It assumes that port configuration has been completed, and it will deploy the application using Docker Compose. AzuraCast should become accessible on the configured ports shortly after execution. ```bash sudo ./docker.sh install ``` -------------------------------- ### Troubleshoot Docker and Docker Compose Installation (Bash) Source: https://www.azuracast.com/docs/getting-started/installation/docker This snippet is used to resolve issues where the VPS provider's Docker or Docker Compose versions are incompatible with the AzuraCast installer. It forces a reinstallation of Docker and Docker Compose before attempting the main AzuraCast installation again. ```bash cd /var/azuracast ./docker.sh install-docker ./docker.sh install-docker-compose ./docker.sh install ``` -------------------------------- ### Automated AzuraCast Installation with Cloud-Init (Bash) Source: https://www.azuracast.com/docs/getting-started/installation/docker This set of commands is designed for unattended installation of AzuraCast, suitable for use in cloud-init scripts. It downloads the utility script and automates the installation process with default options, including the option to switch to a stable release channel. ```bash mkdir -p /var/azuracast cd /var/azuracast curl -fsSL https://raw.githubusercontent.com/AzuraCast/AzuraCast/main/docker.sh > docker.sh chmod a+x docker.sh # To install the "Stable" release channel instead of "Rolling Release", uncomment this line: # yes 'Y' | ./docker.sh setup-release yes '' | ./docker.sh install ``` -------------------------------- ### List Installed WSL2 Distributions Source: https://www.azuracast.com/docs/getting-started/installation/windows Displays a list of all installed WSL2 distributions on your Windows system. This helps identify the name of the distribution you want to set as default. ```bash wsl --list ``` -------------------------------- ### Create AzuraCast Directory and Navigate (Bash) Source: https://www.azuracast.com/docs/getting-started/installation/docker This snippet creates a directory named 'azuracast' in '/var' and then changes the current directory to it. This is a common first step in setting up AzuraCast on a Linux system. ```bash mkdir -p /var/azuracast cd /var/azuracast ``` -------------------------------- ### Setup Nginx Proxy Manager Directory Source: https://www.azuracast.com/docs/administration/multi-site-installation Creates a new directory for Nginx Proxy Manager and navigates into it. This is where the Nginx Proxy Manager's Docker configuration will reside. It also initializes the docker-compose.yml file. ```shell mkdir /var/proxy_manager cd /var/proxy_manager ``` -------------------------------- ### Start Docker Services Source: https://www.azuracast.com/docs/administration/multi-site-installation Restarts the Docker containers for AzuraCast in detached mode. This applies the configuration changes, including the modified web serving ports, and resumes broadcasting. ```shell docker-compose up -d ``` -------------------------------- ### Update AzuraRelay and Self (Bash) Source: https://www.azuracast.com/docs/administration/azurarelay These bash commands utilize the AzuraRelay Docker utility script to update both the script itself and the installed AzuraRelay application. This is the recommended method for keeping the AzuraRelay instance current. ```bash ./docker.sh update-self ./docker.sh update ``` -------------------------------- ### Set Default WSL2 Distribution Source: https://www.azuracast.com/docs/getting-started/installation/windows Sets a specific installed Linux distribution as the default for WSL2. Replace 'Ubuntu' with the actual name of your desired distribution if it differs. ```bash wsl --set-default Ubuntu ``` -------------------------------- ### Access Bash Shell Inside Azuracast Container Source: https://www.azuracast.com/docs/developers/getting-started Opens an interactive bash shell session inside the running Azuracast 'web' container. This is useful for inspecting the application's state, debugging, or manually modifying files within the containerized environment. ```bash bash docker.sh bash ``` ```makefile make bash ``` -------------------------------- ### Nginx Proxy Manager docker-compose.yml Source: https://www.azuracast.com/docs/administration/multi-site-installation Example docker-compose.yml file for setting up Nginx Proxy Manager. This file defines the services and configurations for running Nginx Proxy Manager within Docker, enabling it to act as a reverse proxy. ```yaml version: "3" services: proxy_manager: image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: - '80:80' - '443:443' - '81:81' volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt ``` -------------------------------- ### Download and Make Docker Utility Script Executable Source: https://www.azuracast.com/docs/administration/docker Downloads the `docker.sh` utility script from GitHub and makes it executable. This script simplifies common AzuraCast Docker management tasks. It requires `curl` and `chmod` commands. ```shell curl -L https://raw.githubusercontent.com/AzuraCast/AzuraCast/main/docker.sh > docker.sh chmod a+x docker.sh ``` -------------------------------- ### Set WSL2 as Default Version Source: https://www.azuracast.com/docs/getting-started/installation/windows Ensures that any new Linux distributions installed will use WSL version 2 by default. This command is executed in a Windows terminal. ```bash wsl --set-default-version 2 ``` -------------------------------- ### Update AzuraCast Docker Installation Source: https://www.azuracast.com/docs/getting-started/updates/release-channels These commands are used to update the AzuraCast Docker installation and switch release channels. Running './docker.sh setup-release' with 'N' as input will set the installation to the Rolling Release channel. After changing the channel, './docker.sh update' will apply the changes. ```shell cd /var/azuracast ./docker.sh update-self ./docker.sh setup-release ./docker.sh update ``` -------------------------------- ### Add Stream Intro File Configuration Source: https://www.azuracast.com/docs/administration/docker Adds a custom intro file that plays when a user initially connects to the stream. The intro file must match the stream's format, bitrate, and sample rate. Requires replacing the placeholder path and configuring the mount point in the AzuraCast web interface. ```yaml services: stations: volumes: - /path/to/your/file.mp3:/usr/local/share/icecast/web/intro.mp3 ``` ```xml /intro.mp3 ``` -------------------------------- ### Liquidsoap LADSPA Plugin Listing Command Source: https://www.azuracast.com/docs/developers/liquidsoap This command lists all available LADSPA plugins pre-installed with AzuraCast. It requires Docker to be installed and configured for AzuraCast. ```bash docker-compose exec --user=azuracast web liquidsoap --list-plugins ``` -------------------------------- ### Backup AzuraCast Files and Settings Source: https://www.azuracast.com/docs/administration/docker Creates a compressed archive (.tar.gz) containing station media, statistics, metrics, and the AzuraCast database. This backup can be used for restoration. An optional path for the backup file can be specified. ```shell ./docker.sh backup [/path/to/backup.tar.gz] ``` -------------------------------- ### Get User UID and GID Source: https://www.azuracast.com/docs/getting-started/installation/synology These commands retrieve the User ID (UID) and Group ID (GID) of the current user on the Synology NAS. This information is crucial for correctly configuring AzuraCast's Docker containers to match your user's permissions, preventing potential file access issues, especially when using custom media directories. ```bash id -u id -g ``` -------------------------------- ### Configure AzuraCast User Permissions Source: https://www.azuracast.com/docs/getting-started/installation/synology This involves editing the `.env` file within the AzuraCast installation directory to specify the correct `AZURACAST_PUID` (user ID) and `AZURACAST_PGID` (group ID). These values should be set to the UID and GID obtained from the `id -u` and `id -g` commands, ensuring that the Docker containers run with the appropriate user permissions. ```env AZURACAST_PUID=your_user_uid AZURACAST_PGID=your_user_gid ``` -------------------------------- ### Restart AzuraCast Docker Containers Source: https://www.azuracast.com/docs/getting-started/installation/synology After making changes to the Docker Compose override file or the `.env` file, these commands are used to stop and then restart the AzuraCast Docker containers. This ensures that the new configurations, including custom media directories and user permissions, are applied correctly. ```bash sudo docker-compose down sudo docker-compose up -d ``` -------------------------------- ### Invoking AzuraCast CLI (Docker Installation) Source: https://www.azuracast.com/docs/administration/command-line-interface This command shows how to invoke the AzuraCast CLI when using a Docker installation. It utilizes the `docker-compose run` command to execute the CLI within a container. ```bash docker-compose run --rm cli azuracast_cli [command] ``` -------------------------------- ### Restore AzuraCast Backup via Command Line Source: https://www.azuracast.com/docs/administration/backup-and-restore This command-line utility restores an AzuraCast installation from a backup file. It's crucial to perform this after an initial installation. Specific commands are provided for restoring and managing release channels (stable vs. rolling-release). Dependencies include the Docker Utility Tool. ```bash ./docker.sh restore path-to-backup.zip ``` ```bash ./docker.sh setup-release ``` ```bash ./docker.sh update ``` -------------------------------- ### Clear Azuracast System Cache (Ansible) Source: https://www.azuracast.com/docs/help/troubleshooting This command clears all site-wide caches for Azuracast installations managed with Ansible. It involves executing a console command via PHP on the server where Azuracast is installed. ```bash php /var/azuracast/www/bin/console cache:clear ``` -------------------------------- ### Styling AzuraCast Radio Player Elements (CSS) Source: https://www.azuracast.com/docs/administration/css Provides CSS examples for customizing various parts of the radio player on public pages. This includes changing the background color of the player card, styling the title and artist text, and modifying the play button. ```css # Styling the radio player [data-bs-theme] body.page-minimal .public-page .card { background-color: #5e0f16; } The CSS selector for the title of the player is as follows: [data-bs-theme] body.page-minimal .public-page .card .card-body .card-title { ... } The buttons at the bottom of the player can be styled with the following CSS selector: [data-bs-theme] body.page-minimal .public-page .card .card-actions .btn { ... } This example shows you how to change the text color of the title and artist: [data-bs-theme] body.page-minimal .public-page .card .now-playing-title { color: #fff; } [data-bs-theme] body.page-minimal .public-page .card .now-playing-artist { color: #fefefe; } This example shows you how to change the color of the play button: [data-bs-theme] body.page-minimal .public-page .card .radio-control-play-button a { color: #000; } ``` -------------------------------- ### Stop Docker Services Source: https://www.azuracast.com/docs/administration/multi-site-installation Shuts down all running Docker containers for AzuraCast. This is necessary to safely modify configuration files and prevent conflicts during the setup process. It will temporarily disconnect listeners. ```shell docker-compose down ``` -------------------------------- ### Invoking AzuraCast CLI (Ansible Installation) Source: https://www.azuracast.com/docs/administration/command-line-interface This command illustrates how to invoke the AzuraCast CLI for Ansible installations. It executes the console script located at `/var/azuracast/www/bin/console`. ```bash php /var/azuracast/www/bin/console [command] ``` -------------------------------- ### Fix Docker Compose Version Errors (Docker) Source: https://www.azuracast.com/docs/help/troubleshooting These commands resolve 'Invalid interpolation format' errors in Docker installations by updating the docker-compose version and then reinstalling Azuracast. This is necessary when using an outdated docker-compose version with Azuracast. ```bash ./docker.sh install-docker-compose ./docker.sh install ``` -------------------------------- ### Bash CLI Command to List User Accounts Source: https://context7.com/context7/azuracast/llms.txt Provides a bash command to display all user accounts configured within the Azuracast system. It navigates to the Azuracast directory and executes the CLI command to list accounts, showing their email, name, roles, and creation date. Includes an example output format. ```bash cd /var/azuracast ./docker.sh cli azuracast:account:list # Output example: # AzuraCast User Accounts # ======================= # # E-mail Address Name Roles Created # ------------------------------------------------------------------ # admin@example.com Admin Super Administrator 2024-01-15 10:30 # dj@example.com DJ Station Manager 2024-02-20 14:45 ``` -------------------------------- ### Mount Directory for Station Media Source: https://www.azuracast.com/docs/administration/docker Mounts a host directory into the AzuraCast station's media folder. This allows adding music without copying data into AzuraCast. Requires replacing placeholder paths and station names. Restart Docker containers to apply changes. ```yaml services: web: volumes: - /path/on/host/computer:/var/azuracast/stations//media/ ``` -------------------------------- ### Restore AzuraCast Files and Settings Source: https://www.azuracast.com/docs/administration/docker Restores AzuraCast from a backup file previously created by the `backup` command. This process extracts media, statistics, metrics, and the database from the specified .tar.gz file. Requires the `docker.sh` script and a valid backup file. ```shell ./docker.sh restore /path/to/backup.tar.gz ``` -------------------------------- ### Changing Public Page Background Image (CSS) Source: https://www.azuracast.com/docs/administration/css Shows how to modify the background image of public AzuraCast pages. The example illustrates overriding the default background with a custom image URL, applicable across different themes. ```css # See above for theme-specific prefixes [data-bs-theme] body.page-minimal { background: #edecec url(../img/hexbg.png); background-size: cover; background-attachment: fixed; } You can change the background image by using the same CSS selector and then just overwrite the `background` attribute like this: [data-bs-theme] body.page-minimal { background: url(https://example.com/my_custom_background_image.png); } ``` -------------------------------- ### Restore Azuracast from Backup via CLI Source: https://context7.com/context7/azuracast/llms.txt Restores an Azuracast instance from a backup file using the Docker utility script. This process involves installing Azuracast on a fresh server, running the restore command, and potentially switching to stable or updating to the latest release. The restore stops all services, imports data, restores configurations and media, and then restarts services. ```bash # 1. Install AzuraCast on fresh server mkdir -p /var/azuracast cd /var/azuracast curl -fsSL https://raw.githubusercontent.com/AzuraCast/AzuraCast/main/docker.sh > docker.sh chmod a+x docker.sh ./docker.sh install # 2. Run restore command ./docker.sh restore /path/to/backup.zip # 3. If using older backup, switch to stable first: ./docker.sh setup-release # Answer 'Y' to use stable version # 4. After restore, update to latest rolling release: ./docker.sh setup-release # Answer 'N' to use stable version ./docker.sh update ``` -------------------------------- ### Add User to Docker Group Source: https://www.azuracast.com/docs/getting-started/installation/synology This command adds a user to the 'docker' group on a Synology NAS. This action grants the user root-level access through Docker volumes, so it should only be performed if you are comfortable with this security implication. If not, 'sudo' must be prepended to subsequent commands. ```bash sudo synogroup --add docker username ``` -------------------------------- ### Clear Azuracast System Cache (Docker) Source: https://www.azuracast.com/docs/help/troubleshooting This command clears all site-wide caches for Azuracast installations managed with Docker, helping to resolve issues caused by outdated cache data. It's a single command-line script executed within the Docker environment. ```bash ./docker.sh cli cache:clear ``` -------------------------------- ### Run AzuraCast CLI Commands via Docker Utility Script Source: https://www.azuracast.com/docs/administration/docker Executes commands provided by the AzuraCast command-line interface through the `docker.sh` utility script. This allows for interaction with the AzuraCast application within its Docker environment. Usage: `./docker.sh cli [command_name]`. ```shell ./docker.sh cli [command_name] ``` -------------------------------- ### Specify Custom Media Directory for AzuraCast Source: https://www.azuracast.com/docs/getting-started/installation/synology This YAML configuration is used in a `docker-compose.override.yml` file to map a custom directory on your Synology NAS (e.g., `/volume2/azuracast_media`) to the media storage location within the AzuraCast Docker containers. This allows you to keep your media files separate from the main Docker volume. Ensure the station name in the path matches your station's name. ```yaml services: web: volumes: - /volume2/azuracast_media:/var/azuracast/stations/azuratest_radio/media stations: volumes: - /volume2/azuracast_media:/var/azuracast/stations/azuratest_radio/media ``` -------------------------------- ### Update AzuraCast Ansible Installation Source: https://www.azuracast.com/docs/getting-started/updates Updates an AzuraCast installation managed by Ansible. This script pulls the latest codebase, clears caches, and applies necessary database updates. It requires running the commands from the AzuraCast www directory with sudo permissions. ```Shell cd /var/azuracast/www sudo chmod a+x update.sh sudo ./update.sh ``` -------------------------------- ### Add Custom NGINX Configurations (YAML) Source: https://www.azuracast.com/docs/administration/docker This snippet demonstrates how to add custom NGINX configurations to AzuraCast by mounting a 'custom.conf' file into the 'web' container using 'docker-compose.override.yml'. Files in '/etc/nginx/azuracast.conf.d/' are automatically included. ```YAML services: web: volumes: - ./custom.conf:/etc/nginx/azuracast.conf.d/custom.conf ``` -------------------------------- ### Run SQL Command via Docker CLI Source: https://www.azuracast.com/docs/help/troubleshooting This command allows advanced users to execute arbitrary SQL commands against the AzuraCast database using the Docker CLI. It requires knowledge of the specific SQL commands to be run and is intended for manual database modification during migration failures. ```bash ./docker.sh cli dbal:run-sql "SQL COMMAND HERE" ``` -------------------------------- ### Switch AzuraCast Ansible to Rolling Release Source: https://www.azuracast.com/docs/getting-started/updates/release-channels To switch an Ansible installation of AzuraCast to the Rolling Release channel, you need to reset the Git repository to its default state, checkout the 'main' branch, and then pull the latest changes. This ensures that your installation is running the most current code. ```git git reset --hard git checkout main git pull ``` -------------------------------- ### Targeting Public Pages by Station and Theme (CSS) Source: https://www.azuracast.com/docs/administration/css Demonstrates how to apply CSS styles to public pages for a specific station, with options to target both dark and light themes, or specific themes individually. This is useful for creating station-specific branding. ```css # Targeting either dark or light themed pages [data-bs-theme] body.station-my_radio { ... } # Targeting only light themed pages [data-bs-theme="light"] body.station-my_radio { ... } # Targeting only dark themed pages [data-bs-theme="dark"] body.station-my_radio { ... } ``` -------------------------------- ### Perform Interactive AzuraCast Docker Update Source: https://www.azuracast.com/docs/getting-started/updates Updates AzuraCast to the latest version using the Docker utility script. This is the recommended method for Docker installations as it simplifies the update process. It requires navigating to the AzuraCast directory. ```Shell cd /var/azuracast ./docker.sh update-self ./docker.sh update ``` -------------------------------- ### Restart AzuraCast After Configuration Changes Source: https://www.azuracast.com/docs/administration/sync-tasks These commands are used to restart the AzuraCast installation after making changes to the `azuracast.env` file. This ensures that the new configuration settings for synchronized task timeouts are applied. ```bash docker-compose down docker-compose up -d ``` -------------------------------- ### Change AzuraCast Ports using Docker Utility Script Source: https://www.azuracast.com/docs/administration/docker This sequence of commands utilizes the Docker Utility Script to modify the ports used by AzuraCast. It first navigates to the AzuraCast installation directory, then updates the script itself, and finally initiates the port change process. This is useful for setting non-standard ports for the web application or radio stations. ```shell cd /var/azuracast ./docker.sh update-self ./docker.sh change-ports ``` -------------------------------- ### Store Station Data on Host Machine Source: https://www.azuracast.com/docs/administration/docker Stores all station data in a specified directory on the host machine. Useful for managing storage space between different drives. Requires replacing the placeholder path. Restart Docker containers to apply changes. ```yaml services: web: volumes: - /path/on/host/computer:/var/azuracast/stations ``` -------------------------------- ### Generate AzuraCast Backup via Command Line Source: https://www.azuracast.com/docs/administration/backup-and-restore This command-line utility generates a backup of your AzuraCast installation. It can create full backups or exclude media files to reduce backup size. Backups support .zip and .tar.gz formats based on the specified filename extension. Dependencies include the Docker Utility Tool. ```bash cd /var/azuracast ./docker.sh backup path-to-backup.zip ``` ```bash cd /var/azuracast ./docker.sh backup path-to-backup.zip --exclude-media ``` -------------------------------- ### Mount Custom Favicon Folder Source: https://www.azuracast.com/docs/administration/docker Overrides AzuraCast's default favicon and other browser icons with custom ones. Requires generating icons using a service like favicon-generator.org, placing them on the host, and mounting the folder. Restart Docker containers to apply changes. ```yaml services: web: volumes: - /path/to/your/favicon/folder:/var/azuracast/www/static/icons/production ``` -------------------------------- ### Rename MariaDB Log Files (Docker) Source: https://www.azuracast.com/docs/help/troubleshooting This process addresses the 'InnoDB: Upgrade after a crash is not supported' error by renaming MariaDB log files within the Docker volume. It requires stopping Azuracast, renaming the log files, and then attempting the update again to allow MariaDB to recover. ```bash docker-compose down mv ib_logfile0 ib_logfile0.old ``` -------------------------------- ### Get External IP Address (CLI) Source: https://www.azuracast.com/docs/administration/command-line-interface This command retrieves the external IP address of the AzuraCast instance. It's a simple utility for identifying the server's public IP. ```bash (cli_command) azuracast:internal:ip ``` -------------------------------- ### Replace Default Error Track Source: https://www.azuracast.com/docs/administration/docker Replaces AzuraCast's default `error.mp3` with a custom audio file. The custom file must match the stream format. Requires replacing the placeholder path to the custom file. Restart Docker containers to apply changes. ```yaml services: web: volumes: - /path/to/your/file.mp3:/usr/local/share/icecast/web/error.mp3 ``` -------------------------------- ### Add Video Background with CSS and JavaScript Source: https://www.azuracast.com/docs/administration/customization This example shows how to use AzuraCast's custom CSS and JavaScript features to add a video background to public pages. The CSS styles the video element, and the JavaScript creates and appends the video element to the body. ```css [data-theme] body.page-minimal .background-video { width: 100vw; height: 100vh; object-fit: cover; position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: -1; } ``` ```javascript let videoBackgroundElement = document.createElement('video'); videoBackgroundElement.autoplay = true; videoBackgroundElement.loop = true; videoBackgroundElement.muted = true; videoBackgroundElement.poster = 'Enter.URL.Here'; videoBackgroundElement.className = 'background-video'; let videoBackgroundSource = document.createElement('source'); videoBackgroundSource.src = 'Enter.URL.Here'; videoBackgroundSource.type = 'video/mp4'; videoBackgroundElement.appendChild(videoBackgroundSource); document.body.append(videoBackgroundElement); ``` -------------------------------- ### Uninstall AzuraCast using Docker Utility Script Source: https://www.azuracast.com/docs/administration/docker Completely removes AzuraCast Docker containers and their associated persistent volumes (database, media). This action is irreversible and will delete all AzuraCast data. Requires the `docker.sh` script. ```shell ./docker.sh uninstall ``` -------------------------------- ### Switch AzuraCast Ansible to Stable Release Source: https://www.azuracast.com/docs/getting-started/updates/release-channels To switch an Ansible installation of AzuraCast to the Stable release channel, you must first reset the Git repository, then checkout the 'stable' branch, and finally pull the latest changes from that branch. This process ensures you are on a tested and stable version of AzuraCast. ```git git reset --hard git checkout stable git pull ``` -------------------------------- ### View AzuraCast Docker Container Logs Source: https://www.azuracast.com/docs/help/logs This command allows users to view the logs of the AzuraCast web container. It is useful for debugging application-specific issues and requires a shell session on the host machine where Docker is installed. The '-f' flag follows the log output in real-time. ```bash cd /var/azuracast docker-compose logs -f web ``` -------------------------------- ### Automate AzuraCast Docker Update Source: https://www.azuracast.com/docs/getting-started/updates Performs an automated update of AzuraCast for Docker installations by automatically answering 'yes' to prompts regarding docker-compose.yml file updates. This is useful for users not modifying the docker-compose.yml file and seeking a fully automated process. It requires navigating to the AzuraCast directory. ```Shell cd /var/azuracast ./docker.sh update-self yes "" | ./docker.sh update ``` -------------------------------- ### Force Full AzuraCast Ansible Update Source: https://www.azuracast.com/docs/getting-started/updates Forces a comprehensive update of all AzuraCast components for Ansible installations. This is useful for troubleshooting or recovering from interrupted updates. It processes all system parts, ensuring a complete update. This command is run from the AzuraCast www directory. ```Shell ./update.sh --full ``` -------------------------------- ### Increase PHP Memory Limit (Bash) Source: https://www.azuracast.com/docs/administration/docker This snippet shows how to increase the PHP memory limit by editing the '.env' file in AzuraCast. It addresses 'Allowed memory size exhausted' errors by modifying the PHP_MEMORY_LIMIT setting. Restarting AzuraCast via docker-compose is required after the change. ```Bash # PHP's maximum memory limit. PHP_MEMORY_LIMIT=512M ``` -------------------------------- ### Configure Automatic Port Assignment for Expanded Range Source: https://www.azuracast.com/docs/administration/docker These environment variables are used within the `azuracast.env` file to inform AzuraCast about the expanded port range for automatic station port assignment. Setting `AUTO_ASSIGN_PORT_MIN` and `AUTO_ASSIGN_PORT_MAX` ensures that new stations are assigned ports within the newly defined range. These changes require a Docker container restart. ```env AUTO_ASSIGN_PORT_MIN=8500 AUTO_ASSIGN_PORT_MAX=8999 ``` -------------------------------- ### Fetch Now Playing Data with Axios Source: https://www.azuracast.com/docs/developers/now-playing-data Provides an example of fetching Now Playing data from AzuraCast using the Axios HTTP client library. This implementation also includes a timed refresh mechanism for the data, updating every 15 seconds. It's designed for applications that require dynamic updates of station status. ```javascript var nowPlaying; var nowPlayingTimeout; function loadNowPlaying() { axios.get('http://your-azuracast-site.example.com/api/nowplaying/station_shortcode').then((response) => { // Do something with the Now Playing data. nowPlaying = response.data; }).catch((error) => { console.error(error); }).then(() => { clearTimeout(nowPlayingTimeout); nowPlayingTimeout = setTimeout(checkNowPlaying, 15000); }); } loadNowPlaying(); ``` -------------------------------- ### Expand AzuraCast Station Port Range with Docker Compose Override Source: https://www.azuracast.com/docs/administration/docker This YAML snippet defines a Docker Compose override to expand the range of ports available for radio stations. By adding this to `docker-compose.override.yml`, you can allow more than the default 50 stations to operate on a single AzuraCast instance. The port range can be adjusted as needed. ```yaml services: web: ports: - "8500-8999:8500-8999" ``` -------------------------------- ### Configure AzuraCast Ports Source: https://www.azuracast.com/docs/administration/multi-site-installation Modifies the .env file to change the HTTP and HTTPS ports AzuraCast's web container listens on. This prevents conflicts with the Nginx proxy which will handle these ports. Ports 80 and 443 are redirected to higher, unused ports (e.g., 10080 and 10443). ```env AZURACAST_HTTP_PORT=10080 AZURACAST_HTTPS_PORT=10443 ``` -------------------------------- ### Disable HSTS via CLI - AzuraCast Source: https://www.azuracast.com/docs/administration/ssl-and-lets-encrypt This command-line interface (CLI) command disables the HTTP Strict Transport Security (HSTS) setting in AzuraCast. This is useful if HSTS prevents access to your installation after the SSL certificate becomes unavailable. It requires SSH access to your AzuraCast server. ```bash cd /var/azuracast bash docker.sh cli azuracast:settings:set always_use_ssl 0 ``` -------------------------------- ### Create Azuracast Backup via Command Line Source: https://context7.com/context7/azuracast/llms.txt Creates a backup of the Azuracast instance using the Docker utility script. Backups can include all media files or exclude them for smaller file sizes. Supports both .zip and .tar.gz formats. This command can be scheduled with cron for automated backups. ```bash cd /var/azuracast # Basic backup with all media (large file size) ./docker.sh backup /path/to/backup.zip # Backup excluding media (recommended for regular backups) ./docker.sh backup /path/to/backup-no-media.zip --exclude-media # Both .zip and .tar.gz formats supported ./docker.sh backup /path/to/backup.tar.gz # Schedule with cron for automated backups: # 0 3 * * * cd /var/azuracast && ./docker.sh backup /backups/azuracast-$(date +%Y%m%d).zip --exclude-media ``` -------------------------------- ### Configure Xiph Icecast Directory (XML) Source: https://www.azuracast.com/docs/user-guide/promoting-your-station This configuration snippet allows AzuraCast to submit station metadata to the Xiph Icecast Directory using Icecast's YellowPages discovery mechanism. It requires Icecast broadcasting and is added to the station's custom configuration. ```xml 15 http://dir.xiph.org/cgi-bin/yp-cgi ``` -------------------------------- ### Attempt SFTP Authentication (CLI) Source: https://www.azuracast.com/docs/administration/command-line-interface This CLI command attempts to authenticate via SFTP. It's a diagnostic tool for verifying SFTP connection settings and credentials. ```bash (cli_command) azuracast:internal:sftp-auth ``` -------------------------------- ### Change Azuracast Top Navigation Color Source: https://www.azuracast.com/docs/administration/css Customize the background color of the Azuracast top navigation bar and remove any existing background image. This CSS targets the 'navbar' element. ```css [data-bs-theme] header.navbar { background-image: none; background: #3d3d3d; } ``` -------------------------------- ### Style Azuracast Modal Pagination Source: https://www.azuracast.com/docs/administration/css Modify the background color of the pagination elements within Azuracast modals. This CSS selector targets the pagination container inside the modal content. ```css [data-bs-theme] body.page-minimal .modal .modal-content .pagination { background: #3d3d3d; } ``` -------------------------------- ### Configure Internet-radio.com Directory (XML) Source: https://www.azuracast.com/docs/user-guide/promoting-your-station This configuration snippet enables AzuraCast station submission to the Internet-radio.com directory via Icecast's YellowPages feature. It requires Icecast broadcasting and is applied through the station's custom configuration. ```xml 15 http://icecast-yp.internet-radio.com ``` -------------------------------- ### Conditionally Style Azuracast Internal Pages Source: https://www.azuracast.com/docs/administration/css Apply conditional styling to Azuracast internal pages based on the selected theme (light or dark). This uses the 'data-bs-theme' attribute to differentiate styles. ```css [data-bs-theme="light"] body { ... } [data-bs-theme="dark"] body { ... } ``` -------------------------------- ### Configure radio-browser.info Headers (XML) Source: https://www.azuracast.com/docs/user-guide/promoting-your-station This configuration snippet demonstrates how to add custom HTTP headers to an Icecast mount point to send metadata to radio-browser.info. These headers are crucial for directory integration and must be added directly to the mount point's advanced configuration. ```xml
``` -------------------------------- ### Change Azuracast Card Header Background Source: https://www.azuracast.com/docs/administration/css Modify the default blue background color of cards and other elements on Azuracast internal pages. This uses the '.bg-primary-dark' class with an 'important' flag to ensure the override. ```css [data-bs-theme] .bg-primary-dark { background-color: #5e0f16 !important; } ``` -------------------------------- ### Configure Custom SSL Certificates - AzuraCast Source: https://www.azuracast.com/docs/administration/ssl-and-lets-encrypt This configuration allows AzuraCast to use custom SSL certificates. It involves creating a `docker-compose.override.yml` file to map your SSL certificate and key files to the paths expected by AzuraCast's web service. Ensure your certificate includes the complete chain. ```yaml services: web: volumes: - /path/on/host/to/ssl.crt:/var/azuracast/acme/ssl.crt:ro - /path/on/host/to/ssl.key:/var/azuracast/acme/ssl.key:ro ``` -------------------------------- ### List All AzuraCast Accounts (CLI) Source: https://www.azuracast.com/docs/administration/command-line-interface This CLI command lists all user accounts within AzuraCast. It outputs a table with account details including E-mail Address, Name, Roles, and Creation Date. ```bash (cli_command) azuracast:account:list ``` -------------------------------- ### Style Azuracast Modal Background and Text Source: https://www.azuracast.com/docs/administration/css Customize the background color of Azuracast modals and the text color of their titles. This CSS targets specific modal elements within the 'page-minimal' body class. ```css [data-bs-theme] body.page-minimal .modal .modal-content { background-color: #5e0f16; } [data-bs-theme] body.page-minimal .modal .modal-content .modal-title { color: #fff; } ``` -------------------------------- ### Convert Custom SSL Certificate Formats - OpenSSL Source: https://www.azuracast.com/docs/administration/ssl-and-lets-encrypt These OpenSSL commands are used to convert custom SSL certificate files into the formats typically expected by web servers like Icecast. It specifically handles converting a private key and a full chain certificate into separate RSA key and CRT files. ```bash openssl rsa -in privkey.pem -out example.com.key openssl crl2pkcs7 -nocrl -certfile fullchain.pem | openssl pkcs7 -print_certs -out example.com.crt ``` -------------------------------- ### Liquidsoap: Ensuring Safe Playlist Fallback Source: https://www.azuracast.com/docs/user-guide/playlists This Liquidsoap configuration demonstrates how to use the `mksafe` function to ensure that a playlist provides a reliable audio source. This is crucial when dealing with 'fallible' playlists that might contain invalid files or fail to produce output, preventing stream interruptions. ```liquidsoap radio = rotate(weights=[1,1,5], [mksafe(playlist_jingles), playlist_commercials, playlist_music]) ``` -------------------------------- ### Style Azuracast Song Requests Table Text Source: https://www.azuracast.com/docs/administration/css Change the text color for both the header (thead) and body (tbody) rows of the Song Requests table within Azuracast modals. This allows for consistent text styling. ```css [data-bs-theme] body.page-minimal .modal .modal-content .table thead { color: #fff; } [data-bs-theme] body.page-minimal .modal .modal-content .table tbody { color: #fff; } ``` -------------------------------- ### Create Account Login Token (CLI) Source: https://www.azuracast.com/docs/administration/command-line-interface This command generates a unique login recovery URL for a specified account. The generated URL can be used to log in and reset the account's password via the web interface. ```bash (cli_command) azuracast:account:login-token [example] ```