@greenlock/manager

中文文档
3.1.0发布于 2019/12/01MPL-2.0CommonJS近 30 天下载 1.9万

FileSytem 基于 Greenlock SSL 的可选加密云备份管理器

中文使用文档
文档目录8 节
  1. 安装
  2. 使用量
  3. 初始化管理器
  4. 设置订阅者和其他全局默认值
  5. 添加站点 - 域和 SSL 证书
  6. 查看站点配置
  7. 更新网站配置
  8. 删除一个站点

格林洛克管理器

管理 SSL 证书的签发和续签 绿锁。 。 。 .

将全局和每个站点的配置保存到本地文件 Sytem (当前), 并带有可选的加密 Cloud 备份( 即将到来) .

安装

npm install --save greenlock@4
npm install --save greenlock-manager@3

使用量

要启用加密云备份, 当可用时:

npx greenlock init --manager cloud --config-dir './greenlock.d'

只针对本地文件系统 :

npx greenlock init --manager fs --config-dir './greenlock.d'

或者,把这个文件放在您的工程的根中 :

.greenlockrc数字 :

{
    "manager": { "module": "@greenlock/manager" },
    "configDir": "./greenlock.d"
}

格林洛克管理器 CLI 和 API

所有管理器插件都有 同样的 API。 。 。 .

由Greenlock负责具体管理人员的实施工作, 然后按这里的记录曝光.

说明:大多数人不需要(也不应该)不使用JavaScript API. 相反,使用CLI(当前)或Web API(即将到来).

初始化管理器

npx greenlock init --manager cloud --config-dir './greenlock.d'

说明:你 不应该 将绿锁直接初始化为 这可能使它与CLI和Web GUI不相容.

使用 CLI 生成的文件 init (上下扬.

Greenlock.create({
    manager: "@greenlock/manager",
    cloud: true,
    configDir: "./greenlock.d",
    packageRoot: __dirname
});

设置订阅者和其他全局默认值

npx greenlock defaults --subscriber-email [email protected] --agree-to-terms true
greenlock.manager.defaults({
    subscriberEmail: "[email protected]",
    agreeToTerms: true
});

场地管理

通过"现场",我们是指一个主域, 和,可选的,次要域, 要在 ssl 证书上列出, 以及获取和延长这些证书所需的任何配置.

添加站点 - 域和 SSL 证书

npx greenlock add --subject example.com --altnames 'example.com,www.example.com'
greenlock.sites.add({
    subject: "example.com",
    altnames: ["example.com", "www.example.com"]
});

查看站点配置

npx greenlock config --subject example.com
greenlock.sites.get({
    servername: "www.example.com",
    wildname: "*.example.com"
});

更新网站配置

npx greenlock update --subject example.com --challenge-dns-01 acme-dns-01-ovh --challenge-dns-01-token xxxx
greenlock.sites.update({
    subject: "www.example.com",
    challenges: {
        "dns-01": {
            module: "acme-dns-01-ovh",
            token: "xxxx"
        }
    }
});

删除一个站点

停止对特定站点自动更新 SSL 证书 . 要重新开始更新, 您必须使用 add()。 。 。 .

npx greenlock remove --subject example.com
greenlock.sites.remove({
    subject: "example.com"
});

版本与发布记录

@greenlock/manager 共发布 2 个版本,首次发布于 2019/11/05;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.1.0latest2019/12/016 年前
3.0.02019/11/057 年前

关于 @greenlock/manager 的常见问题

@greenlock/manager 是什么?

FileSytem 基于 Greenlock SSL 的可选加密云备份管理器

如何安装 @greenlock/manager?

在项目目录运行 npm install @greenlock/manager,或使用 pnpm add / yarn add / bun add。

@greenlock/manager 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/greenlock__manager 是否存在。

@greenlock/manager 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@greenlock/manager 可以商用吗?

@greenlock/manager 使用 MPL-2.0 许可。弱 Copyleft:可以商用,也可以和闭源代码一起使用;但如果分发时修改了 MPL 授权的文件,这些文件的修改需以 MPL 开源。以上为概括,不构成法律意见,请以许可原文为准。

@greenlock/manager 的下载量有多少?

根据 npm 官方下载统计,@greenlock/manager 在 2026/10/17 – 2026/11/15 这 30 天内被下载 19,285 次,日均约 643 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@greenlock/manager 还在维护吗?

最新版本 3.1.0 发布于 2019/12/01(6 年前);至今共发布 2 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/11/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。