mirror of
https://github.com/therootcompany/greenlock.js.git
synced 2025-03-06 08:40:41 +00:00
add default handlers
This commit is contained in:
parent
d03c6ac577
commit
d4a44f893c
5
lib/default-handlers.js
Normal file
5
lib/default-handlers.js
Normal file
@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports.agreeToTerms = function (args, agree) {
|
||||
agree(args.agreeTos || args.agree);
|
||||
};
|
10
lib/default-remove-challenge.js
Normal file
10
lib/default-remove-challenge.js
Normal file
@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
module.exports = function (args, key, done) {
|
||||
//var hostname = args.domains[0];
|
||||
|
||||
fs.unlinkSync(path.join(args.webroot, key), done);
|
||||
};
|
21
lib/default-set-challenge.js
Normal file
21
lib/default-set-challenge.js
Normal file
@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
module.exports = function (args, challengePath, keyAuthorization, done) {
|
||||
//var hostname = args.domains[0];
|
||||
var mkdirp = require('mkdirp');
|
||||
|
||||
// TODO should be args.webrootPath
|
||||
mkdirp(path.join(args.webrootPath, challengePath), function (err) {
|
||||
if (err) {
|
||||
done(err);
|
||||
return;
|
||||
}
|
||||
|
||||
fs.writeFile(path.join(args.webrootPath, challengePath), keyAuthorization, 'utf8', function (err) {
|
||||
done(err);
|
||||
});
|
||||
});
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user