mirror of
https://github.com/certd/certd.git
synced 2026-07-09 22:47:38 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| edda1b57f3 | |||
| 5a7766992d | |||
| 02dabe11db | |||
| 58024128d8 | |||
| e44bf9d773 | |||
| 1114223bda | |||
| 55022e5fa6 | |||
| ae732fb298 |
@@ -281,12 +281,12 @@ export class DemoTest extends AbstractTaskPlugin {
|
||||
return {
|
||||
value: item.siteName,
|
||||
label: item.siteName,
|
||||
domain: item.siteName,
|
||||
domain: item.siteName, //这里必须要包含domain 否则后面分组时候全部分配到未匹配中
|
||||
};
|
||||
});
|
||||
//将站点域名名称根据证书域名进行匹配分组,分成匹配的和不匹配的两组选项,返回给前端,供用户选择
|
||||
return {
|
||||
list: optionsUtils.buildGroupOptions(options, this.certDomains),
|
||||
list: optionsUtils.buildGroupOptions(options, this.certDomains), //分组后的列表
|
||||
total: siteRes.length,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **volcengine-alb:** 修复火山引擎ALB 默认证书部署类型会部署到扩展证书的问题 ([0a068a2](https://github.com/certd/certd/commit/0a068a274673e9768954e9f7367c267d44f3b530))
|
||||
|
||||
## [1.42.2](https://github.com/certd/certd/compare/v1.42.1...v1.42.2) (2026-07-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -75,5 +75,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
||||
}
|
||||
|
||||
@@ -54,5 +54,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
||||
}
|
||||
|
||||
@@ -51,5 +51,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
||||
}
|
||||
|
||||
@@ -30,5 +30,5 @@
|
||||
"prettier": "3.3.3",
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
||||
}
|
||||
|
||||
@@ -62,5 +62,5 @@
|
||||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
||||
}
|
||||
|
||||
@@ -69,5 +69,5 @@
|
||||
"typeorm": "^0.3.20",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
||||
}
|
||||
|
||||
@@ -52,5 +52,5 @@
|
||||
"typeorm": "^0.3.20",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
||||
}
|
||||
|
||||
@@ -45,5 +45,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
||||
}
|
||||
|
||||
@@ -132,6 +132,5 @@ export class MainConfiguration {
|
||||
logger.info(text);
|
||||
});
|
||||
logger.info("当前环境:", this.app.getEnv()); // prod
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ export class MineController extends BaseController {
|
||||
user.needInitAccount = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return this.ok(user);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ export class MineController extends BaseController {
|
||||
|
||||
@Post("/accountInit", { description: Constants.per.authOnly, summary: "初始化Let's Encrypt ACME账号和邮件通知" })
|
||||
public async accountInit(@Body("email") email?: string) {
|
||||
let userId = this.getUserId();
|
||||
const userId = this.getUserId();
|
||||
let userEmail = email;
|
||||
let user: any = null;
|
||||
if (!userEmail) {
|
||||
@@ -190,7 +190,7 @@ export class MineController extends BaseController {
|
||||
type: "acmeAccount",
|
||||
name: "Let's Encrypt",
|
||||
userId,
|
||||
projectId:undefined,
|
||||
projectId: undefined,
|
||||
setting: JSON.stringify({
|
||||
caType: "letsencrypt",
|
||||
email: userEmail,
|
||||
|
||||
@@ -114,7 +114,7 @@ export class AsiaIspClient {
|
||||
|
||||
if (response.code !== "0") {
|
||||
this.logger.error(`接口请求失败: code=${response.code}, msg=${response.msg}`);
|
||||
const e= new Error(response.msg || "接口请求失败");
|
||||
const e = new Error(response.msg || "接口请求失败");
|
||||
// @ts-ignore
|
||||
e.errorCode = response.code;
|
||||
throw e;
|
||||
@@ -122,9 +122,9 @@ export class AsiaIspClient {
|
||||
|
||||
return response;
|
||||
} catch (error: any) {
|
||||
const response = error.response
|
||||
const response = error.response;
|
||||
if (response && response.data) {
|
||||
const e = new Error(response.data.msg || error.message || "接口请求失败");
|
||||
const e = new Error(response.data.msg || error.message || "接口请求失败");
|
||||
// @ts-ignore
|
||||
e.errorCode = response.data.code;
|
||||
throw e;
|
||||
@@ -245,7 +245,7 @@ export class AsiaIspClient {
|
||||
this.logger.info(`域名 ${req.domain} 已绑定该证书 ${req.certId},无需重复绑定`);
|
||||
return;
|
||||
}
|
||||
throw e
|
||||
throw e;
|
||||
}
|
||||
this.logger.info(`部署证书到域名成功: ${req.domain}, certId=${req.certId}`);
|
||||
}
|
||||
|
||||
+41
-48
@@ -78,6 +78,7 @@ export class VolcengineDeployToVOD extends AbstractTaskPlugin {
|
||||
options: [
|
||||
{ value: "play", label: "点播加速域名" },
|
||||
{ value: "image", label: "封面加速域名" },
|
||||
{ value: "third", label: "自定义源站" },
|
||||
],
|
||||
},
|
||||
value: "play",
|
||||
@@ -85,29 +86,12 @@ export class VolcengineDeployToVOD extends AbstractTaskPlugin {
|
||||
})
|
||||
domainType!: string;
|
||||
|
||||
@TaskInput({
|
||||
title: "源站类型",
|
||||
helper: "选择源站类型",
|
||||
value: 1,
|
||||
component: {
|
||||
name: "a-select",
|
||||
vModel: "value",
|
||||
options: [
|
||||
{ value: 1, label: "点播源站" },
|
||||
{ value: 2, label: "自定义源站" },
|
||||
],
|
||||
helper: "注意:封面加速域名不支持自定义源站",
|
||||
},
|
||||
required: false,
|
||||
})
|
||||
sourceStationType!: number | undefined;
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: "域名",
|
||||
helper: "选择要部署证书的域名\n需要先在域名管理页面进行证书中心访问授权(即点击去配置SSL证书)",
|
||||
action: VolcengineDeployToVOD.prototype.onGetDomainList.name,
|
||||
watches: ["certDomains", "accessId", "spaceName", "domainType", "sourceStationType"],
|
||||
watches: ["certDomains", "accessId", "spaceName", "domainType"],
|
||||
required: true,
|
||||
})
|
||||
)
|
||||
@@ -124,19 +108,25 @@ export class VolcengineDeployToVOD extends AbstractTaskPlugin {
|
||||
|
||||
const access = await this.getAccess<VolcengineAccess>(this.accessId);
|
||||
const certId = await this.uploadOrGetCertId(access);
|
||||
await this.ctx.utils.sleep(3000);
|
||||
const domainTypeMapping: Record<string, string> = {
|
||||
play: "vod_play",
|
||||
image: "vod_image",
|
||||
};
|
||||
const apiDomainType = domainTypeMapping[this.domainType] || this.domainType;
|
||||
|
||||
const service = await this.getVodService({ version: "2023-07-01", region: this.regionId });
|
||||
const service = await this.getVodService({ version: "2026-01-01", region: this.regionId });
|
||||
const domains = Array.isArray(this.domainList) ? this.domainList : [this.domainList];
|
||||
for (const domain of domains) {
|
||||
this.logger.info(`开始部署域名${domain}证书`);
|
||||
await service.request({
|
||||
action: "UpdateDomainConfig",
|
||||
action: "UpdateVodDomainConfig",
|
||||
method: "POST",
|
||||
body: {
|
||||
SpaceName: this.spaceName,
|
||||
DomainType: this.domainType,
|
||||
Domain: domain,
|
||||
Config: {
|
||||
DomainType: apiDomainType,
|
||||
UpdateCdnConfigParam: {
|
||||
Domain: domain,
|
||||
HTTPS: {
|
||||
Switch: true,
|
||||
CertInfo: {
|
||||
@@ -221,38 +211,41 @@ export class VolcengineDeployToVOD extends AbstractTaskPlugin {
|
||||
if (!this.spaceName) {
|
||||
throw new Error("请先选择空间名称");
|
||||
}
|
||||
const service = await this.getVodService({ version: "2023-01-01", region: this.regionId });
|
||||
const service = await this.getVodService({ version: "2026-01-01", region: this.regionId });
|
||||
|
||||
const query: Record<string, any> = {
|
||||
SpaceName: this.spaceName,
|
||||
DomainType: this.domainType,
|
||||
const domainTypeMapping: Record<string, string> = {
|
||||
play: "vod_play",
|
||||
image: "vod_image",
|
||||
};
|
||||
if (this.sourceStationType !== undefined) {
|
||||
query.SourceStationType = this.sourceStationType;
|
||||
}
|
||||
const apiDomainType = domainTypeMapping[this.domainType] || this.domainType;
|
||||
|
||||
const body: Record<string, any> = {
|
||||
SpaceName: this.spaceName,
|
||||
ListCdnDomainsParam: {
|
||||
PageNum: 1,
|
||||
PageSize: 100,
|
||||
},
|
||||
};
|
||||
if (apiDomainType) {
|
||||
body.DomainType = apiDomainType;
|
||||
}
|
||||
const res = await service.request({
|
||||
action: "ListDomain",
|
||||
query,
|
||||
action: "ListVodDomains",
|
||||
method: "POST",
|
||||
body,
|
||||
});
|
||||
|
||||
const instances = res.Result?.PlayInstanceInfo?.ByteInstances;
|
||||
if (!instances || instances.length === 0) {
|
||||
throw new Error("找不到域名,您也可以手动输入域名");
|
||||
}
|
||||
const list = [];
|
||||
for (const item of instances) {
|
||||
if (item.Domains && item.Domains.length > 0) {
|
||||
for (const domain of item.Domains) {
|
||||
if (domain.Domain) {
|
||||
list.push({
|
||||
value: domain.Domain,
|
||||
label: domain.Domain,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
const domains = res.Result?.VodInfo?.Domains;
|
||||
if (!domains || domains.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const list = domains.map((item: any) => {
|
||||
return {
|
||||
value: item.Domain,
|
||||
label: item.Domain,
|
||||
domain : item.Domain,
|
||||
};
|
||||
});
|
||||
return this.ctx.utils.options.buildGroupOptions(list, this.certDomains);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
20:04
|
||||
23:48
|
||||
|
||||
@@ -1 +1 @@
|
||||
21:20
|
||||
00:00
|
||||
|
||||
Reference in New Issue
Block a user