2021-01-11 11:00:12 +00:00
|
|
|
|
# CertD
|
|
|
|
|
|
2023-07-04 05:06:37 +00:00
|
|
|
|
CertD 是一个免费全自动申请和部署SSL证书的工具。
|
2021-01-12 01:44:41 +00:00
|
|
|
|
后缀D取自linux守护进程的命名风格,意为证书守护进程。
|
2021-01-11 11:00:12 +00:00
|
|
|
|
|
2023-07-04 05:46:57 +00:00
|
|
|
|
## 一、特性
|
2021-01-12 01:44:41 +00:00
|
|
|
|
本项目不仅支持证书申请过程自动化,还可以自动化部署证书,让你的证书永不过期。
|
|
|
|
|
|
2024-06-15 18:06:44 +00:00
|
|
|
|
* 全自动申请证书(支持阿里云、腾讯云、华为云、Cloudflare注册的域名)
|
2023-07-04 05:06:37 +00:00
|
|
|
|
* 全自动部署证书(目前支持服务器上传部署、部署到阿里云、腾讯云等)
|
2023-06-28 14:10:52 +00:00
|
|
|
|
* 支持通配符域名
|
|
|
|
|
* 支持多个域名打到一个证书上
|
2023-07-04 05:06:37 +00:00
|
|
|
|
* 邮件通知
|
|
|
|
|
* 证书自动更新
|
2023-07-04 06:37:13 +00:00
|
|
|
|
* 免费、免费、免费([阿里云单个通配符域名证书最便宜也要1800/年](https://yundun.console.aliyun.com/?p=cas#/certExtend/buy/cn-hangzhou))
|
|
|
|
|
|
2021-01-12 01:44:41 +00:00
|
|
|
|
|
|
|
|
|
|
2023-07-04 06:12:19 +00:00
|
|
|
|
## 二、在线体验
|
2021-01-11 14:49:24 +00:00
|
|
|
|
|
2023-07-04 05:06:37 +00:00
|
|
|
|
官方Demo地址,自助注册后体验
|
2021-01-11 14:49:24 +00:00
|
|
|
|
|
2023-07-04 05:06:37 +00:00
|
|
|
|
https://certd.handsfree.work/
|
2021-01-11 14:49:24 +00:00
|
|
|
|
|
2023-07-04 05:06:37 +00:00
|
|
|
|
> 注意数据将不定期清理,生产使用请自行部署
|
2023-07-04 06:14:31 +00:00
|
|
|
|
> 包含敏感信息,务必自己本地部署进行生产使用
|
2021-01-11 14:49:24 +00:00
|
|
|
|
|
2023-07-04 06:12:19 +00:00
|
|
|
|
## 三、使用教程
|
2023-07-04 06:29:18 +00:00
|
|
|
|
本案例演示,如何配置自动申请证书,并部署到阿里云CDN,然后快要到期前自动更新证书并重新部署
|
2021-01-11 15:15:35 +00:00
|
|
|
|
|
2023-07-04 05:06:37 +00:00
|
|
|
|
![演示](./doc/images/5-view.png)
|
2023-07-04 06:56:40 +00:00
|
|
|
|
![演示](./doc/images/9-start.png)
|
|
|
|
|
![演示](./doc/images/10-1-log.png)
|
|
|
|
|
![演示](./doc/images/13-3-download.png)
|
2023-07-04 07:03:34 +00:00
|
|
|
|
![演示](./doc/images/13-1-result.png)
|
2021-01-11 15:15:35 +00:00
|
|
|
|
|
2023-07-04 06:28:27 +00:00
|
|
|
|
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
|
|
|
|
-------> [点我查看详细使用步骤演示](./step.md) <--------
|
|
|
|
|
↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
|
2021-01-11 15:15:35 +00:00
|
|
|
|
|
2023-07-04 05:46:57 +00:00
|
|
|
|
## 四、本地docker部署
|
2021-01-11 15:15:35 +00:00
|
|
|
|
|
2023-07-04 05:46:57 +00:00
|
|
|
|
### 1. 安装docker、docker-compose
|
2021-01-11 15:15:35 +00:00
|
|
|
|
|
2024-06-15 16:42:17 +00:00
|
|
|
|
1.1 准备一台云服务器
|
|
|
|
|
* 【阿里云】云服务器2核2G,新老用户同享,99元/年,续费同价!【 [立即购买](https://www.aliyun.com/benefit?scm=20140722.M_10244282._.V_1&source=5176.11533457&userCode=qya11txb )】
|
|
|
|
|
* 【腾讯云】云服务器2核2G,新老用户同享,99元/年,续费同价!【 [立即购买](https://cloud.tencent.com/act/cps/redirect?redirect=6094&cps_key=b3ef73330335d7a6efa4a4bbeeb6b2c9&from=console)】
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2 安装docker
|
2023-07-04 05:46:57 +00:00
|
|
|
|
https://docs.docker.com/engine/install/
|
2024-06-27 08:38:43 +00:00
|
|
|
|
选择对应的操作系统,按照官方文档执行命令即可
|
2021-01-11 15:15:35 +00:00
|
|
|
|
|
|
|
|
|
|
2023-07-04 05:46:57 +00:00
|
|
|
|
### 2. 下载docker-compose.yaml文件
|
2024-06-15 16:42:17 +00:00
|
|
|
|
|
|
|
|
|
[docker-compose.yaml下载](https://gitee.com/certd/certd/raw/v2/docker/run/docker-compose.yaml)
|
|
|
|
|
|
2023-07-04 05:46:57 +00:00
|
|
|
|
```bash
|
2023-11-07 06:22:17 +00:00
|
|
|
|
mkdir certd
|
2023-07-04 05:46:57 +00:00
|
|
|
|
cd certd
|
2024-06-15 16:42:17 +00:00
|
|
|
|
# wget下载docker-compose.yaml文件
|
2023-11-07 09:46:18 +00:00
|
|
|
|
wget https://raw.githubusercontent.com/certd/certd/v2/docker/run/docker-compose.yaml
|
|
|
|
|
# 或者使用gitee地址
|
|
|
|
|
wget https://gitee.com/certd/certd/raw/v2/docker/run/docker-compose.yaml
|
2023-07-04 05:46:57 +00:00
|
|
|
|
|
2023-07-04 06:19:55 +00:00
|
|
|
|
# 根据需要修改里面的配置
|
2024-06-15 16:42:17 +00:00
|
|
|
|
# 1.修改镜像版本号【可选】
|
|
|
|
|
# 2.配置数据保存路径【可选】
|
|
|
|
|
# 3.配置certd_auth_jwt_secret【必须】
|
2023-07-04 06:21:14 +00:00
|
|
|
|
vi docker-compose.yaml
|
|
|
|
|
|
|
|
|
|
|
2023-07-04 05:46:57 +00:00
|
|
|
|
```
|
2023-07-04 06:19:55 +00:00
|
|
|
|
> 镜像版本号与release版本号同步:
|
|
|
|
|
https://github.com/certd/certd/releases
|
|
|
|
|
|
|
|
|
|
|
2023-07-04 05:46:57 +00:00
|
|
|
|
### 3. 运行
|
|
|
|
|
```bash
|
|
|
|
|
# 如果docker compose是插件化安装
|
2024-06-15 16:42:17 +00:00
|
|
|
|
export CERTD_VERSION=latest
|
2023-07-04 05:46:57 +00:00
|
|
|
|
docker compose up -d
|
2024-06-27 08:38:43 +00:00
|
|
|
|
```
|
|
|
|
|
如果提示 没有compose命令,请安装docker-compose
|
|
|
|
|
https://docs.docker.com/compose/install/linux/
|
|
|
|
|
|
2023-07-04 05:46:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 4. 访问
|
|
|
|
|
|
2023-07-06 07:14:56 +00:00
|
|
|
|
http://your_server_ip:7001
|
|
|
|
|
默认账号密码:admin/123456
|
|
|
|
|
记得修改密码
|
2023-07-04 05:46:57 +00:00
|
|
|
|
|
|
|
|
|
|
2024-03-22 05:14:29 +00:00
|
|
|
|
### 5. 升级
|
|
|
|
|
|
|
|
|
|
* 修改版本号,重新运行 `docker compose up -d` 即可
|
|
|
|
|
* 数据存在`/data/certd`目录下,不用担心数据丢失
|
|
|
|
|
|
|
|
|
|
|
2023-07-04 06:38:31 +00:00
|
|
|
|
|
2024-06-26 05:48:22 +00:00
|
|
|
|
## 五、一些说明
|
2023-07-04 05:06:37 +00:00
|
|
|
|
* 本项目ssl证书提供商为letencrypt
|
|
|
|
|
* 申请过程遵循acme协议
|
|
|
|
|
* 需要验证域名所有权,一般有两种方式(目前本项目仅支持dns-01)
|
|
|
|
|
* http-01: 在网站根目录下放置一份txt文件
|
2023-07-04 06:38:41 +00:00
|
|
|
|
* dns-01: 需要给域名添加txt解析记录,通配符域名只能用这种方式
|
2023-07-04 05:06:37 +00:00
|
|
|
|
* 证书续期:
|
|
|
|
|
* 实际上acme并没有续期概念。
|
|
|
|
|
* 我们所说的续期,其实就是按照全套流程重新申请一份新证书。
|
|
|
|
|
* 免费证书过期时间90天,以后可能还会缩短,所以自动化部署必不可少
|
2023-07-04 06:38:31 +00:00
|
|
|
|
* 设置每天自动运行,当证书过期前20天,会自动重新申请证书并部署
|
2021-01-11 15:15:35 +00:00
|
|
|
|
|
2024-06-26 05:48:22 +00:00
|
|
|
|
## 六、不同平台的设置说明
|
|
|
|
|
|
|
|
|
|
* [Cloudflare](./doc/cf/cf.md)
|
2024-06-27 08:38:43 +00:00
|
|
|
|
* [腾讯云](./doc/tencent/tencent.md)
|
|
|
|
|
* [windows主机](./doc/host/host.md)
|
|
|
|
|
|
2024-06-26 05:48:22 +00:00
|
|
|
|
|
|
|
|
|
## 七、问题处理
|
2024-06-27 08:38:43 +00:00
|
|
|
|
### 7.1 忘记管理员密码
|
2024-06-15 18:06:44 +00:00
|
|
|
|
解决方法如下:
|
|
|
|
|
1. 修改docker-compose.yaml文件,将环境变量`certd_system_resetAdminPassword`改为`true`
|
|
|
|
|
```yaml
|
|
|
|
|
services:
|
|
|
|
|
certd:
|
|
|
|
|
environment: # 环境变量
|
|
|
|
|
- certd_system_resetAdminPassword=false
|
|
|
|
|
```
|
|
|
|
|
2. 重启容器
|
|
|
|
|
```shell
|
|
|
|
|
docker compose up -d
|
|
|
|
|
docker logs -f --tail 500 certd
|
|
|
|
|
# 观察日志,当日志中输出“重置1号管理员用户的密码完成”,即可操作下一步
|
|
|
|
|
```
|
|
|
|
|
3. 修改docker-compose.yaml,将`certd_system_resetAdminPassword`改回`false`
|
|
|
|
|
4. 再次重启容器
|
|
|
|
|
```shell
|
|
|
|
|
docker compose up -d
|
|
|
|
|
```
|
|
|
|
|
5. 使用admin/123456登录系统,请及时修改管理员密码
|
|
|
|
|
|
2024-06-26 05:48:22 +00:00
|
|
|
|
## 八、联系作者
|
2023-07-06 07:13:20 +00:00
|
|
|
|
如有疑问,欢迎加入群聊(请备注certd)
|
|
|
|
|
* QQ群:141236433
|
2023-07-04 06:11:43 +00:00
|
|
|
|
* 微信群:
|
2023-07-06 07:13:20 +00:00
|
|
|
|
![](https://ai.handsfree.work/images/exchange_wxqroup.png)
|
|
|
|
|
|
|
|
|
|
|
2024-02-27 13:31:18 +00:00
|
|
|
|
加作者好友
|
|
|
|
|
<p align="center">
|
|
|
|
|
<img height="230" src="./doc/images/me.png">
|
|
|
|
|
</p>
|
|
|
|
|
|
2024-06-26 05:48:22 +00:00
|
|
|
|
## 九、捐赠
|
2024-02-27 13:31:18 +00:00
|
|
|
|
媳妇儿说:“一天到晚搞开源,也不管管老婆孩子!😡😡😡”
|
|
|
|
|
拜托各位捐赠支持一下,让媳妇儿开心开心,我也能有更多时间进行开源项目,感谢🙏🙏🙏
|
|
|
|
|
<p align="center">
|
|
|
|
|
<img height="380" src="./doc/images/donate.png">
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
2024-06-26 05:48:22 +00:00
|
|
|
|
## 十、贡献代码
|
2024-03-21 17:04:45 +00:00
|
|
|
|
|
2024-05-27 10:38:41 +00:00
|
|
|
|
[贡献插件教程](./plugin.md)
|
2024-03-21 17:04:45 +00:00
|
|
|
|
|
|
|
|
|
|
2024-06-26 05:48:22 +00:00
|
|
|
|
## 十一、我的其他项目
|
2023-07-06 07:13:20 +00:00
|
|
|
|
* [袖手GPT](https://ai.handsfree.work/) ChatGPT,国内可用,无需FQ,每日免费额度
|
|
|
|
|
* [fast-crud](https://gitee.com/fast-crud/fast-crud/) 基于vue3的crud快速开发框架
|
|
|
|
|
* [dev-sidecar](https://github.com/docmirror/dev-sidecar/) 直连访问github工具,无需FQ,解决github无法访问的问题
|