begin docker xenial support
This commit is contained in:
parent
65968ee0fa
commit
9f15b2d3df
117
install
117
install
|
@ -52,7 +52,13 @@ showhelp () {
|
||||||
Install Icecast 2 and deploy a basic configuration for Airtime
|
Install Icecast 2 and deploy a basic configuration for Airtime
|
||||||
--selinux
|
--selinux
|
||||||
Run restorecon on directories and files that need tagging to
|
Run restorecon on directories and files that need tagging to
|
||||||
allow the WEB_USER access."
|
allow the WEB_USER access
|
||||||
|
--no-postgres
|
||||||
|
Skips all postgres related install tasks (Useful if you configure
|
||||||
|
postgresql as part of another script / docker builds)
|
||||||
|
--no-rabbitmq
|
||||||
|
Skips all rabbitmq related install tasks.
|
||||||
|
"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,6 +455,12 @@ while :; do
|
||||||
--selinux)
|
--selinux)
|
||||||
selinux="t"
|
selinux="t"
|
||||||
;;
|
;;
|
||||||
|
--skip-postgres)
|
||||||
|
skip_postgres=1
|
||||||
|
;;
|
||||||
|
--skip-rabbitmq)
|
||||||
|
skip_rabbitmq=1
|
||||||
|
;;
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
|
@ -986,70 +998,75 @@ else
|
||||||
loudCmd "a2enmod rewrite php5"
|
loudCmd "a2enmod rewrite php5"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
loud "\n-----------------------------------------------------"
|
if [ $skip_postgres -ne 1 ]; then
|
||||||
loud " * Configuring PostgreSQL * "
|
loud "\n-----------------------------------------------------"
|
||||||
loud "-----------------------------------------------------"
|
loud " * Configuring PostgreSQL * "
|
||||||
|
loud "-----------------------------------------------------"
|
||||||
|
|
||||||
# Ensure postgres is running - It isn't after you install the postgres package on Ubuntu 15.04
|
# Ensure postgres is running - It isn't after you install the postgres package on Ubuntu 15.04
|
||||||
systemInitCommand start postgresql
|
systemInitCommand start postgresql
|
||||||
|
|
||||||
setupAirtimePostgresUser() {
|
setupAirtimePostgresUser() {
|
||||||
# here-doc to execute this block as postgres user
|
# here-doc to execute this block as postgres user
|
||||||
su postgres <<'EOF'
|
su postgres <<'EOF'
|
||||||
set +e
|
set +e
|
||||||
count=$(psql -d postgres -tAc "SELECT count(*) FROM pg_roles WHERE rolname='airtime';")
|
count=$(psql -d postgres -tAc "SELECT count(*) FROM pg_roles WHERE rolname='airtime';")
|
||||||
if [[ $count -eq 0 ]]; then
|
if [[ $count -eq 0 ]]; then
|
||||||
psql -d postgres -tAc "CREATE USER airtime WITH ENCRYPTED PASSWORD 'airtime'; ALTER USER airtime CREATEDB;"
|
psql -d postgres -tAc "CREATE USER airtime WITH ENCRYPTED PASSWORD 'airtime'; ALTER USER airtime CREATEDB;"
|
||||||
[[ $? -eq 0 ]] &&
|
[[ $? -eq 0 ]] &&
|
||||||
echo "Created airtime user in PostgreSQL" ||
|
echo "Created airtime user in PostgreSQL" ||
|
||||||
echo "$0:${FUNCNAME}(): ERROR: Can't create airtime user in PostgreSQL!"
|
echo "$0:${FUNCNAME}(): ERROR: Can't create airtime user in PostgreSQL!"
|
||||||
else
|
else
|
||||||
echo "airtime user already exists in PostgreSQL"
|
echo "airtime user already exists in PostgreSQL"
|
||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
# don't indent this!
|
# don't indent this!
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$postgres" = "t" ]; then
|
if [ "$postgres" = "t" ]; then
|
||||||
setupAirtimePostgresUser
|
|
||||||
elif [ ${_i} -eq 1 ]; then
|
|
||||||
echo -e "Create default airtime postgres user? (Y/n): \c"
|
|
||||||
read IN
|
|
||||||
if [ "$IN" = "y" -o "$IN" = "Y" ]; then
|
|
||||||
setupAirtimePostgresUser
|
setupAirtimePostgresUser
|
||||||
|
elif [ ${_i} -eq 1 ]; then
|
||||||
|
echo -e "Create default airtime postgres user? (Y/n): \c"
|
||||||
|
read IN
|
||||||
|
if [ "$IN" = "y" -o "$IN" = "Y" ]; then
|
||||||
|
setupAirtimePostgresUser
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
loud "\n-----------------------------------------------------"
|
if [ $skip_rabbitmq -ne 1 ]; then
|
||||||
loud " * Configuring RabbitMQ * "
|
|
||||||
loud "-----------------------------------------------------"
|
|
||||||
|
|
||||||
RABBITMQ_VHOST=/airtime
|
loud "\n-----------------------------------------------------"
|
||||||
RABBITMQ_USER=airtime
|
loud " * Configuring RabbitMQ * "
|
||||||
RABBITMQ_PASSWORD=airtime
|
loud "-----------------------------------------------------"
|
||||||
EXCHANGES="airtime-pypo|pypo-fetch|airtime-analyzer|media-monitor"
|
|
||||||
|
|
||||||
# Ignore errors in this check to avoid dying when vhost isn't found
|
RABBITMQ_VHOST=/airtime
|
||||||
set +e
|
RABBITMQ_USER=airtime
|
||||||
rabbitmqctl list_vhosts | grep -w "^${RABBITMQ_VHOST}$" > /dev/null
|
RABBITMQ_PASSWORD=airtime
|
||||||
RESULT="$?"
|
EXCHANGES="airtime-pypo|pypo-fetch|airtime-analyzer|media-monitor"
|
||||||
set -e
|
|
||||||
|
|
||||||
# Only run these if the vhost doesn't exist
|
# Ignore errors in this check to avoid dying when vhost isn't found
|
||||||
if [ "$RESULT" != "0" ]; then
|
set +e
|
||||||
verbose "\n * Creating RabbitMQ user ${RABBITMQ_USER}..."
|
rabbitmqctl list_vhosts | grep -w "^${RABBITMQ_VHOST}$" > /dev/null
|
||||||
|
RESULT="$?"
|
||||||
|
set -e
|
||||||
|
|
||||||
rabbitmqctl add_vhost ${RABBITMQ_VHOST}
|
# Only run these if the vhost doesn't exist
|
||||||
rabbitmqctl add_user ${RABBITMQ_USER} ${RABBITMQ_PASSWORD}
|
if [ "$RESULT" != "0" ]; then
|
||||||
else
|
verbose "\n * Creating RabbitMQ user ${RABBITMQ_USER}..."
|
||||||
verbose "\nRabbitMQ user already exists, skipping creation"
|
|
||||||
|
rabbitmqctl add_vhost ${RABBITMQ_VHOST}
|
||||||
|
rabbitmqctl add_user ${RABBITMQ_USER} ${RABBITMQ_PASSWORD}
|
||||||
|
else
|
||||||
|
verbose "\nRabbitMQ user already exists, skipping creation"
|
||||||
|
fi
|
||||||
|
|
||||||
|
verbose "\n * Setting RabbitMQ user permissions..."
|
||||||
|
#loudCmd "rabbitmqctl set_permissions -p ${RABBITMQ_VHOST} ${RABBITMQ_USER} \"$EXCHANGES\" \"$EXCHANGES\" \"$EXCHANGES\""
|
||||||
|
loudCmd "rabbitmqctl set_permissions -p ${RABBITMQ_VHOST} ${RABBITMQ_USER} .\* .\* .\*"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
verbose "\n * Setting RabbitMQ user permissions..."
|
|
||||||
#loudCmd "rabbitmqctl set_permissions -p ${RABBITMQ_VHOST} ${RABBITMQ_USER} \"$EXCHANGES\" \"$EXCHANGES\" \"$EXCHANGES\""
|
|
||||||
loudCmd "rabbitmqctl set_permissions -p ${RABBITMQ_VHOST} ${RABBITMQ_USER} .\* .\* .\*"
|
|
||||||
|
|
||||||
if [ ! -d "/etc/airtime" ]; then
|
if [ ! -d "/etc/airtime" ]; then
|
||||||
loud "\n-----------------------------------------------------"
|
loud "\n-----------------------------------------------------"
|
||||||
loud " * Installing Airtime * "
|
loud " * Installing Airtime * "
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
apache2
|
||||||
|
libapache2-mod-php7.0
|
||||||
|
php7.0
|
||||||
|
php-pear
|
||||||
|
php7.0-gd
|
||||||
|
php-bcmath
|
||||||
|
php-mbstring
|
||||||
|
|
||||||
|
lsb-release
|
||||||
|
|
||||||
|
zip
|
||||||
|
unzip
|
||||||
|
|
||||||
|
postgresql-client
|
||||||
|
php7.0-pgsql
|
||||||
|
|
||||||
|
python
|
||||||
|
python-virtualenv
|
||||||
|
python-pip
|
||||||
|
|
||||||
|
libsoundtouch-ocaml
|
||||||
|
libtaglib-ocaml
|
||||||
|
libao-ocaml
|
||||||
|
libmad-ocaml
|
||||||
|
ecasound
|
||||||
|
libportaudio2
|
||||||
|
libsamplerate0
|
||||||
|
|
||||||
|
python-rgain
|
||||||
|
python-gst-1.0
|
||||||
|
gstreamer1.0-plugins-ugly
|
||||||
|
python-pika
|
||||||
|
|
||||||
|
patch
|
||||||
|
|
||||||
|
php7.0-curl
|
||||||
|
mpg123
|
||||||
|
curl
|
||||||
|
|
||||||
|
libcamomile-ocaml-data
|
||||||
|
libpulse0
|
||||||
|
vorbis-tools
|
||||||
|
lsof
|
||||||
|
# mp3gain need to be installed over an external ppa or the use of easymp3gain
|
||||||
|
easymp3gain-gtk
|
||||||
|
vorbisgain
|
||||||
|
flac
|
||||||
|
vorbis-tools
|
||||||
|
pwgen
|
||||||
|
libfaad2
|
||||||
|
php-apcu
|
||||||
|
|
||||||
|
lame
|
||||||
|
|
||||||
|
coreutils
|
||||||
|
|
||||||
|
liquidsoap
|
||||||
|
liquidsoap-plugin-alsa
|
||||||
|
liquidsoap-plugin-ao
|
||||||
|
liquidsoap-plugin-faad
|
||||||
|
liquidsoap-plugin-flac
|
||||||
|
liquidsoap-plugin-icecast
|
||||||
|
liquidsoap-plugin-lame
|
||||||
|
liquidsoap-plugin-mad
|
||||||
|
liquidsoap-plugin-ogg
|
||||||
|
liquidsoap-plugin-portaudio
|
||||||
|
liquidsoap-plugin-pulseaudio
|
||||||
|
liquidsoap-plugin-taglib
|
||||||
|
liquidsoap-plugin-voaacenc
|
||||||
|
liquidsoap-plugin-vorbis
|
||||||
|
|
||||||
|
silan
|
||||||
|
libopus0
|
||||||
|
|
||||||
|
sysvinit-utils
|
||||||
|
|
||||||
|
build-essential
|
||||||
|
libssl-dev
|
||||||
|
libffi-dev
|
||||||
|
python-dev
|
Loading…
Reference in New Issue