feat: add structured logging, process watchdog, and systemd hardening
- Add lib/logger.js: timestamped structured logging with 5MB x 5 file rotation - Add lib/watchdog.js: generic child process supervisor with rate-limited restarts - Enhance client.js: WS ping/pong liveness detection, uncaughtException/unhandledRejection handlers, systemd sd-notify integration - Refactor frpc.js: FrpcManager now delegates to Watchdog instead of manual spawn/exit - Enhance install.sh: environment file, log directory, systemd resource limits, security hardening, WatchdogSec=60 - Replace all console.log/warn/error with structured logger across modules Made-with: Cursor
This commit is contained in:
@@ -104,7 +104,8 @@ function getPersistentUUID() {
|
||||
fs.writeFileSync(PERSIST_FILE, id, 'utf8');
|
||||
} catch (e) {
|
||||
// 写不进去也没关系,本次用内存值(重启后会变,但这是最后兜底)
|
||||
console.warn('[fingerprint] 无法持久化 box_id:', e.message);
|
||||
const log = require('./logger');
|
||||
log.warn('fingerprint', '无法持久化 box_id:', e.message);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user