mirror of
https://github.com/certd/certd.git
synced 2026-04-14 20:40:53 +08:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7eb6d7d053 | ||
|
|
93b6431369 | ||
|
|
d301ac6832 | ||
|
|
1af19f0ac0 | ||
|
|
24c7be2c9c | ||
|
|
c3f04a80fd | ||
|
|
bf6c5d690e | ||
|
|
7c92762f48 | ||
|
|
efacfd6b2c | ||
|
|
93559174c7 | ||
|
|
1b0ae8654f | ||
|
|
d11a19ce59 | ||
|
|
9a68b0fb61 | ||
|
|
79bbdce1e1 | ||
|
|
916ee4a089 | ||
|
|
ac9313da38 | ||
|
|
ed01ef1eb7 | ||
|
|
7ec2218c9f | ||
|
|
e8ed97206b | ||
|
|
c45d85e612 | ||
|
|
b3ff0fd880 | ||
|
|
2fbc7459e2 | ||
|
|
fbf4959463 | ||
|
|
02bb0be06a | ||
|
|
87e440ee2a | ||
|
|
2182dce07c | ||
|
|
3f0a10007c |
2
.github/workflows/build-image.yml
vendored
2
.github/workflows/build-image.yml
vendored
@@ -61,7 +61,7 @@ jobs:
|
|||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6.5.0
|
uses: docker/build-push-action@v6.5.0
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
context: ./packages/ui/
|
context: ./packages/ui/
|
||||||
tags: |
|
tags: |
|
||||||
|
|||||||
27
CHANGELOG.md
27
CHANGELOG.md
@@ -3,6 +3,33 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.23.1](https://github.com/certd/certd/compare/v1.23.0...v1.23.1) (2024-08-06)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复模糊查询无效的bug ([9355917](https://github.com/certd/certd/commit/93559174c780173f0daec7cdbd1f72f8d5c504d5))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化插件字段的default value ([24c7be2](https://github.com/certd/certd/commit/24c7be2c9cb39c14f7a97b674127c88033280b02))
|
||||||
|
* 优化默认值设置 ([1af19f0](https://github.com/certd/certd/commit/1af19f0ac053fe109782882964533636b5969d6b))
|
||||||
|
|
||||||
|
# [1.23.0](https://github.com/certd/certd/compare/v1.22.9...v1.23.0) (2024-08-05)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复环境变量多个下划线不生效的bug ([7ec2218](https://github.com/certd/certd/commit/7ec2218c9fee5bee2bf0aa31f3e3a4301575f247))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* use node 20 ([e8ed972](https://github.com/certd/certd/commit/e8ed97206bf28e83f942db2ef4ea07fa76fd3567))
|
||||||
|
|
||||||
|
## [1.22.9](https://github.com/certd/certd/compare/v1.22.8...v1.22.9) (2024-08-05)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化定时任务 ([87e440e](https://github.com/certd/certd/commit/87e440ee2a8b10dc571ce619f28bc83c1e5eb147))
|
||||||
|
|
||||||
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -5,6 +5,17 @@ CertD 是一个免费全自动申请和自动部署更新SSL证书的工具。
|
|||||||
|
|
||||||
关键字:证书自动申请、证书自动更新、证书自动续期、证书自动续签
|
关键字:证书自动申请、证书自动更新、证书自动续期、证书自动续签
|
||||||
|
|
||||||
|
************************
|
||||||
|
支持开源,为爱发电,我已入驻爱发电
|
||||||
|
https://afdian.com/a/greper
|
||||||
|
|
||||||
|
发电权益:
|
||||||
|
1. 可加入发电专属群(先加我好友,发送发电截图,我拉你进群)
|
||||||
|
2. 你的需求优先实现
|
||||||
|
3. 可以获得作者一对一技术支持
|
||||||
|
4. 更多权益陆续增加中...
|
||||||
|
************************
|
||||||
|
|
||||||
## 一、特性
|
## 一、特性
|
||||||
本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。
|
本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。
|
||||||
|
|
||||||
@@ -22,7 +33,7 @@ CertD 是一个免费全自动申请和自动部署更新SSL证书的工具。
|
|||||||
|
|
||||||
https://certd.handsfree.work/
|
https://certd.handsfree.work/
|
||||||
|
|
||||||
> 注意数据将不定期清理,生产使用请自行部署
|
> 注意数据将不定期清理,不定期停止定时任务,生产使用请自行部署
|
||||||
> 包含敏感信息,务必自己本地部署进行生产使用
|
> 包含敏感信息,务必自己本地部署进行生产使用
|
||||||
|
|
||||||
## 三、使用教程
|
## 三、使用教程
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
22:33
|
2
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
|
|
||||||
# 免费服务器部署
|
|
||||||
|
|
||||||
## 1. 注册koyeb账号
|
|
||||||
|
|
||||||
https://app.koyeb.com/
|
|
||||||
|
|
||||||
## 2. 创建应用
|
|
||||||
@@ -9,5 +9,5 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmClient": "pnpm",
|
"npmClient": "pnpm",
|
||||||
"version": "1.22.8"
|
"version": "1.23.1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "lerna bootstrap --hoist",
|
"start": "lerna bootstrap --hoist",
|
||||||
"i-all": "lerna link && lerna exec npm install ",
|
"i-all": "lerna link && lerna exec npm install ",
|
||||||
"publish": "npm run prepublishOnly1 && lerna publish --conventional-commits --create-release github && npm run afterpublishOnly",
|
"publish": "npm run prepublishOnly2 && lerna publish --conventional-commits --create-release github && npm run afterpublishOnly",
|
||||||
"afterpublishOnly": "time /t >build.trigger && git add ./build.trigger && git commit -m \"build: trigger build image\" && TIMEOUT /T 10 && git push",
|
"afterpublishOnly": "time /t >build.trigger && git add ./build.trigger && git commit -m \"build: trigger build image\" && TIMEOUT /T 10 && git push",
|
||||||
"prepublishOnly1": "npm run check && lerna run build ",
|
"prepublishOnly1": "npm run check && lerna run build ",
|
||||||
"prepublishOnly2": "npm run check && npm run before-build && lerna run build ",
|
"prepublishOnly2": "npm run check && npm run before-build && lerna run build ",
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.23.1](https://github.com/certd/certd/compare/v1.23.0...v1.23.1) (2024-08-06)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
22:30
|
11:38
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/pipeline",
|
"name": "@certd/pipeline",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.22.8",
|
"version": "1.23.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.23.1](https://github.com/certd/certd/compare/v1.23.0...v1.23.1) (2024-08-06)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|
||||||
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/lib-k8s
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-k8s",
|
"name": "@certd/lib-k8s",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.22.8",
|
"version": "1.23.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"shelljs": "^0.8.5"
|
"shelljs": "^0.8.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/pipeline": "^1.22.8",
|
"@certd/pipeline": "^1.23.1",
|
||||||
"@rollup/plugin-commonjs": "^23.0.4",
|
"@rollup/plugin-commonjs": "^23.0.4",
|
||||||
"@rollup/plugin-json": "^6.0.0",
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import kubernetesClient from 'kubernetes-client';
|
import kubernetesClient from 'kubernetes-client';
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
import dns from 'dns';
|
import dns from 'dns';
|
||||||
import { logger } from '@certd/pipeline';
|
import { ILogger } from '@certd/pipeline';
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
const { KubeConfig, Client, Request } = kubernetesClient;
|
const { KubeConfig, Client, Request } = kubernetesClient;
|
||||||
@@ -10,8 +10,10 @@ export class K8sClient {
|
|||||||
kubeConfigStr: string;
|
kubeConfigStr: string;
|
||||||
lookup!: any;
|
lookup!: any;
|
||||||
client!: any;
|
client!: any;
|
||||||
constructor(kubeConfigStr: string) {
|
logger: ILogger;
|
||||||
|
constructor(kubeConfigStr: string, logger: ILogger) {
|
||||||
this.kubeConfigStr = kubeConfigStr;
|
this.kubeConfigStr = kubeConfigStr;
|
||||||
|
this.logger = logger;
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,9 +35,9 @@ export class K8sClient {
|
|||||||
*/
|
*/
|
||||||
setLookup(localRecords: { [key: string]: { ip: string } }) {
|
setLookup(localRecords: { [key: string]: { ip: string } }) {
|
||||||
this.lookup = (hostnameReq: any, options: any, callback: any) => {
|
this.lookup = (hostnameReq: any, options: any, callback: any) => {
|
||||||
logger.info('custom lookup', hostnameReq, localRecords);
|
this.logger.info('custom lookup', hostnameReq, localRecords);
|
||||||
if (localRecords[hostnameReq]) {
|
if (localRecords[hostnameReq]) {
|
||||||
logger.info('local record', hostnameReq, localRecords[hostnameReq]);
|
this.logger.info('local record', hostnameReq, localRecords[hostnameReq]);
|
||||||
callback(null, localRecords[hostnameReq].ip, 4);
|
callback(null, localRecords[hostnameReq].ip, 4);
|
||||||
} else {
|
} else {
|
||||||
dns.lookup(hostnameReq, options, callback);
|
dns.lookup(hostnameReq, options, callback);
|
||||||
@@ -64,7 +66,7 @@ export class K8sClient {
|
|||||||
const created = await this.client.api.v1.namespaces(namespace).secrets.post({
|
const created = await this.client.api.v1.namespaces(namespace).secrets.post({
|
||||||
body: opts.body,
|
body: opts.body,
|
||||||
});
|
});
|
||||||
logger.info('new secrets:', created);
|
this.logger.info('new secrets:', created);
|
||||||
return created;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,12 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.23.1](https://github.com/certd/certd/compare/v1.23.0...v1.23.1) (2024-08-06)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化插件字段的default value ([24c7be2](https://github.com/certd/certd/commit/24c7be2c9cb39c14f7a97b674127c88033280b02))
|
||||||
|
|
||||||
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-cert
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-cert",
|
"name": "@certd/plugin-cert",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.22.8",
|
"version": "1.23.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^1.22.6",
|
"@certd/acme-client": "^1.22.6",
|
||||||
"@certd/pipeline": "^1.22.8",
|
"@certd/pipeline": "^1.23.1",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"node-forge": "^0.10.0",
|
"node-forge": "^0.10.0",
|
||||||
"psl": "^1.9.0"
|
"psl": "^1.9.0"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export type { CertInfo };
|
|||||||
export class CertApplyPlugin extends CertApplyBasePlugin {
|
export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: "证书提供商",
|
title: "证书提供商",
|
||||||
default: "letsencrypt",
|
value: "letsencrypt",
|
||||||
component: {
|
component: {
|
||||||
name: "a-select",
|
name: "a-select",
|
||||||
vModel: "value",
|
vModel: "value",
|
||||||
@@ -82,7 +82,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
|||||||
|
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: "使用代理",
|
title: "使用代理",
|
||||||
default: false,
|
value: false,
|
||||||
component: {
|
component: {
|
||||||
name: "a-switch",
|
name: "a-switch",
|
||||||
vModel: "checked",
|
vModel: "checked",
|
||||||
@@ -93,7 +93,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
|||||||
|
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: "跳过本地校验DNS",
|
title: "跳过本地校验DNS",
|
||||||
default: false,
|
value: false,
|
||||||
component: {
|
component: {
|
||||||
name: "a-switch",
|
name: "a-switch",
|
||||||
vModel: "checked",
|
vModel: "checked",
|
||||||
|
|||||||
19
packages/ui/.dockerignore
Normal file
19
packages/ui/.dockerignore
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
logs/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
node_modules/
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
|
coverage/
|
||||||
|
!dist/
|
||||||
|
.idea/
|
||||||
|
run/
|
||||||
|
.DS_Store
|
||||||
|
*.sw*
|
||||||
|
*.un~
|
||||||
|
.tsbuildinfo
|
||||||
|
.tsbuildinfo.*
|
||||||
|
/data/db.sqlite
|
||||||
|
*/node_modules
|
||||||
|
certd-server/tools/windows/
|
||||||
|
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
FROM node:18-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
EXPOSE 7001
|
EXPOSE 7001
|
||||||
WORKDIR /workspace/
|
WORKDIR /workspace/
|
||||||
COPY . /workspace/
|
COPY . /workspace/
|
||||||
RUN npm install -g pnpm@8.15.7
|
RUN npm install -g pnpm
|
||||||
|
|
||||||
#RUN cd /workspace/certd-client && pnpm install && npm run build
|
#RUN cd /workspace/certd-client && pnpm install && npm run build
|
||||||
RUN cp /workspace/certd-client/dist/* /workspace/certd-server/public/ -rf
|
RUN cp /workspace/certd-client/dist/* /workspace/certd-server/public/ -rf
|
||||||
RUN cd /workspace/certd-server && pnpm install && npm run build-on-docker
|
RUN cd /workspace/certd-server && pnpm install && npm run build-on-docker
|
||||||
|
|
||||||
|
|
||||||
FROM node:18-alpine
|
FROM node:20-alpine
|
||||||
WORKDIR /app/
|
WORKDIR /app/
|
||||||
COPY --from=builder /workspace/certd-server/ /app/
|
COPY --from=builder /workspace/certd-server/ /app/
|
||||||
RUN chmod +x /app/tools/linux/*
|
RUN chmod +x /app/tools/linux/*
|
||||||
|
|||||||
@@ -3,6 +3,24 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.23.1](https://github.com/certd/certd/compare/v1.23.0...v1.23.1) (2024-08-06)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化默认值设置 ([1af19f0](https://github.com/certd/certd/commit/1af19f0ac053fe109782882964533636b5969d6b))
|
||||||
|
|
||||||
|
# [1.23.0](https://github.com/certd/certd/compare/v1.22.9...v1.23.0) (2024-08-05)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* use node 20 ([e8ed972](https://github.com/certd/certd/commit/e8ed97206bf28e83f942db2ef4ea07fa76fd3567))
|
||||||
|
|
||||||
|
## [1.22.9](https://github.com/certd/certd/compare/v1.22.8...v1.22.9) (2024-08-05)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化定时任务 ([87e440e](https://github.com/certd/certd/commit/87e440ee2a8b10dc571ce619f28bc83c1e5eb147))
|
||||||
|
|
||||||
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/ui-client",
|
"name": "@certd/ui-client",
|
||||||
"version": "1.22.8",
|
"version": "1.23.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --open",
|
"dev": "vite --open",
|
||||||
@@ -24,10 +24,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/colors": "^7.0.2",
|
"@ant-design/colors": "^7.0.2",
|
||||||
"@ant-design/icons-vue": "^7.0.1",
|
"@ant-design/icons-vue": "^7.0.1",
|
||||||
"@fast-crud/fast-crud": "^1.21.1",
|
"@fast-crud/fast-crud": "^1.21.2",
|
||||||
"@fast-crud/fast-extends": "^1.21.1",
|
"@fast-crud/fast-extends": "^1.21.2",
|
||||||
"@fast-crud/ui-antdv4": "^1.21.1",
|
"@fast-crud/ui-antdv4": "^1.21.2",
|
||||||
"@fast-crud/ui-interface": "^1.21.1",
|
"@fast-crud/ui-interface": "^1.21.2",
|
||||||
"@iconify/vue": "^4.1.1",
|
"@iconify/vue": "^4.1.1",
|
||||||
"@soerenmartius/vue3-clipboard": "^0.1.2",
|
"@soerenmartius/vue3-clipboard": "^0.1.2",
|
||||||
"ant-design-vue": "^4.1.2",
|
"ant-design-vue": "^4.1.2",
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
"vuedraggable": "^2.24.3"
|
"vuedraggable": "^2.24.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/pipeline": "^1.22.8",
|
"@certd/pipeline": "^1.23.1",
|
||||||
"@rollup/plugin-commonjs": "^25.0.7",
|
"@rollup/plugin-commonjs": "^25.0.7",
|
||||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||||
"@types/chai": "^4.3.12",
|
"@types/chai": "^4.3.12",
|
||||||
|
|||||||
@@ -187,6 +187,9 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
|||||||
title: "ID",
|
title: "ID",
|
||||||
key: "id",
|
key: "id",
|
||||||
type: "number",
|
type: "number",
|
||||||
|
search: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
column: {
|
column: {
|
||||||
width: 50
|
width: 50
|
||||||
},
|
},
|
||||||
@@ -233,6 +236,31 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
content: {
|
||||||
|
title: "定时任务数量",
|
||||||
|
type: "number",
|
||||||
|
column: {
|
||||||
|
cellRender({ value }) {
|
||||||
|
if (value && value.triggers) {
|
||||||
|
return value.triggers?.length > 0 ? value.triggers.length : "-";
|
||||||
|
}
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
valueBuilder({ row }) {
|
||||||
|
if (row.content) {
|
||||||
|
row.content = JSON.parse(row.content);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
valueResolve({ row }) {
|
||||||
|
if (row.content) {
|
||||||
|
row.content = JSON.stringify(row.content);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
lastVars: {
|
lastVars: {
|
||||||
title: "到期剩余",
|
title: "到期剩余",
|
||||||
type: "number",
|
type: "number",
|
||||||
@@ -328,6 +356,9 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
|||||||
sorter: true,
|
sorter: true,
|
||||||
align: "center",
|
align: "center",
|
||||||
width: 80
|
width: 80
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
value: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
createTime: {
|
createTime: {
|
||||||
|
|||||||
@@ -148,15 +148,8 @@ export default {
|
|||||||
// 给step的input设置默认值
|
// 给step的input设置默认值
|
||||||
changeCurrentPlugin(currentStep.value);
|
changeCurrentPlugin(currentStep.value);
|
||||||
|
|
||||||
//赋初始值
|
//合并默认值
|
||||||
_.merge(currentStep.value, { input: {}, strategy: { runStrategy: 0 } }, currentPlugin.value.default, currentStep.value);
|
_.merge(currentStep.value, { input: {}, strategy: { runStrategy: 0 } }, currentPlugin.value.default, currentStep.value);
|
||||||
|
|
||||||
for (const key in currentPlugin.value.input) {
|
|
||||||
const input = currentPlugin.value.input[key];
|
|
||||||
if (input.default != null) {
|
|
||||||
currentStep.value.input[key] = input.default ?? input.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const stepDrawerShow = () => {
|
const stepDrawerShow = () => {
|
||||||
@@ -229,7 +222,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//设置初始值
|
//设置初始值
|
||||||
if (input.default != null && currentStep.value.input[key] == null) {
|
if ((input.default != null || input.value != null) && currentStep.value.input[key] == null) {
|
||||||
currentStep.value.input[key] = input.default ?? input.value;
|
currentStep.value.input[key] = input.default ?? input.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ run/
|
|||||||
.tsbuildinfo
|
.tsbuildinfo
|
||||||
.tsbuildinfo.*
|
.tsbuildinfo.*
|
||||||
/data/db.sqlite
|
/data/db.sqlite
|
||||||
|
*/node_modules
|
||||||
/tools/windows/
|
certd-server/tools/windows/
|
||||||
|
|
||||||
|
|||||||
@@ -13,3 +13,4 @@ typeorm:
|
|||||||
username: postgres
|
username: postgres
|
||||||
password: root
|
password: root
|
||||||
database: postgres
|
database: postgres
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,28 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.23.1](https://github.com/certd/certd/compare/v1.23.0...v1.23.1) (2024-08-06)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复模糊查询无效的bug ([9355917](https://github.com/certd/certd/commit/93559174c780173f0daec7cdbd1f72f8d5c504d5))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化插件字段的default value ([24c7be2](https://github.com/certd/certd/commit/24c7be2c9cb39c14f7a97b674127c88033280b02))
|
||||||
|
|
||||||
|
# [1.23.0](https://github.com/certd/certd/compare/v1.22.9...v1.23.0) (2024-08-05)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复环境变量多个下划线不生效的bug ([7ec2218](https://github.com/certd/certd/commit/7ec2218c9fee5bee2bf0aa31f3e3a4301575f247))
|
||||||
|
|
||||||
|
## [1.22.9](https://github.com/certd/certd/compare/v1.22.8...v1.22.9) (2024-08-05)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化定时任务 ([87e440e](https://github.com/certd/certd/commit/87e440ee2a8b10dc571ce619f28bc83c1e5eb147))
|
||||||
|
|
||||||
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
## [1.22.8](https://github.com/certd/certd/compare/v1.22.7...v1.22.8) (2024-08-05)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- 表:sys_permission
|
-- 表:sys_permission
|
||||||
CREATE TABLE "sys_permission" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "title" varchar(100) NOT NULL, "permission" varchar(100), "parent_id" integer NOT NULL DEFAULT (-1), "sort" integer NOT NULL, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "sys_permission" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "title" varchar(100) NOT NULL, "permission" varchar(100), "parent_id" bigint NOT NULL DEFAULT (-1), "sort" bigint NOT NULL, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
INSERT INTO sys_permission (id, title, permission, parent_id, sort ) VALUES (1, '系统管理', 'sys', -1, 1);
|
INSERT INTO sys_permission (id, title, permission, parent_id, sort ) VALUES (1, '系统管理', 'sys', -1, 1);
|
||||||
INSERT INTO sys_permission (id, title, permission, parent_id, sort ) VALUES (2, '权限管理', 'sys:auth', 1, 1 );
|
INSERT INTO sys_permission (id, title, permission, parent_id, sort ) VALUES (2, '权限管理', 'sys:auth', 1, 1 );
|
||||||
INSERT INTO sys_permission (id, title, permission, parent_id, sort ) VALUES (3, '用户管理', 'sys:auth:user', 2, 1);
|
INSERT INTO sys_permission (id, title, permission, parent_id, sort ) VALUES (3, '用户管理', 'sys:auth:user', 2, 1);
|
||||||
@@ -22,12 +22,12 @@ INSERT INTO sys_permission (id, title, permission, parent_id, sort ) VALUES (18,
|
|||||||
|
|
||||||
|
|
||||||
-- 表:sys_role
|
-- 表:sys_role
|
||||||
CREATE TABLE "sys_role" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "name" varchar(100) NOT NULL, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "sys_role" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "name" varchar(100) NOT NULL, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
INSERT INTO sys_role (id, name ) VALUES (1, '管理员');
|
INSERT INTO sys_role (id, name ) VALUES (1, '管理员');
|
||||||
INSERT INTO sys_role (id, name ) VALUES (2, '只读角色');
|
INSERT INTO sys_role (id, name ) VALUES (2, '只读角色');
|
||||||
|
|
||||||
-- 表:sys_role_permission
|
-- 表:sys_role_permission
|
||||||
CREATE TABLE "sys_role_permission" ("role_id" integer NOT NULL, "permission_id" integer NOT NULL, PRIMARY KEY ("role_id", "permission_id"));
|
CREATE TABLE "sys_role_permission" ("role_id" bigint NOT NULL, "permission_id" bigint NOT NULL, PRIMARY KEY ("role_id", "permission_id"));
|
||||||
INSERT INTO sys_role_permission (role_id, permission_id) VALUES (1, 1);
|
INSERT INTO sys_role_permission (role_id, permission_id) VALUES (1, 1);
|
||||||
INSERT INTO sys_role_permission (role_id, permission_id) VALUES (1, 2);
|
INSERT INTO sys_role_permission (role_id, permission_id) VALUES (1, 2);
|
||||||
INSERT INTO sys_role_permission (role_id, permission_id) VALUES (1, 3);
|
INSERT INTO sys_role_permission (role_id, permission_id) VALUES (1, 3);
|
||||||
@@ -59,12 +59,12 @@ INSERT INTO sys_role_permission (role_id, permission_id) VALUES (2, 7);
|
|||||||
INSERT INTO sys_role_permission (role_id, permission_id) VALUES (2, -1);
|
INSERT INTO sys_role_permission (role_id, permission_id) VALUES (2, -1);
|
||||||
|
|
||||||
-- 表:sys_user
|
-- 表:sys_user
|
||||||
CREATE TABLE "sys_user" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "username" varchar(100) NOT NULL, "password" varchar(50) NOT NULL, "nick_name" varchar(50), "avatar" varchar(255), "phone_code" varchar(20), "mobile" varchar(20), "email" varchar(100),"remark" varchar(100), "status" integer NOT NULL DEFAULT (1), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "sys_user" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "username" varchar(100) NOT NULL, "password" varchar(50) NOT NULL, "nick_name" varchar(50), "avatar" varchar(255), "phone_code" varchar(20), "mobile" varchar(20), "email" varchar(100),"remark" varchar(100), "status" bigint NOT NULL DEFAULT (1), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
INSERT INTO sys_user (id, username, password, nick_name, avatar, phone_code, mobile, email, status ,remark) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 'admin', NULL, NULL, NULL, NULL, 1,NULL);
|
INSERT INTO sys_user (id, username, password, nick_name, avatar, phone_code, mobile, email, status ,remark) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 'admin', NULL, NULL, NULL, NULL, 1,NULL);
|
||||||
INSERT INTO sys_user (id, username, password, nick_name, avatar, phone_code, mobile, email, status ,remark) VALUES (2, 'readonly', 'e10adc3949ba59abbe56e057f20f883e', '只读用户', NULL, NULL, NULL, NULL, 1,'密码:123456');
|
INSERT INTO sys_user (id, username, password, nick_name, avatar, phone_code, mobile, email, status ,remark) VALUES (2, 'readonly', 'e10adc3949ba59abbe56e057f20f883e', '只读用户', NULL, NULL, NULL, NULL, 1,'密码:123456');
|
||||||
|
|
||||||
-- 表:sys_user_role
|
-- 表:sys_user_role
|
||||||
CREATE TABLE "sys_user_role" ("role_id" integer NOT NULL, "user_id" integer NOT NULL, PRIMARY KEY ("role_id", "user_id"));
|
CREATE TABLE "sys_user_role" ("role_id" bigint NOT NULL, "user_id" bigint NOT NULL, PRIMARY KEY ("role_id", "user_id"));
|
||||||
INSERT INTO sys_user_role (role_id, user_id) VALUES (1, 1);
|
INSERT INTO sys_user_role (role_id, user_id) VALUES (1, 1);
|
||||||
INSERT INTO sys_user_role (role_id, user_id) VALUES (2, 2);
|
INSERT INTO sys_user_role (role_id, user_id) VALUES (2, 2);
|
||||||
|
|
||||||
|
|||||||
@@ -5,20 +5,20 @@
|
|||||||
--
|
--
|
||||||
|
|
||||||
-- 表:cd_access
|
-- 表:cd_access
|
||||||
CREATE TABLE "cd_access" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" integer NOT NULL, "name" varchar(100) NOT NULL, "type" varchar(100) NOT NULL, "setting" varchar(1024), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "cd_access" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "name" varchar(100) NOT NULL, "type" varchar(100) NOT NULL, "setting" varchar(1024), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
|
|
||||||
-- 表:cd_cert
|
-- 表:cd_cert
|
||||||
CREATE TABLE "cd_cert" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" integer NOT NULL, "domains" varchar(2048) NOT NULL, "email" varchar(100) NOT NULL, "cert_issuer_id" integer, "challenge_type" varchar(100), "challenge_dns_type" varchar(100),"challenge_access_id" integer, "country" varchar(100), "state" varchar(100), "locality" varchar(100), "organization" varchar(100), "organization_unit" varchar(100), "remark" varchar(100), "last_history_id" integer, "last_success_id" integer, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "cd_cert" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "domains" varchar(2048) NOT NULL, "email" varchar(100) NOT NULL, "cert_issuer_id" bigint, "challenge_type" varchar(100), "challenge_dns_type" varchar(100),"challenge_access_id" bigint, "country" varchar(100), "state" varchar(100), "locality" varchar(100), "organization" varchar(100), "organization_unit" varchar(100), "remark" varchar(100), "last_history_id" bigint, "last_success_id" bigint, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
|
|
||||||
-- 表:cd_cert_apply_history
|
-- 表:cd_cert_apply_history
|
||||||
CREATE TABLE "cd_cert_apply_history" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" integer NOT NULL, "cert_id" integer NOT NULL, "success" boolean, "result" varchar(1024), "cert_crt" varchar(1024), "cert_key" varchar(1024), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "cd_cert_apply_history" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "cert_id" bigint NOT NULL, "success" boolean, "result" varchar(1024), "cert_crt" varchar(1024), "cert_key" varchar(1024), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
|
|
||||||
-- 表:cd_cert_issuer
|
-- 表:cd_cert_issuer
|
||||||
CREATE TABLE "cd_cert_issuer" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" integer NOT NULL, "type" varchar(20) NOT NULL, "account" varchar(100) NOT NULL, "private_key" varchar(1024), "setting" varchar, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "cd_cert_issuer" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "type" varchar(20) NOT NULL, "account" varchar(100) NOT NULL, "private_key" varchar(1024), "setting" varchar, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
|
|
||||||
-- 表:cd_task
|
-- 表:cd_task
|
||||||
CREATE TABLE "cd_task" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" integer NOT NULL, "name" varchar(100), "type" varchar(100), "setting" varchar(2048), "cert_id" integer NOT NULL, "last_history_id" integer, "last_success_id" integer, "remark" varchar(100), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "cd_task" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "name" varchar(100), "type" varchar(100), "setting" varchar(2048), "cert_id" bigint NOT NULL, "last_history_id" bigint, "last_success_id" bigint, "remark" varchar(100), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
|
|
||||||
-- 表:cd_task_history
|
-- 表:cd_task_history
|
||||||
CREATE TABLE "cd_task_history" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" integer NOT NULL, "task_id" integer NOT NULL, "cert_id" integer NOT NULL, "cert_apply_history_id" integer NOT NULL, "success" boolean, "result" varchar(2048), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "cd_task_history" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "task_id" bigint NOT NULL, "cert_id" bigint NOT NULL, "cert_apply_history_id" bigint NOT NULL, "success" boolean, "result" varchar(2048), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
CREATE TABLE "pi_history" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" integer NOT NULL, "pipeline_id" integer NOT NULL, "pipeline" varchar(40960), "status" varchar(20), "end_time" timestamp, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "pi_history" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "pipeline_id" bigint NOT NULL, "pipeline" varchar(40960), "status" varchar(20), "end_time" timestamp, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
|
|
||||||
CREATE TABLE "pi_history_log" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" integer NOT NULL, "pipeline_id" integer NOT NULL, "history_id" integer NOT NULL, "node_id" varchar(100), "logs" varchar(40960), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "pi_history_log" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "pipeline_id" bigint NOT NULL, "history_id" bigint NOT NULL, "node_id" varchar(100), "logs" varchar(40960), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
|
|
||||||
CREATE TABLE "pi_pipeline" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" integer NOT NULL, "title" integer NOT NULL, "content" varchar(40960) NOT NULL, "keep_history_count" integer, "remark" varchar(100), "status" varchar(100), "disabled" boolean DEFAULT (false), "last_history_time" integer, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "pi_pipeline" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "title" bigint NOT NULL, "content" varchar(40960) NOT NULL, "keep_history_count" bigint, "remark" varchar(100), "status" varchar(100), "disabled" boolean DEFAULT (false), "last_history_time" bigint, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
|
|
||||||
CREATE TABLE "pi_storage" ("id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" integer NOT NULL, "scope" varchar NOT NULL, "namespace" varchar NOT NULL, "version" varchar(100),"key" varchar(100), "value" varchar(40960), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
CREATE TABLE "pi_storage" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "scope" varchar NOT NULL, "namespace" varchar NOT NULL, "version" varchar(100),"key" varchar(100), "value" varchar(40960), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
CREATE TABLE "sys_settings" (
|
CREATE TABLE "sys_settings" (
|
||||||
"id" integer NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY ,
|
"id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY ,
|
||||||
"user_id" integer NOT NULL,
|
"user_id" bigint NOT NULL,
|
||||||
"key" varchar(100) NOT NULL,
|
"key" varchar(100) NOT NULL,
|
||||||
"title" varchar(100) NOT NULL,
|
"title" varchar(100) NOT NULL,
|
||||||
"setting" varchar(1024),
|
"setting" varchar(1024),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
ALTER TABLE "sys_settings" RENAME TO "user_settings";
|
ALTER TABLE "sys_settings" RENAME TO "user_settings";
|
||||||
|
|
||||||
CREATE TABLE "sys_settings" (
|
CREATE TABLE "sys_settings" (
|
||||||
"id" integer NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY ,
|
"id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY ,
|
||||||
"key" varchar(100) NOT NULL,
|
"key" varchar(100) NOT NULL,
|
||||||
"title" varchar(100) NOT NULL,
|
"title" varchar(100) NOT NULL,
|
||||||
"setting" varchar(1024),
|
"setting" varchar(1024),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
INSERT INTO sys_settings (key, title, setting,access) VALUES ('sys.install','安装信息','{"installTime":'|| (select (timestamp) from flyway_history where id = 1 )||'}','private');
|
INSERT INTO sys_settings (key, title, setting,access) VALUES ('sys.install','安装信息','{"installTime":'|| (select (timestamp) from flyway_history where id = 1 )||'}','private');
|
||||||
|
|
||||||
ALTER TABLE sys_user ADD COLUMN password_version integer DEFAULT 1;
|
ALTER TABLE sys_user ADD COLUMN password_version bigint DEFAULT 1;
|
||||||
ALTER TABLE sys_user ADD COLUMN password_salt varchar(36);
|
ALTER TABLE sys_user ADD COLUMN password_salt varchar(36);
|
||||||
alter table sys_user alter column password type varchar(100) using password::varchar(100);
|
alter table sys_user alter column password type varchar(100) using password::varchar(100);
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ alter table pi_pipeline alter column title type varchar(100) using title::varcha
|
|||||||
alter table pi_pipeline alter column content type text using content::text;
|
alter table pi_pipeline alter column content type text using content::text;
|
||||||
alter table pi_storage alter column value type text using value::text;
|
alter table pi_storage alter column value type text using value::text;
|
||||||
|
|
||||||
alter table pi_pipeline add "order" integer default 0;
|
alter table pi_pipeline add "order" bigint default 0;
|
||||||
|
|||||||
@@ -1,18 +1,24 @@
|
|||||||
AUTOINCREAMENT
|
## sqlite与postgres不同点
|
||||||
GENERATED BY DEFAULT AS IDENTITY
|
1.
|
||||||
|
sl: AUTOINCREAMENT
|
||||||
|
pg: GENERATED BY DEFAULT AS IDENTITY
|
||||||
|
|
||||||
|
2.
|
||||||
datetime
|
datetime
|
||||||
timestamp
|
timestamp
|
||||||
|
|
||||||
|
3.
|
||||||
update sqlite_sequence set seq = 1000 where name = 'sys_role' ;
|
update sqlite_sequence set seq = 1000 where name = 'sys_role' ;
|
||||||
select setval('sys_role_id_seq', 1000);
|
select setval('sys_role_id_seq', 1000);
|
||||||
|
|
||||||
|
4.
|
||||||
"disabled" boolean DEFAULT (0)
|
"disabled" boolean DEFAULT (0)
|
||||||
"disabled" boolean DEFAULT (false)
|
"disabled" boolean DEFAULT (false)
|
||||||
|
|
||||||
|
5.
|
||||||
last_insert_rowid()
|
last_insert_rowid()
|
||||||
LASTVAL()
|
LASTVAL()
|
||||||
|
|
||||||
|
6.
|
||||||
|
sl: integer
|
||||||
|
pg: bigint
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/ui-server",
|
"name": "@certd/ui-server",
|
||||||
"version": "1.22.8",
|
"version": "1.23.1",
|
||||||
"description": "fast-server base midway",
|
"description": "fast-server base midway",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -23,10 +23,10 @@
|
|||||||
"@alicloud/pop-core": "^1.7.10",
|
"@alicloud/pop-core": "^1.7.10",
|
||||||
"@certd/acme-client": "^1.22.6",
|
"@certd/acme-client": "^1.22.6",
|
||||||
"@certd/lib-huawei": "^1.22.1",
|
"@certd/lib-huawei": "^1.22.1",
|
||||||
"@certd/lib-k8s": "^1.22.8",
|
"@certd/lib-k8s": "^1.23.1",
|
||||||
"@certd/midway-flyway-js": "^1.22.6",
|
"@certd/midway-flyway-js": "^1.22.6",
|
||||||
"@certd/pipeline": "^1.22.8",
|
"@certd/pipeline": "^1.23.1",
|
||||||
"@certd/plugin-cert": "^1.22.8",
|
"@certd/plugin-cert": "^1.23.1",
|
||||||
"@koa/cors": "^3.4.3",
|
"@koa/cors": "^3.4.3",
|
||||||
"@midwayjs/bootstrap": "^3.16.2",
|
"@midwayjs/bootstrap": "^3.16.2",
|
||||||
"@midwayjs/cache": "^3.14.0",
|
"@midwayjs/cache": "^3.14.0",
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export abstract class BaseService<T> {
|
|||||||
* @param param 数据
|
* @param param 数据
|
||||||
*/
|
*/
|
||||||
async add(param) {
|
async add(param) {
|
||||||
const now = new Date().getTime();
|
const now = new Date();
|
||||||
param.createTime = now;
|
param.createTime = now;
|
||||||
param.updateTime = now;
|
param.updateTime = now;
|
||||||
await this.addOrUpdate(param);
|
await this.addOrUpdate(param);
|
||||||
@@ -91,7 +91,7 @@ export abstract class BaseService<T> {
|
|||||||
*/
|
*/
|
||||||
async update(param) {
|
async update(param) {
|
||||||
if (!param.id) throw new ValidateException('no id');
|
if (!param.id) throw new ValidateException('no id');
|
||||||
param.updateTime = new Date().getTime();
|
param.updateTime = new Date();
|
||||||
await this.addOrUpdate(param);
|
await this.addOrUpdate(param);
|
||||||
await this.modifyAfter(param);
|
await this.modifyAfter(param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ function parseEnv(defaultConfig: any) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
keyName = keyName.replace('certd_', '');
|
keyName = keyName.replace('certd_', '');
|
||||||
const configKey = keyName.replace('_', '.');
|
const configKey = keyName.replaceAll('_', '.');
|
||||||
const oldValue = _.get(defaultConfig, configKey);
|
const oldValue = _.get(defaultConfig, configKey);
|
||||||
let value: any = process.env[key];
|
let value: any = process.env[key];
|
||||||
if (typeof oldValue === 'boolean') {
|
if (typeof oldValue === 'boolean') {
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ export class PipelineController extends CrudController<PipelineService> {
|
|||||||
body.sort = { prop: 'order', asc: false };
|
body.sort = { prop: 'order', asc: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.page({ ...body, buildQuery });
|
const pageRet = await this.getService().page(body?.query, body?.page, body?.sort, buildQuery);
|
||||||
|
return this.ok(pageRet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post('/add', { summary: Constants.per.authOnly })
|
@Post('/add', { summary: Constants.per.authOnly })
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
|||||||
const info = await this.info(pipelineId);
|
const info = await this.info(pipelineId);
|
||||||
if (info && !info.disabled) {
|
if (info && !info.disabled) {
|
||||||
const pipeline = JSON.parse(info.content);
|
const pipeline = JSON.parse(info.content);
|
||||||
|
// 手动触发,不要await
|
||||||
this.registerTriggers(pipeline);
|
this.registerTriggers(pipeline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,15 +88,16 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async update(bean: PipelineEntity) {
|
async update(bean: PipelineEntity) {
|
||||||
await this.clearTriggers(bean.id);
|
//更新非trigger部分
|
||||||
await super.update(bean);
|
await super.update(bean);
|
||||||
await this.registerTriggerById(bean.id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async save(bean: PipelineEntity) {
|
async save(bean: PipelineEntity) {
|
||||||
await this.clearTriggers(bean.id);
|
await this.clearTriggers(bean.id);
|
||||||
const pipeline = JSON.parse(bean.content);
|
if (bean.content) {
|
||||||
bean.title = pipeline.title;
|
const pipeline = JSON.parse(bean.content);
|
||||||
|
bean.title = pipeline.title;
|
||||||
|
}
|
||||||
await this.addOrUpdate(bean);
|
await this.addOrUpdate(bean);
|
||||||
await this.registerTriggerById(bean.id);
|
await this.registerTriggerById(bean.id);
|
||||||
}
|
}
|
||||||
@@ -173,7 +175,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
|||||||
|
|
||||||
if (immediateTriggerOnce) {
|
if (immediateTriggerOnce) {
|
||||||
await this.trigger(pipeline.id);
|
await this.trigger(pipeline.id);
|
||||||
await sleep(1000);
|
await sleep(200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,6 +226,11 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
registerCron(pipelineId, trigger) {
|
registerCron(pipelineId, trigger) {
|
||||||
|
if (pipelineId == null) {
|
||||||
|
logger.warn('pipelineId为空,无法注册定时任务');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let cron = trigger.props?.cron;
|
let cron = trigger.props?.cron;
|
||||||
if (cron == null) {
|
if (cron == null) {
|
||||||
return;
|
return;
|
||||||
@@ -232,15 +239,20 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
|||||||
if (cron.startsWith('*')) {
|
if (cron.startsWith('*')) {
|
||||||
cron = '0' + cron.substring(1, cron.length);
|
cron = '0' + cron.substring(1, cron.length);
|
||||||
}
|
}
|
||||||
const name = this.buildCronKey(pipelineId, trigger.id);
|
const triggerId = trigger.id;
|
||||||
|
const name = this.buildCronKey(pipelineId, triggerId);
|
||||||
this.cron.remove(name);
|
this.cron.remove(name);
|
||||||
this.cron.register({
|
this.cron.register({
|
||||||
name,
|
name,
|
||||||
cron,
|
cron,
|
||||||
job: async () => {
|
job: async () => {
|
||||||
logger.info('定时任务触发:', pipelineId, trigger.id);
|
logger.info('定时任务触发:', pipelineId, triggerId);
|
||||||
|
if (pipelineId == null) {
|
||||||
|
logger.warn('pipelineId为空,无法执行');
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await this.run(pipelineId, trigger.id);
|
await this.run(pipelineId, triggerId);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error('定时job执行失败:', e);
|
logger.error('定时job执行失败:', e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export class CronConfiguration {
|
|||||||
...this.config,
|
...this.config,
|
||||||
});
|
});
|
||||||
container.registerObject('cron', this.cron);
|
container.registerObject('cron', this.cron);
|
||||||
|
this.cron.start();
|
||||||
this.logger.info('cron started');
|
this.logger.info('cron started');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,56 +17,63 @@ export class CronTask {
|
|||||||
name: string;
|
name: string;
|
||||||
stoped = false;
|
stoped = false;
|
||||||
|
|
||||||
timeoutId: any;
|
nextTime: any;
|
||||||
|
|
||||||
constructor(req: CronTaskReq, logger: ILogger) {
|
constructor(req: CronTaskReq, logger: ILogger) {
|
||||||
this.cron = req.cron;
|
this.cron = req.cron;
|
||||||
this.job = req.job;
|
this.job = req.job;
|
||||||
this.name = req.name;
|
this.name = req.name;
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.start();
|
this.genNextTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
genNextTime() {
|
||||||
if (!this.cron) {
|
if (!this.cron) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
if (this.stoped) {
|
if (this.stoped) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
const interval = parser.parseExpression(this.cron);
|
const interval = parser.parseExpression(this.cron);
|
||||||
const next = interval.next().getTime();
|
const next = interval.next().getTime();
|
||||||
const now = Date.now();
|
this.logger.info(`[cron] [${this.name}], cron:${this.cron}, next run :${new Date(next).toLocaleString()}`);
|
||||||
const delay = next - now;
|
this.nextTime = next;
|
||||||
this.timeoutId = setTimeout(async () => {
|
return next;
|
||||||
try {
|
|
||||||
if (this.stoped) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await this.job();
|
|
||||||
} catch (e) {
|
|
||||||
this.logger.error(`[cron] job error : [${this.name}]`, e);
|
|
||||||
}
|
|
||||||
this.start();
|
|
||||||
}, delay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
this.stoped = true;
|
this.stoped = true;
|
||||||
clearTimeout(this.timeoutId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export class Cron {
|
export class Cron {
|
||||||
logger: ILogger;
|
logger: ILogger;
|
||||||
immediateTriggerOnce: boolean;
|
immediateTriggerOnce: boolean;
|
||||||
|
|
||||||
bucket: Record<string, CronTask> = {};
|
queue: CronTask[] = [];
|
||||||
|
|
||||||
constructor(opts: any) {
|
constructor(opts: any) {
|
||||||
this.logger = opts.logger;
|
this.logger = opts.logger;
|
||||||
this.immediateTriggerOnce = opts.immediateTriggerOnce;
|
this.immediateTriggerOnce = opts.immediateTriggerOnce;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
this.logger.info('[cron] start');
|
||||||
|
this.queue.forEach(task => {
|
||||||
|
task.genNextTime();
|
||||||
|
});
|
||||||
|
|
||||||
|
setInterval(() => {
|
||||||
|
const now = new Date().getTime();
|
||||||
|
for (const task of this.queue) {
|
||||||
|
if (task.nextTime <= now) {
|
||||||
|
task.job().catch(e => {
|
||||||
|
this.logger.error(`job execute error : [${task.name}]`, e);
|
||||||
|
});
|
||||||
|
task.genNextTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 1000 * 60);
|
||||||
|
}
|
||||||
|
|
||||||
register(req: CronTaskReq) {
|
register(req: CronTaskReq) {
|
||||||
if (!req.cron) {
|
if (!req.cron) {
|
||||||
this.logger.info(`[cron] register once : [${req.name}]`);
|
this.logger.info(`[cron] register once : [${req.name}]`);
|
||||||
@@ -78,21 +85,22 @@ export class Cron {
|
|||||||
this.logger.info(`[cron] register cron : [${req.name}] ,${req.cron}`);
|
this.logger.info(`[cron] register cron : [${req.name}] ,${req.cron}`);
|
||||||
|
|
||||||
const task = new CronTask(req, this.logger);
|
const task = new CronTask(req, this.logger);
|
||||||
this.bucket[task.name] = task;
|
this.queue.push(task);
|
||||||
this.logger.info('当前定时任务数量:', this.getTaskSize());
|
this.logger.info('当前定时任务数量:', this.getTaskSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
remove(taskName: string) {
|
remove(taskName: string) {
|
||||||
this.logger.info(`[cron] remove : [${taskName}]`);
|
this.logger.info(`[cron] remove : [${taskName}]`);
|
||||||
const task = this.bucket[taskName];
|
const index = this.queue.findIndex(item => item.name === taskName);
|
||||||
if (task) {
|
if (index !== -1) {
|
||||||
task.stop();
|
this.queue[index].stop();
|
||||||
delete this.bucket[taskName];
|
this.queue.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
this.logger.info('当前定时任务数量:', this.getTaskSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
getTaskSize() {
|
getTaskSize() {
|
||||||
const tasks = Object.keys(this.bucket);
|
const tasks = Object.keys(this.queue);
|
||||||
return tasks.length;
|
return tasks.length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
|
|||||||
|
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: '大区',
|
title: '大区',
|
||||||
default: 'cn-shanghai',
|
value: 'cn-shanghai',
|
||||||
component: {
|
component: {
|
||||||
placeholder: '集群所属大区',
|
placeholder: '集群所属大区',
|
||||||
},
|
},
|
||||||
@@ -48,7 +48,7 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
|
|||||||
|
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: '命名空间',
|
title: '命名空间',
|
||||||
default: 'default',
|
value: 'default',
|
||||||
component: {
|
component: {
|
||||||
placeholder: '命名空间',
|
placeholder: '命名空间',
|
||||||
},
|
},
|
||||||
@@ -57,7 +57,7 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
|
|||||||
namespace!: string;
|
namespace!: string;
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: 'ingress名称',
|
title: 'ingress名称',
|
||||||
default: '',
|
value: '',
|
||||||
component: {
|
component: {
|
||||||
placeholder: 'ingress名称',
|
placeholder: 'ingress名称',
|
||||||
},
|
},
|
||||||
@@ -67,7 +67,7 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
|
|||||||
ingressName!: string;
|
ingressName!: string;
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: 'ingress类型',
|
title: 'ingress类型',
|
||||||
default: 'nginx',
|
value: 'nginx',
|
||||||
component: {
|
component: {
|
||||||
placeholder: '暂时只支持nginx类型',
|
placeholder: '暂时只支持nginx类型',
|
||||||
},
|
},
|
||||||
@@ -76,7 +76,7 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
|
|||||||
ingressClass!: string;
|
ingressClass!: string;
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: '是否私网ip',
|
title: '是否私网ip',
|
||||||
default: false,
|
value: false,
|
||||||
component: {
|
component: {
|
||||||
name: 'a-switch',
|
name: 'a-switch',
|
||||||
vModel: 'checked',
|
vModel: 'checked',
|
||||||
@@ -121,7 +121,7 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
|
|||||||
const kubeConfigStr = await this.getKubeConfig(client, clusterId, isPrivateIpAddress);
|
const kubeConfigStr = await this.getKubeConfig(client, clusterId, isPrivateIpAddress);
|
||||||
|
|
||||||
this.logger.info('kubeconfig已成功获取');
|
this.logger.info('kubeconfig已成功获取');
|
||||||
const k8sClient = new K8sClient(kubeConfigStr);
|
const k8sClient = new K8sClient(kubeConfigStr,this.logger);
|
||||||
const ingressType = ingressClass || 'qcloud';
|
const ingressType = ingressClass || 'qcloud';
|
||||||
if (ingressType === 'qcloud') {
|
if (ingressType === 'qcloud') {
|
||||||
throw new Error('暂未实现');
|
throw new Error('暂未实现');
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export class UploadCertToAliyun extends AbstractTaskPlugin {
|
|||||||
|
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: '大区',
|
title: '大区',
|
||||||
default: 'cn-hangzhou',
|
value: 'cn-hangzhou',
|
||||||
component: {
|
component: {
|
||||||
name: 'a-select',
|
name: 'a-select',
|
||||||
mode: 'tags',
|
mode: 'tags',
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export class DemoTestPlugin extends AbstractTaskPlugin {
|
|||||||
this.logger.info('授权id:', accessId);
|
this.logger.info('授权id:', accessId);
|
||||||
//TODO 这里实现你要部署的执行方法
|
//TODO 这里实现你要部署的执行方法
|
||||||
|
|
||||||
new K8sClient('111');
|
new K8sClient('111', null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO 这里实例化插件,进行注册
|
//TODO 这里实例化插件,进行注册
|
||||||
|
|||||||
@@ -75,6 +75,10 @@ export class AsyncSsh2Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async exec(script: string) {
|
async exec(script: string) {
|
||||||
|
if (!script) {
|
||||||
|
this.logger.info('script 为空,取消执行');
|
||||||
|
return;
|
||||||
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.logger.info(`执行命令:[${this.connConf.host}][exec]: ` + script);
|
this.logger.info(`执行命令:[${this.connConf.host}][exec]: ` + script);
|
||||||
this.conn.exec(script, (err: Error, stream: any) => {
|
this.conn.exec(script, (err: Error, stream: any) => {
|
||||||
@@ -97,6 +101,10 @@ export class AsyncSsh2Client {
|
|||||||
data += out;
|
data += out;
|
||||||
this.logger.info(`[${this.connConf.host}][info]: ` + out.trimEnd());
|
this.logger.info(`[${this.connConf.host}][info]: ` + out.trimEnd());
|
||||||
})
|
})
|
||||||
|
.on('error', (err: any) => {
|
||||||
|
reject(err);
|
||||||
|
this.logger.error(err);
|
||||||
|
})
|
||||||
.stderr.on('data', (ret: Buffer) => {
|
.stderr.on('data', (ret: Buffer) => {
|
||||||
const err = this.convert(ret);
|
const err = this.convert(ret);
|
||||||
data += err;
|
data += err;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export class HostShellExecutePlugin extends AbstractTaskPlugin {
|
|||||||
name: 'a-textarea',
|
name: 'a-textarea',
|
||||||
vModel: 'value',
|
vModel: 'value',
|
||||||
},
|
},
|
||||||
|
required: true,
|
||||||
})
|
})
|
||||||
script!: string;
|
script!: string;
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
|
|||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: '自动创建远程目录',
|
title: '自动创建远程目录',
|
||||||
helper: '是否自动创建远程目录,如果关闭则你需要自己确保远程目录存在',
|
helper: '是否自动创建远程目录,如果关闭则你需要自己确保远程目录存在',
|
||||||
default: true,
|
value: true,
|
||||||
component: {
|
component: {
|
||||||
name: 'a-switch',
|
name: 'a-switch',
|
||||||
vModel: 'checked',
|
vModel: 'checked',
|
||||||
@@ -68,7 +68,7 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
|
|||||||
title: '仅复制到当前主机',
|
title: '仅复制到当前主机',
|
||||||
helper:
|
helper:
|
||||||
'开启后,将直接复制到当前主机某个目录,不上传到主机,由于是docker启动,实际上是复制到docker容器内的“证书保存路径”,你需要事先在docker-compose.yaml中配置主机目录映射: volumes: /your_target_path:/your_target_path',
|
'开启后,将直接复制到当前主机某个目录,不上传到主机,由于是docker启动,实际上是复制到docker容器内的“证书保存路径”,你需要事先在docker-compose.yaml中配置主机目录映射: volumes: /your_target_path:/your_target_path',
|
||||||
default: false,
|
value: false,
|
||||||
component: {
|
component: {
|
||||||
name: 'a-switch',
|
name: 'a-switch',
|
||||||
vModel: 'checked',
|
vModel: 'checked',
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import dayjs from 'dayjs';
|
|||||||
export class DeployToClbPlugin extends AbstractTaskPlugin {
|
export class DeployToClbPlugin extends AbstractTaskPlugin {
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: '大区',
|
title: '大区',
|
||||||
default: 'ap-guangzhou',
|
value: 'ap-guangzhou',
|
||||||
component: {
|
component: {
|
||||||
name: 'a-select',
|
name: 'a-select',
|
||||||
mode: 'tags',
|
mode: 'tags',
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
|
|||||||
const kubeConfigStr = await this.getTkeKubeConfig(tkeClient, this.clusterId);
|
const kubeConfigStr = await this.getTkeKubeConfig(tkeClient, this.clusterId);
|
||||||
|
|
||||||
this.logger.info('kubeconfig已成功获取');
|
this.logger.info('kubeconfig已成功获取');
|
||||||
const k8sClient = new K8sClient(kubeConfigStr);
|
const k8sClient = new K8sClient(kubeConfigStr, this.logger);
|
||||||
if (this.clusterIp != null) {
|
if (this.clusterIp != null) {
|
||||||
if (!this.clusterDomain) {
|
if (!this.clusterDomain) {
|
||||||
this.clusterDomain = `${this.clusterId}.ccs.tencent-cloud.com`;
|
this.clusterDomain = `${this.clusterId}.ccs.tencent-cloud.com`;
|
||||||
|
|||||||
Reference in New Issue
Block a user