Compare commits

..

31 Commits

Author SHA1 Message Date
xiaojunnuo eb46f8c776 chore: 企业管理模式初步 2026-02-04 15:49:01 +08:00
xiaojunnuo bd511f97cb fix: 修复新网找错域名的bug 2026-02-03 18:28:41 +08:00
xiaojunnuo 560bf40e4b chore: 1 2026-02-03 16:28:11 +08:00
xiaojunnuo 4f4652c1cd docs: 1 2026-02-03 12:28:30 +08:00
xiaojunnuo 60e13c2a1d Merge branch 'v2-dev' of https://github.com/certd/certd into v2-dev 2026-02-03 09:50:29 +08:00
xiaojunnuo 1fe0dc4d16 chore: 1 2026-02-03 09:50:23 +08:00
xiaojunnuo 181a1e3c0a build: release 2026-02-03 00:18:06 +08:00
xiaojunnuo 6bba771856 build: publish 2026-02-03 00:04:32 +08:00
xiaojunnuo 921f1f42fb build: trigger build image 2026-02-03 00:04:20 +08:00
xiaojunnuo eeb1f27fa4 v1.38.5 2026-02-03 00:02:52 +08:00
xiaojunnuo 9ce21ad152 build: prepare to build 2026-02-02 23:59:55 +08:00
xiaojunnuo c036929cfe chore: order count 2026-02-02 23:40:10 +08:00
xiaojunnuo 21591a3a89 chore: plus失效原因显示 2026-02-02 16:54:23 +08:00
xiaojunnuo a2e9a41a7e perf: 支持绑定两个url地址 2026-02-02 16:36:43 +08:00
xiaojunnuo 0902349130 Merge branch 'v2-dev' of https://github.com/certd/certd into v2-dev 2026-02-02 15:31:17 +08:00
xiaojunnuo f900db8e10 chore: 赞助数量状态样式 2026-02-02 15:31:02 +08:00
xiaojunnuo 0fa9b344e0 perf: 将重置密码的日志挪到启动成功之后,方便查看 2026-02-02 11:46:55 +08:00
xiaojunnuo f48ef3d17b Merge branch 'v2-dev' of https://github.com/certd/certd into v2-dev 2026-02-02 11:31:27 +08:00
xiaojunnuo 40801d0a06 fix: 某些情况下登陆页面没有显示重置密码文档链接的问题 2026-02-02 11:31:17 +08:00
xiaojunnuo c6ccf1cf21 chore: vscode 显示多存储库 2026-02-02 10:21:25 +08:00
xiaojunnuo d311992983 chore: vip modal content转到单独的组件中 2026-02-02 02:29:26 +08:00
xiaojunnuo b4babbe2c7 chore: bindUrl2初步 2026-02-02 02:02:58 +08:00
xiaojunnuo 0719f4c99e fix: 修复部署到火山引擎vod,获取域名列表为空的bug 2026-02-01 23:10:45 +08:00
xiaojunnuo eb5de15033 fix: 修复oidc配置取消后获取登出地址失败后无法列出oauth列表的bug 2026-02-01 22:43:35 +08:00
xiaojunnuo b229486d3b chore: 1 2026-02-01 15:43:19 +08:00
xiaojunnuo 33b8d3e219 chore: aliyun esa ok 2026-02-01 15:40:35 +08:00
xiaojunnuo 230256793f fix: 阿里云esa查询证书限制接口无效,改成配置证书数量上限检查方式进行清理 2026-02-01 15:37:45 +08:00
xiaojunnuo 540ef96745 fix: 修复litessl new-nonce报428的bug 2026-02-01 15:25:28 +08:00
xiaojunnuo 1baf30a671 build: release 2026-02-01 02:25:55 +08:00
xiaojunnuo 5e93840e48 build: publish 2026-02-01 02:12:29 +08:00
xiaojunnuo 73a5908039 build: trigger build image 2026-02-01 02:12:17 +08:00
83 changed files with 1309 additions and 491 deletions
+5 -1
View File
@@ -16,5 +16,9 @@
},
"[less]": {
"editor.defaultFormatter": "vscode.css-language-features"
}
},
"scm.repositories.visible": 9,
"scm.repositories.explorer": false,
"scm.repositories.selectionMode": "multiple",
"scm.repositories.sortOrder": "discovery time"
}
+15
View File
@@ -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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
### Bug Fixes
* 阿里云esa查询证书限制接口无效,改成配置证书数量上限检查方式进行清理 ([2302567](https://github.com/certd/certd/commit/230256793f8ad87ef8a0738c37108bf7b5ab9853))
* 某些情况下登陆页面没有显示重置密码文档链接的问题 ([40801d0](https://github.com/certd/certd/commit/40801d0a0668c77adb57fae42b4b6615b198a88d))
* 修复部署到火山引擎vod,获取域名列表为空的bug ([0719f4c](https://github.com/certd/certd/commit/0719f4c99e9198544d03431107b53652e076e881))
* 修复litessl new-nonce报428的bug ([540ef96](https://github.com/certd/certd/commit/540ef967457a7871637cfdb5012ed1fa3261757b))
* 修复oidc配置取消后获取登出地址失败后无法列出oauth列表的bug ([eb5de15](https://github.com/certd/certd/commit/eb5de150332fd914c56b812c3ba2c2445f902bb7))
### Performance Improvements
* 将重置密码的日志挪到启动成功之后,方便查看 ([0fa9b34](https://github.com/certd/certd/commit/0fa9b344e08cf355aee7a7566f061cc5d95dc374))
* 支持绑定两个url地址 ([a2e9a41](https://github.com/certd/certd/commit/a2e9a41a7e712395c0e3ee6fe55b370aa1fc1f12))
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
### Bug Fixes
+33
View File
@@ -3,6 +3,39 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
### Bug Fixes
* 阿里云esa查询证书限制接口无效,改成配置证书数量上限检查方式进行清理 ([2302567](https://github.com/certd/certd/commit/230256793f8ad87ef8a0738c37108bf7b5ab9853))
* 某些情况下登陆页面没有显示重置密码文档链接的问题 ([40801d0](https://github.com/certd/certd/commit/40801d0a0668c77adb57fae42b4b6615b198a88d))
* 修复部署到火山引擎vod,获取域名列表为空的bug ([0719f4c](https://github.com/certd/certd/commit/0719f4c99e9198544d03431107b53652e076e881))
* 修复litessl new-nonce报428的bug ([540ef96](https://github.com/certd/certd/commit/540ef967457a7871637cfdb5012ed1fa3261757b))
* 修复oidc配置取消后获取登出地址失败后无法列出oauth列表的bug ([eb5de15](https://github.com/certd/certd/commit/eb5de150332fd914c56b812c3ba2c2445f902bb7))
### Performance Improvements
* 将重置密码的日志挪到启动成功之后,方便查看 ([0fa9b34](https://github.com/certd/certd/commit/0fa9b344e08cf355aee7a7566f061cc5d95dc374))
* 支持绑定两个url地址 ([a2e9a41](https://github.com/certd/certd/commit/a2e9a41a7e712395c0e3ee6fe55b370aa1fc1f12))
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
### Bug Fixes
* 修复1:: 形式的ipv6校验失败的bug ([8b96f21](https://github.com/certd/certd/commit/8b96f218d5284033f10c186c0ce18e4c16d8e9b2))
* 修复阿里云esa超过免费配额之后无法部署证书的bug,改成删除最旧的那张证书 ([32de8d9](https://github.com/certd/certd/commit/32de8d9ccb08d26414adbdde950d7cd405dc344a))
### Performance Improvements
* 当ip证书天数太小时,自动调整更新天数,避免每次运行都重新申请ip证书 ([433e98b](https://github.com/certd/certd/commit/433e98b6450fa7d0491151f159e432bf3dfe4feb))
* 首页证书数量支持点击跳转 ([52cbff0](https://github.com/certd/certd/commit/52cbff0e15329aecd3edcf81315fb7ceab9ec290))
* 修复旧版本流水线数据发送通知标题为空的bug ([9bee0e4](https://github.com/certd/certd/commit/9bee0e460bfebe8db76742b80b2d52854392f4de))
* 验证码支持 Cloudflare Turnstile ,谨慎启用,国内被墙了 ([ca43c77](https://github.com/certd/certd/commit/ca43c775250154def63c4acd96d65dc95d1c0c2b))
* 优化证书未过期时的任务日志提示 ([ac85488](https://github.com/certd/certd/commit/ac85488245197694560aad7df9425ca215ef7ff7))
* 支持部署到阿里云GA ([1a0d3ee](https://github.com/certd/certd/commit/1a0d3eeb1b0b5ce08f05af84b6161e00c1fe1815))
* 支持部署到华为elb ([60c8ace](https://github.com/certd/certd/commit/60c8ace443e848155d3ce12e95b84766a4610d3a))
* 支持部署到AcePanel ([1661cae](https://github.com/certd/certd/commit/1661caed05e3413dc3e2b14ce62b75aa03ad90e0))
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
### Bug Fixes
+24
View File
@@ -0,0 +1,24 @@
{
"notice": "永久专业版上线,新用户立减50,升级到最新版点击下方“立即赞助”按钮前往获取",
"plus": {
"name": "专业版",
"price": "89.9",
"price3": "199",
"tooltip": "开源需要您的赞助支持",
"priceText":"¥89.9/年",
"discountText":"永久专业版50优惠券立即领取"
},
"comm": {
"name": "商业版",
"price": "399",
"price3": "899",
"tooltip": "3年优惠300",
"priceText":"¥399/年",
"discountText":"¥899/3年(3年优惠300"
},
"app":{
"minVersion":"1.36.0",
"minVersionTip":"版本过低,为了您的数据安全,请尽快升级"
}
}
+8
View File
@@ -52,3 +52,11 @@ service:
3. DNS 有其他平台申请过的_acme-challenge记录,删除即可
## 7. DNS problem: NXDOMAIN looking up TXT for _acme-challenge.xxx
`
DNS problem: NXDOMAIN looking up TXT for _acme-challenge.xxxxx - check that a DNS record exists for this domain
`
证书颁发机构向域名ns查询TXT验证记录失败,有以下几种可能
1、域名的ns服务器修改成别的了,但申请证书时的DNS提供商选择错误(检查确认,配置正确的DNS提供商)
2、证书颁发机构与ns域名服务器之间访问不通,无法查询到TXT记录(尝试更换证书颁发机构)
3、ns服务商解析值生效慢(尝试修改证书申请任务里面的等待生效时长600-1000s)
+1 -1
View File
@@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.38.4"
"version": "1.38.5"
}
+6
View File
@@ -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.38.5](https://github.com/publishlab/node-acme-client/compare/v1.38.4...v1.38.5) (2026-02-02)
### Bug Fixes
* 修复litessl new-nonce报428的bug ([540ef96](https://github.com/publishlab/node-acme-client/commit/540ef967457a7871637cfdb5012ed1fa3261757b))
## [1.38.4](https://github.com/publishlab/node-acme-client/compare/v1.38.3...v1.38.4) (2026-01-31)
**Note:** Version bump only for package @certd/acme-client
+3 -3
View File
@@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client",
"private": false,
"author": "nmorsman",
"version": "1.38.4",
"version": "1.38.5",
"type": "module",
"module": "scr/index.js",
"main": "src/index.js",
@@ -18,7 +18,7 @@
"types"
],
"dependencies": {
"@certd/basic": "^1.38.4",
"@certd/basic": "^1.38.5",
"@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5",
"axios": "^1.9.0",
@@ -70,5 +70,5 @@
"bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues"
},
"gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
}
+3 -1
View File
@@ -103,7 +103,9 @@ class AcmeClient {
max: this.opts.backoffMax,
};
this.http = new HttpClient(this.opts.directoryUrl, this.opts.accountKey, this.opts.externalAccountBinding, this.opts.urlMapping, opts.logger);
const cacheNonce = true
// const cacheNonce = this.sslProvider === 'litessl';
this.http = new HttpClient(this.opts.directoryUrl, this.opts.accountKey, this.opts.externalAccountBinding, this.opts.urlMapping, opts.logger, cacheNonce);
this.api = new AcmeApi(this.http, this.opts.accountUrl);
this.logger = opts.logger;
}
+47 -2
View File
@@ -19,7 +19,7 @@ import { getJwk } from './crypto/index.js';
*/
class HttpClient {
constructor(directoryUrl, accountKey, externalAccountBinding = {}, urlMapping = {},logger) {
constructor(directoryUrl, accountKey, externalAccountBinding = {}, urlMapping = {}, logger, cacheNonce= false) {
this.directoryUrl = directoryUrl;
this.accountKey = accountKey;
this.externalAccountBinding = externalAccountBinding;
@@ -31,7 +31,34 @@ class HttpClient {
this.directoryMaxAge = 86400;
this.directoryTimestamp = 0;
this.urlMapping = urlMapping;
this.log = logger? logger.info.bind(logger) : log;
this.log = logger ? logger.info.bind(logger) : log;
this.nonces = [];
this.cacheNonce = cacheNonce;
}
pushNonce(nonce) {
if (!this.cacheNonce || !nonce) {
return;
}
this.nonces.push({
nonce,
expires: Date.now() + 30*1000,
});
}
popNonce() {
while (true) {
if (this.nonces.length === 0) {
return null;
}
const item = this.nonces.shift();
if (!item) {
return null;
}
if (item.expires < Date.now()) {
continue;
}
return item.nonce;
}
}
/**
@@ -70,6 +97,13 @@ class HttpClient {
const resp = await axios.request(opts);
this.log(`RESP ${resp.status} ${method} ${url}`);
const nonce = resp.headers['replay-nonce'];
if (nonce) {
//如果有nonce
this.pushNonce(nonce);
}
return resp;
}
@@ -127,6 +161,13 @@ class HttpClient {
*/
async getNonce() {
//尝试从队列中pop一个nonce
const nonce = this.popNonce();
if (nonce) {
return nonce;
}
const url = await this.getResourceUrl('newNonce');
const resp = await this.request(url, 'head');
@@ -134,7 +175,11 @@ class HttpClient {
throw new Error('Failed to get nonce from ACME provider');
}
if (this.cacheNonce) {
return this.popNonce();
}
return resp.headers['replay-nonce'];
}
/**
+4
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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
**Note:** Version bump only for package @certd/basic
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
### Bug Fixes
+1 -1
View File
@@ -1 +1 @@
02:08
23:59
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/basic",
"private": false,
"version": "1.38.4",
"version": "1.38.5",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -47,5 +47,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
}
+4
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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
**Note:** Version bump only for package @certd/pipeline
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
### Performance Improvements
+4 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.38.4",
"version": "1.38.5",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -18,8 +18,8 @@
"compile": "tsc --skipLibCheck --watch"
},
"dependencies": {
"@certd/basic": "^1.38.4",
"@certd/plus-core": "^1.38.4",
"@certd/basic": "^1.38.5",
"@certd/plus-core": "^1.38.5",
"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": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
}
+4
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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
**Note:** Version bump only for package @certd/lib-huawei
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
**Note:** Version bump only for package @certd/lib-huawei
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.38.4",
"version": "1.38.5",
"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": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
}
+4
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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
**Note:** Version bump only for package @certd/lib-iframe
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
**Note:** Version bump only for package @certd/lib-iframe
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.38.4",
"version": "1.38.5",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -31,5 +31,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
}
+4
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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
**Note:** Version bump only for package @certd/jdcloud
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
**Note:** Version bump only for package @certd/jdcloud
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/jdcloud",
"version": "1.38.4",
"version": "1.38.5",
"description": "jdcloud openApi sdk",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
@@ -56,5 +56,5 @@
"fetch"
]
},
"gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
}
+4
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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
**Note:** Version bump only for package @certd/lib-k8s
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
**Note:** Version bump only for package @certd/lib-k8s
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-k8s",
"private": false,
"version": "1.38.4",
"version": "1.38.5",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -17,7 +17,7 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/basic": "^1.38.4",
"@certd/basic": "^1.38.5",
"@kubernetes/client-node": "0.21.0"
},
"devDependencies": {
@@ -32,5 +32,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
}
+6
View File
@@ -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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
### Performance Improvements
* 支持绑定两个url地址 ([a2e9a41](https://github.com/certd/certd/commit/a2e9a41a7e712395c0e3ee6fe55b370aa1fc1f12))
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
**Note:** Version bump only for package @certd/lib-server
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/lib-server",
"version": "1.38.4",
"version": "1.38.5",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -28,11 +28,11 @@
],
"license": "AGPL",
"dependencies": {
"@certd/acme-client": "^1.38.4",
"@certd/basic": "^1.38.4",
"@certd/pipeline": "^1.38.4",
"@certd/plugin-lib": "^1.38.4",
"@certd/plus-core": "^1.38.4",
"@certd/acme-client": "^1.38.5",
"@certd/basic": "^1.38.5",
"@certd/pipeline": "^1.38.5",
"@certd/plugin-lib": "^1.38.5",
"@certd/plus-core": "^1.38.5",
"@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": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
}
@@ -20,6 +20,7 @@ export class PlusService {
const subjectId = installInfo.siteId;
const bindUrl = installInfo.bindUrl;
const bindUrl2 = installInfo.bindUrl2;
const installTime = installInfo.installTime;
const saveLicense = async (license: string) => {
let licenseInfo: SysLicenseInfo = await this.sysSettingsService.getSetting(SysLicenseInfo);
@@ -30,7 +31,7 @@ export class PlusService {
await this.sysSettingsService.saveSetting(licenseInfo);
};
return new PlusRequestService({ subjectId, bindUrl, installTime, saveLicense });
return new PlusRequestService({ subjectId, bindUrl, bindUrl2, installTime, saveLicense });
}
async getSubjectId() {
@@ -53,9 +54,9 @@ export class PlusService {
await plusRequestService.verify({ license: licenseInfo.license });
}
async bindUrl(url: string) {
async bindUrl(url: string, url2?:string) {
const plusRequestService = await this.getPlusRequestService();
const res = await plusRequestService.bindUrl(url);
const res = await plusRequestService.bindUrl(url,url2);
this.plusRequestService = null;
return res;
}
@@ -150,6 +151,12 @@ export class PlusService {
}
}
async getTodayOrderCount () {
await this.register();
const plusRequestService = await this.getPlusRequestService();
return await plusRequestService.getOrderCount()
}
async requestWithToken(config: HttpRequestConfig) {
const plusRequestService = await this.getPlusRequestService();
const token = await this.getAccessToken();
@@ -65,6 +65,8 @@ export class SysPublicSettings extends BaseSettings {
}> = {};
notice?: string;
adminMode?: "enterprise" | "saas" = "saas";
}
export class SysPrivateSettings extends BaseSettings {
@@ -107,6 +109,7 @@ export class SysInstallInfo extends BaseSettings {
siteId?: string;
bindUserId?: number;
bindUrl?: string;
bindUrl2?: string;
accountServerBaseUrl?: string;
appKey?: string;
}
@@ -21,6 +21,9 @@ export class AccessEntity {
@Column({ name: 'encrypt_setting', comment: '已加密设置', length: 10240, nullable: true })
encryptSetting: string;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -28,6 +28,9 @@ export class AddonEntity {
@Column({ name: 'is_default', comment: '是否默认', nullable: false, default: false })
isDefault: boolean;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
@@ -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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
**Note:** Version bump only for package @certd/midway-flyway-js
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.38.4",
"version": "1.38.5",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -46,5 +46,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
}
@@ -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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
**Note:** Version bump only for package @certd/plugin-cert
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
**Note:** Version bump only for package @certd/plugin-cert
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-cert",
"private": false,
"version": "1.38.4",
"version": "1.38.5",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -17,10 +17,10 @@
"compile": "tsc --skipLibCheck --watch"
},
"dependencies": {
"@certd/acme-client": "^1.38.4",
"@certd/basic": "^1.38.4",
"@certd/pipeline": "^1.38.4",
"@certd/plugin-lib": "^1.38.4",
"@certd/acme-client": "^1.38.5",
"@certd/basic": "^1.38.5",
"@certd/pipeline": "^1.38.5",
"@certd/plugin-lib": "^1.38.5",
"psl": "^1.9.0",
"punycode.js": "^2.3.1"
},
@@ -38,5 +38,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
}
+4
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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
**Note:** Version bump only for package @certd/plugin-lib
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
**Note:** Version bump only for package @certd/plugin-lib
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-lib",
"private": false,
"version": "1.38.4",
"version": "1.38.5",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -22,10 +22,10 @@
"@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.11",
"@aws-sdk/client-s3": "^3.964.0",
"@certd/acme-client": "^1.38.4",
"@certd/basic": "^1.38.4",
"@certd/pipeline": "^1.38.4",
"@certd/plus-core": "^1.38.4",
"@certd/acme-client": "^1.38.5",
"@certd/basic": "^1.38.5",
"@certd/pipeline": "^1.38.5",
"@certd/plus-core": "^1.38.5",
"@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5",
@@ -57,5 +57,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
}
+10
View File
@@ -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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
### Bug Fixes
* 某些情况下登陆页面没有显示重置密码文档链接的问题 ([40801d0](https://github.com/certd/certd/commit/40801d0a0668c77adb57fae42b4b6615b198a88d))
### Performance Improvements
* 支持绑定两个url地址 ([a2e9a41](https://github.com/certd/certd/commit/a2e9a41a7e712395c0e3ee6fe55b370aa1fc1f12))
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
### Bug Fixes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.38.4",
"version": "1.38.5",
"private": true,
"scripts": {
"dev": "vite --open",
@@ -106,8 +106,8 @@
"zod-defaults": "^0.1.3"
},
"devDependencies": {
"@certd/lib-iframe": "^1.38.4",
"@certd/pipeline": "^1.38.4",
"@certd/lib-iframe": "^1.38.5",
"@certd/pipeline": "^1.38.5",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",
+5 -1
View File
@@ -8,19 +8,23 @@
</template>
<script lang="ts" setup>
import { computed, provide, ref } from "vue";
import { computed, provide, Ref, ref } from "vue";
import { preferences, usePreferences } from "/@/vben/preferences";
import { useAntdDesignTokens } from "/@/vben/hooks";
import { Modal, theme } from "ant-design-vue";
import AConfigProvider from "ant-design-vue/es/config-provider";
import { antdvLocale } from "./locales/antdv";
import { setI18nLanguage } from "/@/locales";
import { mitter } from "./utils/util.mitt";
defineOptions({
name: "App",
});
const [modal, contextHolder] = Modal.useModal();
provide("modal", modal);
mitter.on("getModal", (event: any) => {
event.ModalRef = modal;
});
const locale = preferences.app.locale;
setI18nLanguage(locale);
@@ -15,3 +15,10 @@ export async function getVipTrial(vipType: string) {
data: { vipType },
});
}
export async function getTodayVipOrderCount() {
return await request({
url: "/sys/plus/getTodayVipOrderCount",
method: "post",
});
}
@@ -14,16 +14,20 @@
<script lang="tsx" setup>
import { message, Modal } from "ant-design-vue";
import dayjs from "dayjs";
import { computed, onMounted, reactive, ref } from "vue";
import { computed, onMounted, ref } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import * as api from "./api";
import { useSettingStore } from "/@/store/settings";
import { useSettingStore } from "/src/store/settings/index";
import { useUserStore } from "/@/store/user";
import { env } from "/@/utils/util.env";
import { mitter } from "/@/utils/util.mitt";
import VipModalContent from "./vip-modal-content.vue";
const { t } = useI18n();
defineOptions({
name: "VipButton",
});
const settingStore = useSettingStore();
const props = withDefaults(
defineProps<{
@@ -39,6 +43,7 @@ type Text = {
};
const text = computed<Text>(() => {
const vipLabel = settingStore.vipLabel;
const plusMessage = settingStore.plusInfo?.message;
const map = {
isComm: {
comm: {
@@ -91,7 +96,7 @@ const text = computed<Text>(() => {
},
nav: {
name: t("vip.free.nav.name"),
title: t("vip.free.nav.title"),
title: plusMessage || t("vip.free.nav.title"),
},
},
};
@@ -113,58 +118,16 @@ const expireTime = computed(() => {
const expiredDays = computed(() => {
if (settingStore.plusInfo?.isPlus && !settingStore.isPlus) {
//
const days = dayjs().diff(dayjs(settingStore.plusInfo.expireTime), "day");
return `${settingStore.vipLabel}已过期${days}`;
}
return "";
});
const formState = reactive({
code: "",
inviteCode: "",
});
const router = useRouter();
async function doActive() {
if (!formState.code) {
message.error(t("vip.enterCode"));
throw new Error(t("vip.enterCode"));
}
const res = await api.doActive(formState);
if (res) {
await settingStore.init();
const vipLabel = settingStore.vipLabel;
Modal.success({
title: t("vip.successTitle"),
content: t("vip.successContent", {
vipLabel,
expireDate: dayjs(settingStore.plusInfo.expireTime).format("YYYY-MM-DD"),
}),
onOk() {
if (!(settingStore.installInfo.bindUserId > 0)) {
Modal.confirm({
title: t("vip.bindAccountTitle"),
content: t("vip.bindAccountContent"),
onOk() {
router.push("/sys/account");
},
});
}
},
});
}
}
const computedSiteId = computed(() => settingStore.installInfo?.siteId);
const [modal, contextHolder] = Modal.useModal();
const userStore = useUserStore();
function goAccount() {
Modal.destroyAll();
router.push("/sys/account");
}
async function getVipTrial(vipType = "plus") {
const res = await api.getVipTrial(vipType);
message.success(t("vip.congratulations_vip_trial", { duration: res.duration }));
@@ -253,6 +216,7 @@ function openUpgrade() {
throw new Error(t("vip.already_perpetual_plus"));
}
}
function goBuyPlusPage() {
checkPerpetualPlus();
if (settingStore.isComm) {
@@ -264,6 +228,7 @@ function openUpgrade() {
}
window.open(goBuyUrl);
}
function goBuyCommPage() {
checkPerpetualPlus();
if (settingStore.isPlus && !settingStore.isComm) {
@@ -278,75 +243,6 @@ function openUpgrade() {
}
window.open(goBuyCommUrl);
}
const vipTypeDefine = {
free: {
title: t("vip.basic_edition"),
desc: t("vip.community_free_version"),
type: "free",
icon: "lucide:package-open",
privilege: [t("vip.unlimited_certificate_application"), t("vip.unlimited_domain_count"), t("vip.unlimited_certificate_pipelines"), t("vip.common_deployment_plugins"), t("vip.email_webhook_notifications")],
},
plus: {
title: t("vip.professional_edition"),
desc: t("vip.open_source_support"),
type: "plus",
privilege: [t("vip.vip_group_priority"), t("vip.unlimited_site_certificate_monitoring"), t("vip.more_notification_methods"), t("vip.plugins_fully_open")],
trial: {
title: t("vip.click_to_get_7_day_trial"),
click: () => {
openStarModal("plus");
},
},
icon: "stash:thumb-up",
priceText: productInfo.plus.priceText || `¥${productInfo.plus.price}/${t("vip.years")}`,
discountText: productInfo.plus.discountText || `¥${productInfo.plus.price3}/3${t("vip.years")}`,
tooltip: productInfo.plus.tooltip,
get() {
return (
<a-tooltip title={t("vip.afdian_support_vip")}>
<a-button size="small" type="primary" onClick={goBuyPlusPage}>
{t("vip.get_after_support")}
</a-button>
</a-tooltip>
);
},
},
comm: {
title: t("vip.business_edition"),
desc: t("vip.commercial_license"),
type: "comm",
icon: "vaadin:handshake",
privilege: [t("vip.all_pro_privileges"), t("vip.allow_commercial_use_modify_logo_title"), t("vip.data_statistics"), t("vip.plugin_management"), t("vip.unlimited_multi_users"), t("vip.support_user_payment")],
priceText: productInfo.comm.priceText || `¥${productInfo.comm.price}/${t("vip.years")}`,
discountText: productInfo.comm.discountText || `¥${productInfo.comm.price3}/3${t("vip.years")}`,
tooltip: productInfo.comm.tooltip,
trial: {
title: t("vip.click_to_get_7_day_trial"),
click: () => {
openStarModal("comm");
},
},
get() {
return (
<a-button size="small" type="primary" onClick={goBuyCommPage}>
{t("vip.buy")}
</a-button>
);
},
},
};
const manualActiveFlag = ref();
function showManualActivation() {
manualActiveFlag.value = true;
}
function goBindAccount() {
modalRef?.destroy();
router.push({
path: "/sys/account",
});
}
const modalRef = modal.success({
title,
class: "vip-modal",
@@ -354,119 +250,7 @@ function openUpgrade() {
okText: t("vip.close"),
width: 1100,
content: () => {
let manualActiveBlock: any = "";
if (manualActiveFlag.value) {
manualActiveBlock = (
<div>
<div class="mt-10">
<a-input-search class="w-2/6" v-model:value={formState.code} placeholder={placeholder} enter-button={t("vip.activate")} onSearch={doActive}></a-input-search>
</div>
<div class="mt-10">
{t("vip.activation_code_one_use")}
<a onClick={goAccount}>{t("vip.bind_account")}</a>{t("vip.transfer_vip")}
</div>
</div>
);
}
const vipLabel = settingStore.vipLabel;
let plusInfo: any = "";
if (isPlus) {
plusInfo = (
<div class="mt-10 flex flex-col md:flex-row ">
<span class="mr-2">
{t("vip.current")} {vipLabel} {t("vip.activated_expire_time")} {settingStore.expiresText}
</span>
<a href="https://app.handfree.work/subject/#/page/detail/1" target="_blank">
{t("vip.learn_more")}
</a>
</div>
);
}
const slots = [];
for (const key in vipTypeDefine) {
// @ts-ignore
const item = vipTypeDefine[key];
const vipBlockClass = `vip-block ${key === settingStore.plusInfo.vipType ? "current" : ""}`;
slots.push(
<div class="w-full md:w-1/3 mb-4 p-5">
<div class={vipBlockClass}>
<h3 class="block-header ">
<span class="flex-o">{item.title}</span>
{item.trial && (
<span class="trial">
<a-tooltip title={item.trial.message}>
<a onClick={item.trial.click}>{item.trial.title}</a>
</a-tooltip>
</span>
)}
</h3>
<div style="color:green" class="flex-o">
<fs-icon icon={item.icon} class="fs-16 flex-o" />
{item.desc}
</div>
<ul class="flex-1 privilege">
{item.privilege.map((p: string) => (
<li class="flex-baseline">
<fs-icon class="color-green" icon="ion:checkmark-sharp" />
{p}
</li>
))}
</ul>
<div class="footer flex-between flex-vc">
<div class="price-show">
{item.priceText && (
<span class="flex">
<span class="-text">{item.priceText}</span>
<a-tooltip class="ml-5" title={item.discountText}>
<fs-icon class="pointer color-red" icon="ic:outline-discount"></fs-icon>
</a-tooltip>
</span>
)}
{!item.priceText && (
<span>
<span class="price-text">{t("vip.freee")}</span>
</span>
)}
</div>
<div class="get-show">{item.get && <div>{item.get()}</div>}</div>
</div>
</div>
</div>
);
}
return (
<div class="mt-10 mb-10 vip-active-modal">
{productInfo.notice && (
<div class="mb-10">
<a-alert type="error" message={productInfo.notice}></a-alert>
</div>
)}
<div class="vip-type-vs">
<a-row gutter={20}>{slots}</a-row>
</div>
<div>
<a href="https://certd.docmirror.cn/guide/donate/#相关问题" target="_blank">
{t("vip.question")}
</a>
</div>
<div class="mt-10">
<div class=" w-100 flex-col md:flex-row ">
<span>{t("vip.site_id")}</span>
<fs-copyable v-model={computedSiteId.value} class="mr-2"></fs-copyable>
<a onClick={goBindAccount}>{t("vip.not_effective")}</a>
</div>
</div>
{plusInfo}
<div class="mt-10 ">
<span class="mr-2">{t("vip.have_activation_code")}</span>
<span>
<a onClick={showManualActivation}>{t("vip.manual_activation")}</a>
</span>
</div>
<div class="mt-10">{manualActiveBlock}</div>
</div>
);
return <VipModalContent placeholder={placeholder} isPlus={isPlus} productInfo={productInfo} goBuyPlusPage={goBuyPlusPage} goBuyCommPage={goBuyCommPage} openStarModal={openStarModal} modalRef={modalRef} />;
},
});
}
@@ -502,69 +286,4 @@ onMounted(() => {
.text {
}
}
.vip-active-modal {
.vip-block {
display: flex;
flex-direction: column;
padding: 10px;
border: 1px solid #eee;
border-radius: 5px;
height: 275px;
line-height: 24px;
.privilege {
margin-top: 5px;
}
//background-color: rgba(250, 237, 167, 0.79);
&.current {
border-color: green;
}
.block-header {
padding: 0px;
display: flex;
justify-content: space-between;
.trial {
font-size: 12px;
font-wight: 400;
}
}
.footer {
padding-top: 5px;
margin-top: 0px;
border-top: 1px solid #eee;
.price-text {
font-size: 18px;
color: red;
}
}
}
ul {
list-style-type: unset;
margin-left: 0px;
padding: 0;
}
.color-green {
color: green;
}
.vip-type-vs {
.privilege {
.fs-icon {
color: green;
}
}
.fs-icon {
margin-right: 5px;
}
}
}
</style>
@@ -0,0 +1,404 @@
<template>
<div class="mt-10 vip-active-modal">
<div v-if="todayOrderCount.enabled" class="order-count hidden md:flex">
<div v-for="(stage, index) in todayOrderCount.stages" :key="index" class="status-item" :class="{ 'status-show': TodayVipOrderCountRef.current === index }">
<div class="background">
<img :src="stage.bg" alt="" />
</div>
<div class="flex flex-col order-count-text weight-bold">
<div class="count-text ml-4 flex items-center">
<fs-icon icon="noto:fire" class="fs-20 mr-2"></fs-icon>
<span> 今日赞助 </span>
<span class="count-number color-red font-bold text-2xl ml-1 mr-1"> {{ stage.orderCount }} </span>
<span> {{ stage.title }} </span>
</div>
</div>
</div>
</div>
<div v-if="productInfo.notice" class="mt-10">
<a-alert type="error" :message="productInfo.notice"></a-alert>
</div>
<div class="vip-type-vs mt-10">
<a-row :gutter="20">
<div v-for="(item, key) in vipTypeDefine" :key="key" class="w-full md:w-1/3 mb-4 p-5">
<div :class="`vip-block ${key === settingStore.plusInfo.vipType ? 'current' : ''}`">
<h3 class="block-header">
<span class="flex-o">{{ item.title }}</span>
<span v-if="item.trial" class="trial">
<a-tooltip :title="item.trial.message">
<a @click="item.trial.click">{{ item.trial.title }}</a>
</a-tooltip>
</span>
</h3>
<div style="color: green" class="flex-o">
<fs-icon :icon="item.icon" class="fs-16 flex-o" />
{{ item.desc }}
</div>
<ul class="flex-1 privilege">
<li v-for="p in item.privilege" :key="p" class="flex-baseline">
<fs-icon class="color-green" icon="ion:checkmark-sharp" />
{{ p }}
</li>
</ul>
<div class="footer flex-between flex-vc">
<div class="price-show">
<span v-if="item.priceText" class="flex">
<span class="-text">{{ item.priceText }}</span>
<a-tooltip class="ml-5" :title="item.discountText">
<fs-icon class="pointer color-red" icon="ic:outline-discount"></fs-icon>
</a-tooltip>
</span>
<span v-else>
<span class="price-text">{{ t("vip.freee") }}</span>
</span>
</div>
<div class="get-show">
<template v-if="item.type === 'plus'">
<a-tooltip :title="t('vip.afdian_support_vip')">
<a-button size="small" type="primary" @click="goBuyPlusPage">
{{ t("vip.get_after_support") }}
</a-button>
</a-tooltip>
</template>
<template v-else-if="item.type === 'comm'">
<a-button size="small" type="primary" @click="goBuyCommPage">
{{ t("vip.buy") }}
</a-button>
</template>
</div>
</div>
</div>
</div>
</a-row>
</div>
<div>
<a href="https://certd.docmirror.cn/guide/donate/#相关问题" target="_blank">
{{ t("vip.question") }}
</a>
</div>
<div class="mt-10">
<div class="w-100 flex-col md:flex-row">
<span>{{ t("vip.site_id") }}</span>
<fs-copyable v-model="computedSiteId" class="mr-2"></fs-copyable>
<a @click="goBindAccount">{{ t("vip.not_effective") }}</a>
</div>
</div>
<div v-if="isPlus" class="mt-10 flex flex-col md:flex-row">
<span class="mr-2"> {{ t("vip.current") }} {{ vipLabel }} {{ t("vip.activated_expire_time") }} {{ settingStore.expiresText }} </span>
<a href="https://app.handfree.work/subject/#/page/detail/1" target="_blank">
{{ t("vip.learn_more") }}
</a>
</div>
<div class="mt-10">
<span class="mr-2">{{ t("vip.have_activation_code") }}</span>
<span>
<a @click="showManualActivation">{{ t("vip.manual_activation") }}</a>
</span>
</div>
<div v-if="manualActiveFlag" class="mt-10">
<div class="mt-10">
<a-input-search v-model:value="formState.code" class="w-2/6" :placeholder="placeholder" :enter-button="t('vip.activate')" @search="doActive"></a-input-search>
</div>
<div class="mt-10">
{{ t("vip.activation_code_one_use") }}
<a @click="goAccount">{{ t("vip.bind_account") }}</a
>{{ t("vip.transfer_vip") }}
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { computed, nextTick, onMounted, reactive, Ref, ref } from "vue";
import { message, Modal } from "ant-design-vue";
import dayjs from "dayjs";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { useSettingStore } from "/@/store/settings";
import * as api from "./api";
import { utils } from "/@/utils";
const { t } = useI18n();
const router = useRouter();
const settingStore = useSettingStore();
const props = defineProps<{
placeholder: string;
isPlus: boolean;
productInfo: any;
goBuyPlusPage: () => void;
goBuyCommPage: () => void;
openStarModal: (vipType: string) => void;
modalRef: any;
}>();
const formState = reactive({
code: "",
inviteCode: "",
});
async function doActive() {
if (!formState.code) {
message.error(t("vip.enterCode"));
throw new Error(t("vip.enterCode"));
}
const res = await api.doActive(formState);
if (res) {
await settingStore.init();
const vipLabel = settingStore.vipLabel;
Modal.success({
title: t("vip.successTitle"),
content: t("vip.successContent", {
vipLabel,
expireDate: dayjs(settingStore.plusInfo.expireTime).format("YYYY-MM-DD"),
}),
onOk() {
if (!(settingStore.installInfo.bindUserId > 0)) {
Modal.confirm({
title: t("vip.bindAccountTitle"),
content: t("vip.bindAccountContent"),
onOk() {
router.push("/sys/account");
},
});
}
},
});
}
}
const vipLabel = computed(() => settingStore.vipLabel);
const computedSiteId = computed(() => settingStore.installInfo?.siteId);
const manualActiveFlag = ref(false);
function showManualActivation() {
manualActiveFlag.value = true;
}
function goAccount() {
props.modalRef?.destroy();
router.push("/sys/account");
}
function goBindAccount() {
props.modalRef?.destroy();
router.push({
path: "/sys/account",
});
}
const vipTypeDefine: any = {
free: {
title: t("vip.basic_edition"),
desc: t("vip.community_free_version"),
type: "free",
icon: "lucide:package-open",
privilege: [t("vip.unlimited_certificate_application"), t("vip.unlimited_domain_count"), t("vip.unlimited_certificate_pipelines"), t("vip.common_deployment_plugins"), t("vip.email_webhook_notifications")],
},
plus: {
title: t("vip.professional_edition"),
desc: t("vip.open_source_support"),
type: "plus",
privilege: [t("vip.vip_group_priority"), t("vip.unlimited_site_certificate_monitoring"), t("vip.more_notification_methods"), t("vip.plugins_fully_open")],
trial: {
title: t("vip.click_to_get_7_day_trial"),
click: () => {
props.openStarModal("plus");
},
},
icon: "stash:thumb-up",
priceText: props.productInfo.plus.priceText || `¥${props.productInfo.plus.price}/${t("vip.years")}`,
discountText: props.productInfo.plus.discountText || `¥${props.productInfo.plus.price3}/3${t("vip.years")}`,
tooltip: props.productInfo.plus.tooltip,
},
comm: {
title: t("vip.business_edition"),
desc: t("vip.commercial_license"),
type: "comm",
icon: "vaadin:handshake",
privilege: [t("vip.all_pro_privileges"), t("vip.allow_commercial_use_modify_logo_title"), t("vip.data_statistics"), t("vip.plugin_management"), t("vip.unlimited_multi_users"), t("vip.support_user_payment")],
priceText: props.productInfo.comm.priceText || `¥${props.productInfo.comm.price}/${t("vip.years")}`,
discountText: props.productInfo.comm.discountText || `¥${props.productInfo.comm.price3}/3${t("vip.years")}`,
tooltip: props.productInfo.comm.tooltip,
trial: {
title: t("vip.click_to_get_7_day_trial"),
click: () => {
props.openStarModal("comm");
},
},
},
};
const TodayVipOrderCountRef: Ref = ref({});
async function getTodayVipOrderCount() {
const res = await api.getTodayVipOrderCount();
if (res) {
TodayVipOrderCountRef.value = res;
}
}
const todayOrderCount = computed(() => {
const countInfo = TodayVipOrderCountRef.value;
const enabled = countInfo?.enabled || false;
const orderCount = countInfo?.orderCount || 0;
for (const stage of countInfo?.stages) {
stage.orderCount = stage.countGe || 0;
}
const lastStage = countInfo?.stages?.[countInfo?.stages?.length - 1] || {};
lastStage.orderCount = orderCount;
return {
enabled: enabled,
orderCount: orderCount,
title: lastStage.title || "",
stages: countInfo?.stages,
};
});
async function scrollOrderCount() {
const stages = todayOrderCount.value.stages;
if (!stages.length) {
return;
}
let index = 0;
for (const stage of stages) {
TodayVipOrderCountRef.value.current = index;
await utils.sleep(500);
index++;
}
}
onMounted(async () => {
await getTodayVipOrderCount();
await scrollOrderCount();
});
</script>
<style lang="less">
.vip-active-modal {
.order-count {
height: 80px;
position: relative;
border: 1px solid #fee2c5;
border-radius: 5px;
.background {
border: 0px;
border-radius: 5px;
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 0;
display: flex;
justify-content: flex-end;
overflow: hidden;
img {
height: 100%;
object-fit: cover;
}
}
.order-count-text {
position: absolute;
width: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
padding: 10px;
display: flex;
flex-direction: column;
justify-content: space-evenly;
/* 左至右渐变*/
background: linear-gradient(to right, rgba(255, 217, 167, 0.5), rgba(255, 255, 255, 0));
.count-text {
font-size: 16px;
font-weight: 600;
color: #ff6600;
display: flex;
.count-number {
margin-bottom: 5px;
}
}
}
.status-item {
opacity: 0;
transition: all 0.7s ease-in-out;
}
.status-show {
opacity: 1;
}
}
.vip-block {
display: flex;
flex-direction: column;
padding: 10px;
border: 1px solid #eee;
border-radius: 5px;
height: 275px;
line-height: 24px;
.privilege {
margin-top: 5px;
}
&.current {
border-color: green;
}
.block-header {
padding: 0px;
display: flex;
justify-content: space-between;
.trial {
font-size: 12px;
font-wight: 400;
}
}
.footer {
padding-top: 5px;
margin-top: 0px;
border-top: 1px solid #eee;
.price-text {
font-size: 18px;
color: red;
}
}
}
ul {
list-style-type: unset;
margin-left: 0px;
padding: 0;
}
.color-green {
color: green;
}
.vip-type-vs {
.privilege {
.fs-icon {
color: green;
}
}
.fs-icon {
margin-right: 5px;
}
}
}
</style>
@@ -861,4 +861,8 @@ export default {
select: "Select",
placeholder: "select please",
},
adminMode: {
enterpriseMode: "Enterprise Mode",
saasMode: "SaaS Mode",
},
};
@@ -120,7 +120,7 @@ export default {
},
customPipeline: "自定义流水线",
createCertdPipeline: "创建证书流水线",
commercialCertHosting: "商用证书托管",
commercialCertHosting: "已有证书托管",
tooltip: {
manualUploadOwnCert: "手动上传自有证书,执行自动部署",
noAutoApplyCommercialCert: "并不能自动申请商业证书",
@@ -876,4 +876,8 @@ export default {
select: "选择",
placeholder: "请选择",
},
adminMode: {
enterpriseMode: "企业模式",
saasMode: "SaaS模式",
},
};
@@ -27,6 +27,7 @@ export type PlusInfo = {
expireTime?: number;
isPlus: boolean;
isComm?: boolean;
message?: string;
};
export type SysPublicSetting = {
registerEnabled?: boolean;
@@ -85,6 +86,9 @@ export type SysPublicSetting = {
>;
// 系统通知
notice?: string;
// 管理员模式
adminMode?: "enterprise" | "saas";
};
export type SuiteSetting = {
enabled?: boolean;
@@ -107,6 +111,8 @@ export type SysPrivateSetting = {
};
export type SysInstallInfo = {
siteId: string;
bindUrl?: string;
bindUrl2?: string;
};
export type MenuItem = {
id: string;
@@ -1,5 +1,5 @@
import { defineStore } from "pinia";
import { Modal, notification } from "ant-design-vue";
import { notification } from "ant-design-vue";
import * as basicApi from "./api.basic";
import { AppInfo, HeaderMenus, PlusInfo, SiteEnv, SiteInfo, SuiteSetting, SysInstallInfo, SysPublicSetting } from "./api.basic";
import { useUserStore } from "../user";
@@ -20,6 +20,7 @@ export interface SettingState {
installTime?: number;
bindUserId?: number;
bindUrl?: string;
bindUrl2?: string;
accountServerBaseUrl?: string;
appKey?: string;
};
@@ -153,9 +154,11 @@ export const useSettingStore = defineStore({
if (this.plusInfo?.expireTime === -1) {
return "永久";
}
//@ts-ignore
return dayjs(this.plusInfo?.expireTime).format("YYYY-MM-DD");
},
isForever() {
//@ts-ignore
return this.isPlus && this.plusInfo?.expireTime === -1;
},
vipLabel(): string {
@@ -251,9 +254,17 @@ export const useSettingStore = defineStore({
url = url.split("#")[0];
return url;
},
async doBindUrl() {
const url = this.getBaseUrl();
await basicApi.bindUrl({ url });
async doBindUrl(key: string = "url") {
const url = this.installInfo.bindUrl;
const url2 = this.installInfo.bindUrl2;
const thisUrl = this.getBaseUrl();
const form = {
url,
url2,
[key]: thisUrl,
};
await basicApi.bindUrl(form);
await this.loadSysSettings();
},
async checkUrlBound() {
@@ -262,24 +273,64 @@ export const useSettingStore = defineStore({
if (!userStore.isAdmin) {
return;
}
const event: any = { ModalRef: null };
mitter.emit("getModal", event);
const Modal = event.ModalRef;
let modalRef: any = null;
const bindUrl = this.installInfo.bindUrl;
const bindUrl2 = this.installInfo.bindUrl2;
const doBindRequest = async (key: string) => {
await this.doBindUrl(key);
if (modalRef) {
modalRef.destroy();
}
};
if (!bindUrl) {
//绑定url
await this.doBindUrl();
await this.doBindUrl("url");
} else {
//检查当前url 是否与绑定的url一致
const url = window.location.href;
if (!url.startsWith(bindUrl)) {
Modal.confirm({
title: "URL地址有变化",
content: "以后都用这个新地址访问本系统吗?",
onOk: async () => {
await this.doBindUrl();
if (!url.startsWith(bindUrl) && !url.startsWith(bindUrl2)) {
modalRef = Modal.warning({
title: "URL地址未绑定,是否绑定此地址?",
width: 500,
keyboard: false,
content: () => {
return (
<div class="p-4">
<div class="flex items-center justify-between">
<span>
1
<a-tag color="green">{bindUrl || "未占用"}</a-tag>
</span>
<a-button type="primary" onClick={() => doBindRequest("url")}>
1
</a-button>
</div>
<div class="flex items-center justify-between mt-3">
<span>
2
<a-tag color="green">{bindUrl2 || "未占用"}</a-tag>
</span>
<a-button type="primary" onClick={() => doBindRequest("url2")}>
2
</a-button>
</div>
</div>
);
},
okText: "是的,继续",
cancelText: "不是,回到原来的地址",
onOk: async () => {
// await this.doBindUrl();
window.location.href = bindUrl;
},
okButtonProps: {
danger: true,
},
okText: "不,回到原来的地址",
cancelText: "不,回到原来的地址",
onCancel: () => {
window.location.href = bindUrl;
},
+16 -1
View File
@@ -320,10 +320,25 @@ h6 {
font-size: 16px !important;
}
.fs-18 {
font-size: 18px !important;
}
.fs-20 {
font-size: 20px !important;
}
.fs-24 {
font-size: 24px !important;
}
.fs-26 {
font-size: 26px !important;
}
.fs-28 {
font-size: 28px !important;
}
.fs-32 {
font-size: 32px !important;
}
.w-50\% {
width: 50%;
}
@@ -76,7 +76,7 @@
<a-button type="primary" size="large" html-type="submit" class="submit-button"> 找回密码</a-button>
<div class="mt-2 flex-between">
<a v-comm="false" href="https://certd.docmirror.cn/guide/use/forgotpasswd/" target="_blank"> 管理员无绑定通信方式或MFA丢失找回 </a>
<a v-comm="false" href="https://certd.docmirror.cn/guide/use/forgotpasswd/" target="_blank"> 管理员忘记密码 </a>
<router-link :to="{ name: 'login' }"> 返回登录 </router-link>
</div>
@@ -59,6 +59,9 @@
<router-link v-if="!!settingStore.sysPublic.selfServicePasswordRetrievalEnabled && !queryBindCode" :to="{ name: 'forgotPassword' }">
{{ t("authentication.forgotPassword") }}
</router-link>
<a v-else v-comm="false" href="https://certd.docmirror.cn/guide/use/forgotpasswd/" target="_blank">
{{ t("authentication.forgotPassword") }}
</a>
</div>
<router-link v-if="hasRegisterTypeEnabled() && !queryBindCode" class="register" :to="{ name: 'register' }">
@@ -26,6 +26,9 @@
<a-tab-pane key="pipeline" :tab="t('certd.sys.setting.pipelineSetting')">
<SettingPipeline v-if="activeKey === 'pipeline'" />
</a-tab-pane>
<a-tab-pane key="mode" :tab="t('certd.adminMode')">
<SettingMode v-if="activeKey === 'mode'" />
</a-tab-pane>
</a-tabs>
</div>
</fs-page>
@@ -39,6 +42,8 @@ import SettingSafe from "/@/views/sys/settings/tabs/safe.vue";
import SettingCaptcha from "/@/views/sys/settings/tabs/captcha.vue";
import SettingPipeline from "/@/views/sys/settings/tabs/pipeline.vue";
import SettingOauth from "/@/views/sys/settings/tabs/oauth.vue";
import SettingMode from "/@/views/sys/settings/tabs/mode.vue";
import { useRoute, useRouter } from "vue-router";
import { ref } from "vue";
import { useSettingStore } from "/@/store/settings";
@@ -34,7 +34,9 @@
<a-select-option value="ipv4first">{{ t("certd.ipv4Priority") }}</a-select-option>
<a-select-option value="ipv6first">{{ t("certd.ipv6Priority") }}</a-select-option>
</a-select>
<div class="helper">{{ t("certd.dualStackNetworkHelper") }}, <a href="https://certd.docmirror.cn/guide/use/setting/ipv6.html" target="_blank">{{ t("certd.helpDocLink") }}</a></div>
<div class="helper">
{{ t("certd.dualStackNetworkHelper") }}, <a href="https://certd.docmirror.cn/guide/use/setting/ipv6.html" target="_blank">{{ t("certd.helpDocLink") }}</a>
</div>
</a-form-item>
<a-form-item :label="t('certd.sys.setting.showRunStrategy')" :name="['public', 'showRunStrategy']">
@@ -68,8 +70,6 @@ import { useSettingStore } from "/@/store/settings";
import { notification } from "ant-design-vue";
import { util } from "/@/utils";
import { useI18n } from "/src/locales";
import AddonSelector from "../../../certd/addon/addon-selector/index.vue";
import CaptchaInput from "/@/components/captcha/captcha-input.vue";
const { t } = useI18n();
defineOptions({
@@ -0,0 +1,67 @@
<template>
<div class="sys-settings-form sys-settings-mode">
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish">
<a-form-item :label="t('certd.adminMode')" :name="['public', 'adminMode']">
<fs-dict-radio v-model:checked="formState.public.adminMode" :dict="adminModeDict" />
</a-form-item>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 8 }">
<a-button :loading="saveLoading" type="primary" html-type="submit">{{ t("certd.saveButton") }}</a-button>
</a-form-item>
</a-form>
</div>
</template>
<script setup lang="tsx">
import { reactive, ref } from "vue";
import { SysSettings } from "/@/views/sys/settings/api";
import * as api from "/@/views/sys/settings/api";
import { merge } from "lodash-es";
import { useSettingStore } from "/@/store/settings";
import { notification } from "ant-design-vue";
import { useI18n } from "/src/locales";
const { t } = useI18n();
defineOptions({
name: "SettingMode",
});
const adminModeDict = [
{
label: t("certd.adminMode.enterpriseMode"),
value: "enterprise",
},
{
label: t("certd.adminMode.saasMode"),
value: "saas",
},
];
const formState = reactive<Partial<SysSettings>>({
public: {},
private: {},
});
async function loadSysSettings() {
const data: any = await api.SysSettingsGet();
merge(formState, data);
}
const saveLoading = ref(false);
loadSysSettings();
const settingsStore = useSettingStore();
const onFinish = async (form: any) => {
try {
saveLoading.value = true;
await api.SysSettingsSave(form);
await settingsStore.loadSysSettings();
notification.success({
message: t("certd.saveSuccess"),
});
} finally {
saveLoading.value = false;
}
};
</script>
<style lang="less"></style>
+13
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.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
### Bug Fixes
* 阿里云esa查询证书限制接口无效,改成配置证书数量上限检查方式进行清理 ([2302567](https://github.com/certd/certd/commit/230256793f8ad87ef8a0738c37108bf7b5ab9853))
* 修复部署到火山引擎vod,获取域名列表为空的bug ([0719f4c](https://github.com/certd/certd/commit/0719f4c99e9198544d03431107b53652e076e881))
* 修复oidc配置取消后获取登出地址失败后无法列出oauth列表的bug ([eb5de15](https://github.com/certd/certd/commit/eb5de150332fd914c56b812c3ba2c2445f902bb7))
### Performance Improvements
* 将重置密码的日志挪到启动成功之后,方便查看 ([0fa9b34](https://github.com/certd/certd/commit/0fa9b344e08cf355aee7a7566f061cc5d95dc374))
* 支持绑定两个url地址 ([a2e9a41](https://github.com/certd/certd/commit/a2e9a41a7e712395c0e3ee6fe55b370aa1fc1f12))
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
### Bug Fixes
@@ -0,0 +1,53 @@
CREATE TABLE "cd_project"
(
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
"user_id" integer NOT NULL,
"name" varchar(512) NOT NULL,
"disabled" boolean NOT NULL DEFAULT (false),
"create_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"update_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP)
);
CREATE INDEX "index_project_user_id" ON "cd_project" ("user_id");
INSERT INTO cd_project (id, user_id, "name", "disabled") VALUES (1, 0, 'default', false);
ALTER TABLE cd_cert_info ADD COLUMN project_id integer;
CREATE INDEX "index_cert_project_id" ON "cd_cert_info" ("project_id");
ALTER TABLE cd_site_info ADD COLUMN project_id integer;
CREATE INDEX "index_site_project_id" ON "cd_site_info" ("project_id");
ALTER TABLE cd_site_ip ADD COLUMN project_id integer;
CREATE INDEX "index_site_ip_project_id" ON "cd_site_ip" ("project_id");
ALTER TABLE cd_open_key ADD COLUMN project_id integer;
CREATE INDEX "index_open_key_project_id" ON "cd_open_key" ("project_id");
ALTER TABLE cd_access ADD COLUMN project_id integer;
CREATE INDEX "index_access_project_id" ON "cd_access" ("project_id");
ALTER TABLE cd_addon ADD COLUMN project_id integer;
CREATE INDEX "index_addon_project_id" ON "cd_addon" ("project_id");
ALTER TABLE pi_pipeline ADD COLUMN project_id integer;
CREATE INDEX "index_pipeline_project_id" ON "cd_pipeline" ("project_id");
ALTER TABLE pi_pipeline_group ADD COLUMN project_id integer;
CREATE INDEX "index_pipeline_group_project_id" ON "cd_pipeline_group" ("project_id");
ALTER TABLE pi_storage ADD COLUMN project_id integer;
CREATE INDEX "index_storage_project_id" ON "cd_storage" ("project_id");
ALTER TABLE pi_notification ADD COLUMN project_id integer;
CREATE INDEX "index_notification_project_id" ON "cd_notification" ("project_id");
ALTER TABLE pi_history ADD COLUMN project_id integer;
CREATE INDEX "index_history_project_id" ON "cd_history" ("project_id");
ALTER TABLE pi_history_log ADD COLUMN project_id integer;
CREATE INDEX "index_history_log_project_id" ON "cd_history_log" ("project_id");
@@ -98,13 +98,13 @@ input:
helper: 请选择要部署证书的站点
order: 0
isFree:
title: 是否免费版
value: true
certLimit:
title: 免费证书数量限制
value: 2
component:
name: a-switch
name: a-input-number
vModel: value
helper: 如果是免费站点,将检查证书数量限制,如果超限将删除最旧的那张证书
helper: 将检查证书数量限制,如果超限将删除最旧的那张证书
required: true
order: 0
output: {}
@@ -4,7 +4,7 @@ default:
runStrategy: 0
name: CertApplyUpload
icon: ph:certificate
title: 商用证书托管
title: 已有证书托管
group: cert
desc: 手动上传自定义证书后,自动部署(每次证书有更新,都需要手动上传一次)
shortcut:
+14 -14
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/ui-server",
"version": "1.38.4",
"version": "1.38.5",
"description": "fast-server base midway",
"private": true,
"type": "module",
@@ -48,20 +48,20 @@
"@aws-sdk/client-iam": "^3.964.0",
"@aws-sdk/client-route-53": "^3.964.0",
"@aws-sdk/client-s3": "^3.964.0",
"@certd/acme-client": "^1.38.4",
"@certd/basic": "^1.38.4",
"@certd/commercial-core": "^1.38.4",
"@certd/acme-client": "^1.38.5",
"@certd/basic": "^1.38.5",
"@certd/commercial-core": "^1.38.5",
"@certd/cv4pve-api-javascript": "^8.4.2",
"@certd/jdcloud": "^1.38.4",
"@certd/lib-huawei": "^1.38.4",
"@certd/lib-k8s": "^1.38.4",
"@certd/lib-server": "^1.38.4",
"@certd/midway-flyway-js": "^1.38.4",
"@certd/pipeline": "^1.38.4",
"@certd/plugin-cert": "^1.38.4",
"@certd/plugin-lib": "^1.38.4",
"@certd/plugin-plus": "^1.38.4",
"@certd/plus-core": "^1.38.4",
"@certd/jdcloud": "^1.38.5",
"@certd/lib-huawei": "^1.38.5",
"@certd/lib-k8s": "^1.38.5",
"@certd/lib-server": "^1.38.5",
"@certd/midway-flyway-js": "^1.38.5",
"@certd/pipeline": "^1.38.5",
"@certd/plugin-cert": "^1.38.5",
"@certd/plugin-lib": "^1.38.5",
"@certd/plugin-plus": "^1.38.5",
"@certd/plus-core": "^1.38.5",
"@google-cloud/publicca": "^1.3.0",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.185",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.185",
@@ -22,14 +22,13 @@ export class SysPlusController extends BaseController {
return this.ok(true);
}
@Post('/bindUrl', { summary: 'sys:settings:edit' })
async bindUrl(@Body(ALL) body: { url: string }) {
const { url } = body;
async bindUrl(@Body(ALL) body: { url: string ,url2?:string }) {
const { url,url2 } = body;
await this.plusService.register();
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
await this.plusService.bindUrl(url);
await this.plusService.bindUrl(url,url2);
installInfo.bindUrl = url;
installInfo.bindUrl2 = url2;
await this.sysSettingsService.saveSetting(installInfo);
//重新验证vip
@@ -48,6 +47,11 @@ export class SysPlusController extends BaseController {
const res = await this.plusService.getVipTrial(vipType);
return this.ok(res);
}
@Post('/getTodayVipOrderCount', { summary: 'sys:settings:edit' })
async getTodayVipOrderCount() {
const res = await this.plusService.getTodayOrderCount();
return this.ok(res);
}
//
// @Get('/test', { summary: Constants.per.guest })
// async test() {
@@ -1,9 +1,8 @@
import { CommonException, SysSettingsService } from "@certd/lib-server";
import { Autoload, Config, Init, Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { IMidwayKoaContext, IWebMiddleware, NextFunction } from '@midwayjs/koa';
import { CommonException, SysSettingsService } from "@certd/lib-server";
import { UserSettingsService } from "../../modules/mine/service/user-settings-service.js";
import { UserService } from '../../modules/sys/authority/service/user-service.js';
import { logger } from '@certd/basic';
import {UserSettingsService} from "../../modules/mine/service/user-settings-service.js";
/**
*
@@ -33,21 +32,6 @@ export class ResetPasswdMiddleware implements IWebMiddleware {
@Init()
async init() {
if (this.resetAdminPasswd === true) {
logger.info('开始重置1号管理员用户的密码');
const newPasswd = '123456';
await this.userService.resetPassword(1, newPasswd);
await this.userService.updateStatus(1, 1);
await this.userSettingsService.deleteWhere({
userId: 1,
key:"user.two.factor"
})
const publicSettings = await this.sysSettingsService.getPublicSettings()
publicSettings.captchaEnabled = false
await this.sysSettingsService.savePublicSettings(publicSettings);
const user = await this.userService.info(1);
logger.info(`重置1号管理员用户的密码完成,2FA设置已删除,验证码登录已禁用,用户名:${user.username},新密码:${newPasswd},请在登录进去之后尽快修改密码`);
}
}
}
@@ -7,6 +7,9 @@ import { getVersion } from '../../utils/version.js';
import dayjs from 'dayjs';
import { Application } from '@midwayjs/koa';
import { httpsServer, HttpsServerOptions } from './https/server.js';
import { UserService } from '../sys/authority/service/user-service.js';
import { UserSettingsService } from '../mine/service/user-settings-service.js';
import { startProxyServer } from './proxy/server.js';
@Autoload()
@Scope(ScopeEnum.Request, { allowDowngrade: true })
@@ -22,10 +25,20 @@ export class AutoZPrint {
@Config('koa')
koaConfig: any;
@Inject()
userService: UserService;
@Inject()
userSettingsService: UserSettingsService;
@Config('system.resetAdminPasswd')
private resetAdminPasswd: boolean;
@Init()
async init() {
//监听https
this.startHttpsServer();
// this.startProxyServer();
logger.info("ENV:", process.env.NODE_ENV);
if (isDev()) {
this.startHeapLog();
@@ -41,6 +54,26 @@ export class AutoZPrint {
}
logger.info('Certd已启动');
logger.info('=========================================');
await this.resetPasswd();
}
async resetPasswd(){
if (this.resetAdminPasswd === true) {
logger.info('开始重置1号管理员用户的密码');
const newPasswd = '123456';
await this.userService.resetPassword(1, newPasswd);
await this.userService.updateStatus(1, 1);
await this.userSettingsService.deleteWhere({
userId: 1,
key:"user.two.factor"
})
const publicSettings = await this.sysSettingsService.getPublicSettings()
publicSettings.captchaEnabled = false
await this.sysSettingsService.savePublicSettings(publicSettings);
const user = await this.userService.info(1);
logger.info(`重置1号管理员用户的密码完成,2FA设置已删除,验证码登录已禁用,用户名:${user.username},新密码:${newPasswd},请在登录进去之后尽快修改密码`);
}
}
startHeapLog() {
@@ -66,4 +99,8 @@ export class AutoZPrint {
hostname: this.httpsConfig.hostname || this.koaConfig.hostname,
});
}
startProxyServer() {
startProxyServer({port: 7003});
}
}
@@ -0,0 +1,88 @@
// proxy-server.js
import http from 'http';
import https from 'https';
import url from 'url';
import net from 'net';
import { logger } from '@certd/basic';
export function startProxyServer(opts:{port:number}) {
const {port} = opts;
// 创建 HTTP 代理服务器
const proxyServer = http.createServer((clientReq, clientRes) => {
logger.log(`[proxy] 收到请求: ${clientReq.method} ${clientReq.url}`);
// 解析请求的 URL
const parsedUrl = url.parse(clientReq.url);
const options = {
hostname: parsedUrl.hostname,
port: parsedUrl.port || (parsedUrl.protocol === 'https:' ? 443 : 80),
path: parsedUrl.path,
method: clientReq.method,
headers: clientReq.headers
};
// 根据协议选择不同的模块
const protocol = parsedUrl.protocol === 'https:' ? https : http;
// 移除可能会引起问题的 headers
delete options.headers['proxy-connection'];
delete options.headers['connection'];
delete options.headers['keep-alive'];
// 创建到目标服务器的请求
const proxyReq = protocol.request(options, (proxyRes) => {
// 将目标服务器的响应返回给客户端
clientRes.writeHead(proxyRes.statusCode, proxyRes.headers);
proxyRes.pipe(clientRes);
});
proxyReq.on('error', (err) => {
logger.error('[proxy] 代理请求错误:', err);
clientRes.writeHead(500);
clientRes.end('代理服务器错误');
});
// 将客户端请求体转发到目标服务器
clientReq.pipe(proxyReq);
});
// 处理 CONNECT 方法(HTTPS 代理)
proxyServer.on('connect', (req, clientSocket, head) => {
logger.log(`[proxy] HTTPS 连接请求: ${req.url}`);
const [hostname, port] = req.url.split(':');
const portNum = parseInt(port) || 443;
// 连接到目标服务器
const serverSocket = net.connect(portNum, hostname, () => {
// 告诉客户端连接已建立
clientSocket.write('HTTP/1.1 200 Connection Established\r\n' +
'Proxy-agent: Node.js-Proxy\r\n' +
'\r\n');
// 建立双向数据流
serverSocket.write(head);
serverSocket.pipe(clientSocket);
clientSocket.pipe(serverSocket);
});
serverSocket.on('error', (err) => {
logger.error('[proxy] HTTPS 代理错误:', err);
clientSocket.end();
});
clientSocket.on('error', (err) => {
logger.error('[proxy] 客户端 socket 错误:', err);
serverSocket.end();
});
});
// 监听端口
proxyServer.listen(port, () => {
logger.info(`[proxy] 正向代理服务器运行在 http://0.0.0.0:${port}`);
});
return proxyServer
}
@@ -42,6 +42,9 @@ export class CertInfoEntity {
@Column({ name: 'cert_file', comment: '证书下载' })
certFile: string;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -71,6 +71,9 @@ export class SiteInfoEntity {
@Column({ name: 'group_id', comment: '分组id' })
groupId: number;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({ name: 'create_time', comment: '创建时间', default: () => 'CURRENT_TIMESTAMP' })
createTime: Date;
@Column({ name: 'update_time', comment: '修改时间', default: () => 'CURRENT_TIMESTAMP' })
@@ -33,6 +33,8 @@ export class SiteIpEntity {
remark: string;
@Column({ name: "disabled", comment: "禁用启用" })
disabled: boolean;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({ name: 'create_time', comment: '创建时间', default: () => 'CURRENT_TIMESTAMP' })
createTime: Date;
@@ -17,6 +17,9 @@ export class OpenKeyEntity {
@Column({ name: 'scope', comment: '权限范围' })
scope: string; // open 仅开放接口、 user 用户所有权限
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({ name: 'create_time', comment: '创建时间', default: () => 'CURRENT_TIMESTAMP' })
createTime: Date;
@@ -25,6 +25,9 @@ export class HistoryLogEntity {
@Column({ comment: '日志内容', length: 40960, nullable: true })
logs: string;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -26,6 +26,9 @@ export class HistoryEntity {
})
endTime: Date;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -38,6 +41,7 @@ export class HistoryEntity {
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
pipelineTitle: string;
@@ -20,6 +20,9 @@ export class NotificationEntity {
@Column({ name: 'is_default', comment: '是否默认' })
isDefault: boolean;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -17,6 +17,9 @@ export class PipelineGroupEntity {
@Column({ name: 'favorite', comment: '收藏' })
favorite: boolean;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -61,6 +61,9 @@ export class PipelineEntity {
@Column({name: 'order', comment: '排序', nullable: true,})
order: number;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({name: 'create_time',comment: '创建时间', default: () => 'CURRENT_TIMESTAMP',})
createTime: Date;
@Column({
@@ -23,6 +23,9 @@ export class StorageEntity {
@Column({ comment: 'value', length: 40960, nullable: true })
value: string;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -39,6 +39,9 @@ export class TemplateEntity {
})
order: number;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -0,0 +1,43 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
/**
*/
@Entity('cd_audit_log')
export class AuditLogEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: 'UserId' })
userId: number;
@Column({ name: 'user_name', comment: '用户名' })
userName: string;
@Column({ name: 'project_id', comment: 'ProjectId' })
projectId: number;
@Column({ name: 'project_name', comment: '项目名称' })
projectName: string;
@Column({ name: 'action', comment: '操作' })
action: string;
@Column({ name: 'content', comment: '内容' })
content: string;
@Column({ name: 'ip_address', comment: 'IP地址' })
ipAddress: string;
@Column({
name: 'create_time',
comment: '创建时间',
default: () => 'CURRENT_TIMESTAMP',
})
createTime: Date;
@Column({
name: 'update_time',
comment: '修改时间',
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
}
@@ -0,0 +1,31 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
/**
*/
@Entity('cd_project_user')
export class ProjectUserEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: 'UserId' })
userId: number;
@Column({ name: 'project_id', comment: 'ProjectId' })
projectId: number;
@Column({ name: 'permission', comment: '权限' })
permission: string; // read / write
@Column({
name: 'create_time',
comment: '创建时间',
default: () => 'CURRENT_TIMESTAMP',
})
createTime: Date;
@Column({
name: 'update_time',
comment: '修改时间',
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
}
@@ -0,0 +1,31 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
/**
*/
@Entity('cd_project')
export class ProjectEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: 'UserId' })
userId: number;
@Column({ name: 'name', comment: '项目名称' })
name: string;
@Column({ name: 'disabled', comment: '禁用' })
disabled: boolean;
@Column({
name: 'create_time',
comment: '创建时间',
default: () => 'CURRENT_TIMESTAMP',
})
createTime: Date;
@Column({
name: 'update_time',
comment: '修改时间',
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
}
@@ -91,17 +91,17 @@ export class AliyunDeployCertToESA extends AbstractTaskPlugin {
siteIds!: string[];
@TaskInput({
title: "是否免费版",
value: true,
title: "免费证书数量限制",
value: 2,
component: {
name: "a-switch",
name: "a-input-number",
vModel: "value"
},
helper: "如果是免费站点,将检查证书数量限制,如果超限将删除最旧的那张证书",
helper: "将检查证书数量限制,如果超限将删除最旧的那张证书",
required: true
})
isFree: boolean;
certLimit: number = 2;
async onInstance() {
@@ -141,9 +141,7 @@ export class AliyunDeployCertToESA extends AbstractTaskPlugin {
const { certId, certName } = await this.getAliyunCertId(access);
for (const siteId of this.siteIds) {
if (this.isFree) {
await this.clearSiteLimitCert(client, siteId);
}
await this.clearSiteLimitCert(client, siteId);
try {
const res = await client.doRequest({
// 接口名称
@@ -254,25 +252,10 @@ export class AliyunDeployCertToESA extends AbstractTaskPlugin {
async clearSiteLimitCert(client: AliyunClientV2, siteId: string) {
const res = await client.doRequest({
action: "GetCertificateQuota",
version: "2024-09-10",
method: "GET",
data: {
query: {
SiteId: siteId,
Type: "free"
}
}
});
this.logger.info(`站点[${siteId}]证书限制情况, 限制${res.Quota} ,已使用${res.QuotaUsage}`);
if (res.QuotaUsage < res.Quota) {
this.logger.info(`站点[${siteId}]证书未超限制, 无需删除`);
return;
}
//删除最旧的证书
this.logger.info(`站点[${siteId}]证书已超限制, 开始删除最旧的证书`);
const certLimit = this.certLimit || 2;
this.logger.info(`站点[${siteId}]证书数量检查,当前限制${certLimit}`);
const certListRes = await client.doRequest({
action: "ListCertificates",
version: "2024-09-10",
@@ -290,6 +273,12 @@ export class AliyunDeployCertToESA extends AbstractTaskPlugin {
this.logger.info(`站点[${siteId}]没有证书, 无需删除`);
return
}
if (list.length < certLimit) {
this.logger.info(`站点[${siteId}]证书数量(${list.length})未超限制, 无需删除`);
return;
}
this.logger.info(`站点[${siteId}]证书数量(${list.length})已超限制, 开始删除最旧的证书`);
let oldly:any = null;
for (const item of list) {
if (!oldly) {
@@ -308,12 +297,11 @@ export class AliyunDeployCertToESA extends AbstractTaskPlugin {
data: {
query: {
SiteId: siteId,
Id: oldly.id
Id: oldly.Id
}
}
});
this.logger.info(`最旧证书${oldly.Name}已删除`);
}
}
@@ -6,7 +6,7 @@ import dayjs from "dayjs";
@IsTaskPlugin({
name: "CertApplyUpload",
icon: "ph:certificate",
title: "商用证书托管",
title: "已有证书托管",
group: pluginGroups.cert.key,
desc: "手动上传自定义证书后,自动部署(每次证书有更新,都需要手动上传一次)",
default: {
@@ -135,10 +135,17 @@ export class OidcOauthProvider extends BaseAddon implements IOauthProvider {
};
async buildLogoutUrl(params: BuildLogoutUrlReq) {
const { config } = await this.getClient()
let logoutUrl = config.serverMetadata().end_session_endpoint
return {
logoutUrl: logoutUrl,
};
try{
const { config } = await this.getClient()
let logoutUrl = config.serverMetadata().end_session_endpoint
return {
logoutUrl: logoutUrl,
};
}catch(err){
this.logger.error(`获取注销地址失败: ${err}`)
return {
logoutUrl: "",
};
}
}
}
@@ -174,7 +174,7 @@ export class VolcengineDeployToVOD extends AbstractTaskPlugin {
action: "ListDomain",
body: {
SpaceName: this.spaceName,
Offset: 100
// Offset: 100
}
});
@@ -44,7 +44,7 @@ export class XinnetAccess extends BaseAccess {
name: "api-test",
action: "TestRequest"
},
helper: "点击测试接口是否正常"
helper: "测试前请务必先在新网后台关闭异地登录保护、关闭动态口令验证\n如果提示需要短信验证码,请等几个小时后再试"
})
testRequest = true;
@@ -57,7 +57,19 @@ export class XinnetProvider extends AbstractDnsProvider<XinnetRecord> {
if (!res.list || res.list.length == 0) {
throw new Error("域名不存在");
}
const serviceCode = res.list[0].serviceCode;
let list = res.list.map((item) => ({
domainName: item.domainName,
serviceCode: item.serviceCode
}));
this.logger.info("域名列表:", JSON.stringify(list));
const domainItem = list.find((item) => item.domainName === domain);
if (!domainItem) {
throw new Error("域名(" + domain + ")不存在");
}
const serviceCode = domainItem.serviceCode;
const dcpCookie = await client.getDcpCookie({
serviceCode
+44 -44
View File
@@ -49,7 +49,7 @@ importers:
packages/core/acme-client:
dependencies:
'@certd/basic':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../basic
'@peculiar/x509':
specifier: ^1.11.0
@@ -213,10 +213,10 @@ importers:
packages/core/pipeline:
dependencies:
'@certd/basic':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../basic
'@certd/plus-core':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../pro/plus-core
dayjs:
specifier: ^1.11.7
@@ -412,7 +412,7 @@ importers:
packages/libs/lib-k8s:
dependencies:
'@certd/basic':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/basic
'@kubernetes/client-node':
specifier: 0.21.0
@@ -452,19 +452,19 @@ importers:
packages/libs/lib-server:
dependencies:
'@certd/acme-client':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/pipeline
'@certd/plugin-lib':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../plugins/plugin-lib
'@certd/plus-core':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../pro/plus-core
'@midwayjs/cache':
specifier: 3.14.0
@@ -610,16 +610,16 @@ importers:
packages/plugins/plugin-cert:
dependencies:
'@certd/acme-client':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/pipeline
'@certd/plugin-lib':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../plugin-lib
psl:
specifier: ^1.9.0
@@ -683,16 +683,16 @@ importers:
specifier: ^3.964.0
version: 3.964.0(aws-crt@1.26.2)
'@certd/acme-client':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/pipeline
'@certd/plus-core':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../pro/plus-core
'@kubernetes/client-node':
specifier: 0.21.0
@@ -783,16 +783,16 @@ importers:
packages/pro/commercial-core:
dependencies:
'@certd/basic':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/basic
'@certd/lib-server':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../libs/lib-server
'@certd/pipeline':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/pipeline
'@certd/plus-core':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../plus-core
'@midwayjs/core':
specifier: 3.20.11
@@ -865,16 +865,16 @@ importers:
packages/pro/plugin-plus:
dependencies:
'@certd/basic':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/pipeline
'@certd/plugin-lib':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../plugins/plugin-lib
'@certd/plus-core':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../plus-core
crypto-js:
specifier: ^4.2.0
@@ -950,7 +950,7 @@ importers:
packages/pro/plus-core:
dependencies:
'@certd/basic':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/basic
dayjs:
specifier: ^1.11.7
@@ -1246,10 +1246,10 @@ importers:
version: 0.1.3(zod@3.24.4)
devDependencies:
'@certd/lib-iframe':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../libs/lib-iframe
'@certd/pipeline':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/pipeline
'@rollup/plugin-commonjs':
specifier: ^25.0.7
@@ -1438,46 +1438,46 @@ importers:
specifier: ^3.964.0
version: 3.964.0(aws-crt@1.26.2)
'@certd/acme-client':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/basic
'@certd/commercial-core':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../pro/commercial-core
'@certd/cv4pve-api-javascript':
specifier: ^8.4.2
version: 8.4.2
'@certd/jdcloud':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../libs/lib-jdcloud
'@certd/lib-huawei':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../libs/lib-huawei
'@certd/lib-k8s':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../libs/lib-k8s
'@certd/lib-server':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../libs/lib-server
'@certd/midway-flyway-js':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../libs/midway-flyway-js
'@certd/pipeline':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../core/pipeline
'@certd/plugin-cert':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../plugins/plugin-cert
'@certd/plugin-lib':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../plugins/plugin-lib
'@certd/plugin-plus':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../pro/plugin-plus
'@certd/plus-core':
specifier: ^1.38.3
specifier: ^1.38.5
version: link:../../pro/plus-core
'@google-cloud/publicca':
specifier: ^1.3.0
@@ -19971,13 +19971,13 @@ snapshots:
resolve: 1.22.10
semver: 6.3.1
eslint-plugin-prettier@3.4.1(eslint-config-prettier@8.10.0(eslint@7.32.0))(eslint@7.32.0)(prettier@2.8.8):
eslint-plugin-prettier@3.4.1(eslint-config-prettier@8.10.0(eslint@8.57.0))(eslint@7.32.0)(prettier@2.8.8):
dependencies:
eslint: 7.32.0
prettier: 2.8.8
prettier-linter-helpers: 1.0.0
optionalDependencies:
eslint-config-prettier: 8.10.0(eslint@7.32.0)
eslint-config-prettier: 8.10.0(eslint@8.57.0)
eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.10.0(eslint@8.57.0))(eslint@8.57.0)(prettier@2.8.8):
dependencies:
@@ -22377,7 +22377,7 @@ snapshots:
eslint: 7.32.0
eslint-config-prettier: 8.10.0(eslint@7.32.0)
eslint-plugin-node: 11.1.0(eslint@7.32.0)
eslint-plugin-prettier: 3.4.1(eslint-config-prettier@8.10.0(eslint@7.32.0))(eslint@7.32.0)(prettier@2.8.8)
eslint-plugin-prettier: 3.4.1(eslint-config-prettier@8.10.0(eslint@8.57.0))(eslint@7.32.0)(prettier@2.8.8)
execa: 5.1.1
inquirer: 7.3.3
json5: 2.2.3
+1 -1
View File
@@ -1 +1 @@
01:02
00:04
+1 -1
View File
@@ -1 +1 @@
01:17
00:18