1
0
Fork 0
mirror of synced 2024-07-03 21:50:34 +12:00
appwrite/app/tasks/ssl.php

25 lines
693 B
PHP
Raw Normal View History

2020-07-29 07:48:51 +12:00
<?php
global $cli;
use Appwrite\Event\Certificate;
2020-07-29 07:48:51 +12:00
use Utopia\App;
use Utopia\CLI\Console;
use Utopia\Database\Document;
2022-04-11 19:56:58 +12:00
use Utopia\Validator\Hostname;
2020-07-29 07:48:51 +12:00
$cli
->task('ssl')
->desc('Validate server certificates')
2022-04-11 19:56:58 +12:00
->param('domain', App::getEnv('_APP_DOMAIN', ''), new Hostname(), 'Domain to generate certificate for. If empty, main domain will be used.', true)
->action(function ($domain) {
2022-05-13 00:13:47 +12:00
Console::success('Scheduling a job to issue a TLS certificate for domain: ' . $domain);
2020-07-29 07:48:51 +12:00
(new Certificate())
->setDomain(new Document([
'domain' => $domain
]))
->setSkipRenewCheck(true)
->trigger();
});