Quieter #13
|
@ -1,5 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var mkdirp = require('@root/mkdirp');
|
||||||
|
|
||||||
module.exports.create = function (config={}) {
|
module.exports.create = function (config={}) {
|
||||||
var store = {
|
var store = {
|
||||||
options: {},
|
options: {},
|
||||||
|
@ -19,7 +21,13 @@ module.exports.create = function (config={}) {
|
||||||
if (config.storeDatabaseUrl) {
|
if (config.storeDatabaseUrl) {
|
||||||
sequelize = new Sequelize(config.storeDatabaseUrl,{ logging: false });
|
sequelize = new Sequelize(config.storeDatabaseUrl,{ logging: false });
|
||||||
} else {
|
} else {
|
||||||
sequelize = new Sequelize({ dialect: 'sqlite', storage: confDir + '/db.sqlite3', logging: false });
|
sequelize = new Promise(function (resolve, reject) {
|
||||||
|
confDir = confDir.replace(/~\//, require('os').homedir());
|
||||||
|
mkdirp(confDir, function (err) {
|
||||||
|
if (err) { reject(err); return; }
|
||||||
|
resolve(new Sequelize({ dialect: 'sqlite', storage: confDir + '/db.sqlite3', logging: false }));
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
{
|
{
|
||||||
"name": "greenlock-store-sequelize",
|
"name": "@greenlock/store-sequelize",
|
||||||
"version": "1.0.0",
|
"version": "3.0.1",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@root/mkdirp": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@root/mkdirp/-/mkdirp-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-hxGAYUx5029VggfG+U9naAhQkoMSXtOeXtbql97m3Hi6/sQSRL/4khKZPyOF6w11glyCOU38WCNLu9nUcSjOfA=="
|
||||||
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "11.13.0",
|
"version": "11.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.0.tgz",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@greenlock/store-sequelize",
|
"name": "@greenlock/store-sequelize",
|
||||||
"version": "3.0.1-dev",
|
"version": "3.0.2-dev",
|
||||||
"description": "A Sequelize-based certificate store for greenlock that supports wildcards.",
|
"description": "A Sequelize-based certificate store for greenlock that supports wildcards.",
|
||||||
"homepage": "https://git.rootprojects.org/root/greenlock-store-sequelize.js",
|
"homepage": "https://git.rootprojects.org/root/greenlock-store-sequelize.js",
|
||||||
"main": "greenlock-store-sequelize.js",
|
"main": "greenlock-store-sequelize.js",
|
||||||
|
@ -29,6 +29,7 @@
|
||||||
],
|
],
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@root/mkdirp": "^1.0.0",
|
||||||
"sequelize": "^5.2.11"
|
"sequelize": "^5.2.11"
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
|
|
Loading…
Reference in New Issue