mirror of
https://github.com/certd/certd.git
synced 2026-07-21 18:37:33 +08:00
Compare commits
21 Commits
78c2ced43b
...
v1.39.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 590ff67fcb | |||
| 209e1adf53 | |||
| 53c08484a3 | |||
| c6ca832737 | |||
| 853fdc70a2 | |||
| dc4f811eaa | |||
| d23c8b4a2a | |||
| 00c0dcc81d | |||
| f77feefdb8 | |||
| 2e346e5369 | |||
| 17023f6b55 | |||
| 3bb29abe32 | |||
| ac42d38b7a | |||
| d9c0130b59 | |||
| 4925d5a5e7 | |||
| dd9a7cf5d7 | |||
| 5ee3874b7e | |||
| 17dd77cc96 | |||
| 6c546b5290 | |||
| a853fc2026 | |||
| 92c9ac3826 |
@@ -43,7 +43,7 @@ jobs:
|
||||
with:
|
||||
time: '10' # for 60 seconds
|
||||
- name: deploy-certd-demo
|
||||
uses: tyrrrz/action-http-request@master
|
||||
uses: tyrrrz/action-http-request@prime
|
||||
with:
|
||||
# 通过webhook 触发 certd-demo来部署
|
||||
url: ${{ secrets.WEBHOOK_CERTD_DEMO }}
|
||||
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
# greper/certd-agent:latest
|
||||
# greper/certd-agent:${{steps.get_certd_version.outputs.result}}
|
||||
- name: deploy-certd-doc
|
||||
uses: tyrrrz/action-http-request@master
|
||||
uses: tyrrrz/action-http-request@prime
|
||||
with:
|
||||
url: ${{ secrets.WEBHOOK_CERTD_DOC }}
|
||||
method: POST
|
||||
|
||||
@@ -3,6 +3,45 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复企业管理模式下,切换用户登录后,丢失项目列表的bug ([d23c8b4](https://github.com/certd/certd/commit/d23c8b4a2a5f5ab17822c6ee1d4108ac7280b9d1))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持迁移个人数据到企业项目中 ([c6ca832](https://github.com/certd/certd/commit/c6ca83273779ed84de1b23b5e477063af043d015))
|
||||
* install tip ([853fdc7](https://github.com/certd/certd/commit/853fdc70a263b62d75c9ff3970607e6bf1c1593b))
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复部署到openwrt错误的bug ([2e3d0cc](https://github.com/certd/certd/commit/2e3d0cc57c16c48ad435bc8fde729bacaedde9f5))
|
||||
* 修复发件邮箱无法输入的bug ([27b0348](https://github.com/certd/certd/commit/27b0348e1d3d752f418f851965d6afbc26c0160c))
|
||||
* 修复复制流水线保存后丢失分组和排序号的问题 ([bc32648](https://github.com/certd/certd/commit/bc326489abc1d50a0930b4f47aa2d62d3a486798))
|
||||
* 修复获取群辉deviceid报错的bug ([79be392](https://github.com/certd/certd/commit/79be392775a2c91848dd5a66a2618adc4e4b48f6))
|
||||
* 修复京东云域名申请证书报错的bug ([d9c0130](https://github.com/certd/certd/commit/d9c0130b59997144a3c274d456635b800135e43f))
|
||||
* 修复偶尔下载证书报未授权的错误 ([316537e](https://github.com/certd/certd/commit/316537eb4dcbe5ec57784e8bf95ee3cdfd21dce7))
|
||||
* 修复dcdn多个域名同时部署时 可能会出现证书名称重复的bug ([78c2ced](https://github.com/certd/certd/commit/78c2ced43b1a73d142b0ed783b162b97f545ab06))
|
||||
* 优化dcdn部署上传多次证书 偶尔报 The CertName already exists的问题 ([72f850f](https://github.com/certd/certd/commit/72f850f675b500d12ebff2338d1b99d6fab476e1))
|
||||
* **cert-plugin:** 优化又拍云客户端错误处理逻辑,当域名已绑定证书时不再抛出异常。 ([92c9ac3](https://github.com/certd/certd/commit/92c9ac382692e6c84140ff787759ab6d39ccbe96))
|
||||
* esxi部署失败的bug ([1e44115](https://github.com/certd/certd/commit/1e441154617e6516a9a3610412bf597128c62696))
|
||||
|
||||
### Features
|
||||
|
||||
* 支持企业级管理模式,项目管理,细分权限 ([3734083](https://github.com/certd/certd/commit/37340838b6a61a94b86bfa13cf5da88b26f1315a))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 【破坏性更新】错误返回信息msg字段名统一改成message,与成功的返回结构一致 ([51ab6d6](https://github.com/certd/certd/commit/51ab6d6da1bb551b55b3a6a4a9a945c8d6ace806))
|
||||
* 当域名管理中没有域名时,创建流水线时不展开域名选择框 ([bb0afe1](https://github.com/certd/certd/commit/bb0afe1fa7b0fc52fde051d24fbe6be69d52f4cc))
|
||||
* 任务步骤页面增加串行执行提示说明 ([787f6ef](https://github.com/certd/certd/commit/787f6ef52893d8dc912ee2a7a5b8ce2b73c108c9))
|
||||
* 站点监控支持指定ip地址检查 ([83d81b6](https://github.com/certd/certd/commit/83d81b64b3adb375366039e07c87d1ad79121c13))
|
||||
* AI开发插件 skills 定义初步 ([1f68fad](https://github.com/certd/certd/commit/1f68faddb97a978c5a5e731a8895b4bb0587ad83))
|
||||
* http请求增加建立连接超时配置 ([3c85602](https://github.com/certd/certd/commit/3c85602ab1fc1953cdc06a6cd75a971d14119179))
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -3,6 +3,34 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复部署到openwrt错误的bug ([2e3d0cc](https://github.com/certd/certd/commit/2e3d0cc57c16c48ad435bc8fde729bacaedde9f5))
|
||||
* 修复发件邮箱无法输入的bug ([27b0348](https://github.com/certd/certd/commit/27b0348e1d3d752f418f851965d6afbc26c0160c))
|
||||
* 修复复制流水线保存后丢失分组和排序号的问题 ([bc32648](https://github.com/certd/certd/commit/bc326489abc1d50a0930b4f47aa2d62d3a486798))
|
||||
* 修复获取群辉deviceid报错的bug ([79be392](https://github.com/certd/certd/commit/79be392775a2c91848dd5a66a2618adc4e4b48f6))
|
||||
* 修复京东云域名申请证书报错的bug ([d9c0130](https://github.com/certd/certd/commit/d9c0130b59997144a3c274d456635b800135e43f))
|
||||
* 修复偶尔下载证书报未授权的错误 ([316537e](https://github.com/certd/certd/commit/316537eb4dcbe5ec57784e8bf95ee3cdfd21dce7))
|
||||
* 修复dcdn多个域名同时部署时 可能会出现证书名称重复的bug ([78c2ced](https://github.com/certd/certd/commit/78c2ced43b1a73d142b0ed783b162b97f545ab06))
|
||||
* 优化dcdn部署上传多次证书 偶尔报 The CertName already exists的问题 ([72f850f](https://github.com/certd/certd/commit/72f850f675b500d12ebff2338d1b99d6fab476e1))
|
||||
* **cert-plugin:** 优化又拍云客户端错误处理逻辑,当域名已绑定证书时不再抛出异常。 ([92c9ac3](https://github.com/certd/certd/commit/92c9ac382692e6c84140ff787759ab6d39ccbe96))
|
||||
* esxi部署失败的bug ([1e44115](https://github.com/certd/certd/commit/1e441154617e6516a9a3610412bf597128c62696))
|
||||
|
||||
### Features
|
||||
|
||||
* 支持企业级管理模式,项目管理,细分权限 ([3734083](https://github.com/certd/certd/commit/37340838b6a61a94b86bfa13cf5da88b26f1315a))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 【破坏性更新】错误返回信息msg字段名统一改成message,与成功的返回结构一致 ([51ab6d6](https://github.com/certd/certd/commit/51ab6d6da1bb551b55b3a6a4a9a945c8d6ace806))
|
||||
* 当域名管理中没有域名时,创建流水线时不展开域名选择框 ([bb0afe1](https://github.com/certd/certd/commit/bb0afe1fa7b0fc52fde051d24fbe6be69d52f4cc))
|
||||
* 任务步骤页面增加串行执行提示说明 ([787f6ef](https://github.com/certd/certd/commit/787f6ef52893d8dc912ee2a7a5b8ce2b73c108c9))
|
||||
* 站点监控支持指定ip地址检查 ([83d81b6](https://github.com/certd/certd/commit/83d81b64b3adb375366039e07c87d1ad79121c13))
|
||||
* AI开发插件 skills 定义初步 ([1f68fad](https://github.com/certd/certd/commit/1f68faddb97a978c5a5e731a8895b4bb0587ad83))
|
||||
* http请求增加建立连接超时配置 ([3c85602](https://github.com/certd/certd/commit/3c85602ab1fc1953cdc06a6cd75a971d14119179))
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -16,7 +16,6 @@ https://1panel.cn/docs/installation/online_installation/
|
||||
|
||||

|
||||
|
||||
|
||||

|
||||
|
||||
#### 1.2 访问测试:
|
||||
@@ -40,6 +39,9 @@ admin/123456
|
||||
1. 打开`docker-compose.yaml`,整个内容复制下来
|
||||
https://gitee.com/certd/certd/raw/v2/docker/run/docker-compose.yaml
|
||||
|
||||
::: tip
|
||||
默认使用SQLite数据库,如果需要使用MySQL、PostgreSQL数据库,请参考[多数据库支持](./install/database.md)
|
||||
:::
|
||||
|
||||
2. 然后到 `1Panel->容器->编排->新建编排`
|
||||
输入名称,粘贴`docker-compose.yaml`原文内容
|
||||
@@ -49,7 +51,10 @@ admin/123456
|
||||

|
||||
|
||||
> 默认使用sqlite数据库,数据保存在`/data/certd`目录下,您可以手动备份该目录
|
||||
> certd还支持`mysql`和`postgresql`数据库,[点我了解如何切换其他数据库](../database)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### 2.2 访问测试
|
||||
|
||||
|
||||
@@ -30,7 +30,9 @@
|
||||
点击确定,等待启动完成
|
||||

|
||||
|
||||
> certd默认使用sqlite数据库,另外支持`mysql`和`postgresql`数据库,[点我了解如何切换其他数据库](../database)
|
||||
::: tip
|
||||
默认安装使用SQLite数据库,如果需要使用MySQL、PostgreSQL数据库,请参考[多数据库支持](./install/database.md)
|
||||
:::
|
||||
|
||||
|
||||
## 二、访问应用
|
||||
|
||||
@@ -42,8 +42,9 @@ docker compose up -d
|
||||
> 如果提示 没有docker compose命令,请安装docker-compose
|
||||
> https://docs.docker.com/compose/install/linux/
|
||||
|
||||
> certd默认使用sqlite数据库,另外还支持`mysql`和`postgresql`数据库,[点我了解如何切换其他数据库](../database)
|
||||
|
||||
::: tip
|
||||
默认安装使用SQLite数据库,如果需要使用MySQL、PostgreSQL数据库,请参考[多数据库支持](./install/database.md)
|
||||
:::
|
||||
|
||||
### 3. 访问测试
|
||||
|
||||
|
||||
@@ -28,6 +28,11 @@ https://certd.handsfree.work/
|
||||
2. [Docker方式部署](./install/docker/)
|
||||
3. [源码方式部署](./install/source/)
|
||||
|
||||
::: tip
|
||||
默认安装使用SQLite数据库,如果需要使用MySQL、PostgreSQL数据库,请参考[多数据库支持](./install/database.md)
|
||||
:::
|
||||
|
||||
|
||||
|
||||
### 2. 访问测试
|
||||
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@
|
||||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.38.12"
|
||||
"version": "1.39.1"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/publishlab/node-acme-client/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
# [1.39.0](https://github.com/publishlab/node-acme-client/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.38.12](https://github.com/publishlab/node-acme-client/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**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.38.12",
|
||||
"version": "1.39.1",
|
||||
"type": "module",
|
||||
"module": "scr/index.js",
|
||||
"main": "src/index.js",
|
||||
@@ -18,7 +18,7 @@
|
||||
"types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@certd/basic": "^1.39.1",
|
||||
"@peculiar/x509": "^1.11.0",
|
||||
"asn1js": "^3.0.5",
|
||||
"axios": "^1.9.0",
|
||||
@@ -70,5 +70,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||
},
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
"gitHead": "3bb29abe32c311e1cf840f97d485d1147411992a"
|
||||
}
|
||||
|
||||
@@ -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.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* esxi部署失败的bug ([1e44115](https://github.com/certd/certd/commit/1e441154617e6516a9a3610412bf597128c62696))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* http请求增加建立连接超时配置 ([3c85602](https://github.com/certd/certd/commit/3c85602ab1fc1953cdc06a6cd75a971d14119179))
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
@@ -1 +1 @@
|
||||
23:18
|
||||
23:44
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -47,5 +47,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
"gitHead": "3bb29abe32c311e1cf840f97d485d1147411992a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -18,8 +18,8 @@
|
||||
"compile": "tsc --skipLibCheck --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@certd/plus-core": "^1.38.12",
|
||||
"@certd/basic": "^1.39.1",
|
||||
"@certd/plus-core": "^1.39.1",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
@@ -45,5 +45,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
"gitHead": "3bb29abe32c311e1cf840f97d485d1147411992a"
|
||||
}
|
||||
|
||||
@@ -170,9 +170,7 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
||||
}
|
||||
|
||||
if (this.ctx?.define?.onlyAdmin) {
|
||||
if (!this.isAdmin()) {
|
||||
throw new Error("只有管理员才能运行此任务");
|
||||
}
|
||||
this.checkAdmin();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,6 +282,12 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
||||
return this.ctx.user.role === "admin";
|
||||
}
|
||||
|
||||
checkAdmin() {
|
||||
if (!this.isAdmin()) {
|
||||
throw new Error("只有“管理员”或“系统级项目”才有权限运行此插件任务");
|
||||
}
|
||||
}
|
||||
|
||||
getStepFromPipeline(stepId: string) {
|
||||
let found: any = null;
|
||||
RunnableCollection.each(this.ctx.pipeline.stages, step => {
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"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": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
"gitHead": "3bb29abe32c311e1cf840f97d485d1147411992a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -31,5 +31,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
"gitHead": "3bb29abe32c311e1cf840f97d485d1147411992a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/jdcloud",
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"description": "jdcloud openApi sdk",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
@@ -56,5 +56,5 @@
|
||||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
"gitHead": "3bb29abe32c311e1cf840f97d485d1147411992a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,7 +17,7 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@certd/basic": "^1.39.1",
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -32,5 +32,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
"gitHead": "3bb29abe32c311e1cf840f97d485d1147411992a"
|
||||
}
|
||||
|
||||
@@ -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.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 【破坏性更新】错误返回信息msg字段名统一改成message,与成功的返回结构一致 ([51ab6d6](https://github.com/certd/certd/commit/51ab6d6da1bb551b55b3a6a4a9a945c8d6ace806))
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -28,11 +28,11 @@
|
||||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.38.12",
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@certd/pipeline": "^1.38.12",
|
||||
"@certd/plugin-lib": "^1.38.12",
|
||||
"@certd/plus-core": "^1.38.12",
|
||||
"@certd/acme-client": "^1.39.1",
|
||||
"@certd/basic": "^1.39.1",
|
||||
"@certd/pipeline": "^1.39.1",
|
||||
"@certd/plugin-lib": "^1.39.1",
|
||||
"@certd/plus-core": "^1.39.1",
|
||||
"@midwayjs/cache": "3.14.0",
|
||||
"@midwayjs/core": "3.20.11",
|
||||
"@midwayjs/i18n": "3.20.13",
|
||||
@@ -64,5 +64,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
"gitHead": "3bb29abe32c311e1cf840f97d485d1147411992a"
|
||||
}
|
||||
|
||||
@@ -69,10 +69,8 @@ export abstract class BaseController {
|
||||
if (!projectIdStr){
|
||||
projectIdStr = this.ctx.request.query["projectId"] as string;
|
||||
}
|
||||
if (!projectIdStr){
|
||||
return null
|
||||
}
|
||||
if (!projectIdStr) {
|
||||
//这里必须抛异常,否则可能会有权限问题
|
||||
throw new Error("projectId 不能为空")
|
||||
}
|
||||
const userId = this.getUserId()
|
||||
@@ -85,7 +83,7 @@ export abstract class BaseController {
|
||||
let userId = this.getUserId()
|
||||
const projectId = await this.getProjectId(permission)
|
||||
if(projectId){
|
||||
userId = 0
|
||||
userId = -1 // 企业管理模式下,用户id固定-1
|
||||
}
|
||||
return {
|
||||
projectId,userId
|
||||
@@ -120,7 +118,7 @@ export abstract class BaseController {
|
||||
if(allowAdmin){
|
||||
await authService.checkUserIdButAllowAdmin(this.ctx, service, id);
|
||||
}else{
|
||||
await authService.checkUserId(this.ctx, service, id);
|
||||
await authService.checkUserId( service, id, userId);
|
||||
}
|
||||
}
|
||||
return {projectId,userId}
|
||||
|
||||
@@ -258,12 +258,12 @@ export abstract class BaseService<T> {
|
||||
|
||||
export function checkUserProjectParam(userId: number, projectId: number) {
|
||||
if (projectId != null ){
|
||||
if( userId !==0) {
|
||||
if( userId !==-1) {
|
||||
throw new ValidateException('userId projectId 错误');
|
||||
}
|
||||
return true
|
||||
}else{
|
||||
if( userId > 0) {
|
||||
if( userId != null) {
|
||||
return true
|
||||
}
|
||||
throw new ValidateException('userId不能为空');
|
||||
|
||||
@@ -8,7 +8,7 @@ export class AccessEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
@Column({ name: 'user_id', comment: '用户id' })
|
||||
userId: number;
|
||||
userId: number; // 0为系统级别, -1为企业,大于1为用户
|
||||
@Column({ comment: '名称', length: 100 })
|
||||
name: string;
|
||||
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -46,5 +46,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
"gitHead": "3bb29abe32c311e1cf840f97d485d1147411992a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -17,10 +17,10 @@
|
||||
"compile": "tsc --skipLibCheck --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.38.12",
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@certd/pipeline": "^1.38.12",
|
||||
"@certd/plugin-lib": "^1.38.12",
|
||||
"@certd/acme-client": "^1.39.1",
|
||||
"@certd/basic": "^1.39.1",
|
||||
"@certd/pipeline": "^1.39.1",
|
||||
"@certd/plugin-lib": "^1.39.1",
|
||||
"psl": "^1.9.0",
|
||||
"punycode.js": "^2.3.1"
|
||||
},
|
||||
@@ -38,5 +38,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
"gitHead": "3bb29abe32c311e1cf840f97d485d1147411992a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-lib",
|
||||
"private": false,
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -22,10 +22,10 @@
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@alicloud/tea-util": "^1.4.11",
|
||||
"@aws-sdk/client-s3": "^3.964.0",
|
||||
"@certd/acme-client": "^1.38.12",
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@certd/pipeline": "^1.38.12",
|
||||
"@certd/plus-core": "^1.38.12",
|
||||
"@certd/acme-client": "^1.39.1",
|
||||
"@certd/basic": "^1.39.1",
|
||||
"@certd/pipeline": "^1.39.1",
|
||||
"@certd/plus-core": "^1.39.1",
|
||||
"@kubernetes/client-node": "0.21.0",
|
||||
"ali-oss": "^6.22.0",
|
||||
"basic-ftp": "^5.0.5",
|
||||
@@ -57,5 +57,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
"gitHead": "3bb29abe32c311e1cf840f97d485d1147411992a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,34 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复企业管理模式下,切换用户登录后,丢失项目列表的bug ([d23c8b4](https://github.com/certd/certd/commit/d23c8b4a2a5f5ab17822c6ee1d4108ac7280b9d1))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持迁移个人数据到企业项目中 ([c6ca832](https://github.com/certd/certd/commit/c6ca83273779ed84de1b23b5e477063af043d015))
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复发件邮箱无法输入的bug ([27b0348](https://github.com/certd/certd/commit/27b0348e1d3d752f418f851965d6afbc26c0160c))
|
||||
* 修复复制流水线保存后丢失分组和排序号的问题 ([bc32648](https://github.com/certd/certd/commit/bc326489abc1d50a0930b4f47aa2d62d3a486798))
|
||||
* 修复获取群辉deviceid报错的bug ([79be392](https://github.com/certd/certd/commit/79be392775a2c91848dd5a66a2618adc4e4b48f6))
|
||||
* 修复偶尔下载证书报未授权的错误 ([316537e](https://github.com/certd/certd/commit/316537eb4dcbe5ec57784e8bf95ee3cdfd21dce7))
|
||||
|
||||
### Features
|
||||
|
||||
* 支持企业级管理模式,项目管理,细分权限 ([3734083](https://github.com/certd/certd/commit/37340838b6a61a94b86bfa13cf5da88b26f1315a))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 当域名管理中没有域名时,创建流水线时不展开域名选择框 ([bb0afe1](https://github.com/certd/certd/commit/bb0afe1fa7b0fc52fde051d24fbe6be69d52f4cc))
|
||||
* 任务步骤页面增加串行执行提示说明 ([787f6ef](https://github.com/certd/certd/commit/787f6ef52893d8dc912ee2a7a5b8ce2b73c108c9))
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
@@ -106,8 +106,8 @@
|
||||
"zod-defaults": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.38.12",
|
||||
"@certd/pipeline": "^1.38.12",
|
||||
"@certd/lib-iframe": "^1.39.1",
|
||||
"@certd/pipeline": "^1.39.1",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
||||
@@ -155,7 +155,7 @@ function createRequestFunction(service: any) {
|
||||
}
|
||||
Object.assign(configDefault, config);
|
||||
|
||||
if (projectStore.isEnterprise && !config.url.startsWith("/sys") && !config.url.startsWith("http")) {
|
||||
if (!configDefault.params.projectId && projectStore.isEnterprise && !config.url.startsWith("/sys") && !config.url.startsWith("http")) {
|
||||
configDefault.params.projectId = projectStore.currentProject?.id;
|
||||
}
|
||||
return service(configDefault);
|
||||
|
||||
@@ -220,6 +220,7 @@ export default {
|
||||
myProjectDetail: "Project Detail",
|
||||
projectJoin: "Join Project",
|
||||
currentProject: "Current Project",
|
||||
projectMemberManager: "Project Member",
|
||||
},
|
||||
certificateRepo: {
|
||||
title: "Certificate Repository",
|
||||
@@ -822,6 +823,9 @@ export default {
|
||||
admin: "Admin",
|
||||
},
|
||||
projectMemberStatus: "Member Status",
|
||||
|
||||
isSystem: "Is System Project",
|
||||
isSystemHelper: "System-level projects allow running admin plugins",
|
||||
},
|
||||
project: {
|
||||
noProjectJoined: "You haven't joined any projects yet",
|
||||
@@ -838,6 +842,8 @@ export default {
|
||||
leaveFailed: "Leave project failed, please try again later",
|
||||
applyJoinConfirm: "Are you sure you want to apply to join this project?",
|
||||
leaveConfirm: "Are you sure you want to leave this project?",
|
||||
viewDetail: "View Detail",
|
||||
projectManage: "Project Manage",
|
||||
},
|
||||
addonSelector: {
|
||||
select: "Select",
|
||||
|
||||
@@ -220,12 +220,12 @@ export default {
|
||||
netTest: "网络测试",
|
||||
enterpriseManager: "企业管理设置",
|
||||
projectManager: "项目管理",
|
||||
projectDetail: "项目详情",
|
||||
enterpriseSetting: "企业设置",
|
||||
myProjectManager: "我的项目",
|
||||
myProjectDetail: "项目详情",
|
||||
projectJoin: "加入项目",
|
||||
currentProject: "当前项目",
|
||||
projectMemberManager: "项目成员管理",
|
||||
},
|
||||
certificateRepo: {
|
||||
title: "证书仓库",
|
||||
@@ -838,6 +838,9 @@ export default {
|
||||
admin: "管理员",
|
||||
},
|
||||
projectMemberStatus: "成员状态",
|
||||
|
||||
isSystem: "是否系统项目",
|
||||
isSystemHelper: "系统级项目允许运行管理员插件",
|
||||
},
|
||||
project: {
|
||||
noProjectJoined: "您还没有加入任何项目",
|
||||
@@ -854,5 +857,7 @@ export default {
|
||||
leaveFailed: "退出项目失败,请稍后重试",
|
||||
applyJoinConfirm: "确认加入项目?",
|
||||
leaveConfirm: "确认退出项目?",
|
||||
viewDetail: "查看详情",
|
||||
projectManage: "项目管理",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -55,7 +55,7 @@ export default {
|
||||
email_webhook_notifications: "邮件、webhook通知方式",
|
||||
|
||||
professional_edition: "专业版",
|
||||
open_source_support: "开源需要您的赞助支持",
|
||||
open_source_support: "开源需要您的赞助支持,个人和企业内部使用",
|
||||
vip_group_priority: "可加VIP群,您的需求将优先实现",
|
||||
unlimited_site_certificate_monitoring: "站点证书监控无限制",
|
||||
more_notification_methods: "更多通知方式",
|
||||
@@ -66,13 +66,13 @@ export default {
|
||||
get_after_support: "立即赞助",
|
||||
|
||||
business_edition: "商业版",
|
||||
commercial_license: "商业授权,可对外运营",
|
||||
commercial_license: "商业授权,可对外运营,提供SaaS服务",
|
||||
all_pro_privileges: "拥有专业版所有特权",
|
||||
allow_commercial_use_modify_logo_title: "允许商用,可修改logo、标题",
|
||||
data_statistics: "数据统计",
|
||||
plugin_management: "插件管理",
|
||||
unlimited_multi_users: "多用户无限制",
|
||||
support_user_payment: "支持用户支付",
|
||||
support_user_payment: "支持用户支付(购买套餐,按流水线条数、域名数量、部署次数计费)",
|
||||
activate: "激活",
|
||||
get_pro_code_after_support: "前往获取",
|
||||
business_contact_author: "",
|
||||
|
||||
@@ -10,7 +10,9 @@ import { usePermissionStore } from "/@/plugin/permission/store.permission";
|
||||
import util from "/@/plugin/permission/util.permission";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useProjectStore } from "../store/project";
|
||||
export const PROJECT_JOIN_PATH = "/certd/project/join";
|
||||
export const PROJECT_PATH_PREFIX = "/certd/project";
|
||||
export const SYS_PATH_PREFIX = "/sys";
|
||||
|
||||
function buildAccessedMenus(menus: any) {
|
||||
if (menus == null) {
|
||||
return;
|
||||
@@ -131,10 +133,10 @@ function setupAccessGuard(router: Router) {
|
||||
if (projectStore.isEnterprise) {
|
||||
//加载我的项目
|
||||
await projectStore.init();
|
||||
if (!projectStore.currentProject && to.path !== PROJECT_JOIN_PATH) {
|
||||
if (!projectStore.currentProject && !to.path.startsWith(PROJECT_PATH_PREFIX) && !to.path.startsWith(SYS_PATH_PREFIX)) {
|
||||
//没有项目
|
||||
return {
|
||||
path: PROJECT_JOIN_PATH,
|
||||
path: `${PROJECT_PATH_PREFIX}/join`,
|
||||
replace: true,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -29,21 +29,6 @@ export const certdResources = [
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "certd.sysResources.currentProject",
|
||||
name: "CurrentProject",
|
||||
path: "/certd/project/detail",
|
||||
component: "/certd/project/detail/index.vue",
|
||||
meta: {
|
||||
show: () => {
|
||||
const projectStore = useProjectStore();
|
||||
return projectStore.isEnterprise;
|
||||
},
|
||||
isMenu: true,
|
||||
icon: "ion:apps",
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "certd.sysResources.projectJoin",
|
||||
name: "ProjectJoin",
|
||||
@@ -142,6 +127,21 @@ export const certdResources = [
|
||||
keepAlive: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "certd.sysResources.currentProject",
|
||||
name: "ProjectMemberManager",
|
||||
path: "/certd/project/detail",
|
||||
component: "/certd/project/detail/index.vue",
|
||||
meta: {
|
||||
show: () => {
|
||||
const projectStore = useProjectStore();
|
||||
return projectStore.isEnterprise;
|
||||
},
|
||||
isMenu: true,
|
||||
icon: "ion:apps",
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "certd.settings",
|
||||
name: "MineSetting",
|
||||
|
||||
@@ -15,11 +15,18 @@ export type ProjectItem = {
|
||||
export const useProjectStore = defineStore("app.project", () => {
|
||||
const myProjects = ref([]);
|
||||
const inited = ref(false);
|
||||
const currentProjectId = ref(); // 直接调用
|
||||
|
||||
function $reset() {
|
||||
myProjects.value = [];
|
||||
currentProjectId.value = "";
|
||||
inited.value = false;
|
||||
}
|
||||
const userStore = useUserStore();
|
||||
const userId = userStore.getUserInfo?.id;
|
||||
const lastProjectIdCacheKey = "currentProjectId:" + userId;
|
||||
const lastProjectId = LocalStorage.get(lastProjectIdCacheKey);
|
||||
const currentProjectId = ref(lastProjectId); // 直接调用
|
||||
currentProjectId.value = lastProjectId;
|
||||
|
||||
const projects = computed(() => {
|
||||
return myProjects.value;
|
||||
@@ -118,11 +125,6 @@ export const useProjectStore = defineStore("app.project", () => {
|
||||
return false;
|
||||
}
|
||||
|
||||
function $reset() {
|
||||
myProjects.value = [];
|
||||
currentProjectId.value = "";
|
||||
}
|
||||
|
||||
return {
|
||||
projects,
|
||||
myProjects,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useFormWrapper } from "@fast-crud/fast-crud";
|
||||
import { merge } from "lodash-es";
|
||||
|
||||
export type FormOptionReq = {
|
||||
title: string;
|
||||
@@ -7,6 +8,7 @@ export type FormOptionReq = {
|
||||
body?: any;
|
||||
initialForm?: any;
|
||||
zIndex?: number;
|
||||
wrapper?: any;
|
||||
};
|
||||
|
||||
export function useFormDialog() {
|
||||
@@ -14,19 +16,23 @@ export function useFormDialog() {
|
||||
|
||||
async function openFormDialog(req: FormOptionReq) {
|
||||
function createCrudOptions() {
|
||||
const warpper = merge(
|
||||
{
|
||||
zIndex: req.zIndex,
|
||||
title: req.title,
|
||||
saveRemind: false,
|
||||
slots: {
|
||||
"form-body-top": req.body,
|
||||
},
|
||||
},
|
||||
req.wrapper
|
||||
);
|
||||
return {
|
||||
crudOptions: {
|
||||
columns: req.columns,
|
||||
form: {
|
||||
initialForm: req.initialForm,
|
||||
wrapper: {
|
||||
zIndex: req.zIndex,
|
||||
title: req.title,
|
||||
saveRemind: false,
|
||||
slots: {
|
||||
"form-body-top": req.body,
|
||||
},
|
||||
},
|
||||
wrapper: warpper,
|
||||
async afterSubmit() {},
|
||||
async doSubmit({ form }: any) {
|
||||
if (req.onSubmit) {
|
||||
|
||||
@@ -143,7 +143,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
order: 10,
|
||||
},
|
||||
valueBuilder: ({ row, key, value }) => {
|
||||
row[key] = row.userId > 0 ? "user" : "sys";
|
||||
row[key] = row.userId != 0 ? "user" : "sys";
|
||||
},
|
||||
},
|
||||
...commonColumnsDefine,
|
||||
|
||||
@@ -121,7 +121,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
order: 10,
|
||||
},
|
||||
valueBuilder: ({ row, key, value }) => {
|
||||
row[key] = row.userId > 0 ? "user" : "sys";
|
||||
row[key] = row.userId != 0 ? "user" : "sys";
|
||||
},
|
||||
},
|
||||
...commonColumnsDefine,
|
||||
|
||||
@@ -734,7 +734,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
}),
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
width: 140,
|
||||
sorter: true,
|
||||
align: "center",
|
||||
},
|
||||
@@ -757,7 +757,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
helper: t("monitor.ipSyncModeHelper"),
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
width: 140,
|
||||
sorter: true,
|
||||
align: "center",
|
||||
},
|
||||
@@ -779,7 +779,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
helper: t("monitor.ipIgnoreCoherenceHelper"),
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
width: 180,
|
||||
sorter: true,
|
||||
align: "center",
|
||||
},
|
||||
|
||||
@@ -16,13 +16,16 @@ import { useCertViewer } from "/@/views/certd/pipeline/use";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { useDicts } from "../dicts";
|
||||
import { useProjectStore } from "/@/store/project";
|
||||
import { useCrudPermission } from "/@/plugin/permission";
|
||||
|
||||
export default function ({ crudExpose, context: { selectedRowKeys, openCertApplyDialog, hasActionPermission } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
export default function ({ crudExpose, context: { selectedRowKeys, openCertApplyDialog, permission } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
const lastResRef = ref();
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const { hasActionPermission } = useCrudPermission({ permission });
|
||||
|
||||
const { openUploadCreateDialog } = useCertUpload();
|
||||
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
|
||||
@@ -73,3 +73,17 @@ export async function ApproveJoin(form: any) {
|
||||
data: form,
|
||||
});
|
||||
}
|
||||
|
||||
export async function GetSelfResources() {
|
||||
return await request({
|
||||
url: "/enterprise/transfer/selfResources",
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
|
||||
export async function TransferResources() {
|
||||
return await request({
|
||||
url: "/enterprise/transfer/doTransfer",
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -109,7 +109,10 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {},
|
||||
form: {
|
||||
show: true,
|
||||
rules: [{ required: true, message: "请选择用户" }],
|
||||
},
|
||||
editForm: {
|
||||
show: false,
|
||||
},
|
||||
@@ -126,6 +129,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
form: {
|
||||
show: true,
|
||||
rules: [{ required: true, message: "请选择权限" }],
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
@@ -140,6 +144,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
form: {
|
||||
show: true,
|
||||
rules: [{ required: true, message: "请选择状态" }],
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
@@ -156,6 +161,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
id: row.id,
|
||||
permission: row.permission,
|
||||
onSubmit: async (form: any) => {
|
||||
form.userId = row.userId;
|
||||
await api.ApproveJoin(form);
|
||||
crudExpose.doRefresh();
|
||||
},
|
||||
|
||||
@@ -9,8 +9,12 @@
|
||||
<fs-values-format :model-value="project.permission" :dict="projectPermissionDict"></fs-values-format>
|
||||
<a-divider type="vertical"></a-divider>
|
||||
<fs-values-format :model-value="project.status" :dict="projectMemberStatusDict"></fs-values-format> -->
|
||||
<a-divider type="vertical"></a-divider>
|
||||
<a-button class="mr-5" type="primary" @click="openTransferDialog">个人数据迁移</a-button>
|
||||
<a-button v-if="userStore.isAdmin" type="primary" @click="goProjectManager">{{ t("certd.project.projectManage") }}</a-button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="more"></div>
|
||||
</template>
|
||||
<fs-crud ref="crudRef" v-bind="crudBinding">
|
||||
<template #pagination-left>
|
||||
@@ -29,11 +33,13 @@ import createCrudOptions from "./crud";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { DeleteBatch } from "./api";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useProjectStore } from "/@/store/project";
|
||||
import { request } from "/@/api/service";
|
||||
import { useDicts } from "../../dicts";
|
||||
import { useCrudPermission } from "/@/plugin/permission";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useTransfer } from "./use";
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -49,6 +55,14 @@ if (!projectId) {
|
||||
projectId = projectStore.currentProject?.id;
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
function goProjectManager() {
|
||||
router.push(`/sys/enterprise/project`);
|
||||
}
|
||||
|
||||
const { openTransferDialog } = useTransfer();
|
||||
|
||||
const { projectPermissionDict, projectMemberStatusDict, userDict } = useDicts();
|
||||
|
||||
const project: Ref<any> = ref({});
|
||||
@@ -97,6 +111,10 @@ const handleBatchDelete = () => {
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(async () => {
|
||||
if (!projectId) {
|
||||
message.error("您还未选择项目");
|
||||
return;
|
||||
}
|
||||
await loadProjectDetail();
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
import { dict } from "@fast-crud/fast-crud";
|
||||
import { useDicts } from "../../dicts";
|
||||
import { useFormDialog } from "/@/use/use-dialog";
|
||||
|
||||
export function useApprove() {
|
||||
const { openFormDialog } = useFormDialog();
|
||||
const { projectPermissionDict, projectMemberStatusDict, userDict } = useDicts();
|
||||
function openApproveDialog({ id, permission, onSubmit }: { id: any; permission: any; onSubmit: any }) {
|
||||
openFormDialog({
|
||||
title: "审批加入申请",
|
||||
columns: {
|
||||
permission: {
|
||||
title: "成员权限",
|
||||
type: "dict-select",
|
||||
dict: projectPermissionDict,
|
||||
},
|
||||
status: {
|
||||
title: "审批结果",
|
||||
type: "dict-radio",
|
||||
dict: dict({
|
||||
data: [
|
||||
{
|
||||
label: "通过",
|
||||
value: "approved",
|
||||
},
|
||||
{
|
||||
label: "拒绝",
|
||||
value: "rejected",
|
||||
},
|
||||
],
|
||||
}),
|
||||
},
|
||||
},
|
||||
onSubmit: onSubmit,
|
||||
initialForm: {
|
||||
id: id,
|
||||
permission: permission,
|
||||
status: "approved",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
openApproveDialog,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
import { dict } from "@fast-crud/fast-crud";
|
||||
import { useDicts } from "../../dicts";
|
||||
import { useFormDialog } from "/@/use/use-dialog";
|
||||
import * as api from "./api";
|
||||
import { useProjectStore } from "/@/store/project";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { Ref, ref } from "vue";
|
||||
export function useApprove() {
|
||||
const { openFormDialog } = useFormDialog();
|
||||
const { projectPermissionDict, projectMemberStatusDict, userDict } = useDicts();
|
||||
function openApproveDialog({ id, permission, onSubmit }: { id: any; permission: any; onSubmit: any }) {
|
||||
openFormDialog({
|
||||
title: "审批加入申请",
|
||||
columns: {
|
||||
permission: {
|
||||
title: "成员权限",
|
||||
type: "dict-select",
|
||||
dict: projectPermissionDict,
|
||||
},
|
||||
status: {
|
||||
title: "审批结果",
|
||||
type: "dict-radio",
|
||||
dict: dict({
|
||||
data: [
|
||||
{
|
||||
label: "通过",
|
||||
value: "approved",
|
||||
},
|
||||
{
|
||||
label: "拒绝",
|
||||
value: "rejected",
|
||||
},
|
||||
],
|
||||
}),
|
||||
},
|
||||
},
|
||||
onSubmit: onSubmit,
|
||||
initialForm: {
|
||||
id: id,
|
||||
permission: permission,
|
||||
status: "approved",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
openApproveDialog,
|
||||
};
|
||||
}
|
||||
|
||||
export function useTransfer() {
|
||||
const { openFormDialog } = useFormDialog();
|
||||
|
||||
async function doTransfer() {
|
||||
Modal.confirm({
|
||||
title: "请确认",
|
||||
content: () => (
|
||||
<div>
|
||||
<p>确认迁移个人资源数据到当前项目?</p>
|
||||
<p class="text-red-500">注意;此操作不可逆,一旦迁移,数据将无法还原回个人用户名下。</p>
|
||||
</div>
|
||||
),
|
||||
okText: "确认",
|
||||
okType: "primary",
|
||||
onOk: async () => {
|
||||
await api.TransferResources();
|
||||
message.success("迁移成功");
|
||||
await loadMyResources();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const selfResources: Ref = ref({});
|
||||
|
||||
const projectStore = useProjectStore();
|
||||
|
||||
async function loadMyResources() {
|
||||
selfResources.value = await api.GetSelfResources();
|
||||
}
|
||||
async function openTransferDialog() {
|
||||
await loadMyResources();
|
||||
openFormDialog({
|
||||
title: "迁移我的个人资源到当前企业项目",
|
||||
wrapper: {
|
||||
buttons: {
|
||||
ok: {
|
||||
show: false,
|
||||
},
|
||||
reset: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
body() {
|
||||
return (
|
||||
<div class="p-8">
|
||||
<div class="flex flex-row items-center justify-evenly w-full">
|
||||
<div>
|
||||
<h3 class="text-lg font-bold">我原有的个人资源数量</h3>
|
||||
<div class="mt-4">
|
||||
<p>流水线:{selfResources.value.pipeline}</p>
|
||||
<p>流水线历史:{selfResources.value.history}</p>
|
||||
<p>流水线历史日志:{selfResources.value.historyLog}</p>
|
||||
<p>流水线分组:{selfResources.value.pipelineGroup}</p>
|
||||
<p>存储:{selfResources.value.storage}</p>
|
||||
<p>证书:{selfResources.value.certInfo}</p>
|
||||
<p>授权:{selfResources.value.access}</p>
|
||||
<p>站点监控:{selfResources.value.siteMonitor}</p>
|
||||
<p>通知:{selfResources.value.notification}</p>
|
||||
<p>站点监控分组:{selfResources.value.group}</p>
|
||||
|
||||
<p>流水线模版:{selfResources.value.template}</p>
|
||||
<p>域名:{selfResources.value.domain}</p>
|
||||
<p>子域名托管:{selfResources.value.subdomain}</p>
|
||||
<p>cname记录:{selfResources.value.cnameRecord}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-2xl font-bold"> 迁移到→ </div>
|
||||
<div>项目:"{projectStore.currentProject?.name}"</div>
|
||||
</div>
|
||||
<div class="flex flex-row items-center justify-center w-full">
|
||||
<a-button type="primary" onClick={doTransfer}>
|
||||
确认迁移
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
return {
|
||||
openTransferDialog,
|
||||
};
|
||||
}
|
||||
@@ -5,6 +5,10 @@
|
||||
{{ t("certd.sysResources.projectJoin") }}
|
||||
<span v-if="projectStore.projects.length === 0" class="sub">{{ t("certd.project.noProjectJoined") }}</span>
|
||||
</div>
|
||||
|
||||
<div class="more">
|
||||
<a-button v-if="userStore.isAdmin" type="primary" @click="goProjectManager">{{ t("certd.project.projectManage") }}</a-button>
|
||||
</div>
|
||||
</template>
|
||||
<div class="project-container">
|
||||
<h3 class="text-lg font-medium mb-4">{{ t("certd.project.projectList") }}</h3>
|
||||
@@ -13,20 +17,20 @@
|
||||
<a-card :bordered="true" class="project-card">
|
||||
<div class="project-card-content">
|
||||
<div class="project-info">
|
||||
<h3 class="text-md font-bold title">{{ project.name }}</h3>
|
||||
<p class="text-gray-500 text-sm">{{ formatDate(project.createTime) }}</p>
|
||||
<div class="text-md font-bold title">{{ project.name }}</div>
|
||||
<div class="flex items-center justify-start">管理员: <fs-values-format :model-value="project.adminId" :dict="userDict" color="green"></fs-values-format></div>
|
||||
<p class="text-gray-500 text-sm">创建时间:{{ formatDate(project.createTime) }}</p>
|
||||
</div>
|
||||
<div class="flex-col items-center">
|
||||
<div>管理员: <fs-values-format :model-value="project.adminId" :dict="userDict"></fs-values-format></div>
|
||||
<div class="flex items-center mt-2">
|
||||
<div v-if="project.status">
|
||||
<fs-values-format :model-value="project.status" :dict="projectMemberStatusDict"></fs-values-format>
|
||||
</div>
|
||||
<div v-if="project.permission"><fs-values-format :model-value="project.permission" :dict="projectPermissionDict"></fs-values-format></div>
|
||||
</div>
|
||||
<div class="flex-col items-start">
|
||||
<div v-if="project.status" class="mt-1 flex items-center justify-start">状态:<fs-values-format :model-value="project.status" :dict="projectMemberStatusDict"></fs-values-format></div>
|
||||
<div v-if="project.permission" class="mt-1 flex items-center justify-start">权限:<fs-values-format :model-value="project.permission" :dict="projectPermissionDict"></fs-values-format></div>
|
||||
</div>
|
||||
</div>
|
||||
<template #actions>
|
||||
<span v-if="project.status === 'approved'" class="flex-inline items-center text-blue-500" :title="t('certd.project.viewDetail')" @click="goProjectDetail(project.id)">
|
||||
<fs-icon class="fs-18 mr-2" icon="mdi:eye-outline"></fs-icon>
|
||||
{{ t("certd.project.viewDetail") }}
|
||||
</span>
|
||||
<span v-if="!project.status || project.status === 'rejected'" class="flex-inline items-center text-blue-500" :title="t('certd.project.applyJoin')" @click="applyToJoin(project.id)">
|
||||
<fs-icon class="fs-18 mr-2" icon="mdi:checkbox-marked-circle-outline"></fs-icon>
|
||||
{{ t("certd.project.applyJoin") }}
|
||||
@@ -51,6 +55,8 @@ import { request } from "/src/api/service";
|
||||
import { useProjectStore } from "/@/store/project";
|
||||
import dayjs from "dayjs";
|
||||
import { useDicts } from "../dicts";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
|
||||
defineOptions({
|
||||
name: "ProjectJoin",
|
||||
@@ -62,6 +68,17 @@ const { projectMemberStatusDict, projectPermissionDict, userDict } = useDicts();
|
||||
const projects = ref<any[]>([]);
|
||||
|
||||
const projectStore = useProjectStore();
|
||||
const userStore = useUserStore();
|
||||
function goProjectManager() {
|
||||
// 假设这里调用跳转到项目管理页的API
|
||||
router.push(`/sys/enterprise/project`);
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
function goProjectDetail(projectId: number) {
|
||||
// 假设这里调用跳转到项目详情页的API
|
||||
router.push(`/certd/project/detail?projectId=${projectId}`);
|
||||
}
|
||||
|
||||
const getSystemProjects = async () => {
|
||||
try {
|
||||
@@ -147,7 +164,6 @@ async function leaveProject(projectId: number) {
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,35 +90,21 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
},
|
||||
},
|
||||
disabled: {
|
||||
title: t("certd.disabled"),
|
||||
isSystem: {
|
||||
title: t("certd.ent.isSystem"),
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t("certd.enabled"), value: false, color: "success" },
|
||||
{ label: t("certd.disabledLabel"), value: true, color: "error" },
|
||||
{ label: t("common.yes"), value: true, color: "success" },
|
||||
{ label: t("common.no"), value: false, color: "error" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: false,
|
||||
value: true,
|
||||
helper: t("certd.ent.isSystemHelper"),
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
title: t("certd.clickToToggle"),
|
||||
on: {
|
||||
async click({ value, row }) {
|
||||
Modal.confirm({
|
||||
title: t("certd.prompt"),
|
||||
content: t("certd.confirmToggleStatus", { action: !value ? t("certd.disable") : t("certd.enable") }),
|
||||
onOk: async () => {
|
||||
await api.SetDisabled(row.id, !value);
|
||||
await crudExpose.doRefresh();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
width: 150,
|
||||
},
|
||||
},
|
||||
adminId: {
|
||||
|
||||
@@ -108,7 +108,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {},
|
||||
form: {
|
||||
rules: [{ required: true, message: "请选择用户" }],
|
||||
},
|
||||
editForm: {
|
||||
show: false,
|
||||
},
|
||||
@@ -131,6 +133,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
form: {
|
||||
show: true,
|
||||
rules: [{ required: true, message: "请选择权限" }],
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
@@ -145,6 +148,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
form: {
|
||||
show: true,
|
||||
rules: [{ required: true, message: "请选择状态" }],
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<h2 class="intro-title text-xl font-bold">{{ title || "管理模式介绍" }}</h2>
|
||||
<div class="mt-8 image-block">
|
||||
<div class="flex gap-8">
|
||||
<div class="intro-desc flex-1">SaaS模式:每个用户管理自己的流水线和授权资源,独立使用。</div>
|
||||
<div class="intro-desc flex-1">企业模式:企业内部员工使用,通过项目合作管理流水线证书和授权资源。</div>
|
||||
<div class="intro-desc flex-1">SaaS模式:每个用户管理自己的流水线和授权资源,每个用户独立使用。</div>
|
||||
<div class="intro-desc flex-1">企业模式:通过项目合作管理流水线证书和授权资源,所有用户视为企业内部员工。</div>
|
||||
</div>
|
||||
<div class="image-intro">
|
||||
<img :src="src" alt="" />
|
||||
|
||||
@@ -6,8 +6,11 @@
|
||||
<fs-dict-radio v-model:value="formState.public.adminMode" :disabled="!settingsStore.isPlus" :dict="adminModeDict" />
|
||||
<vip-button class="ml-5" mode="button"></vip-button>
|
||||
</div>
|
||||
<div class="helper">建议在开始使用时选择合适的模式,之后就不要随意切换了。</div>
|
||||
<div><a @click="adminModeIntroOpen = true"> 管理模式介绍</a></div>
|
||||
<div class="helper">SaaS模式:每个用户管理自己的流水线和授权资源,独立使用。</div>
|
||||
<div class="helper">企业模式:通过项目合作管理流水线证书和授权资源,所有用户视为企业内部员工。</div>
|
||||
<div class="helper text-red-500">建议在开始使用时固定一个合适的模式,之后就不要随意切换了。</div>
|
||||
<div v-if="settingsStore.isComm" class="helper text-red-500">商业版不建议设置为企业模式,除非你确定要转成企业内部使用</div>
|
||||
<div><a @click="adminModeIntroOpen = true"> 更多管理模式介绍</a></div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 8 }">
|
||||
|
||||
@@ -6,7 +6,7 @@ typeorm:
|
||||
default:
|
||||
type: mysql # mariadb
|
||||
host: localhost
|
||||
port: 3309
|
||||
port: 3308
|
||||
username: root
|
||||
password: root
|
||||
database: certd
|
||||
|
||||
@@ -3,6 +3,33 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.39.1](https://github.com/certd/certd/compare/v1.39.0...v1.39.1) (2026-03-09)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持迁移个人数据到企业项目中 ([c6ca832](https://github.com/certd/certd/commit/c6ca83273779ed84de1b23b5e477063af043d015))
|
||||
|
||||
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复部署到openwrt错误的bug ([2e3d0cc](https://github.com/certd/certd/commit/2e3d0cc57c16c48ad435bc8fde729bacaedde9f5))
|
||||
* 修复复制流水线保存后丢失分组和排序号的问题 ([bc32648](https://github.com/certd/certd/commit/bc326489abc1d50a0930b4f47aa2d62d3a486798))
|
||||
* 修复京东云域名申请证书报错的bug ([d9c0130](https://github.com/certd/certd/commit/d9c0130b59997144a3c274d456635b800135e43f))
|
||||
* 修复偶尔下载证书报未授权的错误 ([316537e](https://github.com/certd/certd/commit/316537eb4dcbe5ec57784e8bf95ee3cdfd21dce7))
|
||||
* 修复dcdn多个域名同时部署时 可能会出现证书名称重复的bug ([78c2ced](https://github.com/certd/certd/commit/78c2ced43b1a73d142b0ed783b162b97f545ab06))
|
||||
* 优化dcdn部署上传多次证书 偶尔报 The CertName already exists的问题 ([72f850f](https://github.com/certd/certd/commit/72f850f675b500d12ebff2338d1b99d6fab476e1))
|
||||
* **cert-plugin:** 优化又拍云客户端错误处理逻辑,当域名已绑定证书时不再抛出异常。 ([92c9ac3](https://github.com/certd/certd/commit/92c9ac382692e6c84140ff787759ab6d39ccbe96))
|
||||
* esxi部署失败的bug ([1e44115](https://github.com/certd/certd/commit/1e441154617e6516a9a3610412bf597128c62696))
|
||||
|
||||
### Features
|
||||
|
||||
* 支持企业级管理模式,项目管理,细分权限 ([3734083](https://github.com/certd/certd/commit/37340838b6a61a94b86bfa13cf5da88b26f1315a))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 站点监控支持指定ip地址检查 ([83d81b6](https://github.com/certd/certd/commit/83d81b64b3adb375366039e07c87d1ad79121c13))
|
||||
|
||||
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
|
||||
|
||||
**Note:** Version bump only for package @certd/ui-server
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
|
||||
CREATE TABLE `cd_project`
|
||||
(
|
||||
`id` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`user_id` bigint NOT NULL,
|
||||
`name` varchar(512) NOT NULL,
|
||||
`admin_id` bigint NOT NULL,
|
||||
`disabled` boolean NOT NULL DEFAULT false,
|
||||
`is_system` boolean NOT NULL DEFAULT false,
|
||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
|
||||
CREATE INDEX `index_project_user_id` ON `cd_project` (`user_id`);
|
||||
CREATE INDEX `index_project_admin_id` ON `cd_project` (`admin_id`);
|
||||
INSERT INTO cd_project (id, user_id, `admin_id`, `name`, `disabled`, `is_system`) VALUES (1, -1, 1,'default', false,false);
|
||||
|
||||
ALTER TABLE cd_cert_info ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_cert_project_id` ON `cd_cert_info` (`project_id`);
|
||||
|
||||
ALTER TABLE cd_site_info ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_site_project_id` ON `cd_site_info` (`project_id`);
|
||||
|
||||
ALTER TABLE cd_site_ip ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_site_ip_project_id` ON `cd_site_ip` (`project_id`);
|
||||
|
||||
ALTER TABLE cd_open_key ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_open_key_project_id` ON `cd_open_key` (`project_id`);
|
||||
|
||||
ALTER TABLE cd_access ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_access_project_id` ON `cd_access` (`project_id`);
|
||||
|
||||
ALTER TABLE cd_addon ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_addon_project_id` ON `cd_addon` (`project_id`);
|
||||
|
||||
ALTER TABLE pi_pipeline ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_pipeline_project_id` ON `pi_pipeline` (`project_id`);
|
||||
|
||||
ALTER TABLE pi_pipeline_group ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_pipeline_group_project_id` ON `pi_pipeline_group` (`project_id`);
|
||||
|
||||
ALTER TABLE pi_storage ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_storage_project_id` ON `pi_storage` (`project_id`);
|
||||
|
||||
ALTER TABLE pi_notification ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_notification_project_id` ON `pi_notification` (`project_id`);
|
||||
|
||||
ALTER TABLE pi_history ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_history_project_id` ON `pi_history` (`project_id`);
|
||||
|
||||
ALTER TABLE pi_history_log ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_history_log_project_id` ON `pi_history_log` (`project_id`);
|
||||
|
||||
ALTER TABLE pi_template ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_template_project_id` ON `pi_template` (`project_id`);
|
||||
|
||||
ALTER TABLE pi_sub_domain ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_sub_domain_project_id` ON `pi_sub_domain` (`project_id`);
|
||||
|
||||
ALTER TABLE cd_cname_record ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_cname_record_project_id` ON `cd_cname_record` (`project_id`);
|
||||
|
||||
ALTER TABLE cd_domain ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_domain_project_id` ON `cd_domain` (`project_id`);
|
||||
|
||||
ALTER TABLE user_settings ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_user_settings_project_id` ON `user_settings` (`project_id`);
|
||||
|
||||
ALTER TABLE cd_group ADD COLUMN project_id bigint;
|
||||
CREATE INDEX `index_group_project_id` ON `cd_group` (`project_id`);
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE `cd_project_member`
|
||||
(
|
||||
`id` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`user_id` bigint NOT NULL,
|
||||
`project_id` bigint NOT NULL,
|
||||
`permission` varchar(128) NOT NULL DEFAULT 'read',
|
||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
ALTER TABLE cd_project_member ADD COLUMN status varchar(128);
|
||||
|
||||
CREATE INDEX `index_project_member_user_id` ON `cd_project_member` (`user_id`);
|
||||
CREATE INDEX `index_project_member_project_id` ON `cd_project_member` (`project_id`);
|
||||
|
||||
|
||||
CREATE TABLE `cd_audit_log`
|
||||
(
|
||||
`id` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`user_id` bigint NOT NULL,
|
||||
`username` varchar(128) NOT NULL,
|
||||
`project_id` bigint NOT NULL,
|
||||
`project_name` varchar(512) NOT NULL,
|
||||
`type` varchar(128) NOT NULL,
|
||||
`action` varchar(128) NOT NULL DEFAULT 'read',
|
||||
`content` longtext NOT NULL,
|
||||
`ip_address` varchar(128) NOT NULL,
|
||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
|
||||
CREATE INDEX `index_audit_log_user_id` ON `cd_audit_log` (`user_id`);
|
||||
CREATE INDEX `index_audit_log_project_id` ON `cd_audit_log` (`project_id`);
|
||||
|
||||
|
||||
|
||||
ALTER TABLE cd_site_info ADD COLUMN ip_address varchar(128);
|
||||
|
||||
|
||||
ALTER TABLE `cd_project` ENGINE = InnoDB;
|
||||
ALTER TABLE `cd_project_member` ENGINE = InnoDB;
|
||||
ALTER TABLE `cd_audit_log` ENGINE = InnoDB;
|
||||
@@ -0,0 +1,116 @@
|
||||
|
||||
CREATE TABLE "cd_project"
|
||||
(
|
||||
"id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL,
|
||||
"user_id" bigint NOT NULL,
|
||||
"name" varchar(512) NOT NULL,
|
||||
"admin_id" bigint NOT NULL,
|
||||
"disabled" boolean NOT NULL DEFAULT (false),
|
||||
"is_system" boolean NOT NULL DEFAULT (false),
|
||||
"create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
|
||||
CREATE INDEX "index_project_user_id" ON "cd_project" ("user_id");
|
||||
CREATE INDEX "index_project_admin_id" ON "cd_project" ("admin_id");
|
||||
INSERT INTO cd_project (id, user_id, "admin_id", "name", "disabled", "is_system") VALUES (1, -1, 1,'default', false,false);
|
||||
select setval('cd_project_id_seq', 1);
|
||||
|
||||
|
||||
ALTER TABLE cd_cert_info ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_cert_project_id" ON "cd_cert_info" ("project_id");
|
||||
|
||||
ALTER TABLE cd_site_info ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_site_project_id" ON "cd_site_info" ("project_id");
|
||||
|
||||
ALTER TABLE cd_site_ip ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_site_ip_project_id" ON "cd_site_ip" ("project_id");
|
||||
|
||||
ALTER TABLE cd_open_key ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_open_key_project_id" ON "cd_open_key" ("project_id");
|
||||
|
||||
ALTER TABLE cd_access ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_access_project_id" ON "cd_access" ("project_id");
|
||||
|
||||
ALTER TABLE cd_addon ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_addon_project_id" ON "cd_addon" ("project_id");
|
||||
|
||||
ALTER TABLE pi_pipeline ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_pipeline_project_id" ON "pi_pipeline" ("project_id");
|
||||
|
||||
ALTER TABLE pi_pipeline_group ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_pipeline_group_project_id" ON "pi_pipeline_group" ("project_id");
|
||||
|
||||
ALTER TABLE pi_storage ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_storage_project_id" ON "pi_storage" ("project_id");
|
||||
|
||||
ALTER TABLE pi_notification ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_notification_project_id" ON "pi_notification" ("project_id");
|
||||
|
||||
ALTER TABLE pi_history ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_history_project_id" ON "pi_history" ("project_id");
|
||||
|
||||
ALTER TABLE pi_history_log ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_history_log_project_id" ON "pi_history_log" ("project_id");
|
||||
|
||||
ALTER TABLE pi_template ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_template_project_id" ON "pi_template" ("project_id");
|
||||
|
||||
ALTER TABLE pi_sub_domain ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_sub_domain_project_id" ON "pi_sub_domain" ("project_id");
|
||||
|
||||
ALTER TABLE cd_cname_record ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_cname_record_project_id" ON "cd_cname_record" ("project_id");
|
||||
|
||||
ALTER TABLE cd_domain ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_domain_project_id" ON "cd_domain" ("project_id");
|
||||
|
||||
ALTER TABLE user_settings ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_user_settings_project_id" ON "user_settings" ("project_id");
|
||||
|
||||
ALTER TABLE cd_group ADD COLUMN project_id bigint;
|
||||
CREATE INDEX "index_group_project_id" ON "cd_group" ("project_id");
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE "cd_project_member"
|
||||
(
|
||||
"id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL,
|
||||
"user_id" bigint NOT NULL,
|
||||
"project_id" bigint NOT NULL,
|
||||
"permission" varchar(128) NOT NULL DEFAULT ('read'),
|
||||
"create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
ALTER TABLE cd_project_member ADD COLUMN status varchar(128);
|
||||
|
||||
CREATE INDEX "index_project_member_user_id" ON "cd_project_member" ("user_id");
|
||||
CREATE INDEX "index_project_member_project_id" ON "cd_project_member" ("project_id");
|
||||
|
||||
|
||||
CREATE TABLE "cd_audit_log"
|
||||
(
|
||||
"id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL,
|
||||
"user_id" bigint NOT NULL,
|
||||
"username" varchar(128) NOT NULL,
|
||||
"project_id" bigint NOT NULL,
|
||||
"project_name" varchar(512) NOT NULL,
|
||||
"type" varchar(128) NOT NULL,
|
||||
"action" varchar(128) NOT NULL DEFAULT ('read'),
|
||||
"content" text NOT NULL,
|
||||
"ip_address" varchar(128) NOT NULL,
|
||||
"create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
|
||||
CREATE INDEX "index_audit_log_user_id" ON "cd_audit_log" ("user_id");
|
||||
CREATE INDEX "index_audit_log_project_id" ON "cd_audit_log" ("project_id");
|
||||
|
||||
|
||||
|
||||
ALTER TABLE cd_site_info ADD COLUMN ip_address varchar(128);
|
||||
|
||||
@@ -6,6 +6,7 @@ CREATE TABLE "cd_project"
|
||||
"name" varchar(512) NOT NULL,
|
||||
"admin_id" integer NOT NULL,
|
||||
"disabled" boolean NOT NULL DEFAULT (false),
|
||||
"is_system" boolean NOT NULL DEFAULT (false),
|
||||
"create_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
@@ -13,7 +14,7 @@ CREATE TABLE "cd_project"
|
||||
|
||||
CREATE INDEX "index_project_user_id" ON "cd_project" ("user_id");
|
||||
CREATE INDEX "index_project_admin_id" ON "cd_project" ("admin_id");
|
||||
INSERT INTO cd_project (id, user_id, "admin_id", "name", "disabled") VALUES (1, 0, 1,'default', false);
|
||||
INSERT INTO cd_project (id, user_id, "admin_id", "name", "disabled", "is_system") VALUES (1, -1, 1,'default', false,false);
|
||||
|
||||
ALTER TABLE cd_cert_info ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_cert_project_id" ON "cd_cert_info" ("project_id");
|
||||
|
||||
@@ -7,18 +7,23 @@ showTest: false
|
||||
input:
|
||||
clientId:
|
||||
title: ClientId
|
||||
helper: '[Azure Portal](https://portal.azure.com/)创建应用后获取'
|
||||
helper: >-
|
||||
[Microsoft Entra
|
||||
ID](https://portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/~/RegisteredApps)创建应用后获取
|
||||
required: true
|
||||
clientSecretKey:
|
||||
title: ClientSecretKey
|
||||
component:
|
||||
placeholder: ClientSecretKey / appSecretKey
|
||||
helper: 客户端凭据->证书与机密->客户端密码->新客户端密码
|
||||
required: true
|
||||
tenantId:
|
||||
title: TenantId
|
||||
helper: 租户ID,留空使用/common端点(需要应用配置为多租户)
|
||||
component:
|
||||
placeholder: common 或 租户ID
|
||||
helper: |-
|
||||
根据受支持的账户类型填写 common 或 租户ID,默认为common(Microsoft个人账户)。
|
||||
租户ID获取: 概述 -> 目录(租户) ID
|
||||
value: common
|
||||
required: false
|
||||
pluginType: addon
|
||||
|
||||
@@ -37,7 +37,7 @@ input:
|
||||
helper: |-
|
||||
1、支持多个域名打到一个证书上,例如: foo.com,*.foo.com,*.bar.com
|
||||
2、子域名被通配符包含的不要填写,例如:www.foo.com已经被*.foo.com包含,不要填写www.foo.com
|
||||
3、泛域名只能通配*号那一级(*.foo.com的证书不能用于xxx.yyy.foo.com、不能用于foo.com)
|
||||
3、泛域名只能通配*号那一级(*.foo.com的证书不能用于foo.com且不能用于xxx.yyy.foo.com)
|
||||
4、输入一个,空格之后,再输入下一个
|
||||
5、如果设置了子域托管解析(比如免费的二级域名托管在CF或者阿里云),请先[设置托管子域名](#/certd/pipeline/subDomain)
|
||||
email:
|
||||
|
||||
@@ -34,7 +34,7 @@ input:
|
||||
helper: |-
|
||||
1、支持多个域名打到一个证书上,例如: foo.com,*.foo.com,*.bar.com
|
||||
2、子域名被通配符包含的不要填写,例如:www.foo.com已经被*.foo.com包含,不要填写www.foo.com
|
||||
3、泛域名只能通配*号那一级(*.foo.com的证书不能用于xxx.yyy.foo.com、不能用于foo.com)
|
||||
3、泛域名只能通配*号那一级(*.foo.com的证书不能用于foo.com且不能用于xxx.yyy.foo.com)
|
||||
4、输入一个,空格之后,再输入下一个
|
||||
5、如果设置了子域托管解析(比如免费的二级域名托管在CF或者阿里云),请先[设置托管子域名](#/certd/pipeline/subDomain)
|
||||
email:
|
||||
|
||||
@@ -3,7 +3,7 @@ default:
|
||||
strategy:
|
||||
runStrategy: 0
|
||||
input:
|
||||
renewDays: 35
|
||||
renewDays: 15
|
||||
forceUpdate: false
|
||||
name: CertApplyLego
|
||||
icon: ph:certificate
|
||||
@@ -37,7 +37,7 @@ input:
|
||||
helper: |-
|
||||
1、支持多个域名打到一个证书上,例如: foo.com,*.foo.com,*.bar.com
|
||||
2、子域名被通配符包含的不要填写,例如:www.foo.com已经被*.foo.com包含,不要填写www.foo.com
|
||||
3、泛域名只能通配*号那一级(*.foo.com的证书不能用于xxx.yyy.foo.com、不能用于foo.com)
|
||||
3、泛域名只能通配*号那一级(*.foo.com的证书不能用于foo.com且不能用于xxx.yyy.foo.com)
|
||||
4、输入一个,空格之后,再输入下一个
|
||||
5、如果设置了子域托管解析(比如免费的二级域名托管在CF或者阿里云),请先[设置托管子域名](#/certd/pipeline/subDomain)
|
||||
email:
|
||||
|
||||
@@ -99,7 +99,7 @@ input:
|
||||
helper: |-
|
||||
1、支持多个域名打到一个证书上,例如: foo.com,*.foo.com,*.bar.com
|
||||
2、子域名被通配符包含的不要填写,例如:www.foo.com已经被*.foo.com包含,不要填写www.foo.com
|
||||
3、泛域名只能通配*号那一级(*.foo.com的证书不能用于xxx.yyy.foo.com、不能用于foo.com)
|
||||
3、泛域名只能通配*号那一级(*.foo.com的证书不能用于foo.com且不能用于xxx.yyy.foo.com)
|
||||
4、输入一个,空格之后,再输入下一个
|
||||
5、如果设置了子域托管解析(比如免费的二级域名托管在CF或者阿里云),请先[设置托管子域名](#/certd/pipeline/subDomain)
|
||||
pfxPassword:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.38.12",
|
||||
"version": "1.39.1",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -50,20 +50,20 @@
|
||||
"@aws-sdk/client-route-53": "^3.964.0",
|
||||
"@aws-sdk/client-s3": "^3.964.0",
|
||||
"@aws-sdk/client-sts": "^3.990.0",
|
||||
"@certd/acme-client": "^1.38.12",
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@certd/commercial-core": "^1.38.12",
|
||||
"@certd/acme-client": "^1.39.1",
|
||||
"@certd/basic": "^1.39.1",
|
||||
"@certd/commercial-core": "^1.39.1",
|
||||
"@certd/cv4pve-api-javascript": "^8.4.2",
|
||||
"@certd/jdcloud": "^1.38.12",
|
||||
"@certd/lib-huawei": "^1.38.12",
|
||||
"@certd/lib-k8s": "^1.38.12",
|
||||
"@certd/lib-server": "^1.38.12",
|
||||
"@certd/midway-flyway-js": "^1.38.12",
|
||||
"@certd/pipeline": "^1.38.12",
|
||||
"@certd/plugin-cert": "^1.38.12",
|
||||
"@certd/plugin-lib": "^1.38.12",
|
||||
"@certd/plugin-plus": "^1.38.12",
|
||||
"@certd/plus-core": "^1.38.12",
|
||||
"@certd/jdcloud": "^1.39.1",
|
||||
"@certd/lib-huawei": "^1.39.1",
|
||||
"@certd/lib-k8s": "^1.39.1",
|
||||
"@certd/lib-server": "^1.39.1",
|
||||
"@certd/midway-flyway-js": "^1.39.1",
|
||||
"@certd/pipeline": "^1.39.1",
|
||||
"@certd/plugin-cert": "^1.39.1",
|
||||
"@certd/plugin-lib": "^1.39.1",
|
||||
"@certd/plugin-plus": "^1.39.1",
|
||||
"@certd/plus-core": "^1.39.1",
|
||||
"@google-cloud/publicca": "^1.3.0",
|
||||
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.185",
|
||||
"@huaweicloud/huaweicloud-sdk-core": "^3.1.185",
|
||||
|
||||
@@ -80,7 +80,7 @@ const development = {
|
||||
type: 'better-sqlite3',
|
||||
database: './data/db.sqlite',
|
||||
synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true
|
||||
logging: false,
|
||||
logging: true,
|
||||
highlightSql: false,
|
||||
|
||||
// 配置实体模型 或者 entities: '/entity',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AccessService } from "@certd/lib-server";
|
||||
import { ALL, Body, Controller, Inject, Post, Provide, Query } from "@midwayjs/core";
|
||||
import { AccessService, Constants } from "@certd/lib-server";
|
||||
import { AccessController } from "../../user/pipeline/access-controller.js";
|
||||
|
||||
/**
|
||||
@@ -15,6 +15,12 @@ export class SysAccessController extends AccessController {
|
||||
return this.service2;
|
||||
}
|
||||
|
||||
async getProjectUserId(permission:string){
|
||||
return {
|
||||
projectId:null,userId:0
|
||||
}
|
||||
}
|
||||
|
||||
getUserId() {
|
||||
// checkComm();
|
||||
return 0;
|
||||
@@ -54,7 +60,7 @@ export class SysAccessController extends AccessController {
|
||||
return await super.define(type);
|
||||
}
|
||||
|
||||
@Post('/getSecretPlain', { summary: Constants.per.authOnly })
|
||||
@Post('/getSecretPlain', { summary: 'sys:settings:view' })
|
||||
async getSecretPlain(@Body(ALL) body: { id: number; key: string }) {
|
||||
const value = await this.service.getById(body.id, 0);
|
||||
return this.ok(value[body.key]);
|
||||
@@ -69,4 +75,9 @@ export class SysAccessController extends AccessController {
|
||||
async simpleInfo(@Query('id') id: number) {
|
||||
return await super.simpleInfo(id);
|
||||
}
|
||||
|
||||
@Post('/getDictByIds', { summary: 'sys:settings:view' })
|
||||
async getDictByIds(@Body('ids') ids: number[]) {
|
||||
return await super.getDictByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,12 +21,18 @@ export class BasicController extends BaseController {
|
||||
@Post('/preBindUser', { summary: 'sys:settings:edit' })
|
||||
public async preBindUser(@Body(ALL) body: PreBindUserReq) {
|
||||
// 设置缓存内容
|
||||
if (body.userId == null || body.userId <= 0) {
|
||||
throw new Error("用户ID不能为空");
|
||||
}
|
||||
await this.plusService.userPreBind(body.userId);
|
||||
return this.ok({});
|
||||
}
|
||||
|
||||
@Post('/bindUser', { summary: 'sys:settings:edit' })
|
||||
public async bindUser(@Body(ALL) body: BindUserReq) {
|
||||
if (body.userId == null || body.userId <= 0) {
|
||||
throw new Error("用户ID不能为空");
|
||||
}
|
||||
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
||||
installInfo.bindUserId = body.userId;
|
||||
await this.sysSettingsService.saveSetting(installInfo);
|
||||
|
||||
@@ -12,6 +12,11 @@ export class SysAddonController extends AddonController {
|
||||
return this.service2;
|
||||
}
|
||||
|
||||
async getProjectUserId(permission:string){
|
||||
return {
|
||||
projectId:null,userId:0 //0为系统级别
|
||||
}
|
||||
}
|
||||
getUserId() {
|
||||
// checkComm();
|
||||
return 0;
|
||||
|
||||
@@ -40,7 +40,7 @@ export class SysProjectController extends CrudController<ProjectEntity> {
|
||||
bean.userId = this.getUserId();
|
||||
return super.add({
|
||||
...bean,
|
||||
userId:0,
|
||||
userId:-1, //企业用户id固定为-1
|
||||
adminId: bean.userId,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -60,10 +60,12 @@ export class SysProjectMemberController extends CrudController<ProjectMemberEnti
|
||||
userId: this.getUserId(),
|
||||
projectId: projectId,
|
||||
});
|
||||
return super.update({
|
||||
const res =await this.service.update({
|
||||
id: bean.id,
|
||||
permission: bean.permission,
|
||||
status: bean.status,
|
||||
});
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post("/info", { summary: "sys:settings:view" })
|
||||
|
||||
@@ -20,8 +20,6 @@ export class CnameProviderController extends BaseController {
|
||||
|
||||
@Post('/list', { summary: Constants.per.authOnly })
|
||||
async list(@Body(ALL) body: any) {
|
||||
body.query = body.query ?? {};
|
||||
body.query.userId = this.getUserId();
|
||||
const res = await this.providerService.list({});
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@@ -67,50 +67,51 @@ export class CnameRecordController extends CrudController<CnameRecordService> {
|
||||
|
||||
@Post('/info', { summary: Constants.per.authOnly })
|
||||
async info(@Query('id') id: number) {
|
||||
await this.service.checkUserId(id, this.getUserId());
|
||||
await this.checkOwner(this.getService(), id, "read");
|
||||
return super.info(id);
|
||||
}
|
||||
|
||||
@Post('/delete', { summary: Constants.per.authOnly })
|
||||
async delete(@Query('id') id: number) {
|
||||
await this.service.checkUserId(id, this.getUserId());
|
||||
await this.checkOwner(this.getService(), id, "write");
|
||||
return super.delete(id);
|
||||
}
|
||||
|
||||
@Post('/deleteByIds', { summary: Constants.per.authOnly })
|
||||
async deleteByIds(@Body(ALL) body: any) {
|
||||
const {userId,projectId} = await this.getProjectUserIdWrite();
|
||||
await this.service.delete(body.ids, {
|
||||
userId: this.getUserId(),
|
||||
userId,
|
||||
projectId,
|
||||
});
|
||||
return this.ok();
|
||||
}
|
||||
@Post('/getByDomain', { summary: Constants.per.authOnly })
|
||||
async getByDomain(@Body(ALL) body: { domain: string; createOnNotFound: boolean }) {
|
||||
const userId = this.getUserId();
|
||||
const res = await this.service.getByDomain(body.domain, userId, body.createOnNotFound);
|
||||
const {userId,projectId} = await this.getProjectUserIdRead();
|
||||
const res = await this.service.getByDomain(body.domain, userId,projectId, body.createOnNotFound);
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post('/verify', { summary: Constants.per.authOnly })
|
||||
async verify(@Body(ALL) body: { id: number }) {
|
||||
const userId = this.getUserId();
|
||||
await this.service.checkUserId(body.id, userId);
|
||||
await this.checkOwner(this.getService(), body.id, "read");
|
||||
const res = await this.service.verify(body.id);
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post('/resetStatus', { summary: Constants.per.authOnly })
|
||||
async resetStatus(@Body(ALL) body: { id: number }) {
|
||||
const userId = this.getUserId();
|
||||
await this.service.checkUserId(body.id, userId);
|
||||
await this.checkOwner(this.getService(), body.id, "read");
|
||||
const res = await this.service.resetStatus(body.id);
|
||||
return this.ok(res);
|
||||
}
|
||||
@Post('/import', { summary: Constants.per.authOnly })
|
||||
async import(@Body(ALL) body: { domainList: string; cnameProviderId: any }) {
|
||||
const userId = this.getUserId();
|
||||
const {userId,projectId} = await this.getProjectUserIdWrite();
|
||||
const res = await this.service.doImport({
|
||||
userId,
|
||||
projectId,
|
||||
domainList: body.domainList,
|
||||
cnameProviderId: body.cnameProviderId,
|
||||
});
|
||||
|
||||
+4
-1
@@ -64,10 +64,13 @@ export class ProjectMemberController extends CrudController<ProjectMemberEntity>
|
||||
userId: this.getUserId(),
|
||||
projectId: projectId,
|
||||
});
|
||||
return super.update({
|
||||
const res = await this.service.update({
|
||||
id: bean.id,
|
||||
permission: bean.permission,
|
||||
status: bean.status,
|
||||
});
|
||||
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post("/info", { summary: Constants.per.authOnly })
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import { BaseController, Constants } from '@certd/lib-server';
|
||||
import { Controller, Inject, Post, Provide } from '@midwayjs/core';
|
||||
import { TransferService } from '../../../modules/sys/enterprise/service/transfer-service.js';
|
||||
|
||||
/**
|
||||
*/
|
||||
@Provide()
|
||||
@Controller('/api/enterprise/transfer')
|
||||
export class TransferController extends BaseController {
|
||||
@Inject()
|
||||
service: TransferService;
|
||||
|
||||
|
||||
getService(): TransferService {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 我自己的资源
|
||||
* @param body
|
||||
* @returns
|
||||
*/
|
||||
@Post('/selfResources', { summary: Constants.per.authOnly })
|
||||
async selfResources() {
|
||||
const userId = this.getUserId();
|
||||
const res = await this.service.getUserResources(userId);
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 迁移项目
|
||||
* @param body
|
||||
* @returns
|
||||
*/
|
||||
@Post('/doTransfer', { summary: Constants.per.authOnly })
|
||||
async doTransfer() {
|
||||
const {projectId} = await this.getProjectUserIdRead();
|
||||
const userId = this.getUserId();
|
||||
await this.service.transferAll(userId,projectId);
|
||||
return this.ok();
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ export class AccessController extends CrudController<AccessService> {
|
||||
@Post('/simpleInfo', { summary: Constants.per.authOnly })
|
||||
async simpleInfo(@Query('id') id: number) {
|
||||
// await this.authService.checkUserIdButAllowAdmin(this.ctx, this.service, id);
|
||||
await this.checkOwner(this.getService(), id, "read",true);
|
||||
// await this.checkOwner(this.getService(), id, "read",true);
|
||||
const res = await this.service.getSimpleInfo(id);
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@@ -164,8 +164,8 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
|
||||
// // 3. 检查原域名是否有cname记录
|
||||
// }
|
||||
|
||||
async getWithAccessByDomain(domain: string, userId: number) {
|
||||
const record: CnameRecord = await this.getByDomain(domain, userId);
|
||||
async getWithAccessByDomain(domain: string, userId: number,projectId?:number) {
|
||||
const record: CnameRecord = await this.getByDomain(domain, userId,projectId);
|
||||
if (record.cnameProvider.id > 0) {
|
||||
//自定义cname服务
|
||||
record.cnameProvider.access = await this.accessService.getAccessById(record.cnameProvider.accessId, false);
|
||||
@@ -179,17 +179,17 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
|
||||
return record;
|
||||
}
|
||||
|
||||
async getByDomain(domain: string, userId: number, createOnNotFound = true) {
|
||||
async getByDomain(domain: string, userId: number,projectId?:number, createOnNotFound = true) {
|
||||
if (!domain) {
|
||||
throw new ValidateException("domain不能为空");
|
||||
}
|
||||
if (userId == null) {
|
||||
throw new ValidateException("userId不能为空");
|
||||
}
|
||||
let record = await this.getRepository().findOne({ where: { domain, userId } });
|
||||
let record = await this.getRepository().findOne({ where: { domain, userId,projectId } });
|
||||
if (record == null) {
|
||||
if (createOnNotFound) {
|
||||
record = await this.add({ domain, userId });
|
||||
record = await this.add({ domain, userId,projectId });
|
||||
} else {
|
||||
throw new ValidateException(`找不到${domain}的CNAME记录`);
|
||||
}
|
||||
@@ -489,8 +489,8 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
|
||||
await this.getRepository().update(id, { status: "cname", mainDomain: "" });
|
||||
}
|
||||
|
||||
async doImport(req:{ userId: number; domainList: string; cnameProviderId: any }) {
|
||||
const {userId,cnameProviderId,domainList} = req;
|
||||
async doImport(req:{ userId: number; projectId: number; domainList: string; cnameProviderId: any }) {
|
||||
const {userId,projectId,cnameProviderId,domainList} = req;
|
||||
const domains = domainList.split("\n").map(item => item.trim()).filter(item => item.length > 0);
|
||||
if (domains.length === 0) {
|
||||
throw new ValidateException("域名列表不能为空");
|
||||
@@ -504,18 +504,19 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
|
||||
key: "user_"+userId,
|
||||
title: "导入CNAME记录",
|
||||
run: async (task) => {
|
||||
await this._import({ userId, domains, cnameProviderId },task);
|
||||
await this._import({ userId,projectId, domains, cnameProviderId },task);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
async _import(req :{ userId: number; domains: string[]; cnameProviderId: any },task:BackTask) {
|
||||
async _import(req :{ userId: number; projectId: number; domains: string[]; cnameProviderId: any },task:BackTask) {
|
||||
const userId = req.userId;
|
||||
for (const domain of req.domains) {
|
||||
const old = await this.getRepository().findOne({
|
||||
where: {
|
||||
userId: req.userId,
|
||||
domain,
|
||||
projectId: req.projectId,
|
||||
},
|
||||
});
|
||||
if (old) {
|
||||
@@ -526,6 +527,7 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
|
||||
await this.add({
|
||||
userId,
|
||||
domain: domain,
|
||||
projectId: req.projectId,
|
||||
cnameProviderId: req.cnameProviderId,
|
||||
});
|
||||
}catch(e){
|
||||
|
||||
@@ -63,7 +63,7 @@ export class TwoFactorService {
|
||||
}
|
||||
|
||||
async offAuthenticator(userId:number) {
|
||||
if (!userId) {
|
||||
if (!userId || userId <= 0) {
|
||||
throw new Error("userId is required");
|
||||
}
|
||||
|
||||
|
||||
@@ -358,7 +358,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
||||
async checkList(sites: SiteInfoEntity[],isCommon: boolean) {
|
||||
const cache = {}
|
||||
const getFromCache = async (userId: number,projectId?: number) =>{
|
||||
const key = `${userId}-${projectId??""}`
|
||||
const key = `${userId}_${projectId??""}`
|
||||
if (cache[key]) {
|
||||
return cache[key];
|
||||
}
|
||||
@@ -424,7 +424,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
||||
if (!req.text) {
|
||||
throw new Error("text is required");
|
||||
}
|
||||
if (!req.userId) {
|
||||
if (req.userId == null) {
|
||||
throw new Error("userId is required");
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
||||
}
|
||||
|
||||
clearSiteMonitorJob(userId: number,projectId?: number) {
|
||||
this.cron.remove(`siteMonitor-${userId}-${projectId||""}`);
|
||||
this.cron.remove(`siteMonitor_${userId}_${projectId||""}`);
|
||||
}
|
||||
|
||||
async registerSiteMonitorJob(userId?: number,projectId?: number) {
|
||||
@@ -502,7 +502,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
||||
}
|
||||
//注册个人的 或项目的
|
||||
this.cron.register({
|
||||
name: `siteMonitor-${userId}-${projectId||""}`,
|
||||
name: `siteMonitor_${userId}_${projectId||""}`,
|
||||
cron: setting.cron,
|
||||
job: () => this.triggerJobOnce(userId,projectId),
|
||||
});
|
||||
@@ -511,9 +511,9 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
||||
}
|
||||
|
||||
async triggerJobOnce(userId?:number,projectId?:number) {
|
||||
logger.info(`站点证书检查开始执行[${userId??'所有用户'}-${projectId??'所有项目'}]`);
|
||||
logger.info(`站点证书检查开始执行[${userId??'所有用户'}_${projectId??'所有项目'}]`);
|
||||
const query:any = { disabled: false };
|
||||
if(userId){
|
||||
if(userId!=null){
|
||||
query.userId = userId;
|
||||
if(projectId){
|
||||
query.projectId = projectId;
|
||||
@@ -541,7 +541,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
||||
await this.checkList(records,isCommon);
|
||||
}
|
||||
|
||||
logger.info(`站点证书检查完成[${userId??'所有用户'}-${projectId??'所有项目'}]`);
|
||||
logger.info(`站点证书检查完成[${userId??'所有用户'}_${projectId??'所有项目'}]`);
|
||||
}
|
||||
|
||||
async batchDelete(ids: number[], userId: number,projectId?:number): Promise<void> {
|
||||
|
||||
@@ -43,7 +43,7 @@ export class SiteIpService extends BaseService<SiteIpEntity> {
|
||||
}
|
||||
|
||||
async add(data: SiteIpEntity) {
|
||||
if (!data.userId) {
|
||||
if (data.userId == null) {
|
||||
throw new Error("userId is required");
|
||||
}
|
||||
data.disabled = false;
|
||||
|
||||
@@ -2,13 +2,15 @@ import { CnameRecord, ICnameProxyService } from '@certd/pipeline';
|
||||
|
||||
export class CnameProxyService implements ICnameProxyService {
|
||||
userId: number;
|
||||
getter: <T>(domain: string, userId?: number) => Promise<T>;
|
||||
constructor(userId: number, getter: (domain: string, userId: number) => Promise<any>) {
|
||||
projectId: number;
|
||||
getter: <T>(domain: string, userId?: number, projectId?: number) => Promise<T>;
|
||||
constructor(userId: number, projectId: number, getter: (domain: string, userId: number, projectId: number) => Promise<any>) {
|
||||
this.userId = userId;
|
||||
this.projectId = projectId;
|
||||
this.getter = getter;
|
||||
}
|
||||
|
||||
async getByDomain(domain: string): Promise<CnameRecord> {
|
||||
return await this.getter<CnameRecord>(domain, this.userId);
|
||||
return await this.getter<CnameRecord>(domain, this.userId, this.projectId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export class TaskServiceGetter implements IServiceGetter{
|
||||
|
||||
async getCnameProxyService(): Promise<CnameProxyService> {
|
||||
const cnameRecordService:CnameRecordService = await this.appCtx.getAsync("cnameRecordService")
|
||||
return new CnameProxyService(this.userId, cnameRecordService.getWithAccessByDomain.bind(cnameRecordService));
|
||||
return new CnameProxyService(this.userId, this.projectId, cnameRecordService.getWithAccessByDomain.bind(cnameRecordService));
|
||||
}
|
||||
|
||||
async getNotificationService(): Promise<NotificationGetter> {
|
||||
|
||||
@@ -188,11 +188,11 @@ export class HistoryService extends BaseService<HistoryEntity> {
|
||||
const where: any = {
|
||||
createTime: MoreThan(todayEnd.add(-param.days, 'day').toDate()),
|
||||
};
|
||||
if (param.userId > 0) {
|
||||
where.userId = param.userId;
|
||||
}
|
||||
|
||||
if (param.projectId > 0) {
|
||||
where.projectId = param.projectId;
|
||||
}else if (param.userId > 0) {
|
||||
where.userId = param.userId;
|
||||
}
|
||||
const result = await this.getRepository()
|
||||
.createQueryBuilder('main')
|
||||
|
||||
@@ -138,21 +138,21 @@ export class NotificationService extends BaseService<NotificationEntity> {
|
||||
if (userId==null) {
|
||||
throw new ValidateException('userId不能为空');
|
||||
}
|
||||
const query:any = {
|
||||
userId,
|
||||
}
|
||||
if (projectId){
|
||||
query.projectId = projectId
|
||||
}
|
||||
await this.repository.update(
|
||||
{
|
||||
userId,
|
||||
projectId,
|
||||
},
|
||||
query,
|
||||
{
|
||||
isDefault: false,
|
||||
}
|
||||
);
|
||||
query.id = id
|
||||
await this.repository.update(
|
||||
{
|
||||
id,
|
||||
userId,
|
||||
projectId,
|
||||
},
|
||||
query,
|
||||
{
|
||||
isDefault: true,
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ import { nanoid } from "nanoid";
|
||||
import { set } from "lodash-es";
|
||||
import { executorQueue } from "@certd/lib-server";
|
||||
import parser from "cron-parser";
|
||||
import { ProjectService } from "../../sys/enterprise/service/project-service.js";
|
||||
const runningTasks: Map<string | number, Executor> = new Map();
|
||||
|
||||
|
||||
@@ -107,6 +108,9 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
@Inject()
|
||||
certInfoService: CertInfoService;
|
||||
|
||||
@Inject()
|
||||
projectService: ProjectService;
|
||||
|
||||
//@ts-ignore
|
||||
getRepository() {
|
||||
return this.repository;
|
||||
@@ -252,6 +256,8 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
//修改
|
||||
old = await this.info(bean.id);
|
||||
bean.order = old.order;
|
||||
bean.userId = old.userId;
|
||||
bean.projectId = old.projectId;
|
||||
}
|
||||
if (!old || !old.webhookKey) {
|
||||
bean.webhookKey = await this.genWebhookKey();
|
||||
@@ -262,6 +268,8 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
|
||||
const pipeline = JSON.parse(bean.content || "{}");
|
||||
RunnableCollection.initPipelineRunnableType(pipeline);
|
||||
pipeline.userId = bean.userId;
|
||||
pipeline.projectId = bean.projectId;
|
||||
let domains = [];
|
||||
if (pipeline.stages) {
|
||||
RunnableCollection.each(pipeline.stages, (runnable: any) => {
|
||||
@@ -295,8 +303,8 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
} else if (bean.type === "cert_auto") {
|
||||
fromType = "auto";
|
||||
}
|
||||
const userId = pipeline.userId || bean.userId;
|
||||
const projectId = pipeline.projectId ?? bean.projectId ??null;
|
||||
const userId = bean.userId;
|
||||
const projectId = bean.projectId ??null;
|
||||
await this.certInfoService.updateDomains(pipeline.id, userId, projectId , domains, fromType);
|
||||
return {
|
||||
...bean,
|
||||
@@ -672,9 +680,12 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
};
|
||||
|
||||
const userId = entity.userId;
|
||||
const historyId = await this.historyService.start(entity, triggerType);
|
||||
const projectId = entity.projectId;
|
||||
let userIsAdmin = false
|
||||
if(userId){
|
||||
|
||||
if (projectId && projectId>0) {
|
||||
userIsAdmin = await this.projectService.isAdmin(projectId);
|
||||
}else if(userId>0){
|
||||
userIsAdmin = await this.userService.isAdmin(userId);
|
||||
}
|
||||
const user: UserInfo = {
|
||||
@@ -682,7 +693,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
role: userIsAdmin ? "admin" : "user"
|
||||
};
|
||||
|
||||
|
||||
const historyId = await this.historyService.start(entity, triggerType);
|
||||
const sysInfo: SysInfo = {};
|
||||
if (isComm()) {
|
||||
const siteInfo = await this.sysSettingsService.getSetting<SysSiteInfo>(SysSiteInfo);
|
||||
@@ -690,7 +701,8 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
}
|
||||
|
||||
const taskServiceGetter = this.taskServiceBuilder.create({
|
||||
userId
|
||||
userId,
|
||||
projectId
|
||||
});
|
||||
const accessGetter = await taskServiceGetter.get<IAccessService>("accessService");
|
||||
const notificationGetter = await taskServiceGetter.get<INotificationService>("notificationService");
|
||||
@@ -920,7 +932,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
throw new NeedVIPException("此功能需要升级专业版");
|
||||
}
|
||||
for (const id of ids) {
|
||||
if (userId) {
|
||||
if (userId && userId > 0) {
|
||||
await this.checkUserId(id, userId);
|
||||
}
|
||||
if(projectId){
|
||||
@@ -1104,6 +1116,10 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
|
||||
|
||||
private async checkUserStatus(userId: number) {
|
||||
if(isEnterprise()){
|
||||
//企业模式不检查用户状态,都允许运行流水线
|
||||
return
|
||||
}
|
||||
const userEntity = await this.userService.info(userId);
|
||||
if (userEntity == null) {
|
||||
throw new Error("用户不存在");
|
||||
|
||||
@@ -19,6 +19,10 @@ export class ProjectEntity {
|
||||
@Column({ name: 'disabled', comment: '禁用' })
|
||||
disabled: boolean;
|
||||
|
||||
@Column({ name: 'is_system', comment: '是否系统项目' })
|
||||
isSystem: boolean; //系统项目内的流水线允许运行管理员级别的插件
|
||||
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ export class ProjectMemberService extends BaseService<ProjectMemberEntity> {
|
||||
if (!projectId) {
|
||||
throw new Error('项目ID不能为空');
|
||||
}
|
||||
if (!userId) {
|
||||
if (!userId || userId <= 0) {
|
||||
throw new Error('用户ID不能为空');
|
||||
}
|
||||
const exist = await this.repository.findOne({
|
||||
|
||||
@@ -11,9 +11,12 @@ const projectCache = new LRUCache<string, any>({
|
||||
ttl: 1000 * 60 * 10,
|
||||
});
|
||||
|
||||
const ENTERPRISE_USER_ID = -1 //企业模式下 企业userId 固定为-1
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
export class ProjectService extends BaseService<ProjectEntity> {
|
||||
|
||||
@InjectEntityModel(ProjectEntity)
|
||||
repository: Repository<ProjectEntity>;
|
||||
|
||||
@@ -36,7 +39,7 @@ export class ProjectService extends BaseService<ProjectEntity> {
|
||||
const exist = await this.repository.findOne({
|
||||
where: {
|
||||
name,
|
||||
userId: 0,
|
||||
userId: ENTERPRISE_USER_ID,
|
||||
},
|
||||
});
|
||||
if (exist) {
|
||||
@@ -57,7 +60,7 @@ export class ProjectService extends BaseService<ProjectEntity> {
|
||||
async setDisabled(id: number, disabled: boolean) {
|
||||
await this.repository.update({
|
||||
id,
|
||||
userId: 0,
|
||||
userId: ENTERPRISE_USER_ID,
|
||||
}, {
|
||||
disabled,
|
||||
});
|
||||
@@ -66,10 +69,13 @@ export class ProjectService extends BaseService<ProjectEntity> {
|
||||
async getUserProjects(userId: number) {
|
||||
|
||||
const memberList = await this.projectMemberService.getByUserId(userId, 'approved');
|
||||
const projectIds = memberList.map(item => item.projectId);
|
||||
let projectIds = memberList.map(item => item.projectId);
|
||||
if (!projectIds || projectIds.length === 0) {
|
||||
projectIds = [0]
|
||||
}
|
||||
const projectList = await this.repository.createQueryBuilder('project')
|
||||
.where(' project.disabled = false')
|
||||
.where(' project.userId = :userId', { userId: 0 })
|
||||
.where(' project.userId = :userId', { userId: ENTERPRISE_USER_ID })
|
||||
.where(' project.id IN (:...projectIds) or project.adminId = :userId', { projectIds, userId })
|
||||
.getMany();
|
||||
|
||||
@@ -93,7 +99,7 @@ export class ProjectService extends BaseService<ProjectEntity> {
|
||||
let projectList: any = await this.find({
|
||||
where: {
|
||||
disabled: false,
|
||||
userId: 0,
|
||||
userId: ENTERPRISE_USER_ID,
|
||||
},
|
||||
})
|
||||
const projectMemberItemList: ProjectMemberItem[] = projectList
|
||||
@@ -269,4 +275,9 @@ export class ProjectService extends BaseService<ProjectEntity> {
|
||||
})
|
||||
}
|
||||
|
||||
async isAdmin(projectId: number): Promise<boolean> {
|
||||
const project = await this.info(projectId);
|
||||
return project?.isSystem ?? false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
import { isEnterprise } from "@certd/lib-server";
|
||||
import { ApplicationContext, IMidwayContainer, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
export class TransferService {
|
||||
@ApplicationContext()
|
||||
appCtx: IMidwayContainer;
|
||||
|
||||
|
||||
async getServices() {
|
||||
const getService = async (key: string) => {
|
||||
return await this.appCtx.getAsync(key);
|
||||
}
|
||||
const serviceNames = [
|
||||
"pipeline",
|
||||
"certInfo",
|
||||
"siteInfo",
|
||||
"domain",
|
||||
"cnameRecord",
|
||||
"group",
|
||||
"pipelineGroup",
|
||||
"notification",
|
||||
"subDomain",
|
||||
"template",
|
||||
"openKey",
|
||||
"siteIp",
|
||||
"access",
|
||||
"history",
|
||||
"historyLog",
|
||||
"storage",
|
||||
]
|
||||
|
||||
const services: any = {}
|
||||
for (const key of serviceNames) {
|
||||
services[key] = await getService(`${key}Service`);
|
||||
}
|
||||
return services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户资源
|
||||
* @param userId
|
||||
* @returns
|
||||
*/
|
||||
async getUserResources(userId: number) {
|
||||
|
||||
const query = {
|
||||
userId,
|
||||
}
|
||||
|
||||
const services = await this.getServices();
|
||||
|
||||
const counts: any = {}
|
||||
let totalCount = 0;
|
||||
for (const key of Object.keys(services)) {
|
||||
const count = await services[key].repository.count({ where: query });
|
||||
counts[key] = count;
|
||||
totalCount += count;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
...counts,
|
||||
totalCount,
|
||||
}
|
||||
}
|
||||
|
||||
async transferAll(userId: number, projectId: number) {
|
||||
|
||||
if (!isEnterprise()) {
|
||||
throw new Error('当前非企业模式,不支持资源迁移到项目');
|
||||
}
|
||||
if (projectId === 0) {
|
||||
throw new Error('项目ID不能为0');
|
||||
}
|
||||
if (userId == null) {
|
||||
throw new Error('用户ID不能为空');
|
||||
}
|
||||
|
||||
const query = {
|
||||
userId,
|
||||
}
|
||||
const services = await this.getServices();
|
||||
for (const key of Object.keys(services)) {
|
||||
await services[key].repository.update(query, {
|
||||
userId: -1,
|
||||
projectId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -157,9 +157,7 @@ export class DBBackupPlugin extends AbstractPlusTaskPlugin {
|
||||
async onInstance() {}
|
||||
|
||||
async execute(): Promise<void> {
|
||||
if (!this.isAdmin()) {
|
||||
throw new Error("只有管理员才能运行此任务");
|
||||
}
|
||||
this.checkAdmin();
|
||||
|
||||
this.logger.info("开始备份数据库");
|
||||
|
||||
|
||||
@@ -32,9 +32,7 @@ export class DeployToCertdPlugin extends AbstractTaskPlugin {
|
||||
cert!: CertInfo;
|
||||
async onInstance() { }
|
||||
async execute(): Promise<void> {
|
||||
if (!this.isAdmin()) {
|
||||
throw new Error('只有管理员才能运行此任务');
|
||||
}
|
||||
this.checkAdmin();
|
||||
|
||||
//部署证书
|
||||
let crtPath = "ssl/cert.crt";
|
||||
|
||||
@@ -17,9 +17,7 @@ import { httpsServer } from '../../modules/auto/https/server.js';
|
||||
export class RestartCertdPlugin extends AbstractTaskPlugin {
|
||||
async onInstance() {}
|
||||
async execute(): Promise<void> {
|
||||
if (!this.isAdmin()) {
|
||||
throw new Error('只有管理员才能运行此任务');
|
||||
}
|
||||
this.checkAdmin();
|
||||
this.logger.info('Certd https server 将在 3 秒后重启');
|
||||
await this.ctx.utils.sleep(3000);
|
||||
await httpsServer.restart();
|
||||
|
||||
@@ -47,9 +47,7 @@ export class CustomScriptPlugin extends AbstractTaskPlugin {
|
||||
|
||||
async onInstance() {}
|
||||
async execute(): Promise<void> {
|
||||
if (!this.isAdmin()) {
|
||||
throw new Error('只有管理员才能运行此任务');
|
||||
}
|
||||
this.checkAdmin();
|
||||
this.logger.info('执行自定义脚本:\n', this.script);
|
||||
const ctx: CustomScriptContext = {
|
||||
CertReader,
|
||||
|
||||
@@ -133,7 +133,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否过期,默认提前35天
|
||||
* 检查是否过期,默认提前15天
|
||||
* @param expires
|
||||
* @param maxDays
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user