Merge branch 'v2-dev' into v2

pull/469/head
xiaojunnuo 2025-07-22 12:27:51 +08:00
commit ef3faf5832
44 changed files with 605 additions and 516 deletions

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
### Bug Fixes
* 安全更新,备份数据库插件仅限管理员运行 ([13dfca1](https://github.com/certd/certd/commit/13dfca1749275526c82465a17c482b607c820fdd))
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
### Bug Fixes

View File

@ -1 +1 @@
23:09
12:27

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
### Bug Fixes
* 安全更新,备份数据库插件仅限管理员运行 ([13dfca1](https://github.com/certd/certd/commit/13dfca1749275526c82465a17c482b607c820fdd))
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
### Bug Fixes

View File

@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.36.10"
"version": "1.36.11"
}

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.36.11](https://github.com/publishlab/node-acme-client/compare/v1.36.10...v1.36.11) (2025-07-22)
**Note:** Version bump only for package @certd/acme-client
## [1.36.10](https://github.com/publishlab/node-acme-client/compare/v1.36.9...v1.36.10) (2025-07-18)
**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.36.10",
"version": "1.36.11",
"type": "module",
"module": "scr/index.js",
"main": "src/index.js",
@ -18,7 +18,7 @@
"types"
],
"dependencies": {
"@certd/basic": "^1.36.10",
"@certd/basic": "^1.36.11",
"@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5",
"axios": "^1.7.2",
@ -69,5 +69,5 @@
"bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues"
},
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
"gitHead": "7f9c4e52ac5c3837b251d3b2508457ce802e11cb"
}

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
**Note:** Version bump only for package @certd/basic
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/basic

View File

@ -1 +1 @@
23:02
12:23

View File

@ -1,7 +1,7 @@
{
"name": "@certd/basic",
"private": false,
"version": "1.36.10",
"version": "1.36.11",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@ -45,5 +45,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
"gitHead": "7f9c4e52ac5c3837b251d3b2508457ce802e11cb"
}

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
### Bug Fixes
* 安全更新,备份数据库插件仅限管理员运行 ([13dfca1](https://github.com/certd/certd/commit/13dfca1749275526c82465a17c482b607c820fdd))
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/pipeline

View File

@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.36.10",
"version": "1.36.11",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@ -17,8 +17,8 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/basic": "^1.36.10",
"@certd/plus-core": "^1.36.10",
"@certd/basic": "^1.36.11",
"@certd/plus-core": "^1.36.11",
"dayjs": "^1.11.7",
"lodash-es": "^4.17.21",
"reflect-metadata": "^0.1.13"
@ -44,5 +44,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
"gitHead": "7f9c4e52ac5c3837b251d3b2508457ce802e11cb"
}

View File

@ -352,6 +352,7 @@ export class Executor {
pipeline: this.pipeline,
runtime: this.runtime,
step,
define: cloneDeep(define),
lastStatus,
http,
download,

View File

@ -59,6 +59,7 @@ export type PluginDefine = Registrable & {
form: any;
};
};
onlyAdmin?: boolean;
needPlus?: boolean;
showRunStrategy?: boolean;
pluginType?: string; //类型
@ -85,6 +86,7 @@ export type TaskInstanceContext = {
runtime: RunHistory;
//步骤定义
step: Step;
define: PluginDefine;
//日志
logger: ILogger;
//当前步骤输入参数跟上一次执行比较是否有变化
@ -162,6 +164,12 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
this.registerSecret(cert.key);
this.registerSecret(cert.one);
}
if (this.ctx.define.onlyAdmin) {
if (!this.isAdmin()) {
throw new Error("只有管理员才能运行此任务");
}
}
}
async getAccess<T = any>(accessId: string | number, isCommon = false) {

View File

@ -30,4 +30,5 @@ export const pluginGroups = {
qiniu: new PluginGroup("qiniu", "七牛云", 5, "svg:icon-qiniuyun"),
aws: new PluginGroup("aws", "亚马逊云", 6, "svg:icon-aws"),
other: new PluginGroup("other", "其他", 10, "clarity:plugin-line"),
admin: new PluginGroup("admin", "管理", 11, "ion:settings-outline"),
};

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
**Note:** Version bump only for package @certd/lib-huawei
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/lib-huawei

View File

@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.36.10",
"version": "1.36.11",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts",
@ -24,5 +24,5 @@
"prettier": "^2.8.8",
"tslib": "^2.8.1"
},
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
"gitHead": "7f9c4e52ac5c3837b251d3b2508457ce802e11cb"
}

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
**Note:** Version bump only for package @certd/lib-iframe
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/lib-iframe

View File

@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.36.10",
"version": "1.36.11",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@ -31,5 +31,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
"gitHead": "7f9c4e52ac5c3837b251d3b2508457ce802e11cb"
}

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
**Note:** Version bump only for package @certd/jdcloud
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/jdcloud

View File

@ -1,6 +1,6 @@
{
"name": "@certd/jdcloud",
"version": "1.36.10",
"version": "1.36.11",
"description": "jdcloud openApi sdk",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
@ -61,5 +61,5 @@
"fetch"
]
},
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
"gitHead": "7f9c4e52ac5c3837b251d3b2508457ce802e11cb"
}

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
**Note:** Version bump only for package @certd/lib-k8s
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/lib-k8s

View File

@ -1,7 +1,7 @@
{
"name": "@certd/lib-k8s",
"private": false,
"version": "1.36.10",
"version": "1.36.11",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@ -17,7 +17,7 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/basic": "^1.36.10",
"@certd/basic": "^1.36.11",
"@kubernetes/client-node": "0.21.0"
},
"devDependencies": {
@ -32,5 +32,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
"gitHead": "7f9c4e52ac5c3837b251d3b2508457ce802e11cb"
}

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
**Note:** Version bump only for package @certd/lib-server
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/lib-server

View File

@ -1,6 +1,6 @@
{
"name": "@certd/lib-server",
"version": "1.36.10",
"version": "1.36.11",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@ -27,10 +27,10 @@
],
"license": "AGPL",
"dependencies": {
"@certd/acme-client": "^1.36.10",
"@certd/basic": "^1.36.10",
"@certd/pipeline": "^1.36.10",
"@certd/plus-core": "^1.36.10",
"@certd/acme-client": "^1.36.11",
"@certd/basic": "^1.36.11",
"@certd/pipeline": "^1.36.11",
"@certd/plus-core": "^1.36.11",
"@midwayjs/cache": "~3.14.0",
"@midwayjs/core": "~3.20.3",
"@midwayjs/i18n": "~3.20.3",
@ -61,5 +61,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
"gitHead": "7f9c4e52ac5c3837b251d3b2508457ce802e11cb"
}

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/midway-flyway-js

View File

@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.36.10",
"version": "1.36.11",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@ -46,5 +46,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
"gitHead": "7f9c4e52ac5c3837b251d3b2508457ce802e11cb"
}

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
**Note:** Version bump only for package @certd/plugin-cert
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/plugin-cert

View File

@ -1,7 +1,7 @@
{
"name": "@certd/plugin-cert",
"private": false,
"version": "1.36.10",
"version": "1.36.11",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@ -16,10 +16,10 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/acme-client": "^1.36.10",
"@certd/basic": "^1.36.10",
"@certd/pipeline": "^1.36.10",
"@certd/plugin-lib": "^1.36.10",
"@certd/acme-client": "^1.36.11",
"@certd/basic": "^1.36.11",
"@certd/pipeline": "^1.36.11",
"@certd/plugin-lib": "^1.36.11",
"@google-cloud/publicca": "^1.3.0",
"dayjs": "^1.11.7",
"jszip": "^3.10.1",
@ -43,5 +43,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
"gitHead": "7f9c4e52ac5c3837b251d3b2508457ce802e11cb"
}

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
**Note:** Version bump only for package @certd/plugin-lib
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
**Note:** Version bump only for package @certd/plugin-lib

View File

@ -1,7 +1,7 @@
{
"name": "@certd/plugin-lib",
"private": false,
"version": "1.36.10",
"version": "1.36.11",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@ -21,8 +21,8 @@
"@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.10",
"@aws-sdk/client-s3": "^3.787.0",
"@certd/basic": "^1.36.10",
"@certd/pipeline": "^1.36.10",
"@certd/basic": "^1.36.11",
"@certd/pipeline": "^1.36.11",
"@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5",
@ -53,5 +53,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "085bdf5cfa9140903611aa12cdd2542d05aba321"
"gitHead": "7f9c4e52ac5c3837b251d3b2508457ce802e11cb"
}

View File

@ -9,3 +9,4 @@ yarn.lock
/.idea/
yarn-error.log
vite-profile.cpuprofile
!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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
**Note:** Version bump only for package @certd/ui-client
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
### Performance Improvements

View File

@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.36.10",
"version": "1.36.11",
"private": true,
"scripts": {
"dev": "vite --open",
@ -103,8 +103,8 @@
"zod-defaults": "^0.1.3"
},
"devDependencies": {
"@certd/lib-iframe": "^1.36.10",
"@certd/pipeline": "^1.36.10",
"@certd/lib-iframe": "^1.36.11",
"@certd/pipeline": "^1.36.11",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",

View File

@ -112,7 +112,8 @@ function menuIcon(menu: MenuRecordRaw) {
.vben-normal-menu__name,
.vben-normal-menu__icon {
@apply text-primary-foreground font-semibold;
//@apply text-primary-foreground font-semibold;
@apply font-semibold;
}
}

View File

@ -26,43 +26,45 @@
</template>
<div class="flex-col h-100 w-100 overflow-hidden">
<a-tabs v-model:active-key="pluginGroupActive" tab-position="left" class="flex-1 overflow-hidden">
<a-tab-pane v-for="group of computedPluginGroups" :key="group.key" class="scroll-y">
<template #tab>
<div class="cd-step-form-tab-label">
<fs-icon :icon="group.icon" class="mr-2" />
<div>{{ group.title }}</div>
</div>
</template>
<a-row v-if="!group.plugins || group.plugins.length === 0" :gutter="10">
<a-col class="flex-o">
<div class="flex-o m-10">没有找到插件</div>
</a-col>
</a-row>
<a-row v-else :gutter="10">
<a-col v-for="item of group.plugins" :key="item.key" class="step-plugin w-full md:w-[50%]">
<a-card
hoverable
:class="{ current: item.name === currentStep.type }"
@click="stepTypeSelected(item)"
@dblclick="
stepTypeSelected(item);
stepTypeSave();
"
>
<a-card-meta>
<template #title>
<fs-icon class="plugin-icon" :icon="item.icon || 'clarity:plugin-line'"></fs-icon>
<span class="title" :title="item.title">{{ item.title }}</span>
<vip-button v-if="item.needPlus" mode="icon" />
</template>
<template #description>
<span :title="item.desc" v-html="transformDesc(item.desc)"></span>
</template>
</a-card-meta>
</a-card>
</a-col>
</a-row>
</a-tab-pane>
<template v-for="group of computedPluginGroups" :key="group.key">
<a-tab-pane v-if="(group.key === 'admin' && userStore.isAdmin) || group.key !== 'admin'" :key="group.key" class="scroll-y">
<template #tab>
<div class="cd-step-form-tab-label">
<fs-icon :icon="group.icon" class="mr-2" />
<div>{{ group.title }}</div>
</div>
</template>
<a-row v-if="!group.plugins || group.plugins.length === 0" :gutter="10">
<a-col class="flex-o">
<div class="flex-o m-10">没有找到插件</div>
</a-col>
</a-row>
<a-row v-else :gutter="10">
<a-col v-for="item of group.plugins" :key="item.key" class="step-plugin w-full md:w-[50%]">
<a-card
hoverable
:class="{ current: item.name === currentStep.type }"
@click="stepTypeSelected(item)"
@dblclick="
stepTypeSelected(item);
stepTypeSave();
"
>
<a-card-meta>
<template #title>
<fs-icon class="plugin-icon" :icon="item.icon || 'clarity:plugin-line'"></fs-icon>
<span class="title" :title="item.title">{{ item.title }}</span>
<vip-button v-if="item.needPlus" mode="icon" />
</template>
<template #description>
<span :title="item.desc" v-html="transformDesc(item.desc)"></span>
</template>
</a-card-meta>
</a-card>
</a-col>
</a-row>
</a-tab-pane>
</template>
</a-tabs>
</div>
<template #footer>
@ -124,6 +126,7 @@ import { useReference } from "/@/use/use-refrence";
import { useSettingStore } from "/@/store/settings";
import { mitter } from "/@/utils/util.mitt";
import { utils } from "/@/utils";
import { useUserStore } from "/@/store/user";
defineOptions({
name: "PiStepForm",
@ -138,7 +141,7 @@ const props = defineProps({
const emit = defineEmits(["update"]);
const pluginStore = usePluginStore();
const userStore = useUserStore();
function transformDesc(desc: string = "") {
return utils.transformLink(desc);
}

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.36.11](https://github.com/certd/certd/compare/v1.36.10...v1.36.11) (2025-07-22)
### Bug Fixes
* 安全更新,备份数据库插件仅限管理员运行 ([13dfca1](https://github.com/certd/certd/commit/13dfca1749275526c82465a17c482b607c820fdd))
## [1.36.10](https://github.com/certd/certd/compare/v1.36.9...v1.36.10) (2025-07-18)
### Bug Fixes

View File

@ -1,6 +1,6 @@
{
"name": "@certd/ui-server",
"version": "1.36.10",
"version": "1.36.11",
"description": "fast-server base midway",
"private": true,
"type": "module",
@ -42,20 +42,20 @@
"@aws-sdk/client-cloudfront": "^3.699.0",
"@aws-sdk/client-iam": "^3.699.0",
"@aws-sdk/client-s3": "^3.705.0",
"@certd/acme-client": "^1.36.10",
"@certd/basic": "^1.36.10",
"@certd/commercial-core": "^1.36.10",
"@certd/acme-client": "^1.36.11",
"@certd/basic": "^1.36.11",
"@certd/commercial-core": "^1.36.11",
"@certd/cv4pve-api-javascript": "^8.4.1",
"@certd/jdcloud": "^1.36.10",
"@certd/lib-huawei": "^1.36.10",
"@certd/lib-k8s": "^1.36.10",
"@certd/lib-server": "^1.36.10",
"@certd/midway-flyway-js": "^1.36.10",
"@certd/pipeline": "^1.36.10",
"@certd/plugin-cert": "^1.36.10",
"@certd/plugin-lib": "^1.36.10",
"@certd/plugin-plus": "^1.36.10",
"@certd/plus-core": "^1.36.10",
"@certd/jdcloud": "^1.36.11",
"@certd/lib-huawei": "^1.36.11",
"@certd/lib-k8s": "^1.36.11",
"@certd/lib-server": "^1.36.11",
"@certd/midway-flyway-js": "^1.36.11",
"@certd/pipeline": "^1.36.11",
"@certd/plugin-cert": "^1.36.11",
"@certd/plugin-lib": "^1.36.11",
"@certd/plugin-plus": "^1.36.11",
"@certd/plus-core": "^1.36.11",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
"@koa/cors": "^5.0.0",

View File

@ -30,3 +30,4 @@ export * from './plugin-github/index.js'
export * from './plugin-namesilo/index.js'
export * from './plugin-proxmox/index.js'
export * from './plugin-wangsu/index.js'
export * from './plugin-admin/index.js'

View File

@ -0,0 +1,3 @@
export * from './plugin-restart.js';
export * from './plugin-script.js';
export * from './plugin-db-backup.js';

View File

@ -14,14 +14,15 @@ const defaultFilePrefix = 'db_backup';
name: 'DBBackupPlugin',
title: '数据库备份',
icon: 'lucide:database-backup',
desc: '仅支持备份SQLite数据库',
group: pluginGroups.other.key,
desc: '【仅管理员可用】仅支持备份SQLite数据库',
group: pluginGroups.admin.key,
showRunStrategy: true,
default: {
strategy: {
runStrategy: RunStrategy.AlwaysRun,
},
},
onlyAdmin:true,
needPlus: true,
})
export class DBBackupPlugin extends AbstractPlusTaskPlugin {
@ -157,6 +158,11 @@ export class DBBackupPlugin extends AbstractPlusTaskPlugin {
}
async execute(): Promise<void> {
if (!this.isAdmin()) {
throw new Error('只有管理员才能运行此任务');
}
this.logger.info('开始备份数据库');
let dbPath = process.env.certd_typeorm_dataSource_default_database;

View File

@ -1,12 +1,13 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy } from '@certd/pipeline';
import { httpsServer } from '../../../modules/auto/https/server.js';
import { httpsServer } from '../../modules/auto/https/server.js';
@IsTaskPlugin({
name: 'RestartCertd',
title: '重启 Certd',
icon: 'mdi:restart',
desc: '【仅管理员可用】 重启 certd的https服务用于更新 Certd 的 ssl 证书',
group: pluginGroups.other.key,
group: pluginGroups.admin.key,
onlyAdmin:true,
default: {
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,

View File

@ -11,8 +11,9 @@ export type CustomScriptContext = {
title: '自定义js脚本',
icon: 'ri:javascript-line',
desc: '【仅管理员】运行自定义js脚本执行',
group: pluginGroups.other.key,
group: pluginGroups.admin.key,
showRunStrategy: true,
onlyAdmin: true,
default: {
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,

View File

@ -1,5 +1,2 @@
export * from './plugin-restart.js';
export * from './plugin-script.js';
export * from './plugin-wait.js';
export * from './plugin-db-backup.js';
export * from './plugin-deploy-to-mail.js';

File diff suppressed because it is too large Load Diff