A greenlock keypair and certificate storage strategy with wildcard support for MySQL, Postgres, SQLite3, and Microsoft SQL Server
Go to file
AJ ONeal feb59ce8e2 bugfix: options.certificate is optional 2019-05-09 00:28:08 -06:00
db configure db 2019-04-10 14:11:38 +00:00
.gitignore initial build 2019-04-08 13:01:22 +00:00
LICENSE initial build 2019-04-08 13:01:22 +00:00
README.md progress 2019-04-20 18:02:45 -04:00
convert-wildcard.js initial build 2019-04-08 13:01:22 +00:00
greenlock-store-sequelize.js bugfix: options.certificate is optional 2019-05-09 00:28:08 -06:00
make-safe-sha-str.js initial build 2019-04-08 13:01:22 +00:00
merge-options.js initial build 2019-04-08 13:01:22 +00:00
package-lock.json package details, dependencies 2019-04-17 22:58:49 -04:00
package.json starts at version 3 2019-04-17 23:21:24 -04:00
sync.js progress 2019-04-20 18:02:45 -04:00

README.md

greenlock-store-sequelize | A Root project

A database-driven Greenlock storage plugin with wildcard support.

Usage

To use, provide this Greenlock storage plugin as the store attribute when you invoke create.

greenlock.create({
  store: require('le-store-sequelize')
});

Configuration

Defaults

No configuration is required. By default, you'll get a baked-in Sequelize database running sqlite3.

Database Connection

Without config.dbOptions, the baked-in sequelize object uses sqlite3 with defaults. If config.dbOptions is provided, you can configure the database connection per the Sequelize documentation.

If a dialect other than sqlite3 is used, dependencies will need to be installed.

greenlock.create({
  store: require('le-store-sequelize')({
    dbConfig: {
      username: 'mysqluser',
      password: 'mysqlpassword',
      database: 'mysqldatabase,
      host: '127.0.0.1',
      dialect: 'mysql'
    }
  })
});

The database can also be configured using an env variable.

greenlock.create({
  store: require('greenlock-store-sequelize')({
    dbConfig: {
      use_env_variable: 'DB_URL'
    }
  })
});

Custom Database Object

If you already have a Sequelize object, you can pass that in as config.db, circumventing the baked-in database entirely.

var db = require('./db'); // your db

greenlock.create({
  store: require('le-store-sequelize')({
    db
  })
});