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

25 lines
833 B
PHP
Raw Normal View History

2020-07-29 07:48:51 +12:00
<?php
global $cli;
use Utopia\App;
use Utopia\CLI\Console;
$cli
->task('ssl')
->desc('Validate server certificates')
->action(function () {
$domain = App::getEnv('_APP_DOMAIN', '');
2022-04-10 21:38:22 +12:00
// TODO: Instead of waiting, let's ping Traefik. If responds, we can schedule instantly
// TODO: Add support for argument (domain)
Console::log('Issue a TLS certificate for master domain ('.$domain.') in 2 seconds.
2020-07-29 07:48:51 +12:00
Make sure your domain points to your server or restart to try again.');
2022-04-10 21:38:22 +12:00
// Const for types not available here
ResqueScheduler::enqueueAt(\time() + 2, 'v1-certificates', 'CertificatesV1', [
2020-07-29 07:48:51 +12:00
'domain' => $domain,
2022-04-10 21:38:22 +12:00
'skipRenewCheck' => true // TODO: Discuss this behabiour. true? false? parameter? How do we document it?
2020-07-29 07:48:51 +12:00
]);
});