4.74.1 • Published 1 year ago

@onehilltech/blueprint-greenlock v4.74.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year 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.71.0

1 year ago

4.74.1

1 year ago

4.67.0

1 year ago

5.0.0-alpha.6

2 years ago

4.65.19

2 years ago

5.0.0-alpha.5

2 years ago

5.0.0-alpha.4

2 years ago

5.0.0-alpha.3

2 years ago

5.0.0-alpha.2

2 years ago

5.0.0-alpha.1

2 years ago

4.65.11

2 years ago

4.63.1

2 years ago

4.65.0

2 years ago

4.64.1

2 years ago

4.60.0

2 years ago

4.61.0

2 years ago

4.61.1

2 years ago

4.60.3

2 years ago

4.59.0

2 years ago

4.58.1

2 years ago

4.56.3

2 years ago

4.59.1

2 years ago

5.0.0-alpha.0

2 years ago

4.50.3

2 years ago

4.52.0

2 years ago

4.57.0

2 years ago

4.58.0

2 years ago

4.44.3

2 years ago

4.46.0

2 years ago

4.39.1

3 years ago

4.37.2

3 years ago

4.37.0

3 years ago

4.35.0

3 years ago

4.28.20

4 years ago

4.28.18

4 years ago

4.28.4

4 years ago

4.27.10

4 years ago

4.20.0

4 years ago

4.21.0

4 years ago

4.15.1

4 years ago

4.15.0

4 years ago

4.14.1

4 years ago

4.12.0

4 years ago

4.14.0

4 years ago

4.9.0

4 years ago

4.10.0

4 years ago

4.8.0

4 years ago

4.7.0

4 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago