2015-12-11 11:23:47 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-12-12 14:20:12 +00:00
|
|
|
var config = require('./config');
|
|
|
|
var Letsencrypt = require('../');
|
|
|
|
var leBinPath = '/home/user/.local/share/letsencrypt/bin/letsencrypt';
|
|
|
|
var LEP = require('letsencrypt-python');
|
|
|
|
var lep = LEP.create(leBinPath);
|
2015-12-11 11:23:47 +00:00
|
|
|
|
2015-12-12 14:20:12 +00:00
|
|
|
require('./serve-acme-challenges').create({
|
|
|
|
configDir: config.configDir
|
|
|
|
});
|
2015-12-11 11:23:47 +00:00
|
|
|
|
2015-12-12 14:20:12 +00:00
|
|
|
//var networkInterfaces = require('os').networkInterfaces();
|
|
|
|
//var ipify = require('ipify');
|
2015-12-11 11:23:47 +00:00
|
|
|
|
2015-12-12 14:20:12 +00:00
|
|
|
var le = Letsencrypt.create(
|
|
|
|
lep
|
|
|
|
// set some defaults
|
|
|
|
, { configDir: config.configDir
|
|
|
|
, workDir: config.workDir
|
|
|
|
, logsDir: config.logsDir
|
2015-12-11 11:23:47 +00:00
|
|
|
|
2015-12-12 14:20:12 +00:00
|
|
|
, webroot: true
|
|
|
|
, webrootPath: config.webrootPath
|
2015-12-11 11:23:47 +00:00
|
|
|
|
2015-12-12 14:20:12 +00:00
|
|
|
, server: LEP.stagingServer
|
2015-12-11 11:23:47 +00:00
|
|
|
}
|
|
|
|
, { cacheContextsFor: 1 * 60 * 60 * 1000 // 1 hour
|
|
|
|
, cacheRenewChecksFor: 3 * 24 * 60 * 60 * 1000 // 3 days
|
|
|
|
}
|
2015-12-12 14:20:12 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
le.register({
|
|
|
|
agreeTos: true
|
|
|
|
, domains: ['lds.io']
|
|
|
|
, email: 'coolaj86@gmail.com'
|
2015-12-11 11:23:47 +00:00
|
|
|
});
|