wildduck/lib/tasks/acme.js

18 lines
564 B
JavaScript
Raw Normal View History

2021-06-15 15:47:18 +08:00
'use strict';
const log = require('npmlog');
const config = require('wild-config');
2021-06-20 18:40:04 +08:00
let run = async (task, data, options) => {
const { getCertificate, certHandler } = options;
let cert = await getCertificate(data.servername, config.acme, certHandler);
log.verbose('Tasks', 'task=acme id=%s servername=%s status=%s', task._id, data.servername, cert && cert.status);
2021-06-15 15:47:18 +08:00
return true;
};
2021-06-20 18:40:04 +08:00
module.exports = (task, data, options, callback) => {
run(task, data, options)
2021-06-15 15:47:18 +08:00
.then(response => callback(null, response))
.catch(callback);
};