{"id":16314703,"url":"https://github.com/liufee/certbot-feehi-hook","last_synced_at":"2025-06-25T01:32:06.775Z","repository":{"id":181140717,"uuid":"219184910","full_name":"liufee/certbot-feehi-hook","owner":"liufee","description":"let's encrypt certbot hook","archived":false,"fork":false,"pushed_at":"2023-07-14T06:50:08.000Z","size":13,"stargazers_count":13,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T09:51:07.415Z","etag":null,"topics":["certbot","certbot-aliyun","certbot-qcloud"],"latest_commit_sha":null,"homepage":"https://demo.cms.feehi.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liufee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-02T16:56:46.000Z","updated_at":"2024-01-31T07:52:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"3022679b-d6bf-4205-af17-fa8a83233ff7","html_url":"https://github.com/liufee/certbot-feehi-hook","commit_stats":null,"previous_names":["liufee/certbot-feehi-hook"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liufee/certbot-feehi-hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liufee%2Fcertbot-feehi-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liufee%2Fcertbot-feehi-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liufee%2Fcertbot-feehi-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liufee%2Fcertbot-feehi-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liufee","download_url":"https://codeload.github.com/liufee/certbot-feehi-hook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liufee%2Fcertbot-feehi-hook/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261785231,"owners_count":23209265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["certbot","certbot-aliyun","certbot-qcloud"],"created_at":"2024-10-10T21:55:03.857Z","updated_at":"2025-06-25T01:32:06.759Z","avatar_url":"https://github.com/liufee.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"let's encrypt Certbot hook written in golang\n===============================\n\nlets'encrypt的通配符https证书官方推荐使用certbot客户端获取。\ncertbot验证域名是否属于某人，通过产生一个随机字符串，让用户设置一个TXT记录到此值后，当验证成功后颁发证书。\n该证书有效期为3个月，意味着每3个月得更新一次，每次手工设置dns解析及其麻烦，还容易忘记更新证书。\n好在certbot提供了一个hook，产生随机后调用hook来自动设置dns记录，官方预制了几家dns服务商的hook，\n但是国内的阿里云、腾讯云都不在此例。此插件支持国内阿里云、腾讯云等其他常用dns服务商，\n使用golang编写，服务器无需搭建运行环境，直接下载二进制分发程序即可。\n\n\n支持的DNS服务商\n-------\n- [x] 阿里云\n\n- [x] 腾讯云\n\n- [x] Namesilo\n\n\nDNS服务商密钥获取\n---------------\n1. 阿里云进入管理后台，悬浮右上角的头像，点击下拉菜单的***accesskeys***进入用户信息管理的安全信息管理  \n  AccessKey ID即为ali_AccessKey_ID  \n  Access Key Secret 即为阿里云ACCESS_KEY_SECRET\n\n2. 腾讯云进入管理后台，悬浮右上角账号，点击下拉菜单的***访问管理***，点击左侧的访问密钥，再点击API密钥管理\n  SecretId即为qcloud_SecretId\n  SecretKey即为qcloud_SecretKey\n\n3. Namesilo Visit the API Manager page within your account for details\n  \n  \n获取插件\n---------------\n1. 下载二进制发行版 [点此下载](https://resource-1251086492.cos.ap-shanghai.myqcloud.com/opensource/certbot-feehi-hook) 下载后请记得***chmod +x certbot-feehi-hook***给予执行权限\n\n2. 源码编译安装  \n    ```bash\n        $ go get github.com/liufee/certbot-feehi-hook\n        $ cd $GOPATH/src/liufee/certbot-feehi-hook\n        $ sh build.sh\n    ```\n\n使用方式\n---------------\n\u003e为了方便展示，以下shell命令安装均做了变形处理，如执行失败，请手动去掉换行符，将命令调整为单行  \n\n\u003e以下示例命令均为dns解析在阿里云的，如果为腾讯云请将所有  \n--type=aliyun换成--type=qcloud  \n--ali_AccessKey_ID=阿里云ACCESS_KEY_ID 换成 --qcloud_SecretId=腾讯云secretId  \n--ali_Access_Key_Secret=阿里云ACCESS_KEY_SECRET 换成 --qcloud_SecretKey=腾讯云secretKey  \n\n1. 直接使用  \n    1.1 安装certbot\n    ```bash\n      $ wget https://dl.eff.org/certbot-auto \u0026\u0026 mv certbot-auto certbot \u0026\u0026 chmod +x certbot\n      $ mv certbot /usr/bin\n    ```\n    1.2\n      ```bash\n      $ certbot certonly \n            -d *.您的域名.com --manual --preferred-challenges dns\n            --manual-auth-hook \"/存放certbot-feehi-hook的目录(下载的certboot-feehi-hook存放目录)/certbot-feehi-hook --type=aliyun --action=add --ali_AccessKey_ID=阿里云ACCESS_KEY_ID --ali_Access_Key_Secret=阿里云ACCESS_KEY_SECRET\" \n            --manual-cleanup-hook \"/hook/certbot-feehi-hook --type=aliyun --action=delete --ali_AccessKey_ID=阿里云ACCESS_KEY_ID --ali_Access_Key_Secret=阿里云ACCESS_KEY_SECRET\"\n      ```\n\n2. 通过docker certbot/certbot官方镜像\n    * 申请证书\n    ```bash\n        $ docker run -it --rm --name certbot \n            -v \"/宿主机证书存放目录:/etc/letsencrypt\" \n            -v \"/tmp:/var/log/letsencrypt\" \n            -v \"/存放certbot-feehi-hook的目录(下载的certboot-feehi-hook存放目录):/hook\" \n            certbot/certbot certonly \n            -d *.您的域名.com --manual --preferred-challenges dns\n            --manual-auth-hook \"/hook/certbot-feehi-hook --type=aliyun --action=add --ali_AccessKey_ID=阿里云ACCESS_KEY_ID --ali_Access_Key_Secret=阿里云ACCESS_KEY_SECRET\" \n            --manual-cleanup-hook \"/hook/certbot-feehi-hook --type=aliyun --action=delete --ali_AccessKey_ID=阿里云ACCESS_KEY_ID --ali_Access_Key_Secret=阿里云ACCESS_KEY_SECRET\"\n     ```\n   * 更新证书\n   ```bash\n       $ /path/to/docker run -it --rm --name certbot \\\n           -v \"/宿主机证书存放目录:/etc/letsencrypt\" \\\n           -v \"/tmp:/var/log/letsencrypt\"\n           -v \"/存放certbot-feehi-hook的目录(下载的certboot-feehi-hook存放目录):/hook\" \n           certbot/certbot renew \n           --manual --preferred-challenges dns\n           --manual-auth-hook \"/hook/certbot-feehi-hook.sh --type=aliyun --action=add --ali_AccessKey_ID=阿里云ACCESS_KEY_ID --ali_Access_Key_Secret=阿里云ACCESS_KEY_SECRET\" \n           --manual-cleanup-hook \"/hook/certbot-feehi-hook.sh --type=aliyun --action=delete --ali_AccessKey_ID=阿里云ACCESS_KEY_ID --ali_Access_Key_Secret=阿里云ACCESS_KEY_SECRET\"\n           --deploy-hook  \"service nginx restart\"\n    ```\n        可以配置定时任务每个月执行一次: 0 0 1 * * 上面的命令\n\n        当且仅当成功更新证书后会执行--deploy-hook,根据自身web服务器情况进行重启web服务器重新加载新证书\n       \n       \n帮助\n---------------\n1. QQ群 258780872\n\n2. 微信 \u003cbr\u003e ![微信](http://img-1251086492.cosgz.myqcloud.com/github/wechat.png)\n\n3. Email job@feehi.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliufee%2Fcertbot-feehi-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliufee%2Fcertbot-feehi-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliufee%2Fcertbot-feehi-hook/lists"}