mirror of
https://github.com/certd/certd.git
synced 2026-04-18 08:30:51 +08:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1656e91296 | ||
|
|
5b7df9c175 | ||
|
|
8d8600aaa8 | ||
|
|
54d136cc6a | ||
|
|
661293c189 | ||
|
|
d10d42e206 | ||
|
|
b780eab5f5 | ||
|
|
315e43746b | ||
|
|
526c48450b | ||
|
|
abd2dcf2e8 | ||
|
|
87defa569c | ||
|
|
b4db5518db | ||
|
|
a50b635424 | ||
|
|
40a794f624 | ||
|
|
6876790374 |
2
.github/workflows/deploy-demo.yml
vendored
2
.github/workflows/deploy-demo.yml
vendored
@@ -38,7 +38,6 @@ jobs:
|
||||
with:
|
||||
time: '10' # for 60 seconds
|
||||
- name: deploy-certd-demo
|
||||
id: request
|
||||
uses: tyrrrz/action-http-request@master
|
||||
with:
|
||||
url: http://flow-openapi.aliyun.com/pipeline/webhook/lzCzlGrLCOHQaTMMt0mG
|
||||
@@ -53,7 +52,6 @@ jobs:
|
||||
retry-delay: 5000
|
||||
|
||||
- name: deploy-certd-doc
|
||||
id: request
|
||||
uses: tyrrrz/action-http-request@master
|
||||
with:
|
||||
url: http://flow-openapi.aliyun.com/pipeline/webhook/IiSxLDp9aOhgDUxJPytv
|
||||
|
||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -3,6 +3,20 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复阿里云部署大杀器报插件_还未注册错误的bug ([abd2dcf](https://github.com/certd/certd/commit/abd2dcf2e85a545321bae6451406d081f773b132))
|
||||
* 修复启动时自签证书无法保存的bug ([526c484](https://github.com/certd/certd/commit/526c48450bcd37b3ccded9b448f17de8140bdc6e))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 顶部菜单自定义 ([54d136c](https://github.com/certd/certd/commit/54d136cc6ae122f7c891b7a5c7232fe5de8e5cb5))
|
||||
* 禁用readonly用户 ([d10d42e](https://github.com/certd/certd/commit/d10d42e20619bb55a50d636b8867ff33db4e3b4b))
|
||||
* 限制其他用户流水线数量 ([315e437](https://github.com/certd/certd/commit/315e43746baf01682737f82e41579237a48409af))
|
||||
* 用户管理优化头像上传 ([661293c](https://github.com/certd/certd/commit/661293c189a3abf3cdc953b5225192372f57930d))
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1 +1 @@
|
||||
00:01
|
||||
20:31
|
||||
|
||||
@@ -5,7 +5,7 @@ import lightbox from "vitepress-plugin-lightbox";
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default defineConfig({
|
||||
title: "Certd",
|
||||
description: "Certd帮助文档,Certd是一款开源免费的全自动SSL证书管理工具;自动证书申请、更新、续期;通配符证书,泛域名证书申请;证书自动化部署到阿里云、腾讯云、主机、群晖、宝塔。",
|
||||
description: "Certd帮助文档,Certd是一款开源免费的全自动SSL证书管理工具;证书自动化申请部署流水线;自动证书申请、更新、续期;通配符证书,泛域名证书申请;证书自动化部署到阿里云、腾讯云、主机、群晖、宝塔。",
|
||||
markdown: {
|
||||
config: (md) => {
|
||||
// Use lightbox plugin
|
||||
@@ -23,7 +23,7 @@ export default defineConfig({
|
||||
// ],
|
||||
["meta", {
|
||||
name: "keywords",
|
||||
content: "证书自动申请、证书自动更新、证书自动续期、证书自动续签、证书管理工具、Certd、SSL证书自动部署、证书自动化,https证书,pfx证书,der证书,TLS证书,nginx证书自动续签自动部署,SSL平台,证书管理平台"
|
||||
content: "证书自动申请、证书自动更新、证书自动续期、证书自动续签、证书管理工具、Certd、SSL证书自动部署、证书自动化,https证书,pfx证书,der证书,TLS证书,nginx证书自动续签自动部署,SSL平台,证书管理平台,证书流水线"
|
||||
}],
|
||||
["meta", { name: "google-site-verification",content: "V5XLTSnXoT15uQotwpxJoQolUo2d5UbSL-TacsyOsC0"}],
|
||||
//<meta name="baidu-site-verification" content="codeva-MiWN8Y07Ua" />
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.26.13"
|
||||
"version": "1.26.14"
|
||||
}
|
||||
|
||||
@@ -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.26.14](https://github.com/publishlab/node-acme-client/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复启动时自签证书无法保存的bug ([526c484](https://github.com/publishlab/node-acme-client/commit/526c48450bcd37b3ccded9b448f17de8140bdc6e))
|
||||
|
||||
## [1.26.13](https://github.com/publishlab/node-acme-client/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "Simple and unopinionated ACME client",
|
||||
"private": false,
|
||||
"author": "nmorsman",
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"main": "src/index.js",
|
||||
"types": "types/index.d.ts",
|
||||
"license": "MIT",
|
||||
@@ -60,5 +60,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||
},
|
||||
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
|
||||
"gitHead": "586725a15c561436cda37de830b278907a6fc3f5"
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ function createAgent(opts = {}) {
|
||||
let httpAgent;
|
||||
let
|
||||
httpsAgent;
|
||||
const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy;
|
||||
const httpProxy = opts.httpProxy || process.env.HTTP_PROXY || process.env.http_proxy;
|
||||
if (httpProxy) {
|
||||
log(`acme use httpProxy:${httpProxy}`);
|
||||
httpAgent = new HttpProxyAgent(httpProxy, opts);
|
||||
@@ -16,7 +16,7 @@ function createAgent(opts = {}) {
|
||||
else {
|
||||
httpAgent = new nodeHttp.Agent(opts);
|
||||
}
|
||||
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
|
||||
const httpsProxy = opts.httpsProxy || process.env.HTTPS_PROXY || process.env.https_proxy;
|
||||
if (httpsProxy) {
|
||||
log(`acme use httpsProxy:${httpsProxy}`);
|
||||
httpsAgent = new HttpsProxyAgent(httpsProxy, opts);
|
||||
@@ -38,14 +38,7 @@ function getGlobalAgents() {
|
||||
|
||||
function setGlobalProxy(opts) {
|
||||
log('acme setGlobalProxy:', opts);
|
||||
if (opts.httpProxy) {
|
||||
process.env.HTTP_PROXY = opts.httpProxy;
|
||||
}
|
||||
if (opts.httpsProxy) {
|
||||
process.env.HTTPS_PROXY = opts.httpsProxy;
|
||||
}
|
||||
|
||||
defaultAgents = createAgent();
|
||||
defaultAgents = createAgent(opts);
|
||||
}
|
||||
|
||||
class HttpError extends Error {
|
||||
|
||||
@@ -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.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复启动时自签证书无法保存的bug ([526c484](https://github.com/certd/certd/commit/526c48450bcd37b3ccded9b448f17de8140bdc6e))
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
@@ -1 +1 @@
|
||||
20:27
|
||||
02:53
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -64,5 +64,5 @@
|
||||
"vite": "^4.3.8",
|
||||
"vue-tsc": "^1.6.5"
|
||||
},
|
||||
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
|
||||
"gitHead": "586725a15c561436cda37de830b278907a6fc3f5"
|
||||
}
|
||||
|
||||
@@ -61,14 +61,7 @@ let defaultAgents = createAgent();
|
||||
|
||||
export function setGlobalProxy(opts: { httpProxy?: string; httpsProxy?: string }) {
|
||||
logger.info('setGlobalProxy:', opts);
|
||||
if (opts.httpProxy) {
|
||||
process.env.HTTP_PROXY = opts.httpProxy;
|
||||
}
|
||||
if (opts.httpsProxy) {
|
||||
process.env.HTTPS_PROXY = opts.httpsProxy;
|
||||
}
|
||||
|
||||
defaultAgents = createAgent();
|
||||
defaultAgents = createAgent(opts);
|
||||
}
|
||||
|
||||
export function getGlobalAgents() {
|
||||
@@ -192,9 +185,13 @@ export type HttpClient = {
|
||||
request<D = any, R = any>(config: HttpRequestConfig<D>): Promise<HttpClientResponse<R>>;
|
||||
};
|
||||
|
||||
export function createAgent(opts: nodeHttp.AgentOptions = {}) {
|
||||
export type CreateAgentOptions = {
|
||||
httpProxy?: string;
|
||||
httpsProxy?: string;
|
||||
} & nodeHttp.AgentOptions;
|
||||
export function createAgent(opts: CreateAgentOptions = {}) {
|
||||
let httpAgent, httpsAgent;
|
||||
const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy;
|
||||
const httpProxy = opts.httpProxy || process.env.HTTP_PROXY || process.env.http_proxy;
|
||||
if (httpProxy) {
|
||||
logger.info('use httpProxy:', httpProxy);
|
||||
httpAgent = new HttpProxyAgent(httpProxy, opts as any);
|
||||
@@ -202,7 +199,7 @@ export function createAgent(opts: nodeHttp.AgentOptions = {}) {
|
||||
} else {
|
||||
httpAgent = new nodeHttp.Agent(opts);
|
||||
}
|
||||
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
|
||||
const httpsProxy = opts.httpsProxy || process.env.HTTPS_PROXY || process.env.https_proxy;
|
||||
if (httpsProxy) {
|
||||
logger.info('use httpsProxy:', httpsProxy);
|
||||
httpsAgent = new HttpsProxyAgent(httpsProxy, opts as any);
|
||||
|
||||
@@ -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.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -15,8 +15,8 @@
|
||||
"test": "mocha --loader=ts-node/esm"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.26.13",
|
||||
"@certd/plus-core": "^1.26.13",
|
||||
"@certd/basic": "^1.26.14",
|
||||
"@certd/plus-core": "^1.26.14",
|
||||
"axios": "^1.7.2",
|
||||
"dayjs": "^1.11.7",
|
||||
"fix-path": "^4.0.0",
|
||||
@@ -66,5 +66,5 @@
|
||||
"vite": "^4.3.8",
|
||||
"vue-tsc": "^1.6.5"
|
||||
},
|
||||
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
|
||||
"gitHead": "586725a15c561436cda37de830b278907a6fc3f5"
|
||||
}
|
||||
|
||||
@@ -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.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"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": "11d0daa59ae409c229037189066414f29b787de0"
|
||||
"gitHead": "586725a15c561436cda37de830b278907a6fc3f5"
|
||||
}
|
||||
|
||||
@@ -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.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -39,5 +39,5 @@
|
||||
"tslib": "^2.5.2",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
|
||||
"gitHead": "586725a15c561436cda37de830b278907a6fc3f5"
|
||||
}
|
||||
|
||||
@@ -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.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-jdcloud
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-jdcloud
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-jdcloud",
|
||||
"private": false,
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"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": "11d0daa59ae409c229037189066414f29b787de0"
|
||||
"gitHead": "586725a15c561436cda37de830b278907a6fc3f5"
|
||||
}
|
||||
|
||||
@@ -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.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -18,7 +18,7 @@
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/pipeline": "^1.26.13",
|
||||
"@certd/pipeline": "^1.26.14",
|
||||
"@rollup/plugin-commonjs": "^23.0.4",
|
||||
"@rollup/plugin-json": "^6.0.0",
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
@@ -40,5 +40,5 @@
|
||||
"tslib": "^2.5.2",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
|
||||
"gitHead": "586725a15c561436cda37de830b278907a6fc3f5"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 限制其他用户流水线数量 ([315e437](https://github.com/certd/certd/commit/315e43746baf01682737f82e41579237a48409af))
|
||||
* 用户管理优化头像上传 ([661293c](https://github.com/certd/certd/commit/661293c189a3abf3cdc953b5225192372f57930d))
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -26,9 +26,9 @@
|
||||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.26.13",
|
||||
"@certd/basic": "^1.26.13",
|
||||
"@certd/pipeline": "^1.26.13",
|
||||
"@certd/acme-client": "^1.26.14",
|
||||
"@certd/basic": "^1.26.14",
|
||||
"@certd/pipeline": "^1.26.14",
|
||||
"@midwayjs/cache": "~3.14.0",
|
||||
"@midwayjs/core": "~3.17.1",
|
||||
"@midwayjs/i18n": "~3.17.3",
|
||||
@@ -69,5 +69,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
|
||||
"gitHead": "586725a15c561436cda37de830b278907a6fc3f5"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Provide } from '@midwayjs/core';
|
||||
import { Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
import dayjs from 'dayjs';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
@@ -14,6 +14,7 @@ export const uploadTmpFileCacheKey = 'tmpfile_key_';
|
||||
/**
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Singleton)
|
||||
export class FileService {
|
||||
async saveFile(userId: number, tmpCacheKey: any, permission: 'public' | 'private') {
|
||||
if (tmpCacheKey.startsWith(`/${permission}`)) {
|
||||
|
||||
@@ -15,6 +15,7 @@ export class SysPublicSettings extends BaseSettings {
|
||||
static __title__ = '系统公共设置';
|
||||
static __access__ = 'public';
|
||||
registerEnabled = false;
|
||||
limitUserPipelineCount = 0;
|
||||
managerOtherUserPipeline = false;
|
||||
icpNo?: string;
|
||||
// triggerOnStartup = false;
|
||||
|
||||
@@ -127,14 +127,12 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
||||
|
||||
async reloadPrivateSettings() {
|
||||
const bean = await this.getPrivateSettings();
|
||||
if (bean.httpProxy || bean.httpsProxy) {
|
||||
const opts = {
|
||||
httpProxy: bean.httpProxy,
|
||||
httpsProxy: bean.httpsProxy,
|
||||
};
|
||||
setGlobalProxy(opts);
|
||||
agents.setGlobalProxy(opts);
|
||||
}
|
||||
const opts = {
|
||||
httpProxy: bean.httpProxy,
|
||||
httpsProxy: bean.httpsProxy,
|
||||
};
|
||||
setGlobalProxy(opts);
|
||||
agents.setGlobalProxy(opts);
|
||||
}
|
||||
|
||||
async updateByKey(key: string, setting: any) {
|
||||
|
||||
@@ -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.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -56,5 +56,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
|
||||
"gitHead": "586725a15c561436cda37de830b278907a6fc3f5"
|
||||
}
|
||||
|
||||
@@ -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.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -15,9 +15,9 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.26.13",
|
||||
"@certd/basic": "^1.26.13",
|
||||
"@certd/pipeline": "^1.26.13",
|
||||
"@certd/acme-client": "^1.26.14",
|
||||
"@certd/basic": "^1.26.14",
|
||||
"@certd/pipeline": "^1.26.14",
|
||||
"@google-cloud/publicca": "^1.3.0",
|
||||
"dayjs": "^1.11.7",
|
||||
"jszip": "^3.10.1",
|
||||
@@ -57,5 +57,5 @@
|
||||
"vite": "^3.1.0",
|
||||
"vue-tsc": "^0.38.9"
|
||||
},
|
||||
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
|
||||
"gitHead": "586725a15c561436cda37de830b278907a6fc3f5"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,19 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复启动时自签证书无法保存的bug ([526c484](https://github.com/certd/certd/commit/526c48450bcd37b3ccded9b448f17de8140bdc6e))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 顶部菜单自定义 ([54d136c](https://github.com/certd/certd/commit/54d136cc6ae122f7c891b7a5c7232fe5de8e5cb5))
|
||||
* 禁用readonly用户 ([d10d42e](https://github.com/certd/certd/commit/d10d42e20619bb55a50d636b8867ff33db4e3b4b))
|
||||
* 限制其他用户流水线数量 ([315e437](https://github.com/certd/certd/commit/315e43746baf01682737f82e41579237a48409af))
|
||||
* 用户管理优化头像上传 ([661293c](https://github.com/certd/certd/commit/661293c189a3abf3cdc953b5225192372f57930d))
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
@@ -63,8 +63,8 @@
|
||||
"vuedraggable": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.26.13",
|
||||
"@certd/pipeline": "^1.26.13",
|
||||
"@certd/lib-iframe": "^1.26.14",
|
||||
"@certd/pipeline": "^1.26.14",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<a-dropdown class="fs-locale-picker">
|
||||
<div>
|
||||
<div style="display: block">
|
||||
<fs-iconify icon="ion-globe-outline" @click.prevent></fs-iconify>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -89,11 +89,12 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
const title: any = () => {
|
||||
if (sub?.meta?.icon) {
|
||||
const icon = sub.icon || sub?.meta?.icon;
|
||||
if (icon) {
|
||||
// @ts-ignore
|
||||
return (
|
||||
<div class={"menu-item-title"}>
|
||||
<fsIcon class={"anticon"} icon={sub.meta.icon} />
|
||||
<fsIcon class={"anticon"} icon={icon} />
|
||||
<span>{sub.title}</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
<!-- >-->
|
||||
<!-- Button-->
|
||||
<!-- </button>-->
|
||||
<fs-menu class="header-menu" mode="horizontal" :expand-selected="false" :selectable="false" :menus="settingStore.getHeaderMenus" />
|
||||
|
||||
<fs-menu
|
||||
v-if="!settingStore?.isAgent && !settingStore.isComm"
|
||||
class="header-menu"
|
||||
|
||||
@@ -185,7 +185,8 @@ function install(app: App, options: any = {}) {
|
||||
defaultType: "form",
|
||||
form: {
|
||||
keepName: true,
|
||||
action: "http://www.docmirror.cn:7070/api/upload/form/upload",
|
||||
type: "form",
|
||||
action: "/basic/file/upload",
|
||||
name: "file",
|
||||
withCredentials: false,
|
||||
uploadRequest: async ({ action, file, onProgress }: any) => {
|
||||
@@ -205,12 +206,8 @@ function install(app: App, options: any = {}) {
|
||||
}
|
||||
});
|
||||
},
|
||||
successHandle(ret: any) {
|
||||
// 上传完成后的结果处理, 此处应返回格式为{url:xxx}
|
||||
return {
|
||||
url: "http://www.docmirror.cn:7070" + ret,
|
||||
key: ret.replace("/api/upload/form/download?key=", "")
|
||||
};
|
||||
successHandle(res: any) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -68,20 +68,20 @@ export const sysResources = [
|
||||
permission: "sys:settings:view"
|
||||
}
|
||||
},
|
||||
// {
|
||||
// title: "顶部菜单设置",
|
||||
// name: "HeaderMenus",
|
||||
// path: "/sys/settings/header-menus",
|
||||
// component: "/sys/settings/header-menus/index.vue",
|
||||
// meta: {
|
||||
// show: () => {
|
||||
// const settingStore = useSettingStore();
|
||||
// return settingStore.isComm;
|
||||
// },
|
||||
// icon: "ion:document-text-outline",
|
||||
// permission: "sys:settings:view"
|
||||
// }
|
||||
// },
|
||||
{
|
||||
title: "顶部菜单设置",
|
||||
name: "HeaderMenus",
|
||||
path: "/sys/settings/header-menus",
|
||||
component: "/sys/settings/header-menus/index.vue",
|
||||
meta: {
|
||||
show: () => {
|
||||
const settingStore = useSettingStore();
|
||||
return settingStore.isComm;
|
||||
},
|
||||
icon: "ion:document-text-outline",
|
||||
permission: "sys:settings:view"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "系统级授权",
|
||||
name: "SysAccess",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { Modal, notification, theme } from "ant-design-vue";
|
||||
import _ from "lodash-es";
|
||||
import _, { cloneDeep } from "lodash-es";
|
||||
// @ts-ignore
|
||||
import { LocalStorage } from "/src/utils/util.storage";
|
||||
|
||||
@@ -10,6 +10,7 @@ import { useUserStore } from "/@/store/modules/user";
|
||||
import { mitter } from "/@/utils/util.mitt";
|
||||
import { env } from "/@/utils/util.env";
|
||||
import { toRef } from "vue";
|
||||
import { util } from "/@/utils";
|
||||
|
||||
export type ThemeToken = {
|
||||
token: {
|
||||
@@ -120,6 +121,9 @@ export const useSettingStore = defineStore({
|
||||
comm: "商业版"
|
||||
};
|
||||
return vipLabelMap[this.plusInfo?.vipType || "free"];
|
||||
},
|
||||
getHeaderMenus() {
|
||||
return this.headerMenus?.menus || [];
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@@ -137,6 +141,7 @@ export const useSettingStore = defineStore({
|
||||
_.merge(this.installInfo, allSettings.installInfo || {});
|
||||
_.merge(this.siteEnv, allSettings.siteEnv || {});
|
||||
_.merge(this.plusInfo, allSettings.plusInfo || {});
|
||||
_.merge(this.headerMenus, allSettings.headerMenus || {});
|
||||
//@ts-ignore
|
||||
this.initSiteInfo(allSettings.siteInfo || {});
|
||||
},
|
||||
|
||||
@@ -62,4 +62,9 @@
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.settings-form {
|
||||
width: 800px;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ h1, h2, h3, h4, h5, h6 {
|
||||
}
|
||||
}
|
||||
|
||||
.settings-form {
|
||||
width: 800px;
|
||||
margin: 20px;
|
||||
|
||||
.fs-16{
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
@@ -4,11 +4,13 @@ import * as storages from "./util.storage";
|
||||
import commons from "./util.common";
|
||||
import * as mitt from "./util.mitt";
|
||||
import router from "/util.router";
|
||||
import { treeUtils } from "./util.tree";
|
||||
export const util = {
|
||||
...envs,
|
||||
...sites,
|
||||
...storages,
|
||||
...commons,
|
||||
...mitt,
|
||||
...router
|
||||
...router,
|
||||
tree: treeUtils
|
||||
};
|
||||
|
||||
12
packages/ui/certd-client/src/utils/util.tree.ts
Normal file
12
packages/ui/certd-client/src/utils/util.tree.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export function eachTree(tree: any[], callback: (item: any) => void) {
|
||||
tree.forEach((item) => {
|
||||
callback(item);
|
||||
if (item.children) {
|
||||
eachTree(item.children, callback);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export const treeUtils = {
|
||||
eachTree
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as api from "./api";
|
||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { useUserStore } from "/@/store/modules/user";
|
||||
|
||||
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
@@ -17,6 +18,8 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||
return await api.AddObj(form);
|
||||
};
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
return {
|
||||
crudOptions: {
|
||||
request: {
|
||||
@@ -114,8 +117,52 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||
style: {
|
||||
height: "30px",
|
||||
width: "auto"
|
||||
},
|
||||
buildUrl(key: string) {
|
||||
return `/api/basic/file/download?&key=` + key;
|
||||
}
|
||||
}
|
||||
},
|
||||
form: {
|
||||
component: {
|
||||
vModel: "modelValue",
|
||||
valueType: "key",
|
||||
cropper: {
|
||||
aspectRatio: 1,
|
||||
autoCropArea: 1,
|
||||
viewMode: 0
|
||||
},
|
||||
onReady: null,
|
||||
uploader: {
|
||||
type: "form",
|
||||
action: "/basic/file/upload",
|
||||
name: "file",
|
||||
headers: {
|
||||
Authorization: "Bearer " + userStore.getToken
|
||||
},
|
||||
successHandle(res: any) {
|
||||
return res;
|
||||
}
|
||||
},
|
||||
buildUrl(key: string) {
|
||||
return `/api/basic/file/download?&key=` + key;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
title: "状态",
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "启用", value: 1, color: "green" },
|
||||
{ label: "禁用", value: 0, color: "red" }
|
||||
]
|
||||
}),
|
||||
column: {
|
||||
align: "center",
|
||||
sorter: true,
|
||||
width: 100
|
||||
}
|
||||
},
|
||||
remark: {
|
||||
|
||||
@@ -5,6 +5,7 @@ export type SysSettings = { public: SysPublicSetting; private: SysPrivateSetting
|
||||
|
||||
export type SysPublicSetting = {
|
||||
registerEnabled?: boolean;
|
||||
limitUserPipelineCount?: number;
|
||||
managerOtherUserPipeline?: boolean;
|
||||
icpNo?: string;
|
||||
};
|
||||
|
||||
@@ -1,99 +1,124 @@
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { Ref, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { compute, CreateCrudOptionsProps, CreateCrudOptionsRet } from "@fast-crud/fast-crud";
|
||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { cloneDeep } from "lodash-es";
|
||||
import { cloneDeep, find, merge, remove } from "lodash-es";
|
||||
import { nanoid } from "nanoid";
|
||||
import { SettingsSave } from "../api";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const { crudBinding } = crudExpose;
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const settingStore = useSettingStore();
|
||||
const menusRef = ref(cloneDeep(settingStore.headerMenus?.menus || []));
|
||||
|
||||
const selectedRowKeys: Ref<any[]> = ref([]);
|
||||
context.selectedRowKeys = selectedRowKeys;
|
||||
async function saveMenus() {
|
||||
const menus = settingStore.headerMenus;
|
||||
await SettingsSave("sys.header.menus", menus);
|
||||
}
|
||||
|
||||
function eachTree(tree: any[], callback: (item: any) => void) {
|
||||
tree.forEach((item) => {
|
||||
callback(item);
|
||||
if (item.children) {
|
||||
eachTree(item.children, callback);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const expandedRowKeys = ref<string[]>([]);
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
const records = cloneDeep(settingStore.headerMenus?.menus || []);
|
||||
expandedRowKeys.value = [];
|
||||
eachTree(records, (item) => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
expandedRowKeys.value.push(item.id);
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
records: records,
|
||||
total: records.length,
|
||||
limit: 9999999,
|
||||
offset: 0
|
||||
};
|
||||
};
|
||||
const editRequest = async ({ form, row }: EditReq) => {
|
||||
form.id = row.id;
|
||||
let found: any = undefined;
|
||||
eachTree(settingStore.headerMenus?.menus || [], (item) => {
|
||||
if (item.id === row.id) {
|
||||
merge(item, form);
|
||||
found = item;
|
||||
}
|
||||
});
|
||||
await saveMenus();
|
||||
return found;
|
||||
};
|
||||
const delRequest = async ({ row }: DelReq) => {
|
||||
eachTree([{ children: settingStore.headerMenus?.menus }], (item) => {
|
||||
if (item.children) {
|
||||
remove(item.children, (child) => child.id === row.id);
|
||||
}
|
||||
});
|
||||
await saveMenus();
|
||||
};
|
||||
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
form.id = nanoid();
|
||||
if (form.parentId) {
|
||||
eachTree(settingStore.headerMenus?.menus || [], (item) => {
|
||||
if (item.id === form.parentId) {
|
||||
if (!item.children) {
|
||||
item.children = [];
|
||||
}
|
||||
item.children.push(form);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
settingStore.headerMenus?.menus.push(form);
|
||||
}
|
||||
parent.value = null;
|
||||
await saveMenus();
|
||||
return form;
|
||||
};
|
||||
|
||||
return {
|
||||
crudOptions: {
|
||||
settings: {
|
||||
plugins: {
|
||||
//这里使用行选择插件,生成行选择crudOptions配置,最终会与crudOptions合并
|
||||
rowSelection: {
|
||||
enabled: true,
|
||||
order: -2,
|
||||
before: true,
|
||||
// handle: (pluginProps,useCrudProps)=>CrudOptions,
|
||||
props: {
|
||||
multiple: true,
|
||||
crossPage: true,
|
||||
selectedRowKeys
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
actionbar: {
|
||||
buttons: {
|
||||
add: {
|
||||
show: false
|
||||
},
|
||||
addRow: {
|
||||
show: true,
|
||||
click: () => {
|
||||
crudBinding.value.data.push({ id: nanoid() });
|
||||
}
|
||||
},
|
||||
save: {
|
||||
text: "保存菜单",
|
||||
type: "primary",
|
||||
click: async () => {
|
||||
await settingStore.saveHeaderMenus({ menus: menusRef.value });
|
||||
}
|
||||
}
|
||||
}
|
||||
request: {
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest
|
||||
},
|
||||
search: {
|
||||
show: false
|
||||
},
|
||||
toolbar: {
|
||||
buttons: {
|
||||
refresh: {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
},
|
||||
mode: {
|
||||
name: "local",
|
||||
isMergeWhenUpdate: true,
|
||||
isAppendWhenAdd: true
|
||||
},
|
||||
table: {
|
||||
defaultExpandAllRows: true,
|
||||
expandRowByClick: true,
|
||||
editable: {
|
||||
enabled: true,
|
||||
mode: "row",
|
||||
activeDefault: true,
|
||||
showAction: true,
|
||||
rowKey: "id"
|
||||
defaultExpandAllRows: true,
|
||||
expandedRowKeys: expandedRowKeys,
|
||||
"onUpdate:expandedRowKeys": (val: string[]) => {
|
||||
expandedRowKeys.value = val;
|
||||
}
|
||||
},
|
||||
pagination: { show: false, pageSize: 9999999 },
|
||||
rowHandle: {
|
||||
width: 300,
|
||||
fixed: "right",
|
||||
group: {
|
||||
editRow: {
|
||||
addChild: {
|
||||
text: "添加子菜单",
|
||||
click: ({ row }) => {
|
||||
if (row.children == null) {
|
||||
row.children = [];
|
||||
buttons: {
|
||||
addChild: {
|
||||
title: "添加子菜单",
|
||||
text: null,
|
||||
type: "link",
|
||||
icon: "ion:add-circle-outline",
|
||||
click: ({ row }) => {
|
||||
crudExpose.openAdd({
|
||||
row: {
|
||||
parentId: row.id
|
||||
}
|
||||
row.children.push({ id: nanoid() });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +129,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
key: "id",
|
||||
type: "text",
|
||||
column: {
|
||||
width: 200
|
||||
width: 200,
|
||||
show: false
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
@@ -115,20 +141,60 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
type: "text",
|
||||
column: {
|
||||
width: 300
|
||||
},
|
||||
form: {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入标题"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
icon: {
|
||||
title: "图标",
|
||||
type: "text",
|
||||
column: {
|
||||
width: 300
|
||||
width: 300,
|
||||
cellRender: ({ row }) => {
|
||||
return <fs-icon class={"fs-16"} icon={row.icon}></fs-icon>;
|
||||
}
|
||||
},
|
||||
form: {
|
||||
component: {
|
||||
placeholder: "ion:add-circle"
|
||||
},
|
||||
helper: {
|
||||
render: () => {
|
||||
return (
|
||||
<span>
|
||||
<a href="https://icon-sets.iconify.design/" target="_blank">
|
||||
图标库
|
||||
</a>
|
||||
<span>--搜索--选择图标--复制名称--填到这里</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
link: {
|
||||
path: {
|
||||
title: "链接",
|
||||
type: "text",
|
||||
type: "link",
|
||||
column: {
|
||||
width: 300
|
||||
},
|
||||
form: {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入链接"
|
||||
},
|
||||
{
|
||||
type: "url",
|
||||
message: "请输入正确的链接"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { onMounted } from "vue";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { cloneDeep } from "lodash-es";
|
||||
|
||||
defineOptions({
|
||||
name: "SettingsHeaderMenus"
|
||||
});
|
||||
@@ -21,7 +21,7 @@ const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions
|
||||
const settingStore = useSettingStore();
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
crudBinding.value.data = cloneDeep(settingStore.headerMenus.menus || []);
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
</script>
|
||||
<style lang="less"></style>
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
<a-form-item label="开启自助注册" :name="['public', 'registerEnabled']">
|
||||
<a-switch v-model:checked="formState.public.registerEnabled" />
|
||||
</a-form-item>
|
||||
<a-form-item label="限制用户流水线数量" :name="['public', 'limitUserPipelineCount']">
|
||||
<a-input-number v-model:value="formState.public.limitUserPipelineCount" />
|
||||
<div class="helper">0为不限制</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="管理其他用户流水线" :name="['public', 'managerOtherUserPipeline']">
|
||||
<a-switch v-model:checked="formState.public.managerOtherUserPipeline" />
|
||||
</a-form-item>
|
||||
@@ -25,12 +29,13 @@
|
||||
|
||||
<a-form-item label="HTTP代理" :name="['private', 'httpProxy']" :rules="urlRules">
|
||||
<a-input v-model:value="formState.private.httpProxy" placeholder="http://192.168.1.2:18010/" />
|
||||
<div class="helper">当某些网站被墙时可以配置</div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="HTTPS代理" :name="['private', 'httpsProxy']" :rules="urlRules">
|
||||
<div class="flex">
|
||||
<a-input v-model:value="formState.private.httpsProxy" placeholder="http://192.168.1.2:18010/" />
|
||||
<a-button class="ml-5" type="primary" title="保存后,再点击测试" @click="testProxy">测试</a-button>
|
||||
<a-button class="ml-5" type="primary" :loading="testProxyLoading" title="保存后,再点击测试" @click="testProxy">测试</a-button>
|
||||
</div>
|
||||
<div class="helper">一般这两个代理填一样的</div>
|
||||
</a-form-item>
|
||||
@@ -57,6 +62,7 @@ defineOptions({
|
||||
const formState = reactive<Partial<SysSettings>>({
|
||||
public: {
|
||||
registerEnabled: false,
|
||||
limitUserPipelineCount: 0,
|
||||
managerOtherUserPipeline: false,
|
||||
icpNo: ""
|
||||
},
|
||||
@@ -100,13 +106,19 @@ async function stopOtherUserTimer() {
|
||||
});
|
||||
}
|
||||
|
||||
const testProxyLoading = ref(false);
|
||||
async function testProxy() {
|
||||
const res = await api.TestProxy();
|
||||
const content = `测试google:${res.google === true ? "成功" : "失败" + res.google},测试百度:${res.baidu === true ? "成功" : "失败:" + res.baidu}`;
|
||||
notification.success({
|
||||
message: "测试完成",
|
||||
description: content
|
||||
});
|
||||
testProxyLoading.value = true;
|
||||
try {
|
||||
const res = await api.TestProxy();
|
||||
const content = `测试google:${res.google === true ? "成功" : "失败" + res.google},测试百度:${res.baidu === true ? "成功" : "失败:" + res.baidu}`;
|
||||
notification.success({
|
||||
message: "测试完成",
|
||||
description: content
|
||||
});
|
||||
} finally {
|
||||
testProxyLoading.value = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ import * as api from "./api";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { useSettingStore } from "/src/store/modules/settings";
|
||||
import { useUserStore } from "/@/store/modules/user";
|
||||
import { merge } from "lodash-es";
|
||||
|
||||
defineOptions({
|
||||
name: "SiteSetting"
|
||||
@@ -85,7 +86,7 @@ async function loadSysSiteSettings() {
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
Object.assign(formState, data);
|
||||
merge(formState, data);
|
||||
}
|
||||
const saveLoading = ref(false);
|
||||
loadSysSiteSettings();
|
||||
|
||||
@@ -3,6 +3,19 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复阿里云部署大杀器报插件_还未注册错误的bug ([abd2dcf](https://github.com/certd/certd/commit/abd2dcf2e85a545321bae6451406d081f773b132))
|
||||
* 修复启动时自签证书无法保存的bug ([526c484](https://github.com/certd/certd/commit/526c48450bcd37b3ccded9b448f17de8140bdc6e))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 禁用readonly用户 ([d10d42e](https://github.com/certd/certd/commit/d10d42e20619bb55a50d636b8867ff33db4e3b4b))
|
||||
* 限制其他用户流水线数量 ([315e437](https://github.com/certd/certd/commit/315e43746baf01682737f82e41579237a48409af))
|
||||
* 用户管理优化头像上传 ([661293c](https://github.com/certd/certd/commit/661293c189a3abf3cdc953b5225192372f57930d))
|
||||
|
||||
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
update sys_user set status = 0 where id = 2;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
update sys_user set status = 0 where id = 2;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.26.13",
|
||||
"version": "1.26.14",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -27,17 +27,17 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@certd/acme-client": "^1.26.13",
|
||||
"@certd/commercial-core": "^1.26.13",
|
||||
"@certd/lib-huawei": "^1.26.13",
|
||||
"@certd/lib-jdcloud": "^1.26.13",
|
||||
"@certd/lib-k8s": "^1.26.13",
|
||||
"@certd/lib-server": "^1.26.13",
|
||||
"@certd/midway-flyway-js": "^1.26.13",
|
||||
"@certd/pipeline": "^1.26.13",
|
||||
"@certd/plugin-cert": "^1.26.13",
|
||||
"@certd/plugin-plus": "^1.26.13",
|
||||
"@certd/plus-core": "^1.26.13",
|
||||
"@certd/acme-client": "^1.26.14",
|
||||
"@certd/commercial-core": "^1.26.14",
|
||||
"@certd/lib-huawei": "^1.26.14",
|
||||
"@certd/lib-jdcloud": "^1.26.14",
|
||||
"@certd/lib-k8s": "^1.26.14",
|
||||
"@certd/lib-server": "^1.26.14",
|
||||
"@certd/midway-flyway-js": "^1.26.14",
|
||||
"@certd/pipeline": "^1.26.14",
|
||||
"@certd/plugin-cert": "^1.26.14",
|
||||
"@certd/plugin-plus": "^1.26.14",
|
||||
"@certd/plus-core": "^1.26.14",
|
||||
"@koa/cors": "^5.0.0",
|
||||
"@midwayjs/bootstrap": "~3.17.1",
|
||||
"@midwayjs/cache": "~3.14.0",
|
||||
|
||||
@@ -111,7 +111,9 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
|
||||
await http.request({
|
||||
url: google,
|
||||
method: 'GET',
|
||||
timeout: 4000,
|
||||
timeout: 5000,
|
||||
logRes: false,
|
||||
logParams: false,
|
||||
});
|
||||
googleRes = true;
|
||||
} catch (e) {
|
||||
@@ -123,7 +125,9 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
|
||||
await http.request({
|
||||
url: baidu,
|
||||
method: 'GET',
|
||||
timeout: 4000,
|
||||
timeout: 5000,
|
||||
logRes: false,
|
||||
logParams: false,
|
||||
});
|
||||
baiduRes = true;
|
||||
} catch (e) {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { logger } from '@certd/pipeline';
|
||||
import fs from 'fs';
|
||||
// @ts-ignore
|
||||
import forge from 'node-forge';
|
||||
import path from 'path';
|
||||
|
||||
export function createSelfCertificate(opts: { crtPath: string; keyPath: string }) {
|
||||
// 生成密钥对
|
||||
@@ -32,6 +33,14 @@ export function createSelfCertificate(opts: { crtPath: string; keyPath: string }
|
||||
logger.info('生成自签名证书成功');
|
||||
logger.info(`自签证书保存路径: ${opts.crtPath}`);
|
||||
logger.info(`自签私钥保存路径: ${opts.keyPath}`);
|
||||
const crtDir = path.dirname(opts.crtPath);
|
||||
if (!fs.existsSync(crtDir)) {
|
||||
fs.mkdirSync(crtDir, { recursive: true });
|
||||
}
|
||||
const keyDir = path.dirname(opts.keyPath);
|
||||
if (!fs.existsSync(keyDir)) {
|
||||
fs.mkdirSync(keyDir, { recursive: true });
|
||||
}
|
||||
fs.writeFileSync(opts.crtPath, pemCert);
|
||||
fs.writeFileSync(opts.keyPath, pemKey);
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ export class LoginService {
|
||||
if (!right) {
|
||||
throw new CommonException('用户名或密码错误');
|
||||
}
|
||||
if (info.status === 0) {
|
||||
throw new CommonException('用户已被禁用');
|
||||
}
|
||||
|
||||
const roleIds = await this.roleService.getRoleIdsByUserId(info.id);
|
||||
return this.generateToken(info, roleIds);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Config, Inject, Provide, Scope, ScopeEnum, sleep } from '@midwayjs/core';
|
||||
import { InjectEntityModel } from '@midwayjs/typeorm';
|
||||
import { In, Repository } from 'typeorm';
|
||||
import { BaseService, NeedVIPException, PageReq } from '@certd/lib-server';
|
||||
import { BaseService, NeedVIPException, PageReq, SysPublicSettings, SysSettingsService } from '@certd/lib-server';
|
||||
import { PipelineEntity } from '../entity/pipeline.js';
|
||||
import { PipelineDetail } from '../entity/vo/pipeline-detail.js';
|
||||
import { Executor, isPlus, logger, Pipeline, ResultType, RunHistory, UserInfo } from '@certd/pipeline';
|
||||
@@ -47,6 +47,9 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
@Inject()
|
||||
pluginConfigGetter: PluginConfigGetter;
|
||||
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
@Inject()
|
||||
userService: UserService;
|
||||
|
||||
@@ -121,16 +124,27 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
old = await this.info(bean.id);
|
||||
}
|
||||
const isUpdate = bean.id > 0 && old != null;
|
||||
if (!isPlus()) {
|
||||
let count = await this.repository.count();
|
||||
if (!isUpdate) {
|
||||
//如果是添加要加1
|
||||
count += 1;
|
||||
if (!isUpdate) {
|
||||
//如果是添加,校验数量
|
||||
if (!isPlus()) {
|
||||
const count = await this.repository.count();
|
||||
if (count >= freeCount) {
|
||||
throw new NeedVIPException(`基础版最多只能创建${freeCount}条流水线`);
|
||||
}
|
||||
}
|
||||
if (count > freeCount) {
|
||||
throw new NeedVIPException('基础版最多只能创建10个pipeline');
|
||||
const userId = bean.userId;
|
||||
const userIsAdmin = await this.userService.isAdmin(userId);
|
||||
if (!userIsAdmin) {
|
||||
//非管理员用户,限制pipeline数量
|
||||
const count = await this.repository.count({ where: { userId } });
|
||||
const sysPublic = await this.sysSettingsService.getSetting<SysPublicSettings>(SysPublicSettings);
|
||||
const limitUserPipelineCount = sysPublic.limitUserPipelineCount;
|
||||
if (limitUserPipelineCount && limitUserPipelineCount > 0 && count >= limitUserPipelineCount) {
|
||||
throw new NeedVIPException(`您最多只能创建${limitUserPipelineCount}条流水线`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isUpdate) {
|
||||
//如果是添加,先保存一下,获取到id,更新pipeline.id
|
||||
await this.addOrUpdate(bean);
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Repository } from 'typeorm';
|
||||
import { UserEntity } from '../entity/user.js';
|
||||
import * as _ from 'lodash-es';
|
||||
import md5 from 'md5';
|
||||
import { CommonException } from '@certd/lib-server';
|
||||
import { CommonException, FileService } from '@certd/lib-server';
|
||||
import { BaseService } from '@certd/lib-server';
|
||||
import { RoleService } from './role-service.js';
|
||||
import { PermissionService } from './permission-service.js';
|
||||
@@ -34,6 +34,9 @@ export class UserService extends BaseService<UserEntity> {
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
@Inject()
|
||||
fileService: FileService;
|
||||
|
||||
//@ts-ignore
|
||||
getRepository() {
|
||||
return this.repository;
|
||||
@@ -68,6 +71,11 @@ export class UserService extends BaseService<UserEntity> {
|
||||
const plainPassword = param.password ?? RandomUtil.randomStr(6);
|
||||
param.passwordVersion = 2;
|
||||
param.password = await this.genPassword(plainPassword, param.passwordVersion); // 默认密码 建议未改密码不能登陆
|
||||
|
||||
if (param.avatar) {
|
||||
param.avatar = await this.fileService.saveFile(0, param.avatar, 'public');
|
||||
}
|
||||
|
||||
await super.add(param);
|
||||
//添加角色
|
||||
if (param.roles && param.roles.length > 0) {
|
||||
@@ -98,6 +106,10 @@ export class UserService extends BaseService<UserEntity> {
|
||||
} else {
|
||||
delete param.password;
|
||||
}
|
||||
|
||||
if (param.avatar) {
|
||||
param.avatar = await this.fileService.saveFile(userInfo.id, param.avatar, 'public');
|
||||
}
|
||||
await super.update(param);
|
||||
await this.roleService.updateRoles(param.id, param.roles);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export class TencentDeployCertToCDNv2 extends AbstractTaskPlugin {
|
||||
createRemoteSelectInputDefine({
|
||||
title: 'CDN域名',
|
||||
helper: '请选择域名或输入域名',
|
||||
typeName: TencentDeployCertToCDNv2.name,
|
||||
typeName: 'TencentDeployCertToCDNv2',
|
||||
action: TencentDeployCertToCDNv2.prototype.onGetDomainList.name,
|
||||
})
|
||||
)
|
||||
|
||||
@@ -79,7 +79,7 @@ export class DeployCertToTencentCosPlugin extends AbstractPlusTaskPlugin {
|
||||
createRemoteSelectInputDefine({
|
||||
title: 'COS域名',
|
||||
helper: '请选择域名',
|
||||
typeName: DeployCertToTencentCosPlugin.name,
|
||||
typeName: 'DeployCertToTencentCosPlugin',
|
||||
action: DeployCertToTencentCosPlugin.prototype.onGetDomainList.name,
|
||||
watches: ['bucket', 'region'],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user