dsh-password-gate 网吧式挂机锁屏:一键锁定界面、空闲自动挂机、重启后首次免密登录,忘记密码也不会把自己锁死。 #2178
steamfeifei
started this conversation in
General
Replies: 3 comments
|
#1728 可以自己提PR收录 。记得互相赞赏。 来回复一下。我合并的更快。 你这个挺好。 |
0 replies
|
已收到 谢谢!!
|
0 replies
|
Indexed in the community registry ( |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
dsh-password-gate
A temporary lock (internet-cafe style) for the DSH web GUI: lock the screen with a password, optional idle auto-lock, and a free first login after every service restart.
功能特性
bootId,自动丢弃锁定标记--dsw-alias-*主题变量,自动适配亮/暗色安装
要求 DSH ≥
0.1.0-rc.6(与dsh-*ABI 及@deepseek-ai/cordis ^4.0.1对齐)。方式一:Git 仓库(推荐)
git clone https://github.com/steamfeifei/dsh-password-gate cp -r dsh-password-gate ~/.dsh/profiles/web/node_modules/方式二:npm(可选)
声明插件行
在
~/.dsh/profiles/web/cordis.patch.yml追加:生成
passwordHash:node -e "console.log(require('crypto').createHash('sha256').update('你的密码').digest('hex'))"重启 Harness(
dsh web)并刷新页面,侧边栏即出现「临时门禁」。使用
状态胶囊会显示当前配置:
已设密码 · 空闲 X 分钟自动挂机/未设置密码。配置项(
cordis.patch.yml行 config)passwordHashmaxAttempts5lockSeconds30idleMinutes0面板中的修改会持久化到
<DSH_HOME>/password-gate.json(默认~/.dsh/password-gate.json),优先于上述行配置。工作原理
lib/index.js:在 Harness 自带的 HTTP 服务上注册 JSON APIGET /__dsh/password-gate/state→{ bootId, hasPassword, idleMinutes }POST /__dsh/password-gate/verify→ 解锁校验(SHA-256 比对 + 频率限制)POST /__dsh/password-gate/change→{ next }设置/清除密码(明文不落盘)POST /__dsh/password-gate/config→{ idleMinutes }持久化挂机配置lib/client.js:通过sidebar.footer.action/shell.overlay槽位渲染侧边栏按钮、配置弹窗与锁屏;监听空闲活动触发自动挂机;依据bootId实现重启免密。<DSH_HOME>/password-gate.json,与包安装位置无关(npm/pnpm 安装的只读 store 也能正常工作)。忘记密码怎么办
重启 Harness —— 首次登录自动免密。随后打开「临时门禁」直接设置新密码即可(无需旧密码)。或删除
<DSH_HOME>/password-gate.json(并/或修改cordis.patch.yml的passwordHash)后重启。开发
回归验证(需在已安装该插件的 profile 环境执行):
node verify-password-gate.mjs # 位于本仓库工作副本旁的验证脚本浏览器端为手写 ModuleLoader 包,仅依赖 shell 提供的
reactseed;宿主端仅依赖 Node 内置模块与webServer服务。安全说明
License
MIT
All reactions