1.2.2 • Published 8 years ago

trailpack-letsencrypt v1.2.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

trailpack-letsencrypt

Gitter NPM version NPM downloads Build status Dependency Status Code Climate

:package: Add https to trails using the free letsencrypt tls certificates

This package is an implementation of node-letsencrypt in Trails framework.

It currently only works with trailpack-hapi. Support for other webserver trailpacks will be added soon.

Intallation

With yo :

npm install -g yo generator-trails
yo trails:trailpack trailpack-letsencrypt

With npm (you will have to create config file manually) :

npm install --save trailpack-letsencrypt

Configuration

Enable letsencrypt

// config/main.js

  packs: [
    ...
    require('trailpack-letsencrypt')
  ],

Check that the letsencrypt config is loaded on index.js

// config/index.js
...
exports.letsencrypt = require('./letsencrypt')

Configure

// config/letsencrypt.js

/**
 * Let's Encrypt configuration
 * (app.config.letsencrypt)
 *
 * Configures Let's Encrypt for https
 *
 *  */
module.exports = {

  /**
  * Register trails http routes (routes.js) for https
   */
  registerTrailsRoutes: true,

  /**
   * for https only set to true
   * http connections will be redirected
   */
  requireHttps: false,

  /**
   * List of domains to allow the certificate creation for
   */
  domains: ['example.com', 'www.example.com', 'admin.example.com'],

  /**
   * The port to bind the webserver to for https
   */
  port: process.env.TLSPORT || 443,

  /**
   * Directory to save letsencrypt files in
   */
  configDir: './letsencrypt',

  /**
   * Let's Encrypt environment
   * To use the production service use "production"
   * Please be aware of the rate limits of the production environment.
   * For testing, please consider to use "staging"
   */
  environment: 'staging',

  /**
   * Do you agree to the the terms of service?
   * Then set this to true.
   * You'll find the legal documents here: https://letsencrypt.org/docs/
   */
  agreeTos: false,

  /**
   * email contact address for Let's Encrypt enquiries
   */
  email: 'changme@example.com',

  /**
   * enable debug messages from the letsenrypt module
   */
  debug: false,

  /**
   * https only routes
   */
  routes: [
    {
      method: 'GET',
      path: '/helloHttps',
      handler: 'ViewController.helloWorld'
    }
  ]

}

License

MIT

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago