fix: 修复群晖测试时报addSecret undefine错误

This commit is contained in:
xiaojunnuo
2026-03-16 22:51:09 +08:00
parent 0b9933df1e
commit 5eb4aa3a0e
15 changed files with 31 additions and 16 deletions

10
.vscode/launch.json vendored
View File

@@ -79,5 +79,15 @@
"PLUS_SERVER_BASE_URL": "http://127.0.0.1:11007" "PLUS_SERVER_BASE_URL": "http://127.0.0.1:11007"
} }
} }
],
"compounds": [
{
"name": "all",
"configurations": [
"server",
"client",
],
"stopAll": false
},
] ]
} }

View File

@@ -19,6 +19,7 @@ export function resetLogConfigure() {
} }
resetLogConfigure(); resetLogConfigure();
export const logger: ILogger = log4js.getLogger("default") as any; export const logger: ILogger = log4js.getLogger("default") as any;
logger.addSecret = (secret: string) => {};
export function resetLogFilePath(filePath: string) { export function resetLogFilePath(filePath: string) {
logFilePath = filePath; logFilePath = filePath;
@@ -106,8 +107,8 @@ export class PipelineLogger implements ILogger {
logger: ILogger; logger: ILogger;
customWriter!: (text: string) => void; customWriter!: (text: string) => void;
constructor(name: string, write: (text: string) => void) { constructor(name: string, write?: (text: string) => void) {
this.customWriter = write; this.customWriter = write || (() => {});
//@ts-ignore //@ts-ignore
this.logger = log4js.getLogger(name); this.logger = log4js.getLogger(name);
} }

View File

@@ -90,7 +90,6 @@ const getPluginType: any = inject("get:plugin:type", () => {
return "plugin"; return "plugin";
}); });
debugger;
const searchKeyRef = ref(""); const searchKeyRef = ref("");
const optionsRef = ref([]); const optionsRef = ref([]);
const message = ref(""); const message = ref("");

View File

@@ -308,7 +308,6 @@ async function doRegisterPasskey(deviceName: string) {
}, },
}; };
console.log("credential", credential, response); console.log("credential", credential, response);
debugger;
const verifyRes: any = await api.verifyPasskeyRegistration(response, options.challenge, deviceName); const verifyRes: any = await api.verifyPasskeyRegistration(response, options.challenge, deviceName);
await loadPasskeys(); await loadPasskeys();

View File

@@ -115,7 +115,7 @@ export function useCertPipelineCreator() {
label: "name", label: "name",
}); });
const DEFAULT_RENEW_DAYS = settingStore.sysPublic.defaultCertRenewDays || settingStore.sysPublic.defaultWillExpireDays || 15; const DEFAULT_RENEW_DAYS = settingStore.sysPublic.defaultCertRenewDays || settingStore.sysPublic.defaultWillExpireDays || 20;
merge(inputs, { merge(inputs, {
renewDays: { renewDays: {
@@ -347,7 +347,7 @@ export function useCertPipelineCreator() {
title: "申请证书", title: "申请证书",
runnableType: "step", runnableType: "step",
input: { input: {
renewDays: 15, renewDays: 20,
...pluginInput, ...pluginInput,
}, },
strategy: { strategy: {

View File

@@ -30,12 +30,13 @@ const pipelineOptions: PipelineOptions = {
return { return {
pipeline: { pipeline: {
id: detail.pipeline.id, id: detail.pipeline.id,
userId: detail.pipeline.userId,
stages: [], stages: [],
triggers: [], triggers: [],
...JSON.parse(detail.pipeline.content || "{}"), ...JSON.parse(detail.pipeline.content || "{}"),
type: detail.pipeline.type, type: detail.pipeline.type,
from: detail.pipeline.from, from: detail.pipeline.from,
userId: detail.pipeline.userId,
projectId: detail.pipeline.projectId,
}, },
validTime: detail.pipeline.validTime, validTime: detail.pipeline.validTime,
webhookKey: detail.pipeline.webhookKey, webhookKey: detail.pipeline.webhookKey,

View File

@@ -3,7 +3,7 @@ default:
strategy: strategy:
runStrategy: 0 runStrategy: 0
input: input:
renewDays: 15 renewDays: 20
forceUpdate: false forceUpdate: false
name: CertApply name: CertApply
title: 证书申请JS版 title: 证书申请JS版

View File

@@ -3,7 +3,7 @@ default:
strategy: strategy:
runStrategy: 0 runStrategy: 0
input: input:
renewDays: 15 renewDays: 20
forceUpdate: false forceUpdate: false
name: CertApplyLego name: CertApplyLego
icon: ph:certificate icon: ph:certificate

View File

@@ -41,7 +41,7 @@ export class HandleController extends BaseController {
if (body.record.id > 0) { if (body.record.id > 0) {
const oldEntity = await this.accessService.info(body.record.id); const oldEntity = await this.accessService.info(body.record.id);
if (oldEntity) { if (oldEntity) {
if (oldEntity.userId !== this.getUserId()) { if (oldEntity.userId !== userId) {
throw new Error('access not found'); throw new Error('access not found');
} }
if (oldEntity.projectId && oldEntity.projectId !== projectId) { if (oldEntity.projectId && oldEntity.projectId !== projectId) {

View File

@@ -33,7 +33,7 @@ const pipelineExample = `
"title": "申请证书", // 步骤标题 "title": "申请证书", // 步骤标题
"runnableType": "step", // 类型标识 "runnableType": "step", // 类型标识
"input": { //输入参数 根据插件的配置有不同的参数具体参数建议通过浏览器F12进行查看 "input": { //输入参数 根据插件的配置有不同的参数具体参数建议通过浏览器F12进行查看
"renewDays": 15, "renewDays": 20,
}, },
"strategy": { // 策略 "strategy": { // 策略
"runStrategy": 0 // 运行策略0正常执行1成功后跳过 "runStrategy": 0 // 运行策略0正常执行1成功后跳过

View File

@@ -28,7 +28,7 @@ export class UserSiteMonitorSetting extends BaseSettings {
cron?:string = undefined; cron?:string = undefined;
retryTimes?:number = 3; retryTimes?:number = 3;
dnsServer?:string[] = undefined; dnsServer?:string[] = undefined;
certValidDays?:number = 10; certValidDays?:number = 14;
} }
export class UserEmailSetting extends BaseSettings { export class UserEmailSetting extends BaseSettings {

View File

@@ -648,6 +648,11 @@ export class PipelineService extends BaseService<PipelineEntity> {
pipeline.id = id; pipeline.id = id;
} }
if(entity.userId !=null){
pipeline.userId = entity.userId;
pipeline.projectId = entity.projectId;
}
if (!pipeline.stages || pipeline.stages.length === 0) { if (!pipeline.stages || pipeline.stages.length === 0) {
return; return;
} }
@@ -1285,7 +1290,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
title: "申请证书", title: "申请证书",
runnableType: "step", runnableType: "step",
input: { input: {
renewDays: 18, renewDays: 20,
domains: req.domains, domains: req.domains,
email: req.email, email: req.email,
"challengeType": "auto", "challengeType": "auto",

View File

@@ -90,7 +90,7 @@ const preferredChainMergeScript = (() => {
desc: "免费通配符域名证书申请,支持多个域名打到同一个证书上", desc: "免费通配符域名证书申请,支持多个域名打到同一个证书上",
default: { default: {
input: { input: {
renewDays: 15, renewDays: 20,
forceUpdate: false, forceUpdate: false,
}, },
strategy: { strategy: {

View File

@@ -61,7 +61,7 @@ import dayjs from "dayjs";
export class CertApplyUploadPlugin extends CertApplyBaseConvertPlugin { export class CertApplyUploadPlugin extends CertApplyBaseConvertPlugin {
@TaskInput({ @TaskInput({
title: "过期前提醒", title: "过期前提醒",
value: 10, value: 20,
component: { component: {
name: "a-input-number", name: "a-input-number",
vModel: "value", vModel: "value",

View File

@@ -16,7 +16,7 @@ import { PrivateKeyType } from "./dns.js";
desc: "支持海量DNS解析提供商推荐使用一样的免费通配符域名证书申请支持多个域名打到同一个证书上", desc: "支持海量DNS解析提供商推荐使用一样的免费通配符域名证书申请支持多个域名打到同一个证书上",
default: { default: {
input: { input: {
renewDays: 15, renewDays: 20,
forceUpdate: false, forceUpdate: false,
}, },
strategy: { strategy: {