Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

麻烦提供屏蔽 @alifd/fusion-collector 这个组件收集数据的功能 #2987

Closed
xqin opened this issue Dec 25, 2019 · 4 comments
Closed
Assignees

Comments

@xqin
Copy link

xqin commented Dec 25, 2019

麻烦提供屏蔽 @alifd/fusion-collector 这个组件收集数据的功能

  1. 这个数据收集涉及到自己项目的隐私问题.
  2. 这个数据收集, 在CI环境下(无外网访问权限), 会导致build过程变慢, 影响构建速度.
    image

理想情况下, 请提供可以配置特定环境变量, 从而屏蔽这个数据收集工作.

伪代码

if (porcess.env.BLOCK_FUSION_COLLECTOR) {
   return;
}
// 后面为正常的数据收集流程
@xqin
Copy link
Author

xqin commented Dec 25, 2019

刚发现 还有这个功能 node_modules/ice-scripts/lib/utils/goldlog.js, 希望也能一起屏蔽掉.

ice-scripts@1.10.2
应该最新版本也有这个功能: https://github.com/ice-lab/ice-scripts/blob/master/packages/ice-scripts/lib/utils/goldlog.js

自动化构建环境下, 不希望有这些数据收集 要发往 外网的功能.

image

image

@xqin
Copy link
Author

xqin commented Dec 26, 2019

鉴于官方没反应, 我分享一下我这里的, 临时的解决方案:

package.json

"scripts": {
   "postinstall": "./block.sh"
}

block.sh

#!/bin/bash

goldlog=./node_modules/ice-scripts/lib/utils/goldlog.js

if [ -f "$goldlog" ]; then
  # 屏蔽 ice-scripts 上报日志的功能
  echo 'module.exports=function(){}' > $goldlog
fi

retcodelog=./node_modules/@alifd/fusion-collector/lib/retcodelog/src/core.js

if [ -f "$retcodelog" ]; then
  # 屏蔽 fusion-collector 上报数据的功能
  sed -i -e 's/var sendRequest = conf.sendRequest/var sendRequest = function(){}/' $retcodelog
fi

利用 postinstall 的 hook, 将上报日志的代码屏蔽掉.

@imsobear
Copy link
Collaborator

@xqin OK,这个功能会提供,具体方案我们先讨论下哈

@ClarkXia
Copy link
Collaborator

ice-scripts@2.1.16 通过 DISABLE_COLLECT=true ice-scripts build 的方式禁止

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants