mirror of
https://github.com/certd/certd.git
synced 2026-04-05 07:20:56 +08:00
Merge branch 'v2-dev' of https://github.com/certd/certd into v2-dev
This commit is contained in:
15
CHANGELOG.md
15
CHANGELOG.md
@@ -3,6 +3,21 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复ipv6作为证书域名申请证书校验失败的bug ([e4e16bc](https://github.com/certd/certd/commit/e4e16bc6a65bb082c18ca0590226f0987a47d477))
|
||||
* 优化西部数据 500 already exists 的问题 ([2bfad9f](https://github.com/certd/certd/commit/2bfad9fc651da208b610abd921fbfb2fbc04203f))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 批量设置定时,支持清除定时 ([63d8bcf](https://github.com/certd/certd/commit/63d8bcf8823f713365042d3c7aee3cf31d44b044))
|
||||
* 新增数据库迁移doc说明文档,优化datetime字段平滑迁移 ([45fbce0](https://github.com/certd/certd/commit/45fbce0c2af5fb3ead6d3dd12a42f8cc1714262f))
|
||||
* 支持彩虹聚合登录 ([6f18693](https://github.com/certd/certd/commit/6f186932ccad4becfdc0087c0539f7b2d0069844))
|
||||
* 支持邮件模版设置 ([a6c0d2c](https://github.com/certd/certd/commit/a6c0d2c6f1fd6b60e6d7af290487c94564fd91ea))
|
||||
* oidc支持使用第三方昵称或账号作为certd用户的用户名 ([b6fea0c](https://github.com/certd/certd/commit/b6fea0c8562abf912daa7d72958ceb2e93575d31))
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -3,6 +3,21 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复ipv6作为证书域名申请证书校验失败的bug ([e4e16bc](https://github.com/certd/certd/commit/e4e16bc6a65bb082c18ca0590226f0987a47d477))
|
||||
* 优化西部数据 500 already exists 的问题 ([2bfad9f](https://github.com/certd/certd/commit/2bfad9fc651da208b610abd921fbfb2fbc04203f))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 批量设置定时,支持清除定时 ([63d8bcf](https://github.com/certd/certd/commit/63d8bcf8823f713365042d3c7aee3cf31d44b044))
|
||||
* 新增数据库迁移doc说明文档,优化datetime字段平滑迁移 ([45fbce0](https://github.com/certd/certd/commit/45fbce0c2af5fb3ead6d3dd12a42f8cc1714262f))
|
||||
* 支持彩虹聚合登录 ([6f18693](https://github.com/certd/certd/commit/6f186932ccad4becfdc0087c0539f7b2d0069844))
|
||||
* 支持邮件模版设置 ([a6c0d2c](https://github.com/certd/certd/commit/a6c0d2c6f1fd6b60e6d7af290487c94564fd91ea))
|
||||
* oidc支持使用第三方昵称或账号作为certd用户的用户名 ([b6fea0c](https://github.com/certd/certd/commit/b6fea0c8562abf912daa7d72958ceb2e93575d31))
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -40,32 +40,33 @@
|
||||
| 36.| **括彩云cdn授权** | 括彩云CDN,每月免费30G,[注册即领](https://kuocaicdn.com/register?code=8mn536rrzfbf8) |
|
||||
| 37.| **uniCloud** | unicloud授权 |
|
||||
| 38.| **猫云授权** | |
|
||||
| 39.| **西部数码授权** | |
|
||||
| 40.| **多吉云** | |
|
||||
| 41.| **我爱云授权** | 我爱云CDN |
|
||||
| 42.| **CacheFly** | CacheFly |
|
||||
| 43.| **Gcore** | Gcore |
|
||||
| 44.| **亚马逊云aws授权** | |
|
||||
| 45.| **亚马逊云科技(国区)授权** | |
|
||||
| 46.| **dns.la授权** | |
|
||||
| 47.| **又拍云** | |
|
||||
| 48.| **51dns授权** | |
|
||||
| 49.| **FlexCDN授权** | |
|
||||
| 50.| **farcdn授权** | |
|
||||
| 51.| **cloudflare授权** | |
|
||||
| 52.| **Github授权** | |
|
||||
| 53.| **namesilo授权** | |
|
||||
| 54.| **proxmox** | |
|
||||
| 55.| **网宿授权** | |
|
||||
| 56.| **金山云授权** | |
|
||||
| 57.| **APISIX授权** | |
|
||||
| 58.| **Dokploy授权** | |
|
||||
| 59.| **godaddy授权** | |
|
||||
| 60.| **新网授权** | |
|
||||
| 61.| **新网授权(代理方式)** | |
|
||||
| 62.| **新网互联授权** | 仅支持代理账号,ip需要加入白名单 |
|
||||
| 63.| **中国移动CND授权** | |
|
||||
| 64.| **雨云授权** | https://app.rainyun.com/ |
|
||||
| 39.| **授权插件示例** | |
|
||||
| 40.| **西部数码授权** | |
|
||||
| 41.| **多吉云** | |
|
||||
| 42.| **我爱云授权** | 我爱云CDN |
|
||||
| 43.| **CacheFly** | CacheFly |
|
||||
| 44.| **Gcore** | Gcore |
|
||||
| 45.| **亚马逊云aws授权** | |
|
||||
| 46.| **亚马逊云科技(国区)授权** | |
|
||||
| 47.| **dns.la授权** | |
|
||||
| 48.| **又拍云** | |
|
||||
| 49.| **51dns授权** | |
|
||||
| 50.| **FlexCDN授权** | |
|
||||
| 51.| **farcdn授权** | |
|
||||
| 52.| **cloudflare授权** | |
|
||||
| 53.| **Github授权** | |
|
||||
| 54.| **namesilo授权** | |
|
||||
| 55.| **proxmox** | |
|
||||
| 56.| **网宿授权** | |
|
||||
| 57.| **金山云授权** | |
|
||||
| 58.| **APISIX授权** | |
|
||||
| 59.| **Dokploy授权** | |
|
||||
| 60.| **godaddy授权** | |
|
||||
| 61.| **新网授权** | |
|
||||
| 62.| **新网授权(代理方式)** | |
|
||||
| 63.| **新网互联授权** | 仅支持代理账号,ip需要加入白名单 |
|
||||
| 64.| **中国移动CND授权** | |
|
||||
| 65.| **雨云授权** | https://app.rainyun.com/ |
|
||||
|
||||
<style module>
|
||||
table th:first-of-type {
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
| 13.| **cloudflare** | cloudflare dns provider |
|
||||
| 14.| **namesilo** | namesilo dns provider |
|
||||
| 15.| **godaddy** | GoDaddy |
|
||||
| 16.| **51dns** | 51DNS |
|
||||
| 17.| **新网互联** | 新网互联 |
|
||||
| 16.| **Dns提供商Demo** | dns provider示例 |
|
||||
| 17.| **51dns** | 51DNS |
|
||||
| 18.| **新网互联** | 新网互联 |
|
||||
|
||||
<style module>
|
||||
table th:first-of-type {
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.37.15"
|
||||
"version": "1.37.16"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.16](https://github.com/publishlab/node-acme-client/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复ipv6作为证书域名申请证书校验失败的bug ([e4e16bc](https://github.com/publishlab/node-acme-client/commit/e4e16bc6a65bb082c18ca0590226f0987a47d477))
|
||||
|
||||
## [1.37.15](https://github.com/publishlab/node-acme-client/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "Simple and unopinionated ACME client",
|
||||
"private": false,
|
||||
"author": "nmorsman",
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"type": "module",
|
||||
"module": "scr/index.js",
|
||||
"main": "src/index.js",
|
||||
@@ -18,7 +18,7 @@
|
||||
"types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.37.15",
|
||||
"@certd/basic": "^1.37.16",
|
||||
"@peculiar/x509": "^1.11.0",
|
||||
"asn1js": "^3.0.5",
|
||||
"axios": "^1.7.2",
|
||||
@@ -70,5 +70,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||
},
|
||||
"gitHead": "f2e4e59f8d1b54b835d5da43aef8b527d6a4ba0b"
|
||||
"gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import {log as defaultLog} from './logger.js'
|
||||
import axios from './axios.js'
|
||||
import * as util from './util.js'
|
||||
import {isAlpnCertificateAuthorizationValid} from './crypto/index.js'
|
||||
|
||||
import {utils} from '@certd/basic'
|
||||
|
||||
const dns = dnsSdk.promises
|
||||
|
||||
@@ -60,11 +60,15 @@ async function verifyHttpChallenge(authz, challenge, keyAuthorization, suffix =
|
||||
}
|
||||
|
||||
const httpPort = axios.defaults.acmeSettings.httpChallengePort || 80;
|
||||
const challengeUrl = `http://${authz.identifier.value}:${httpPort}${suffix}`;
|
||||
let host = authz.identifier.value;
|
||||
if(utils.domain.isIpv6(host)){
|
||||
host = `[${host}]`;
|
||||
}
|
||||
const challengeUrl = `http://${host}:${httpPort}${suffix}`;
|
||||
|
||||
if (!await doQuery(challengeUrl)) {
|
||||
const httpsPort = axios.defaults.acmeSettings.httpsChallengePort || 443;
|
||||
const httpsChallengeUrl = `https://${authz.identifier.value}:${httpsPort}${suffix}`;
|
||||
const httpsChallengeUrl = `https://${host}:${httpsPort}${suffix}`;
|
||||
const res = await doQuery(httpsChallengeUrl)
|
||||
if (!res) {
|
||||
throw new Error(`[error] 验证失败,请检查以上测试url是否可以正常访问`);
|
||||
|
||||
1
packages/core/basic/.gitignore
vendored
1
packages/core/basic/.gitignore
vendored
@@ -26,3 +26,4 @@ dist-ssr
|
||||
test/user.secret.*
|
||||
test/**/*.js
|
||||
src/**/*.spec.ts
|
||||
test.mjs
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复ipv6作为证书域名申请证书校验失败的bug ([e4e16bc](https://github.com/certd/certd/commit/e4e16bc6a65bb082c18ca0590226f0987a47d477))
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
@@ -1 +1 @@
|
||||
00:56
|
||||
01:44
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -47,5 +47,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "f2e4e59f8d1b54b835d5da43aef8b527d6a4ba0b"
|
||||
"gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ function isIpv6(d: string) {
|
||||
if (!d) {
|
||||
return false;
|
||||
}
|
||||
const isIPv6Regex = /^([\da-f]{1,4}:){2,7}[\da-f]{1,4}$/i;
|
||||
const isIPv6Regex = /^([0-9A-Fa-f]{0,4}:){2,7}([0-9A-Fa-f]{1,4}$|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4})$/gm;
|
||||
return isIPv6Regex.test(d);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import { random } from "lodash-es";
|
||||
import { locker } from "./dist/utils/util.lock.js";
|
||||
// import { random } from "lodash-es";
|
||||
// import { locker } from "./dist/utils/util.lock.js";
|
||||
|
||||
async function testLocker() {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
await locker.execute("test", async () => {
|
||||
console.log("test", i);
|
||||
await new Promise(resolve => setTimeout(resolve, Math.random() * 1000));
|
||||
throw new Error("test error");
|
||||
});
|
||||
}
|
||||
}
|
||||
// async function testLocker() {
|
||||
// for (let i = 0; i < 10; i++) {
|
||||
// await locker.execute("test", async () => {
|
||||
// console.log("test", i);
|
||||
// await new Promise(resolve => setTimeout(resolve, Math.random() * 1000));
|
||||
// throw new Error("test error");
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
await testLocker();
|
||||
// await testLocker();
|
||||
|
||||
import { domainUtils } from "./dist/utils/util.domain.js";
|
||||
|
||||
console.log(domainUtils.isIpv6("::0:0:0:FFFF:129.144.52.38"));
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持邮件模版设置 ([a6c0d2c](https://github.com/certd/certd/commit/a6c0d2c6f1fd6b60e6d7af290487c94564fd91ea))
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -18,8 +18,8 @@
|
||||
"compile": "tsc --skipLibCheck --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.37.15",
|
||||
"@certd/plus-core": "^1.37.15",
|
||||
"@certd/basic": "^1.37.16",
|
||||
"@certd/plus-core": "^1.37.16",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
@@ -45,5 +45,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "f2e4e59f8d1b54b835d5da43aef8b527d6a4ba0b"
|
||||
"gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
|
||||
}
|
||||
|
||||
@@ -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.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"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": "f2e4e59f8d1b54b835d5da43aef8b527d6a4ba0b"
|
||||
"gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
|
||||
}
|
||||
|
||||
@@ -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.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -31,5 +31,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "f2e4e59f8d1b54b835d5da43aef8b527d6a4ba0b"
|
||||
"gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
|
||||
}
|
||||
|
||||
@@ -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.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/jdcloud",
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"description": "jdcloud openApi sdk",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
@@ -56,5 +56,5 @@
|
||||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "f2e4e59f8d1b54b835d5da43aef8b527d6a4ba0b"
|
||||
"gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
|
||||
}
|
||||
|
||||
@@ -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.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,7 +17,7 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.37.15",
|
||||
"@certd/basic": "^1.37.16",
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -32,5 +32,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "f2e4e59f8d1b54b835d5da43aef8b527d6a4ba0b"
|
||||
"gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复ipv6作为证书域名申请证书校验失败的bug ([e4e16bc](https://github.com/certd/certd/commit/e4e16bc6a65bb082c18ca0590226f0987a47d477))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持邮件模版设置 ([a6c0d2c](https://github.com/certd/certd/commit/a6c0d2c6f1fd6b60e6d7af290487c94564fd91ea))
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -28,11 +28,11 @@
|
||||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.37.15",
|
||||
"@certd/basic": "^1.37.15",
|
||||
"@certd/pipeline": "^1.37.15",
|
||||
"@certd/plugin-lib": "^1.37.15",
|
||||
"@certd/plus-core": "^1.37.15",
|
||||
"@certd/acme-client": "^1.37.16",
|
||||
"@certd/basic": "^1.37.16",
|
||||
"@certd/pipeline": "^1.37.16",
|
||||
"@certd/plugin-lib": "^1.37.16",
|
||||
"@certd/plus-core": "^1.37.16",
|
||||
"@midwayjs/cache": "3.14.0",
|
||||
"@midwayjs/core": "3.20.11",
|
||||
"@midwayjs/i18n": "3.20.13",
|
||||
@@ -64,5 +64,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "f2e4e59f8d1b54b835d5da43aef8b527d6a4ba0b"
|
||||
"gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
|
||||
}
|
||||
|
||||
@@ -134,12 +134,9 @@ export class SysEmailConf extends BaseSettings {
|
||||
|
||||
templates:{
|
||||
registerCode?: EmailTemplate,
|
||||
forgotPasswordCode?: EmailTemplate,
|
||||
certSuccessNotify?: EmailTemplate,
|
||||
certSend?: EmailTemplate,
|
||||
pipelineNotify?: EmailTemplate,
|
||||
test?: EmailTemplate,
|
||||
siteMonitorNotify?: EmailTemplate,
|
||||
forgotPassword?: EmailTemplate,
|
||||
pipelineResult?: EmailTemplate,
|
||||
common?: EmailTemplate,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -46,5 +46,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "f2e4e59f8d1b54b835d5da43aef8b527d6a4ba0b"
|
||||
"gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复ipv6作为证书域名申请证书校验失败的bug ([e4e16bc](https://github.com/certd/certd/commit/e4e16bc6a65bb082c18ca0590226f0987a47d477))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持邮件模版设置 ([a6c0d2c](https://github.com/certd/certd/commit/a6c0d2c6f1fd6b60e6d7af290487c94564fd91ea))
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -17,10 +17,10 @@
|
||||
"compile": "tsc --skipLibCheck --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.37.15",
|
||||
"@certd/basic": "^1.37.15",
|
||||
"@certd/pipeline": "^1.37.15",
|
||||
"@certd/plugin-lib": "^1.37.15",
|
||||
"@certd/acme-client": "^1.37.16",
|
||||
"@certd/basic": "^1.37.16",
|
||||
"@certd/pipeline": "^1.37.16",
|
||||
"@certd/plugin-lib": "^1.37.16",
|
||||
"@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": "f2e4e59f8d1b54b835d5da43aef8b527d6a4ba0b"
|
||||
"gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
|
||||
}
|
||||
|
||||
@@ -21,6 +21,11 @@ export class DomainParser implements IDomainParser {
|
||||
}
|
||||
|
||||
async parse(fullDomain: string) {
|
||||
//如果是ip
|
||||
if (utils.domain.isIp(fullDomain)) {
|
||||
return fullDomain;
|
||||
}
|
||||
|
||||
this.logger.info(`查找主域名:${fullDomain}`);
|
||||
const cacheKey = `domain_parse:${fullDomain}`;
|
||||
const value = utils.cache.get(cacheKey);
|
||||
|
||||
@@ -220,7 +220,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||
if(form.challengeType === 'cname' ){
|
||||
return '请按照上面的提示,给要申请证书的域名添加CNAME记录,添加后,点击验证,验证成功后不要删除记录,申请和续期证书会一直用它'
|
||||
}else if (form.challengeType === 'http'){
|
||||
return '请按照上面的提示,给每个域名设置文件上传配置,证书申请过程中会上传校验文件到网站根目录下'
|
||||
return '请按照上面的提示,给每个域名设置文件上传配置,证书申请过程中会上传校验文件到网站根目录的.well-known/acme-challenge/目录下'
|
||||
}else if (form.challengeType === 'http'){
|
||||
return '给每个域名单独配置dns提供商'
|
||||
}
|
||||
|
||||
@@ -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.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-lib",
|
||||
"private": false,
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -22,8 +22,8 @@
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@alicloud/tea-util": "^1.4.10",
|
||||
"@aws-sdk/client-s3": "^3.787.0",
|
||||
"@certd/basic": "^1.37.15",
|
||||
"@certd/pipeline": "^1.37.15",
|
||||
"@certd/basic": "^1.37.16",
|
||||
"@certd/pipeline": "^1.37.16",
|
||||
"@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": "f2e4e59f8d1b54b835d5da43aef8b527d6a4ba0b"
|
||||
"gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,18 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复ipv6作为证书域名申请证书校验失败的bug ([e4e16bc](https://github.com/certd/certd/commit/e4e16bc6a65bb082c18ca0590226f0987a47d477))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 批量设置定时,支持清除定时 ([63d8bcf](https://github.com/certd/certd/commit/63d8bcf8823f713365042d3c7aee3cf31d44b044))
|
||||
* 支持彩虹聚合登录 ([6f18693](https://github.com/certd/certd/commit/6f186932ccad4becfdc0087c0539f7b2d0069844))
|
||||
* 支持邮件模版设置 ([a6c0d2c](https://github.com/certd/certd/commit/a6c0d2c6f1fd6b60e6d7af290487c94564fd91ea))
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
@@ -106,8 +106,8 @@
|
||||
"zod-defaults": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.37.15",
|
||||
"@certd/pipeline": "^1.37.15",
|
||||
"@certd/lib-iframe": "^1.37.16",
|
||||
"@certd/pipeline": "^1.37.16",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
import Validator from "async-validator";
|
||||
|
||||
function isIpv6(d: string) {
|
||||
if (!d) {
|
||||
return false;
|
||||
}
|
||||
const isIPv6Regex = /^([0-9A-Fa-f]{0,4}:){2,7}([0-9A-Fa-f]{1,4}$|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4})$/gm;
|
||||
return isIPv6Regex.test(d);
|
||||
}
|
||||
function isIpv4(d: string) {
|
||||
if (!d) {
|
||||
return false;
|
||||
}
|
||||
const isIPv4Regex = /^(\d{1,3}\.){3}\d{1,3}$/;
|
||||
return isIPv4Regex.test(d);
|
||||
}
|
||||
function isIp(d: string) {
|
||||
if (!d) {
|
||||
return false;
|
||||
}
|
||||
return isIpv4(d) || isIpv6(d);
|
||||
}
|
||||
|
||||
// 自定义验证器函数
|
||||
export function isDomain(rule: any, value: any) {
|
||||
if (value == null || value == "") {
|
||||
@@ -14,7 +36,9 @@ export function isDomain(rule: any, value: any) {
|
||||
const compiled = new RegExp(exp);
|
||||
for (const domain of domains) {
|
||||
//域名可以是泛域名,中文域名,数字域名,英文域名,域名中可以包含-和. ,可以_开头
|
||||
|
||||
if (isIp(domain)) {
|
||||
continue;
|
||||
}
|
||||
if (!compiled.test(domain)) {
|
||||
throw new Error(`域名有误:${domain},请输入正确的域名`);
|
||||
}
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useFormWrapper } from "@fast-crud/fast-crud";
|
||||
import { compute, dict, useFormWrapper } from "@fast-crud/fast-crud";
|
||||
import * as api from "../api";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { computed } from "vue";
|
||||
const { t } = useI18n();
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -20,7 +21,7 @@ async function batchUpdateRequest(form: any) {
|
||||
await api.BatchUpdateTrigger(props.selectedRowKeys, {
|
||||
title: "定时触发",
|
||||
type: "timer",
|
||||
props: form.props,
|
||||
props: form.clear ? false : form.props,
|
||||
});
|
||||
emit("change");
|
||||
}
|
||||
@@ -33,6 +34,28 @@ async function openFormDialog() {
|
||||
settingStore.checkPlus();
|
||||
const crudOptions: any = {
|
||||
columns: {
|
||||
clear: {
|
||||
title: "设置/清空",
|
||||
form: {
|
||||
value: false,
|
||||
component: {
|
||||
name: "fs-dict-switch",
|
||||
vModel: "checked",
|
||||
dict: dict({
|
||||
data: [
|
||||
{
|
||||
label: "设置定时",
|
||||
value: false,
|
||||
},
|
||||
{
|
||||
label: "清空定时",
|
||||
value: true,
|
||||
},
|
||||
],
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
"props.cron": {
|
||||
title: t("certd.schedule"),
|
||||
form: {
|
||||
@@ -40,12 +63,18 @@ async function openFormDialog() {
|
||||
name: "cron-editor",
|
||||
vModel: "modelValue",
|
||||
},
|
||||
show: compute(({ form }) => {
|
||||
return form.clear !== true;
|
||||
}),
|
||||
rules: [{ required: true, message: t("certd.selectCron") }],
|
||||
},
|
||||
},
|
||||
},
|
||||
form: {
|
||||
mode: "edit",
|
||||
initialForm: {
|
||||
clear: false,
|
||||
},
|
||||
//@ts-ignore
|
||||
async doSubmit({ form }) {
|
||||
await batchUpdateRequest(form);
|
||||
|
||||
@@ -59,7 +59,11 @@
|
||||
<a-button type="primary" html-type="submit">{{ t("certd.save") }}</a-button>
|
||||
</a-form-item>
|
||||
|
||||
<h2>{{ t("certd.sys.setting.email.templateSetting") }}</h2>
|
||||
<div class="flex items-center">
|
||||
<h2>{{ t("certd.sys.setting.email.templateSetting") }}</h2>
|
||||
<vip-button class="ml-10" mode="button"></vip-button>
|
||||
</div>
|
||||
|
||||
<a-form-item :label="t('certd.sys.setting.email.templates')" :name="['templates']">
|
||||
<div class="flex flex-wrap">
|
||||
<table class="w-full table-auto border-collapse border border-gray-400">
|
||||
@@ -78,7 +82,14 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="border border-gray-300 px-4 py-2">
|
||||
<AddonSelector v-model:model-value="item.addonId" addon-type="emailTemplate" from="sys" :type="item.name" :placeholder="t('certd.sys.setting.email.templateProviderSelectorPlaceholder')" />
|
||||
<AddonSelector
|
||||
v-model:model-value="item.addonId"
|
||||
:disabled="!settingStore.isPlus"
|
||||
addon-type="emailTemplate"
|
||||
from="sys"
|
||||
:type="item.name"
|
||||
:placeholder="t('certd.sys.setting.email.templateProviderSelectorPlaceholder')"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -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.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 优化西部数据 500 already exists 的问题 ([2bfad9f](https://github.com/certd/certd/commit/2bfad9fc651da208b610abd921fbfb2fbc04203f))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 批量设置定时,支持清除定时 ([63d8bcf](https://github.com/certd/certd/commit/63d8bcf8823f713365042d3c7aee3cf31d44b044))
|
||||
* 新增数据库迁移doc说明文档,优化datetime字段平滑迁移 ([45fbce0](https://github.com/certd/certd/commit/45fbce0c2af5fb3ead6d3dd12a42f8cc1714262f))
|
||||
* 支持彩虹聚合登录 ([6f18693](https://github.com/certd/certd/commit/6f186932ccad4becfdc0087c0539f7b2d0069844))
|
||||
* 支持邮件模版设置 ([a6c0d2c](https://github.com/certd/certd/commit/a6c0d2c6f1fd6b60e6d7af290487c94564fd91ea))
|
||||
* oidc支持使用第三方昵称或账号作为certd用户的用户名 ([b6fea0c](https://github.com/certd/certd/commit/b6fea0c8562abf912daa7d72958ceb2e93575d31))
|
||||
|
||||
## [1.37.15](https://github.com/certd/certd/compare/v1.37.14...v1.37.15) (2025-12-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.37.15",
|
||||
"version": "1.37.16",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -45,20 +45,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.37.15",
|
||||
"@certd/basic": "^1.37.15",
|
||||
"@certd/commercial-core": "^1.37.15",
|
||||
"@certd/acme-client": "^1.37.16",
|
||||
"@certd/basic": "^1.37.16",
|
||||
"@certd/commercial-core": "^1.37.16",
|
||||
"@certd/cv4pve-api-javascript": "^8.4.2",
|
||||
"@certd/jdcloud": "^1.37.15",
|
||||
"@certd/lib-huawei": "^1.37.15",
|
||||
"@certd/lib-k8s": "^1.37.15",
|
||||
"@certd/lib-server": "^1.37.15",
|
||||
"@certd/midway-flyway-js": "^1.37.15",
|
||||
"@certd/pipeline": "^1.37.15",
|
||||
"@certd/plugin-cert": "^1.37.15",
|
||||
"@certd/plugin-lib": "^1.37.15",
|
||||
"@certd/plugin-plus": "^1.37.15",
|
||||
"@certd/plus-core": "^1.37.15",
|
||||
"@certd/jdcloud": "^1.37.16",
|
||||
"@certd/lib-huawei": "^1.37.16",
|
||||
"@certd/lib-k8s": "^1.37.16",
|
||||
"@certd/lib-server": "^1.37.16",
|
||||
"@certd/midway-flyway-js": "^1.37.16",
|
||||
"@certd/pipeline": "^1.37.16",
|
||||
"@certd/plugin-cert": "^1.37.16",
|
||||
"@certd/plugin-lib": "^1.37.16",
|
||||
"@certd/plugin-plus": "^1.37.16",
|
||||
"@certd/plus-core": "^1.37.16",
|
||||
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
|
||||
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
|
||||
"@koa/cors": "^5.0.0",
|
||||
|
||||
@@ -117,10 +117,11 @@ export class EmailService implements IEmailService {
|
||||
|
||||
async test(userId: number, receiver: string) {
|
||||
await this.sendByTemplate({
|
||||
type:"common",
|
||||
data:{
|
||||
type: "common",
|
||||
data: {
|
||||
title: '测试邮件,from certd',
|
||||
content: '测试邮件,from certd',
|
||||
url:"https://certd.handfree.work",
|
||||
},
|
||||
email: {
|
||||
receivers: [receiver],
|
||||
@@ -150,36 +151,39 @@ export class EmailService implements IEmailService {
|
||||
|
||||
|
||||
async sendByTemplate(req: EmailSendByTemplateReq) {
|
||||
const emailConf = await this.sysSettingsService.getSetting<SysEmailConf>(SysEmailConf);
|
||||
|
||||
const template = emailConf?.templates?.[req.type]
|
||||
let content = null
|
||||
if (template && template.addonId) {
|
||||
const addon: ITemplateProvider<EmailContent> = await this.addonGetterService.getAddonById(template.addonId, true, 0)
|
||||
if (addon) {
|
||||
content = await addon.buildContent({ data: req.data })
|
||||
}
|
||||
}
|
||||
if (!content) {
|
||||
//看看有没有通用模版
|
||||
if (emailConf?.templates?.common && emailConf?.templates?.common.addonId) {
|
||||
const addon: ITemplateProvider<EmailContent> = await this.addonGetterService.getAddonById(emailConf.templates.common.addonId, true, 0)
|
||||
if (isPlus()) {
|
||||
const emailConf = await this.sysSettingsService.getSetting<SysEmailConf>(SysEmailConf);
|
||||
const template = emailConf?.templates?.[req.type]
|
||||
if (template && template.addonId) {
|
||||
const addon: ITemplateProvider<EmailContent> = await this.addonGetterService.getAddonById(template.addonId, true, 0)
|
||||
if (addon) {
|
||||
content = await addon.buildContent({ data: req.data })
|
||||
}
|
||||
}
|
||||
}
|
||||
// 没有找到模版,使用默认模版
|
||||
if (!content) {
|
||||
try {
|
||||
const addon: ITemplateProvider<EmailContent> = await this.addonGetterService.getBlank("emailTemplate", req.type)
|
||||
content = await addon.buildDefaultContent({ data: req.data })
|
||||
} catch (e) {
|
||||
// 对应的通知类型模版可能没有注册或者开发
|
||||
const addon: ITemplateProvider<EmailContent> = await this.addonGetterService.getBlank("emailTemplate", "common")
|
||||
content = await addon.buildDefaultContent({ data: req.data })
|
||||
//common类型的一定有,已经开发了
|
||||
if (!content) {
|
||||
//看看有没有通用模版
|
||||
if (emailConf?.templates?.common && emailConf?.templates?.common.addonId) {
|
||||
const addon: ITemplateProvider<EmailContent> = await this.addonGetterService.getAddonById(emailConf.templates.common.addonId, true, 0)
|
||||
if (addon) {
|
||||
content = await addon.buildContent({ data: req.data })
|
||||
}
|
||||
}
|
||||
}
|
||||
// 没有找到模版,使用默认模版
|
||||
if (!content) {
|
||||
try {
|
||||
const addon: ITemplateProvider<EmailContent> = await this.addonGetterService.getBlank("emailTemplate", req.type)
|
||||
content = await addon.buildDefaultContent({ data: req.data })
|
||||
} catch (e) {
|
||||
// 对应的通知类型模版可能没有注册或者开发
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!content) {
|
||||
const addon: ITemplateProvider<EmailContent> = await this.addonGetterService.getBlank("emailTemplate", "common")
|
||||
content = await addon.buildDefaultContent({ data: req.data })
|
||||
}
|
||||
return await this.send({
|
||||
...req.email,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import parser from 'cron-parser';
|
||||
import { ILogger } from '@certd/basic';
|
||||
import { ILogger, logger } from '@certd/basic';
|
||||
|
||||
export type CronTaskReq = {
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ export class Cron {
|
||||
|
||||
queue: CronTask[] = [];
|
||||
constructor(opts: any) {
|
||||
this.logger = opts.logger;
|
||||
this.logger = opts.logger || logger;
|
||||
this.immediateTriggerOnce = opts.immediateTriggerOnce;
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
}
|
||||
const pipeline = JSON.parse(item.content);
|
||||
let stepCount = 0;
|
||||
if(pipeline.stages){
|
||||
if (pipeline.stages) {
|
||||
RunnableCollection.each(pipeline.stages, (runnable: any) => {
|
||||
stepCount++;
|
||||
});
|
||||
@@ -237,7 +237,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
let fromType = "pipeline";
|
||||
if (bean.type === "cert_upload") {
|
||||
fromType = "upload";
|
||||
}else if (bean.type === "cert_auto") {
|
||||
} else if (bean.type === "cert_auto") {
|
||||
fromType = "auto";
|
||||
}
|
||||
await this.certInfoService.updateDomains(pipeline.id, pipeline.userId || bean.userId, domains, fromType);
|
||||
@@ -376,17 +376,17 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
}
|
||||
|
||||
if (immediateTriggerOnce) {
|
||||
try{
|
||||
try {
|
||||
await this.trigger(pipeline.id);
|
||||
await sleep(200);
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
logger.error(e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
async trigger(id: any, stepId?: string , doCheck = false) {
|
||||
async trigger(id: any, stepId?: string, doCheck = false) {
|
||||
const entity: PipelineEntity = await this.info(id);
|
||||
if (doCheck) {
|
||||
await this.beforeCheck(entity);
|
||||
@@ -441,6 +441,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
pipeline = await this.info(id);
|
||||
} else {
|
||||
pipeline = id;
|
||||
id = pipeline.id;
|
||||
}
|
||||
if (!pipeline) {
|
||||
return;
|
||||
@@ -456,6 +457,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
removeCron(pipelineId, trigger) {
|
||||
const name = this.buildCronKey(pipelineId, trigger.id);
|
||||
this.cron.remove(name);
|
||||
logger.info("当前定时器数量:", this.cron.getTaskSize());
|
||||
}
|
||||
|
||||
registerCron(pipelineId, trigger) {
|
||||
@@ -500,8 +502,8 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
|
||||
async isPipelineValidTimeEnabled(entity: PipelineEntity) {
|
||||
const settings = await this.sysSettingsService.getPublicSettings();
|
||||
if (isPlus() && settings.pipelineValidTimeEnabled){
|
||||
if (entity.validTime > 0 && entity.validTime < Date.now()){
|
||||
if (isPlus() && settings.pipelineValidTimeEnabled) {
|
||||
if (entity.validTime > 0 && entity.validTime < Date.now()) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -524,7 +526,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
if (!validTimeEnabled) {
|
||||
throw new Error(`流水线${entity.id}已过期,不予执行`);
|
||||
}
|
||||
|
||||
|
||||
let suite: UserSuiteEntity = null;
|
||||
if (isComm()) {
|
||||
suite = await this.checkHasDeployCount(entity.id, entity.userId);
|
||||
@@ -538,8 +540,8 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
|
||||
async doRun(entity: PipelineEntity, triggerId: string, stepId?: string) {
|
||||
|
||||
let suite:any = null
|
||||
try{
|
||||
let suite: any = null
|
||||
try {
|
||||
const res = await this.beforeCheck(entity);
|
||||
suite = res.suite
|
||||
} catch (e) {
|
||||
@@ -803,11 +805,17 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
|
||||
for (const item of list) {
|
||||
const pipeline = JSON.parse(item.content);
|
||||
pipeline.triggers = [{
|
||||
id: nanoid(),
|
||||
title: "定时触发",
|
||||
...trigger
|
||||
}];
|
||||
if (trigger.props === false) {
|
||||
//清除trigger
|
||||
pipeline.triggers = []
|
||||
} else {
|
||||
pipeline.triggers = [{
|
||||
id: nanoid(),
|
||||
title: "定时触发",
|
||||
...trigger
|
||||
}];
|
||||
}
|
||||
|
||||
await this.doUpdatePipelineJson(item, pipeline);
|
||||
}
|
||||
|
||||
@@ -919,20 +927,20 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
}
|
||||
}
|
||||
|
||||
async createAutoPipeline(req: { domains: string[]; email: string; userId: number ,from:string}) {
|
||||
async createAutoPipeline(req: { domains: string[]; email: string; userId: number, from: string }) {
|
||||
|
||||
const randomHour = Math.floor(Math.random() * 6);
|
||||
const randomMin = Math.floor(Math.random() * 60);
|
||||
const randomCron = `0 ${randomMin} ${randomHour} * * *`;
|
||||
|
||||
let pipeline: any = {
|
||||
title: req.domains[0] + `证书自动申请【${req.from??"OpenAPI"}】`,
|
||||
title: req.domains[0] + `证书自动申请【${req.from ?? "OpenAPI"}】`,
|
||||
runnableType: "pipeline",
|
||||
triggers: [
|
||||
{
|
||||
id: nanoid(),
|
||||
title: "定时触发",
|
||||
props:{
|
||||
props: {
|
||||
cron: randomCron,
|
||||
},
|
||||
type: "timer"
|
||||
|
||||
@@ -25,13 +25,16 @@ export class EmailNotification extends BaseNotification {
|
||||
const templateData = {
|
||||
...body,
|
||||
}
|
||||
const emailSend:any = {
|
||||
receivers: this.receivers,
|
||||
}
|
||||
if (body.attachments && body.attachments.length > 0) {
|
||||
emailSend.attachments = body.attachments;
|
||||
}
|
||||
await this.ctx.emailService.sendByTemplate({
|
||||
type: body.notificationType,
|
||||
data: templateData,
|
||||
email: {
|
||||
receivers: this.receivers,
|
||||
attachments: body.attachments,
|
||||
}
|
||||
email: emailSend
|
||||
})
|
||||
|
||||
// await this.ctx.emailService.send({
|
||||
|
||||
@@ -60,7 +60,9 @@ export class TelegramNotification extends BaseNotification {
|
||||
|
||||
replaceText(text: string) {
|
||||
// .*()<> 等都需要用\\进行替换
|
||||
return text.replace(/[\\.*()<>-]/g, '\\$&');
|
||||
return text.replace(/[_*[\]()~`>#\+\-=|{}.!]/g, '\\$&');
|
||||
// .replace(/([\\_*`|!.[\](){}>+#=~-])/gm, '\\$1')
|
||||
// return text.replace(/[\\.*()<>]/g, '\\$&');
|
||||
}
|
||||
async send(body: NotificationBody) {
|
||||
if (!this.botToken || !this.chatId) {
|
||||
|
||||
@@ -61,8 +61,14 @@ export class BaseEmailTemplateProvider extends BaseAddon implements ITemplatePro
|
||||
|
||||
|
||||
async buildContent(params: BuildContentReq): Promise<EmailContent> {
|
||||
const title = this.compile(this.titleTemplate)(params.data)
|
||||
const content = this.compile(this.contentTemplate)(params.data)
|
||||
const data = {
|
||||
title:"",
|
||||
content:"",
|
||||
url:"",
|
||||
...params.data,
|
||||
}
|
||||
const title = this.compile(this.titleTemplate)(data)
|
||||
const content = this.compile(this.contentTemplate)(data)
|
||||
|
||||
const body: any = {
|
||||
subject: title,
|
||||
|
||||
@@ -1 +1 @@
|
||||
00:59
|
||||
01:47
|
||||
|
||||
@@ -1 +1 @@
|
||||
01:17
|
||||
07:43
|
||||
|
||||
Reference in New Issue
Block a user