feat: disable specific built-in feature (or change it's config)
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start by tracing the builtinDevTools configuration and the configResolved hook to find where built-in features, especially terminal, are registered. Compare that path with terminalsVite({ shell: '/usr/bin/nologin' }); done means users can keep other built-in or package devtools enabled while excluding terminal through configuration.
由索引模型根据 Issue 内容生成。
描述
Clear and concise description of the problem
Hello and thanks to everyone!
I would like to disable the terminal feature. As of today, the only way to do so is by set
devtools: {
builtinDevTools: false,
},
but this disables all the vite devtools entirely (even the ones from @vitejs/devtools-vite package).
I understand terminal is not active if no authentication is provided, but once it is (and I may want to open devtools for other reasons) I still feel like having it it's a security hole that must be closed. (such terminal is capable of doing too much thing, everything actually - install packages, sudo, reading envs and .bash_history as well as ssh into other machines).
I understand every hole I described can be done in many different way just with a bad package, but at least I would not like to have a terminal in my browser window and potentially accessibile in the network.
I tried to write a custom plugin that hook into the configResolved function to intercept the configuration, but I only managed to entirely disable the tools and I could not manage to reach the configuration.
Suggested solution
From a config perspective, it may be done in different ways, the one I prefer is something like
devtools: {
builtinDevTools: true,
excludeBuiltIn: ['terminal']
},
Alternative
Another way can be to override that specific plugin configuration
import { terminalsVite } from '@devframes/plugin-terminals/vite'
//...
plugins: [
...terminalsVite({
shell: '/usr/bin/nologin'
}),
]
Additional context
I never went that deep into vite: I never needed that (and that thanks to your awesome work, btw!), so I don't know that much of vite internal structure, but if the leading team decides this can be a feature, I can get my hands on it and try to prepare a PR (I feel like it's a small if somewhere, just I don't know where this "somewhere" is)
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 92
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 14
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vitejs/devtools 的其他 Issue
-
`vite build` starts one standalone DevTools server per build environment可能已有人在做 @RaphaelFakhri 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复
-
Compare module sizes between build sessions可能已有人在做 @webfansplz 于 16 天前认领。 未关闭enhancement
vitejs/devtools#601 · 已指派 1 人 ·
维护者通常 3 天内回复
-
feat(oxc): add rule timing stats to the lint inspector可能重新可做 @yuyinws 于 30 天前认领,目前没有进行中的 PR。 未关闭enhancement
vitejs/devtools#584 · 已指派 1 人 ·
维护者通常 3 天内回复
-
pending triage
难度 3/5 1-2 天 新手友好度 58/100
维护者通常 3 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
ccch1mneyyy/dsh-TUI#1631 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
MiniMax-AI/minimax-code#507 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
Transient OAuth login failure persists in getLoginStatus and masks active account in dashboard可能重新可做 关联的 PR 已关闭且未合并。 未关闭account-pool bug gui
难度 2/5 1-3 小时 新手友好度 67/100
lidge-jun/opencodex#7378 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复