Merge branch 'v2-dev' into v2

pull/469/head
xiaojunnuo 2025-07-18 23:14:52 +08:00
commit af54f48cec
43 changed files with 367 additions and 93 deletions

View File

@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
### Bug Fixes
* 企业微信通知改成text类型因为markdown类型不支持@用户 ([747d266](https://github.com/certd/certd/commit/747d26674248082e678a3fd5ecc94712641a2716))
* api接口获取不到证书的bug ([05a33a0](https://github.com/certd/certd/commit/05a33a0ec9999e2802f6c7b23cc1c61a2b9e963d))
### Performance Improvements
* 部署到阿里云oss插件支持选择上传到阿里云cas中的证书 ([2ea2c8c](https://github.com/certd/certd/commit/2ea2c8c05fc40f79595f1bbde67c1413558bf684))
* 优化子域名托管的说明 ([b15f514](https://github.com/certd/certd/commit/b15f514018b728acb0922ee3f93c1f302eb5d471))
* 账号即将过期通知 ([e403450](https://github.com/certd/certd/commit/e40345095f31e2fb8e2333a6647466659133fa0c))
* 子域名托管重复域名不允许添加 ([ffc0c7b](https://github.com/certd/certd/commit/ffc0c7bb7b16d9904fd2d905d1c4e1d4854e92a9))
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
### Bug Fixes

View File

@ -1 +1 @@
16:54
23:09

View File

@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
### Bug Fixes
* 企业微信通知改成text类型因为markdown类型不支持@用户 ([747d266](https://github.com/certd/certd/commit/747d26674248082e678a3fd5ecc94712641a2716))
* api接口获取不到证书的bug ([05a33a0](https://github.com/certd/certd/commit/05a33a0ec9999e2802f6c7b23cc1c61a2b9e963d))
### Performance Improvements
* 部署到阿里云oss插件支持选择上传到阿里云cas中的证书 ([2ea2c8c](https://github.com/certd/certd/commit/2ea2c8c05fc40f79595f1bbde67c1413558bf684))
* 优化子域名托管的说明 ([b15f514](https://github.com/certd/certd/commit/b15f514018b728acb0922ee3f93c1f302eb5d471))
* 账号即将过期通知 ([e403450](https://github.com/certd/certd/commit/e40345095f31e2fb8e2333a6647466659133fa0c))
* 子域名托管重复域名不允许添加 ([ffc0c7b](https://github.com/certd/certd/commit/ffc0c7bb7b16d9904fd2d905d1c4e1d4854e92a9))
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
### Bug Fixes

View File

@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.36.9"
"version": "1.36.10"
}

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/publishlab/node-acme-client/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/acme-client
## [1.36.9](https://github.com/publishlab/node-acme-client/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/acme-client

View File

@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client",
"private": false,
"author": "nmorsman",
"version": "1.36.9",
"version": "1.36.10",
"type": "module",
"module": "scr/index.js",
"main": "src/index.js",
@ -18,7 +18,7 @@
"types"
],
"dependencies": {
"@certd/basic": "^1.36.9",
"@certd/basic": "^1.36.10",
"@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5",
"axios": "^1.7.2",
@ -69,5 +69,5 @@
"bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues"
},
"gitHead": "4a36fd2ec343794c5442e4402b21fa6869dfd90e"
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
}

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/basic
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/basic

View File

@ -1 +1 @@
16:46
23:02

View File

@ -1,7 +1,7 @@
{
"name": "@certd/basic",
"private": false,
"version": "1.36.9",
"version": "1.36.10",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@ -45,5 +45,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "4a36fd2ec343794c5442e4402b21fa6869dfd90e"
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
}

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/pipeline
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/pipeline

View File

@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.36.9",
"version": "1.36.10",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@ -17,8 +17,8 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/basic": "^1.36.9",
"@certd/plus-core": "^1.36.9",
"@certd/basic": "^1.36.10",
"@certd/plus-core": "^1.36.10",
"dayjs": "^1.11.7",
"lodash-es": "^4.17.21",
"reflect-metadata": "^0.1.13"
@ -44,5 +44,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "4a36fd2ec343794c5442e4402b21fa6869dfd90e"
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
}

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/lib-huawei
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/lib-huawei

View File

@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.36.9",
"version": "1.36.10",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts",
@ -24,5 +24,5 @@
"prettier": "^2.8.8",
"tslib": "^2.8.1"
},
"gitHead": "4a36fd2ec343794c5442e4402b21fa6869dfd90e"
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
}

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/lib-iframe
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/lib-iframe

View File

@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.36.9",
"version": "1.36.10",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@ -31,5 +31,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "4a36fd2ec343794c5442e4402b21fa6869dfd90e"
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
}

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/jdcloud
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/jdcloud

View File

@ -1,6 +1,6 @@
{
"name": "@certd/jdcloud",
"version": "1.36.9",
"version": "1.36.10",
"description": "jdcloud openApi sdk",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
@ -61,5 +61,5 @@
"fetch"
]
},
"gitHead": "4a36fd2ec343794c5442e4402b21fa6869dfd90e"
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
}

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/lib-k8s
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/lib-k8s

View File

@ -1,7 +1,7 @@
{
"name": "@certd/lib-k8s",
"private": false,
"version": "1.36.9",
"version": "1.36.10",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@ -17,7 +17,7 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/basic": "^1.36.9",
"@certd/basic": "^1.36.10",
"@kubernetes/client-node": "0.21.0"
},
"devDependencies": {
@ -32,5 +32,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "4a36fd2ec343794c5442e4402b21fa6869dfd90e"
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
}

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/lib-server
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/lib-server

View File

@ -1,6 +1,6 @@
{
"name": "@certd/lib-server",
"version": "1.36.9",
"version": "1.36.10",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@ -27,10 +27,10 @@
],
"license": "AGPL",
"dependencies": {
"@certd/acme-client": "^1.36.9",
"@certd/basic": "^1.36.9",
"@certd/pipeline": "^1.36.9",
"@certd/plus-core": "^1.36.9",
"@certd/acme-client": "^1.36.10",
"@certd/basic": "^1.36.10",
"@certd/pipeline": "^1.36.10",
"@certd/plus-core": "^1.36.10",
"@midwayjs/cache": "~3.14.0",
"@midwayjs/core": "~3.20.3",
"@midwayjs/i18n": "~3.20.3",
@ -61,5 +61,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "4a36fd2ec343794c5442e4402b21fa6869dfd90e"
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
}

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/midway-flyway-js

View File

@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.36.9",
"version": "1.36.10",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@ -46,5 +46,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "4a36fd2ec343794c5442e4402b21fa6869dfd90e"
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
}

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/plugin-cert
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/plugin-cert

View File

@ -1,7 +1,7 @@
{
"name": "@certd/plugin-cert",
"private": false,
"version": "1.36.9",
"version": "1.36.10",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@ -16,10 +16,10 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/acme-client": "^1.36.9",
"@certd/basic": "^1.36.9",
"@certd/pipeline": "^1.36.9",
"@certd/plugin-lib": "^1.36.9",
"@certd/acme-client": "^1.36.10",
"@certd/basic": "^1.36.10",
"@certd/pipeline": "^1.36.10",
"@certd/plugin-lib": "^1.36.10",
"@google-cloud/publicca": "^1.3.0",
"dayjs": "^1.11.7",
"jszip": "^3.10.1",
@ -43,5 +43,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "4a36fd2ec343794c5442e4402b21fa6869dfd90e"
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
}

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/plugin-lib
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
### Bug Fixes

View File

@ -1,7 +1,7 @@
{
"name": "@certd/plugin-lib",
"private": false,
"version": "1.36.9",
"version": "1.36.10",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@ -21,8 +21,8 @@
"@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.10",
"@aws-sdk/client-s3": "^3.787.0",
"@certd/basic": "^1.36.9",
"@certd/pipeline": "^1.36.9",
"@certd/basic": "^1.36.10",
"@certd/pipeline": "^1.36.10",
"@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5",
@ -53,5 +53,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "4a36fd2ec343794c5442e4402b21fa6869dfd90e"
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
}

View File

@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
### Performance Improvements
* 优化子域名托管的说明 ([b15f514](https://github.com/certd/certd/commit/b15f514018b728acb0922ee3f93c1f302eb5d471))
* 账号即将过期通知 ([e403450](https://github.com/certd/certd/commit/e40345095f31e2fb8e2333a6647466659133fa0c))
* 子域名托管重复域名不允许添加 ([ffc0c7b](https://github.com/certd/certd/commit/ffc0c7bb7b16d9904fd2d905d1c4e1d4854e92a9))
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/ui-client

View File

@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.36.9",
"version": "1.36.10",
"private": true,
"scripts": {
"dev": "vite --open",
@ -103,8 +103,8 @@
"zod-defaults": "^0.1.3"
},
"devDependencies": {
"@certd/lib-iframe": "^1.36.9",
"@certd/pipeline": "^1.36.9",
"@certd/lib-iframe": "^1.36.10",
"@certd/pipeline": "^1.36.10",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",

View File

@ -449,7 +449,7 @@ export default {
batchDeleteConfirm: "Are you sure to batch delete these {count} records?",
selectRecordFirst: "Please select records first",
subdomainHosted: "Hosted Subdomain",
subdomainHelpText: "If you don't understand what subdomain hosting is, please refer to the documentation ",
subdomainHelpText: "If you don't understand what subdomain hosting is,Do not set it randomly, as it may result in the inability to apply for the certificate. please refer to the documentation ",
subdomainManagement: "Subdomain Management",
isDisabled: "Is Disabled",
enabled: "Enabled",

View File

@ -415,7 +415,7 @@ export default {
is_present_no: "否",
basicInfo: "基础信息",
titlea: "名称",
disabled: "是否禁用",
disabled: "禁用",
ordera: "排序",
supportBuy: "支持购买",
intro: "介绍",
@ -455,7 +455,7 @@ export default {
batchDeleteConfirm: "确定要批量删除这{count}条记录吗",
selectRecordFirst: "请先勾选记录",
subdomainHosted: "托管的子域名",
subdomainHelpText: "如果您不理解什么是子域托管,可以参考文档",
subdomainHelpText: "如果您不理解什么是子域托管,请不要随意设置,可能导致证书无法申请,可以参考文档",
subdomainManagement: "子域管理",
isDisabled: "是否禁用",
enabled: "启用",

View File

@ -3,7 +3,12 @@
<template #header>
<div class="title">
{{ t("certd.subdomainHosting") }}
<span class="sub">{{ t("certd.subdomainHostingHint") }}</span>
<span class="sub">
{{ t("certd.subdomainHostingHint") }} {{ t("certd.subdomainHelpText") }}
<a href="https://help.aliyun.com/zh/dns/subdomain-management" target="_blank">
{{ t("certd.subdomainManagement") }}
</a>
</span>
</div>
</template>
<fs-crud ref="crudRef" v-bind="crudBinding">

View File

@ -1,10 +1,11 @@
import * as api from "./api";
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { useUserStore } from "/@/store/user";
import { Modal, notification } from "ant-design-vue";
import dayjs from "dayjs";
import { useSettingStore } from "/@/store/settings";
import { useI18n } from "/src/locales";
import { computed } from "vue";
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n();
@ -26,7 +27,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
const userStore = useUserStore();
const settingStore = useSettingStore();
const userValidTimeEnabled = compute(() => {
const userValidTimeEnabled = computed(() => {
return settingStore.sysPublic.userValidTimeEnabled === true;
});
return {
@ -226,7 +227,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
column: {
align: "center",
sorter: true,
width: 100,
width: 160,
show: userValidTimeEnabled,
cellRender({ value }) {
if (value == null || value === 0) {

View File

@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
### Bug Fixes
* 企业微信通知改成text类型因为markdown类型不支持@用户 ([747d266](https://github.com/certd/certd/commit/747d26674248082e678a3fd5ecc94712641a2716))
* api接口获取不到证书的bug ([05a33a0](https://github.com/certd/certd/commit/05a33a0ec9999e2802f6c7b23cc1c61a2b9e963d))
### Performance Improvements
* 部署到阿里云oss插件支持选择上传到阿里云cas中的证书 ([2ea2c8c](https://github.com/certd/certd/commit/2ea2c8c05fc40f79595f1bbde67c1413558bf684))
* 账号即将过期通知 ([e403450](https://github.com/certd/certd/commit/e40345095f31e2fb8e2333a6647466659133fa0c))
* 子域名托管重复域名不允许添加 ([ffc0c7b](https://github.com/certd/certd/commit/ffc0c7bb7b16d9904fd2d905d1c4e1d4854e92a9))
## [1.36.9](https://github.com/certd/certd/compare/v1.36.7...v1.36.9) (2025-07-15)
**Note:** Version bump only for package @certd/ui-server

View File

@ -1,6 +1,6 @@
{
"name": "@certd/ui-server",
"version": "1.36.9",
"version": "1.36.10",
"description": "fast-server base midway",
"private": true,
"type": "module",
@ -42,20 +42,20 @@
"@aws-sdk/client-cloudfront": "^3.699.0",
"@aws-sdk/client-iam": "^3.699.0",
"@aws-sdk/client-s3": "^3.705.0",
"@certd/acme-client": "^1.36.9",
"@certd/basic": "^1.36.9",
"@certd/commercial-core": "^1.36.9",
"@certd/acme-client": "^1.36.10",
"@certd/basic": "^1.36.10",
"@certd/commercial-core": "^1.36.10",
"@certd/cv4pve-api-javascript": "^8.4.1",
"@certd/jdcloud": "^1.36.9",
"@certd/lib-huawei": "^1.36.9",
"@certd/lib-k8s": "^1.36.9",
"@certd/lib-server": "^1.36.9",
"@certd/midway-flyway-js": "^1.36.9",
"@certd/pipeline": "^1.36.9",
"@certd/plugin-cert": "^1.36.9",
"@certd/plugin-lib": "^1.36.9",
"@certd/plugin-plus": "^1.36.9",
"@certd/plus-core": "^1.36.9",
"@certd/jdcloud": "^1.36.10",
"@certd/lib-huawei": "^1.36.10",
"@certd/lib-k8s": "^1.36.10",
"@certd/lib-server": "^1.36.10",
"@certd/midway-flyway-js": "^1.36.10",
"@certd/pipeline": "^1.36.10",
"@certd/plugin-cert": "^1.36.10",
"@certd/plugin-lib": "^1.36.10",
"@certd/plugin-plus": "^1.36.10",
"@certd/plus-core": "^1.36.10",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
"@koa/cors": "^5.0.0",

View File

@ -10,6 +10,7 @@ import {getPlusInfo} from "@certd/plus-core";
import dayjs from "dayjs";
import {NotificationService} from "../pipeline/service/notification-service.js";
import {UserService} from "../sys/authority/service/user-service.js";
import {Between} from "typeorm";
@Autoload()
@Scope(ScopeEnum.Request, { allowDowngrade: true })
@ -58,6 +59,8 @@ export class AutoCRegisterCron {
await this.registerPlusExpireCheckCron();
await this.registerUserExpireCheckCron()
}
async registerSiteMonitorCron() {
@ -137,4 +140,61 @@ export class AutoCRegisterCron {
}
})
}
registerUserExpireCheckCron() {
// 添加plus即将到期检查任务
this.cron.register({
name: 'user-expire-check',
cron: `0 20 9 * * *`, // 一天只能检查一次,否则会重复发送通知
job: async () => {
const getExpiresDaysUsers = async (days: number) => {
const targetDate = dayjs().add(days, 'day')
const startTime = targetDate.startOf('day').valueOf()
const endTime = targetDate.endOf('day').valueOf()
return await this.userService.find({
where: {
validTime: Between(startTime, endTime),
status: 1
}
})
}
const notifyExpiresDaysUsers = async (days: number) => {
const list = await getExpiresDaysUsers(days)
if (list.length === 0) {
return
}
let title = `账号即将到期`
let content = `您的账号剩余${days}天到期,请及时续期,以免影响业务`
if (days <= 0) {
title = `账号已过期`
content = `您的账号已过期${Math.abs(days)}天,请尽快续期,以免影响业务`
}
const url = await this.notificationService.getBindUrl("");
for (const user of list) {
logger.info(`发送到期通知给用户:${user.username}`)
await this.notificationService.send({
useDefault: true,
logger: logger,
body: {
title,
content,
errorMessage: title,
url
}
}, user.id)
}
}
await notifyExpiresDaysUsers(7)
await notifyExpiresDaysUsers(3)
await notifyExpiresDaysUsers(1)
await notifyExpiresDaysUsers(0)
await notifyExpiresDaysUsers(-1)
await notifyExpiresDaysUsers(-3)
}
})
}
}

View File

@ -32,6 +32,12 @@ export class CertInfoFacade {
if (certId) {
return await this.certInfoService.getCertInfoById({ id: certId, userId });
}
if (!domains) {
throw new CodeException({
...Constants.res.openParamError,
message: "参数错误certId和domains必须传一个",
});
}
const domainArr = domains.split(',');
const matchedList = await this.certInfoService.getMatchCertList({domains:domainArr,userId})
@ -42,12 +48,15 @@ export class CertInfoFacade {
const pipeline:PipelineEntity = await this.createAutoPipeline({domains:domainArr,userId})
await this.triggerApplyPipeline({pipelineId:pipeline.id})
}else{
throw new CodeException(Constants.res.openCertNotFound);
throw new CodeException({
...Constants.res.openCertNotFound,
message:"在证书仓库中没有找到匹配域名的证书请先创建证书流水线或传入autoApply参数自动创建"
});
}
}
matched = null;
for (const item of matchedList) {
if (item.expiresTime>0 && item.expiresTime < new Date().getTime()) {
if (item.expiresTime>0 && item.expiresTime > new Date().getTime()) {
matched = item;
break
}
@ -59,7 +68,10 @@ export class CertInfoFacade {
await this.triggerApplyPipeline({pipelineId:first.pipelineId})
return
}else{
throw new CodeException(Constants.res.openCertNotFound);
throw new CodeException({
...Constants.res.openCertNotFound,
message:"证书已过期请触发流水线申请或者传入autoApply参数自动触发"
});
}
}
@ -109,10 +121,12 @@ export class CertInfoFacade {
await this.pipelineService.trigger(req.pipelineId)
await utils.sleep(1000)
}
const certInfo = await this.certInfoService.getByPipelineId(req.pipelineId)
throw new CodeException({
...Constants.res.openCertApplying,
data:{
pipelineId:req.pipelineId
pipelineId:req.pipelineId,
certId:certInfo?.id
}
});
}

View File

@ -86,7 +86,10 @@ export class CertInfoService extends BaseService<CertInfoEntity> {
async getMatchCertList(params: { domains: string[]; userId: number }) {
const { domains, userId } = params;
if (!domains) {
throw new CodeException(Constants.res.openCertNotFound);
throw new CodeException({
...Constants.res.openCertNotFound,
message:"域名不能为空"
});
}
const list = await this.find({
@ -99,6 +102,9 @@ export class CertInfoService extends BaseService<CertInfoEntity> {
where: {
userId,
},
order: {
id: 'DESC',
},
});
//遍历查找
return list.filter(item => {
@ -161,4 +167,12 @@ export class CertInfoService extends BaseService<CertInfoEntity> {
return bean;
}
async getByPipelineId(pipelineId: number) {
return await this.repository.findOne({
where: {
pipelineId,
},
});
}
}

View File

@ -93,7 +93,7 @@ export class SiteIpService extends BaseService<SiteIpEntity> {
if (oldIps.length === ips.length ){
//检查是否有变化
const oldIpList = oldIps.map(ip=>ip.ipAddress).sort().join(",")
const newIpList = ips.filter(ip=>!oldIpList.includes(ip)).sort().join(",")
const newIpList = ips.sort().join(",")
if(oldIpList === newIpList){
//无变化
hasChanged = false

View File

@ -36,4 +36,25 @@ export class SubDomainService extends BaseService<SubDomainEntity> {
return list.map(item=>item.domain);
}
async add(bean: SubDomainEntity) {
const {domain, userId} = bean;
if (!domain) {
throw new Error('域名不能为空');
}
if (!userId) {
throw new Error('用户ID不能为空');
}
const exist = await this.repository.findOne({
where: {
domain,
userId,
},
});
if (exist) {
throw new Error('域名已存在');
}
return await super.add(bean)
}
}

View File

@ -1,6 +1,6 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { AliyunAccess } from '@certd/plugin-lib';
import { CertInfo } from '@certd/plugin-cert';
import {AliyunAccess, AliyunSslClient} from '@certd/plugin-lib';
import {CertInfo, CertReader} from '@certd/plugin-cert';
import { CertApplyPluginNames} from '@certd/plugin-cert';
@IsTaskPlugin({
name: 'DeployCertToAliyunOSS',
@ -82,11 +82,27 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
helper: '请选择前置任务输出的域名证书',
component: {
name: 'output-selector',
from: [...CertApplyPluginNames],
from: [...CertApplyPluginNames,"uploadCertToAliyun"],
},
required: true,
})
cert!: CertInfo;
cert!: CertInfo | string;
@TaskInput({
title: '证书服务接入点',
helper: '不会选就按默认',
value: 'cas.aliyuncs.com',
component: {
name: 'a-select',
options: [
{ value: 'cn-hangzhou', label: '中国大陆' },
{ value: 'southeast-1', label: '新加坡' },
{ value: 'eu-central-1', label: '德国(法兰克福)' },
],
},
required: true,
})
casRegion!: string;
@TaskInput({
title: 'Access授权',
@ -103,12 +119,42 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云OSS');
const access = (await this.getAccess(this.accessId)) as AliyunAccess;
await this.getAliyunCertId(access)
this.logger.info(`bucket: ${this.bucket}, region: ${this.region}, domainName: ${this.domainName}`);
const client = await this.getClient(access);
await this.doRequest(client, {});
this.logger.info('部署完成');
}
async getAliyunCertId(access: AliyunAccess) {
let certId: any = this.cert;
let certName: any = this.appendTimeSuffix("certd");
if (typeof this.cert === "object") {
let endpoint = `cas.${this.casRegion}.aliyuncs.com`;
if (this.casRegion === "cn-hangzhou"){
endpoint = "cas.aliyuncs.com";
}
const sslClient = new AliyunSslClient({
access,
logger: this.logger,
endpoint: endpoint
});
certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt));
certId = await sslClient.uploadCert({
name: certName,
cert: this.cert
});
this.logger.info("上传证书成功", certId, certName);
}
return {
certId,
certName
};
}
async getClient(access: AliyunAccess) {
// @ts-ignore
const OSS = await import('ali-oss');
@ -129,13 +175,24 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
cname: '',
comp: 'add',
});
let certStr = ""
if (typeof this.cert === "object" ){
certStr = `
<PrivateKey>${this.cert.key}</PrivateKey>
<Certificate>${this.cert.crt}</Certificate>
`
}else{
certStr = `<CertId>${this.cert}-${this.casRegion}</CertId>`
}
const xml = `
<BucketCnameConfiguration>
<Cname>
<Domain>${this.domainName}</Domain>
<CertificateConfiguration>
<PrivateKey>${this.cert.key}</PrivateKey>
<Certificate>${this.cert.crt}</Certificate>
${certStr}
<Force>true</Force>
</CertificateConfiguration>
</Cname>
</BucketCnameConfiguration>`;

View File

@ -23,7 +23,7 @@ const regionDict = [
@IsTaskPlugin({
name: 'uploadCertToAliyun',
title: '阿里云-上传证书到阿里云',
title: '阿里云-上传证书到阿里云CAS',
icon: 'svg:icon-aliyun',
group: pluginGroups.aliyun.key,
desc: '上传证书到阿里云数字证书管理服务CAS注意不会部署到任何应用上如果不想在阿里云上同一份证书上传多次可以把此任务作为前置任务其他阿里云任务证书那一项选择此任务的输出',

View File

@ -47,26 +47,35 @@ export class QywxNotification extends BaseNotification {
if (!this.webhook) {
throw new Error('webhook地址不能为空');
}
/**
*
* "msgtype": "text",
* "text": {
* "content": "hello world"
* }
* }
*/
const color = body.errorMessage?'red':'green';
await this.http.request({
url: this.webhook,
method: 'POST',
data: {
msgtype: 'markdown',
markdown: {
content: `<font color='${color}'>${body.title}</font>\n\n\n${body.content}\n\n[查看详情](${body.url})`,
msgtype: 'text',
text: {
content: `${body.title}\n${body.content}\n查看详情: ${body.url}`,
mentioned_list: this.mentionedList,
mentioned_mobile_list: this.mentionedMobileList,
},
},
});
//Markdown 模式不支持@
// const color = body.errorMessage?'red':'green';
// await this.http.request({
// url: this.webhook,
// method: 'POST',
// data: {
// msgtype: 'markdown',
// markdown: {
// content: `<font color='${color}'>${body.title}</font>\n\n\n${body.content}\n\n[查看详情](${body.url})`,
// mentioned_list: this.mentionedList,
// mentioned_mobile_list: this.mentionedMobileList,
// },
// },
// });
}
}