perf: lego 升级到 4.19.2

pull/243/head
xiaojunnuo 2024-10-30 16:12:08 +08:00
parent 6113c388b7
commit 129bf53edc
8 changed files with 34 additions and 1 deletions

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 };
@ -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

@ -16,7 +16,9 @@ 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
RUN chmod +x /app/tools/linux/*
ENV TZ=Asia/Shanghai
ENV NODE_ENV=production
ENV MIDWAY_SERVER_ENV=production

View File

@ -1 +1,2 @@
./tools/**/* filter=lfs diff=lfs merge=lfs -text
tools/** filter=lfs diff=lfs merge=lfs -text

View File

@ -19,3 +19,6 @@ run/
.clinic
.env.pgpl.yaml
tools/windows/*
!tools/windows/*.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:588e41dfbc2a5ef1596953b605ef0981f95135443a1e66db3e06e1fa2c061eab
size 24746505

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9b91a1e4f32b3f5e55fa6e455b8a72069cd2983ec7a36d275f0aa4b0d82a0de6
size 25579960