sintonia/legacy/application/configs/config-check.php

297 lines
12 KiB
PHP
Raw Normal View History

2014-11-28 21:30:11 +01:00
<?php
/*
* We only get here after setup, or if there's an error in the configuration.
*
* Display a table to the user showing the necessary dependencies
* (both PHP and binary) and the status of any application services,
* along with steps to fix them if they're not found or misconfigured.
*/
2021-10-11 16:10:47 +02:00
$phpDependencies = checkPhpDependencies();
$externalServices = checkExternalServices();
$postgres = $phpDependencies['postgres'];
2014-11-28 21:30:11 +01:00
2021-10-11 16:10:47 +02:00
$database = $externalServices['database'];
$rabbitmq = $externalServices['rabbitmq'];
2014-11-28 21:30:11 +01:00
2021-10-11 16:10:47 +02:00
$pypo = $externalServices['pypo'];
$liquidsoap = $externalServices['liquidsoap'];
$analyzer = $externalServices['analyzer'];
$celery = $externalServices['celery'];
$api = $externalServices['api'];
2014-11-28 21:30:11 +01:00
2021-10-11 16:10:47 +02:00
$r1 = array_reduce($phpDependencies, 'booleanReduce', true);
$r2 = array_reduce($externalServices, 'booleanReduce', true);
$result = $r1 && $r2;
2014-11-28 21:30:11 +01:00
?>
2014-12-09 23:48:16 +01:00
<html>
2014-11-28 21:30:11 +01:00
<head>
<link rel="stylesheet" type="text/css" href="css/bootstrap-3.3.1.min.css">
<link rel="stylesheet" type="text/css" href="css/setup/config-check.css">
2014-11-28 21:30:11 +01:00
</head>
<style>
2020-01-30 14:47:36 +01:00
/*
This is here because we're using the config-check css for
both this page and the system status page
*/
html {
background-color: #f5f5f5;
}
2020-01-30 14:47:36 +01:00
body {
padding: 2em;
min-width: 600px;
text-align: center;
margin: 3em ;
border: 1px solid lightgray;
border-radius: 5px;
}
</style>
2014-11-28 21:30:11 +01:00
2014-12-09 23:48:16 +01:00
<body>
2014-11-28 21:30:11 +01:00
<h2>
2014-12-09 23:48:16 +01:00
<img class="logo" src="css/images/airtime_logo_jp.png" /><br/>
2014-11-28 21:30:11 +01:00
<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
2018-02-04 14:20:36 +01:00
still experiencing issues, read the
2022-03-29 13:07:38 +02:00
<a href="https://github.com/libretime/libretime/releases">release notes</a>,
2018-02-04 14:20:36 +01:00
come <a href="https://discourse.libretime.org/">visit our discourse</a>
or, check <a href="http://www.libretime.org/">the website and main docs</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
}
?>
2014-12-09 23:48:16 +01:00
<table class="table">
2014-11-28 21:30:11 +01:00
<thead>
<tr>
<th class="component">
2014-11-28 21:30:11 +01:00
Component
</th>
<th class="description">
<strong>Description</strong>
</th>
<th class="solution">
<strong>Status or Solution</strong>
</th>
2014-11-28 21:30:11 +01:00
</tr>
</thead>
</table>
<div class="checklist">
<table class="table table-striped">
<caption class="caption">
PHP Dependencies
</caption>
<tbody>
2021-10-11 16:10:47 +02:00
<tr class="<?php echo $postgres ? 'success' : 'danger'; ?>">
2014-11-28 21:30:11 +01:00
<td class="component">
Postgres
</td>
<td class="description">
PDO and PostgreSQL libraries
</td>
2021-10-11 16:10:47 +02:00
<td class="solution <?php if ($postgres) {
echo 'check'; ?>">
2014-11-28 21:30:11 +01:00
<?php
2021-10-11 16:10:47 +02:00
} else {
?>">
2014-11-28 21:30:11 +01:00
Try running <code>sudo apt-get install php5-pgsql</code>
<?php
2021-10-11 16:10:47 +02:00
}
2014-11-28 21:30:11 +01:00
?>
</td>
</tr>
</tbody>
</table>
<table class="table table-striped">
<caption class="caption">
External Services
</caption>
<tbody>
2021-10-11 16:10:47 +02:00
<tr class="<?php echo $database ? 'success' : 'danger'; ?>">
2014-11-28 21:30:11 +01:00
<td class="component">
Database
</td>
<td class="description">
Database configuration for Airtime
</td>
2021-10-11 16:10:47 +02:00
<td class="solution <?php if ($database) {
echo 'check'; ?>">
2014-11-28 21:30:11 +01:00
<?php
2021-10-11 16:10:47 +02:00
} else {
?>">
2014-11-28 21:30:11 +01:00
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><?php echo LIBRETIME_CONFIG_FILEPATH; ?></code> are correct and the Airtime database was installed correctly.
2014-11-28 21:30:11 +01:00
<?php
2021-10-11 16:10:47 +02:00
}
2014-11-28 21:30:11 +01:00
?>
</td>
</tr>
2021-10-11 16:10:47 +02:00
<tr class="<?php echo $rabbitmq ? 'success' : 'danger'; ?>">
<td class="component">
RabbitMQ
</td>
<td class="description">
RabbitMQ configuration for Airtime
</td>
2021-10-11 16:10:47 +02:00
<td class="solution <?php if ($rabbitmq) {
echo 'check'; ?>">
<?php
} else {
?>">
Make sure RabbitMQ is installed correctly, and that your settings in <?php echo LIBRETIME_CONFIG_FILEPATH; ?>
are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code>
2020-01-30 14:47:36 +01:00
to see if the airtime user (or your custom RabbitMQ user) exists, then checking that
<code>sudo rabbitmqctl list_exchanges</code> contains entries for airtime-pypo and airtime-uploads.
<?php
}
?>
</td>
</tr>
2021-10-11 16:10:47 +02:00
<tr class="<?php echo $analyzer ? 'success' : 'danger'; ?>">
<td class="component">
2020-05-19 16:16:31 +02:00
Media Analyzer
</td>
<td class="description">
2021-10-11 16:10:47 +02:00
<?php echo _('LibreTime media analyzer service'); ?>
</td>
2021-10-11 16:10:47 +02:00
<td class="solution <?php if ($analyzer) {
echo 'check'; ?>">
<?php
} else {
?>">
2021-10-11 16:10:47 +02:00
<?php echo _('Check that the libretime-analyzer service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
<?php echo _(" and ensure that it's running with "); ?>
2020-05-19 16:16:31 +02:00
<br/><code>systemctl status libretime-analyzer</code><br/>
2021-10-11 16:10:47 +02:00
<?php echo _('If not, try '); ?><br/><code>sudo systemctl restart libretime-analyzer</code>
<?php
}
?>
</td>
</tr>
2021-10-11 16:10:47 +02:00
<tr class="<?php echo $pypo ? 'success' : 'danger'; ?>">
<td class="component">
Pypo
</td>
<td class="description">
2021-10-11 16:10:47 +02:00
<?php echo _('LibreTime playout service'); ?>
</td>
2021-10-11 16:10:47 +02:00
<td class="solution <?php if ($pypo) {
echo 'check'; ?>">
<?php
} else {
?>">
2021-10-11 16:10:47 +02:00
<?php echo _('Check that the libretime-playout service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
<?php echo _(" and ensure that it's running with "); ?>
2020-05-19 16:16:31 +02:00
<br/><code>systemctl status libretime-playout</code><br/>
2021-10-11 16:10:47 +02:00
<?php echo _('If not, try '); ?><br/><code>sudo systemctl restart libretime-playout</code>
<?php
}
?>
</td>
</tr>
2021-10-11 16:10:47 +02:00
<tr class="<?php echo $liquidsoap ? 'success' : 'danger'; ?>">
<td class="component">
Liquidsoap
</td>
<td class="description">
2021-10-11 16:10:47 +02:00
<?php echo _('LibreTime liquidsoap service'); ?>
</td>
2021-10-11 16:10:47 +02:00
<td class="solution <?php if ($liquidsoap) {
echo 'check'; ?>" >
<?php
} else {
?>">
2021-10-11 16:10:47 +02:00
<?php echo _('Check that the libretime-liquidsoap service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
<?php echo _(" and ensure that it's running with "); ?>
2020-05-19 16:16:31 +02:00
<br/><code>systemctl status libretime-liquidsoap</code><br/>
2021-10-11 16:10:47 +02:00
<?php echo _('If not, try '); ?><br/><code>sudo systemctl restart libretime-liquidsoap</code>
<?php
}
?>
</td>
</tr>
2021-10-11 16:10:47 +02:00
<tr class="<?php echo $celery ? 'success' : 'danger'; ?>">
<td class="component">
Celery
</td>
<td class="description">
2021-10-11 16:10:47 +02:00
<?php echo _('LibreTime Celery Task service'); ?>
</td>
2021-10-11 16:10:47 +02:00
<td class="solution <?php if ($celery) {
echo 'check'; ?>" >
<?php
} else {
?>">
2021-10-11 16:10:47 +02:00
<?php echo _('Check that the libretime-celery service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
<?php echo _(" and ensure that it's running with "); ?>
2020-05-19 16:16:31 +02:00
<br/><code>systemctl status libretime-celery</code><br/>
2021-10-11 16:10:47 +02:00
<?php echo _('If not, try '); ?><br/><code>sudo systemctl restart libretime-celery</code>
<?php
}
?>
</td>
</tr>
2021-10-11 16:10:47 +02:00
<tr class="<?php echo $api ? 'success' : 'danger'; ?>">
2020-01-30 14:47:36 +01:00
<td class="component">
API
</td>
<td class="description">
2021-10-11 16:10:47 +02:00
<?php echo _('LibreTime API service'); ?>
2020-01-30 14:47:36 +01:00
</td>
2021-10-11 16:10:47 +02:00
<td class="solution <?php if ($api) {
echo 'check'; ?>" >
2020-01-30 14:47:36 +01:00
<?php
} else {
?>">
2021-10-11 16:10:47 +02:00
<?php echo _('Check that the libretime-api service is installed correctly in '); ?><code>/etc/init.d/</code>,
<?php echo _(" and ensure that it's running with "); ?>
2020-01-30 14:47:36 +01:00
<br/><code>systemctl status libretime-api</code><br/>
2021-10-11 16:10:47 +02:00
<?php echo _('If not, try '); ?><br/><code>sudo systemctl restart libretime-api</code>
2020-01-30 14:47:36 +01:00
<?php
}
?>
</td>
</tr>
2014-11-28 21:30:11 +01:00
</tbody>
</table>
2014-12-09 23:48:16 +01:00
</div>
2014-11-28 21:30:11 +01:00
<div class="footer">
<h3>
PHP Extension List
</h3>
<p>
<?php
2014-12-01 21:49:53 +01:00
global $extensions;
2014-12-16 18:24:41 +01:00
$first = true;
2014-11-28 21:30:11 +01:00
foreach ($extensions as $ext) {
2014-12-16 18:24:41 +01:00
if (!$first) {
2021-10-11 16:10:47 +02:00
echo ' | ';
2014-12-16 18:24:41 +01:00
} else {
$first = false;
}
echo $ext;
2014-11-28 21:30:11 +01:00
}
?>
</p>
</div>