Compare commits

...

74 Commits

Author SHA1 Message Date
xiaojunnuo
c643d7edc3 v1.27.0 2024-11-01 02:22:57 +08:00
xiaojunnuo
a4b37d01ab build: prepare to build 2024-11-01 02:21:12 +08:00
xiaojunnuo
a59eb0c4c7 chore: 1 2024-11-01 02:19:00 +08:00
xiaojunnuo
2dcc3206e1 build: prepare to build 2024-11-01 02:16:16 +08:00
xiaojunnuo
dc9040a68e chore: 1 2024-11-01 02:13:34 +08:00
xiaojunnuo
5160b9fbd6 chore: 1 2024-11-01 01:02:13 +08:00
xiaojunnuo
a2af45e1c7 build: prepare to build 2024-11-01 01:01:29 +08:00
xiaojunnuo
0165ccbaac chore: 1 2024-11-01 00:59:09 +08:00
xiaojunnuo
b817cb4a1b chore: 1 2024-10-31 22:35:05 +08:00
xiaojunnuo
584378a32b Merge branch 'v2' into v2-dev 2024-10-31 21:08:35 +08:00
xiaojunnuo
6d9ef26eca perf: 增加向导 2024-10-31 18:04:51 +08:00
xiaojunnuo
1bc170b069 chore: 2024-10-31 16:21:17 +08:00
xiaojunnuo
babd5897ae perf: 管理控制台数据统计 2024-10-31 16:19:35 +08:00
xiaojunnuo
63ec5b5519 feat: 首页全新改版 2024-10-31 15:14:56 +08:00
xiaojunnuo
e5e468a463 fix: pfx兼容windows server 2016 2024-10-31 13:37:25 +08:00
xiaojunnuo
ee65c9f47d chore: 2024-10-31 10:32:05 +08:00
xiaojunnuo
f92935d93f chore: 教程优化 2024-10-30 17:50:38 +08:00
xiaojunnuo
d282045683 chore: 2024-10-30 16:18:03 +08:00
xiaojunnuo
129bf53edc perf: lego 升级到 4.19.2 2024-10-30 16:12:08 +08:00
xiaojunnuo
6113c388b7 fix: 修复历史记录不能按名称查询的bug 2024-10-30 15:19:35 +08:00
xiaojunnuo
764326ab16 chore: 1 2024-10-30 14:22:48 +08:00
xiaojunnuo
262ad0b51c chore: 1 2024-10-30 13:42:02 +08:00
xiaojunnuo
8cc2b64066 chore: 1 2024-10-30 13:21:28 +08:00
xiaojunnuo
ceb4b76cdb build: publish 2024-10-30 11:14:54 +08:00
xiaojunnuo
80af1fa9e6 build: trigger build image 2024-10-30 11:14:37 +08:00
xiaojunnuo
844fd4358c v1.26.16 2024-10-30 11:13:20 +08:00
xiaojunnuo
79b41954f9 build: prepare to build 2024-10-30 11:12:00 +08:00
xiaojunnuo
5a4a7814e1 chore: 1 2024-10-30 11:11:16 +08:00
xiaojunnuo
c4630aaf7b chore: 1 2024-10-30 10:35:14 +08:00
xiaojunnuo
d35ad50254 chore: 暂时移除jks 2024-10-30 10:24:53 +08:00
xiaojunnuo
b1cc6f2a9c chore: 2024-10-30 10:18:05 +08:00
xiaojunnuo
0d94329940 chore: 2024-10-30 10:18:04 +08:00
xiaojunnuo
04150e1c0a chore: 2024-10-30 10:18:03 +08:00
xiaojunnuo
385757b54b chore: 证书支持jks格式 2024-10-30 10:18:01 +08:00
xiaojunnuo
ccfe922c30 chore: 2024-10-30 01:42:41 +08:00
xiaojunnuo
b3e0546f78 chore: 1 2024-10-30 01:42:40 +08:00
xiaojunnuo
aaaf8d7db3 fix: 修复lego No help topic for 错误 2024-10-29 23:08:40 +08:00
xiaojunnuo
b1b2cd088b perf: 支持白山云cdn部署 2024-10-29 22:18:45 +08:00
xiaojunnuo
d1ea61debc chore: 2024-10-29 18:15:38 +08:00
xiaojunnuo
12cebea29e chore: 2024-10-29 18:13:24 +08:00
xiaojunnuo
81a3fdbc29 perf: 支持华为云cdn 2024-10-29 13:59:20 +08:00
xiaojunnuo
fea4669d82 chore: 2024-10-29 09:54:42 +08:00
xiaojunnuo
241f9ed383 build: publish 2024-10-28 21:59:45 +08:00
xiaojunnuo
3d06ce444c build: trigger build image 2024-10-28 21:59:31 +08:00
xiaojunnuo
06fed944c9 v1.26.15 2024-10-28 21:58:30 +08:00
xiaojunnuo
5d225c2583 build: prepare to build 2024-10-28 21:56:17 +08:00
xiaojunnuo
e626367a06 chore: 2024-10-28 21:55:37 +08:00
xiaojunnuo
5c992c3214 Merge remote-tracking branch 'origin/v2-dev' into v2-dev 2024-10-28 21:34:14 +08:00
xiaojunnuo
5575c83970 perf: 授权加密支持解密查看 2024-10-28 18:20:10 +08:00
xiaojunnuo
6dabad76ba fix: 顶部菜单变...的bug 2024-10-28 17:27:10 +08:00
xiaojunnuo
1c656f8b90 chore: 2024-10-28 16:44:10 +08:00
xiaojunnuo
51b6fed468 perf: 默认证书更新时间设置为35天,增加腾讯云删除过期证书插件,可以避免腾讯云过期证书邮件 2024-10-28 15:31:45 +08:00
xiaojunnuo
f92d918a1e perf: 重置管理员密码同时启用管理员账户,避免之前禁用了,重置密码还是登录不进去 2024-10-28 10:26:14 +08:00
xiaojunnuo
3e290f057f chore: 2024-10-27 11:03:09 +08:00
xiaojunnuo
13eb0231ac chore: 2024-10-27 03:13:09 +08:00
xiaojunnuo
6089f0aa8e chore: 2024-10-27 03:02:20 +08:00
xiaojunnuo
b0c4050567 chore: 2024-10-27 02:58:26 +08:00
xiaojunnuo
3f9244542d build: publish 2024-10-27 02:56:49 +08:00
xiaojunnuo
70b6098ee5 build: trigger build image 2024-10-27 02:56:36 +08:00
xiaojunnuo
1656e91296 v1.26.14 2024-10-27 02:55:31 +08:00
xiaojunnuo
5b7df9c175 build: prepare to build 2024-10-27 02:53:58 +08:00
xiaojunnuo
8d8600aaa8 chore: 2024-10-27 02:52:45 +08:00
xiaojunnuo
54d136cc6a perf: 顶部菜单自定义 2024-10-27 02:51:56 +08:00
xiaojunnuo
661293c189 perf: 用户管理优化头像上传 2024-10-27 00:52:26 +08:00
xiaojunnuo
d10d42e206 perf: 禁用readonly用户 2024-10-27 00:04:02 +08:00
xiaojunnuo
b780eab5f5 chore: 2024-10-26 23:56:13 +08:00
xiaojunnuo
315e43746b perf: 限制其他用户流水线数量 2024-10-26 23:54:49 +08:00
xiaojunnuo
526c48450b fix: 修复启动时自签证书无法保存的bug 2024-10-26 23:24:26 +08:00
xiaojunnuo
abd2dcf2e8 fix: 修复阿里云部署大杀器报插件_还未注册错误的bug 2024-10-26 23:08:10 +08:00
xiaojunnuo
87defa569c chore: 2024-10-26 22:11:10 +08:00
xiaojunnuo
b4db5518db chore: 2024-10-26 20:33:05 +08:00
xiaojunnuo
a50b635424 chore: 2024-10-26 20:32:09 +08:00
xiaojunnuo
40a794f624 build: publish 2024-10-26 20:31:58 +08:00
xiaojunnuo
6876790374 build: trigger build image 2024-10-26 20:31:45 +08:00
199 changed files with 3018 additions and 834 deletions

View File

@@ -0,0 +1,79 @@
name: build-image-for-test
on:
push:
branches: ['v2-dev']
paths:
- "build-dev.trigger"
# schedule:
# - # 国际时间 19:17 执行北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
# - cron: '17 19 * * *'
permissions:
contents: read
jobs:
build-certd-image:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: v2-dev
- name: get_certd_version
id: get_certd_version
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const fs = require('fs');
const path = require('path');
const pnpmWorkspace = "./pnpm-workspace.yaml";
fs.unlinkSync(pnpmWorkspace)
const jsonFilePath = "./packages/ui/certd-server/package.json";
const jsonContent = fs.readFileSync(jsonFilePath, 'utf-8');
const pkg = JSON.parse(jsonContent)
console.log("certd_version:",pkg.version);
return pkg.version
# - name: Use Node.js
# uses: actions/setup-node@v4
# with:
# node-version: 18
# cache: 'npm'
# working-directory: ./packages/ui/certd-client
- run: |
npm install -g pnpm@8.15.7
pnpm install
npm run build
working-directory: ./packages/ui/certd-client
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to aliyun container Registry
uses: docker/login-action@v3
with:
registry: registry.cn-shenzhen.aliyuncs.com
username: ${{ secrets.aliyun_cs_username }}
password: ${{ secrets.aliyun_cs_password }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.dockerhub_username }}
password: ${{ secrets.dockerhub_password }}
- name: Build default platforms
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
context: ./packages/ui/
tags: |
registry.cn-shenzhen.aliyuncs.com/handsfree/certd-dev:latest
greper/certd-dev:latest

View File

@@ -17,6 +17,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: get_certd_version
id: get_certd_version

View File

@@ -2,8 +2,8 @@ name: deploy-demo
on:
push:
branches: ['v2-dev']
# paths:
# - "deploy.trigger"
paths:
- "deploy.trigger"
workflow_run:
workflows: [ "build-image" ]
types:
@@ -21,6 +21,9 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: v2-dev
- name: get_certd_version
id: get_certd_version
uses: actions/github-script@v6
@@ -38,7 +41,6 @@ jobs:
with:
time: '10' # for 60 seconds
- name: deploy-certd-demo
id: request
uses: tyrrrz/action-http-request@master
with:
url: http://flow-openapi.aliyun.com/pipeline/webhook/lzCzlGrLCOHQaTMMt0mG
@@ -53,11 +55,12 @@ jobs:
retry-delay: 5000
- name: deploy-certd-doc
id: request
uses: tyrrrz/action-http-request@master
with:
url: http://flow-openapi.aliyun.com/pipeline/webhook/IiSxLDp9aOhgDUxJPytv
method: POST
body: |
{}
headers: |
Content-Type: application/json
retry-count: 3

View File

@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email

View File

@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email

View File

@@ -3,6 +3,60 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/certd/certd/compare/v1.26.16...v1.27.0) (2024-10-31)
### Bug Fixes
* 修复历史记录不能按名称查询的bug ([6113c38](https://github.com/certd/certd/commit/6113c388b7fc58b11ca19ff05cc1286d096c8d28))
* pfx兼容windows server 2016 ([e5e468a](https://github.com/certd/certd/commit/e5e468a463f66d02f235de54b7c1e09ace5f1cb1))
### Features
* 首页全新改版 ([63ec5b5](https://github.com/certd/certd/commit/63ec5b5519c760a3330569c0da6dac157302a330))
### Performance Improvements
* 管理控制台数据统计 ([babd589](https://github.com/certd/certd/commit/babd5897ae013ff7c04ebfcbfac8a00d84dd627c))
* 增加向导 ([6d9ef26](https://github.com/certd/certd/commit/6d9ef26ecab71d752c2c55d75aed4fb5f6c05a39))
* lego 升级到 4.19.2 ([129bf53](https://github.com/certd/certd/commit/129bf53edc9bbb001fe49fbd7e239bd1d09cc128))
## [1.26.16](https://github.com/certd/certd/compare/v1.26.15...v1.26.16) (2024-10-30)
### Bug Fixes
* 修复lego No help topic for 错误 ([aaaf8d7](https://github.com/certd/certd/commit/aaaf8d7db34896cf8f2ff8f12eec1ab0cae58f0f))
### Performance Improvements
* 支持白山云cdn部署 ([b1b2cd0](https://github.com/certd/certd/commit/b1b2cd088b684eda764962abd61754c26a204d1c))
* 支持华为云cdn ([81a3fdb](https://github.com/certd/certd/commit/81a3fdbc29b71f380762008cc151493ec97458f9))
## [1.26.15](https://github.com/certd/certd/compare/v1.26.14...v1.26.15) (2024-10-28)
### Bug Fixes
* 顶部菜单变...的bug ([6dabad7](https://github.com/certd/certd/commit/6dabad76baba96be0f8af36a3fbfb9f5182aecf1))
### Performance Improvements
* 默认证书更新时间设置为35天增加腾讯云删除过期证书插件可以避免腾讯云过期证书邮件 ([51b6fed](https://github.com/certd/certd/commit/51b6fed468eaa6f28ce4497ce303ace1a52abb96))
* 授权加密支持解密查看 ([5575c83](https://github.com/certd/certd/commit/5575c839705f6987ad2bdcd33256b0962c6a9c6a))
* 重置管理员密码同时启用管理员账户,避免之前禁用了,重置密码还是登录不进去 ([f92d918](https://github.com/certd/certd/commit/f92d918a1e28e29b794ad4754661ea760c18af46))
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
### Bug Fixes
* 修复阿里云部署大杀器报插件_还未注册错误的bug ([abd2dcf](https://github.com/certd/certd/commit/abd2dcf2e85a545321bae6451406d081f773b132))
* 修复启动时自签证书无法保存的bug ([526c484](https://github.com/certd/certd/commit/526c48450bcd37b3ccded9b448f17de8140bdc6e))
### Performance Improvements
* 顶部菜单自定义 ([54d136c](https://github.com/certd/certd/commit/54d136cc6ae122f7c891b7a5c7232fe5de8e5cb5))
* 禁用readonly用户 ([d10d42e](https://github.com/certd/certd/commit/d10d42e20619bb55a50d636b8867ff33db4e3b4b))
* 限制其他用户流水线数量 ([315e437](https://github.com/certd/certd/commit/315e43746baf01682737f82e41579237a48409af))
* 用户管理优化头像上传 ([661293c](https://github.com/certd/certd/commit/661293c189a3abf3cdc953b5225192372f57930d))
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
### Bug Fixes

View File

@@ -13,7 +13,7 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的管理系
* 全自动部署更新证书目前支持部署到主机、部署到阿里云、腾讯云等目前已支持30+部署插件)
* 支持通配符域名/泛域名,支持多个域名打到一个证书上
* 邮件通知
* 私有化部署,保障数据安全
* 私有化部署,数据保存本地镜像由Github Actions构建过程公开透明
* 支持sqlitepostgresql数据库

1
build-dev.trigger Normal file
View File

@@ -0,0 +1 @@
21:59

View File

@@ -1 +1 @@
00:01
11:14

View File

@@ -23,23 +23,13 @@ services:
# extra_hosts:
# ↓↓↓↓ ---------------------------------------------------------- 这里可以配置自定义hosts外网域名可以指向本地局域网ip地址
# - "localdomain.comm:192.168.1.3"
environment: # 环境变量
environment:
- TZ=Asia/Shanghai
# 设置环境变量即可自定义certd配置
# 配置项见: packages/ui/certd-server/src/config/config.default.ts
# 配置规则: certd_ + 配置项, 点号用_代替
# ↓↓↓↓ ------------------------------------ 这里可以设置http代理
#- HTTPS_PROXY=http://xxxxxx:xx
#- HTTP_PROXY=http://xxxxxx:xx
# ↓↓↓↓ ----------------------------- 如果忘记管理员密码可以设置为true重启之后管理员密码将改成123456然后请及时修改回false
- certd_system_resetAdminPasswd=false
# ↓↓↓↓ -------------------------- 如果设置为true启动后所有配置了cron的流水线任务都将被立即触发一次
- certd_cron_immediateTriggerOnce=false
# ↓↓↓↓ -------------------------------- 配置证书和key则表示https方式启动使用https协议访问https://your.domain:7001
#- certd_koa_key=./data/ssl/cert.key
#- certd_koa_cert=./data/ssl/cert.crt
# ↓↓↓↓ ------------------------------- 使用postgresql数据库
# - certd_flyway_scriptDir=./db/migration-pg # 升级脚本目录
# - certd_typeorm_dataSource_default_type=postgres # 数据库类型

View File

@@ -5,7 +5,7 @@ import lightbox from "vitepress-plugin-lightbox";
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Certd",
description: "Certd帮助文档,Certd是一款开源免费的全自动SSL证书管理工具自动证书申请、更新、续期通配符证书泛域名证书申请证书自动化部署到阿里云、腾讯云、主机、群晖、宝塔。",
description: "Certd帮助文档,Certd是一款开源免费的全自动SSL证书管理工具证书自动化申请部署流水线;自动证书申请、更新、续期;通配符证书,泛域名证书申请;证书自动化部署到阿里云、腾讯云、主机、群晖、宝塔。",
markdown: {
config: (md) => {
// Use lightbox plugin
@@ -23,7 +23,7 @@ export default defineConfig({
// ],
["meta", {
name: "keywords",
content: "证书自动申请、证书自动更新、证书自动续期、证书自动续签、证书管理工具、Certd、SSL证书自动部署、证书自动化https证书pfx证书der证书TLS证书nginx证书自动续签自动部署,SSL平台证书管理平台"
content: "证书自动申请、证书自动更新、证书自动续期、证书自动续签、证书管理工具、Certd、SSL证书自动部署、证书自动化https证书pfx证书der证书TLS证书nginx证书自动续签自动部署,SSL平台证书管理平台,证书流水线"
}],
["meta", { name: "google-site-verification",content: "V5XLTSnXoT15uQotwpxJoQolUo2d5UbSL-TacsyOsC0"}],
//<meta name="baidu-site-verification" content="codeva-MiWN8Y07Ua" />

View File

@@ -28,3 +28,7 @@ Certd 是一款开源、免费、全自动申请和部署更新SSL证书的工
* 免费证书过期时间90天以后可能还会缩短所以自动化部署必不可少
* 设置每天自动运行当证书过期前20天会自动重新申请证书并部署
## 三、证书颁发机构对比
* Let's Encrypt申请最简单。
* Google: 大厂光环兼容性好需要翻墙获取EAB。
* ZeroSSL 有数量限制获取EAB无需翻墙。

View File

@@ -4,7 +4,10 @@
## windows开启OpenSSH Server
### 1. 安装OpenSSH Server
请前往Microsoft官方文档查看如何开启openSSH
* 下载安装包安装: https://github.com/PowerShell/Win32-OpenSSH/releases OpenSSH-Win64-vxx.xx.x.msi
* 前往Microsoft官方文档查看如何开启openSSH以及其他设置
https://learn.microsoft.com/zh-cn/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui#install-openssh-for-windows
### 2. 启动OpenSSH Server服务

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -6,3 +6,16 @@
打开 https://console.cloud.tencent.com/cam/capi
然后按如下方式获取腾讯云的API密钥
![](./tencent-access.png)
## 如何避免收到腾讯云证书过期邮件
腾讯云在证书有效期还剩28天时会发送过期通知邮件
您可以通过配置“腾讯云过期证书删除”任务来避免收到此类邮件。
![](./images/delete.png)
注意点:
> 1. 选择腾讯云授权,需授权`服务角色SSL_QCSLinkedRoleInReplaceLoadCertificate`权限
> 2. `1.26.14`版本之前Certd创建的证书流水线默认是到期前20天才更新证书需要将之前创建的证书申请任务的更新天数修改为35天保证删除之前就已经替换掉即将过期证书
![](./images/delete2.png)

View File

@@ -28,7 +28,7 @@ features:
- title: 多域名、泛域名打到一个证书上
details: 支持通配符域名/泛域名,支持多个域名打到一个证书上
- title: 多证书格式支持
details: 支持pem、pfx、der等多种证书格式支持Google、Letsencrypt、ZeroSSL证书颁发机构
details: 支持pem、pfx、der、jks等多种证书格式支持Google、Letsencrypt、ZeroSSL证书颁发机构
- title: 支持私有化部署
details: 保障数据安全
- title: 多数据库支持

View File

@@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.26.13"
"version": "1.27.0"
}

View File

@@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/publishlab/node-acme-client/compare/v1.26.16...v1.27.0) (2024-10-31)
**Note:** Version bump only for package @certd/acme-client
## [1.26.16](https://github.com/publishlab/node-acme-client/compare/v1.26.15...v1.26.16) (2024-10-30)
**Note:** Version bump only for package @certd/acme-client
## [1.26.15](https://github.com/publishlab/node-acme-client/compare/v1.26.14...v1.26.15) (2024-10-28)
**Note:** Version bump only for package @certd/acme-client
## [1.26.14](https://github.com/publishlab/node-acme-client/compare/v1.26.13...v1.26.14) (2024-10-26)
### Bug Fixes
* 修复启动时自签证书无法保存的bug ([526c484](https://github.com/publishlab/node-acme-client/commit/526c48450bcd37b3ccded9b448f17de8140bdc6e))
## [1.26.13](https://github.com/publishlab/node-acme-client/compare/v1.26.12...v1.26.13) (2024-10-26)
**Note:** Version bump only for package @certd/acme-client

View File

@@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client",
"private": false,
"author": "nmorsman",
"version": "1.26.13",
"version": "1.27.0",
"main": "src/index.js",
"types": "types/index.d.ts",
"license": "MIT",
@@ -60,5 +60,5 @@
"bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues"
},
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
"gitHead": "844fd4358c84251c72c5854ea633f238014244ad"
}

View File

@@ -8,7 +8,7 @@ function createAgent(opts = {}) {
let httpAgent;
let
httpsAgent;
const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy;
const httpProxy = opts.httpProxy || process.env.HTTP_PROXY || process.env.http_proxy;
if (httpProxy) {
log(`acme use httpProxy:${httpProxy}`);
httpAgent = new HttpProxyAgent(httpProxy, opts);
@@ -16,7 +16,7 @@ function createAgent(opts = {}) {
else {
httpAgent = new nodeHttp.Agent(opts);
}
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
const httpsProxy = opts.httpsProxy || process.env.HTTPS_PROXY || process.env.https_proxy;
if (httpsProxy) {
log(`acme use httpsProxy:${httpsProxy}`);
httpsAgent = new HttpsProxyAgent(httpsProxy, opts);
@@ -38,30 +38,24 @@ function getGlobalAgents() {
function setGlobalProxy(opts) {
log('acme setGlobalProxy:', opts);
if (opts.httpProxy) {
process.env.HTTP_PROXY = opts.httpProxy;
}
if (opts.httpsProxy) {
process.env.HTTPS_PROXY = opts.httpsProxy;
}
defaultAgents = createAgent();
defaultAgents = createAgent(opts);
}
class HttpError extends Error {
// eslint-disable-next-line constructor-super
constructor(error) {
super(error || error.message);
if (!error) {
return;
}
super(error.message);
if (error.message.indexOf('ssl3_get_record:wrong version number') >= 0) {
this.message = error.message;
if (this.message && this.message.indexOf('ssl3_get_record:wrong version number') >= 0) {
this.message = 'http协议错误服务端要求http协议请检查是否使用了https请求';
}
this.name = error.name;
this.code = error.code;
this.cause = error.cause;
if (error.response) {
this.status = error.response.status;
@@ -69,6 +63,9 @@ class HttpError extends Error {
this.response = {
data: error.response.data,
};
if (!this.message) {
this.message = this.statusText;
}
}
let url = '';
@@ -80,12 +77,18 @@ class HttpError extends Error {
params: error.config.params,
data: error.config.data,
};
url = error.config.baseURL + error.config.url;
url = (error.config.baseURL || '') + error.config.url;
}
if (url) {
this.message = `${this.message}:${url}`;
}
// const { stack, cause } = error;
delete this.cause;
delete this.stack;
// this.cause = cause;
// this.stack = stack;
delete error.stack;
delete error.cause;
delete error.response;
delete error.config;
delete error.request;

View File

@@ -5,6 +5,7 @@
const { readCsrDomains } = require('./crypto');
const { log } = require('./logger');
const { wait } = require('./wait');
const { CancelError } = require('./error');
const defaultOpts = {
csr: null,
@@ -250,7 +251,7 @@ module.exports = async (client, userOpts) => {
i += 1;
log(`开始第${i}`);
if (opts.signal && opts.signal.aborted) {
throw new Error('用户取消');
throw new CancelError('用户取消');
}
try {

View File

@@ -114,17 +114,19 @@ instance.interceptors.response.use(null, async (error) => {
const code = response ? `HTTP ${response.status}` : error.code;
log(`Caught ${code}, retry attempt ${config.retryAttempt}/${retryMaxAttempts} to URL ${config.url}`);
const retryAfter = (retryDefaultDelay * config.retryAttempt);
/* Attempt to parse Retry-After header, fallback to default delay */
let retryAfter = response ? parseRetryAfterHeader(response.headers['retry-after']) : 0;
const headerRetryAfter = response ? parseRetryAfterHeader(response.headers['retry-after']) : 0;
if (retryAfter > 0) {
log(`Found retry-after response header with value: ${response.headers['retry-after']}, waiting ${retryAfter} seconds`);
}
else {
retryAfter = (retryDefaultDelay * config.retryAttempt);
log(`Unable to locate or parse retry-after response header, waiting ${retryAfter} seconds`);
if (headerRetryAfter > 0) {
const waitMinutes = (headerRetryAfter / 60).toFixed(1);
log(`Found retry-after response header with value: ${response.headers['retry-after']}, waiting ${waitMinutes} minutes`);
log(JSON.stringify(response.data));
return Promise.reject(new Agents.HttpError(error));
}
log(`waiting ${retryAfter} seconds`);
/* Wait and retry the request */
await new Promise((resolve) => { setTimeout(resolve, (retryAfter * 1000)); });
return instance(config);

View File

@@ -12,6 +12,7 @@ const AcmeApi = require('./api');
const verify = require('./verify');
const util = require('./util');
const auto = require('./auto');
const { CancelError } = require('./error');
/**
* ACME states
@@ -490,9 +491,10 @@ class AcmeClient {
const keyAuthorization = await this.getChallengeKeyAuthorization(challenge);
const verifyFn = async () => {
const verifyFn = async (abort) => {
if (this.opts.signal && this.opts.signal.aborted) {
throw new Error('用户取消');
abort();
throw new CancelError('用户取消');
}
await verify[challenge.type](authz, challenge, keyAuthorization);
};
@@ -518,7 +520,7 @@ class AcmeClient {
async completeChallenge(challenge) {
if (this.opts.signal && this.opts.signal.aborted) {
throw new Error('用户取消');
throw new CancelError('用户取消');
}
const resp = await this.api.completeChallenge(challenge.url, {});
return resp.data;
@@ -559,7 +561,7 @@ class AcmeClient {
const verifyFn = async (abort) => {
if (this.opts.signal && this.opts.signal.aborted) {
abort();
throw new Error('用户取消');
throw new CancelError('用户取消');
}
const resp = await this.api.apiRequest(item.url, null, [200]);

View File

@@ -0,0 +1,10 @@
class CancelError extends Error {
constructor(message) {
super(message);
this.name = 'CancelError';
}
}
module.exports = {
CancelError,
};

View File

@@ -48,3 +48,4 @@ exports.agents = require('./agents');
exports.setLogger = require('./logger').setLogger;
exports.walkTxtRecord = require('./verify').walkTxtRecord;
exports.CancelError = require('./error').CancelError;

View File

@@ -5,5 +5,5 @@ async function wait(ms) {
}
module.exports = {
wait
wait,
};

View File

@@ -198,6 +198,8 @@ export const agents: any;
* Logger
*/
export function setLogger(fn: (msg: string) => void): void;
export function setLogger(fn: (message: any, ...args: any[]) => void): void;
export function walkTxtRecord(record: any): Promise<string[]>;
export const CancelError: Error;

View File

@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/certd/certd/compare/v1.26.16...v1.27.0) (2024-10-31)
**Note:** Version bump only for package @certd/basic
## [1.26.16](https://github.com/certd/certd/compare/v1.26.15...v1.26.16) (2024-10-30)
### Performance Improvements
* 支持华为云cdn ([81a3fdb](https://github.com/certd/certd/commit/81a3fdbc29b71f380762008cc151493ec97458f9))
## [1.26.15](https://github.com/certd/certd/compare/v1.26.14...v1.26.15) (2024-10-28)
**Note:** Version bump only for package @certd/basic
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
### Bug Fixes
* 修复启动时自签证书无法保存的bug ([526c484](https://github.com/certd/certd/commit/526c48450bcd37b3ccded9b448f17de8140bdc6e))
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
**Note:** Version bump only for package @certd/basic

View File

@@ -1 +1 @@
20:27
02:21

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/basic",
"private": false,
"version": "1.26.13",
"version": "1.27.0",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -64,5 +64,5 @@
"vite": "^4.3.8",
"vue-tsc": "^1.6.5"
},
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
"gitHead": "844fd4358c84251c72c5854ea633f238014244ad"
}

View File

@@ -1,4 +1,5 @@
export * from './util.request.js';
export * from './util.env.js';
export * from './util.log.js';
export * from './util.file.js';
export * from './util.sp.js';

View File

@@ -0,0 +1,3 @@
export function isDev() {
return process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'local';
}

View File

@@ -1,7 +1,7 @@
import crypto from "crypto";
import crypto from 'crypto';
function md5(data: string) {
return crypto.createHash("md5").update(data).digest("hex");
return crypto.createHash('md5').update(data).digest('hex');
}
export const hashUtils = {

View File

@@ -1,4 +1,4 @@
import log4js, { LoggingEvent, Logger } from "log4js";
import log4js, { LoggingEvent, Logger } from 'log4js';
const OutputAppender = {
configure: (config: any, layouts: any, findAppender: any, levels: any) => {
@@ -18,18 +18,22 @@ const OutputAppender = {
},
};
// @ts-ignore
log4js.configure({
appenders: { std: { type: "stdout" }, output: { type: OutputAppender } },
categories: { default: { appenders: ["std"], level: "info" }, pipeline: { appenders: ["std", "output"], level: "info" } },
});
export const logger = log4js.getLogger("default");
export function resetLogConfigure() {
// @ts-ignore
log4js.configure({
appenders: { std: { type: 'stdout' }, output: { type: OutputAppender } },
categories: { default: { appenders: ['std'], level: 'info' }, pipeline: { appenders: ['std', 'output'], level: 'info' } },
});
}
resetLogConfigure();
export const logger = log4js.getLogger('default');
export function buildLogger(write: (text: string) => void) {
const logger = log4js.getLogger("pipeline");
logger.addContext("outputHandler", {
const logger = log4js.getLogger('pipeline');
logger.addContext('outputHandler', {
write,
});
return logger;
}
export type ILogger = Logger;

View File

@@ -17,15 +17,14 @@ export class HttpError extends Error {
if (!error) {
return;
}
super(error.message);
super(error.message || error.response?.statusText);
if (error?.message?.indexOf('ssl3_get_record:wrong version number') >= 0) {
if (error?.message?.indexOf && error?.message?.indexOf('ssl3_get_record:wrong version number') >= 0) {
this.message = 'http协议错误服务端要求http协议请检查是否使用了https请求';
}
this.name = error.name;
this.code = error.code;
this.cause = error.cause;
this.status = error.response?.status;
this.statusText = error.response?.statusText;
@@ -38,7 +37,7 @@ export class HttpError extends Error {
};
let url = error.config?.url;
if (error.config?.baseURL) {
url = error.config?.baseURL + url;
url = (error.config?.baseURL || '') + url;
}
if (url) {
this.message = `${this.message} : url=${url}`;
@@ -48,6 +47,9 @@ export class HttpError extends Error {
data: error.response?.data,
};
// const { stack, cause } = error;
// this.cause = cause;
// this.stack = stack;
delete error.response;
delete error.config;
delete error.request;
@@ -61,14 +63,7 @@ let defaultAgents = createAgent();
export function setGlobalProxy(opts: { httpProxy?: string; httpsProxy?: string }) {
logger.info('setGlobalProxy:', opts);
if (opts.httpProxy) {
process.env.HTTP_PROXY = opts.httpProxy;
}
if (opts.httpsProxy) {
process.env.HTTPS_PROXY = opts.httpsProxy;
}
defaultAgents = createAgent();
defaultAgents = createAgent(opts);
}
export function getGlobalAgents() {
@@ -192,9 +187,13 @@ export type HttpClient = {
request<D = any, R = any>(config: HttpRequestConfig<D>): Promise<HttpClientResponse<R>>;
};
export function createAgent(opts: nodeHttp.AgentOptions = {}) {
export type CreateAgentOptions = {
httpProxy?: string;
httpsProxy?: string;
} & nodeHttp.AgentOptions;
export function createAgent(opts: CreateAgentOptions = {}) {
let httpAgent, httpsAgent;
const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy;
const httpProxy = opts.httpProxy || process.env.HTTP_PROXY || process.env.http_proxy;
if (httpProxy) {
logger.info('use httpProxy:', httpProxy);
httpAgent = new HttpProxyAgent(httpProxy, opts as any);
@@ -202,7 +201,7 @@ export function createAgent(opts: nodeHttp.AgentOptions = {}) {
} else {
httpAgent = new nodeHttp.Agent(opts);
}
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
const httpsProxy = opts.httpsProxy || process.env.HTTPS_PROXY || process.env.https_proxy;
if (httpsProxy) {
logger.info('use httpsProxy:', httpsProxy);
httpsAgent = new HttpsProxyAgent(httpsProxy, opts as any);

View File

@@ -1,8 +1,8 @@
//转换为import
import childProcess from "child_process";
import { safePromise } from "./util.promise.js";
import { ILogger, logger } from "./util.log.js";
import childProcess from 'child_process';
import { safePromise } from './util.promise.js';
import { ILogger, logger } from './util.log.js';
import iconv from 'iconv-lite';
export type ExecOption = {
cmd: string | string[];
env: any;
@@ -11,12 +11,12 @@ export type ExecOption = {
};
async function exec(opts: ExecOption): Promise<string> {
let cmd = "";
let cmd = '';
const log = opts.logger || logger;
if (opts.cmd instanceof Array) {
for (const item of opts.cmd) {
if (cmd) {
cmd += " && " + item;
cmd += ' && ' + item;
} else {
cmd = item;
}
@@ -38,7 +38,7 @@ async function exec(opts: ExecOption): Promise<string> {
log.error(`exec error: ${error}`);
reject(error);
} else {
const res = stdout.toString("utf-8");
const res = stdout.toString('utf-8');
log.info(`stdout: ${res}`);
resolve(res);
}
@@ -55,13 +55,31 @@ export type SpawnOption = {
logger?: ILogger;
options?: any;
};
function isWindows() {
return process.platform === 'win32';
}
function convert(buffer: any) {
if (isWindows()) {
const decoded = iconv.decode(buffer, 'GBK');
// 检查是否有有效字符
return decoded && decoded.trim().length > 0 ? decoded : buffer.toString();
} else {
return buffer;
}
}
// function convert(buffer: any) {
// return buffer;
// }
async function spawn(opts: SpawnOption): Promise<string> {
let cmd = "";
let cmd = '';
const log = opts.logger || logger;
if (opts.cmd instanceof Array) {
for (const item of opts.cmd) {
if (cmd) {
cmd += " && " + item;
cmd += ' && ' + item;
} else {
cmd = item;
}
@@ -70,8 +88,8 @@ async function spawn(opts: SpawnOption): Promise<string> {
cmd = opts.cmd;
}
log.info(`执行命令: ${cmd}`);
let stdout = "";
let stderr = "";
let stdout = '';
let stderr = '';
return safePromise((resolve, reject) => {
const ls = childProcess.spawn(cmd, {
shell: true,
@@ -81,21 +99,23 @@ async function spawn(opts: SpawnOption): Promise<string> {
},
...opts.options,
});
ls.stdout.on("data", (data) => {
ls.stdout.on('data', data => {
data = convert(data);
log.info(`stdout: ${data}`);
stdout += data;
});
ls.stderr.on("data", (data) => {
log.error(`stderr: ${data}`);
ls.stderr.on('data', data => {
data = convert(data);
log.warn(`stderr: ${data}`);
stderr += data;
});
ls.on("error", (error) => {
ls.on('error', error => {
log.error(`child process error: ${error}`);
reject(error);
});
ls.on("close", (code: number) => {
ls.on('close', (code: number) => {
if (code !== 0) {
log.error(`child process exited with code ${code}`);
reject(new Error(stderr));

View File

@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/certd/certd/compare/v1.26.16...v1.27.0) (2024-10-31)
**Note:** Version bump only for package @certd/pipeline
## [1.26.16](https://github.com/certd/certd/compare/v1.26.15...v1.26.16) (2024-10-30)
### Performance Improvements
* 支持白山云cdn部署 ([b1b2cd0](https://github.com/certd/certd/commit/b1b2cd088b684eda764962abd61754c26a204d1c))
## [1.26.15](https://github.com/certd/certd/compare/v1.26.14...v1.26.15) (2024-10-28)
### Performance Improvements
* 默认证书更新时间设置为35天增加腾讯云删除过期证书插件可以避免腾讯云过期证书邮件 ([51b6fed](https://github.com/certd/certd/commit/51b6fed468eaa6f28ce4497ce303ace1a52abb96))
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
**Note:** Version bump only for package @certd/pipeline
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
**Note:** Version bump only for package @certd/pipeline

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.26.13",
"version": "1.27.0",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -15,8 +15,8 @@
"test": "mocha --loader=ts-node/esm"
},
"dependencies": {
"@certd/basic": "^1.26.13",
"@certd/plus-core": "^1.26.13",
"@certd/basic": "^1.27.0",
"@certd/plus-core": "^1.27.0",
"axios": "^1.7.2",
"dayjs": "^1.11.7",
"fix-path": "^4.0.0",
@@ -66,5 +66,5 @@
"vite": "^4.3.8",
"vue-tsc": "^1.6.5"
},
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
"gitHead": "844fd4358c84251c72c5854ea633f238014244ad"
}

View File

@@ -0,0 +1,5 @@
export class CancelError extends Error {
constructor(message: string) {
super(message);
}
}

View File

@@ -135,7 +135,12 @@ export class Executor {
this.runtime.success(runnable);
return ResultType.success;
} catch (e: any) {
this.runtime.error(runnable, e);
if (e.name === "CancelError" || this.abort.signal.aborted) {
this.runtime.cancel(runnable);
return ResultType.canceled;
} else {
this.runtime.error(runnable, e);
}
throw e;
} finally {
this.runtime.finally(runnable);

View File

@@ -5,3 +5,4 @@ export * from "./storage.js";
export * from "./file-store.js";
export * from "./license.js";
export * from "./handler.js";
export * from "./exceptions.js";

View File

@@ -117,7 +117,8 @@ export class RunHistory {
}
logError(runnable: Runnable, e: Error) {
// @ts-ignore
delete e.stack;
delete e.cause;
const errorInfo = runnable.runnableType === "step" ? e : e.message;
this._loggers[runnable.id].error(`[${runnable.runnableType}] [${runnable.title}]<id:${runnable.id}> `, errorInfo);
}

View File

@@ -1,115 +0,0 @@
/**
* [x]-col的配置
*/
export type ColProps = {
span?: number;
[props: string]: any;
};
export type FormItemProps = {
/**
* 字段label
*/
title?: string;
/**
* 表单字段组件配置
*/
component?: ComponentProps;
/**
* 表单字段 [a|el|n]-col的配置
* 一般用来配置跨列:{span:24} 占满一行
*/
col?: ColProps;
/**
* 默认值
*/
value?: any;
/**
* 帮助提示配置
*/
helper?: string | FormItemHelperProps;
/**
* 排序号
*/
order?: number;
/**
* 是否显示此字段
*/
show?: boolean;
/**
* 是否是空白占位栏
*/
blank?: boolean;
[key: string]: any;
};
/**
* 表单字段帮助说明配置
*/
export type FormItemHelperProps = {
/**
* 自定义渲染帮助说明
* @param scope
*/
render?: (scope: any) => any;
/**
* 帮助文本
*/
text?: string;
/**
* 帮助说明所在的位置,[ undefined | label]
*/
position?: string;
/**
* [a|el|n]-tooltip配置
*/
tooltip?: object;
[key: string]: any;
};
/**
* 组件配置
*/
export type ComponentProps = {
/**
* 组件的名称
*/
name?: string | object;
/**
* vmodel绑定的目标属性名
*/
vModel?: string;
/**
* 当原始组件名的参数被以上属性名占用时,可以配置在这里
* 例如:原始组件有一个叫name的属性你想要配置它则可以按如下配置
* ```
* component:{
* name:"组件的名称"
* props:{
* name:"组件的name属性" <-----------
* }
* }
* ```
*/
props?: {
[key: string]: any;
};
/**
* 组件事件监听
*/
on?: {
[key: string]: (context?: any) => void;
};
/**
* 组件其他参数
* 事件onXxx:(event)=>void 组件原始事件监听
* on.onXxx:(context)=>void 组件事件监听(对原始事件包装)
* 样式style、class等
*/
[key: string]: any;
};

View File

@@ -1,2 +0,0 @@
export * from "./pipeline";
export * from "./fast-crud";

View File

@@ -1,140 +0,0 @@
export enum RunStrategy {
AlwaysRun,
SkipWhenSucceed,
}
export enum ConcurrencyStrategy {
Serial,
Parallel,
}
export enum NextStrategy {
AllSuccess,
OneSuccess,
}
export enum HandlerType {
//清空后续任务的状态
ClearFollowStatus,
SendEmail,
}
export type EventHandler = {
type: HandlerType;
params: {
[key: string]: any;
};
};
export type RunnableStrategy = {
runStrategy?: RunStrategy;
onSuccess?: EventHandler[];
onError?: EventHandler[];
};
export type Step = Runnable & {
type: string; //插件类型
input: {
[key: string]: any;
};
};
export type Task = Runnable & {
steps: Step[];
};
export type Stage = Runnable & {
tasks: Task[];
concurrency: ConcurrencyStrategy;
next: NextStrategy;
};
export type Trigger = {
id: string;
title: string;
cron: string;
type: string;
};
export type FileItem = {
id: string;
filename: string;
path: string;
};
export type Runnable = {
id: string;
title: string;
strategy?: RunnableStrategy;
runnableType?: string; // pipeline, stage, task , step
status?: HistoryResult;
timeout?: number;
default?: {
[key: string]: any;
};
context?: Context;
};
export type EmailOptions = {
receivers: string[];
};
export type NotificationWhen = "error" | "success" | "turnToSuccess" | "start";
export type NotificationType = "email" | "url";
export type Notification = {
type: NotificationType;
when: NotificationWhen[];
options: EmailOptions;
};
export type Pipeline = Runnable & {
version?: number;
userId: any;
stages: Stage[];
triggers: Trigger[];
notifications?: Notification[];
};
export type Context = {
[key: string]: any;
};
export type Log = {
title: string;
time: number;
level: string;
text: string;
};
export enum ResultType {
start = "start",
success = "success",
error = "error",
canceled = "canceled",
skip = "skip",
none = "none",
}
export type HistoryResultGroup = {
[key: string]: {
runnable: Runnable;
res: HistoryResult;
};
};
export type HistoryResult = {
input: any;
output: any;
files?: FileItem[];
/**
* 任务状态
*/
status: ResultType;
startTime: number;
endTime?: number;
/**
* 处理结果
*/
result?: ResultType; //success, error,skip
message?: string;
};
export type RunnableMap = {
[id: string]: Runnable;
};

View File

@@ -4,7 +4,7 @@ import { FileStore } from "../core/file-store.js";
import { Logger } from "log4js";
import { IAccessService } from "../access/index.js";
import { ICnameProxyService, IEmailService } from "../service/index.js";
import { IContext, PluginRequestHandleReq, RunnableCollection } from "../core/index.js";
import { CancelError, IContext, PluginRequestHandleReq, RunnableCollection } from "../core/index.js";
import { ILogger, logger, utils } from "../utils/index.js";
import { HttpClient } from "../utils/index.js";
import dayjs from "dayjs";
@@ -111,13 +111,19 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
return this._result.files;
}
checkSignal() {
if (this.ctx.signal && this.ctx.signal.aborted) {
throw new CancelError("用户取消");
}
}
setCtx(ctx: TaskInstanceContext) {
this.ctx = ctx;
this.logger = ctx.logger;
this.accessService = ctx.accessService;
}
async getAccess(accessId: string) {
async getAccess<T = any>(accessId: string) {
if (accessId == null) {
throw new Error("您还没有配置授权");
}
@@ -125,7 +131,7 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
if (res == null) {
throw new Error("授权不存在,可能已被删除,请前往任务配置里面重新选择授权");
}
return res;
return res as T;
}
randomFileId() {

View File

@@ -1,4 +1,4 @@
import { logger } from "../utils/index.js";
import { isDev, logger } from "../utils/index.js";
export type Registrable = {
name: string;
@@ -71,6 +71,9 @@ export class Registry<T> {
if (define?.deprecated) {
continue;
}
if (!isDev() && define.name.startsWith("demo")) {
continue;
}
list.push({ ...define, key });
}
}

View File

@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/certd/certd/compare/v1.26.16...v1.27.0) (2024-10-31)
**Note:** Version bump only for package @certd/lib-huawei
## [1.26.16](https://github.com/certd/certd/compare/v1.26.15...v1.26.16) (2024-10-30)
**Note:** Version bump only for package @certd/lib-huawei
## [1.26.15](https://github.com/certd/certd/compare/v1.26.14...v1.26.15) (2024-10-28)
**Note:** Version bump only for package @certd/lib-huawei
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
**Note:** Version bump only for package @certd/lib-huawei
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
**Note:** Version bump only for package @certd/lib-huawei

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.26.13",
"version": "1.27.0",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts",
@@ -17,5 +17,5 @@
"rimraf": "^5.0.5",
"rollup": "^3.7.4"
},
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
"gitHead": "844fd4358c84251c72c5854ea633f238014244ad"
}

View File

@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/certd/certd/compare/v1.26.16...v1.27.0) (2024-10-31)
**Note:** Version bump only for package @certd/lib-iframe
## [1.26.16](https://github.com/certd/certd/compare/v1.26.15...v1.26.16) (2024-10-30)
**Note:** Version bump only for package @certd/lib-iframe
## [1.26.15](https://github.com/certd/certd/compare/v1.26.14...v1.26.15) (2024-10-28)
**Note:** Version bump only for package @certd/lib-iframe
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
**Note:** Version bump only for package @certd/lib-iframe
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
**Note:** Version bump only for package @certd/lib-iframe

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.26.13",
"version": "1.27.0",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -39,5 +39,5 @@
"tslib": "^2.5.2",
"typescript": "^5.4.2"
},
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
"gitHead": "844fd4358c84251c72c5854ea633f238014244ad"
}

View File

@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/certd/certd/compare/v1.26.16...v1.27.0) (2024-10-31)
**Note:** Version bump only for package @certd/lib-jdcloud
## [1.26.16](https://github.com/certd/certd/compare/v1.26.15...v1.26.16) (2024-10-30)
**Note:** Version bump only for package @certd/lib-jdcloud
## [1.26.15](https://github.com/certd/certd/compare/v1.26.14...v1.26.15) (2024-10-28)
**Note:** Version bump only for package @certd/lib-jdcloud
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
**Note:** Version bump only for package @certd/lib-jdcloud
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
**Note:** Version bump only for package @certd/lib-jdcloud

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-jdcloud",
"private": false,
"version": "1.26.13",
"version": "1.27.0",
"main": "./dist/bundle.mjs",
"module": "./dist/bundle.mjs",
"types": "./dist/d/index.d.ts",
@@ -27,5 +27,5 @@
"rimraf": "^5.0.5",
"rollup": "^3.7.4"
},
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
"gitHead": "844fd4358c84251c72c5854ea633f238014244ad"
}

View File

@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/certd/certd/compare/v1.26.16...v1.27.0) (2024-10-31)
**Note:** Version bump only for package @certd/lib-k8s
## [1.26.16](https://github.com/certd/certd/compare/v1.26.15...v1.26.16) (2024-10-30)
**Note:** Version bump only for package @certd/lib-k8s
## [1.26.15](https://github.com/certd/certd/compare/v1.26.14...v1.26.15) (2024-10-28)
**Note:** Version bump only for package @certd/lib-k8s
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
**Note:** Version bump only for package @certd/lib-k8s
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
**Note:** Version bump only for package @certd/lib-k8s

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-k8s",
"private": false,
"version": "1.26.13",
"version": "1.27.0",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -18,7 +18,7 @@
"@kubernetes/client-node": "0.21.0"
},
"devDependencies": {
"@certd/pipeline": "^1.26.13",
"@certd/pipeline": "^1.27.0",
"@rollup/plugin-commonjs": "^23.0.4",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
@@ -40,5 +40,5 @@
"tslib": "^2.5.2",
"typescript": "^5.4.2"
},
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
"gitHead": "844fd4358c84251c72c5854ea633f238014244ad"
}

View File

@@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/certd/certd/compare/v1.26.16...v1.27.0) (2024-10-31)
**Note:** Version bump only for package @certd/lib-server
## [1.26.16](https://github.com/certd/certd/compare/v1.26.15...v1.26.16) (2024-10-30)
**Note:** Version bump only for package @certd/lib-server
## [1.26.15](https://github.com/certd/certd/compare/v1.26.14...v1.26.15) (2024-10-28)
**Note:** Version bump only for package @certd/lib-server
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
### Performance Improvements
* 限制其他用户流水线数量 ([315e437](https://github.com/certd/certd/commit/315e43746baf01682737f82e41579237a48409af))
* 用户管理优化头像上传 ([661293c](https://github.com/certd/certd/commit/661293c189a3abf3cdc953b5225192372f57930d))
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
**Note:** Version bump only for package @certd/lib-server

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/lib-server",
"version": "1.26.13",
"version": "1.27.0",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -26,9 +26,9 @@
],
"license": "AGPL",
"dependencies": {
"@certd/acme-client": "^1.26.13",
"@certd/basic": "^1.26.13",
"@certd/pipeline": "^1.26.13",
"@certd/acme-client": "^1.27.0",
"@certd/basic": "^1.27.0",
"@certd/pipeline": "^1.27.0",
"@midwayjs/cache": "~3.14.0",
"@midwayjs/core": "~3.17.1",
"@midwayjs/i18n": "~3.17.3",
@@ -69,5 +69,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
"gitHead": "844fd4358c84251c72c5854ea633f238014244ad"
}

View File

@@ -1,4 +1,4 @@
import { Provide } from '@midwayjs/core';
import { Provide, Scope, ScopeEnum } from '@midwayjs/core';
import dayjs from 'dayjs';
import path from 'path';
import fs from 'fs';
@@ -14,6 +14,7 @@ export const uploadTmpFileCacheKey = 'tmpfile_key_';
/**
*/
@Provide()
@Scope(ScopeEnum.Singleton)
export class FileService {
async saveFile(userId: number, tmpCacheKey: any, permission: 'public' | 'private') {
if (tmpCacheKey.startsWith(`/${permission}`)) {

View File

@@ -15,6 +15,7 @@ export class SysPublicSettings extends BaseSettings {
static __title__ = '系统公共设置';
static __access__ = 'public';
registerEnabled = false;
limitUserPipelineCount = 0;
managerOtherUserPipeline = false;
icpNo?: string;
// triggerOnStartup = false;

View File

@@ -127,14 +127,12 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
async reloadPrivateSettings() {
const bean = await this.getPrivateSettings();
if (bean.httpProxy || bean.httpsProxy) {
const opts = {
httpProxy: bean.httpProxy,
httpsProxy: bean.httpsProxy,
};
setGlobalProxy(opts);
agents.setGlobalProxy(opts);
}
const opts = {
httpProxy: bean.httpProxy,
httpsProxy: bean.httpsProxy,
};
setGlobalProxy(opts);
agents.setGlobalProxy(opts);
}
async updateByKey(key: string, setting: any) {

View File

@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/certd/certd/compare/v1.26.16...v1.27.0) (2024-10-31)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.26.16](https://github.com/certd/certd/compare/v1.26.15...v1.26.16) (2024-10-30)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.26.15](https://github.com/certd/certd/compare/v1.26.14...v1.26.15) (2024-10-28)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
**Note:** Version bump only for package @certd/midway-flyway-js

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.26.13",
"version": "1.27.0",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -56,5 +56,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
"gitHead": "844fd4358c84251c72c5854ea633f238014244ad"
}

View File

@@ -3,6 +3,36 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/certd/certd/compare/v1.26.16...v1.27.0) (2024-10-31)
### Bug Fixes
* pfx兼容windows server 2016 ([e5e468a](https://github.com/certd/certd/commit/e5e468a463f66d02f235de54b7c1e09ace5f1cb1))
### Features
* 首页全新改版 ([63ec5b5](https://github.com/certd/certd/commit/63ec5b5519c760a3330569c0da6dac157302a330))
### Performance Improvements
* lego 升级到 4.19.2 ([129bf53](https://github.com/certd/certd/commit/129bf53edc9bbb001fe49fbd7e239bd1d09cc128))
## [1.26.16](https://github.com/certd/certd/compare/v1.26.15...v1.26.16) (2024-10-30)
### Bug Fixes
* 修复lego No help topic for 错误 ([aaaf8d7](https://github.com/certd/certd/commit/aaaf8d7db34896cf8f2ff8f12eec1ab0cae58f0f))
## [1.26.15](https://github.com/certd/certd/compare/v1.26.14...v1.26.15) (2024-10-28)
### Performance Improvements
* 默认证书更新时间设置为35天增加腾讯云删除过期证书插件可以避免腾讯云过期证书邮件 ([51b6fed](https://github.com/certd/certd/commit/51b6fed468eaa6f28ce4497ce303ace1a52abb96))
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
**Note:** Version bump only for package @certd/plugin-cert
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
### Bug Fixes

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-cert",
"private": false,
"version": "1.26.13",
"version": "1.27.0",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -15,9 +15,9 @@
"preview": "vite preview"
},
"dependencies": {
"@certd/acme-client": "^1.26.13",
"@certd/basic": "^1.26.13",
"@certd/pipeline": "^1.26.13",
"@certd/acme-client": "^1.27.0",
"@certd/basic": "^1.27.0",
"@certd/pipeline": "^1.27.0",
"@google-cloud/publicca": "^1.3.0",
"dayjs": "^1.11.7",
"jszip": "^3.10.1",
@@ -57,5 +57,5 @@
"vite": "^3.1.0",
"vue-tsc": "^0.38.9"
},
"gitHead": "11d0daa59ae409c229037189066414f29b787de0"
"gitHead": "844fd4358c84251c72c5854ea633f238014244ad"
}

View File

@@ -30,6 +30,7 @@ export type CertInfo = {
ic?: string;
pfx?: string;
der?: string;
jks?: string;
};
export type SSLProvider = "letsencrypt" | "google" | "zerossl";
export type PrivateKeyType = "rsa_1024" | "rsa_2048" | "rsa_3072" | "rsa_4096" | "ec_256" | "ec_384" | "ec_521";
@@ -59,8 +60,8 @@ export class AcmeService {
this.sslProvider = options.sslProvider || "letsencrypt";
this.eab = options.eab;
this.skipLocalVerify = options.skipLocalVerify ?? false;
acme.setLogger((text: string) => {
this.logger.info(text);
acme.setLogger((message: any, ...args: any[]) => {
this.logger.info(message, ...args);
});
}

View File

@@ -55,13 +55,14 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
},
required: false,
order: 100,
helper: "PFX格式证书是否需要加密",
// helper: "PFX、jks格式证书是否加密jks必须设置密码不传则默认123456",
helper: "PFX证书是否加密",
})
pfxPassword!: string;
@TaskInput({
title: "更新天数",
value: 20,
value: 35,
component: {
name: "a-input-number",
vModel: "value",
@@ -157,14 +158,28 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
cert,
pfxPassword: this.pfxPassword,
});
const pfxBuffer = fs.readFileSync(res.pfxPath);
cert.pfx = pfxBuffer.toString("base64");
if (res.pfxPath) {
const pfxBuffer = fs.readFileSync(res.pfxPath);
cert.pfx = pfxBuffer.toString("base64");
fs.unlinkSync(res.pfxPath);
isNew = true;
}
const derBuffer = fs.readFileSync(res.derPath);
cert.der = derBuffer.toString("base64");
if (res.derPath) {
const derBuffer = fs.readFileSync(res.derPath);
cert.der = derBuffer.toString("base64");
fs.unlinkSync(res.derPath);
isNew = true;
}
if (res.jksPath) {
const jksBuffer = fs.readFileSync(res.jksPath);
cert.jks = jksBuffer.toString("base64");
fs.unlinkSync(res.jksPath);
isNew = true;
}
this.logger.info("转换证书格式成功");
isNew = true;
} catch (e) {
this.logger.error("转换证书格式失败", e);
}
@@ -186,12 +201,16 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
zip.file("cert.crt", cert.crt);
zip.file("cert.key", cert.key);
zip.file("intermediate.crt", cert.ic);
if (cert.pfx) {
zip.file("cert.pfx", Buffer.from(cert.pfx, "base64"));
}
if (cert.der) {
zip.file("cert.der", Buffer.from(cert.der, "base64"));
}
if (cert.jks) {
zip.file("cert.jks", Buffer.from(cert.jks, "base64"));
}
const content = await zip.generateAsync({ type: "nodebuffer" });
this.saveFile(filename, content);
this.logger.info(`已保存文件:${filename}`);
@@ -212,7 +231,7 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
this.logger.info("input hash 有变更,检查是否需要重新申请证书");
//判断域名有没有变更
/**
* "renewDays": 20,
* "renewDays": 35,
* "certApplyPlugin": "CertApply",
* "sslProvider": "letsencrypt",
* "privateKeyType": "rsa_2048_pkcs1",

View File

@@ -13,6 +13,7 @@ export type CertReaderHandleContext = {
tmpPfxPath?: string;
tmpDerPath?: string;
tmpIcPath?: string;
tmpJksPath?: string;
};
export type CertReaderHandle = (ctx: CertReaderHandleContext) => Promise<void>;
export type HandleOpts = { logger: ILogger; handle: CertReaderHandle };
@@ -72,14 +73,14 @@ export class CertReader {
return domains;
}
saveToFile(type: "crt" | "key" | "pfx" | "der" | "ic", filepath?: string) {
saveToFile(type: "crt" | "key" | "pfx" | "der" | "ic" | "jks", filepath?: string) {
if (!this.cert[type]) {
return;
}
if (filepath == null) {
//写入临时目录
filepath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + "", `cert.${type}`);
filepath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + `_cert.${type}`);
}
const dir = path.dirname(filepath);
@@ -103,6 +104,7 @@ export class CertReader {
const tmpIcPath = this.saveToFile("ic");
logger.info("本地文件写入成功");
const tmpDerPath = this.saveToFile("der");
const tmpJksPath = this.saveToFile("jks");
try {
return await opts.handle({
reader: this,
@@ -111,6 +113,7 @@ export class CertReader {
tmpPfxPath: tmpPfxPath,
tmpDerPath: tmpDerPath,
tmpIcPath: tmpIcPath,
tmpJksPath: tmpJksPath,
});
} catch (err) {
throw err;
@@ -127,6 +130,7 @@ export class CertReader {
removeFile(tmpPfxPath);
removeFile(tmpDerPath);
removeFile(tmpIcPath);
removeFile(tmpJksPath);
}
}

View File

@@ -17,16 +17,20 @@ export class CertConverter {
async convert(opts: { cert: CertInfo; pfxPassword: string }): Promise<{
pfxPath: string;
derPath: string;
jksPath: string;
}> {
const certReader = new CertReader(opts.cert);
let pfxPath: string;
let derPath: string;
let jksPath: string;
const handle = async (ctx: CertReaderHandleContext) => {
// 调用openssl 转pfx
pfxPath = await this.convertPfx(ctx, opts.pfxPassword);
// 转der
derPath = await this.convertDer(ctx);
//jksPath = await this.convertJks(ctx, opts.pfxPassword);
};
await certReader.readCertFile({ logger: this.logger, handle });
@@ -34,10 +38,12 @@ export class CertConverter {
return {
pfxPath,
derPath,
jksPath,
};
}
async exec(cmd: string) {
process.env.LANG = "zh_CN.GBK";
await sp.spawn({
cmd: cmd,
logger: this.logger,
@@ -47,7 +53,7 @@ export class CertConverter {
private async convertPfx(opts: CertReaderHandleContext, pfxPassword: string) {
const { tmpCrtPath, tmpKeyPath } = opts;
const pfxPath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + "", "cert.pfx");
const pfxPath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + "_cert.pfx");
const dir = path.dirname(pfxPath);
if (!fs.existsSync(dir)) {
@@ -58,7 +64,10 @@ export class CertConverter {
if (pfxPassword) {
passwordArg = `-password pass:${pfxPassword}`;
}
await this.exec(`openssl pkcs12 -export -out ${pfxPath} -inkey ${tmpKeyPath} -in ${tmpCrtPath} ${passwordArg}`);
// 兼容server 2016旧版本不能用sha256
const oldPfxCmd = `openssl pkcs12 -macalg SHA1 -keypbe PBE-SHA1-3DES -certpbe PBE-SHA1-3DES -export -out ${pfxPath} -inkey ${tmpKeyPath} -in ${tmpCrtPath} ${passwordArg}`;
// const newPfx = `openssl pkcs12 -export -out ${pfxPath} -inkey ${tmpKeyPath} -in ${tmpCrtPath} ${passwordArg}`;
await this.exec(oldPfxCmd);
return pfxPath;
// const fileBuffer = fs.readFileSync(pfxPath);
// this.pfxCert = fileBuffer.toString("base64");
@@ -70,7 +79,7 @@ export class CertConverter {
private async convertDer(opts: CertReaderHandleContext) {
const { tmpCrtPath } = opts;
const derPath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + "", `cert.der`);
const derPath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + `_cert.der`);
const dir = path.dirname(derPath);
if (!fs.existsSync(dir)) {
@@ -88,4 +97,33 @@ export class CertConverter {
// const filename = reader.buildCertFileName("der", applyTime);
// this.saveFile(filename, fileBuffer);
}
async convertJks(opts: CertReaderHandleContext, pfxPassword = "") {
const jksPassword = pfxPassword || "123456";
try {
const randomStr = Math.floor(Math.random() * 1000000) + "";
const p12Path = path.join(os.tmpdir(), "/certd/tmp/", randomStr + `_cert.p12`);
const { tmpCrtPath, tmpKeyPath } = opts;
let passwordArg = "-passout pass:";
if (pfxPassword) {
passwordArg = `-password pass:${pfxPassword}`;
}
await this.exec(`openssl pkcs12 -export -in ${tmpCrtPath} -inkey ${tmpKeyPath} -out ${p12Path} -name certd ${passwordArg}`);
const jksPath = path.join(os.tmpdir(), "/certd/tmp/", randomStr + `_cert.jks`);
const dir = path.dirname(jksPath);
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true });
}
await this.exec(
`keytool -importkeystore -srckeystore ${p12Path} -srcstoretype PKCS12 -srcstorepass "${pfxPassword}" -destkeystore ${jksPath} -deststoretype PKCS12 -deststorepass "${jksPassword}" `
);
fs.unlinkSync(p12Path);
return jksPath;
} catch (e) {
this.logger.error("转换jks失败", e);
return;
}
}
}

View File

@@ -7,6 +7,7 @@ import { CertReader } from "./cert-reader.js";
import { CertApplyBasePlugin } from "./base.js";
import { GoogleClient } from "../../libs/google.js";
import { EabAccess } from "../../access";
import { CancelError } from "@certd/pipeline";
export type { CertInfo };
export * from "./cert-reader.js";
@@ -33,7 +34,7 @@ export type DomainsVerifyPlanInput = {
desc: "免费通配符域名证书申请,支持多个域名打到同一个证书上",
default: {
input: {
renewDays: 20,
renewDays: 35,
forceUpdate: false,
},
strategy: {
@@ -55,12 +56,12 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
},
required: true,
helper:
"DNS直接验证适合域名是在阿里云、腾讯云、华为云、Cloudflare、西数注册的需要提供Access授权信息。\nCNAME代理验证支持任何注册商注册的域名并且不需要提供Access授权信息但第一次需要手动添加CNAME记录",
"DNS直接验证域名是在阿里云、腾讯云、华为云、Cloudflare、西数注册的选它。\nCNAME代理验证支持任何注册商注册的域名但第一次需要手动添加CNAME记录",
})
challengeType!: string;
@TaskInput({
title: "DNS提供商",
title: "DNS解析服务商",
component: {
name: "dns-provider-selector",
},
@@ -72,7 +73,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
}
`,
required: true,
helper: "请选择dns解析提供商您的域名是在哪里注册或者域名的dns解析服务器属于哪个平台\n如果这里没有您需要的dns解析提供商请选择CNAME代理验证校验方式",
helper: "您的域名注册或者域名的dns服务器属于哪个平台\n如果这里没有请选择CNAME代理验证校验方式",
})
dnsProviderType!: string;
@@ -82,7 +83,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
name: "access-selector",
},
required: true,
helper: "请选择dns解析提供商授权",
helper: "请选择dns解析服务商授权",
mergeScript: `return {
component:{
type: ctx.compute(({form})=>{
@@ -134,7 +135,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
{ value: "zerossl", label: "ZeroSSL" },
],
},
helper: "Let's Encrypt最简单如果使用ZeroSSL、Google证书需要提供EAB授权",
helper: "Let's Encrypt:申请最简单\nGoogle大厂光环兼容性好需要翻墙获取EAB授权\nZeroSSL有数量限制获取EAB授权无需翻墙",
required: true,
})
sslProvider!: SSLProvider;
@@ -293,6 +294,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
useMappingProxy: this.useProxy,
reverseProxy: this.reverseProxy,
privateKeyType: this.privateKeyType,
signal: this.ctx.signal,
// cnameProxyService: this.ctx.cnameProxyService,
// dnsProviderCreator: this.createDnsProvider.bind(this),
});
@@ -347,6 +349,9 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
this.logger.error(e);
throw new Error(`通配符域名已经包含了普通域名,请删除其中一个(${message}`);
}
if (e.name === "CancelError") {
throw new CancelError(e.message);
}
throw e;
}
}

View File

@@ -5,6 +5,8 @@ import { CertApplyBasePlugin } from "../base.js";
import fs from "fs";
import { EabAccess } from "../../../access/index.js";
import path from "path";
import { utils } from "@certd/basic";
import JSZip from "jszip";
export { CertReader };
export type { CertInfo };
@@ -17,7 +19,7 @@ export type { CertInfo };
desc: "支持海量DNS解析提供商推荐使用一样的免费通配符域名证书申请支持多个域名打到同一个证书上",
default: {
input: {
renewDays: 20,
renewDays: 35,
forceUpdate: false,
},
strategy: {
@@ -118,7 +120,7 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin {
this.logger.info(`环境变量:${JSON.stringify(env)}`);
let eabArgs = "";
if (this.eab) {
eabArgs = ` --eab "${this.eab.kid}" --kid "${this.eab.kid}" --hmac "${this.eab.hmacKey}"`;
eabArgs = ` --eab --kid "${this.eab.kid}" --hmac "${this.eab.hmacKey}"`;
}
const keyType = "-k rsa2048";
@@ -126,6 +128,25 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin {
const savePathArgs = `--path "${saveDir}"`;
const os_type = process.platform === "win32" ? "windows" : "linux";
const legoPath = path.resolve("./tools", os_type, "lego");
if (!fs.existsSync(legoPath)) {
//解压缩
if (os_type === "linux") {
await utils.sp.spawn({
cmd: "tar -zxvf ./tools/linux/lego_*.tar.gz -C ./tools/linux/",
});
this.logger.info("解压lego成功");
} else {
const zip = new JSZip();
const data = fs.readFileSync("./tools/windows/lego_windows_amd64.zip");
const zipData = await zip.loadAsync(data);
const files = Object.keys(zipData.files);
for (const file of files) {
const content = await zipData.files[file].async("nodebuffer");
fs.writeFileSync(`./tools/windows/${file}`, content);
}
this.logger.info("解压lego成功");
}
}
let serverArgs = "";
if (this.acmeServer) {
serverArgs = ` --server ${this.acmeServer}`;

View File

@@ -13,9 +13,12 @@ RUN cd /workspace/certd-server && pnpm install && npm run build-on-docker
FROM node:18-alpine
RUN apk add --no-cache openssl
# RUN apk add --no-cache openjdk11-jdk
WORKDIR /app/
COPY --from=builder /workspace/certd-server/ /app/
RUN cd /app/tools/linux/ && tar -zxvf *.tar.gz -C .
RUN chmod +x /app/tools/linux/*
ENV TZ=Asia/Shanghai
ENV NODE_ENV=production
ENV MIDWAY_SERVER_ENV=production

View File

@@ -3,6 +3,50 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.27.0](https://github.com/certd/certd/compare/v1.26.16...v1.27.0) (2024-10-31)
### Bug Fixes
* 修复历史记录不能按名称查询的bug ([6113c38](https://github.com/certd/certd/commit/6113c388b7fc58b11ca19ff05cc1286d096c8d28))
### Features
* 首页全新改版 ([63ec5b5](https://github.com/certd/certd/commit/63ec5b5519c760a3330569c0da6dac157302a330))
### Performance Improvements
* 管理控制台数据统计 ([babd589](https://github.com/certd/certd/commit/babd5897ae013ff7c04ebfcbfac8a00d84dd627c))
* 增加向导 ([6d9ef26](https://github.com/certd/certd/commit/6d9ef26ecab71d752c2c55d75aed4fb5f6c05a39))
## [1.26.16](https://github.com/certd/certd/compare/v1.26.15...v1.26.16) (2024-10-30)
**Note:** Version bump only for package @certd/ui-client
## [1.26.15](https://github.com/certd/certd/compare/v1.26.14...v1.26.15) (2024-10-28)
### Bug Fixes
* 顶部菜单变...的bug ([6dabad7](https://github.com/certd/certd/commit/6dabad76baba96be0f8af36a3fbfb9f5182aecf1))
### Performance Improvements
* 默认证书更新时间设置为35天增加腾讯云删除过期证书插件可以避免腾讯云过期证书邮件 ([51b6fed](https://github.com/certd/certd/commit/51b6fed468eaa6f28ce4497ce303ace1a52abb96))
* 授权加密支持解密查看 ([5575c83](https://github.com/certd/certd/commit/5575c839705f6987ad2bdcd33256b0962c6a9c6a))
* 重置管理员密码同时启用管理员账户,避免之前禁用了,重置密码还是登录不进去 ([f92d918](https://github.com/certd/certd/commit/f92d918a1e28e29b794ad4754661ea760c18af46))
## [1.26.14](https://github.com/certd/certd/compare/v1.26.13...v1.26.14) (2024-10-26)
### Bug Fixes
* 修复启动时自签证书无法保存的bug ([526c484](https://github.com/certd/certd/commit/526c48450bcd37b3ccded9b448f17de8140bdc6e))
### Performance Improvements
* 顶部菜单自定义 ([54d136c](https://github.com/certd/certd/commit/54d136cc6ae122f7c891b7a5c7232fe5de8e5cb5))
* 禁用readonly用户 ([d10d42e](https://github.com/certd/certd/commit/d10d42e20619bb55a50d636b8867ff33db4e3b4b))
* 限制其他用户流水线数量 ([315e437](https://github.com/certd/certd/commit/315e43746baf01682737f82e41579237a48409af))
* 用户管理优化头像上传 ([661293c](https://github.com/certd/certd/commit/661293c189a3abf3cdc953b5225192372f57930d))
## [1.26.13](https://github.com/certd/certd/compare/v1.26.12...v1.26.13) (2024-10-26)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.26.13",
"version": "1.27.0",
"private": true,
"scripts": {
"dev": "vite --open",
@@ -45,6 +45,7 @@
"cron-parser": "^4.9.0",
"cropperjs": "^1.6.1",
"dayjs": "^1.11.10",
"echarts": "^5.5.1",
"highlight.js": "^11.9.0",
"humanize-duration": "^3.27.3",
"lodash-es": "^4.17.21",
@@ -58,13 +59,14 @@
"sortablejs": "^1.15.2",
"vue": "^3.4.21",
"vue-cropperjs": "^5.0.0",
"vue-echarts": "^7.0.3",
"vue-i18n": "^9.10.2",
"vue-router": "^4.3.0",
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@certd/lib-iframe": "^1.26.13",
"@certd/pipeline": "^1.26.13",
"@certd/lib-iframe": "^1.27.0",
"@certd/pipeline": "^1.27.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -6,9 +6,9 @@
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/>
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/>
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
<link rel="stylesheet" href='demo.css'>
<link rel="stylesheet" href='iconfont.css'>
<script src='iconfont.js'></script>
<link rel="stylesheet" href="demo.css">
<link rel="stylesheet" href="iconfont.css">
<script src="iconfont.js"></script>
<!-- jQuery -->
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
<!-- 代码高亮 -->
@@ -38,7 +38,7 @@
<div class="main">
<h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">
<img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg">
</a></h1>
<div class="nav-tabs">
<ul id="tabs" class="dib-box">
@@ -46,44 +46,50 @@
<li class="dib"><span>Font class</span></li>
<li class="dib"><span>Symbol</span></li>
</ul>
<a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=4688792" target="_blank" class="nav-more">查看项目</a>
</div>
<div class="tab-container">
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe610;</span>
<div class="name">华为</div>
<div class="code-name">&amp;#xe610;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe603;</span>
<div class="name">qiniuyun</div>
<div class="code-name">&amp;#xe603;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe601;</span>
<div class="name">aliyun</div>
<div class="code-name">&amp;#xe601;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe747;</span>
<div class="name">腾讯云</div>
<div class="code-name">&amp;#xe747;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe605;</span>
<div class="name">doge</div>
<div class="code-name">&amp;#xe605;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe600;</span>
<div class="name">bt</div>
<div class="code-name">&amp;#xe600;</div>
</li>
</ul>
<div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2>
@@ -102,7 +108,7 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.svg?t=1727153857332#iconfont') format('svg');
src: url('iconfont.svg?t=1730278432006#iconfont') format('svg');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -127,7 +133,16 @@
</div>
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-huawei"></span>
<div class="name">
华为
</div>
<div class="code-name">.icon-huawei
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-qiniuyun"></span>
<div class="name">
@@ -136,7 +151,7 @@
<div class="code-name">.icon-qiniuyun
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-aliyun"></span>
<div class="name">
@@ -145,7 +160,7 @@
<div class="code-name">.icon-aliyun
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-tencentcloud"></span>
<div class="name">
@@ -154,7 +169,7 @@
<div class="code-name">.icon-tencentcloud
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-dogecloud"></span>
<div class="name">
@@ -163,7 +178,7 @@
<div class="code-name">.icon-dogecloud
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-bt"></span>
<div class="name">
@@ -172,7 +187,7 @@
<div class="code-name">.icon-bt
</div>
</li>
</ul>
<div class="article markdown">
<h2 id="font-class-">font-class 引用</h2>
@@ -199,7 +214,15 @@
</div>
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-huawei"></use>
</svg>
<div class="name">华为</div>
<div class="code-name">#icon-huawei</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-qiniuyun"></use>
@@ -207,7 +230,7 @@
<div class="name">qiniuyun</div>
<div class="code-name">#icon-qiniuyun</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-aliyun"></use>
@@ -215,7 +238,7 @@
<div class="name">aliyun</div>
<div class="code-name">#icon-aliyun</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-tencentcloud"></use>
@@ -223,7 +246,7 @@
<div class="name">腾讯云</div>
<div class="code-name">#icon-tencentcloud</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-dogecloud"></use>
@@ -231,7 +254,7 @@
<div class="name">doge</div>
<div class="code-name">#icon-dogecloud</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-bt"></use>
@@ -239,7 +262,7 @@
<div class="name">bt</div>
<div class="code-name">#icon-bt</div>
</li>
</ul>
<div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2>

View File

@@ -1,6 +1,6 @@
@font-face {
font-family: "iconfont"; /* Project id 4688792 */
src: url('iconfont.svg?t=1727153857332#iconfont') format('svg');
src: url('iconfont.svg?t=1730278432006#iconfont') format('svg');
}
.iconfont {
@@ -11,6 +11,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-huawei:before {
content: "\e610";
}
.icon-qiniuyun:before {
content: "\e603";
}

File diff suppressed because one or more lines are too long

View File

@@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "24164616",
"name": "华为",
"font_class": "huawei",
"unicode": "e610",
"unicode_decimal": 58896
},
{
"icon_id": "9612999",
"name": "qiniuyun",

View File

@@ -14,7 +14,9 @@
/>
<missing-glyph />
<glyph glyph-name="qiniuyun" unicode="&#58883;" d="M53.684427 804.418697a705.73155 705.73155 0 0 1 52.395618-94.012709 810.709913 810.709913 0 0 1 74.626331-96.63249c6.100347-11.003079 18.301041-15.868388 24.438812-28.106506 10.965654-9.76804 21.968734-20.733695 32.971814-31.736775a1023.698102 1023.698102 0 0 1 119.761413-86.714748c17.103427-9.805465 33.009239-18.338467 50.112667-26.871467 3.742544-4.902733 1.197614-9.805465 2.432653-14.670773 6.100347-35.441893 8.533-72.0814 13.435733-107.485868 2.432654-20.77112 3.742544-42.777279 7.297962-63.623251 6.137772-35.441893 9.805465-72.0814 14.670773-107.523293 6.100347-40.3072 9.76804-80.576976 17.103427-120.884176 3.742544-19.573506 14.670773-35.441893 23.203773-53.78036 2.432654-3.742544 6.100347-6.100347 8.570427-10.965654 31.736774-40.3072 74.476628-57.410627 125.786909-57.410627h287.053136c73.279014 0 124.589295 35.404468 152.695801 103.818174 13.435733 32.971814 15.868388 68.413707 19.536081 102.620562l25.636427 208.871388c2.470079 10.965654-1.197614 12.200694-10.965654 12.200695-24.438814 0-46.444972-6.100347-68.413707-14.670774-17.103427-4.865307-28.106507-17.103427-40.3072-28.106507a21.220225 21.220225 0 0 1-8.533002-6.100347c-8.570426-13.435733-19.573506-24.438814-24.438813-39.07216a410.819071 410.819071 0 0 1-14.670773-41.54224c-9.76804-34.169428-19.536081-69.611321-29.304121-105.015789-3.742544-17.103427-13.435733-29.341546-24.438813-42.77728a40.906008 40.906008 0 0 0-29.304121-13.435734c-59.880706-3.742544-118.488948-2.432654-178.332228-1.197614a58.159136 58.159136 0 0 0-50.112667 30.501735c-8.533 14.670773-12.200694 29.341546-15.868387 45.209934-4.865307 22.00616-14.633347 42.739854-17.103426 65.981053a11.227632 11.227632 0 0 0-1.197615 6.062921c-17.103427 63.623251-35.441893 125.824334-52.395618 189.335309-1.197614 3.742544-3.742544 7.485088-1.197614 9.768041 2.432654 3.742544 7.297961 1.23504 10.965654 0a665.124946 665.124946 0 0 1 70.846362-14.633348 811.907528 811.907528 0 0 1 204.006081-6.100347 435.557288 435.557288 0 0 1 78.181747 13.435733c20.77112 8.533 42.739854 12.200694 64.708589 18.301041 28.106507 8.570426 54.977974 19.536081 83.084479 29.341547 12.200694 6.100347 25.636428 12.200694 37.837122 18.30104a839.826907 839.826907 0 0 1 90.419867 53.742934c4.865307 3.742544 9.76804 9.76804 14.633347 12.23812 13.435733 7.485088 24.438814 17.066002 36.639507 25.636427a52.395618 52.395618 0 0 1 20.771121 15.868387c6.100347 8.570426 14.670773 14.670773 22.00616 21.968735s15.868388 13.473159 21.968733 22.006159c6.100347 7.485088 14.670773 14.670773 22.00616 21.968734s7.485088 17.140853 17.103427 22.00616c7.485088 4.865307 10.965654 13.435733 17.103426 19.53608 2.432654 2.432654 4.865307 3.742544 6.100347 6.137773 1.197614 3.742544 3.742544 6.100347 4.865308 9.76804 14.670773 17.103427 25.673853 37.837121 39.109586 57.373202 10.965654 15.905812 17.103427 33.009239 28.069082 47.680012 1.23504 3.742544 0 7.485088 2.470079 10.965655 13.435733 18.338467 19.536081 40.3072 28.069081 61.07832 3.742544 7.485088 1.23504 9.76804-6.100348 9.76804-8.533 1.23504-17.103427 2.432654-23.203773-4.902732-1.23504-2.432654-3.742544-2.432654-6.100347-2.432654a15.419282 15.419282 0 0 1-15.868387-8.533001c-8.570426-14.670773-26.908893-23.203774-30.539161-41.54224h-1.235039c-8.570426 3.742544-12.200694-3.742544-15.868388-8.533a714.825933 714.825933 0 0 0-72.0814-64.746014 748.92051 748.92051 0 0 0-63.62325-45.209934c-28.106507-17.103427-53.742934-35.404468-84.282095-47.605161-1.23504-1.23504-2.432654-2.470079-2.432654-3.742544 0-3.742544-2.470079-2.470079-4.902732-2.470079a17.178278 17.178278 0 0 1-7.485088-2.432655c-32.971814-19.536081-69.611321-32.971814-105.015789-45.209933-50.112667-18.301041-103.8556-29.304121-156.363494-36.639507a510.370746 510.370746 0 0 0-74.514055-6.100347c-59.880706 0-118.488948-2.432654-178.332228 8.570426a1135.637597 1135.637597 0 0 0-124.589295 28.069082 8.944681 8.944681 0 0 0-7.485089 8.570425 134.057932 134.057932 0 0 1-8.570426 31.736775c-12.200694 40.3072-17.066002 83.047055-39.072161 120.921601-1.23504 1.23504-2.432654 1.23504-4.902732 1.23504a1.197614 1.197614 0 0 1-1.197614-1.23504v2.470079c-8.570426 11.003079-22.00616 15.868388-35.404468 18.301042-15.905812 3.742544-20.77112-1.197614-18.338467-15.868388 4.902733-37.874547 8.533-76.946708 14.633348-116.018869 1.23504-2.432654 2.470079-6.100347-1.197614-7.297961a7.709641 7.709641 0 0 0-7.485089 0c-17.103427 9.76804-32.971814 18.301041-50.07524 26.871467-23.203774 10.965654-43.974893 25.636428-64.746014 39.072161-9.76804 4.902733-17.103427 12.200694-25.636427 18.301041a620.438969 620.438969 0 0 0-81.849441 67.178668 444.988499 444.988499 0 0 0-67.365795 68.413707A49.888114 49.888114 0 0 1 47.022699 862.802386C32.38935 862.802386 28.721657 857.899653 34.822004 844.463919z" horiz-adv-x="1525" />
<glyph glyph-name="huawei" unicode="&#58896;" d="M418.325 157.246875Q310.4375 62.38125 238.38125 62.315625t-109.940625 89.128125l289.884375 5.85z m189.525 0l289.884375-5.803125Q859.8125 62.315625 787.79375 62.315625T607.85 157.29375zM46.915625 405.46875q166.875-89.0625 214.209375-117.50625t161.146875-102.075q-181.03125-11.25-236.953125-0.3c-42.646875 8.334375-75.84375 26.521875-104.26875 54.99375Q24.29375 297.3375 46.915625 405.46875z m932.34375 0Q1001.9 297.365625 945.125 240.5625c-28.415625-28.471875-61.6125-46.659375-104.26875-54.99375q-55.9125-10.96875-236.90625 0.3 113.690625 73.640625 161.109375 102.075t214.2 117.525zM183.3875 649.996875q87.2625-115.65 119.446875-164.94375t145.3125-265.66875Q225.0125 319.734375 137.9375 418.6875c-41.709375 47.38125-41.709375 125.11875 5.625 191.465625q10.3125 14.4375 39.815625 39.815625z m659.353125 0q29.540625-25.40625 39.815625-39.815625c47.38125-66.346875 47.38125-144.046875 5.68125-191.49375q-87.075-99-310.3125-199.33125 113.11875 216.375 145.3125 265.715625t119.503125 164.925zM445.0625 784.575q43.603125-128.925 49.275-181.96875T484.878125 246.1875Q295.259375 519.159375 295.259375 642.384375T445.0625 784.575z m136.134375 0Q730.953125 765.5625 730.953125 642.384375T541.38125 246.1875q-15.159375 303.328125-9.459375 356.4t49.275 181.96875z" horiz-adv-x="1024" />
<glyph glyph-name="qiniuyun" unicode="&#58883;" d="M102.32915 778.142528a661.623328 661.623328 0 0 1 49.120892-88.136914 760.040544 760.040544 0 0 1 69.962185-90.59296c5.719075-10.315387 17.157226-14.876613 22.911387-26.349849 10.280301-9.157538 20.595688-19.437839 30.911076-29.753227a959.716971 959.716971 0 0 1 112.276324-81.295076c16.034462-9.192624 30.946162-17.192312 46.980625-25.192 3.508635-4.596312 1.122763-9.192624 2.280613-13.75385 5.719075-33.226775 7.999688-67.576313 12.596-100.768001 2.280613-19.472925 3.508635-40.103699 6.841838-59.646798 5.754161-33.226775 9.192624-67.576313 13.75385-100.803087 5.719075-37.788 9.157538-75.540915 16.034463-113.328915 3.508635-18.350162 13.75385-33.226775 21.753538-50.419087 2.280613-3.508635 5.719075-5.719075 8.034774-10.280301 29.753226-37.788 69.821839-53.822463 117.925228-53.822463h269.112315c68.699076 0 116.802464 33.191689 143.152313 97.329538 12.596 30.911076 14.876613 64.13785 18.315076 96.206777l24.034151 195.816927c2.315699 10.280301-1.122763 11.438151-10.280301 11.438151-22.911388 0-43.542162-5.719075-64.137851-13.753851-16.034462-4.561225-26.34985-16.034462-37.788-26.34985a19.893961 19.893961 0 0 1-7.999689-5.719075c-8.034775-12.596-18.350162-22.911388-22.911387-36.63015a385.142879 385.142879 0 0 1-13.75385-38.945851c-9.157538-32.033839-18.315076-65.260614-27.472613-98.452301-3.508635-16.034462-12.596-27.507699-22.911387-40.103701a38.349382 38.349382 0 0 0-27.472613-12.596c-56.138162-3.508635-111.083389-2.280613-167.186465-1.122763a54.52419 54.52419 0 0 0-46.980625 28.595377c-7.999688 13.75385-11.438151 27.507699-14.876612 42.384312-4.561225 20.630775-13.718763 40.068613-16.034463 61.857237a10.525905 10.525905 0 0 0-1.122764 5.683989c-16.034462 59.646798-33.226775 117.960313-49.120891 177.501852-1.122763 3.508635-3.508635 7.01727-1.122764 9.157538 2.280613 3.508635 6.841839 1.15785 10.280301 0a623.554637 623.554637 0 0 1 66.418464-13.718763 761.163308 761.163308 0 0 1 191.255702-5.719076 408.334958 408.334958 0 0 1 73.295387 12.596c19.472925 7.999688 40.068613 11.438151 60.664302 17.157226 26.34985 8.034775 51.54185 18.315076 77.8917 27.5077 11.438151 5.719075 24.034151 11.438151 35.472301 17.157226a787.337726 787.337726 0 0 1 84.768625 50.384c4.561225 3.508635 9.157538 9.157538 13.718764 11.473237 12.596 7.01727 22.911388 15.999376 34.349538 24.034151a49.120892 49.120892 0 0 1 19.472925 14.876613c5.719075 8.034775 13.75385 13.75385 20.630775 20.595688s14.876613 12.631087 20.595688 20.630775c5.719075 7.01727 13.75385 13.75385 20.630774 20.595688s7.01727 16.069549 16.034463 20.630775c7.01727 4.561225 10.280301 12.596 16.034462 18.315075 2.280613 2.280613 4.561225 3.508635 5.719076 5.754162 1.122763 3.508635 3.508635 5.719075 4.561225 9.157538 13.75385 16.034462 24.069237 35.472301 36.665237 53.787376 10.280301 14.911699 16.034462 30.946162 26.314765 44.700012 1.15785 3.508635 0 7.01727 2.315699 10.280301 12.596 17.192312 18.315076 37.788 26.314763 57.260925 3.508635 7.01727 1.15785 9.157538-5.719075 9.157538-7.999688 1.15785-16.034462 2.280613-21.753538-4.596312-1.15785-2.280613-3.508635-2.280613-5.719076-2.280613a14.455577 14.455577 0 0 1-14.876612-7.999688c-8.034775-13.75385-25.227087-21.753538-28.630464-38.94585h-1.157849c-8.034775 3.508635-11.438151-3.508635-14.876613-7.999688a670.149312 670.149312 0 0 0-67.576313-60.699388 702.112978 702.112978 0 0 0-59.646797-42.384313c-26.34985-16.034462-50.384-33.191689-79.014463-44.629838-1.15785-1.15785-2.280613-2.315699-2.280614-3.508636 0-3.508635-2.315699-2.315699-4.596311-2.315699a16.104635 16.104635 0 0 1-7.01727-2.280613c-30.911076-18.315076-65.260614-30.911076-98.452303-42.384312-46.980625-17.157226-97.364625-27.472613-146.590775-34.349538a478.472574 478.472574 0 0 0-69.856926-5.719076c-56.138162 0-111.083389-2.280613-167.186465 8.034775a1064.660247 1064.660247 0 0 0-116.802464 26.314764 8.385638 8.385638 0 0 0-7.01727 8.034774 125.679311 125.679311 0 0 1-8.034775 29.753226c-11.438151 37.788-15.999376 77.856614-36.630151 113.364001-1.15785 1.15785-2.280613 1.15785-4.596311 1.15785a1.122763 1.122763 0 0 1-1.122763-1.15785v2.315699c-8.034775 10.315387-20.630775 14.876613-33.191689 17.157227-14.911699 3.508635-19.472925-1.122763-17.192313-14.876614 4.596312-35.507388 7.999688-72.137538 13.718765-108.767689 1.15785-2.280613 2.315699-5.719075-1.122764-6.841839a7.227788 7.227788 0 0 0-7.017271 0c-16.034462 9.157538-30.911076 17.157226-46.945538 25.192-21.753538 10.280301-41.226463 24.034151-60.699388 36.630152-9.157538 4.596312-16.034462 11.438151-24.03415 17.157225a581.661533 581.661533 0 0 0-76.733851 62.980002 417.176718 417.176718 0 0 0-63.155433 64.13785A46.770107 46.770107 0 0 1 96.08378 832.877237C82.365016 832.877237 78.926554 828.280925 84.645629 815.684924z" horiz-adv-x="1525" />
<glyph glyph-name="aliyun" unicode="&#58881;" d="M991.142857 521.25c-0.321428 87.964285-71.678572 159.214285-159.75 159.214285H580.464285l23.142858-91.285713 215.357142-46.821429a45.621428 45.621428 0 0 0 35.25-42.535715c0.107143-0.535715 0.107143-231.535715 0-232.071428a45.621428 45.621428 0 0 0-35.25-42.535715l-215.357142-46.821428-23.142858-91.392857h250.928572c87.964285 0 159.428572 71.25 159.75 159.214285V521.25zM205.035715 225a45.621428 45.621428 0 0 0-35.25 42.535715c-0.107143 0.642857-0.107143 231.535715 0 232.071428 0.857143 20.785715 15.642857 38.035715 35.25 42.535714l215.357142 46.821428 23.142858 91.285715H192.5c-87.964285 0-159.428572-71.142857-159.75-159.214285V245.785715c0.321428-87.964285 71.785715-159.214285 159.75-159.214287H443.428572l-23.142857 91.392857-215.25 47.035715z m215.25 170.142857h183.214285v-22.821429h-183.214285z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -18,6 +18,7 @@ export interface UserInfoRes {
id: string | number;
username: string;
nickName: string;
avatar: string;
roleIds: number[];
}

View File

@@ -27,6 +27,12 @@ function createService() {
}
// dataAxios 是 axios 返回数据中的 data
const dataAxios = response.data;
if (response.config.unpack === false) {
//如果不需要解包
return dataAxios;
}
// 这个状态码是和后端约定的
const { code } = dataAxios;
// 根据 code 进行判断
@@ -40,10 +46,6 @@ function createService() {
case 0:
// [ 示例 ] code === 0 代表没有错误
// @ts-ignore
if (response.config.unpack === false) {
//如果不需要解包
return dataAxios;
}
return dataAxios.data;
default:
// 不是正确的 code

Some files were not shown because too many files have changed in this diff Show More