mirror of
https://github.com/certd/certd.git
synced 2026-07-14 09:27:32 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 584b7b6f45 | |||
| 2312c444ef | |||
| 0373d019f8 | |||
| fe09e75b80 | |||
| 432c9c6cc1 | |||
| 5fc1d55879 |
@@ -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.42.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复火山引擎查不到自定义源站域名的问题 ([02dabe1](https://github.com/certd/certd/commit/02dabe11db3e9b13ca4621ce9ddd2b808bfca390))
|
||||||
|
* 修复火山引擎自定义源站域名查询不到的问题 ([e44bf9d](https://github.com/certd/certd/commit/e44bf9d77375d48ac7fd1582e69fae02dfd248fa))
|
||||||
|
* **pipeline:** 重构运行时依赖加载逻辑,修复火山引擎DNS解析报runtimeDepsService未初始化的bug ([ec69b8f](https://github.com/certd/certd/commit/ec69b8f11bfd4b20991aef74a72a47182ca79a9d))
|
||||||
|
|
||||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -75,5 +75,5 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||||
},
|
},
|
||||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,5 +54,5 @@
|
|||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,5 +51,5 @@
|
|||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,5 +30,5 @@
|
|||||||
"prettier": "3.3.3",
|
"prettier": "3.3.3",
|
||||||
"tslib": "^2.8.1"
|
"tslib": "^2.8.1"
|
||||||
},
|
},
|
||||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,5 +37,5 @@
|
|||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,5 +62,5 @@
|
|||||||
"fetch"
|
"fetch"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,5 +38,5 @@
|
|||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,5 +69,5 @@
|
|||||||
"typeorm": "^0.3.20",
|
"typeorm": "^0.3.20",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,5 +52,5 @@
|
|||||||
"typeorm": "^0.3.20",
|
"typeorm": "^0.3.20",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,5 +38,5 @@
|
|||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,5 +45,5 @@
|
|||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "a6ef6996c3a68ce0c2a4577a0934ed74a53f0515"
|
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
|||||||
import { UserSettingsService } from "./user-settings-service.js";
|
import { UserSettingsService } from "./user-settings-service.js";
|
||||||
import { UserTwoFactorSetting } from "./models.js";
|
import { UserTwoFactorSetting } from "./models.js";
|
||||||
import { UserService } from "../../sys/authority/service/user-service.js";
|
import { UserService } from "../../sys/authority/service/user-service.js";
|
||||||
|
import { RuntimeDepsService } from "../../runtime-deps/runtime-deps-service.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 授权
|
* 授权
|
||||||
@@ -13,13 +14,15 @@ export class TwoFactorService {
|
|||||||
userSettingsService: UserSettingsService;
|
userSettingsService: UserSettingsService;
|
||||||
@Inject()
|
@Inject()
|
||||||
userService: UserService;
|
userService: UserService;
|
||||||
|
@Inject()
|
||||||
|
runtimeDepsService: RuntimeDepsService;
|
||||||
|
|
||||||
async getAuthenticatorQrCode(userId: any) {
|
async getAuthenticatorQrCode(userId: any) {
|
||||||
const setting = await this.getSetting(userId);
|
const setting = await this.getSetting(userId);
|
||||||
|
|
||||||
const authenticatorSetting = setting.authenticator;
|
const authenticatorSetting = setting.authenticator;
|
||||||
if (!authenticatorSetting.secret) {
|
if (!authenticatorSetting.secret) {
|
||||||
const { authenticator } = await import("otplib");
|
const { authenticator } = await this.runtimeDepsService.importRuntime("otplib");
|
||||||
|
|
||||||
authenticatorSetting.secret = authenticator.generateSecret();
|
authenticatorSetting.secret = authenticator.generateSecret();
|
||||||
await this.userSettingsService.saveSetting(userId, null, setting);
|
await this.userSettingsService.saveSetting(userId, null, setting);
|
||||||
@@ -38,7 +41,7 @@ export class TwoFactorService {
|
|||||||
|
|
||||||
async saveAuthenticator(req: { userId: any; verifyCode: any }) {
|
async saveAuthenticator(req: { userId: any; verifyCode: any }) {
|
||||||
const userId = req.userId;
|
const userId = req.userId;
|
||||||
const { authenticator } = await import("otplib");
|
const { authenticator } = await this.runtimeDepsService.importRuntime("otplib");
|
||||||
const setting = await this.getSetting(userId);
|
const setting = await this.getSetting(userId);
|
||||||
|
|
||||||
const authenticatorSetting = setting.authenticator;
|
const authenticatorSetting = setting.authenticator;
|
||||||
@@ -77,7 +80,7 @@ export class TwoFactorService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async verifyAuthenticatorCode(userId: any, verifyCode: string) {
|
async verifyAuthenticatorCode(userId: any, verifyCode: string) {
|
||||||
const { authenticator } = await import("otplib");
|
const { authenticator } = await this.runtimeDepsService.importRuntime("otplib");
|
||||||
const setting = await this.getSetting(userId);
|
const setting = await this.getSetting(userId);
|
||||||
if (!setting.authenticator.enabled) {
|
if (!setting.authenticator.enabled) {
|
||||||
throw new Error("authenticator 未开启");
|
throw new Error("authenticator 未开启");
|
||||||
|
|||||||
+9
-6
@@ -57,12 +57,12 @@ input:
|
|||||||
action: TestRequest
|
action: TestRequest
|
||||||
helper: 测试登录并拉取代理主机列表。
|
helper: 测试登录并拉取代理主机列表。
|
||||||
content: |
|
content: |
|
||||||
const { BaseAccess } = await import("@certd/pipeline");
|
const runtimeImport = import;
|
||||||
const httpsModule = await import("node:https");
|
const { BaseAccess } = await runtimeImport("@certd/pipeline");
|
||||||
const { URL } = await import("node:url");
|
const httpsModule = await runtimeImport("node:https");
|
||||||
const axiosModule = await import("axios");
|
const { URL } = await runtimeImport("node:url");
|
||||||
const formDataModule = await import("form-data");
|
const axiosModule = await runtimeImport("axios");
|
||||||
const { authenticator } = await import("otplib");
|
const formDataModule = await runtimeImport("form-data");
|
||||||
|
|
||||||
const https = httpsModule.default ?? httpsModule;
|
const https = httpsModule.default ?? httpsModule;
|
||||||
const axios = axiosModule.default ?? axiosModule;
|
const axios = axiosModule.default ?? axiosModule;
|
||||||
@@ -114,6 +114,7 @@ content: |
|
|||||||
class NginxProxyManagerClient {
|
class NginxProxyManagerClient {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
this.importFn = options.importFn;
|
||||||
this.endpoint = normalizeEndpoint(options.endpoint);
|
this.endpoint = normalizeEndpoint(options.endpoint);
|
||||||
this.apiBaseUrl = `${this.endpoint}/api`;
|
this.apiBaseUrl = `${this.endpoint}/api`;
|
||||||
this.token = undefined;
|
this.token = undefined;
|
||||||
@@ -267,6 +268,7 @@ content: |
|
|||||||
|
|
||||||
let code;
|
let code;
|
||||||
try {
|
try {
|
||||||
|
const { authenticator } = await this.importFn("otplib");
|
||||||
code = authenticator.generate(this.options.totpSecret);
|
code = authenticator.generate(this.options.totpSecret);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw describeError(error, "Generating TOTP code");
|
throw describeError(error, "Generating TOTP code");
|
||||||
@@ -327,6 +329,7 @@ content: |
|
|||||||
password: this.password,
|
password: this.password,
|
||||||
totpSecret: this.totpSecret || undefined,
|
totpSecret: this.totpSecret || undefined,
|
||||||
ignoreTls: this.ignoreTls === true,
|
ignoreTls: this.ignoreTls === true,
|
||||||
|
importFn: this.importRuntime.bind(this),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
23:48
|
02:48
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
00:00
|
03:41
|
||||||
|
|||||||
Reference in New Issue
Block a user