fix: DATA_DIR改回.gatekeeper保持密钥兼容,log文件名改为gatekeeper.log

This commit is contained in:
bingshuo 2026-05-30 18:23:31 +08:00
parent caf5701573
commit 498cb42596

View File

@ -7,7 +7,7 @@
const http=require('http'),fs=require('fs'),path=require('path'),crypto=require('crypto'),{exec}=require('child_process'),os=require('os');
const PORT=parseInt(process.env.GATEKEEPER_PORT||process.argv[2]||'3910',10);
const DATA_DIR=path.join(os.homedir(),'.gk');
const DATA_DIR=path.join(os.homedir(),'.gatekeeper');
const CMD_TIMEOUT=30000,MAX_OUTPUT=100000,RATE_LIMIT=60;
if(!fs.existsSync(DATA_DIR))fs.mkdirSync(DATA_DIR,{recursive:true,mode:0o700});
@ -37,7 +37,7 @@ function log(level,action,detail){
const ts=new Date().toISOString();
const line='['+ts+'] ['+level+'] '+action+(detail?' | '+detail:'');
console.log(line);
try{const lf=path.join(DATA_DIR,'gk.log');fs.appendFileSync(lf,line+'\n');}catch(e){}
try{const lf=path.join(DATA_DIR,'gatekeeper.log');fs.appendFileSync(lf,line+'\n');}catch(e){}
}
const RC={};