mirror of
https://github.com/certd/certd.git
synced 2026-04-14 04:20:52 +08:00
261 lines
7.0 KiB
YAML
261 lines
7.0 KiB
YAML
showRunStrategy: false
|
||
default:
|
||
strategy:
|
||
runStrategy: 1
|
||
name: uploadCertToHost
|
||
title: 主机-部署证书到SSH主机
|
||
icon: line-md:uploading-loop
|
||
group: host
|
||
desc: 上传证书到主机覆盖原来的证书文件,然后自动执行部署脚本命令使证书生效
|
||
order: 1
|
||
input:
|
||
cert:
|
||
title: 域名证书
|
||
helper: 请选择前置任务输出的域名证书
|
||
component:
|
||
name: output-selector
|
||
from:
|
||
- ':cert:'
|
||
required: true
|
||
order: 0
|
||
certType:
|
||
title: 证书格式
|
||
helper: |-
|
||
要部署的证书格式,支持pem/crt、pfx、der、jks、p7b
|
||
你原来的证书是哪种格式就选择哪种
|
||
component:
|
||
name: a-select
|
||
options:
|
||
- value: pem
|
||
label: pem/crt,用于Nginx等大部分应用,证书和私钥2个文件
|
||
- value: pfx
|
||
label: pfx,一般用于IIS
|
||
- value: der
|
||
label: der,一般用于Apache
|
||
- value: jks
|
||
label: jks,一般用于JAVA应用
|
||
- value: one
|
||
label: 证书私钥一体,crt+key简单合并为一个pem文件
|
||
- value: p7b
|
||
label: p7b格式
|
||
required: true
|
||
order: 0
|
||
crtPath:
|
||
title: 证书保存路径
|
||
helper: 填写应用原本的证书保存路径,路径要包含证书文件名,例如:/tmp/cert.pem
|
||
component:
|
||
placeholder: /root/deploy/nginx/full_chain.pem
|
||
mergeScript: |2-
|
||
|
||
return {
|
||
show: ctx.compute(({form})=>{
|
||
return form.certType === 'pem';
|
||
})
|
||
}
|
||
|
||
required: true
|
||
rules:
|
||
- type: filepath
|
||
order: 0
|
||
keyPath:
|
||
title: 私钥保存路径
|
||
helper: 原本的私钥保存路径,需要有写入权限,路径要包含私钥文件名,例如:/tmp/cert.key
|
||
component:
|
||
placeholder: /root/deploy/nginx/cert.key
|
||
mergeScript: |2-
|
||
|
||
return {
|
||
show: ctx.compute(({form})=>{
|
||
return form.certType === 'pem' || form.certType === 'p7b' ;
|
||
})
|
||
}
|
||
|
||
required: true
|
||
rules:
|
||
- type: filepath
|
||
order: 0
|
||
icPath:
|
||
title: 中间证书保存路径
|
||
helper: 路径要包含文件名,一般情况传上面两个文件即可,极少数情况需要这个中间证书
|
||
component:
|
||
placeholder: /root/deploy/nginx/intermediate.pem
|
||
mergeScript: |2-
|
||
|
||
return {
|
||
show: ctx.compute(({form})=>{
|
||
return form.certType === 'pem';
|
||
})
|
||
}
|
||
|
||
rules:
|
||
- type: filepath
|
||
order: 0
|
||
pfxPath:
|
||
title: PFX证书保存路径
|
||
helper: 填写应用原本的证书保存路径,路径要包含证书文件名,例如:D:\iis\cert.pfx
|
||
component:
|
||
placeholder: D:\iis\cert.pfx
|
||
mergeScript: |2-
|
||
|
||
return {
|
||
show: ctx.compute(({form})=>{
|
||
return form.certType === 'pfx';
|
||
})
|
||
}
|
||
|
||
required: true
|
||
rules:
|
||
- type: filepath
|
||
order: 0
|
||
derPath:
|
||
title: DER证书保存路径
|
||
helper: 填写应用原本的证书保存路径,路径要包含证书文件名,例如:/tmp/cert.der
|
||
component:
|
||
placeholder: /root/deploy/apache/cert.der
|
||
mergeScript: |2-
|
||
|
||
return {
|
||
show: ctx.compute(({form})=>{
|
||
return form.certType === 'der';
|
||
})
|
||
}
|
||
|
||
required: true
|
||
rules:
|
||
- type: filepath
|
||
order: 0
|
||
jksPath:
|
||
title: jks证书保存路径
|
||
helper: 填写应用原本的证书保存路径,路径要包含证书文件名,例如:/tmp/cert.jks
|
||
component:
|
||
placeholder: /root/deploy/java_app/cert.jks
|
||
mergeScript: |2-
|
||
|
||
return {
|
||
show: ctx.compute(({form})=>{
|
||
return form.certType === 'jks';
|
||
})
|
||
}
|
||
|
||
required: true
|
||
rules:
|
||
- type: filepath
|
||
order: 0
|
||
onePath:
|
||
title: 一体证书保存路径
|
||
helper: 填写应用原本的证书保存路径,路径要包含证书文件名,例如:/tmp/crt_key.pem
|
||
component:
|
||
placeholder: /root/deploy/app/crt_key.pem
|
||
mergeScript: |2-
|
||
|
||
return {
|
||
show: ctx.compute(({form})=>{
|
||
return form.certType === 'one';
|
||
})
|
||
}
|
||
|
||
required: true
|
||
rules:
|
||
- type: filepath
|
||
order: 0
|
||
p7bPath:
|
||
title: p7b证书保存路径
|
||
helper: 填写应用原本的证书保存路径,路径要包含证书文件名,例如:/tmp/domain_cert.p7b
|
||
component:
|
||
placeholder: /root/deploy/app/domain_cert.p7b
|
||
mergeScript: |2-
|
||
|
||
return {
|
||
show: ctx.compute(({form})=>{
|
||
return form.certType === 'p7b';
|
||
})
|
||
}
|
||
|
||
required: true
|
||
rules:
|
||
- type: filepath
|
||
order: 0
|
||
accessId:
|
||
title: 主机登录配置
|
||
helper: access授权
|
||
component:
|
||
name: access-selector
|
||
type: ssh
|
||
required: true
|
||
order: 0
|
||
uploadType:
|
||
title: 上传方式
|
||
helper: |-
|
||
支持sftp或者scp
|
||
需要有写入权限,如果没有,须先将证书上传到有权限的目录,再通过后置命令复制到目标路径
|
||
value: sftp
|
||
component:
|
||
name: a-select
|
||
options:
|
||
- value: sftp
|
||
label: sftp
|
||
- value: scp
|
||
label: scp
|
||
required: true
|
||
order: 0
|
||
mkdirs:
|
||
title: 自动创建远程目录
|
||
helper: 是否自动创建远程目录,如果关闭则你需要自己确保远程目录存在
|
||
value: true
|
||
component:
|
||
name: a-switch
|
||
vModel: checked
|
||
order: 0
|
||
scriptPre:
|
||
title: 前置命令
|
||
component:
|
||
name: a-textarea
|
||
vModel: value
|
||
rows: 3
|
||
placeholder: mkdir /app/ssl
|
||
helper: 上传前执行脚本命令,做上传前的准备工作
|
||
required: false
|
||
order: 0
|
||
script:
|
||
title: 后置命令
|
||
component:
|
||
name: a-textarea
|
||
vModel: value
|
||
rows: 5
|
||
placeholder: 'systemctl restart nginx '
|
||
helper: |-
|
||
上传后执行脚本命令,让证书生效(比如重启nginx),不填则不执行
|
||
注意:sudo需要配置免密,不要使用-i这种交互式命令
|
||
注意:如果目标主机是windows,且终端是cmd,系统会自动将多行命令通过“&&”连接成一行
|
||
required: false
|
||
order: 0
|
||
injectEnv:
|
||
title: 注入环境变量
|
||
value: false
|
||
component:
|
||
name: a-switch
|
||
vModel: checked
|
||
helper: 是否将证书域名、路径等信息注入脚本执行环境变量中,具体的变量名称,可以运行后从日志中查看
|
||
required: false
|
||
order: 0
|
||
output:
|
||
hostCrtPath:
|
||
title: 证书保存路径
|
||
hostKeyPath:
|
||
title: 私钥保存路径
|
||
hostIcPath:
|
||
title: 中间证书保存路径
|
||
hostPfxPath:
|
||
title: PFX保存路径
|
||
hostDerPath:
|
||
title: DER保存路径
|
||
hostJksPath:
|
||
title: jks保存路径
|
||
hostOnePath:
|
||
title: 一体证书保存路径
|
||
hostP7bPath:
|
||
title: p7b证书保存路径
|
||
pluginType: deploy
|
||
type: builtIn
|
||
scriptFilePath: /plugins/plugin-host/plugin/upload-to-host/index.js
|