mirror of
https://github.com/certd/certd.git
synced 2026-07-26 22:09:04 +08:00
Compare commits
9 Commits
ed58ae3c53
...
8875e8059f
| Author | SHA1 | Date | |
|---|---|---|---|
| 8875e8059f | |||
| 6490366c68 | |||
| c278946771 | |||
| 1562d9de36 | |||
| 5bb0990abb | |||
| bfd3cacc68 | |||
| c7e1163d59 | |||
| fba7aeb71b | |||
| c66a2bd77a |
+1
-2
@@ -15,8 +15,7 @@
|
||||
"vitepress-plugin-lightbox": "^1.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "lerna bootstrap --hoist",
|
||||
"start:server": "cd ./packages/ui/certd-server && pnpm start",
|
||||
"start": "cd ./packages/ui/certd-server && pnpm start",
|
||||
"devb": "lerna run dev-build",
|
||||
"i-all": "lerna link && lerna exec npm install ",
|
||||
"publish": "pnpm run prepublishOnly2 && lerna publish --force-publish=pro/plus-core --conventional-commits && pnpm run afterpublishOnly ",
|
||||
|
||||
@@ -170,8 +170,9 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
||||
setGlobalProxy(opts);
|
||||
setGlobalHeaders(this.parseKeyValueText(privateSetting.commonHeaders));
|
||||
|
||||
dns.setDefaultResultOrder(privateSetting.dnsResultOrder as any || 'ipv4first');
|
||||
|
||||
if (privateSetting.dnsResultOrder) {
|
||||
dns.setDefaultResultOrder(privateSetting.dnsResultOrder as any);
|
||||
}
|
||||
if (privateSetting.pipelineMaxRunningCount) {
|
||||
executorQueue.setMaxRunningCount(privateSetting.pipelineMaxRunningCount);
|
||||
}
|
||||
|
||||
+28
-7
@@ -1,4 +1,4 @@
|
||||
FROM node:22-alpine3.21 AS builder
|
||||
FROM node:22-trixie-slim AS builder
|
||||
|
||||
# RUN apk add build-base
|
||||
# RUN wget -O - https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 | tar -xj && \
|
||||
@@ -25,7 +25,7 @@ RUN cd /workspace/certd-server && pnpm install && npm run build-on-docker
|
||||
# npm run build-on-docker
|
||||
|
||||
|
||||
FROM node:22-alpine3.21
|
||||
FROM node:22-trixie-slim
|
||||
EXPOSE 7001
|
||||
EXPOSE 7002
|
||||
|
||||
@@ -34,14 +34,32 @@ EXPOSE 7002
|
||||
# ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so.2
|
||||
|
||||
|
||||
RUN apk add --no-cache openssl
|
||||
RUN apk add --no-cache openjdk8
|
||||
# RUN apk add --no-cache openssl
|
||||
# RUN apk add --no-cache openjdk8
|
||||
# RUN apk add --no-cache gcompat
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
gnupg \
|
||||
wget \
|
||||
openssl \
|
||||
netcat-openbsd \
|
||||
iputils-ping \
|
||||
dnsutils \
|
||||
iproute2 \
|
||||
ncurses-base \
|
||||
&& wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /usr/share/keyrings/adoptium.gpg > /dev/null \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/adoptium.gpg] https://packages.adoptium.net/artifactory/deb bookworm main" | tee /etc/apt/sources.list.d/adoptium.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends temurin-8-jre \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
WORKDIR /app/
|
||||
COPY --from=builder /workspace/certd-server/ /app/
|
||||
|
||||
COPY ./patch/ssh2/*.js /app/node_modules/.pnpm/node_modules/ssh2/lib/protocol/
|
||||
|
||||
ENV TERM xterm
|
||||
ENV LEGO_VERSION=4.30.1
|
||||
ENV LEGO_DOWNLOAD_DIR=/app/tools/lego
|
||||
|
||||
@@ -63,6 +81,9 @@ RUN ARCH=$(uname -m) && \
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV NODE_ENV=production
|
||||
ENV MIDWAY_SERVER_ENV=production
|
||||
|
||||
COPY --from=builder /workspace/certd-server/ /app/
|
||||
COPY ./patch/ssh2/*.js /app/node_modules/.pnpm/node_modules/ssh2/lib/protocol/
|
||||
CMD ["node", "--optimize-for-size", "./bootstrap.js"]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import assert from "assert";
|
||||
import esmock from "esmock";
|
||||
|
||||
describe("NetTestService.telnet", () => {
|
||||
it("treats nc succeeded output as a successful port connection", async () => {
|
||||
const { NetTestService } = await esmock("./nettest-service.js", {
|
||||
"@certd/basic": {
|
||||
http: {},
|
||||
logger: {
|
||||
error() {},
|
||||
},
|
||||
utils: {
|
||||
sp: {
|
||||
async spawn() {
|
||||
return "Connection to baidu.com (110.242.74.102) 443 port [tcp/*] succeeded!";
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
const service = new NetTestService();
|
||||
(service as any).isWindows = () => false;
|
||||
|
||||
const result = await service.telnet("baidu.com", 443);
|
||||
|
||||
assert.equal(result.success, true);
|
||||
assert.equal(result.message, "端口连接测试成功");
|
||||
});
|
||||
});
|
||||
@@ -40,7 +40,11 @@ export class NetTestService {
|
||||
});
|
||||
|
||||
// 判断测试是否成功
|
||||
const success = this.isWindows() ? output.includes("端口连接成功") : output.includes(" open");
|
||||
const normalizedOutput = output.toLowerCase();
|
||||
const success = this.isWindows()
|
||||
? normalizedOutput.includes("端口连接成功")
|
||||
: normalizedOutput.includes("succeeded!") || normalizedOutput.includes("connected to") || normalizedOutput.includes(" open");
|
||||
|
||||
|
||||
// 处理结果
|
||||
return {
|
||||
|
||||
@@ -138,7 +138,7 @@ export class AcmeAccountAccess extends BaseAccess {
|
||||
eabHmacKey = "";
|
||||
|
||||
@AccessInput({
|
||||
title: "ACME账号信息",
|
||||
title: "生成ACME账号",
|
||||
component: {
|
||||
name: "refresh-input",
|
||||
action: "GenerateAccount",
|
||||
@@ -149,7 +149,7 @@ export class AcmeAccountAccess extends BaseAccess {
|
||||
},
|
||||
col: { span: 24 },
|
||||
required: true,
|
||||
helper: "请生成ACME账号,账号一旦生成不允许修改",
|
||||
helper: "请点击右边按钮生成ACME账号,账号一旦生成不允许修改",
|
||||
encrypt: true,
|
||||
mergeScript: `
|
||||
return {
|
||||
|
||||
@@ -377,7 +377,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||
type: "acmeAccount",
|
||||
},
|
||||
required: false,
|
||||
helper: "请选择颁发机构对应的ACME账号",
|
||||
helper: "直接本地生成,无需外部注册\n点击选择按钮->添加->填写邮箱->生成账号即可",
|
||||
mergeScript: `
|
||||
return {
|
||||
show: ctx.compute(({form})=>{
|
||||
|
||||
Reference in New Issue
Block a user