mirror of https://github.com/certd/certd
perf: lego 升级到 4.19.2
parent
6113c388b7
commit
129bf53edc
|
@ -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}`;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
./tools/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
tools/** filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
|
|
|
@ -19,3 +19,6 @@ run/
|
|||
.clinic
|
||||
|
||||
.env.pgpl.yaml
|
||||
|
||||
tools/windows/*
|
||||
!tools/windows/*.zip
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:588e41dfbc2a5ef1596953b605ef0981f95135443a1e66db3e06e1fa2c061eab
|
||||
size 24746505
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9b91a1e4f32b3f5e55fa6e455b8a72069cd2983ec7a36d275f0aa4b0d82a0de6
|
||||
size 25579960
|
Loading…
Reference in New Issue