chore: 暂时移除jks

pull/229/head
xiaojunnuo 2024-10-30 10:24:53 +08:00
parent b1cc6f2a9c
commit d35ad50254
5 changed files with 25 additions and 22 deletions

View File

@ -48,14 +48,15 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
email!: string;
@TaskInput({
title: "证书密码",
title: "PFX证书密码",
component: {
name: "input-password",
vModel: "value",
},
required: false,
order: 100,
helper: "PFX、jks格式证书是否加密jks必须设置密码不传则默认123456",
// helper: "PFX、jks格式证书是否加密jks必须设置密码不传则默认123456",
helper: "PFX证书是否加密",
})
pfxPassword!: string;
@ -150,7 +151,7 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
}
this._result.pipelinePrivateVars.cert = cert;
if (cert.pfx == null || cert.der == null || cert.jks == null) {
if (cert.pfx == null || cert.der == null) {
try {
const converter = new CertConverter({ logger: this.logger });
const res = await converter.convert({
@ -161,22 +162,24 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
const pfxBuffer = fs.readFileSync(res.pfxPath);
cert.pfx = pfxBuffer.toString("base64");
fs.unlinkSync(res.pfxPath);
isNew = true;
}
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);
}

View File

@ -30,7 +30,7 @@ export class CertConverter {
// 转der
derPath = await this.convertDer(ctx);
jksPath = await this.convertJks(ctx, pfxPath, opts.pfxPassword);
// jksPath = await this.convertJks(ctx, pfxPath, opts.pfxPassword);
};
await certReader.readCertFile({ logger: this.logger, handle });

View File

@ -13,7 +13,7 @@ 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
RUN #apk add --no-cache openjdk11-jdk
WORKDIR /app/
COPY --from=builder /workspace/certd-server/ /app/
RUN chmod +x /app/tools/linux/*

View File

@ -67,14 +67,14 @@ export class CopyCertToLocalPlugin extends AbstractTaskPlugin {
})
derPath!: string;
@TaskInput({
title: 'jks证书保存路径',
helper: '用于java路径要包含文件名例如tmp/cert.jks',
component: {
placeholder: 'tmp/cert.jks',
},
rules: [{ type: 'filepath' }],
})
// @TaskInput({
// title: 'jks证书保存路径',
// helper: '用于java路径要包含文件名例如tmp/cert.jks',
// component: {
// placeholder: 'tmp/cert.jks',
// },
// rules: [{ type: 'filepath' }],
// })
jksPath!: string;
@TaskInput({

View File

@ -67,14 +67,14 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
})
derPath!: string;
@TaskInput({
title: 'jks证书保存路径',
helper: '需要有写入权限,路径要包含证书文件名,例如:/tmp/cert.jks',
component: {
placeholder: '/root/deploy/nginx/cert.jks',
},
rules: [{ type: 'filepath' }],
})
// @TaskInput({
// title: 'jks证书保存路径',
// helper: '需要有写入权限,路径要包含证书文件名,例如:/tmp/cert.jks',
// component: {
// placeholder: '/root/deploy/nginx/cert.jks',
// },
// rules: [{ type: 'filepath' }],
// })
jksPath!: string;
@TaskInput({