Giter Site home page Giter Site logo

cloudflare-certbot-dns-hook's Introduction

cloudflare-certbot-dns-hook

方便的对运行在cloudflare上的域名进行certbot-dns挑战.

安装

npm i -g @lsby/cloudflare-certbot-dns-hook

使用

首先您需要保证您的dns解析记录里存在您设置的子域名解析.

例如, 如果您的域名是aaa.com, 您想为bbb.aaa.com这个子域设置ssl证书, 您就必须先手动设置好bbb.aaa.com的解析记录.

接下来安装certbot.

接下来创建两个文件, windows和linux略有不同.

  • 文件后缀名不同, windows是.cmd.bat, linux是.sh.
  • 设置环境变量的写法不同, windows是set, linux是export.

下面的示例使用windows的写法:

auth.cmd:

set CLOUDFLARE_API_TOKEN=<cloudflare的token>
set CLOUDFLARE_ZONE_ID=<cloudflare域名的区域id>

lsby-cloudflare-certbot-dns-hook-auth

cleanup.cmd:

set CLOUDFLARE_API_TOKEN=<cloudflare的token>
set CLOUDFLARE_ZONE_ID=<cloudflare域名的区域id>

lsby-cloudflare-certbot-dns-hook-cleanup

最后执行命令:

certbot certonly --manual --non-interactive --preferred-challenges=dns --manual-auth-hook <auth文件路径> --manual-cleanup-hook <cleanup文件路径> --agree-tos -m <邮箱> -d <完整子域名>
  • 执行后会卡住很久, 是正常的, 因为要等待dns传播. 现在设置的是等待一分钟.
  • 续期时重新执行以上命令即可.

cloudflare-certbot-dns-hook's People

Contributors

lsby avatar

Watchers

Lucian avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.