2020-07-29 07:48:51 +12:00
|
|
|
<?php
|
|
|
|
|
|
|
|
global $cli;
|
|
|
|
|
2022-04-14 00:39:31 +12:00
|
|
|
use Appwrite\Event\Certificate;
|
2020-07-29 07:48:51 +12:00
|
|
|
use Utopia\App;
|
|
|
|
use Utopia\CLI\Console;
|
2022-04-14 00:39:31 +12:00
|
|
|
use Utopia\Database\Document;
|
2020-07-29 07:48:51 +12:00
|
|
|
|
|
|
|
$cli
|
|
|
|
->task('ssl')
|
|
|
|
->desc('Validate server certificates')
|
|
|
|
->action(function () {
|
|
|
|
$domain = App::getEnv('_APP_DOMAIN', '');
|
|
|
|
|
2022-04-14 00:39:31 +12:00
|
|
|
Console::log('Issue a TLS certificate for master domain (' . $domain . ') in 30 seconds.
|
2020-07-29 07:48:51 +12:00
|
|
|
Make sure your domain points to your server or restart to try again.');
|
|
|
|
|
2022-04-14 00:39:31 +12:00
|
|
|
$event = new Certificate();
|
|
|
|
$event
|
|
|
|
->setDomain(new Document([
|
|
|
|
'domain' => $domain
|
|
|
|
]))
|
|
|
|
->trigger();
|
|
|
|
});
|