4.76.5 • Published 12 months ago

@onehilltech/blueprint-greenlock v4.76.5

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
12 months ago

blueprint-greenlock

A blueprint module for GreenlockTM.

npm version Build Status Dependencies Coverage Status

  • Seamlessly integrates Blueprint application with Let's Encrypt.
  • Automatically renews certificates within specified time window.
  • Minimal configuration needed.
  • Supports specialization of workflow entities.

Installation

yarn add @onehilltech/blueprint-greenlock

or

npm install @onehilltech/blueprint-greenlock --save

Getting Started

Server Configuration

Update the server configuration to use the GreenlockTM protocol.

// app/configs/server.js

module.exports = {
  connections : {
    greenlock : { 
      protocol: 'greenlock',
      
      // optional configuration for redirect-https
      redirect: {
        
      },
      
      // optional configuration for tls
      tls: { 
        
      },
      
      // optional configuration for https connection
      https: {
        
      }
    },
  }
};

Basic Approvals

Create the GreenlockTM configuration file.

// app/configs/greenlock.js

module.exports = {
  /// Your list of domains supported by application.
  domains: ['greenlock.onehilltech.com'],
  
  /// Your contact email address.
  email: 'contact@onehilltech.com',
  
  /// Use basic strategy for approving domains.
  approveDomains: 'basic'
};

Custom Approvals

The basic configuration works well when you have one or more domains that all have the same configuration and approval. If you are in a situation where different domains have different configurations and/or approvals then you need to implement a custom configuration.

// app/greenlock/approve-domains.js

const { ApproveDomains } = require ('@onehilltech/blueprint-greenlock');

/**
 * A custom implementation for approving domains. 
 */
module.exports = ApproveDomains.extend ({
  approveDomains (options, certs) {
    // maybe lookup options.domain in a database.
  } 
});

The custom configuration must be located in app/greenlock/approve-domains. Otherwise the module will not be able to locate it.

The custom domain approval class must implement approveDomains. This method must return { options, certs }, or a Promise that resolves { options, certs }. If the domain is not approved, then this method must return Promise.reject (new Error (...)).

Next, update the greenlock configuration to use custom domain approvals.

// app/configs/greenlock.js

module.exports = {
  /// Use custom strategy for approving domains.
  approveDomains: 'custom'
};

Happy Coding!

4.76.5

12 months ago

4.71.0

2 years ago

4.74.1

2 years ago

4.67.0

2 years ago

5.0.0-alpha.6

3 years ago

4.65.19

3 years ago

5.0.0-alpha.5

3 years ago

5.0.0-alpha.4

3 years ago

5.0.0-alpha.3

3 years ago

5.0.0-alpha.2

3 years ago

5.0.0-alpha.1

3 years ago

4.65.11

3 years ago

4.63.1

3 years ago

4.65.0

3 years ago

4.64.1

3 years ago

4.60.0

3 years ago

4.61.0

3 years ago

4.61.1

3 years ago

4.60.3

3 years ago

4.59.0

3 years ago

4.58.1

3 years ago

4.56.3

3 years ago

4.59.1

3 years ago

5.0.0-alpha.0

3 years ago

4.50.3

3 years ago

4.52.0

3 years ago

4.57.0

3 years ago

4.58.0

3 years ago

4.44.3

4 years ago

4.46.0

4 years ago

4.39.1

4 years ago

4.37.2

4 years ago

4.37.0

4 years ago

4.35.0

4 years ago

4.28.20

5 years ago

4.28.18

5 years ago

4.28.4

5 years ago

4.27.10

5 years ago

4.20.0

5 years ago

4.21.0

5 years ago

4.15.1

6 years ago

4.15.0

6 years ago

4.14.1

6 years ago

4.12.0

6 years ago

4.14.0

6 years ago

4.9.0

6 years ago

4.10.0

6 years ago

4.8.0

6 years ago

4.7.0

6 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago