Unify to a single console command location.

This commit is contained in:
Buster "Silver Eagle" Neece 2020-01-24 23:08:25 -06:00
parent 765a01c2d8
commit 6b92475d8d
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
9 changed files with 96 additions and 95 deletions

View File

@ -1,3 +0,0 @@
#!/usr/bin/env php
<?php
include __DIR__.'/azuracast.php';

View File

@ -1,17 +0,0 @@
<?php
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
ini_set('display_errors', 1);
$autoloader = require dirname(__DIR__) . '/vendor/autoload.php';
$app = App\AppFactory::create($autoloader, [
Azura\Settings::BASE_DIR => dirname(__DIR__),
]);
$di = $app->getContainer();
App\Customization::initCli();
/** @var Azura\Console\Application $cli */
$cli = $di->get(Azura\Console\Application::class);
$cli->run();

View File

@ -1,3 +1,18 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
include __DIR__.'/azuracast.php'; error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
ini_set('display_errors', 1);
$autoloader = require dirname(__DIR__) . '/vendor/autoload.php';
$app = App\AppFactory::create($autoloader, [
Azura\Settings::BASE_DIR => dirname(__DIR__),
]);
$di = $app->getContainer();
App\Customization::initCli();
/** @var Azura\Console\Application $cli */
$cli = $di->get(Azura\Console\Application::class);
$cli->run();

View File

@ -109,7 +109,7 @@
} }
}, },
"bin": [ "bin": [
"bin/azuracast" "bin/console"
], ],
"config": { "config": {
"preferred-install": "dist" "preferred-install": "dist"

View File

@ -16,8 +16,8 @@ fi
BASE_DIR=`pwd` BASE_DIR=`pwd`
# Create backup from existing installation. # Create backup from existing installation.
chmod a+x bin/azuracast chmod a+x bin/console
./bin/azuracast azuracast:backup --exclude-media migration.zip ./bin/console azuracast:backup --exclude-media migration.zip
read -n 1 -s -r -p "Database backed up. Press any key to continue (Install Docker)..." read -n 1 -s -r -p "Database backed up. Press any key to continue (Install Docker)..."

View File

@ -719,7 +719,7 @@ class Liquidsoap extends AbstractBackend implements EventSubscriberInterface
} }
} else { } else {
// Ansible shell-script call. // Ansible shell-script call.
$shell_path = '/usr/bin/php ' . $settings->getBaseDirectory() . '/bin/azuracast'; $shell_path = '/usr/bin/php ' . $settings->getBaseDirectory() . '/bin/console';
$shell_args = []; $shell_args = [];
$shell_args[] = 'azuracast:internal:' . $endpoint; $shell_args[] = 'azuracast:internal:' . $endpoint;

View File

@ -6,7 +6,7 @@
$this->layout('main', [ $this->layout('main', [
'title' => __('Backups'), 'title' => __('Backups'),
'manual' => true 'manual' => true,
]); ]);
$assets $assets
@ -69,7 +69,7 @@ $assets
<?php if (\App\Settings::getInstance()->isDocker()): ?> <?php if (\App\Settings::getInstance()->isDocker()): ?>
<pre><code>./docker.sh restore path_to_backup.zip</code></pre> <pre><code>./docker.sh restore path_to_backup.zip</code></pre>
<?php else: ?> <?php else: ?>
<pre><code>/var/azuracast/www/bin/azuracast azuracast:restore path_to_backup.zip</code></pre> <pre><code>/var/azuracast/www/bin/console azuracast:restore path_to_backup.zip</code></pre>
<?php endif; ?> <?php endif; ?>
<p class="card-text text-warning"><?=__('Note that restoring a backup will clear your existing database. Never restore backup files from untrusted users.')?></p> <p class="card-text text-warning"><?=__('Note that restoring a backup will clear your existing database. Never restore backup files from untrusted users.')?></p>
@ -107,14 +107,21 @@ $assets
<tr class="align-middle"> <tr class="align-middle">
<td> <td>
<div class="btn-group btn-group-sm"> <div class="btn-group btn-group-sm">
<a class="btn btn-sm btn-primary" href="<?=$router->fromHere('admin:backups:download', ['path' => base64_encode($row['path'])]) ?>"><?=__('Download') ?></a> <a class="btn btn-sm btn-primary" href="<?=$router->fromHere('admin:backups:download',
<a class="btn btn-sm btn-danger" href="<?=$router->fromHere('admin:backups:delete', ['path' => base64_encode($row['path']), 'csrf' => $csrf]) ?>" data-confirm-title="<?=$this->e(__('Delete backup "%s"?', $row['filename'])) ?>"><?=__('Delete') ?></a> ['path' => base64_encode($row['path'])])?>"><?=__('Download')?></a>
<a class="btn btn-sm btn-danger" href="<?=$router->fromHere('admin:backups:delete', [
'path' => base64_encode($row['path']),
'csrf' => $csrf,
])?>" data-confirm-title="<?=$this->e(__('Delete backup "%s"?',
$row['filename']))?>"><?=__('Delete')?></a>
</div> </div>
</td> </td>
<td> <td>
<big><?=$this->e($row['basename'])?></big> <big><?=$this->e($row['basename'])?></big>
</td> </td>
<td><time data-content="<?=$row['timestamp'] ?>"><?=gmdate('Y-m-d', $row['timestamp']) ?></time></td> <td>
<time data-content="<?=$row['timestamp']?>"><?=gmdate('Y-m-d', $row['timestamp'])?></time>
</td>
<td><span data-file-size="<?=$row['size']?>"><?=$row['size']?></span></td> <td><span data-file-size="<?=$row['size']?>"><?=$row['size']?></span></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
@ -128,7 +135,8 @@ $assets
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" id="modal-log-view-label"><?=__('Most Recent Backup Log')?></h4> <h4 class="modal-title" id="modal-log-view-label"><?=__('Most Recent Backup Log')?></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<pre id="modal-log-view-contents"><?=$last_output?></pre> <pre id="modal-log-view-contents"><?=$last_output?></pre>

View File

@ -3,16 +3,16 @@
file: path="{{ item }}" state=touch mode="a+x" file: path="{{ item }}" state=touch mode="a+x"
with_items: with_items:
- "{{ www_base }}/update.sh" - "{{ www_base }}/update.sh"
- "{{ www_base }}/bin/azuracast" - "{{ www_base }}/bin/console"
- name: Run AzuraCast Setup (Install Mode) - name: Run AzuraCast Setup (Install Mode)
become: true become: true
become_user: azuracast become_user: azuracast
shell: php {{ www_base }}/bin/azuracast.php azuracast:setup shell: php {{ www_base }}/bin/console azuracast:setup
when: update_mode|bool == false when: update_mode|bool == false
- name: Run AzuraCast Setup (Update Mode) - name: Run AzuraCast Setup (Update Mode)
become: true become: true
become_user: azuracast become_user: azuracast
shell: php {{ www_base }}/bin/azuracast.php azuracast:setup --update shell: php {{ www_base }}/bin/console azuracast:setup --update
when: update_mode|bool == true when: update_mode|bool == true

View File

@ -1,2 +0,0 @@
<?php
include dirname(__DIR__) . '/bin/azuracast.php';