Skip to content
dsh.fish
Bundle

@duiba/dsh-web-enterprise

dsh enterprise plugin: local-accounts authentication, session ownership/sharing, RBAC, and the enterprise /api carrier layered over the web profile as one out-of-tree bundle

Source
Chammoon
stars
1 stars
License
MIT
Updated
Updated 4 days ago

Readme

# web-enterprise — 给你的 DeepSeek Harness 装上企业级门禁

> 一条命令,把个人版 Harness 变成多人可用的企业工作台:账号登录、权限分级、私有工作区、共享协作,全部开箱即用。

## 为什么需要它

原版 dsh 的 Web 界面默认"裸奔"——谁打开网址谁就是主人。**web-enterprise** 在不修改 dsh 源码一行的情况下,为你的部署加上完整的准入控制:

- 🚪 **认证围墙** —— 所有 `/api` 请求先过登录态校验,未认证一律 401,fail-closed 设计:认证服务不在,门就不开
- 👤 **本地账号体系** —— scrypt 加密密码、cookie 会话、优雅的登录页,首个管理员密码开箱即得(可预设,也可自动生成并打印到日志)
- 🏢 **每人一个私有工作区** —— Personal Workspace 物理隔离,你的会话你的数据,别人看不见也摸不着
- 🤝 **群组共享协作** —— 组命名空间的会话共享,独占写入(sole-writer)语义,协作不踩脚
- 🛡️ **精细权限(RBAC)** —— 管理员/普通用户/自定义角色,从"谁能看哪个会话"到"谁能进管理后台",粒度随心
- ⚙️ **企业管理后台** —— 设置页新增"企业管理"专区:账户与安全、群组会话、管理后台,改密码、踢会话、管用户,全在浏览器里点几下
- 🔌 **零侵入安装** —— 不改配置、不碰源码、不需要 npm 发布,一条命令装上,一条命令卸掉
- 🔄 **自动跟随 dsh 版本** —— 运行时直接复用你已安装的 dsh 代码,dsh 升级插件自动适配,永不出现双副本冲突

## 安装(一条命令)

```bash
dsh plugin --profile web add github:Chammoon/web-enterprise
```

重启 `dsh web` 即生效。首次启动前设置管理员密码(可选,不设则自动生成并打印到日志):

```bash
export DSH_BOOTSTRAP_ADMIN_PASSWORD=你的管理员密码
dsh web   # 引导账号为 admin
```

## 卸载 / 更新

```bash
dsh plugin --profile web remove @duiba/dsh-web-enterprise
dsh plugin --profile web update @duiba/dsh-web-enterprise
```

## 工作原理

- `cordis.patch.yml`(由 `dsh.bundle.patch` 声明)禁用原生 `/api` 载体行,插入:企业级 carrier、本地账号、enterprise remotes、企业 UI、会话访问控制,以及一个供浏览器 roster 扫描发现客户端包的根行
- Host 半边通过 `./host/*` 子路径导出挂载;三个浏览器半边(carrier / remotes / UI)合并为单一客户端包 `lib/client.js`,在页面模块表中注册后按 carrier → remotes → UI 顺序挂载
- `@deepseek-ai/*` 依赖在运行时通过 dsh 安装自身的符号链接解析(`~/.dsh/profiles/node_modules`),因此插件始终与你运行中的 dsh 版本一致;仅 `ws` 与 `zod` 来自 npm
- `lib/` 预构建产物直接入库,安装时无构建步骤,也不触发 pnpm 的构建脚本白名单

## 重新构建

`lib/` 为预构建产物。修改 `src/` 后,需在仍保留 enterprise 包的 dsh monorepo 检出中构建(`tsc -b` + 各包的 `tsdown` 双面构建),再拷回:各包 `lib/index.js` → `lib/host/*.js`,`packages/core/{auth,session-access}/lib/index.js` → `lib/core/*.js`,三个 client bundle 拼接加合成入口 → `lib/client.js`(见其尾部注释)。

## English Summary

Out-of-tree DeepSeek Harness plugin: enterprise admission control (local accounts, per-user Personal Workspace, group sharing, RBAC, admin console) layered over the `web` profile. One-command install (`dsh plugin --profile web add github:Chammoon/web-enterprise`), zero intrusion, no npm publish required; `@deepseek-ai/*` imports resolve against the running dsh installation at runtime.

Install

dsh plugin --profile web add github:Chammoon/dsh-web-enterprise

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source