npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pclabs/certificator

v0.0.22

Published

ACME Client for obtaining SSL Certificates from Let's Encrypt.

Downloads

9

Readme

Certificator

An ACME client for automatically managing accounts and ssl certificates with Let's Encrypt certificate authority.

Prerequisites

Requires node 10.x.x for updated crypto library.

Usage

  npm install -g @pclabs/certificator
  certificator --help

Configuration

Certificator can be configured using the --plugin or --config option flags.

Use the --plugin flag if you require external dependencies to properly handle event callbacks. Plugins need to be packages that can be fetched and installed by Certificator.

--plugin @payclearly/[email protected]

Alternatively, use the --config flag to provide an absolute path JavaScript file that exports a config object. By default the current working directory is set to the root of this project. This can be changed using the --cwd flag.

--config ./config.js

Example:

module.exports = (options) => {

  return {
    plugin: options.plugin,
    config: options.config,
    environment: options.dryRun ? 'test' : 'production',
    packageAgent: `${package.name}/${package.version}`,
    domains: options.domain || [],
    maintainerEmail: options.maintainer,
    subscriberEmail: options.subscriber,
    accountId: options.accountId,
    accountDetails: options.accountDetails,
    cwd: options.cwd,
    subject: options.subject,
    privateKey: options.privateKey,
    csr: options.csr,

    setChallenge: ({ challenge }) => Promise.resolve(),

    getChallenge: ({ challenge }) => Promise.resolve(),

    removeChallenge: ({ challenge }) => Promise.resolve(),

    accountCreated: (account, accountKey) => Promise.resolve(),

    certificateCreated: (certificate) => Promise.resolve(),

    fetchServerPrivateKey: () => Promise.resolve(),

    fetchAccountDetails: () => Promise.resolve()
  }
};

Parameters

| Parameter             | Description                                                                                                 |
| ----------------------| ----------------------------------------------------------------------------------------------------------- |
| accountDetails        | an object containing the Let's Encrypt Account ID as "kid" (misnomer, not actually a key id/thumbprint)     |
|                       | and an RSA or EC public/private keypair in JWK format.                                                      |
| accountId             | a unique 8 digit id assigned by Let's Encrypt                                                               |
| accountKey            |                                                                                                             |
| certificate           |                                                                                                             |
| environment           | sets Let's Encrypt Directory URL. https://acme-staging-v02.api.letsencrypt.org/directory by default         |
| subject               | the domain of the DNS being challenged                                                                      |
| domains               | domain(s) that are listed in the CSR and will be listed on the certificate                                  |
| maintainerEmail       | should be a contact for the author of the code to receive critical bug and security notices                 |
| subscriberEmail       | should be a contact for the service provider to receive renewal failure notices and manage the ACME account |
| challenge             | object containing the challenge url and token                                                               |
| packageAgent          | an RFC72321-style user-agent string to append to the ACME client (ex: mypackage/v1.1.1)                     |
| plugin                | published npm package name to be install and used.                                                          |
|                       | Certificator needs permission to clone and install.                                                         |
| config                | realtive path to a config.js file.                                                                          |
| cwd                   | realtive path to install and load files from. default to process.cwd()                                      |
| privateKey            | realtive path to a JSON file containing the server's private key. Used to sign the CSR.                     |
|                         not used if a valid CSR is provided                                                                         |
| csr                   | realtive path to csr JSON file                                                                              |

Event Callbacks

| callback                  | Description                                                                                                 |
| --------------------------| ----------------------------------------------------------------------------------------------------------- |
| setChallenge (required)   | Should make the token url return the key authorization.                                                     |
|                           | i.e. GET http://example.com/.well-known/acme-challenge/xxxx => xxxx.yyyy                                    |
| removeChallenge (required)| remove the previously set token file (just the one)                                                         | 
| getChallenge (required)   | confirm the record was set. get the token file via the hosting service API                                  | 
| certificateCreated        | called when certificator has received a signed certificate from Let's Encrypt CA.                           |
| accountCreated            | called when a new account has been created with Let's Encrypt                                               |
| fetchServerPrivateKey     | called when creating a new certificate. The server private key is used to sign the CSR                      |
| fetchAccountDetails       | callback to fetch Certificator account Details                                                              |

Tests

npm run tests

##Legal This client implementation was built with ACME.js (a Root project).