1
0
Fork 0
mirror of synced 2024-07-08 07:55:48 +12:00
appwrite/app/tasks/ssl.php

22 lines
671 B
PHP
Raw Normal View History

2020-07-29 07:48:51 +12:00
<?php
global $cli;
2022-04-11 19:56:58 +12:00
use Appwrite\Event\Event;
2020-07-29 07:48:51 +12:00
use Utopia\App;
use Utopia\CLI\Console;
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-04-27 21:02:31 +12:00
Console::success('Scheduling a job to issue a TLS certificate for domain:' . $domain);
2020-07-29 07:48:51 +12:00
2022-04-11 19:56:58 +12:00
// Scheduje a job
Resque::enqueue(Event::CERTIFICATES_QUEUE_NAME, Event::CERTIFICATES_CLASS_NAME, [
2020-07-29 07:48:51 +12:00
'domain' => $domain,
2022-05-12 01:11:58 +12:00
'skipRenewCheck' => true
2020-07-29 07:48:51 +12:00
]);
});