Initial work on monitless installation

This commit is contained in:
Duncan Sommerville 2014-12-16 12:24:41 -05:00
parent ecb43c2587
commit 4dfd49d12c
23 changed files with 225 additions and 112 deletions

View file

@ -109,7 +109,7 @@ $result = $r && $database;
?>">
Make sure you aren't missing any of the Postgres dependencies in the table above.
If your dependencies check out, make sure your database configuration settings in
<code>airtime.conf</code> are correct and the Airtime database was installed correctly.
<code>/etc/airtime.conf</code> are correct and the Airtime database was installed correctly.
<?php
}
?>
@ -143,8 +143,14 @@ $result = $r && $database;
<p>
<?php
global $extensions;
$first = true;
foreach ($extensions as $ext) {
echo $ext . " | ";
if (!$first) {
echo " | ";
} else {
$first = false;
}
echo $ext;
}
?>
</p>

View file

@ -2,7 +2,7 @@
?>
<form action="#" role="form" id="finishSettingsForm">
<h3 class="form-title">Media Settings</h3>
<h3 class="form-title">Setup Complete!</h3>
<span id="helpBlock" class="help-block help-message"></span>
<p>
Looks like you're almost done! Click "Done!" to bring up the Airtime configuration checklist; if

View file

@ -10,6 +10,44 @@
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# G E N E R A L S E T T I N G S
# ----------------------------------------------------------------------
#
# These settings are used for Airtime's webserver configuration, and
# for general-purpose properties.
#
# api_key: The API key for your Airtime installation.
# The value is generated the first time you use Airtime.
#
# web_server_user: The default webserver user.
# The default is www-data.
#
# base_url: The host name for your webserver.
# The default is localhost.
#
# base_port: The port for your webserver.
# The default is 80.
#
# base_dir: The root directory for your Airtime installation
# on your webserver, relative to the base_url.
# The default is /.
#
# cache_ahead_hours: How many hours ahead of time the Airtime playout
# engine (PYPO) should cache scheduled media files.
# The default is 1.
#
[general]
api_key =
web_server_user = www-data
base_url = localhost
base_port = 80
base_dir = /
cache_ahead_hours = 1
#
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# D A T A B A S E
# ----------------------------------------------------------------------
@ -69,44 +107,6 @@ vhost = /airtime
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# G E N E R A L S E T T I N G S
# ----------------------------------------------------------------------
#
# These settings are used for Airtime's webserver configuration, and
# for general-purpose properties.
#
# api_key: The API key for your Airtime installation.
# The value is generated the first time you use Airtime.
#
# web_server_user: The default webserver user.
# The default is www-data.
#
# base_url: The host name for your webserver.
# The default is localhost.
#
# base_port: The port for your webserver.
# The default is 80.
#
# base_dir: The root directory for your Airtime installation
# on your webserver, relative to the base_url.
# The default is /.
#
# cache_ahead_hours: How many hours ahead of time the Airtime playout
# engine (PYPO) should cache scheduled media files.
# The default is 1.
#
[general]
api_key =
web_server_user = www-data
base_url = localhost
base_port = 80
base_dir = /
cache_ahead_hours = 1
#
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# M O N I T
# ----------------------------------------------------------------------
@ -124,6 +124,47 @@ monit_password = airtime
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# M E D I A M O N I T O R
# ----------------------------------------------------------------------
#
# api_client: ???
#
# bin_dir: Directory containing media monitor binaries
#
# log_dir: Directory containing media monitor log files
#
# check_filesystem_events: How long to queue up events performed on the
# files themselves
#
# check_airtime_events: How long to queue metadata input from airtime
#
# touch_interval
#
# chunking_number
#
# request_max_wait
#
# rmq_event_wait
#
# logpath
#
# index_path
#
[media-monitor]
api_client = "airtime"
check_filesystem_events = 5
check_airtime_events = 30
touch_interval = 5
chunking_number = 450
request_max_wait = 3.0
rmq_event_wait = 0.1
logpath = '/var/log/airtime/media-monitor/media-monitor.log'
index_path = '/var/tmp/airtime/media-monitor/last_index'
#
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# S O U N D C L O U D
# ----------------------------------------------------------------------

View file

@ -18,12 +18,13 @@ body {
.table {
padding: 0;
margin: 3em 0 0 0;
margin: 1em 0 0 0;
}
.checklist {
overflow: auto;
height: 50%;
min-height: 200px;
}
.caption {
@ -40,7 +41,7 @@ body {
}
.check {
background: #dff0d8 url("css/images/accept.png") no-repeat center;
background: #dff0d8 url("../images/accept.png") no-repeat center;
}
.footer {

View file

@ -143,7 +143,7 @@ form .form-group {
* Button Styles
*
* ############################################################################ */
.btn-primary {
font-weight: bold;
}

View file

@ -78,11 +78,15 @@ function removeOverlay() {
}
function formSlide(dir) {
var delta = (dir == "next") ? "-=100%" : "+=100%";
$(".btn").attr("disabled", "disabled");
$(".form-slider").animate({left: delta}, 500, function() {
$(".btn").removeAttr("disabled");
});
var delta = (dir == "next") ? "-=100%" : "+=100%",
parent = $(this).parents("div.form-wrapper"),
toForm = (dir == "next") ? parent.next() : parent.prev();
parent.find(".btn").attr("disabled", "disabled");
toForm.find(".btn").removeAttr("disabled");
toForm.find(":input :first").focus();
$(".form-slider").animate({left: delta}, 500);
var stepCount = $("#stepCount"),
steps = parseInt(stepCount.html());
stepCount.html((dir == "next") ? (steps + 1) : (steps - 1));
@ -93,14 +97,14 @@ function formSlide(dir) {
* Fade out the previous setup step and fade in the next one
*/
function nextSlide() {
formSlide("next");
formSlide.call($(this), "next");
}
/**
* Fade out the current setup step and fade in the previous one
*/
function prevSlide() {
formSlide("prev");
formSlide.call($(this), "prev");
}
/**
@ -118,7 +122,7 @@ function submitForm(e, obj) {
var d = $(e.target).serializeArray();
addOverlay();
// Append .promise().done() rather than using a
// callback to avoid weird alert duplication
// callback to avoid call duplication
$("#overlay, #loadingImage").fadeIn(500).promise().done(function() {
// Proxy function for passing the event to the cleanup function
var cleanupProxy = function(data) {
@ -131,6 +135,8 @@ function submitForm(e, obj) {
$(function() {
// Stop the user from dragging the slider
$(".form-slider").draggable('disable');
$(".btn").attr("disabled", "disabled");
$("form:first .btn").removeAttr("disabled");
window.onresize = function() {
var headerHeight = $(".header").outerHeight(),

View file

@ -9,6 +9,8 @@
* Wrapper class for finalizing and moving airtime.conf
*/
class FinishSetup extends Setup {
const AIRTIME_CONF_PATH = "/etc/airtime/airtime.conf";
function __construct($settings) {
}
@ -17,7 +19,7 @@ class FinishSetup extends Setup {
$message = null;
$errors = array();
if ($this->checkAirtimeConfigDirectory()) {
if (file_exists("/etc/airtime/")) {
if (!$this->moveAirtimeConfig()) {
$message = "Error moving airtime.conf or deleting /tmp/airtime.conf.temp!";
$errors[] = "ERR";
@ -26,20 +28,31 @@ class FinishSetup extends Setup {
$message = "Failed to move airtime.conf; /etc/airtime doesn't exist!";
$errors[] = "ERR";
}
if (empty($errors)) {
// Write service configurations for pypo and media-monitor
$this->startServices();
}
return array(
"message" => $message,
"errors" => $errors,
);
}
function checkAirtimeConfigDirectory() {
return file_exists("/etc/airtime/");
}
/**
* Moves /tmp/airtime.conf.temp to /etc/airtime.conf and then removes it to complete setup
* @return boolean false if either of the copy or removal operations fail
*/
function moveAirtimeConfig() {
return copy(AIRTIME_CONF_TEMP_PATH, "/etc/airtime/airtime.conf")
return copy(AIRTIME_CONF_TEMP_PATH, self::AIRTIME_CONF_PATH)
&& unlink(AIRTIME_CONF_TEMP_PATH);
}
function startServices() {
exec("service airtime-media-monitor start-with-monit");
exec("service airtime-playout start-with-monit");
exec("service airtime-liquidsoap start-with-monit");
}
}