1
0
Fork 0
mirror of synced 2024-07-07 23:46:11 +12:00
appwrite/app/workers/certs.php

45 lines
987 B
PHP
Raw Normal View History

2020-02-20 01:12:48 +13:00
<?php
require_once __DIR__.'/../init.php';
2020-02-20 01:41:23 +13:00
cli_set_process_title('Certificates V1 Worker');
2020-02-20 01:12:48 +13:00
2020-02-20 01:41:23 +13:00
echo APP_NAME.' certificates worker v1 has started';
2020-02-20 01:12:48 +13:00
class CertsV1
{
public $args = [];
public function setUp()
{
}
public function perform()
{
global $register;
2020-02-20 01:41:23 +13:00
$domain = $this->args['domain'];
2020-02-20 01:12:48 +13:00
/**
* 1. Get new domain
* 2. Fetch all subdomains
* 3. Check if certificate already exists
* 4. Check if certificate has been changed
2020-02-20 01:41:23 +13:00
* 4.1. Create / renew certificate
2020-02-20 01:12:48 +13:00
* 4.2. Update loadblancer
* 4.3. Update certificate (domains, change date, expiry)
*/
2020-02-20 01:41:23 +13:00
$response = shell_exec("certbot certonly --webroot --noninteractive --agree-tos --email security@appwrite.io \
-w ./certs \
-d {$domain}"); // cert2.tests.appwrite.org
2020-02-20 01:12:48 +13:00
2020-02-20 01:41:23 +13:00
2020-02-20 01:12:48 +13:00
}
public function tearDown()
{
// ... Remove environment for this job
}
}