javascript - 如何以编程方式使用 certbot 启用/禁用 SSL
问题描述
所以我正在使用 nodejs 和 nginx,我想以编程方式使用 certbot 并能够从 exec() 获取输出。
此命令应在无需用户交互的情况下生成证书:
certbot certonly --standalone --agree-tos -m my@email.com -d mydomain.com
但是我得到了很多文本,我只需要证书的路径和到期日期。
有没有办法以nodejs友好的格式获得它,比如json?
解决方案
看着男人:https ://certbot.eff.org/docs/man/certbot.html
使用标志-n Run non-interactively
您可以使用该标志nginx
来自动安装。
--nginx Obtain and install certificates using Nginx (default: False)
最后:
certbot --agree-tos -n --nginx -d example.com -d www.example.com -m hello@mail.com
推荐阅读
- node.js - 发送 Get 请求时出现 Enotfound 异常
- arrays - 二维数组的线性算法
- javascript - 需要帮助理解 DOM 元素和类中创建的对象之间的关系
- javascript - 允许设置/订阅单个项目的数组的 RxJs BehaviorSubject
- python - 无法在 selenium python IE 11 中使用 autoit 上传文件
- php - 表单等待第二次提交推送第一次提交
- ios - 无法实时获取 UserDefautls 更新的值
- mysql - 使用 @row_number/rank 的 mySQL 分页
- firebase - 如何使用 Flutter/Dart 在 FirebaseDatabase 中获取值的键?
- ksqldb - 如何在非行键列上连接 KSQL 表和流