diff --git a/README.md b/README.md index 3ac0ecbc..54aab33a 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,10 @@ CertD 是一个帮助你全自动申请和部署SSL证书的工具。 ## 特性 本项目不仅支持证书申请过程自动化,还可以自动化部署证书,让你的证书永不过期。 -* 全自动申请证书 +* 全自动申请证书(支持阿里云、腾讯云、华为云注册的域名) * 全自动部署证书(目前支持服务器上传部署、阿里云、腾讯云等) -* 可与CI/DI工具结合使用 +* 支持通配符域名 +* 支持多个域名打到一个证书上 ## 免费证书申请说明 * 本项目ssl证书提供商为letencrypt diff --git a/deploy.js b/deploy.js index 71a3cef9..b4e5aec0 100644 --- a/deploy.js +++ b/deploy.js @@ -3,7 +3,8 @@ import fs from 'fs' //读取 packages/core/pipline/package.json的版本号 import { default as packageJson } from './packages/core/pipeline/package.json' assert { type: "json" }; -console.log("certdVersion", packageJson.version) +const certdVersion = packageJson.version +console.log("certdVersion",certdVersion) // 同步npmmirror的包 async function getPackages(directoryPath) { diff --git a/package.json b/package.json index b56ce3e6..99f44b80 100644 --- a/package.json +++ b/package.json @@ -11,12 +11,12 @@ "scripts": { "start": "lerna bootstrap --hoist", "i-all": "lerna link && lerna exec npm install ", - "publish": "npm run proxy && npm run prepublishOnly1 && lerna publish --conventional-commits && npm run afterpublishOnly && npm run deploy", + "publish": "npm run proxy && npm run prepublishOnly1 && lerna publish --conventional-commits && npm run afterpublishOnly && node deploy.js", "afterpublishOnly": "", "proxy": "npm config set proxy=http://127.0.0.1:10809", "prepublishOnly1": "npm run before-build && lerna run build ", "before-build": "cd ./packages/core/acme-client && time /t >build.md && git add ./build.md && git commit -m \"build: prepare to build\"", - "deploy": "node deploy.js" + "deploy1": "node deploy.js" }, "license": "MIT", "dependencies": { diff --git a/packages/core/pipeline/package.json b/packages/core/pipeline/package.json index f1320edb..4df76a25 100644 --- a/packages/core/pipeline/package.json +++ b/packages/core/pipeline/package.json @@ -21,6 +21,7 @@ "node-forge": "^1.3.1", "nodemailer": "^6.9.3", "qs": "^6.11.2", + "react-native-get-random-values": "^1.9.0", "uuid": "^8.3.2" }, "devDependencies": { diff --git a/packages/core/pipeline/src/plugin/api.ts b/packages/core/pipeline/src/plugin/api.ts index 717d28e9..cbc439a4 100644 --- a/packages/core/pipeline/src/plugin/api.ts +++ b/packages/core/pipeline/src/plugin/api.ts @@ -6,6 +6,10 @@ import { IAccessService } from "../access"; import { IEmailService } from "../service"; import { IContext } from "../core"; import { AxiosInstance } from "axios"; + +//解决 uuid random-values not support 问题 +// https://github.com/uuidjs/uuid#getrandomvalues-not-supported +import "react-native-get-random-values"; import { v4 as uuidv4 } from "uuid"; export enum ContextScope { global, diff --git a/packages/ui/certd-client/src/store/modules/page.ts b/packages/ui/certd-client/src/store/modules/page.ts index 8429c086..02a508aa 100644 --- a/packages/ui/certd-client/src/store/modules/page.ts +++ b/packages/ui/certd-client/src/store/modules/page.ts @@ -21,7 +21,7 @@ interface PageState { inited: boolean; } // 判定是否需要缓存 -const isKeepAlive = (data) => get(data, "meta.cache", false); +const isKeepAlive = (data: any) => get(data, "meta.cache", false); export const usePageStore = defineStore({ id: "app.page", @@ -48,6 +48,7 @@ export const usePageStore = defineStore({ inited: false }), getters: { + // @ts-ignore getOpened() { // @ts-ignore return this.opened; @@ -91,7 +92,7 @@ export const usePageStore = defineStore({ const valid: Array = []; // 处理数据 this.opened = value - .map((opened) => { + .map((opened: any) => { // 忽略首页 if (opened.fullPath === "/index") { valid.push(1); @@ -105,7 +106,7 @@ export const usePageStore = defineStore({ // 新的数据中一般不会携带 params 和 query, 所以旧的参数会留存 return Object.assign({}, opened, find); }) - .filter((opened, index) => valid[index] === 1); + .filter((opened: any, index: any) => valid[index] === 1); // 标记已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201 this.openedLoaded = true; // 根据 opened 数据生成缓存设置 @@ -132,7 +133,7 @@ export const usePageStore = defineStore({ * @param {Object} context * @param {Object} payload { index, params, query, fullPath } 路由信息 */ - async openedUpdate({ index, params, query, fullPath }) { + async openedUpdate({ index, params, query, fullPath }: any) { // 更新页面列表某一项 const page = this.opened[index]; page.params = params || page.params; @@ -148,7 +149,7 @@ export const usePageStore = defineStore({ * @param {Object} context * @param {Object} payload { oldIndex, newIndex } 位置信息 */ - async openedSort({ oldIndex, newIndex }) { + async openedSort({ oldIndex, newIndex }: any) { // 重排页面列表某一项 const page = this.opened[oldIndex]; this.opened.splice(oldIndex, 1); @@ -162,7 +163,7 @@ export const usePageStore = defineStore({ * @param {Object} context * @param {Object} payload new tag info */ - async add({ tag, params, query, fullPath }) { + async add({ tag, params, query, fullPath }: any) { // 设置新的 tag 在新打开一个以前没打开过的页面时使用 const newTag = tag; newTag.params = params || newTag.params; @@ -183,7 +184,7 @@ export const usePageStore = defineStore({ * @param {Object} context * @param {Object} payload 从路由钩子的 to 对象上获取 { name, params, query, fullPath, meta } 路由信息 */ - async open({ name, params, query, fullPath, meta }) { + async open({ name, params, query, fullPath, meta }: any) { // 已经打开的页面 const opened = this.opened; // 判断此页面是否已经打开 并且记录位置 @@ -227,7 +228,7 @@ export const usePageStore = defineStore({ * @param {Object} context * @param {Object} payload { tagName: 要关闭的标签名字 } */ - async close({ tagName }) { + async close({ tagName }: any) { // 预定下个新页面 let newPage = {}; const isCurrent = this.current === tagName; @@ -267,7 +268,7 @@ export const usePageStore = defineStore({ */ async closeLeft(opts = {}) { await this.closeByCondition({ - condition({ i, currentIndex }) { + condition({ i, currentIndex }: any) { return i >= currentIndex; }, ...opts @@ -280,7 +281,7 @@ export const usePageStore = defineStore({ */ async closeRight(opts = {}) { await this.closeByCondition({ - condition({ i, currentIndex }) { + condition({ i, currentIndex }: any) { return currentIndex >= i; }, ...opts @@ -321,7 +322,7 @@ export const usePageStore = defineStore({ */ async closeOther(opts = {}) { await this.closeByCondition({ - condition({ i, currentIndex }) { + condition({ i, currentIndex }: any) { return currentIndex === i; }, ...opts @@ -364,7 +365,7 @@ export const usePageStore = defineStore({ * @param {Object} state state * @param {String} name name */ - keepAliveRemove(name) { + keepAliveRemove(name: any) { const list = cloneDeep(this.keepAlive); const index = list.findIndex((item) => item === name); if (index !== -1) { @@ -377,7 +378,7 @@ export const usePageStore = defineStore({ * @param {Object} state state * @param {String} name name */ - keepAlivePush(name) { + keepAlivePush(name: any) { const keep = cloneDeep(this.keepAlive); keep.push(name); this.keepAlive = uniq(keep); @@ -395,7 +396,7 @@ export const usePageStore = defineStore({ * @param {Object} state state * @param {String} fullPath new fullPath */ - currentSet(fullPath) { + currentSet(fullPath: any) { this.current = fullPath; }, /** @@ -404,7 +405,7 @@ export const usePageStore = defineStore({ * @param {Object} state state * @param {Array} routes routes */ - async init(routes) { + async init(routes: any) { if (this.inited) { return; } @@ -414,9 +415,9 @@ export const usePageStore = defineStore({ routes = frameworkRoutes; } - const pool = []; - const push = function (routes) { - routes.forEach((route) => { + const pool: any = []; + const push = function (routes: any) { + routes.forEach((route: any) => { if (route.children && route.children.length > 0) { push(route.children); } else {