use proper tmpdir, not homedir
This commit is contained in:
parent
cab8ae510f
commit
e418a56b68
10
index.js
10
index.js
|
@ -101,10 +101,12 @@ function pyToJson(pyobj) {
|
||||||
return jsobj;
|
return jsobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var crypto = require('crypto');
|
||||||
|
var rnd = crypto.randomBytes(8).toString('hex');
|
||||||
var defaults = {
|
var defaults = {
|
||||||
configDir: [ os.homedir(), 'letsencrypt', 'etc' ].join(path.sep) // /etc/letsencrypt/
|
configDir: [ os.homedir(), 'letsencrypt', 'etc' ].join(path.sep) // /etc/letsencrypt/
|
||||||
, logsDir: [ os.homedir(), 'tmp', 'acme', 'log' ].join(path.sep) // /var/log/letsencrypt/
|
, logsDir: [ os.tmpdir(), 'acme-' + rnd, 'log' ].join(path.sep) // /var/log/letsencrypt/
|
||||||
, webrootPath: [ os.homedir(), 'tmp', 'acme-challenge' ].join(path.sep)
|
, webrootPath: [ os.tmpdir(), 'acme-' + rnd, 'acme-challenge' ].join(path.sep)
|
||||||
|
|
||||||
, accountsDir: [ ':configDir', 'accounts', ':serverDir' ].join(path.sep)
|
, accountsDir: [ ':configDir', 'accounts', ':serverDir' ].join(path.sep)
|
||||||
, renewalPath: [ ':configDir', 'renewal', ':hostname.conf' ].join(path.sep)
|
, renewalPath: [ ':configDir', 'renewal', ':hostname.conf' ].join(path.sep)
|
||||||
|
@ -373,8 +375,8 @@ module.exports.create = function (configs) {
|
||||||
// Accounts
|
// Accounts
|
||||||
, _getAccountIdByPublicKey: function (keypair) {
|
, _getAccountIdByPublicKey: function (keypair) {
|
||||||
// we use insecure md5 - even though we know it's bad - because that's how the python client did
|
// we use insecure md5 - even though we know it's bad - because that's how the python client did
|
||||||
const pubkey = keypair.publicKeyPem.replace(/\r/g, '');
|
var pubkey = keypair.publicKeyPem.replace(/\r/g, '');
|
||||||
return require('crypto').createHash('md5').update(pubkey).digest('hex');
|
return crypto.createHash('md5').update(pubkey).digest('hex');
|
||||||
}
|
}
|
||||||
// Accounts
|
// Accounts
|
||||||
, checkKeypairAsync: function (args) {
|
, checkKeypairAsync: function (args) {
|
||||||
|
|
Loading…
Reference in New Issue