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

269 lines
12 KiB
PHP
Raw Permalink 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.
*/
global $extensions;
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'];
$systemd = with_systemd();
2014-11-28 21:30:11 +01:00
if ($systemd) {
$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>
2022-07-07 20:01:15 +02: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">
</head>
<style>
/*
This is here because we're using the config-check css for
both this page and the system status page
*/
2022-07-07 20:01:15 +02:00
html {
background-color: #f5f5f5;
}
2020-01-30 14:47:36 +01:00
2022-07-07 20:01:15 +02: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
2022-07-07 20:01:15 +02:00
<body>
<h2>
<img class="logo" src="css/images/airtime_logo_jp.png" /><br />
<strong>Configuration Checklist</strong>
</h2>
<?php if (!$result) { ?>
2022-07-07 20:01:15 +02:00
<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, read the
<a href="https://github.com/libretime/libretime/releases">release notes</a>,
come <a href="https://discourse.libretime.org/">visit our discourse</a>
2022-08-25 16:25:54 +02:00
or, check <a href="https://www.libretime.org/">the website and main docs</a>.
2022-07-07 20:01:15 +02:00
</p>
<?php } else { ?>
2022-07-07 20:01:15 +02:00
<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 } ?>
2022-07-07 20:01:15 +02:00
<table class="table">
<thead>
<tr>
<th class="component">
Component
</th>
<th class="description">
<strong>Description</strong>
</th>
<th class="solution">
<strong>Status or Solution</strong>
</th>
</tr>
</thead>
</table>
<div class="checklist">
<table class="table table-striped">
<caption class="caption">
PHP Dependencies
</caption>
<tbody>
<tr class="<?php echo $postgres ? 'success' : 'danger'; ?>">
<td class="component">
Postgres
</td>
<td class="description">
PDO and PostgreSQL libraries
</td>
<?php if ($postgres) { ?>
<td class="solution check"></td>
<?php } else { ?>
<td class="solution">Try running <code>sudo apt-get install php5-pgsql</code></td>
<?php } ?>
2014-11-28 21:30:11 +01:00
</tr>
2022-07-07 20:01:15 +02:00
</tbody>
2014-11-28 21:30:11 +01:00
</table>
2022-07-07 20:01:15 +02:00
<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>
<?php if ($database) { ?>
<td class="solution check"></td>
<?php } else { ?>
<td class="solution">
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.
</td>
<?php } ?>
2014-11-28 21:30:11 +01:00
</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>
<?php if ($rabbitmq) { ?>
<td class="solution check"></td>
<?php } else { ?>
<td class="solution">
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>
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.
</td>
<?php } ?>
</tr>
<?php if ($systemd) { ?>
<tr class="<?php echo $analyzer ? 'success' : 'danger'; ?>">
<td class="component">
Media Analyzer
</td>
<td class="description">
<?php echo _('LibreTime media analyzer service'); ?>
</td>
<?php if ($analyzer) { ?>
<td class="solution check"></td>
<?php } else { ?>
<td class="solution">
<?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 "); ?>
<br /><code>systemctl status libretime-analyzer</code><br />
<?php echo _('If not, try '); ?><br /><code>sudo systemctl restart libretime-analyzer</code>
</td>
<?php } ?>
</tr>
<tr class="<?php echo $pypo ? 'success' : 'danger'; ?>">
<td class="component">
Pypo
</td>
<td class="description">
<?php echo _('LibreTime playout service'); ?>
</td>
<?php if ($pypo) { ?>
<td class="solution check"></td>
<?php } else { ?>
<td class="solution">
<?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 "); ?>
<br /><code>systemctl status libretime-playout</code><br />
<?php echo _('If not, try '); ?><br /><code>sudo systemctl restart libretime-playout</code>
</td>
<?php } ?>
</tr>
<tr class="<?php echo $liquidsoap ? 'success' : 'danger'; ?>">
<td class="component">
Liquidsoap
</td>
<td class="description">
<?php echo _('LibreTime liquidsoap service'); ?>
</td>
<?php if ($liquidsoap) { ?>
<td class="solution check"></td>
<?php } else { ?>
<td class="solution">
<?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 "); ?>
<br /><code>systemctl status libretime-liquidsoap</code><br />
<?php echo _('If not, try '); ?><br /><code>sudo systemctl restart libretime-liquidsoap</code>
</td>
<?php } ?>
</tr>
<tr class="<?php echo $celery ? 'success' : 'danger'; ?>">
<td class="component">
Celery
</td>
<td class="description">
<?php echo _('LibreTime Celery Task service'); ?>
</td>
<?php if ($celery) { ?>
<td class="solution check"></td>
<?php } else { ?>
<td class="solution">
<?php echo _('Check that the libretime-worker service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
<?php echo _(" and ensure that it's running with "); ?>
<br /><code>systemctl status libretime-worker</code><br />
<?php echo _('If not, try '); ?><br /><code>sudo systemctl restart libretime-worker</code>
</td>
<?php } ?>
</tr>
<tr class="<?php echo $api ? 'success' : 'danger'; ?>">
<td class="component">
API
</td>
<td class="description">
<?php echo _('LibreTime API service'); ?>
</td>
<?php if ($api) { ?>
<td class="solution check"></td>
<?php } else { ?>
<td class="solution">
<?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 "); ?>
<br /><code>systemctl status libretime-api</code><br />
<?php echo _('If not, try '); ?><br /><code>sudo systemctl restart libretime-api</code>
</td>
<?php } ?>
</tr>
<?php } ?>
2022-07-07 20:01:15 +02:00
</tbody>
</table>
</div>
<div class="footer">
<h3>
PHP Extension List
</h3>
<p>
<?php echo implode('|', $extensions); ?>
2022-07-07 20:01:15 +02:00
</p>
</div>