{"id":17922464,"url":"https://github.com/joyqi/acme-bot","last_synced_at":"2025-03-24T02:32:32.586Z","repository":{"id":225784074,"uuid":"766381478","full_name":"joyqi/acme-bot","owner":"joyqi","description":"运行于 Docker 容器中的，基于 acme.sh 的 SSL 证书自动更新和部署机器人","archived":false,"fork":false,"pushed_at":"2024-03-04T09:50:39.000Z","size":14,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-19T01:08:29.544Z","etag":null,"topics":["acme","docker"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joyqi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-03-03T05:14:59.000Z","updated_at":"2025-03-02T02:08:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"c3923450-6fdd-4c07-8365-53eea6cbcb80","html_url":"https://github.com/joyqi/acme-bot","commit_stats":null,"previous_names":["joyqi/acme-bot"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyqi%2Facme-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyqi%2Facme-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyqi%2Facme-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyqi%2Facme-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joyqi","download_url":"https://codeload.github.com/joyqi/acme-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245198717,"owners_count":20576423,"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":["acme","docker"],"created_at":"2024-10-28T20:39:16.911Z","updated_at":"2025-03-24T02:32:32.580Z","avatar_url":"https://github.com/joyqi.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# acme-bot\n\n一个运行于 Docker 容器中的，基于 acme.sh 的 SSL 证书自动更新和部署机器人。\n\n## 为什么需要 acme-bot？\n\n[acme.sh](https://github.com/acmesh-official/acme.sh) 是一个非常优秀的 ACME 协议客户端，它支持多种 DNS API 和多种 Web 服务器，可以自动申请和更新 SSL 证书。但是，acme.sh 虽然提供了官方的 Docker 镜像，但是此镜像并不能做到基于配置信息自动更新证书和部署证书。\n\nacme-bot 是一个基于 acme.sh 官方 Docker 镜像的二次封装，它可以做到通过环境变量配置 acme.sh，告诉 acme.sh 你的域名和 DNS API 的信息，acme-bot 会自动申请和更新证书，并且可以自动部署证书到你指定的服务中。因此它特别适合运行在 Docker 容器中，作为一个独立的证书管理机器人。\n\n## 如何使用 acme-bot？\n\nacme-bot 的使用非常简单，只需要几个环境变量即可。下面是一个使用 acme-bot 的例子：\n\n```bash\ndocker run -d \\\n  --name acme-bot \\\n  -e EMAIL=\"hello@example.com\" \\\n  -e DOMAINS=\"dns_ali:example.com\" \\\n  -e Ali_Key=\"your_ali_key\" \\\n  -e Ali_Secret=\"your_ali_secret\" \\\n  -v $PWD/acme:/acme.sh \\\n  joyqi/acme-bot\n```\n\n你也可以使用 ghcr.io 镜像 `ghcr.io/joyqi/acme-bot`。\n\n我同样提供了一个 [docker-compose.yml](./docker-compose.yml) 文件，你可以直接使用 `docker-compose up -d` 来启动 acme-bot。当然，你需要修改 `docker-compose.yml` 文件中的环境变量。\n\n## 环境变量\n\nacme-bot 支持以下环境变量：\n\n- `EMAIL`:（必须）你的邮箱地址，用于注册 acme.sh 账号。\n- `DOMAINS`: （必须）你的域名和 DNS API 的信息，格式为 `dns_api:domain1,*.domain1,...[/deploy_hook]`。其中 `dns_api` 是你的 DNS API 的名称，具体支持的列表请参考 [acme.sh 的文档](https://github.com/acmesh-official/acme.sh/wiki/dnsapi)。`domain1,*.domain1,...` 是你的域名和泛域名列表，用逗号分隔。`/deploy_hook` 是可选的，用于指定证书在发布/更新后的部署方法，具体支持的列表请参考 [acme.sh 的文档](https://github.com/acmesh-official/acme.sh/wiki/deployhooks)。\n- `CA`: （可选）acme.sh 的 ACME 服务器，默认为 zerossl，你可以指定其它的 ACME 服务器，具体支持的列表请参考 [acme.sh 的文档](https://github.com/acmesh-official/acme.sh/wiki/Server)。\n- `NOTIFY`: （可选）通知方式 `notify-hook`，你可以指定各种通知方式，具体支持的列表请参考 [acme.sh 的文档](https://github.com/acmesh-official/acme.sh/wiki/notify)。多个 `notify-hook` 用逗号分隔。\n\n⚠️注意：以上配置信息中的 `dns_api`、`deploy_hook` 和 `notify-hook` 指定后都需要配置对应的环境变量，具体的环境变量请参考 [acme.sh 的文档](https://github.com/acmesh-official/acme.sh/wiki)。\n\n## 关于 `alicdn`\n\n由于 acme.sh 一直没有处理[关于阿里云 CDN 的 PR](https://github.com/acmesh-official/acme.sh/pull/3375)，导致 acme.sh 无法自动部署证书到阿里云 CDN。因此，acme-bot 参考原 PR 提供了一个 `alicdn` 的部署钩子，用于自动部署证书到阿里云 CDN。\n\n一般情况下如果你使用了 `dns_ali` 作为 DNS API，那么 `alicdn` 会直接使用 `Ali_Key` 和 `Ali_Secret` 作为阿里云 CDN 的密钥。如果你使用了其它的 DNS API，那么你需要额外配置 `ALI_CDN_KEY` 和 `ALI_CDN_SECRET` 作为阿里云 CDN 的密钥。\n\n如果生成的证书包含多个子域名和泛域名，那么你可能需要通过设置 `ALI_CDN_DOMAIN` 来指定 CDN 的域名。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoyqi%2Facme-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoyqi%2Facme-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoyqi%2Facme-bot/lists"}