Compare commits

..

14 Commits

Author SHA1 Message Date
xiaojunnuo
f548fe7011 v1.25.8 2024-09-30 18:06:16 +08:00
xiaojunnuo
17a9beb514 chore: 2024-09-30 18:00:51 +08:00
xiaojunnuo
8d42273665 perf: 群晖获取deviceid优化 2024-09-30 18:00:35 +08:00
xiaojunnuo
251e450fab fix: 修复pfxPassword无效的bug 2024-09-30 13:52:18 +08:00
xiaojunnuo
d3ba3254f1 chore: 宝塔form body querystring 2024-09-30 12:25:44 +08:00
xiaojunnuo
196f9c5fa8 chore: 2024-09-30 11:00:41 +08:00
xiaojunnuo
d00f7ee010 chore: 2024-09-30 11:00:28 +08:00
xiaojunnuo
345571cdff chore: 2024-09-30 10:59:07 +08:00
xiaojunnuo
1bdf7cf439 chore: 忽略证书校验 2024-09-30 10:17:12 +08:00
xiaojunnuo
9c253e8c49 chore: 2024-09-30 09:43:29 +08:00
xiaojunnuo
1c0b040eb0 chore: 2024-09-30 09:41:48 +08:00
xiaojunnuo
939b8d4aa9 Merge remote-tracking branch 'origin/v2' into v2 2024-09-30 09:35:48 +08:00
xiaojunnuo
eec9e2e742 chore: 2024-09-30 09:35:22 +08:00
xiaojunnuo
62f5b18022 build: trigger build image 2024-09-30 02:35:01 +08:00
40 changed files with 263 additions and 83 deletions

View File

@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/certd/certd/compare/v1.25.7...v1.25.8) (2024-09-30)
### Bug Fixes
* 修复pfxPassword无效的bug ([251e450](https://github.com/certd/certd/commit/251e450fabfe62405bac13e39f2153736c081ef0))
### Performance Improvements
* 群晖获取deviceid优化 ([8d42273](https://github.com/certd/certd/commit/8d4227366548eb70f6bc04303829e6933168f906))
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
### Bug Fixes

View File

@@ -1,4 +1,6 @@
# Certd Open Source License
Certd Open Source License
- This project is licensed under the **GNU Affero General Public License (AGPL)** with the following additional terms.
- 本项目遵循 GNU Affero General Public LicenseAGPL并附加以下条款。

View File

@@ -5,22 +5,6 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的工具。
关键字:证书自动申请、证书自动更新、证书自动续期、证书自动续签
************************
支持开源,为爱发电,我已入驻爱发电
https://afdian.com/a/greper
发电权益:
1. 可加入发电专属群,可以获得作者一对一技术支持
2. 您的需求我们将优先实现,并且将作为专业版功能提供
3. 一年期专业版激活码
4. 赠送国外免费服务器部署方案0成本使用Certd可能需要翻墙不过现在性能越来越差了
专业版特权
1. 证书流水线条数无限制免费版限制10条
2. 免配置发邮件功能
3. FTP上传、cdnfly、宝塔等部署插件
4. 更多功能增加中...
************************
## 一、特性
本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。
@@ -222,16 +206,28 @@ docker compose up -d
</p>
## 十、捐赠
************************
支持开源,为爱发电,我已入驻爱发电
https://afdian.com/a/greper
发电权益:
1. 可加入发电专属群(先加我好友,发送发电截图,我拉你进群)
2. 的需求优先实现
3. 可以获得作者一对一技术支持
4. 更多权益陆续增加中...
1. 可加入发电专属群,可以获得作者一对一技术支持
2. 的需求我们将优先实现,并且将作为专业版功能提供
3. 一年期专业版激活码
4. 赠送国外免费服务器部署方案0成本使用Certd可能需要翻墙不过现在性能越来越差了
专业版特权对比
| 功能 | 免费版 | 专业版 |
|---------|------------------------|-----------------------|
| 免费证书申请 | 免费无限制 | 免费无限制 |
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署等 | 支持群晖、宝塔、1Panel等持续开发中 |
| 发邮件功能 | 需要配置 | 免配置 |
| 证书流水线条数 | 10条 | 无限制 |
************************
## 十一、贡献代码
1. 本地开发 [贡献插件教程](./doc/dev/development.md)

View File

@@ -1 +1 @@
02:30
02:35

View File

@@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.25.7"
"version": "1.25.8"
}

View File

@@ -12,8 +12,9 @@
"scripts": {
"start": "lerna bootstrap --hoist",
"i-all": "lerna link && lerna exec npm install ",
"publish": "npm run prepublishOnly2 && lerna publish --force-publish=pro/plus-core --conventional-commits --create-release github && npm run afterpublishOnly",
"publish": "npm run prepublishOnly2 && lerna publish --force-publish=pro/plus-core --conventional-commits --create-release github && npm run afterpublishOnly && npm run commitAll",
"afterpublishOnly": "time /t >build.trigger && git add ./build.trigger && git commit -m \"build: trigger build image\" && TIMEOUT /T 10 && git push",
"commitAll" : "git add . && git commit -m \"build: publish\" && git push",
"prepublishOnly1": "npm run check && lerna run build ",
"prepublishOnly2": "npm run check && npm run before-build && lerna run build ",
"before-build": "cd ./packages/pro/plus-core && time /t >build.md && git add ./build.md && git commit -m \"build: prepare to build\"",

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/publishlab/node-acme-client/compare/v1.25.7...v1.25.8) (2024-09-30)
**Note:** Version bump only for package @certd/acme-client
## [1.25.7](https://github.com/publishlab/node-acme-client/compare/v1.25.6...v1.25.7) (2024-09-29)
**Note:** Version bump only for package @certd/acme-client

View File

@@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client",
"private": false,
"author": "nmorsman",
"version": "1.25.7",
"version": "1.25.8",
"main": "src/index.js",
"types": "types/index.d.ts",
"license": "MIT",
@@ -59,5 +59,5 @@
"bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues"
},
"gitHead": "5668a3e2225059d9d2d236e698b020e272bba076"
"gitHead": "a7ecda9b36e318d169fe1a198fee8455941f44f1"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/certd/certd/compare/v1.25.7...v1.25.8) (2024-09-30)
**Note:** Version bump only for package @certd/pipeline
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
### Bug Fixes

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.25.7",
"version": "1.25.8",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -63,5 +63,5 @@
"vite": "^4.3.8",
"vue-tsc": "^1.6.5"
},
"gitHead": "5668a3e2225059d9d2d236e698b020e272bba076"
"gitHead": "a7ecda9b36e318d169fe1a198fee8455941f44f1"
}

View File

@@ -27,7 +27,10 @@ export class AccessRequestHandler<T = any> {
throw new Error("action is required");
}
const methodName = `on${_.upperFirst(req.action)}`;
let methodName = req.action;
if (!req.action.startsWith("on")) {
methodName = `on${_.upperFirst(req.action)}`;
}
// @ts-ignore
const method = this[methodName];
@@ -38,4 +41,3 @@ export class AccessRequestHandler<T = any> {
throw new Error(`action ${req.action} not found`);
}
}

View File

@@ -4,7 +4,7 @@ import { FileStore } from "../core/file-store.js";
import { Logger } from "log4js";
import { IAccessService } from "../access/index.js";
import { IEmailService } from "../service/index.js";
import { IContext, PluginRequestHandleReq } from "../core/index.js";
import { IContext, PluginRequestHandleReq, RunnableCollection } from "../core/index.js";
import { ILogger, logger, utils } from "../utils/index.js";
import { HttpClient } from "../utils/util.request";
import dayjs from "dayjs";
@@ -165,7 +165,10 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
throw new Error("action is required");
}
const methodName = `on${_.upperFirst(req.action)}`;
let methodName = req.action;
if (!req.action.startsWith("on")) {
methodName = `on${_.upperFirst(req.action)}`;
}
// @ts-ignore
const method = this[methodName];
@@ -179,6 +182,21 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
isAdmin() {
return this.ctx.user.role === "admin";
}
getStepFromPipeline(stepId: string) {
let found: any = null;
RunnableCollection.each(this.ctx.pipeline.stages, (step) => {
if (step.id === stepId) {
found = step;
return;
}
});
return found;
}
getStepIdFromRefInput(ref = ".") {
return ref.split(".")[1];
}
}
export type OutputVO = {

View File

@@ -139,6 +139,7 @@ export const http = createAxiosService({ logger }) as HttpClient;
export type HttpClientResponse<R> = any;
export type HttpRequestConfig<D> = {
skipSslVerify?: boolean;
skipCheckRes?: boolean;
} & AxiosRequestConfig<D>;
export type HttpClient = {
request<D = any, R = any>(config: HttpRequestConfig<D>): Promise<HttpClientResponse<R>>;

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/certd/certd/compare/v1.25.7...v1.25.8) (2024-09-30)
**Note:** Version bump only for package @certd/lib-huawei
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
**Note:** Version bump only for package @certd/lib-huawei

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.25.7",
"version": "1.25.8",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts",
@@ -17,5 +17,5 @@
"rimraf": "^5.0.5",
"rollup": "^3.7.4"
},
"gitHead": "5668a3e2225059d9d2d236e698b020e272bba076"
"gitHead": "a7ecda9b36e318d169fe1a198fee8455941f44f1"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/certd/certd/compare/v1.25.7...v1.25.8) (2024-09-30)
**Note:** Version bump only for package @certd/lib-iframe
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
**Note:** Version bump only for package @certd/lib-iframe

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.25.7",
"version": "1.25.8",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -38,5 +38,5 @@
"tslib": "^2.5.2",
"typescript": "^5.4.2"
},
"gitHead": "5668a3e2225059d9d2d236e698b020e272bba076"
"gitHead": "a7ecda9b36e318d169fe1a198fee8455941f44f1"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/certd/certd/compare/v1.25.7...v1.25.8) (2024-09-30)
**Note:** Version bump only for package @certd/lib-jdcloud
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
**Note:** Version bump only for package @certd/lib-jdcloud

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-jdcloud",
"private": false,
"version": "1.25.7",
"version": "1.25.8",
"main": "./dist/bundle.mjs",
"module": "./dist/bundle.mjs",
"types": "./dist/d/index.d.ts",
@@ -27,5 +27,5 @@
"rimraf": "^5.0.5",
"rollup": "^3.7.4"
},
"gitHead": "5668a3e2225059d9d2d236e698b020e272bba076"
"gitHead": "a7ecda9b36e318d169fe1a198fee8455941f44f1"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/certd/certd/compare/v1.25.7...v1.25.8) (2024-09-30)
**Note:** Version bump only for package @certd/lib-k8s
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
**Note:** Version bump only for package @certd/lib-k8s

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-k8s",
"private": false,
"version": "1.25.7",
"version": "1.25.8",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -17,7 +17,7 @@
"@kubernetes/client-node": "0.21.0"
},
"devDependencies": {
"@certd/pipeline": "^1.25.7",
"@certd/pipeline": "^1.25.8",
"@rollup/plugin-commonjs": "^23.0.4",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
@@ -39,5 +39,5 @@
"tslib": "^2.5.2",
"typescript": "^5.4.2"
},
"gitHead": "5668a3e2225059d9d2d236e698b020e272bba076"
"gitHead": "a7ecda9b36e318d169fe1a198fee8455941f44f1"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/certd/certd/compare/v1.25.7...v1.25.8) (2024-09-30)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
**Note:** Version bump only for package @certd/midway-flyway-js

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.25.7",
"version": "1.25.8",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -55,5 +55,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "5668a3e2225059d9d2d236e698b020e272bba076"
"gitHead": "a7ecda9b36e318d169fe1a198fee8455941f44f1"
}

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/certd/certd/compare/v1.25.7...v1.25.8) (2024-09-30)
### Bug Fixes
* 修复pfxPassword无效的bug ([251e450](https://github.com/certd/certd/commit/251e450fabfe62405bac13e39f2153736c081ef0))
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
**Note:** Version bump only for package @certd/plugin-cert

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-cert",
"private": false,
"version": "1.25.7",
"version": "1.25.8",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -14,8 +14,8 @@
"preview": "vite preview"
},
"dependencies": {
"@certd/acme-client": "^1.25.7",
"@certd/pipeline": "^1.25.7",
"@certd/acme-client": "^1.25.8",
"@certd/pipeline": "^1.25.8",
"dayjs": "^1.11.7",
"jszip": "^3.10.1",
"node-forge": "^0.10.0",
@@ -55,5 +55,5 @@
"vite": "^3.1.0",
"vue-tsc": "^0.38.9"
},
"gitHead": "5668a3e2225059d9d2d236e698b020e272bba076"
"gitHead": "a7ecda9b36e318d169fe1a198fee8455941f44f1"
}

View File

@@ -65,6 +65,13 @@ export class CertReader {
return { detail, expires };
}
getAllDomains() {
const { detail } = this.getCrtDetail();
const domains = [detail.domains.commonName];
domains.push(...detail.domains.altNames);
return domains;
}
saveToFile(type: "crt" | "key" | "pfx" | "der" | "ic", filepath?: string) {
if (!this.cert[type]) {
return;

View File

@@ -21,12 +21,12 @@ export class CertConverter {
const certReader = new CertReader(opts.cert);
let pfxPath: string;
let derPath: string;
const handle = async (opts: CertReaderHandleContext) => {
const handle = async (ctx: CertReaderHandleContext) => {
// 调用openssl 转pfx
pfxPath = await this.convertPfx(opts);
pfxPath = await this.convertPfx(ctx, opts.pfxPassword);
// 转der
derPath = await this.convertDer(opts);
derPath = await this.convertDer(ctx);
};
await certReader.readCertFile({ logger: this.logger, handle });
@@ -44,7 +44,7 @@ export class CertConverter {
});
}
private async convertPfx(opts: CertReaderHandleContext, pfxPassword?: string) {
private async convertPfx(opts: CertReaderHandleContext, pfxPassword: string) {
const { tmpCrtPath, tmpKeyPath } = opts;
const pfxPath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + "", "cert.pfx");

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/certd/certd/compare/v1.25.7...v1.25.8) (2024-09-30)
### Performance Improvements
* 群晖获取deviceid优化 ([8d42273](https://github.com/certd/certd/commit/8d4227366548eb70f6bc04303829e6933168f906))
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
**Note:** Version bump only for package @certd/ui-client

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.25.7",
"version": "1.25.8",
"private": true,
"scripts": {
"dev": "vite --open",
@@ -58,8 +58,8 @@
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@certd/lib-iframe": "^1.25.7",
"@certd/pipeline": "^1.25.7",
"@certd/lib-iframe": "^1.25.8",
"@certd/pipeline": "^1.25.8",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",

View File

@@ -0,0 +1,61 @@
<script setup lang="ts">
import { inject, ref, watch } from "vue";
const props = defineProps<{
inputKey?: string;
modelValue?: string[];
}>();
const emit = defineEmits<{
"update:modelValue": any;
}>();
const pipeline: any = inject("pipeline");
function findStepFromPipeline(targetStepId: string) {
for (const stage of pipeline.value.stages) {
for (const task of stage.tasks) {
for (const step of task.steps) {
if (step.id === targetStepId) {
return step;
}
}
}
}
}
const errorRef = ref("");
function getDomainFromPipeline(inputKey: string) {
if (!inputKey) {
errorRef.value = "请先选择域名证书";
return;
}
const targetStepId = inputKey.split(".")[1];
const certStep = findStepFromPipeline(targetStepId);
if (!certStep) {
errorRef.value = "找不到目标步骤,请先选择域名证书";
return;
}
const domain = certStep.input["domains"];
emit("update:modelValue", domain);
}
watch(
() => {
return props.inputKey;
},
(inputKey: string) => {
getDomainFromPipeline(inputKey);
},
{
immediate: true
}
);
</script>
<template>
<a-select mode="tags" readonly :value="modelValue" />
<div>{{ errorRef }}</div>
</template>
<style lang="less"></style>

View File

@@ -22,6 +22,19 @@ const getOptions = async () => {
});
};
const filterOption = (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 || String(option.value).toLowerCase().indexOf(input.toLowerCase());
};
let isFirst = true;
async function onClick() {
if (!isFirst) {
return;
}
isFirst = false;
optionsRef.value = await getOptions();
}
watch(
() => {
const values = [];
@@ -35,13 +48,20 @@ watch(
},
async () => {
optionsRef.value = await getOptions();
},
{ immediate: true }
}
);
</script>
<template>
<a-select class="remote-select" :options="optionsRef" :value="value" @update:value="emit('update:value', $event)" />
<a-select
class="remote-select"
show-search
:filter-option="filterOption"
:options="optionsRef"
:value="value"
@click="onClick"
@update:value="emit('update:value', $event)"
/>
</template>
<style lang="less"></style>

View File

@@ -1,8 +1,10 @@
import SynologyIdDeviceGetter from "./synology/device-id-getter.vue";
import RemoteSelect from "./common/remote-select.vue";
import CertDomainsGetter from "./common/cert-domains-getter.vue";
export default {
install(app: any) {
app.component("SynologyDeviceIdGetter", SynologyIdDeviceGetter);
app.component("RemoteSelect", RemoteSelect);
app.component("CertDomainsGetter", CertDomainsGetter);
}
};

View File

@@ -7,10 +7,10 @@ export type ComponentPropsType = {
value?: any;
};
export type RequestHandleReq<T = any> = {
type: strin;
type: string;
typeName: string;
action: string;
data: any;
data?: any;
input: T;
};

View File

@@ -32,7 +32,7 @@ async function loginWithOTPCode(otpCode: string) {
data: {
otpCode
},
form: props.form
input: props.form
});
}

View File

@@ -4,6 +4,20 @@
# server:
# baseUrl: 'http://127.0.0.1:11007'
#flyway:
# scriptDir: './db/migration-pg'
#typeorm:
# dataSource:
# default:
# type: postgres
# host: localhost
# port: 5433
# username: postgres
# password: root
# database: postgres
plus:
server:
baseUrls: ['https://api.ai.handsfree.work', 'https://api.ai.docmirror.cn']

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/certd/certd/compare/v1.25.7...v1.25.8) (2024-09-30)
**Note:** Version bump only for package @certd/ui-server
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/ui-server",
"version": "1.25.7",
"version": "1.25.8",
"description": "fast-server base midway",
"private": true,
"type": "module",
@@ -16,20 +16,20 @@
"build": "mwtsc --cleanOutDir --skipLibCheck",
"build-on-docker": "node ./before-build.js && npm run build",
"up-mw-deps": "npx midway-version -u -w",
"heap": "clinic heapprofiler -- node ./bootstrap.js",
"heap": "clinic heapprofiler -- node ./bootstrap.js",
"flame": "clinic flame -- node ./bootstrap.js"
},
"dependencies": {
"@alicloud/cs20151215": "^3.0.3",
"@alicloud/pop-core": "^1.7.10",
"@certd/acme-client": "^1.25.7",
"@certd/lib-huawei": "^1.25.7",
"@certd/lib-jdcloud": "^1.25.7",
"@certd/lib-k8s": "^1.25.7",
"@certd/midway-flyway-js": "^1.25.7",
"@certd/pipeline": "^1.25.7",
"@certd/plugin-cert": "^1.25.7",
"@certd/plugin-plus": "^1.25.7",
"@certd/acme-client": "^1.25.8",
"@certd/lib-huawei": "^1.25.8",
"@certd/lib-jdcloud": "^1.25.8",
"@certd/lib-k8s": "^1.25.8",
"@certd/midway-flyway-js": "^1.25.8",
"@certd/pipeline": "^1.25.8",
"@certd/plugin-cert": "^1.25.8",
"@certd/plugin-plus": "^1.25.8",
"@certd/plus-core": "^1.25.6",
"@koa/cors": "^5.0.0",
"@midwayjs/bootstrap": "^3.16.2",

View File

@@ -37,22 +37,19 @@ export class HandleController extends BaseController {
//@ts-ignore
const access = new accessCls();
let isNew = true;
let inputAccess = body.input.access;
if (body.input.id > 0) {
const oldEntity = await this.accessService.info(body.input.id);
if (!oldEntity) {
isNew = false;
const param = {
if (oldEntity) {
const param: any = {
type: body.typeName,
setting: JSON.stringify(body.input.access),
};
this.accessService.encryptSetting(param, oldEntity);
body.input.access = JSON.parse(param.setting);
inputAccess = this.accessService.decryptAccessEntity(param);
}
}
if (isNew) {
mergeUtils.merge(access, body.input.access);
}
mergeUtils.merge(access, inputAccess);
const ctx: AccessRequestHandleContext = {
http: http,

View File

@@ -108,6 +108,14 @@ export class AccessService extends BaseService<AccessEntity> implements IAccessS
throw new Error(`该授权配置不存在,请确认是否已被删除:id=${id}`);
}
// const access = accessRegistry.get(entity.type);
const setting = this.decryptAccessEntity(entity);
return {
id: entity.id,
...setting,
};
}
decryptAccessEntity(entity: AccessEntity): any {
let setting = {};
if (entity.encryptSetting && entity.encryptSetting !== '{}') {
setting = JSON.parse(entity.encryptSetting);
@@ -123,10 +131,7 @@ export class AccessService extends BaseService<AccessEntity> implements IAccessS
} else if (entity.setting) {
setting = JSON.parse(entity.setting);
}
return {
id: entity.id,
...setting,
};
return setting;
}
getDefineList() {

View File

@@ -8,7 +8,7 @@ export class PluginService {
const list = [];
for (const key in collection) {
const Plugin = collection[key];
if (Plugin?.define.deprecated) {
if (Plugin?.define?.deprecated) {
continue;
}
list.push({ ...Plugin.define, key });