azuracast

by lamasbr
13 deployments · 3 still active · last rev. 7 months ago

Install AzuraCast, a free and open-source self-hosted web radio (https://azuracast.com/) on a linode instance.

Note: provide an username, password and if you have, your SSH public key. After install AzuraCast, this StackScript will disable SSH root login. If you provide your SSH public key, SSH logins with password will be disabled too.

After deployed, please visit http://YOUR-LINODE-IP/ to configure your AzuraCast instalation.

If you want install AzuraCast with Docker, see this StackScript: https://www.linode.com/stackscripts/view/352549

Compatible with: Ubuntu 16.04 LTS, Ubuntu 18.04 LTS
						#!/bin/bash
#<UDF name="USERNAME" label="Username">
#<UDF name="USERPASSWORD" label="Password">
#<UDF name="USERPUBKEY" label="User SSH public key" default="">
#<UDF name="HOSTNAME" label="Hostname (FQDN)" default="">

# Last update: November 04th, 2018
# Author: Lincoln Lamas <falecom@interlli.ga>

set -e

if [ ! -z "$HOSTNAME" ]; then
  hostnamectl set-hostname $HOSTNAME
  echo "127.0.0.1   $HOSTNAME" >> /etc/hosts
fi

# Set up user account
adduser $USERNAME --disabled-password --gecos ""
echo "$USERNAME:$USERPASSWORD" | chpasswd
adduser $USERNAME sudo

# If user provided an SSH public key, whitelist it, disable SSH password authentication, and allow passwordless sudo
if [ ! -z "$USERPUBKEY" ]; then
  mkdir -p /home/$USERNAME/.ssh
  echo "$USERPUBKEY" >> /home/$USERNAME/.ssh/authorized_keys
  chown -R "$USERNAME":"$USERNAME" /home/$USERNAME/.ssh
  chmod 600 /home/$USERNAME/.ssh/authorized_keys
  sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
  echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
fi

# Install GIT
apt-get update && apt-get install -q -y git

# Cloning AzuraCast and install
sudo mkdir -p /var/azuracast/www
cd /var/azuracast/www
git clone https://github.com/AzuraCast/AzuraCast.git .

chmod a+x install.sh
./install.sh

# Disable root SSH access
sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config