CH-J Server ManagerSSH를 통한 서버 관리
메뉴
공개된 소스

CH-J Server Manager

특정 애플리케이션 릴리스의 디렉터리와 파일을 살펴보세요.

소스 ZIP 다운로드
CH-J / Server Manager 377 개 파일
core-20261019T111616Z-160a00bfcddc 추가됨: · 빌드됨:
vaultLockController.js 추가됨: 날짜 기록 없음 1.8 KB · 31 줄
코드 파일 다운로드
1"use strict";
2const { EventEmitter } = require("node:events");
3class VaultLockController extends EventEmitter {
4 constructor({ vaultStore, configStore, biometricService, sessionManager, pluginRuntime, diagnosticsService, now = Date.now, pollMs = 5000 }) {
5 super(); Object.assign(this, { vaultStore, configStore, biometricService, sessionManager, pluginRuntime, diagnosticsService, now });
6 this.lastActivity = now(); this.locking = null;
7 this.timer = setInterval(() => { void this.check().catch(() => {}); }, pollMs); this.timer.unref?.();
8 }
9 activity() { this.lastActivity = this.now(); }
10 async check() {
11 const config = this.configStore.get().security;
12 if (config.autoLockMinutes > 0 && this.vaultStore.status().unlocked && this.now() - this.lastActivity >= config.autoLockMinutes * 60000) await this.lock("inactivity");
13 }
14 async lostFocus() { if (this.configStore.get().security.lockOnBlur && this.vaultStore.status().unlocked) await this.lock("focus-loss"); }
15 async lock(reason = "manual") {
16 if (this.locking) return this.locking;
17 this.biometricService.cancel();
18 // After an automatic lock the next return to the window may prompt again; a manual lock does not.
19 if (reason !== "manual") this.biometricService.armAutoUnlock?.();
20 // Clear the key synchronously, before waiting for potentially slow SSH cleanup.
21 const status = this.vaultStore.lock();
22 this.locking = (async () => {
23 try { this.pluginRuntime.closeAll(); this.diagnosticsService?.stopAll(); await this.sessionManager.disconnectAll("vault-" + reason); }
24 finally { this.emit("locked", { ...status, reason }); }
25 return status;
26 })();
27 try { return await this.locking; } finally { this.locking = null; }
28 }
29 dispose() { clearInterval(this.timer); this.biometricService.cancel(); }
31module.exports = { VaultLockController };
SHA-2563bf7b2e09dd1af7ad3a7f893f56fe6bb4c8e6d047fc285c7e80f68c9a706c96a

CH-J Proprietary Software License 1.14 · 소스는 CH-J Proprietary Software License 1.14에 따라 제공됩니다. 소스를 공개한다고 해서 라이선스 조항이 바뀌거나 추가 권리가 부여되지는 않습니다.

압축 파일 SHA-256a9605c0870a223b6a8542bb0705edd51d8b04f3069582653417a8397fabcc09a
파일