refactor(core): ♻️ 移除 brew 脚本中的 sudo 密码注入并重构代码
移除 Homebrew 升级脚本中硬编码的 sudo 密码处理逻辑,改为依赖用户预先认证(sudo -v),提高安全性并简化 PTY 转发逻辑。同步更新文档说明及 sntp 脚本的类型校验。 - 脚本: 移除 SUDO_PWD 相关变量及自动注入逻辑,升级版本至 v5.3 - 文档: 更新 README 建议使用 sudo -v 刷新凭据,重写交互说明 - 工具: 在 sntp-rename.js 中增加对非字符串名称的防御性校验
This commit is contained in:
@@ -56,6 +56,7 @@ function operator(proxies) {
|
||||
// 3. 执行节点遍历与注入
|
||||
return proxies.map(p => {
|
||||
const name = p.name;
|
||||
if (typeof name !== 'string') return p;
|
||||
|
||||
// A. 单次复合正则扫描提取
|
||||
const match = name.match(featureRegex);
|
||||
@@ -83,4 +84,4 @@ function operator(proxies) {
|
||||
|
||||
return p;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user