Installer tweaks and a pypo bugfix

* Moved all the remaining DEB requirements into the requirements files
* The installer should now be distro agnostic (unless you ask it to
  install third-party deps for you)
* Fixed pypo not being able to find replaygainupdater
* Tweaked a bunch of styling for the installer
This commit is contained in:
Albert Santoni 2015-02-10 18:06:46 -05:00
parent 861bb42f3f
commit d46f4a52eb
11 changed files with 218 additions and 130 deletions

View File

@ -38,13 +38,12 @@ $result = $r1 && $r2;
}
body {
padding: 2em 0;
padding: 2em;
min-width: 600px;
width: 50%;
text-align: center;
margin: 3em auto;
margin: 3em ;
border: 1px solid lightgray;
border-radius: 5em;
border-radius: 5px;
}
</style>
@ -53,18 +52,42 @@ $result = $r1 && $r2;
<img class="logo" src="css/images/airtime_logo_jp.png" /><br/>
<strong>Configuration Checklist</strong>
</h2>
<?php
if (!$result) {
?>
<br/>
<h3 class="error">Looks like something went wrong!</h3>
<p>
Take a look at the checklist below for possible solutions. If you're tried the suggestions and are
still experiencing issues, come
<a href="https://forum.sourcefabric.org/">visit our forums</a>
or <a href="http://www.sourcefabric.org/en/airtime/manuals/">check out the manual</a>.
</p>
<?php
} else {
?>
<p>
Your Airtime station is up and running! Get started by logging in with the default username and password: admin/admin
</p>
<button onclick="location = location.pathname;">Log in to Airtime!</button>
<?php
}
?>
<table class="table">
<thead>
<tr>
<td class="component">
<th class="component">
Component
</td>
<td class="description">
</th>
<th class="description">
<strong>Description</strong>
</td>
<td class="solution">
<strong>Solution</strong>
</td>
</th>
<th class="solution">
<strong>Status or Solution</strong>
</th>
</tr>
</thead>
</table>
@ -172,7 +195,7 @@ $result = $r1 && $r2;
Check that the airtime-media-monitor service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-media-monitor</code><br/>
If not, try <br/><code>sudo service airtime-media-monitor start</code>
If not, try running <code>sudo service airtime-media-monitor start</code>
<?php
}
?>
@ -192,7 +215,7 @@ $result = $r1 && $r2;
Check that the airtime-playout service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-playout</code><br/>
If not, try <br/><code>sudo service airtime-playout restart</code>
If not, try running <code>sudo service airtime-playout restart</code>
<?php
}
?>
@ -212,7 +235,7 @@ $result = $r1 && $r2;
Check that the airtime-liquidsoap service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-liquidsoap</code><br/>
If not, try <br/><code>sudo service airtime-liquidsoap restart</code>
If not, try running <code>sudo service airtime-liquidsoap restart</code>
<?php
}
?>
@ -221,26 +244,6 @@ $result = $r1 && $r2;
</tbody>
</table>
</div>
<?php
if (!$result) {
?>
<br/>
<strong>Looks like something went wrong!</strong>
<p>
If you've tried everything we've recommended above and are still experiencing issues, come
<a href="https://forum.sourcefabric.org/">visit our forums</a>
or <a href="http://www.sourcefabric.org/en/airtime/manuals/">check out the manual</a>.
</p>
<?php
} else {
?>
<p>
Your Airtime station is up and running! Get started by logging in with the default username and password: admin/admin
</p>
<button onclick="location = location.pathname;">Log in to Airtime!</button>
<?php
}
?>
<div class="footer">
<h3>
PHP Extension List

View File

@ -2,10 +2,10 @@
?>
<form action="#" role="form" id="finishSettingsForm">
<h3 class="form-title">Setup Complete!</h3>
<h3 class="form-title">Manual Step: Start Airtime Services</h3>
<span id="helpBlock" class="help-block help-message"></span>
<p>
Looks like you're almost done! As a final step, run the following commands from the terminal:
Looks like you're almost done! As a final step, please run the following commands from the terminal:
</p>
<pre style="text-align: left">sudo service airtime-playout start
sudo service airtime-liquidsoap start

View File

@ -3,13 +3,11 @@
}
.table {
padding: 0;
padding: 5px;
margin: 1em 0 0 0;
}
.checklist {
overflow: auto;
height: 50%;
min-height: 200px;
}
@ -22,8 +20,12 @@
width: 20%;
}
.description, .solution {
width: 40%;
.error {
color: red;
}
.description {
width: 300px;
}
.check {

View File

@ -1,8 +1,8 @@
html {
background: -webkit-linear-gradient(midnightblue, black); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(midnightblue, black); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(midnightblue, black); /* For Firefox 3.6 to 15 */
background: linear-gradient(midnightblue, black); /* Standard syntax */
background: -webkit-linear-gradient(#444, black); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(#444, black); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(#444, black); /* For Firefox 3.6 to 15 */
background: linear-gradient(#444, black); /* Standard syntax */
}
body {
@ -15,6 +15,14 @@ body {
margin: auto;
}
p, h1, h2, h3, h4, h5, h6 {
text-shadow: 0px 1px 1px #000;
}
code {
text-shadow: none;
}
.header {
padding-top: 1em;
height: 10%;
@ -36,8 +44,33 @@ body {
}
#airtimeLogo {
padding-top: .7em;
float: left;
padding-top: 0.6em;
}
.btn-primary {
text-shadow: 0px 1px 1px #000000;
background-color: #ff5d1a;
border-color: #8d3715;
}
.btn-primary:focus, .btn-primary:active, .form-control:focus
{
border-color: #ff5d1a;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(255, 93, 26, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(255, 93, 26, 0.6);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary.focus, .btn-primary:active, .btn-primary.active, .open>.dropdown-toggle.btn-primary,
.btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled.focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary.focus, .btn-primary.disabled:active,
.btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active
{
background-color: #dc5118;
border-color: #632910;
}
/* ############################################################################

View File

@ -67,7 +67,8 @@ class DatabaseSetup extends Setup {
}
} catch (PDOException $e) {
throw new AirtimeDatabaseException("Couldn't establish a connection to the database! "
. "Please check your credentials and try again.",
. "Please check your credentials and try again. "
. "PDO Exception: " . $e->getMessage(),
array(
self::DB_NAME,
self::DB_USER,

126
install
View File

@ -88,6 +88,18 @@ function loudCmd() {
fi
}
function checkCommandExists() {
set +e
command=$@
eval hash ${command} 2>/dev/null
commandFound=$?
if [[ ! ${commandFound} -eq 0 ]]; then
echo -e "Error: ${command} not found. Please ensure you have the corresponding dependency installed."
exit
fi
set -e
}
while :; do
case "$1" in
--help)
@ -234,6 +246,25 @@ echo "/ | \ || | \ | | | / Y \| \ "
echo "\____|__ /___||____|_ / |____| |___\____|__ /_______ / "
echo -e " \/ \/ \/ \/ \n"
if [ "$ignore_dependencies" = "f" ]; then
loud "\n-----------------------------------------------------"
loud " * Installing External Dependencies * "
loud "-----------------------------------------------------"
verbose "\n * Reading requirements-${dist,,}-${code,,}.apt..."
set +e
if [ -f ${SCRIPT_DIR}/installer/lib/requirements-${dist,,}-${code,,}.apt ]; then
loudCmd "DEBIAN_FRONTEND=noninteractive apt-get -y -m --force-yes install $(grep -vE '^\s*#' ${SCRIPT_DIR}/installer/lib/requirements-${dist,,}-${code,,}.apt | tr '\n' ' ')"
else
loudCmd "DEBIAN_FRONTEND=noninteractive apt-get -y -m --force-yes install $(grep -vE '^\s*#' ${SCRIPT_DIR}/installer/lib/requirements-ubuntu-trusty.apt | tr '\n' ' ')"
fi
set -e
else
checkCommandExists "apache2"
checkCommandExists "rabbitmqctl"
checkCommandExists "psql"
fi
if [ -f /etc/airtime/airtime.conf ]; then
OLD_CONF=$(grep "[media-monitor]" /etc/airtime/airtime.conf)
@ -281,11 +312,6 @@ if [ "$apache" = "f" -a ${_i} -eq 1 ]; then
fi
fi
loudCmd "apt-get install -y --force-yes lsb-release"
dist=`lsb_release -is`
code=`lsb_release -cs`
if [ "$in_place" = "t" ]; then
verbose "\n * Setting current Airtime directory as web root..."
web_root=${AIRTIMEROOT}/airtime_mvc/public
@ -304,10 +330,9 @@ verbose "...Done"
if [ "$apache" = "t" ]; then
loud "\n-----------------------------------------------------"
loud " * Installing Apache * "
loud " * Configuring Apache * "
loud "-----------------------------------------------------"
loudCmd "apt-get -y --force-yes install apache2 libapache2-mod-php5"
set +e
apache2 -v | grep "2\.4" > /dev/null
apacheversion=$?
@ -348,11 +373,9 @@ fi
if [ "$icecast" = "t" ]; then
loud "\n-----------------------------------------------------"
loud " * Installing Icecast * "
loud " * Configuring Icecast * "
loud "-----------------------------------------------------"
loudCmd "DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install icecast2"
verbose "\n * Enabling Icecast 2..."
sed -i 's/ENABLE=false/ENABLE=true/g' /etc/default/icecast2
set +e
@ -365,8 +388,7 @@ loud "\n-----------------------------------------------------"
loud " * Installing Airtime Services * "
loud "-----------------------------------------------------"
verbose "\n * Installing necessary binaries..."
loudCmd "apt-get -y --force-yes install liquidsoap python python-pip"
verbose "\n * Installing necessary python services..."
loudCmd "pip install setuptools"
verbose "...Done"
@ -421,22 +443,6 @@ verbose "\n * Setting permissions on /var/tmp/airtime..."
chmod -R a+x /var/tmp/airtime
chown -R ${web_user}:${web_user} /var/tmp/airtime/
loud "\n-----------------------------------------------------"
loud " * Installing PHP * "
loud "-----------------------------------------------------"
loudCmd "apt-get -y --force-yes install php5"
verbose "\n * Installing Zend framework..."
#Debian Squeeze only has zendframework package. Newer versions of Ubuntu have zend-framework package.
#Ubuntu Lucid has both zendframework and zend-framework. Difference appears to be that zendframework is for
#1.10 and zend-framework is 1.11
if [ "$dist" = "Debian" ]; then
loudCmd "apt-get -y --force-yes install zendframework"
else
loudCmd "apt-get -y --force-yes install libzend-framework-php"
fi
# PHP Config File for Apache
if [ ! -f "/etc/php5/apache2/conf.d/airtime.ini" ]; then
verbose "\n * Creating Airtime PHP config for Apache..."
@ -445,15 +451,13 @@ else
verbose "\nAirtime PHP config for Apache already exists, skipping"
fi
# Enable modules
# Enable Apache modules
loudCmd "a2enmod rewrite php5"
loud "\n-----------------------------------------------------"
loud " * Installing PostgreSQL * "
loud " * Configuring PostgreSQL * "
loud "-----------------------------------------------------"
loudCmd "apt-get -y --force-yes install postgresql php5-pgsql"
setupAirtimePostgresUser() {
# here-doc to execute this block as postgres user
su postgres <<'EOF'
@ -475,11 +479,9 @@ elif [ ${_i} -eq 1 ]; then
fi
loud "\n-----------------------------------------------------"
loud " * Installing RabbitMQ * "
loud " * Configuring RabbitMQ * "
loud "-----------------------------------------------------"
loudCmd "apt-get -y --force-yes install rabbitmq-server"
RABBITMQ_VHOST=/airtime
RABBITMQ_USER=airtime
RABBITMQ_PASSWORD=airtime
@ -519,45 +521,39 @@ if [ ! -d "/srv/airtime" ]; then
fi
chown -R ${web_user}:${web_user} /srv/airtime
loud "\n-----------------------------------------------------"
loud " * Installing Locales * "
loud "-----------------------------------------------------"
set +e
verbose "\n * Generating locales"
for i in `ls /usr/share/airtime/locale | grep ".._.."`; do
if [ "$dist" = "Debian" ]; then
grep -qi "^$i" /etc/locale.gen
if [ $? -ne 0 ]; then
verbose "$i.UTF-8 UTF-8" >> /etc/locale.gen
fi
else
loudCmd "locale-gen \"$i.utf8\""
fi
done
set -e
if [ "$dist" = "Debian" ]; then
loudCmd "/usr/sbin/locale-gen"
fi
# We only generate the locales for Airtime if you're allowing us
# to install our dependencies, so that we won't automatically do this
# when this install script runs from our DEB package.
if [ "$ignore_dependencies" = "f" ]; then
loud "\n-----------------------------------------------------"
loud " * Installing External Dependencies * "
loud " * Installing Locales * "
loud "-----------------------------------------------------"
verbose "\n * Reading requirements-${dist,,}-${code,,}.apt..."
dist=`lsb_release -is`
code=`lsb_release -cs`
set +e
if [ -f ${SCRIPT_DIR}/installer/lib/requirements-${dist,,}-${code,,}.apt ]; then
loudCmd "apt-get -y -m --force-yes install $(grep -vE '^\s*#' ${SCRIPT_DIR}/installer/lib/requirements-${dist,,}-${code,,}.apt | tr '\n' ' ')"
else
loudCmd "apt-get -y -m --force-yes install $(grep -vE '^\s*#' ${SCRIPT_DIR}/installer/lib/requirements-ubuntu-trusty.apt | tr '\n' ' ')"
fi
verbose "\n * Generating locales"
for i in `ls /usr/share/airtime/locale | grep ".._.."`; do
if [ "$dist" = "Debian" ]; then
grep -qi "^$i" /etc/locale.gen
if [ $? -ne 0 ]; then
verbose "$i.UTF-8 UTF-8" >> /etc/locale.gen
fi
else
loudCmd "locale-gen \"$i.utf8\""
fi
done
set -e
if [ "$dist" = "Debian" ]; then
loudCmd "/usr/sbin/locale-gen"
fi
fi
verbose "\n * Restarting apache..."
loudCmd "service apache2 restart 2>/dev/null"
verbose "\n * Reloading apache..."
loudCmd "service apache2 reload 2>/dev/null"
IP=$(ifconfig eth0 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://')

View File

@ -1,10 +1,21 @@
apache2
libapache2-mod-php5
php5
zendframework
php-pear
php5-gd
odbc-postgresql
lsb-release
rabbitmq-server
postgresql
postgresql-client
php5-pgsql
python
python-virtualenv
python-pip
libsoundtouch-ocaml
libtaglib-ocaml
@ -17,6 +28,8 @@ libvo-aacenc0
patch
icecast2
php5-curl
mpg123
@ -37,5 +50,8 @@ lame
coreutils
liquidsoap
silan
libopus0

View File

@ -1,10 +1,21 @@
apache2
libapache2-mod-php5
php5
libzend-framework-php
php-pear
php5-gd
odbc-postgresql
lsb-release
rabbitmq-server
postgresql
postgresql-client
php5-pgsql
python
python-virtualenv
python-pip
libsoundtouch-ocaml
libtaglib-ocaml
@ -19,6 +30,8 @@ patch
php5-curl
mpg123
icecast2
libcamomile-ocaml-data
libpulse0
vorbis-tools
@ -35,10 +48,9 @@ dbus
lame
libzend-framework-php
coreutils
liquidsoap
liquidsoap-plugin-alsa
liquidsoap-plugin-ao
liquidsoap-plugin-faad
@ -55,3 +67,4 @@ liquidsoap-plugin-vorbis
silan
libopus0

View File

@ -1,10 +1,22 @@
apache2
libapache2-mod-php5
php5
libzend-framework-php
php-pear
php5-gd
php5-json
odbc-postgresql
lsb-release
rabbitmq-server
postgresql
postgresql-client
php5-pgsql
python
python-virtualenv
python-pip
libsoundtouch-ocaml
libtaglib-ocaml
@ -19,6 +31,8 @@ patch
php5-curl
mpg123
icecast2
libcamomile-ocaml-data
libpulse0
vorbis-tools
@ -34,12 +48,9 @@ php-apc
lame
libzend-framework-php
coreutils
php5-json
liquidsoap
liquidsoap-plugin-alsa
liquidsoap-plugin-ao
liquidsoap-plugin-faad

View File

@ -1,10 +1,21 @@
apache2
libapache2-mod-php5
php5
libzend-framework-php
php-pear
php5-gd
odbc-postgresql
lsb-release
rabbitmq-server
postgresql
postgresql-client
php5-pgsql
python
python-virtualenv
python-pip
libsoundtouch-ocaml
libtaglib-ocaml
@ -19,6 +30,8 @@ patch
php5-curl
mpg123
icecast2
libcamomile-ocaml-data
libpulse0
vorbis-tools
@ -34,10 +47,9 @@ php-apc
lame
libzend-framework-php
coreutils
liquidsoap
liquidsoap-plugin-alsa
liquidsoap-plugin-ao
liquidsoap-plugin-faad
@ -54,3 +66,4 @@ liquidsoap-plugin-vorbis
silan
libopus0

View File

@ -27,8 +27,8 @@ from pypomessagehandler import PypoMessageHandler
from pypoliquidsoap import PypoLiquidsoap
from timeout import ls_timeout
from media.update.replaygainupdater import ReplayGainUpdater
from media.update.silananalyzer import SilanAnalyzer
from pypo.media.update.replaygainupdater import ReplayGainUpdater
from pypo.media.update.silananalyzer import SilanAnalyzer
from configobj import ConfigObj