2019-09-11 01:10:57 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use App\Console\Command;
|
2020-02-06 03:35:13 +01:00
|
|
|
use App\Console\Application;
|
|
|
|
use App\Settings;
|
2019-09-11 01:10:57 +02:00
|
|
|
|
2019-11-22 11:44:03 +01:00
|
|
|
return function (Application $console) {
|
2019-09-11 01:10:57 +02:00
|
|
|
// Set console version and name.
|
|
|
|
$di = $console->getContainer();
|
|
|
|
|
|
|
|
/** @var App\Version $version */
|
|
|
|
$version = $di->get(App\Version::class);
|
|
|
|
|
|
|
|
/** @var Settings $settings */
|
|
|
|
$settings = $di->get(Settings::class);
|
|
|
|
|
2019-11-22 11:44:03 +01:00
|
|
|
$console->setName($settings[Settings::APP_NAME] . ' Command Line Tools (' . $settings[Settings::APP_ENV] . ')');
|
2019-09-11 01:10:57 +02:00
|
|
|
$console->setVersion($version->getVersion());
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Register commands.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Liquidsoap Internal CLI commands
|
|
|
|
$console->command(
|
|
|
|
'azuracast:internal:auth station-id [--dj-user=] [--dj-password=]',
|
|
|
|
Command\Internal\DjAuthCommand::class
|
|
|
|
)->setDescription('Authorize a streamer to connect as a source for the radio service.');
|
|
|
|
|
|
|
|
$console->command(
|
2020-01-29 03:23:55 +01:00
|
|
|
'azuracast:internal:djoff station-id [--dj-user=]',
|
2019-09-11 01:10:57 +02:00
|
|
|
Command\Internal\DjOffCommand::class
|
|
|
|
)->setDescription('Indicate that a DJ has finished streaming to a station.');
|
|
|
|
|
|
|
|
$console->command(
|
2020-01-29 03:23:55 +01:00
|
|
|
'azuracast:internal:djon station-id [--dj-user=]',
|
2019-09-11 01:10:57 +02:00
|
|
|
Command\Internal\DjOnCommand::class
|
|
|
|
)->setDescription('Indicate that a DJ has begun streaming to a station.');
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'azuracast:internal:feedback station-id [-s|--song=] [-m|--media=] [-p|--playlist=]',
|
|
|
|
Command\Internal\FeedbackCommand::class
|
|
|
|
)->setDescription('Send upcoming song feedback from the AutoDJ back to AzuraCast.');
|
|
|
|
|
|
|
|
$console->command(
|
2020-01-05 22:29:56 +01:00
|
|
|
'azuracast:internal:sftp-upload action username path target-path ssh-cmd',
|
2020-01-08 20:24:33 +01:00
|
|
|
Command\Internal\SftpUploadCommand::class
|
2020-01-05 22:29:56 +01:00
|
|
|
)->setDescription('Process a file uploaded via SFTP');
|
2019-09-11 01:10:57 +02:00
|
|
|
|
2020-01-08 20:24:33 +01:00
|
|
|
$console->command(
|
|
|
|
'azuracast:internal:sftp-auth',
|
|
|
|
Command\Internal\SftpAuthCommand::class
|
|
|
|
)->setDescription('Attempt SFTP authentication');
|
|
|
|
|
2019-09-11 01:10:57 +02:00
|
|
|
$console->command(
|
2019-09-11 19:58:22 +02:00
|
|
|
'azuracast:internal:nextsong station-id [as-autodj]',
|
2019-09-11 01:10:57 +02:00
|
|
|
Command\Internal\NextSongCommand::class
|
2019-09-11 19:58:22 +02:00
|
|
|
)->defaults([
|
|
|
|
'as-autodj' => true,
|
|
|
|
])->setDescription('Return the next song to the AutoDJ.');
|
2019-09-11 01:10:57 +02:00
|
|
|
|
2019-11-22 11:44:03 +01:00
|
|
|
$console->command(
|
|
|
|
'azuracast:internal:ip',
|
|
|
|
Command\Internal\GetIpCommand::class
|
|
|
|
)->setDescription('Get the external IP address for this instance.');
|
|
|
|
|
2019-09-11 01:10:57 +02:00
|
|
|
// Locales
|
|
|
|
$console->command(
|
|
|
|
'locale:generate',
|
|
|
|
Command\LocaleGenerateCommand::class
|
|
|
|
)->setDescription(__('Generate the translation locale file.'));
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'locale:import',
|
|
|
|
Command\LocaleImportCommand::class
|
|
|
|
)->setDescription(__('Convert translated locale files into PHP arrays.'));
|
|
|
|
|
|
|
|
// Setup
|
|
|
|
$console->command(
|
|
|
|
'azuracast:config:migrate',
|
|
|
|
Command\MigrateConfigCommand::class
|
|
|
|
)->setDescription(__('Migrate existing configuration to new INI format if any exists.'));
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'azuracast:setup:influx',
|
|
|
|
Command\SetupInfluxCommand::class
|
|
|
|
)->setDescription(__('Initial setup of InfluxDB.'));
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'azuracast:setup:fixtures',
|
|
|
|
Command\SetupFixturesCommand::class
|
|
|
|
)->setDescription(__('Install fixtures for demo / local development.'));
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'azuracast:setup [--update] [--load-fixtures] [--release]',
|
|
|
|
Command\SetupCommand::class
|
|
|
|
)->setDescription(__('Run all general AzuraCast setup steps.'));
|
|
|
|
|
|
|
|
// Maintenance
|
|
|
|
$console->command(
|
2019-09-19 04:31:13 +02:00
|
|
|
'azuracast:radio:restart [station-name]',
|
2019-09-11 01:10:57 +02:00
|
|
|
Command\RestartRadioCommand::class
|
2019-09-19 04:31:13 +02:00
|
|
|
)->setDescription('Restart all radio stations, or a single one if specified.');
|
2019-09-11 01:10:57 +02:00
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'sync:run [task]',
|
|
|
|
Command\SyncCommand::class
|
|
|
|
)->setDescription(__('Run one or more scheduled synchronization tasks.'));
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'queue:process [runtime]',
|
|
|
|
Command\ProcessMessageQueueCommand::class
|
|
|
|
)->setDescription(__('Process the message queue.'));
|
|
|
|
|
|
|
|
$console->command(
|
2019-12-15 09:53:04 +01:00
|
|
|
'azuracast:media:reprocess [station-name]',
|
2019-09-11 01:10:57 +02:00
|
|
|
Command\ReprocessMediaCommand::class
|
|
|
|
)->setDescription('Manually reload all media metadata from file.');
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'azuracast:api:docs',
|
|
|
|
Command\GenerateApiDocsCommand::class
|
|
|
|
)->setDescription('Trigger regeneration of AzuraCast API documentation.');
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'azuracast:internal:uptime-wait [service]',
|
|
|
|
Command\UptimeWaitCommand::class
|
|
|
|
)->setDescription('Wait until a service is online and accepting connections before continuing.');
|
|
|
|
|
|
|
|
// User-side tools
|
|
|
|
$console->command(
|
|
|
|
'azuracast:account:reset-password email',
|
|
|
|
Command\ResetPasswordCommand::class
|
|
|
|
)->setDescription('Reset the password of the specified account.');
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'azuracast:account:set-administrator email',
|
|
|
|
Command\SetAdministratorCommand::class
|
|
|
|
)->setDescription('Set the account specified as a global administrator.');
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'azuracast:settings:list',
|
|
|
|
Command\ListSettingsCommand::class
|
|
|
|
)->setDescription(__('List all settings in the AzuraCast settings database.'));
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'azuracast:settings:set setting-key setting-value',
|
|
|
|
Command\SetSettingCommand::class
|
|
|
|
)->setDescription('Set the value of a setting in the AzuraCast settings database.');
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'azuracast:backup [path] [--exclude-media]',
|
|
|
|
Command\BackupCommand::class
|
|
|
|
)->setDescription(__('Back up the AzuraCast database and statistics (and optionally media).'));
|
|
|
|
|
|
|
|
$console->command(
|
|
|
|
'azuracast:restore path [--restore] [--release]',
|
|
|
|
Command\RestoreCommand::class
|
|
|
|
)->setDescription('Restore a backup previously generated by AzuraCast.');
|
|
|
|
};
|