Compare commits

...

22 Commits

Author SHA1 Message Date
xiaojunnuo 4fda6cbcde v1.38.8 2026-02-07 02:27:52 +08:00
xiaojunnuo 2bbba897ec build: prepare to build 2026-02-07 02:23:58 +08:00
xiaojunnuo 0cfb94b0ba perf: 支持设置默认的证书申请地址的反向代理 2026-02-07 02:20:27 +08:00
xiaojunnuo 3f7ac93932 perf: 子域名托管域名支持配置通配符 2026-02-07 00:03:37 +08:00
xiaojunnuo 96c36b4f6a chore: aliyun cdn log 2026-02-06 23:35:35 +08:00
xiaojunnuo febd6d32cf perf: 双重验证显示secret 2026-02-06 23:26:57 +08:00
xiaojunnuo cbd8699801 chore: 移除 github star 2026-02-06 23:04:39 +08:00
xiaojunnuo 74400aacc6 chore: 敏感数据隐藏输出 2026-02-06 16:49:19 +08:00
xiaojunnuo 9f55c3605a chore: 1 2026-02-06 16:36:57 +08:00
xiaojunnuo 8d61e8179f chore: 1 2026-02-06 16:29:53 +08:00
xiaojunnuo f250889c3e Merge branch 'v2-dev' of https://github.com/certd/certd into v2-dev 2026-02-06 16:26:32 +08:00
xiaojunnuo 00f67d86d6 perf: 优化申请证书最大超时时长 2026-02-06 16:26:26 +08:00
xiaojunnuo 5b580d2a17 build: release 2026-02-05 17:12:31 +08:00
xiaojunnuo 083dd7d1a3 build: publish 2026-02-05 16:32:10 +08:00
xiaojunnuo 03bd4755ce build: trigger build image 2026-02-05 16:31:58 +08:00
xiaojunnuo 29d37075dd v1.38.7 2026-02-05 16:30:37 +08:00
xiaojunnuo f311bac580 build: prepare to build 2026-02-05 16:26:01 +08:00
xiaojunnuo beb7a4c992 perf: 第三方登录支持Microsoft 2026-02-05 16:14:05 +08:00
xiaojunnuo 4d86fb319b perf: 优化zerossl申请证书稳定性 2026-02-05 12:22:55 +08:00
xiaojunnuo 5ea4f46de7 perf: eab从更多参数中挪到外面 2026-02-05 11:39:06 +08:00
xiaojunnuo 1d8d5251ae chore: domain-selector 优化 2026-02-05 11:29:10 +08:00
xiaojunnuo 54c8217808 fix: 修复有域名记录时,域名输入框无法关闭的bug 2026-02-05 11:27:32 +08:00
67 changed files with 751 additions and 214 deletions
+21
View File
@@ -3,6 +3,27 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
### Performance Improvements
* 双重验证显示secret ([febd6d3](https://github.com/certd/certd/commit/febd6d32cfe6d89ccecf26bf15141df7c456e5c6))
* 优化申请证书最大超时时长 ([00f67d8](https://github.com/certd/certd/commit/00f67d86d68f4f83cfafe2fbfeb4af0d86f9d20e))
* 支持设置默认的证书申请地址的反向代理 ([0cfb94b](https://github.com/certd/certd/commit/0cfb94b0ba6a6dc3bb0d0a81a1912068a4e6b6b6))
* 子域名托管域名支持配置通配符 ([3f7ac93](https://github.com/certd/certd/commit/3f7ac939326b0c7ec013a7534b6c0e58fb3e8cb4))
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
### Bug Fixes
* 修复有域名记录时,域名输入框无法关闭的bug ([54c8217](https://github.com/certd/certd/commit/54c8217808453b121abf646b004596f28932509f))
### Performance Improvements
* eab从更多参数中挪到外面 ([5ea4f46](https://github.com/certd/certd/commit/5ea4f46de7ae403a7a16e9488dc1d9c7523d019a))
* 第三方登录支持Microsoft ([beb7a4c](https://github.com/certd/certd/commit/beb7a4c99277262bb9681c5594cfcd3e36c52074))
* 优化zerossl申请证书稳定性 ([4d86fb3](https://github.com/certd/certd/commit/4d86fb319b81dbf6fa6485982105725b1b066593))
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
### Bug Fixes ### Bug Fixes
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
### Bug Fixes
* 修复有域名记录时,域名输入框无法关闭的bug ([54c8217](https://github.com/certd/certd/commit/54c8217808453b121abf646b004596f28932509f))
### Performance Improvements
* eab从更多参数中挪到外面 ([5ea4f46](https://github.com/certd/certd/commit/5ea4f46de7ae403a7a16e9488dc1d9c7523d019a))
* 第三方登录支持Microsoft ([beb7a4c](https://github.com/certd/certd/commit/beb7a4c99277262bb9681c5594cfcd3e36c52074))
* 优化zerossl申请证书稳定性 ([4d86fb3](https://github.com/certd/certd/commit/4d86fb319b81dbf6fa6485982105725b1b066593))
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
### Bug Fixes ### Bug Fixes
+1 -1
View File
@@ -9,5 +9,5 @@
} }
}, },
"npmClient": "pnpm", "npmClient": "pnpm",
"version": "1.38.6" "version": "1.38.8"
} }
+13
View File
@@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/publishlab/node-acme-client/compare/v1.38.7...v1.38.8) (2026-02-06)
### Performance Improvements
* 优化申请证书最大超时时长 ([00f67d8](https://github.com/publishlab/node-acme-client/commit/00f67d86d68f4f83cfafe2fbfeb4af0d86f9d20e))
* 支持设置默认的证书申请地址的反向代理 ([0cfb94b](https://github.com/publishlab/node-acme-client/commit/0cfb94b0ba6a6dc3bb0d0a81a1912068a4e6b6b6))
## [1.38.7](https://github.com/publishlab/node-acme-client/compare/v1.38.6...v1.38.7) (2026-02-05)
### Performance Improvements
* 优化zerossl申请证书稳定性 ([4d86fb3](https://github.com/publishlab/node-acme-client/commit/4d86fb319b81dbf6fa6485982105725b1b066593))
## [1.38.6](https://github.com/publishlab/node-acme-client/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/publishlab/node-acme-client/compare/v1.38.5...v1.38.6) (2026-02-04)
**Note:** Version bump only for package @certd/acme-client **Note:** Version bump only for package @certd/acme-client
+3 -3
View File
@@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client", "description": "Simple and unopinionated ACME client",
"private": false, "private": false,
"author": "nmorsman", "author": "nmorsman",
"version": "1.38.6", "version": "1.38.8",
"type": "module", "type": "module",
"module": "scr/index.js", "module": "scr/index.js",
"main": "src/index.js", "main": "src/index.js",
@@ -18,7 +18,7 @@
"types" "types"
], ],
"dependencies": { "dependencies": {
"@certd/basic": "^1.38.6", "@certd/basic": "^1.38.8",
"@peculiar/x509": "^1.11.0", "@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5", "asn1js": "^3.0.5",
"axios": "^1.9.0", "axios": "^1.9.0",
@@ -70,5 +70,5 @@
"bugs": { "bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues" "url": "https://github.com/publishlab/node-acme-client/issues"
}, },
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca" "gitHead": "29d37075dd600fa4898c5e38611e09db522e32fc"
} }
+5 -2
View File
@@ -600,8 +600,11 @@ class AcmeClient {
throw new Error(`[${d}] Unexpected item status: ${resp.data.status}`); throw new Error(`[${d}] Unexpected item status: ${resp.data.status}`);
}; };
this.log(`[${d}] Waiting for valid status (等待valid状态): ${item.url}`, this.backoffOpts); this.log(`[${d}] Waiting for valid status (等待valid状态): ${item.url}`, JSON.stringify(this.backoffOpts));
return util.retry(verifyFn, this.backoffOpts); const log = (...args)=>{
this.logger.info(...args)
}
return util.retry(verifyFn, this.backoffOpts,log);
} }
/** /**
+26
View File
@@ -57,6 +57,32 @@ export function getDirectoryUrl(opts) {
return list.production return list.production
} }
export function getAllSslProviderDomains() {
const list = Object.values(directory).map((item) => {
let url = item.production.replace('https://', '')
url = url.substring(0, url.indexOf('/'))
return url
})
return list
}
let sslProviderReverseProxies = {}
function initSslProviderReverseProxies() {
for (const sslProvider of getAllSslProviderDomains()) {
sslProviderReverseProxies[sslProvider] = ""
}
}
initSslProviderReverseProxies()
export function getSslProviderReverseProxies() {
return sslProviderReverseProxies
}
export function setSslProviderReverseProxies(reverseProxies) {
Object.assign(sslProviderReverseProxies, reverseProxies)
}
/** /**
* Crypto * Crypto
*/ */
+8 -2
View File
@@ -52,11 +52,17 @@ async function retryPromise(fn, attempts, backoff, logger = log) {
let aborted = false; let aborted = false;
try { try {
const data = await fn(() => { aborted = true; }); const setAbort = () => { aborted = true; }
const data = await fn(setAbort);
return data; return data;
} }
catch (e) { catch (e) {
if (aborted || ((backoff.attempts + 1) >= attempts)) { if (aborted){
logger(`用户取消重试`);
throw e;
}
if ( ((backoff.attempts + 1) >= attempts)) {
logger(`重试次数超过${attempts}`);
throw e; throw e;
} }
+3
View File
@@ -118,6 +118,9 @@ export const directory: {
}; };
export function getDirectoryUrl(opts:{sslProvider:string, pkType: string}): string; export function getDirectoryUrl(opts:{sslProvider:string, pkType: string}): string;
export function getAllSslProviderDomains(): string[];
export function getSslProviderReverseProxies(): Record<string, string>;
export function setSslProviderReverseProxies(reverseProxies: Record<string, string>): void;
/** /**
* Crypto * Crypto
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/basic
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
**Note:** Version bump only for package @certd/basic
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
**Note:** Version bump only for package @certd/basic **Note:** Version bump only for package @certd/basic
+1 -1
View File
@@ -1 +1 @@
01:13 02:23
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/basic", "name": "@certd/basic",
"private": false, "private": false,
"version": "1.38.6", "version": "1.38.8",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -47,5 +47,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca" "gitHead": "29d37075dd600fa4898c5e38611e09db522e32fc"
} }
+7 -1
View File
@@ -18,7 +18,7 @@ export function resetLogConfigure() {
}); });
} }
resetLogConfigure(); resetLogConfigure();
export const logger = log4js.getLogger("default"); export const logger: ILogger = log4js.getLogger("default") as any;
export function resetLogFilePath(filePath: string) { export function resetLogFilePath(filePath: string) {
logFilePath = filePath; logFilePath = filePath;
@@ -77,6 +77,8 @@ export type ILogger = {
fatal(message: any, ...args: any[]): void; fatal(message: any, ...args: any[]): void;
mark(message: any, ...args: any[]): void; mark(message: any, ...args: any[]): void;
addSecret(secret: string): void;
}; };
const locale = Intl.DateTimeFormat().resolvedOptions().locale; const locale = Intl.DateTimeFormat().resolvedOptions().locale;
@@ -106,10 +108,14 @@ export class PipelineLogger implements ILogger {
constructor(name: string, write: (text: string) => void) { constructor(name: string, write: (text: string) => void) {
this.customWriter = write; this.customWriter = write;
//@ts-ignore
this.logger = log4js.getLogger(name); this.logger = log4js.getLogger(name);
} }
addSecret(secret: string) { addSecret(secret: string) {
if (!secret) {
return;
}
this._secrets.push(secret); this._secrets.push(secret);
} }
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/pipeline
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
**Note:** Version bump only for package @certd/pipeline
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
**Note:** Version bump only for package @certd/pipeline **Note:** Version bump only for package @certd/pipeline
+4 -4
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/pipeline", "name": "@certd/pipeline",
"private": false, "private": false,
"version": "1.38.6", "version": "1.38.8",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -18,8 +18,8 @@
"compile": "tsc --skipLibCheck --watch" "compile": "tsc --skipLibCheck --watch"
}, },
"dependencies": { "dependencies": {
"@certd/basic": "^1.38.6", "@certd/basic": "^1.38.8",
"@certd/plus-core": "^1.38.6", "@certd/plus-core": "^1.38.8",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"reflect-metadata": "^0.1.13" "reflect-metadata": "^0.1.13"
@@ -45,5 +45,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca" "gitHead": "29d37075dd600fa4898c5e38611e09db522e32fc"
} }
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/lib-huawei
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
**Note:** Version bump only for package @certd/lib-huawei
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
**Note:** Version bump only for package @certd/lib-huawei **Note:** Version bump only for package @certd/lib-huawei
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-huawei", "name": "@certd/lib-huawei",
"private": false, "private": false,
"version": "1.38.6", "version": "1.38.8",
"main": "./dist/bundle.js", "main": "./dist/bundle.js",
"module": "./dist/bundle.js", "module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts", "types": "./dist/d/index.d.ts",
@@ -24,5 +24,5 @@
"prettier": "^2.8.8", "prettier": "^2.8.8",
"tslib": "^2.8.1" "tslib": "^2.8.1"
}, },
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca" "gitHead": "29d37075dd600fa4898c5e38611e09db522e32fc"
} }
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/lib-iframe
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
**Note:** Version bump only for package @certd/lib-iframe
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
**Note:** Version bump only for package @certd/lib-iframe **Note:** Version bump only for package @certd/lib-iframe
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-iframe", "name": "@certd/lib-iframe",
"private": false, "private": false,
"version": "1.38.6", "version": "1.38.8",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -31,5 +31,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca" "gitHead": "29d37075dd600fa4898c5e38611e09db522e32fc"
} }
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/jdcloud
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
**Note:** Version bump only for package @certd/jdcloud
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
**Note:** Version bump only for package @certd/jdcloud **Note:** Version bump only for package @certd/jdcloud
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/jdcloud", "name": "@certd/jdcloud",
"version": "1.38.6", "version": "1.38.8",
"description": "jdcloud openApi sdk", "description": "jdcloud openApi sdk",
"main": "./dist/bundle.js", "main": "./dist/bundle.js",
"module": "./dist/bundle.js", "module": "./dist/bundle.js",
@@ -56,5 +56,5 @@
"fetch" "fetch"
] ]
}, },
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca" "gitHead": "29d37075dd600fa4898c5e38611e09db522e32fc"
} }
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/lib-k8s
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
**Note:** Version bump only for package @certd/lib-k8s
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
**Note:** Version bump only for package @certd/lib-k8s **Note:** Version bump only for package @certd/lib-k8s
+3 -3
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-k8s", "name": "@certd/lib-k8s",
"private": false, "private": false,
"version": "1.38.6", "version": "1.38.8",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -17,7 +17,7 @@
"pub": "npm publish" "pub": "npm publish"
}, },
"dependencies": { "dependencies": {
"@certd/basic": "^1.38.6", "@certd/basic": "^1.38.8",
"@kubernetes/client-node": "0.21.0" "@kubernetes/client-node": "0.21.0"
}, },
"devDependencies": { "devDependencies": {
@@ -32,5 +32,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca" "gitHead": "29d37075dd600fa4898c5e38611e09db522e32fc"
} }
+10
View File
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
### Performance Improvements
* 支持设置默认的证书申请地址的反向代理 ([0cfb94b](https://github.com/certd/certd/commit/0cfb94b0ba6a6dc3bb0d0a81a1912068a4e6b6b6))
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
**Note:** Version bump only for package @certd/lib-server
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
**Note:** Version bump only for package @certd/lib-server **Note:** Version bump only for package @certd/lib-server
+7 -7
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/lib-server", "name": "@certd/lib-server",
"version": "1.38.6", "version": "1.38.8",
"description": "midway with flyway, sql upgrade way ", "description": "midway with flyway, sql upgrade way ",
"private": false, "private": false,
"type": "module", "type": "module",
@@ -28,11 +28,11 @@
], ],
"license": "AGPL", "license": "AGPL",
"dependencies": { "dependencies": {
"@certd/acme-client": "^1.38.6", "@certd/acme-client": "^1.38.8",
"@certd/basic": "^1.38.6", "@certd/basic": "^1.38.8",
"@certd/pipeline": "^1.38.6", "@certd/pipeline": "^1.38.8",
"@certd/plugin-lib": "^1.38.6", "@certd/plugin-lib": "^1.38.8",
"@certd/plus-core": "^1.38.6", "@certd/plus-core": "^1.38.8",
"@midwayjs/cache": "3.14.0", "@midwayjs/cache": "3.14.0",
"@midwayjs/core": "3.20.11", "@midwayjs/core": "3.20.11",
"@midwayjs/i18n": "3.20.13", "@midwayjs/i18n": "3.20.13",
@@ -64,5 +64,5 @@
"typeorm": "^0.3.11", "typeorm": "^0.3.11",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca" "gitHead": "29d37075dd600fa4898c5e38611e09db522e32fc"
} }
@@ -76,6 +76,9 @@ export class SysPrivateSettings extends BaseSettings {
httpsProxy? = ''; httpsProxy? = '';
httpProxy? = ''; httpProxy? = '';
reverseProxies?: Record<string, string> = {};
dnsResultOrder? = ''; dnsResultOrder? = '';
commonCnameEnabled?: boolean = true; commonCnameEnabled?: boolean = true;
@@ -4,10 +4,10 @@ import { Repository } from 'typeorm';
import { SysSettingsEntity } from '../entity/sys-settings.js'; import { SysSettingsEntity } from '../entity/sys-settings.js';
import { BaseSettings, SysInstallInfo, SysPrivateSettings, SysPublicSettings, SysSecret, SysSecretBackup } from './models.js'; import { BaseSettings, SysInstallInfo, SysPrivateSettings, SysPublicSettings, SysSecret, SysSecretBackup } from './models.js';
import { BaseService } from '../../../basic/index.js'; import { getAllSslProviderDomains, setSslProviderReverseProxies } from '@certd/acme-client';
import { cache, logger, setGlobalProxy } from '@certd/basic'; import { cache, logger, mergeUtils, setGlobalProxy } from '@certd/basic';
import * as dns from 'node:dns'; import * as dns from 'node:dns';
import {mergeUtils} from "@certd/basic"; import { BaseService } from '../../../basic/index.js';
import { executorQueue } from '../../basic/service/executor-queue.js'; import { executorQueue } from '../../basic/service/executor-queue.js';
const {merge} = mergeUtils; const {merge} = mergeUtils;
/** /**
@@ -120,7 +120,14 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
} }
async getPrivateSettings(): Promise<SysPrivateSettings> { async getPrivateSettings(): Promise<SysPrivateSettings> {
return await this.getSetting(SysPrivateSettings); const res = await this.getSetting<SysPrivateSettings>(SysPrivateSettings);
const sslProviderDomains = getAllSslProviderDomains();
for (const domain of sslProviderDomains) {
if (!res.reverseProxies[domain]) {
res.reverseProxies[domain] = "";
}
}
return res
} }
async savePrivateSettings(bean: SysPrivateSettings) { async savePrivateSettings(bean: SysPrivateSettings) {
@@ -145,6 +152,8 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
if (bean.pipelineMaxRunningCount){ if (bean.pipelineMaxRunningCount){
executorQueue.setMaxRunningCount(bean.pipelineMaxRunningCount); executorQueue.setMaxRunningCount(bean.pipelineMaxRunningCount);
} }
setSslProviderReverseProxies(bean.reverseProxies);
} }
async updateByKey(key: string, setting: any) { async updateByKey(key: string, setting: any) {
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
**Note:** Version bump only for package @certd/midway-flyway-js **Note:** Version bump only for package @certd/midway-flyway-js
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/midway-flyway-js", "name": "@certd/midway-flyway-js",
"version": "1.38.6", "version": "1.38.8",
"description": "midway with flyway, sql upgrade way ", "description": "midway with flyway, sql upgrade way ",
"private": false, "private": false,
"type": "module", "type": "module",
@@ -46,5 +46,5 @@
"typeorm": "^0.3.11", "typeorm": "^0.3.11",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca" "gitHead": "29d37075dd600fa4898c5e38611e09db522e32fc"
} }
+10
View File
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/plugin-cert
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
### Performance Improvements
* eab从更多参数中挪到外面 ([5ea4f46](https://github.com/certd/certd/commit/5ea4f46de7ae403a7a16e9488dc1d9c7523d019a))
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
**Note:** Version bump only for package @certd/plugin-cert **Note:** Version bump only for package @certd/plugin-cert
+6 -6
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/plugin-cert", "name": "@certd/plugin-cert",
"private": false, "private": false,
"version": "1.38.6", "version": "1.38.8",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
@@ -17,10 +17,10 @@
"compile": "tsc --skipLibCheck --watch" "compile": "tsc --skipLibCheck --watch"
}, },
"dependencies": { "dependencies": {
"@certd/acme-client": "^1.38.6", "@certd/acme-client": "^1.38.8",
"@certd/basic": "^1.38.6", "@certd/basic": "^1.38.8",
"@certd/pipeline": "^1.38.6", "@certd/pipeline": "^1.38.8",
"@certd/plugin-lib": "^1.38.6", "@certd/plugin-lib": "^1.38.8",
"psl": "^1.9.0", "psl": "^1.9.0",
"punycode.js": "^2.3.1" "punycode.js": "^2.3.1"
}, },
@@ -38,5 +38,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca" "gitHead": "29d37075dd600fa4898c5e38611e09db522e32fc"
} }
+1 -1
View File
@@ -1 +1 @@
export * from "@certd/plugin-lib"; export * from "@certd/plugin-lib";
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/plugin-lib
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
**Note:** Version bump only for package @certd/plugin-lib
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
**Note:** Version bump only for package @certd/plugin-lib **Note:** Version bump only for package @certd/plugin-lib
+6 -6
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/plugin-lib", "name": "@certd/plugin-lib",
"private": false, "private": false,
"version": "1.38.6", "version": "1.38.8",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
@@ -22,10 +22,10 @@
"@alicloud/pop-core": "^1.7.10", "@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.11", "@alicloud/tea-util": "^1.4.11",
"@aws-sdk/client-s3": "^3.964.0", "@aws-sdk/client-s3": "^3.964.0",
"@certd/acme-client": "^1.38.6", "@certd/acme-client": "^1.38.8",
"@certd/basic": "^1.38.6", "@certd/basic": "^1.38.8",
"@certd/pipeline": "^1.38.6", "@certd/pipeline": "^1.38.8",
"@certd/plus-core": "^1.38.6", "@certd/plus-core": "^1.38.8",
"@kubernetes/client-node": "0.21.0", "@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0", "ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5", "basic-ftp": "^5.0.5",
@@ -57,5 +57,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca" "gitHead": "29d37075dd600fa4898c5e38611e09db522e32fc"
} }
+18
View File
@@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
### Performance Improvements
* 双重验证显示secret ([febd6d3](https://github.com/certd/certd/commit/febd6d32cfe6d89ccecf26bf15141df7c456e5c6))
* 支持设置默认的证书申请地址的反向代理 ([0cfb94b](https://github.com/certd/certd/commit/0cfb94b0ba6a6dc3bb0d0a81a1912068a4e6b6b6))
* 子域名托管域名支持配置通配符 ([3f7ac93](https://github.com/certd/certd/commit/3f7ac939326b0c7ec013a7534b6c0e58fb3e8cb4))
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
### Bug Fixes
* 修复有域名记录时,域名输入框无法关闭的bug ([54c8217](https://github.com/certd/certd/commit/54c8217808453b121abf646b004596f28932509f))
### Performance Improvements
* eab从更多参数中挪到外面 ([5ea4f46](https://github.com/certd/certd/commit/5ea4f46de7ae403a7a16e9488dc1d9c7523d019a))
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
### Performance Improvements ### Performance Improvements
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-client", "name": "@certd/ui-client",
"version": "1.38.6", "version": "1.38.8",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite --open", "dev": "vite --open",
@@ -106,8 +106,8 @@
"zod-defaults": "^0.1.3" "zod-defaults": "^0.1.3"
}, },
"devDependencies": { "devDependencies": {
"@certd/lib-iframe": "^1.38.6", "@certd/lib-iframe": "^1.38.8",
"@certd/pipeline": "^1.38.6", "@certd/pipeline": "^1.38.8",
"@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12", "@types/chai": "^4.3.12",
@@ -3,13 +3,13 @@
<div class="flex flex-row"> <div class="flex flex-row">
<a-select <a-select
class="domain-select-input" class="domain-select-input"
:popup-class-name="popupClassName"
:dropdown-style="dropdownStyle" :dropdown-style="dropdownStyle"
show-search show-search
:filter-option="filterOption" :filter-option="filterOption"
:options="optionsRef" :options="optionsRef"
:value="value" :value="value"
v-bind="attrs" v-bind="attrs"
:open="openProp"
@click="onClick" @click="onClick"
@update:value="emit('update:value', $event)" @update:value="emit('update:value', $event)"
> >
@@ -56,7 +56,7 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, defineComponent, ref, Ref, useAttrs } from "vue"; import { computed, defineComponent, onMounted, ref, Ref, useAttrs } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { Dicts } from "../lib/dicts"; import { Dicts } from "../lib/dicts";
import { request } from "/@/api/service"; import { request } from "/@/api/service";
@@ -83,7 +83,6 @@ const props = defineProps<{
search?: boolean; search?: boolean;
pager?: boolean; pager?: boolean;
value?: any[]; value?: any[];
open?: boolean;
}>(); }>();
const emit = defineEmits<{ const emit = defineEmits<{
@@ -94,11 +93,11 @@ const attrs = useAttrs();
const hasOptions: Ref = ref(null); const hasOptions: Ref = ref(null);
const openProp = computed(() => { const popupClassName = computed(() => {
if (hasOptions.value == null) { if (!hasOptions.value) {
return false; return "hidden-important";
} }
return hasOptions.value; return "";
}); });
const searchKeyRef = ref(""); const searchKeyRef = ref("");
@@ -155,6 +154,7 @@ const getOptions = async () => {
optionsRef.value = options; optionsRef.value = options;
if (hasOptions.value == null) { if (hasOptions.value == null) {
//
if (options.length > 0) { if (options.length > 0) {
hasOptions.value = true; hasOptions.value = true;
} else { } else {
@@ -223,6 +223,10 @@ function openDomainImportDialog() {
const dropdownStyle = ref({ const dropdownStyle = ref({
zIndex: 2000, zIndex: 2000,
}); });
onMounted(() => {
refreshOptions();
});
</script> </script>
<style lang="less"></style> <style lang="less"></style>
@@ -1,8 +1,8 @@
<template> <template>
<div class="params-show"> <div class="params-show">
<a-tag type="primary" color="green" v-for="item of params" :key="item.value" class="item"> <a-tag v-for="item of params" :key="item.value" type="primary" color="green" class="item">
<span class="label">{{ item.label }}=</span> <span class="label">{{ item.label }}=</span>
<fs-copyable :modelValue="`\$\{${item.value}\}`" :button="{show:false}" :inline="true"></fs-copyable> <fs-copyable :model-value="`\$\{${item.value}\}`" :button="{ show: false }" :inline="true"></fs-copyable>
</a-tag> </a-tag>
</div> </div>
</template> </template>
@@ -161,27 +161,30 @@ function openStarModal(vipType: string) {
return; return;
} }
Modal.destroyAll(); Modal.destroyAll();
const goGithub = () => {
window.open("https://github.com/certd/certd/");
};
modal.confirm({ openTrialModal(vipType);
title: t("vip.get_7_day_pro_trial"),
okText: t("vip.star_now"), // const goGithub = () => {
onOk() { // window.open("https://github.com/certd/certd/");
goGithub(); // };
openTrialModal(vipType);
}, // modal.confirm({
width: 600, // title: t("vip.get_7_day_pro_trial"),
content: () => { // okText: t("vip.star_now"),
return ( // onOk() {
<div class="flex mt-10 mb-10"> // goGithub();
<div>{t("vip.please_help_star")}</div> // openTrialModal(vipType);
<img class="ml-5" src="https://img.shields.io/github/stars/certd/certd?logo=github" /> // },
</div> // width: 600,
); // content: () => {
}, // return (
}); // <div class="flex mt-10 mb-10">
// <div>{t("vip.please_help_star")}</div>
// <img class="ml-5" src="https://img.shields.io/github/stars/certd/certd?logo=github" />
// </div>
// );
// },
// });
} }
function openUpgrade() { function openUpgrade() {
@@ -511,6 +511,7 @@ export default {
selectRecordFirst: "Please select records first", selectRecordFirst: "Please select records first",
subdomainHosted: "Hosted Subdomain", subdomainHosted: "Hosted Subdomain",
subdomainHelpText: "If you don't understand what subdomain hosting is,Do not set it randomly, as it may result in the inability to apply for the certificate. please refer to the documentation ", subdomainHelpText: "If you don't understand what subdomain hosting is,Do not set it randomly, as it may result in the inability to apply for the certificate. please refer to the documentation ",
subdomainHelpSupportStart: "Supports * wildcard, indicating that all subdomains of the domain are hosted (free subdomains)",
subdomainManagement: "Subdomain Management", subdomainManagement: "Subdomain Management",
isDisabled: "Is Disabled", isDisabled: "Is Disabled",
enabled: "Enabled", enabled: "Enabled",
@@ -784,6 +785,7 @@ export default {
captchaSetting: "Captcha Setting", captchaSetting: "Captcha Setting",
pipelineSetting: "Pipeline Settings", pipelineSetting: "Pipeline Settings",
oauthSetting: "OAuth2 Settings", oauthSetting: "OAuth2 Settings",
networkSetting: "Network Settings",
showRunStrategy: "Show RunStrategy", showRunStrategy: "Show RunStrategy",
showRunStrategyHelper: "Allow modify the run strategy of the task", showRunStrategyHelper: "Allow modify the run strategy of the task",
@@ -835,6 +837,11 @@ export default {
notice: "System Notice", notice: "System Notice",
noticeHelper: "System notice, will be displayed on the login page", noticeHelper: "System notice, will be displayed on the login page",
noticePlaceholder: "System notice", noticePlaceholder: "System notice",
reverseProxy: "Reverse Proxy List",
reverseProxyHelper: "Reverse proxy for ACME address, used when applying for certificate",
reverseProxyPlaceholder: "http://le.px.handfree.work",
reverseProxyEmpty: "No reverse proxy list configured",
}, },
}, },
modal: { modal: {
@@ -521,6 +521,7 @@ export default {
selectRecordFirst: "请先勾选记录", selectRecordFirst: "请先勾选记录",
subdomainHosted: "托管的子域名", subdomainHosted: "托管的子域名",
subdomainHelpText: "如果您不理解什么是子域托管,请不要随意设置(可能导致证书无法申请,以前设置过的cname记录也需要重新配置),可以参考文档", subdomainHelpText: "如果您不理解什么是子域托管,请不要随意设置(可能导致证书无法申请,以前设置过的cname记录也需要重新配置),可以参考文档",
subdomainHelpSupportStart: "支持*号通配符,表示该域名下的子域名都是托管的(免费子域名)",
subdomainManagement: "子域管理", subdomainManagement: "子域管理",
isDisabled: "是否禁用", isDisabled: "是否禁用",
enabled: "启用", enabled: "启用",
@@ -791,6 +792,7 @@ export default {
captchaSetting: "验证码设置", captchaSetting: "验证码设置",
pipelineSetting: "流水线设置", pipelineSetting: "流水线设置",
oauthSetting: "第三方登录", oauthSetting: "第三方登录",
networkSetting: "网络设置",
showRunStrategy: "显示运行策略选择", showRunStrategy: "显示运行策略选择",
showRunStrategyHelper: "任务设置中是否允许选择运行策略", showRunStrategyHelper: "任务设置中是否允许选择运行策略",
@@ -850,6 +852,11 @@ export default {
notice: "系统公告", notice: "系统公告",
noticeHelper: "系统公告,将在首页显示", noticeHelper: "系统公告,将在首页显示",
noticePlaceholder: "系统公告", noticePlaceholder: "系统公告",
reverseProxy: "反向代理列表",
reverseProxyHelper: "证书颁发机构ACME地址的反向代理,在申请证书时自动使用",
reverseProxyPlaceholder: "http://le.px.handfree.work",
reverseProxyEmpty: "未配置反向代理",
}, },
}, },
modal: { modal: {
@@ -93,6 +93,7 @@ export type SuiteSetting = {
export type SysPrivateSetting = { export type SysPrivateSetting = {
httpProxy?: string; httpProxy?: string;
httpsProxy?: string; httpsProxy?: string;
reverseProxies?: any;
dnsResultOrder?: string; dnsResultOrder?: string;
commonCnameEnabled?: boolean; commonCnameEnabled?: boolean;
// 同一个用户同时最大运行流水线数量 // 同一个用户同时最大运行流水线数量
@@ -372,6 +372,13 @@ h6 {
border-spacing: 0; border-spacing: 0;
overflow: auto; overflow: auto;
&.cd-table-none-border {
border: 0 !important;
td, th {
border: 0 !important;
}
}
.fs-loading { .fs-loading {
position: absolute; position: absolute;
left: 0; left: 0;
@@ -476,4 +483,10 @@ h6 {
.fs-icon{ .fs-icon{
margin-right: 5px; margin-right: 5px;
} }
}
.hidden-important {
display: none !important;
visibility: hidden !important;
} }
@@ -28,7 +28,7 @@ export async function TwoFactorAuthenticatorGet() {
url: apiPrefix + "/twoFactor/authenticator/qrcode", url: apiPrefix + "/twoFactor/authenticator/qrcode",
method: "post", method: "post",
}); });
return res as string; //base64 return res as { qrcode: string; link: string; secret: string }; //base64
} }
export async function TwoFactorAuthenticatorSave(req: AuthenticatorSaveReq) { export async function TwoFactorAuthenticatorSave(req: AuthenticatorSaveReq) {
@@ -57,6 +57,17 @@
<div class="ml-20"> <div class="ml-20">
<img class="full-w" :src="authenticatorForm.qrcodeSrc" /> <img class="full-w" :src="authenticatorForm.qrcodeSrc" />
</div> </div>
<div class="ml-20 mt-5">
<div>您也可以手动添加</div>
<div class="flex mt-5">
<a-tag type="primary" color="green" class="mr-2">Secret</a-tag>
<fs-copyable :model-value="authenticatorForm.secret" />
</div>
<div class="flex mt-5">
<a-tag type="primary" color="green" class="mr-2">Link</a-tag>
<fs-copyable :model-value="authenticatorForm.link" />
</div>
</div>
</div> </div>
<h3 class="font-bold m-10">{{ t("certd.step3") }}</h3> <h3 class="font-bold m-10">{{ t("certd.step3") }}</h3>
<div class="ml-20"> <div class="ml-20">
@@ -97,6 +108,8 @@ const formState = reactive<Partial<UserTwoFactorSetting>>({
const authenticatorForm = reactive({ const authenticatorForm = reactive({
qrcodeSrc: "", qrcodeSrc: "",
verifyCode: "", verifyCode: "",
link: "",
secret: "",
open: false, open: false,
}); });
@@ -110,9 +123,14 @@ watch(
async open => { async open => {
if (open) { if (open) {
//base64 //base64
authenticatorForm.qrcodeSrc = await api.TwoFactorAuthenticatorGet(); const { qrcode, link, secret } = await api.TwoFactorAuthenticatorGet();
authenticatorForm.qrcodeSrc = qrcode;
authenticatorForm.link = link;
authenticatorForm.secret = secret;
} else { } else {
authenticatorForm.qrcodeSrc = ""; authenticatorForm.qrcodeSrc = "";
authenticatorForm.link = "";
authenticatorForm.secret = "";
authenticatorForm.verifyCode = ""; authenticatorForm.verifyCode = "";
} }
} }
@@ -1065,7 +1065,7 @@ export default defineComponent({
} }
.layout-right { .layout-right {
width: 364px; width: 368px;
height: 100%; height: 100%;
max-width: 90vw; max-width: 90vw;
} }
@@ -1292,7 +1292,7 @@ export default defineComponent({
.layout-right { .layout-right {
position: relative; position: relative;
&.collapsed { &.collapsed {
margin-right: max(-364px, -90vw); margin-right: max(-368px, -90vw);
} }
.collapse-toggle { .collapse-toggle {
@@ -80,10 +80,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
render() { render() {
return ( return (
<div> <div>
{t("certd.subdomainHelpText")} <div>
<a href={"https://help.aliyun.com/zh/dns/subdomain-management"} target={"_blank"}> 1. {t("certd.subdomainHelpText")}
{t("certd.subdomainManagement")} <a href={"https://help.aliyun.com/zh/dns/subdomain-management"} target={"_blank"}>
</a> {t("certd.subdomainManagement")}
</a>
</div>
<div>2. {t("certd.subdomainHelpSupportStart")}</div>
</div> </div>
); );
}, },
@@ -26,6 +26,9 @@
<a-tab-pane key="pipeline" :tab="t('certd.sys.setting.pipelineSetting')"> <a-tab-pane key="pipeline" :tab="t('certd.sys.setting.pipelineSetting')">
<SettingPipeline v-if="activeKey === 'pipeline'" /> <SettingPipeline v-if="activeKey === 'pipeline'" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="network" :tab="t('certd.sys.setting.networkSetting')">
<SettingNetwork v-if="activeKey === 'network'" />
</a-tab-pane>
</a-tabs> </a-tabs>
</div> </div>
</fs-page> </fs-page>
@@ -39,6 +42,7 @@ import SettingSafe from "/@/views/sys/settings/tabs/safe.vue";
import SettingCaptcha from "/@/views/sys/settings/tabs/captcha.vue"; import SettingCaptcha from "/@/views/sys/settings/tabs/captcha.vue";
import SettingPipeline from "/@/views/sys/settings/tabs/pipeline.vue"; import SettingPipeline from "/@/views/sys/settings/tabs/pipeline.vue";
import SettingOauth from "/@/views/sys/settings/tabs/oauth.vue"; import SettingOauth from "/@/views/sys/settings/tabs/oauth.vue";
import SettingNetwork from "/@/views/sys/settings/tabs/network.vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { ref } from "vue"; import { ref } from "vue";
import { useSettingStore } from "/@/store/settings"; import { useSettingStore } from "/@/store/settings";
@@ -15,33 +15,6 @@
<a-switch v-model:checked="formState.public.robots" /> <a-switch v-model:checked="formState.public.robots" />
</a-form-item> </a-form-item>
<a-form-item :label="t('certd.httpProxy')" :name="['private', 'httpProxy']" :rules="urlRules">
<a-input v-model:value="formState.private.httpProxy" :placeholder="t('certd.httpProxyPlaceholder')" />
<div class="helper">{{ t("certd.httpProxyHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.httpsProxy')" :name="['private', 'httpsProxy']" :rules="urlRules">
<div class="flex">
<a-input v-model:value="formState.private.httpsProxy" :placeholder="t('certd.httpsProxyPlaceholder')" />
<a-button class="ml-5" type="primary" :loading="testProxyLoading" :title="t('certd.saveThenTestTitle')" @click="testProxy">{{ t("certd.testButton") }}</a-button>
</div>
<div class="helper">{{ t("certd.httpsProxyHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.dualStackNetwork')" :name="['private', 'dnsResultOrder']">
<a-select v-model:value="formState.private.dnsResultOrder">
<a-select-option value="verbatim">{{ t("certd.default") }}</a-select-option>
<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>
</a-form-item>
<a-form-item :label="t('certd.sys.setting.showRunStrategy')" :name="['public', 'showRunStrategy']">
<a-switch v-model:checked="formState.public.showRunStrategy" />
<div class="helper">{{ t("certd.sys.setting.showRunStrategyHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.enableCommonCnameService')" :name="['private', 'commonCnameEnabled']"> <a-form-item :label="t('certd.enableCommonCnameService')" :name="['private', 'commonCnameEnabled']">
<a-switch v-model:checked="formState.private.commonCnameEnabled" /> <a-switch v-model:checked="formState.private.commonCnameEnabled" />
<div class="helper" v-html="t('certd.commonCnameHelper')"></div> <div class="helper" v-html="t('certd.commonCnameHelper')"></div>
@@ -60,16 +33,14 @@
</template> </template>
<script setup lang="tsx"> <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 { notification } from "ant-design-vue";
import { util } from "/@/utils"; import { merge } from "lodash-es";
import { reactive, ref } from "vue";
import { useSettingStore } from "/@/store/settings";
import * as api from "/@/views/sys/settings/api";
import { SysSettings } from "/@/views/sys/settings/api";
import { useI18n } from "/src/locales"; 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(); const { t } = useI18n();
defineOptions({ defineOptions({
@@ -84,11 +55,6 @@ const formState = reactive<Partial<SysSettings>>({
private: {}, private: {},
}); });
const urlRules = ref({
type: "url",
message: "请输入正确的URL",
});
async function loadSysSettings() { async function loadSysSettings() {
const data: any = await api.SysSettingsGet(); const data: any = await api.SysSettingsGet();
merge(formState, data); merge(formState, data);
@@ -110,43 +76,6 @@ const onFinish = async (form: any) => {
saveLoading.value = false; saveLoading.value = false;
} }
}; };
const testProxyLoading = ref(false);
async function testProxy() {
testProxyLoading.value = true;
try {
const res = await api.TestProxy();
let success = true;
if (res.google !== true || res.baidu !== true) {
success = false;
}
const content = () => {
return (
<div>
<div>
{t("certd.google")}: {res.google === true ? t("certd.success") : util.maxLength(res.google)}
</div>
<div>
{t("certd.baidu")}: {res.baidu === true ? t("certd.success") : util.maxLength(res.baidu)}
</div>
</div>
);
};
if (!success) {
notification.error({
message: t("certd.testFailed"),
description: content,
});
return;
}
notification.success({
message: t("certd.testCompleted"),
description: content,
});
} finally {
testProxyLoading.value = false;
}
}
</script> </script>
<style lang="less"> <style lang="less">
.sys-settings-base { .sys-settings-base {
@@ -0,0 +1,127 @@
<template>
<div class="sys-settings-form sys-settings-network">
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish">
<a-form-item :label="t('certd.httpProxy')" :name="['private', 'httpProxy']" :rules="urlRules">
<a-input v-model:value="formState.private.httpProxy" :placeholder="t('certd.httpProxyPlaceholder')" />
<div class="helper">{{ t("certd.httpProxyHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.httpsProxy')" :name="['private', 'httpsProxy']" :rules="urlRules">
<div class="flex">
<a-input v-model:value="formState.private.httpsProxy" :placeholder="t('certd.httpsProxyPlaceholder')" />
<a-button class="ml-5" type="primary" :loading="testProxyLoading" :title="t('certd.saveThenTestTitle')" @click="testProxy">{{ t("certd.testButton") }}</a-button>
</div>
<div class="helper">{{ t("certd.httpsProxyHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.dualStackNetwork')" :name="['private', 'dnsResultOrder']">
<a-select v-model:value="formState.private.dnsResultOrder">
<a-select-option value="verbatim">{{ t("certd.default") }}</a-select-option>
<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>
</a-form-item>
<a-form-item :label="t('certd.sys.setting.reverseProxy')" :name="['private', 'reverseProxy']">
<div class="mt-5">
<div v-for="(value, key) in formState.private.reverseProxies" :key="key" class="flex items-center p-2 border-b border-gray-300">
<span class="flex-1">{{ key }}</span>
<span class="flex-1 ml-5"><a-input v-model:value="formState.private.reverseProxies[key]" placeholder="proxy.xxxx.com" allow-clear /></span>
</div>
</div>
<div class="helper">{{ t("certd.sys.setting.reverseProxyHelper") }}</div>
</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 { proxyRefs, 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 { message, notification } from "ant-design-vue";
import { useI18n } from "/src/locales";
const { t } = useI18n();
import { util } from "/@/utils";
defineOptions({
name: "SettingNetwork",
});
const formState = reactive<Partial<SysSettings>>({
public: {},
private: {},
});
const urlRules = ref({
type: "url",
message: "请输入正确的URL",
});
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;
form.private.reverseProxies = formState.private.reverseProxies;
await api.SysSettingsSave(form);
await settingsStore.loadSysSettings();
notification.success({
message: t("certd.saveSuccess"),
});
} finally {
saveLoading.value = false;
}
};
const testProxyLoading = ref(false);
async function testProxy() {
testProxyLoading.value = true;
try {
const res = await api.TestProxy();
let success = true;
if (res.google !== true || res.baidu !== true) {
success = false;
}
const content = () => {
return (
<div>
<div>
{t("certd.google")}: {res.google === true ? t("certd.success") : util.maxLength(res.google)}
</div>
<div>
{t("certd.baidu")}: {res.baidu === true ? t("certd.success") : util.maxLength(res.baidu)}
</div>
</div>
);
};
if (!success) {
notification.error({
message: t("certd.testFailed"),
description: content,
});
return;
}
notification.success({
message: t("certd.testCompleted"),
description: content,
});
} finally {
testProxyLoading.value = false;
}
}
</script>
<style lang="less"></style>
@@ -8,6 +8,10 @@
<a-input-number v-model:value="formState.public.limitUserPipelineCount" /> <a-input-number v-model:value="formState.public.limitUserPipelineCount" />
<div class="helper">{{ t("certd.limitUserPipelineCountHelper") }}</div> <div class="helper">{{ t("certd.limitUserPipelineCountHelper") }}</div>
</a-form-item> </a-form-item>
<a-form-item :label="t('certd.sys.setting.showRunStrategy')" :name="['public', 'showRunStrategy']">
<a-switch v-model:checked="formState.public.showRunStrategy" />
<div class="helper">{{ t("certd.sys.setting.showRunStrategyHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.sys.setting.pipelineValidTimeEnabled')" :name="['public', 'pipelineValidTimeEnabled']"> <a-form-item :label="t('certd.sys.setting.pipelineValidTimeEnabled')" :name="['public', 'pipelineValidTimeEnabled']">
<div class="flex items-center"> <div class="flex items-center">
<a-switch v-model:checked="formState.public.pipelineValidTimeEnabled" :disabled="!settingsStore.isPlus" /> <a-switch v-model:checked="formState.public.pipelineValidTimeEnabled" :disabled="!settingsStore.isPlus" />
+17
View File
@@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
### Performance Improvements
* 双重验证显示secret ([febd6d3](https://github.com/certd/certd/commit/febd6d32cfe6d89ccecf26bf15141df7c456e5c6))
* 优化申请证书最大超时时长 ([00f67d8](https://github.com/certd/certd/commit/00f67d86d68f4f83cfafe2fbfeb4af0d86f9d20e))
* 支持设置默认的证书申请地址的反向代理 ([0cfb94b](https://github.com/certd/certd/commit/0cfb94b0ba6a6dc3bb0d0a81a1912068a4e6b6b6))
* 子域名托管域名支持配置通配符 ([3f7ac93](https://github.com/certd/certd/commit/3f7ac939326b0c7ec013a7534b6c0e58fb3e8cb4))
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
### Performance Improvements
* eab从更多参数中挪到外面 ([5ea4f46](https://github.com/certd/certd/commit/5ea4f46de7ae403a7a16e9488dc1d9c7523d019a))
* 第三方登录支持Microsoft ([beb7a4c](https://github.com/certd/certd/commit/beb7a4c99277262bb9681c5594cfcd3e36c52074))
* 优化zerossl申请证书稳定性 ([4d86fb3](https://github.com/certd/certd/commit/4d86fb319b81dbf6fa6485982105725b1b066593))
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04) ## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
### Bug Fixes ### Bug Fixes
@@ -0,0 +1,26 @@
addonType: oauth
name: microsoft
title: Microsoft认证
desc: Microsoft OAuth2登录
icon: simple-icons:microsoft
showTest: false
input:
clientId:
title: ClientId
helper: '[Azure Portal](https://portal.azure.com/)创建应用后获取'
required: true
clientSecretKey:
title: ClientSecretKey
component:
placeholder: ClientSecretKey / appSecretKey
required: true
tenantId:
title: TenantId
helper: 租户ID,留空使用/common端点(需要应用配置为多租户)
component:
placeholder: common 或 租户ID
value: common
required: false
pluginType: addon
type: builtIn
scriptFilePath: /plugins/plugin-oauth/oauth2/plugin-microsoft.js
@@ -215,7 +215,7 @@ input:
component: component:
name: access-selector name: access-selector
type: eab type: eab
maybeNeed: true maybeNeed: false
required: false required: false
helper: >- helper: >-
需要提供EAB授权 需要提供EAB授权
@@ -246,7 +246,7 @@ input:
component: component:
name: access-selector name: access-selector
type: google type: google
maybeNeed: true maybeNeed: false
required: false required: false
helper: >- helper: >-
google服务账号授权与EAB授权选填其中一个,[服务账号授权获取方法](https://certd.docmirror.cn/guide/use/google/) google服务账号授权与EAB授权选填其中一个,[服务账号授权获取方法](https://certd.docmirror.cn/guide/use/google/)
+14 -14
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-server", "name": "@certd/ui-server",
"version": "1.38.6", "version": "1.38.8",
"description": "fast-server base midway", "description": "fast-server base midway",
"private": true, "private": true,
"type": "module", "type": "module",
@@ -48,20 +48,20 @@
"@aws-sdk/client-iam": "^3.964.0", "@aws-sdk/client-iam": "^3.964.0",
"@aws-sdk/client-route-53": "^3.964.0", "@aws-sdk/client-route-53": "^3.964.0",
"@aws-sdk/client-s3": "^3.964.0", "@aws-sdk/client-s3": "^3.964.0",
"@certd/acme-client": "^1.38.6", "@certd/acme-client": "^1.38.8",
"@certd/basic": "^1.38.6", "@certd/basic": "^1.38.8",
"@certd/commercial-core": "^1.38.6", "@certd/commercial-core": "^1.38.8",
"@certd/cv4pve-api-javascript": "^8.4.2", "@certd/cv4pve-api-javascript": "^8.4.2",
"@certd/jdcloud": "^1.38.6", "@certd/jdcloud": "^1.38.8",
"@certd/lib-huawei": "^1.38.6", "@certd/lib-huawei": "^1.38.8",
"@certd/lib-k8s": "^1.38.6", "@certd/lib-k8s": "^1.38.8",
"@certd/lib-server": "^1.38.6", "@certd/lib-server": "^1.38.8",
"@certd/midway-flyway-js": "^1.38.6", "@certd/midway-flyway-js": "^1.38.8",
"@certd/pipeline": "^1.38.6", "@certd/pipeline": "^1.38.8",
"@certd/plugin-cert": "^1.38.6", "@certd/plugin-cert": "^1.38.8",
"@certd/plugin-lib": "^1.38.6", "@certd/plugin-lib": "^1.38.8",
"@certd/plugin-plus": "^1.38.6", "@certd/plugin-plus": "^1.38.8",
"@certd/plus-core": "^1.38.6", "@certd/plus-core": "^1.38.8",
"@google-cloud/publicca": "^1.3.0", "@google-cloud/publicca": "^1.3.0",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.185", "@huaweicloud/huaweicloud-sdk-cdn": "^3.1.185",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.185", "@huaweicloud/huaweicloud-sdk-core": "^3.1.185",
@@ -48,8 +48,8 @@ export class UserTwoFactorSettingController extends BaseController {
@Post("/authenticator/qrcode", { summary: Constants.per.authOnly }) @Post("/authenticator/qrcode", { summary: Constants.per.authOnly })
async authenticatorQrcode() { async authenticatorQrcode() {
const userId = this.getUserId(); const userId = this.getUserId();
const qrcode = await this.twoFactorService.getAuthenticatorQrCode(userId); const {qrcode,link,secret} = await this.twoFactorService.getAuthenticatorQrCode(userId);
return this.ok(qrcode); return this.ok({qrcode,link,secret});
} }
@Post("/authenticator/save", { summary: Constants.per.authOnly }) @Post("/authenticator/save", { summary: Constants.per.authOnly })
@@ -33,7 +33,8 @@ export class TwoFactorService {
//生成qrcode base64 //生成qrcode base64
const qrcode = await import("qrcode"); const qrcode = await import("qrcode");
return await qrcode.toDataURL(qrcodeContent); const qrcodeBase64 = await qrcode.toDataURL(qrcodeContent);
return {qrcode:qrcodeBase64,link:qrcodeContent,secret}
} }
@@ -1,5 +1,5 @@
import {ISubDomainsGetter} from "@certd/plugin-cert"; import { ISubDomainsGetter } from "@certd/plugin-cert";
import {SubDomainService} from "../sub-domain-service.js"; import { SubDomainService } from "../sub-domain-service.js";
import { DomainService } from "../../../cert/service/domain-service.js"; import { DomainService } from "../../../cert/service/domain-service.js";
export class SubDomainsGetter implements ISubDomainsGetter { export class SubDomainsGetter implements ISubDomainsGetter {
@@ -18,18 +18,39 @@ export class SubDomainsGetter implements ISubDomainsGetter {
} }
async hasSubDomain(fullDomain: string) { async hasSubDomain(fullDomain: string) {
let arr = fullDomain.split(".")
const subDomains = await this.getSubDomains() const subDomains = await this.getSubDomains()
if (subDomains && subDomains.length > 0) { if (subDomains && subDomains.length > 0) {
const fullDomainDot = "." + fullDomain; const fullDomainDot = "." + fullDomain;
for (const subDomain of subDomains) { for (const subDomain of subDomains) {
if (fullDomainDot.endsWith("." + subDomain)) { if (fullDomainDot.endsWith("." + subDomain)) {
//找到子域名托管 //找到子域名托管
return subDomain; return subDomain;
} }
if (subDomain.startsWith("*.")) {
//如果子域名配置的是泛域名,说明这一层及以下的子域名都是托管的
//以fullDomain在这一层的子域名作为返回值
const nonStarDomain = subDomain.slice(1)
if (fullDomainDot.endsWith(nonStarDomain)) {
//提取fullDomain在这一层的子域名
const fullArr = arr.reverse()
const subArr = subDomain.split(".").reverse()
let strBuilder = ""
for (let i =0 ;i<subArr.length;i++) {
if (strBuilder) {
strBuilder = fullArr[i] + "." + strBuilder
} else {
strBuilder = fullArr[i]
}
}
return strBuilder
}
}
} }
} }
let arr = fullDomain.split(".") while (arr.length > 0) {
while(arr.length>0){
const subDomain = arr.join(".") const subDomain = arr.join(".")
const domain = await this.domainService.findOne({ const domain = await this.domainService.findOne({
where: { where: {
@@ -38,10 +59,10 @@ export class SubDomainsGetter implements ISubDomainsGetter {
challengeType: "dns", challengeType: "dns",
} }
}) })
if(domain){ if (domain) {
return subDomain return subDomain
} }
arr = arr.slice(1) arr = arr.slice(1)
} }
return null return null
} }
@@ -113,6 +113,9 @@ export class PipelineService extends BaseService<PipelineEntity> {
async add(bean: PipelineEntity) { async add(bean: PipelineEntity) {
bean.status = ResultType.none; bean.status = ResultType.none;
if (bean.order == null) {
bean.order = 0;
}
await this.save(bean); await this.save(bean);
return bean; return bean;
} }
@@ -243,6 +246,9 @@ export class PipelineService extends BaseService<PipelineEntity> {
if (!bean.status) { if (!bean.status) {
bean.status = ResultType.none; bean.status = ResultType.none;
} }
if (bean.order == null) {
bean.order = 0;
}
if (!isUpdate) { if (!isUpdate) {
//如果是添加,先保存一下,获取到id,更新pipeline.id //如果是添加,先保存一下,获取到id,更新pipeline.id
await this.addOrUpdate(bean); await this.addOrUpdate(bean);
@@ -151,6 +151,7 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
} }
async SetCdnDomainSSLCertificate(client: any, params: { CertId: number; DomainName: string,CertName:string,CertRegion:string }) { async SetCdnDomainSSLCertificate(client: any, params: { CertId: number; DomainName: string,CertName:string,CertRegion:string }) {
this.logger.info('设置CDN: ',JSON.stringify(params));
const requestOption = { const requestOption = {
method: 'POST', method: 'POST',
formatParams: false, formatParams: false,
@@ -1,13 +1,12 @@
// @ts-ignore // @ts-ignore
import * as acme from "@certd/acme-client"; import * as acme from "@certd/acme-client";
import { ClientExternalAccountBindingOptions, UrlMapping } from "@certd/acme-client"; import { ClientExternalAccountBindingOptions, UrlMapping } from "@certd/acme-client";
import * as _ from "lodash-es";
import { Challenge } from "@certd/acme-client/types/rfc8555.js"; import { Challenge } from "@certd/acme-client/types/rfc8555.js";
import { IContext } from "@certd/pipeline";
import { ILogger, utils } from "@certd/basic"; import { ILogger, utils } from "@certd/basic";
import { IContext } from "@certd/pipeline";
import { IDnsProvider, IDomainParser } from "@certd/plugin-lib";
import punycode from "punycode.js"; import punycode from "punycode.js";
import { IOssClient } from "../../../plugin-lib/index.js"; import { IOssClient } from "../../../plugin-lib/index.js";
import { IDnsProvider, IDomainParser } from "@certd/plugin-lib";
export type CnameVerifyPlan = { export type CnameVerifyPlan = {
type?: string; type?: string;
domain: string; domain: string;
@@ -112,11 +111,26 @@ export class AcmeService {
} }
async getAcmeClient(email: string): Promise<acme.Client> { async getAcmeClient(email: string): Promise<acme.Client> {
const mappings = {};
if (this.sslProvider === "letsencrypt") { const directoryUrl = acme.getDirectoryUrl({ sslProvider: this.sslProvider, pkType: this.options.privateKeyType });
mappings["acme-v02.api.letsencrypt.org"] = this.options.reverseProxy || "le.px.certd.handfree.work"; let targetUrl = directoryUrl.replace("https://", "");
} else if (this.sslProvider === "google") { targetUrl = targetUrl.substring(0, targetUrl.indexOf("/"));
mappings["dv.acme-v02.api.pki.goog"] = this.options.reverseProxy || "gg.px.certd.handfree.work";
const mappings = {
"acme-v02.api.letsencrypt.org": "le.px.certd.handfree.work",
"dv.acme-v02.api.pki.goog": "gg.px.certd.handfree.work",
};
const reverseProxies = acme.getSslProviderReverseProxies();
if (reverseProxies) {
for (const key in reverseProxies) {
const value = reverseProxies[key];
if (value) {
mappings[key] = value;
}
}
}
if (this.options.reverseProxy && targetUrl) {
mappings[targetUrl] = this.options.reverseProxy;
} }
const urlMapping: UrlMapping = { const urlMapping: UrlMapping = {
enabled: false, enabled: false,
@@ -128,7 +142,7 @@ export class AcmeService {
await this.saveAccountConfig(email, conf); await this.saveAccountConfig(email, conf);
this.logger.info(`创建新的Accountkey:${email}`); this.logger.info(`创建新的Accountkey:${email}`);
} }
const directoryUrl = acme.getDirectoryUrl({ sslProvider: this.sslProvider, pkType: this.options.privateKeyType });
if (this.options.useMappingProxy) { if (this.options.useMappingProxy) {
urlMapping.enabled = true; urlMapping.enabled = true;
} else { } else {
@@ -147,7 +161,7 @@ export class AcmeService {
externalAccountBinding: this.eab, externalAccountBinding: this.eab,
backoffAttempts: this.options.maxCheckRetryCount || 20, backoffAttempts: this.options.maxCheckRetryCount || 20,
backoffMin: 5000, backoffMin: 5000,
backoffMax: 10000, backoffMax: 30 * 1000,
urlMapping, urlMapping,
signal: this.options.signal, signal: this.options.signal,
logger: this.logger, logger: this.logger,
@@ -434,11 +448,7 @@ export class AcmeService {
if (domains.length === 0) { if (domains.length === 0) {
throw new Error("domain can not be empty"); throw new Error("domain can not be empty");
} }
// const commonName = domains[0];
// let altNames: undefined | string[] = undefined;
// if (domains.length > 1) {
// altNames = _.slice(domains, 1);
// }
return { return {
// commonName, // commonName,
altNames: domains, altNames: domains,
@@ -264,7 +264,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
name: "access-selector", name: "access-selector",
type: "eab", type: "eab",
}, },
maybeNeed: true, maybeNeed: false,
required: false, required: false,
helper: helper:
"需要提供EAB授权" + "需要提供EAB授权" +
@@ -291,7 +291,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
name: "access-selector", name: "access-selector",
type: "google", type: "google",
}, },
maybeNeed: true, maybeNeed: false,
required: false, required: false,
helper: "google服务账号授权与EAB授权选填其中一个,[服务账号授权获取方法](https://certd.docmirror.cn/guide/use/google/)\n服务账号授权需要配置代理或者服务器本身在海外", helper: "google服务账号授权与EAB授权选填其中一个,[服务账号授权获取方法](https://certd.docmirror.cn/guide/use/google/)\n服务账号授权需要配置代理或者服务器本身在海外",
mergeScript: ` mergeScript: `
@@ -458,6 +458,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
this.eab = eab; this.eab = eab;
const subDomainsGetter = await this.ctx.serviceGetter.get<ISubDomainsGetter>("subDomainsGetter"); const subDomainsGetter = await this.ctx.serviceGetter.get<ISubDomainsGetter>("subDomainsGetter");
const domainParser = new DomainParser(subDomainsGetter, this.logger); const domainParser = new DomainParser(subDomainsGetter, this.logger);
this.acme = new AcmeService({ this.acme = new AcmeService({
userId: this.ctx.user.id, userId: this.ctx.user.id,
userContext: this.userContext, userContext: this.userContext,
@@ -673,6 +674,12 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
}, },
}; };
} }
async onGetReverseProxyList() {
const sysSettingsService:any = await this.ctx.serviceGetter.get("sysSettingsService");
const sysSettings = await sysSettingsService.getPrivateSettings();
return sysSettings.reverseProxyList || []
}
} }
new CertApplyPlugin(); new CertApplyPlugin();
@@ -60,6 +60,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
abstract doCertApply(): Promise<CertReader>; abstract doCertApply(): Promise<CertReader>;
async execute(): Promise<string | void> { async execute(): Promise<string | void> {
this.logger.addSecret(this.pfxPassword);
const oldCert = await this.condition(); const oldCert = await this.condition();
if (oldCert != null) { if (oldCert != null) {
await this.output(oldCert, false); await this.output(oldCert, false);
@@ -4,4 +4,5 @@ export * from './wx/plugin-wx.js'
export * from './oauth2/plugin-gitee.js' export * from './oauth2/plugin-gitee.js'
export * from './oauth2/plugin-clogin.js' export * from './oauth2/plugin-clogin.js'
export * from './oauth2/plugin-github.js' export * from './oauth2/plugin-github.js'
export * from './oauth2/plugin-google.js' export * from './oauth2/plugin-google.js'
export * from './oauth2/plugin-microsoft.js'
@@ -0,0 +1,122 @@
import { AddonInput, BaseAddon, IsAddon } from "@certd/lib-server";
import { BuildLoginUrlReq, BuildLogoutUrlReq, IOauthProvider, OnCallbackReq } from "../api.js";
@IsAddon({
addonType: "oauth",
name: 'microsoft',
title: 'Microsoft认证',
desc: 'Microsoft OAuth2登录',
icon:"simple-icons:microsoft",
showTest: false,
})
export class MicrosoftOauthProvider extends BaseAddon implements IOauthProvider {
@AddonInput({
title: "ClientId",
helper: "[Azure Portal](https://portal.azure.com/)创建应用后获取",
required: true,
})
clientId = "";
@AddonInput({
title: "ClientSecretKey",
component: {
placeholder: "ClientSecretKey / appSecretKey",
},
required: true,
})
clientSecretKey = "";
@AddonInput({
title: "TenantId",
helper: "租户ID,留空使用/common端点(需要应用配置为多租户)",
component: {
placeholder: "common 或 租户ID",
},
value: "common",
required: false,
})
tenantId = "common";
async buildLoginUrl(params: BuildLoginUrlReq) {
let scope = "openid profile email User.Read" // Scope of the access request
let state:any = {
forType: params.forType || 'login',
}
state = this.ctx.utils.hash.base64(JSON.stringify(state))
const authorizeEndpoint = `https://login.microsoftonline.com/${this.tenantId}/oauth2/v2.0/authorize`
const redirectUrl = encodeURIComponent(params.redirectUri)
const loginUrl = `${authorizeEndpoint}?client_id=${this.clientId}&redirect_uri=${redirectUrl}&response_type=code&scope=${scope}&state=${state}`
return {
loginUrl,
ticketValue: {
state,
},
};
}
async onCallback(req: OnCallbackReq) {
const code = req.code || ""
if (!code) {
throw new Error("Missing code parameter");
}
const tokenEndpoint = `https://login.microsoftonline.com/${this.tenantId}/oauth2/v2.0/token`
const uri = new URL(req.currentURL)
const redirectUri = `${uri.origin}${uri.pathname}`
// 构建 form-urlencoded 格式的数据
const formData = new URLSearchParams();
formData.append('client_id', this.clientId);
formData.append('client_secret', this.clientSecretKey);
formData.append('code', code);
formData.append('redirect_uri', redirectUri);
formData.append('grant_type', 'authorization_code');
const res = await this.ctx.utils.http.request( {
url: tokenEndpoint,
method: "post",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "application/json"
},
data: formData.toString()
})
const tokens = res
const userInfoEndpoint = "https://graph.microsoft.com/v1.0/me"
// 获取用户信息
const userInfoRes = await this.ctx.utils.http.request( {
url: userInfoEndpoint,
method: "get",
headers: {
"Authorization": `Bearer ${tokens.access_token}`,
"Accept": "application/json"
}
})
const userInfo = userInfoRes
return {
token:{
accessToken: tokens.access_token,
refreshToken: tokens.refresh_token,
expiresIn: tokens.expires_in,
},
userInfo: {
openId: userInfo.id,
nickName: userInfo.displayName || userInfo.userPrincipalName || "",
avatar: userInfo.avatar || "",
},
}
};
async buildLogoutUrl(params: BuildLogoutUrlReq) {
return {};
}
}
+1 -1
View File
@@ -1 +1 @@
01:18 16:31
+1 -1
View File
@@ -1 +1 @@
01:33 17:12