mirror of
https://github.com/certd/certd.git
synced 2026-07-26 05:37:36 +08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 18b2d3ac20 | |||
| 7d22fe3d7d | |||
| ee67b6c042 | |||
| 1cfa76683b | |||
| 4662e45e58 | |||
| 1fefbdc9ab | |||
| 1cb2a57c55 |
@@ -3,6 +3,16 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复正常批量删除流水线报权限不足的bug ([5b50083](https://github.com/certd/certd/commit/5b500830a122c6c42dab054e57fed509050f94da))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 优化动态加载依赖镜像地址,多次重试 ([5f53b81](https://github.com/certd/certd/commit/5f53b81c75dd242b4260ac08cae14c6d1a08a883))
|
||||
|
||||
## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -75,5 +75,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||
},
|
||||
"gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0"
|
||||
"gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252"
|
||||
}
|
||||
|
||||
@@ -54,5 +54,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0"
|
||||
"gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252"
|
||||
}
|
||||
|
||||
@@ -51,5 +51,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0"
|
||||
"gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252"
|
||||
}
|
||||
|
||||
@@ -571,8 +571,14 @@ export class RuntimeDepsService {
|
||||
log.info("第三方依赖安装完成");
|
||||
return { registryUrl: tryUrl, packageJsonPath };
|
||||
}
|
||||
lastError = result.stderr || result.stdout || "unknown error";
|
||||
log.warn?.(`镜像 ${tryUrl || "默认"} 安装失败${urlsToTry.length > 1 ? ",尝试下一个镜像..." : ""}`);
|
||||
const errOutput = (result.stderr || "").trim();
|
||||
const outOutput = (result.stdout || "").trim();
|
||||
lastError = errOutput || outOutput || "unknown error";
|
||||
log.info(`镜像 ${tryUrl || "默认"} 安装失败,退出码: ${result.code}${urlsToTry.length > 1 ? ",尝试下一个镜像..." : ""}`);
|
||||
log.info(` pnpm stderr: ${(errOutput || "(空)").slice(0, 2000)}`);
|
||||
if (outOutput) {
|
||||
log.info(` pnpm stdout: ${outOutput.slice(0, 2000)}`);
|
||||
}
|
||||
}
|
||||
this.writeInstallState(statePath, {
|
||||
...currentState,
|
||||
|
||||
@@ -31,5 +31,5 @@
|
||||
"prettier": "3.3.3",
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0"
|
||||
"gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252"
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0"
|
||||
"gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252"
|
||||
}
|
||||
|
||||
@@ -63,5 +63,5 @@
|
||||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0"
|
||||
"gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252"
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0"
|
||||
"gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252"
|
||||
}
|
||||
|
||||
@@ -69,5 +69,5 @@
|
||||
"typeorm": "^0.3.20",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0"
|
||||
"gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252"
|
||||
}
|
||||
|
||||
@@ -52,5 +52,5 @@
|
||||
"typeorm": "^0.3.20",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0"
|
||||
"gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252"
|
||||
}
|
||||
|
||||
@@ -93,19 +93,21 @@ export class Flyway {
|
||||
await queryRunner.commitTransaction();
|
||||
} catch (err) {
|
||||
this.logger.error(err);
|
||||
this.errorTip(err);
|
||||
await this.storeSqlExecLog(file.script, filepath, false, queryRunner);
|
||||
await queryRunner.rollbackTransaction();
|
||||
|
||||
if (err.code === "SQLITE_IOERR_WRITE") {
|
||||
this.logger.warn("SQLite数据库写入失败,可能您的操作系统版本太低,请将「certd:latest」镜像改为「certd:slim」即可。(如需指定版本可以修改成「certd:[version]-slim」)", file.script);
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
this.logger.info("[ midfly ] end-------------");
|
||||
}
|
||||
|
||||
private errorTip(err: any) {
|
||||
if (err.code === "SQLITE_IOERR_WRITE") {
|
||||
this.logger.warn("SQLite数据库写入失败,可能您的操作系统版本太低,请将「certd:latest」镜像改为「certd:slim」即可。(如需指定版本可以修改成「certd:[version]-slim」)");
|
||||
}
|
||||
}
|
||||
|
||||
private async storeSqlExecLog(filename: string, filepath: string, success: boolean, queryRunner: QueryRunner) {
|
||||
const hash = await this.getFileHash(filepath);
|
||||
//先删除
|
||||
@@ -265,6 +267,7 @@ export class Flyway {
|
||||
await queryRunner.query(sql);
|
||||
} catch (err: any) {
|
||||
this.logger.error("exec sql error : ", err.message, err);
|
||||
this.errorTip(err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0"
|
||||
"gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252"
|
||||
}
|
||||
|
||||
@@ -45,5 +45,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0"
|
||||
"gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252"
|
||||
}
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import crypto from "node:crypto";
|
||||
import { BaotaAccess } from "../access.js";
|
||||
import { HttpClient, HttpRequestConfig } from "@certd/basic";
|
||||
import { HttpClient, HttpRequestConfig, ILogger } from "@certd/basic";
|
||||
import * as querystring from "node:querystring";
|
||||
|
||||
export class BaotaClient {
|
||||
access: BaotaAccess;
|
||||
http: HttpClient;
|
||||
logger: ILogger
|
||||
|
||||
constructor(access: BaotaAccess, http: HttpClient) {
|
||||
this.access = access;
|
||||
this.http = http;
|
||||
this.logger = access.ctx.logger;
|
||||
}
|
||||
|
||||
//将以上 java代码 翻译成nodejs 代码
|
||||
|
||||
+13
-2
@@ -104,12 +104,15 @@ export class BaotaDeployWebSiteCert extends AbstractTaskPlugin {
|
||||
}
|
||||
|
||||
const lockKey = `baota-lock-${accessId}`;
|
||||
|
||||
if (this.isDockerSite) {
|
||||
this.logger.info(`当前已勾选docker站点(如果部署失败,请确认站点:${siteNames}, 是否全部为docker站点)`);
|
||||
}
|
||||
for (const site of siteNames) {
|
||||
// 加锁,防止并发部署证书, 宝塔并发部署会导致nginx的conf错乱
|
||||
await this.ctx.utils.locker.execute(lockKey, async () => {
|
||||
this.logger.info(`为站点:${site}设置证书,目前支持宝塔网站站点、docker站点`);
|
||||
try {
|
||||
if (this.isDockerSite) {
|
||||
this.logger.info(`为Docker站点:${site} 设置证书`);
|
||||
const res = await client.doRequest("/mod/docker/com/set_ssl", "", {
|
||||
site_name: site,
|
||||
key: cert.key,
|
||||
@@ -117,6 +120,7 @@ export class BaotaDeployWebSiteCert extends AbstractTaskPlugin {
|
||||
});
|
||||
this.logger.info(res?.msg);
|
||||
} else {
|
||||
this.logger.info(`为非Docker站点:${site} 设置证书`);
|
||||
const res = await client.doRequest("/site", "SetSSL", {
|
||||
type: 0,
|
||||
siteName: site,
|
||||
@@ -125,6 +129,13 @@ export class BaotaDeployWebSiteCert extends AbstractTaskPlugin {
|
||||
});
|
||||
this.logger.info(res?.msg);
|
||||
}
|
||||
} catch (e: any) {
|
||||
if (e?.message?.includes("没有服务器配置文件")) {
|
||||
this.logger.error(e.message);
|
||||
this.logger.warn(`首先请确认站点 ${site} 是否存在,如果存在,请到宝塔上手动保存一下该站点证书试试`);
|
||||
}
|
||||
throw e
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
23:35
|
||||
01:14
|
||||
|
||||
@@ -1 +1 @@
|
||||
23:54
|
||||
01:28
|
||||
|
||||
Reference in New Issue
Block a user