perf: 调整静态资源到static目录
10
README.md
|
@ -29,11 +29,11 @@ https://certd.handsfree.work/
|
||||||
## 三、使用教程
|
## 三、使用教程
|
||||||
本案例演示,如何配置自动申请证书,并部署到阿里云CDN,然后快要到期前自动更新证书并重新部署
|
本案例演示,如何配置自动申请证书,并部署到阿里云CDN,然后快要到期前自动更新证书并重新部署
|
||||||
|
|
||||||
![演示](./packages/ui/certd-client/src/assets/doc/images/5-view.png)
|
![演示](packages/ui/certd-client/public/statics/doc/images/5-view.png)
|
||||||
![演示](./packages/ui/certd-client/src/assets/doc/images/9-start.png)
|
![演示](packages/ui/certd-client/public/statics/doc/images/9-start.png)
|
||||||
![演示](./packages/ui/certd-client/src/assets/doc/images/10-1-log.png)
|
![演示](packages/ui/certd-client/public/statics/doc/images/10-1-log.png)
|
||||||
![演示](./packages/ui/certd-client/src/assets/doc/images/13-3-download.png)
|
![演示](packages/ui/certd-client/public/statics/doc/images/13-3-download.png)
|
||||||
![演示](./packages/ui/certd-client/src/assets/doc/images/13-1-result.png)
|
![演示](packages/ui/certd-client/public/statics/doc/images/13-1-result.png)
|
||||||
|
|
||||||
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||||
-------> [点我查看详细使用步骤演示](./step.md) <--------
|
-------> [点我查看详细使用步骤演示](./step.md) <--------
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
|
export * from "./access/index.js";
|
||||||
export * from "./plugin/index.js";
|
export * from "./plugin/index.js";
|
||||||
export * from "./dns-provider/index.js";
|
export * from "./dns-provider/index.js";
|
||||||
export * from "./access/index.js";
|
|
||||||
|
|
|
@ -6,6 +6,6 @@ VITE_APP_SLOGAN=让你的证书永不过期
|
||||||
VITE_APP_COPYRIGHT_YEAR=2021-2024
|
VITE_APP_COPYRIGHT_YEAR=2021-2024
|
||||||
VITE_APP_COPYRIGHT_NAME=handsfree.work
|
VITE_APP_COPYRIGHT_NAME=handsfree.work
|
||||||
VITE_APP_COPYRIGHT_URL=https://certd.handsfree.work
|
VITE_APP_COPYRIGHT_URL=https://certd.handsfree.work
|
||||||
VITE_APP_LOGO=./assets/images/logo/logo.svg
|
VITE_APP_LOGO=/statics/images/logo/logo.svg
|
||||||
VITE_APP_PROJECT_PATH=https://github.com/certd/certd
|
VITE_APP_PROJECT_PATH=https://github.com/certd/certd
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8"/>
|
<meta charset="UTF-8"/>
|
||||||
<link rel="icon" href="/logo.svg"/>
|
<link rel="icon" href="/static/logo.svg"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
<title>Certd-让你的证书永不过期</title>
|
<title>Certd-让你的证书永不过期</title>
|
||||||
<script src="/assets/icons/iconfont.js"></script>
|
<script src="/static/icons/iconfont.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="/index.css"/>
|
<link rel="stylesheet" type="text/css" href="/static/index.css"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
|
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 124 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
@ -6,9 +6,9 @@
|
||||||
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/>
|
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/>
|
||||||
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/>
|
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/>
|
||||||
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
|
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
|
||||||
<link rel="stylesheet" href="demo.css">
|
<link rel="stylesheet" href='demo.css'>
|
||||||
<link rel="stylesheet" href="iconfont.css">
|
<link rel="stylesheet" href='iconfont.css'>
|
||||||
<script src="iconfont.js"></script>
|
<script src='iconfont.js'></script>
|
||||||
<!-- jQuery -->
|
<!-- jQuery -->
|
||||||
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
|
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
|
||||||
<!-- 代码高亮 -->
|
<!-- 代码高亮 -->
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 397 B After Width: | Height: | Size: 397 B |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 402 B |
Before Width: | Height: | Size: 6.7 KiB |
|
@ -43,27 +43,27 @@ const steps = ref<Step[]>([
|
||||||
description: "演示证书申请任务如何配置",
|
description: "演示证书申请任务如何配置",
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/1-add.png",
|
image: "/static/doc/images/1-add.png",
|
||||||
title: "创建证书流水线",
|
title: "创建证书流水线",
|
||||||
descriptions: ["点击添加流水线,选择证书申请"]
|
descriptions: ["点击添加流水线,选择证书申请"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/2-access-provider.png",
|
image: "/static/doc/images/2-access-provider.png",
|
||||||
title: "DNS授权",
|
title: "DNS授权",
|
||||||
descriptions: ["证书申请需要给域名添加TXT解析记录来验证域名所有权"]
|
descriptions: ["证书申请需要给域名添加TXT解析记录来验证域名所有权"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/3-add-access.png",
|
image: "/static/doc/images/3-add-access.png",
|
||||||
title: "第一次使用,需要添加DNS授权",
|
title: "第一次使用,需要添加DNS授权",
|
||||||
descriptions: ["选择DNS授权,确认创建"]
|
descriptions: ["选择DNS授权,确认创建"]
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// image: "/assets/doc/images/3-add-access.png",
|
// image: "/static/doc/images/3-add-access.png",
|
||||||
// title: "确定创建流水线",
|
// title: "确定创建流水线",
|
||||||
// descriptions: ["选择DNS授权,信息填写无误,确认创建"]
|
// descriptions: ["选择DNS授权,信息填写无误,确认创建"]
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/4-add-success.png",
|
image: "/static/doc/images/4-add-success.png",
|
||||||
title: "流水线创建成功",
|
title: "流水线创建成功",
|
||||||
descriptions: ["此时证书申请任务已经建好,点击手动触发即可测试证书申请", "接下来演示如何添加部署任务"]
|
descriptions: ["此时证书申请任务已经建好,点击手动触发即可测试证书申请", "接下来演示如何添加部署任务"]
|
||||||
}
|
}
|
||||||
|
@ -74,52 +74,52 @@ const steps = ref<Step[]>([
|
||||||
description: "演示部署到阿里云CDN和Nginx",
|
description: "演示部署到阿里云CDN和Nginx",
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/6-1-add-task.png",
|
image: "/static/doc/images/6-1-add-task.png",
|
||||||
title: "添加部署任务",
|
title: "添加部署任务",
|
||||||
descriptions: ["演示第一个部署任务,部署到阿里云CDN"]
|
descriptions: ["演示第一个部署任务,部署到阿里云CDN"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/6-2-add-task.png",
|
image: "/static/doc/images/6-2-add-task.png",
|
||||||
title: "选择任务插件",
|
title: "选择任务插件",
|
||||||
descriptions: ["可以搜索插件,这里选择阿里云CDN插件"]
|
descriptions: ["可以搜索插件,这里选择阿里云CDN插件"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/6-3-add-task.png",
|
image: "/static/doc/images/6-3-add-task.png",
|
||||||
title: "配置任务参数",
|
title: "配置任务参数",
|
||||||
descriptions: ["填写CDN的域名和证书ID", "任务保存之后,阿里云CDN的部署任务就配置好了"]
|
descriptions: ["填写CDN的域名和证书ID", "任务保存之后,阿里云CDN的部署任务就配置好了"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/7-1-add-host-task.png",
|
image: "/static/doc/images/7-1-add-host-task.png",
|
||||||
title: "添加主机部署任务",
|
title: "添加主机部署任务",
|
||||||
descriptions: ["接下来演示配置第二个部署任务,部署到主机", "部署到主机分两步: 1. 上传证书到主机 2. 运行主机命令"]
|
descriptions: ["接下来演示配置第二个部署任务,部署到主机", "部署到主机分两步: 1. 上传证书到主机 2. 运行主机命令"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/7-2-add-host-task.png",
|
image: "/static/doc/images/7-2-add-host-task.png",
|
||||||
title: "配置上传到主机任务",
|
title: "配置上传到主机任务",
|
||||||
descriptions: ["填写上传到主机任务参数", "比如证书保存路径"]
|
descriptions: ["填写上传到主机任务参数", "比如证书保存路径"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/7-3-add-host-task.png",
|
image: "/static/doc/images/7-3-add-host-task.png",
|
||||||
title: "添加主机ssh登录授权",
|
title: "添加主机ssh登录授权",
|
||||||
descriptions: ["填写主机ip、用户名、密码,授权只需添加一次,后续其他任务可以复用"]
|
descriptions: ["填写主机ip、用户名、密码,授权只需添加一次,后续其他任务可以复用"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/8-1-add-host-task.png",
|
image: "/static/doc/images/8-1-add-host-task.png",
|
||||||
title: "上传到主机任务配置完成",
|
title: "上传到主机任务配置完成",
|
||||||
descriptions: ["接下来配置主机执行脚本,去部署证书"]
|
descriptions: ["接下来配置主机执行脚本,去部署证书"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/8-2-add-host-task.png",
|
image: "/static/doc/images/8-2-add-host-task.png",
|
||||||
title: "选择添加主机远程命令任务",
|
title: "选择添加主机远程命令任务",
|
||||||
descriptions: ["选择主机远程命令任务"]
|
descriptions: ["选择主机远程命令任务"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/8-4-add-host-task.png",
|
image: "/static/doc/images/8-4-add-host-task.png",
|
||||||
title: "填写证书部署脚本",
|
title: "填写证书部署脚本",
|
||||||
descriptions: ["选择主机授权,编写部署脚本,这里演示部署到nginx,需要重启nginx,让证书生效"]
|
descriptions: ["选择主机授权,编写部署脚本,这里演示部署到nginx,需要重启nginx,让证书生效"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/8-5-add-host-task.png",
|
image: "/static/doc/images/8-5-add-host-task.png",
|
||||||
title: "上传到主机任务的两个步骤配置完成",
|
title: "上传到主机任务的两个步骤配置完成",
|
||||||
descriptions: ["接下来测试运行"]
|
descriptions: ["接下来测试运行"]
|
||||||
}
|
}
|
||||||
|
@ -130,47 +130,47 @@ const steps = ref<Step[]>([
|
||||||
description: "演示流水线运行,查看日志,成功后跳过等",
|
description: "演示流水线运行,查看日志,成功后跳过等",
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/9-start.png",
|
image: "/static/doc/images/9-start.png",
|
||||||
title: "运行测试一下",
|
title: "运行测试一下",
|
||||||
descriptions: ["之前是把证书上传到主机,接下来要运行命令,去部署证书"]
|
descriptions: ["之前是把证书上传到主机,接下来要运行命令,去部署证书"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/10-1-log.png",
|
image: "/static/doc/images/10-1-log.png",
|
||||||
title: "查看日志",
|
title: "查看日志",
|
||||||
descriptions: ["点击任务可以查看状态和日志"]
|
descriptions: ["点击任务可以查看状态和日志"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/11-1-error.png",
|
image: "/static/doc/images/11-1-error.png",
|
||||||
title: "执行失败如何排查",
|
title: "执行失败如何排查",
|
||||||
descriptions: ["查看错误日志"]
|
descriptions: ["查看错误日志"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/11-2-error.png",
|
image: "/static/doc/images/11-2-error.png",
|
||||||
title: "执行失败如何排查",
|
title: "执行失败如何排查",
|
||||||
descriptions: ["查看错误日志,这里报的是nginx容器不存在,修改命令改成正确的nginx容器名称"]
|
descriptions: ["查看错误日志,这里报的是nginx容器不存在,修改命令改成正确的nginx容器名称"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/12-1-log-success.png",
|
image: "/static/doc/images/12-1-log-success.png",
|
||||||
title: "执行成功",
|
title: "执行成功",
|
||||||
descriptions: ["修改正确后,重新点击手动触发,重新运行一次,执行成功"]
|
descriptions: ["修改正确后,重新点击手动触发,重新运行一次,执行成功"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/12-2-skip-log.png",
|
image: "/static/doc/images/12-2-skip-log.png",
|
||||||
title: "成功后自动跳过",
|
title: "成功后自动跳过",
|
||||||
descriptions: ["可以看到成功过的将会自动跳过,不会重复执行,只有当参数变更或者证书更新了,才会重新运行"]
|
descriptions: ["可以看到成功过的将会自动跳过,不会重复执行,只有当参数变更或者证书更新了,才会重新运行"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/13-1-result.png",
|
image: "/static/doc/images/13-1-result.png",
|
||||||
title: "查看证书部署成功",
|
title: "查看证书部署成功",
|
||||||
descriptions: ["访问nginx上的网站,可以看到证书已经部署成功"]
|
descriptions: ["访问nginx上的网站,可以看到证书已经部署成功"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/13-2-result.png",
|
image: "/static/doc/images/13-2-result.png",
|
||||||
title: "阿里云CDN也部署成功",
|
title: "阿里云CDN也部署成功",
|
||||||
descriptions: ["阿里云CDN上已经更新证书,证书名称已certd开头"]
|
descriptions: ["阿里云CDN上已经更新证书,证书名称已certd开头"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/13-3-download.png",
|
image: "/static/doc/images/13-3-download.png",
|
||||||
title: "还可以下载证书,手动部署",
|
title: "还可以下载证书,手动部署",
|
||||||
descriptions: ["如果还没有好用的部署插件,没办法自动部署,你还可以下载证书,手动部署"]
|
descriptions: ["如果还没有好用的部署插件,没办法自动部署,你还可以下载证书,手动部署"]
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ const steps = ref<Step[]>([
|
||||||
description: "自动运行",
|
description: "自动运行",
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/14-timer.png",
|
image: "/static/doc/images/14-timer.png",
|
||||||
title: "设置定时执行",
|
title: "设置定时执行",
|
||||||
descriptions: [
|
descriptions: [
|
||||||
"流水线测试成功,接下来配置定时触发,以后每天定时执行就不用管了",
|
"流水线测试成功,接下来配置定时触发,以后每天定时执行就不用管了",
|
||||||
|
@ -189,7 +189,7 @@ const steps = ref<Step[]>([
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
image: "/assets/doc/images/15-1-email.png",
|
image: "/static/doc/images/15-1-email.png",
|
||||||
title: "设置邮件通知",
|
title: "设置邮件通知",
|
||||||
descriptions: ["建议选择监听'错误时'和'错误转成功'两种即可,在意外失败时可以尽快去排查问题,(免费版需要配置邮件服务器)"]
|
descriptions: ["建议选择监听'错误时'和'错误转成功'两种即可,在意外失败时可以尽快去排查问题,(免费版需要配置邮件服务器)"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,8 +85,11 @@ export const useSettingStore = defineStore({
|
||||||
const settings = await basicApi.getSysPublicSettings();
|
const settings = await basicApi.getSysPublicSettings();
|
||||||
_.merge(this.sysPublic, settings);
|
_.merge(this.sysPublic, settings);
|
||||||
|
|
||||||
const siteInfo = await basicApi.getSiteInfo();
|
const userStore = useUserStore();
|
||||||
_.merge(this.siteInfo, siteInfo);
|
if (userStore.isComm) {
|
||||||
|
const siteInfo = await basicApi.getSiteInfo();
|
||||||
|
_.merge(this.siteInfo, siteInfo);
|
||||||
|
}
|
||||||
|
|
||||||
await this.loadInstallInfo();
|
await this.loadInstallInfo();
|
||||||
|
|
||||||
|
|
|
@ -58,10 +58,10 @@ export const useUserStore = defineStore({
|
||||||
vipLabel(): string {
|
vipLabel(): string {
|
||||||
const vipLabelMap: any = {
|
const vipLabelMap: any = {
|
||||||
free: "免费版",
|
free: "免费版",
|
||||||
vip: "专业版",
|
plus: "专业版",
|
||||||
comm: "商业版"
|
comm: "商业版"
|
||||||
};
|
};
|
||||||
return vipLabelMap[this.plusInfo?.vipType];
|
return vipLabelMap[this.plusInfo?.vipType || "free"];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -100,7 +100,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||||
column: {
|
column: {
|
||||||
show: computed(() => {
|
show: computed(() => {
|
||||||
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
|
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
|
||||||
})
|
}),
|
||||||
|
width: 100
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pipelineId: {
|
pipelineId: {
|
||||||
|
@ -111,6 +112,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
show: false
|
show: false
|
||||||
|
},
|
||||||
|
column: {
|
||||||
|
width: 100
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pipelineTitle: {
|
pipelineTitle: {
|
||||||
|
@ -123,7 +127,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
width: 200
|
width: 300
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
createTime: {
|
createTime: {
|
||||||
|
@ -134,7 +138,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 125,
|
width: 160,
|
||||||
align: "center"
|
align: "center"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,43 +1,20 @@
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { request } from "/src/api/service";
|
import { request } from "/src/api/service";
|
||||||
const apiPrefix = "/sys/settings";
|
const apiPrefix = "/sys/site";
|
||||||
|
|
||||||
export const SettingKeys = {
|
|
||||||
SysPublic: "sys.public",
|
|
||||||
SysPrivate: "sys.private"
|
|
||||||
};
|
|
||||||
export async function SettingsGet(key: string) {
|
export async function SettingsGet(key: string) {
|
||||||
return await request({
|
return await request({
|
||||||
url: apiPrefix + "/get",
|
url: apiPrefix + "/get",
|
||||||
method: "post",
|
method: "post"
|
||||||
params: {
|
|
||||||
key
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function SettingsSave(key: string, setting: any) {
|
export async function SettingsSave(setting: any) {
|
||||||
await request({
|
await request({
|
||||||
url: apiPrefix + "/save",
|
url: apiPrefix + "/save",
|
||||||
method: "post",
|
method: "post",
|
||||||
data: {
|
data: {
|
||||||
key,
|
|
||||||
setting: JSON.stringify(setting)
|
setting: JSON.stringify(setting)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function PublicSettingsSave(setting: any) {
|
|
||||||
await request({
|
|
||||||
url: apiPrefix + "/savePublicSettings",
|
|
||||||
method: "post",
|
|
||||||
data: setting
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function stopOtherUserTimer() {
|
|
||||||
await request({
|
|
||||||
url: apiPrefix + "/stopOtherUserTimer",
|
|
||||||
method: "post"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { ALL, Body, Controller, Inject, Post, Provide } from '@midwayjs/core';
|
import { ALL, Body, Controller, Inject, Post, Provide } from '@midwayjs/core';
|
||||||
import { BaseController } from '@certd/lib-server';
|
import { BaseController, PlusService } from '@certd/lib-server';
|
||||||
import { PlusService } from '../basic/service/plus-service.js';
|
|
||||||
import { AppKey } from '@certd/pipeline';
|
import { AppKey } from '@certd/pipeline';
|
||||||
import { SysSettingsService } from '@certd/lib-server';
|
import { SysSettingsService } from '@certd/lib-server';
|
||||||
import { SysInstallInfo } from '@certd/lib-server';
|
import { SysInstallInfo } from '@certd/lib-server';
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
|
import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
|
||||||
import { logger } from '@certd/pipeline';
|
import { logger } from '@certd/pipeline';
|
||||||
import { UserService } from '../authority/service/user-service.js';
|
import { UserService } from '../authority/service/user-service.js';
|
||||||
import { SysSettingsService } from '@certd/lib-server';
|
import { PlusService, SysSettingsService } from '@certd/lib-server';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { SysInstallInfo, SysPrivateSettings } from '@certd/lib-server';
|
import { SysInstallInfo, SysPrivateSettings } from '@certd/lib-server';
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
import { PlusService } from '../basic/service/plus-service.js';
|
|
||||||
|
|
||||||
export type InstallInfo = {
|
export type InstallInfo = {
|
||||||
installTime: number;
|
installTime: number;
|
||||||
|
|
|
@ -23,7 +23,6 @@ export class AutoRegisterCron {
|
||||||
@Init()
|
@Init()
|
||||||
async init() {
|
async init() {
|
||||||
logger.info('加载定时trigger开始');
|
logger.info('加载定时trigger开始');
|
||||||
|
|
||||||
await this.pipelineService.onStartup(this.immediateTriggerOnce, this.onlyAdminUser);
|
await this.pipelineService.onStartup(this.immediateTriggerOnce, this.onlyAdminUser);
|
||||||
logger.info('加载定时trigger完成');
|
logger.info('加载定时trigger完成');
|
||||||
//
|
//
|
||||||
|
|
|
@ -10,6 +10,7 @@ import * as fs from 'fs';
|
||||||
import { logger } from '@certd/pipeline';
|
import { logger } from '@certd/pipeline';
|
||||||
import { AuthService } from '../../authority/service/auth-service.js';
|
import { AuthService } from '../../authority/service/auth-service.js';
|
||||||
import { SysSettingsService } from '@certd/lib-server';
|
import { SysSettingsService } from '@certd/lib-server';
|
||||||
|
import { In } from 'typeorm';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 证书
|
* 证书
|
||||||
|
@ -35,16 +36,34 @@ export class HistoryController extends CrudController<HistoryService> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post('/page', { summary: Constants.per.authOnly })
|
@Post('/page', { summary: Constants.per.authOnly })
|
||||||
async page(@Body(ALL) body) {
|
async page(@Body(ALL) body: any) {
|
||||||
const isAdmin = await this.authService.isAdmin(this.ctx);
|
const isAdmin = await this.authService.isAdmin(this.ctx);
|
||||||
const publicSettings = await this.sysSettingsService.getPublicSettings();
|
const publicSettings = await this.sysSettingsService.getPublicSettings();
|
||||||
|
const pipelineQuery: any = {};
|
||||||
if (!(publicSettings.managerOtherUserPipeline && isAdmin)) {
|
if (!(publicSettings.managerOtherUserPipeline && isAdmin)) {
|
||||||
body.query.userId = this.ctx.user.id;
|
body.query.userId = this.ctx.user.id;
|
||||||
|
pipelineQuery.userId = this.ctx.user.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await super.page(body);
|
let pipelineIds: any = null;
|
||||||
|
const pipelineTitle = body.query?.pipelineTitle;
|
||||||
|
if (pipelineTitle) {
|
||||||
|
const pipelines = await this.pipelineService.list(pipelineQuery, null, qb => {
|
||||||
|
qb.where('title like :title', { title: `%${pipelineTitle}%` });
|
||||||
|
});
|
||||||
|
pipelineIds = pipelines.map(p => p.id);
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
const buildQuery = qb => {
|
||||||
|
if (pipelineIds) {
|
||||||
|
qb.where({
|
||||||
|
pipelineId: In(pipelineIds),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const res = await this.service.page(body?.query, body?.page, body?.sort, buildQuery);
|
||||||
|
return this.ok(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post('/list', { summary: Constants.per.authOnly })
|
@Post('/list', { summary: Constants.per.authOnly })
|
||||||
|
|
|
@ -18,6 +18,9 @@ import { logger } from '@certd/pipeline';
|
||||||
export class HistoryService extends BaseService<HistoryEntity> {
|
export class HistoryService extends BaseService<HistoryEntity> {
|
||||||
@InjectEntityModel(HistoryEntity)
|
@InjectEntityModel(HistoryEntity)
|
||||||
repository: Repository<HistoryEntity>;
|
repository: Repository<HistoryEntity>;
|
||||||
|
|
||||||
|
@InjectEntityModel(PipelineEntity)
|
||||||
|
pipelineRepository: Repository<PipelineEntity>;
|
||||||
@Inject()
|
@Inject()
|
||||||
logService: HistoryLogService;
|
logService: HistoryLogService;
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,5 @@
|
||||||
"dist",
|
"dist",
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"test"
|
"test"
|
||||||
],
|
|
||||||
"references": [
|
|
||||||
{ "path": "../../libs/midway-flyway-js" },
|
|
||||||
{ "path": "../../libs/lib-k8s" },
|
|
||||||
{ "path": "../../libs/lib-huawei" },
|
|
||||||
{ "path": "../../plugins/plugin-cert" },
|
|
||||||
{ "path": "../../core/acme-client" },
|
|
||||||
{ "path": "../../core/pipeline" }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
54
step.md
|
@ -13,19 +13,19 @@
|
||||||
## 自动化流水线创建
|
## 自动化流水线创建
|
||||||
|
|
||||||
### 1. 创建证书申请部署流水线
|
### 1. 创建证书申请部署流水线
|
||||||
![创建证书申请任务](./packages/ui/certd-client/src/assets/doc/images/1-add.png)
|
![创建证书申请任务](packages/ui/certd-client/public/statics/doc/images/1-add.png)
|
||||||
|
|
||||||
需要添加域名的DNS解析服务商的授权
|
需要添加域名的DNS解析服务商的授权
|
||||||
![添加域名的DNS解析服务商的授权](./packages/ui/certd-client/src/assets/doc/images/2-access-provider.png)
|
![添加域名的DNS解析服务商的授权](packages/ui/certd-client/public/statics/doc/images/2-access-provider.png)
|
||||||
|
|
||||||
填写accessKey和accessSecret
|
填写accessKey和accessSecret
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/3-add-access.png)
|
![](packages/ui/certd-client/public/statics/doc/images/3-add-access.png)
|
||||||
流水线创建成功
|
流水线创建成功
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/4-add-success.png)
|
![](packages/ui/certd-client/public/statics/doc/images/4-add-success.png)
|
||||||
|
|
||||||
### 2. 任务详情界面
|
### 2. 任务详情界面
|
||||||
|
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/5-view.png)
|
![](packages/ui/certd-client/public/statics/doc/images/5-view.png)
|
||||||
|
|
||||||
到这一步申请证书就已经配置完成了。
|
到这一步申请证书就已经配置完成了。
|
||||||
点击手动触发,就可以申请证书了。
|
点击手动触发,就可以申请证书了。
|
||||||
|
@ -34,72 +34,72 @@
|
||||||
|
|
||||||
### 3. 添加部署到阿里云CDN任务
|
### 3. 添加部署到阿里云CDN任务
|
||||||
点击添加任务
|
点击添加任务
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/6-1-add-task.png)
|
![](packages/ui/certd-client/public/statics/doc/images/6-1-add-task.png)
|
||||||
|
|
||||||
选择任务类型
|
选择任务类型
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/6-2-add-task.png)
|
![](packages/ui/certd-client/public/statics/doc/images/6-2-add-task.png)
|
||||||
|
|
||||||
填写任务参数
|
填写任务参数
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/6-3-add-task.png)
|
![](packages/ui/certd-client/public/statics/doc/images/6-3-add-task.png)
|
||||||
|
|
||||||
点击确定,部署到CDN任务配置成功
|
点击确定,部署到CDN任务配置成功
|
||||||
|
|
||||||
### 4. 添加部署到服务器主机任务
|
### 4. 添加部署到服务器主机任务
|
||||||
点击新任务,弹出添加任务界面
|
点击新任务,弹出添加任务界面
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/7-1-add-host-task.png)
|
![](packages/ui/certd-client/public/statics/doc/images/7-1-add-host-task.png)
|
||||||
先选择上传到主机任务
|
先选择上传到主机任务
|
||||||
|
|
||||||
填写任务参数,比如证书保存路径
|
填写任务参数,比如证书保存路径
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/7-2-add-host-task.png)
|
![](packages/ui/certd-client/public/statics/doc/images/7-2-add-host-task.png)
|
||||||
|
|
||||||
需要添加主机ip、用户名、密码,只需添加一次,后续其他任务可以复用
|
需要添加主机ip、用户名、密码,只需添加一次,后续其他任务可以复用
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/7-3-add-host-task.png)
|
![](packages/ui/certd-client/public/statics/doc/images/7-3-add-host-task.png)
|
||||||
|
|
||||||
然后添加第二个任务,执行主机命令,部署证书
|
然后添加第二个任务,执行主机命令,部署证书
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/8-1-add-host-task.png)
|
![](packages/ui/certd-client/public/statics/doc/images/8-1-add-host-task.png)
|
||||||
|
|
||||||
选择执行脚本命令任务
|
选择执行脚本命令任务
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/8-2-add-host-task.png)
|
![](packages/ui/certd-client/public/statics/doc/images/8-2-add-host-task.png)
|
||||||
|
|
||||||
编写脚本,选择之前添加的主机
|
编写脚本,选择之前添加的主机
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/8-4-add-host-task.png)
|
![](packages/ui/certd-client/public/statics/doc/images/8-4-add-host-task.png)
|
||||||
|
|
||||||
点击确定,部署到主机任务配置成功
|
点击确定,部署到主机任务配置成功
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/8-5-add-host-task.png)
|
![](packages/ui/certd-client/public/statics/doc/images/8-5-add-host-task.png)
|
||||||
|
|
||||||
### 5. 手动触发执行任务,测试一下
|
### 5. 手动触发执行任务,测试一下
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/9-start.png)
|
![](packages/ui/certd-client/public/statics/doc/images/9-start.png)
|
||||||
|
|
||||||
点击任务可以查看状态和日志
|
点击任务可以查看状态和日志
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/10-1-log.png)
|
![](packages/ui/certd-client/public/statics/doc/images/10-1-log.png)
|
||||||
|
|
||||||
这里执行失败,可以查看错误日志
|
这里执行失败,可以查看错误日志
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/11-1-error.png)
|
![](packages/ui/certd-client/public/statics/doc/images/11-1-error.png)
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/11-2-error.png)
|
![](packages/ui/certd-client/public/statics/doc/images/11-2-error.png)
|
||||||
|
|
||||||
修改正确后,重新执行
|
修改正确后,重新执行
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/12-1-log-success.png)
|
![](packages/ui/certd-client/public/statics/doc/images/12-1-log-success.png)
|
||||||
可以看到前面执行过的就会跳过,不会重复执行
|
可以看到前面执行过的就会跳过,不会重复执行
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/12-2-skip-log.png)
|
![](packages/ui/certd-client/public/statics/doc/images/12-2-skip-log.png)
|
||||||
|
|
||||||
### 6. 查看证书部署效果
|
### 6. 查看证书部署效果
|
||||||
可以看到证书已经部署到CDN成功
|
可以看到证书已经部署到CDN成功
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/13-1-result.png)
|
![](packages/ui/certd-client/public/statics/doc/images/13-1-result.png)
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/13-2-result.png)
|
![](packages/ui/certd-client/public/statics/doc/images/13-2-result.png)
|
||||||
也可以手动下载证书
|
也可以手动下载证书
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/13-3-download.png)
|
![](packages/ui/certd-client/public/statics/doc/images/13-3-download.png)
|
||||||
|
|
||||||
### 7. 定时触发
|
### 7. 定时触发
|
||||||
配置定时触发,以后每天定时执行
|
配置定时触发,以后每天定时执行
|
||||||
cron格式,例如: `0 0 3 * * *` 表示每天凌晨3点执行
|
cron格式,例如: `0 0 3 * * *` 表示每天凌晨3点执行
|
||||||
到期前20天会自动申请新证书并部署,没到期前不会重复申请
|
到期前20天会自动申请新证书并部署,没到期前不会重复申请
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/14-timer.png)
|
![](packages/ui/certd-client/public/statics/doc/images/14-timer.png)
|
||||||
|
|
||||||
### 8. 邮件通知
|
### 8. 邮件通知
|
||||||
可以接收邮件通知(支持时机:开始、成功、失败、失败转成功)
|
可以接收邮件通知(支持时机:开始、成功、失败、失败转成功)
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/15-1-email.png)
|
![](packages/ui/certd-client/public/statics/doc/images/15-1-email.png)
|
||||||
需要配置邮件服务器
|
需要配置邮件服务器
|
||||||
![](./packages/ui/certd-client/src/assets/doc/images/15-2-email.png)
|
![](packages/ui/certd-client/public/statics/doc/images/15-2-email.png)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|