diff --git a/README.md b/README.md index 3935f1a2..66a58613 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的工具。 ## 一、特性 本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。 -* 全自动申请证书(支持阿里云、腾讯云、华为云、Cloudflare等各种途径注册的域名) -* 全自动部署更新证书(目前支持部署到主机、部署到阿里云、腾讯云等) +* 全自动申请证书(支持所有注册商注册的域名) +* 全自动部署更新证书(目前支持部署到主机、部署到阿里云、腾讯云等,目前已支持30+部署插件) * 支持通配符域名/泛域名,支持多个域名打到一个证书上 * 邮件通知 -* 私有化部署,保障安全 +* 私有化部署,保障数据安全 * 免费、免费、免费([阿里云单个通配符域名证书最便宜也要1800/年](https://yundun.console.aliyun.com/?p=cas#/certExtend/buy/cn-hangzhou)) @@ -124,6 +124,7 @@ git clone https://github.com/certd/certd cd certd # 启动服务 ./start.sh +# 数据默认保存在 ./packages/ui/certd-server/data 目录下,注意数据备份 ``` 如果是windows,请先安装`git for windows` ,然后右键,选择`open git bash here`打开终端,再执行`./start.sh`命令 @@ -169,6 +170,7 @@ docker compose up -d * [google证书](./doc/google/google.md) * [群晖部署certd及证书更新教程](./doc/synology/index.md) +* [CNAME证书校验方式说明](./doc/cname/index.md) ## 八、问题处理 ### 7.1 忘记管理员密码 diff --git a/doc/cname/images/cname1.png b/doc/cname/images/cname1.png new file mode 100644 index 00000000..fc5e02f2 Binary files /dev/null and b/doc/cname/images/cname1.png differ diff --git a/doc/cname/images/cname2.png b/doc/cname/images/cname2.png new file mode 100644 index 00000000..110a3e7c Binary files /dev/null and b/doc/cname/images/cname2.png differ diff --git a/doc/cname/images/cname3.png b/doc/cname/images/cname3.png new file mode 100644 index 00000000..200ef07c Binary files /dev/null and b/doc/cname/images/cname3.png differ diff --git a/doc/cname/images/cname4.png b/doc/cname/images/cname4.png new file mode 100644 index 00000000..a58e22fb Binary files /dev/null and b/doc/cname/images/cname4.png differ diff --git a/doc/cname/index.md b/doc/cname/index.md new file mode 100644 index 00000000..45ee1238 --- /dev/null +++ b/doc/cname/index.md @@ -0,0 +1,27 @@ +# CNAME代理校验方式说明 + +## 1. 前言 +申请域名证书是需要校验域名所有权的。 +目前有两种校验方式: +1. http-01: 在网站根目录下放置一份txt文件(Certd不支持) +2. dns-01: 需要给域名添加txt解析记录,通配符域名只能用这种方式(Certd采用这种方式) + +DNS-01方式需要开发适配DNS服务商的接口,目前已实现主流域名注册商的接口(阿里云、腾讯云、华为云、Cloudflare、西数) + +如果域名不在这几家,那么就只能通过CNAME代理校验方式来实现 + + +## 2. 使用步骤 + +1. 假设你要申请证书的域名叫:need.cert.com ,它是在其他服务商注册的 +2. 现在你需要另外一个域名:cname.foo.com,这个域名属于是在阿里云、腾讯云、华为云、Cloudflare、西数,或者你把这个域名的DNS服务器转到这几家。 +3. 到Certd的 CNAME服务管理界面,用`cname.foo.com`创建一条默认的CNAME服务,需要提供DNS提供商授权。 +![](./images/cname1.png) +4. 申请证书时,Certd会生成一个随机的CNAME记录,例如:`_acme-challenge.need`->`xxxxxx.cname.foo.com` + ![](./images/cname2.png) +5. 您需要手动添加这条CNAME记录到你要申请证书的域名解析中,点击校验,校验成功后就可以开始申请证书了 (此操作每个域名只需要做一次,后续可以重复使用,注意不要删除添加的CNAME记录) + ![](./images/cname3.png) +6. ![](./images/cname4.png) +6. 申请过程中,Certd会在`xxxxxx.cname.foo.com`下自动添加验证TXT记录。 +7. 由于您配置了`_acme-challenge.need`的CNAME,所以这个TXT记录会被解析到`_acme-challenge.need.cert.com`下,从而完成域名校验。 + diff --git a/packages/ui/certd-client/src/router/source/modules/sys.ts b/packages/ui/certd-client/src/router/source/modules/sys.ts index b866d5ca..b4a83b78 100644 --- a/packages/ui/certd-client/src/router/source/modules/sys.ts +++ b/packages/ui/certd-client/src/router/source/modules/sys.ts @@ -106,7 +106,7 @@ export const sysResources = [ const settingStore = useSettingStore(); return settingStore.isComm; }, - icon: "ion:extension-puzzle-outline", + icon: "ion:extension-puzzle", permission: "sys:settings:view" } }, diff --git a/packages/ui/certd-server/src/modules/auto/auto-z.ts b/packages/ui/certd-server/src/modules/auto/auto-z.ts index fa8458b9..c1f11edd 100644 --- a/packages/ui/certd-server/src/modules/auto/auto-z.ts +++ b/packages/ui/certd-server/src/modules/auto/auto-z.ts @@ -1,7 +1,8 @@ import { Autoload, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core'; -import { logger } from '@certd/pipeline'; +import { getPlusInfo, isPlus, logger } from '@certd/pipeline'; import { SysInstallInfo, SysSettingsService } from '@certd/lib-server'; import { getVersion } from '../../utils/version.js'; +import dayjs from 'dayjs'; @Autoload() @Scope(ScopeEnum.Singleton) @@ -16,6 +17,10 @@ export class AutoZPrint { logger.info('当前站点ID:', installInfo.siteId); const version = await getVersion(); logger.info(`当前版本:${version}`); + const plusInfo = getPlusInfo(); + if (isPlus()) { + logger.info(`授权信息:${plusInfo.vipType},${dayjs(plusInfo.expireTime).format('YYYY-MM-DD')}`); + } logger.info('服务启动完成'); logger.info('========================================='); }