/**
 * @param \PhpAmqpLib\Message\AMQPMessage $msg
*/
function process_message($msg)
{
    //  load content queue
    $content = json_decode($msg->body, TRUE);
    // echo "<pre>"; print_r($content); echo "/<pre>";
    if ($content['action'] === 'create' || $content['action'] === 'renew') {
        $renew = $content['action'] === 'renew';
        $infos = $content['infos'];
        $db = new VHFFS();
        $vh = $db->get_httpd_from_servername($infos['domain']);
        $vl = VHFFS_letsencrypt::get_from_httpd_id($vh->httpd_id);
        if (empty($vl)) {
            $vl = new VHFFS_letsencrypt($vh->httpd_id);
        }
        $error = create_cert($infos, $renew);
        if (isset($error)) {
            $vl->cert_error($error);
        } else {
            $vl->cert_ok();
        }
        $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);
    }
}
<?php

require_once __DIR__ . '/../includes/autoload.inc.php';
Admin::restrict('./');
$domains = VHFFS::get_alpha_domains();
echo json_encode($domains);
function ask_for_cert($action, $servername)
{
    global $conf;
    //  get missing data's from VHFFS database
    $owner = VHFFS::get_owner_user_from_httpd_servername($servername);
    $infos = array('domain' => $servername, 'rsa-key-size' => $conf['rsa-key-size'], 'email' => $owner->mail, 'webroot-path' => VHFFS::get_webrootpath_from_servername($servername));
    verify_parameters($infos);
    //  put item into queue
    put_item_into_queue($action, $infos);
}
<?php

require_once __DIR__ . '/../includes/autoload.inc.php';
Admin::restrict('./');
$domains = VHFFS::get_project_domains();
echo json_encode($domains);
Example #5
0
<?php

require_once __DIR__ . '/includes/autoload.inc.php';
Admin::restrict('./');
VHFFS::create_table_if_needed();
?>

<!DOCTYPE html>
<html lang="fr">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
	<title>VHFFS letsencrypt</title>
	
	<!-- Bootstrap -->
	<link href="external/bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<link href="external/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">
	
	<link href="index.css" rel="stylesheet">
	
	
	
	<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
		      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
		      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
		    <![endif]-->