浏览代码

check parent domains of fqdn for hideStats flag. add some exceptions to block data

tags/v1.0.4
Jonathan Cobb 4 年前
父节点
当前提交
2744f8cdbf
共有 3 个文件被更改,包括 28 次插入3 次删除
  1. +8
    -2
      bubble-server/src/main/java/bubble/service/cloud/StandardDeviceIdService.java
  2. +18
    -0
      bubble-server/src/main/resources/models/apps/bubble_block/bubbleApp_bubbleBlock_data.json
  3. +2
    -1
      bubble-server/src/main/resources/models/manifest-app-bubble-block.json

+ 8
- 2
bubble-server/src/main/java/bubble/service/cloud/StandardDeviceIdService.java 查看文件

@@ -181,8 +181,14 @@ public class StandardDeviceIdService implements DeviceIdService {

@Override public Boolean doShowBlockStatsForIpAndFqdn(String ip, String fqdn) {
if (!configuration.showBlockStatsSupported()) return false;
final String val = redis.get_plaintext(REDIS_KEY_DEVICE_SHOW_BLOCK_STATS + ip + ":" + fqdn);
return val == null ? null : Boolean.parseBoolean(val);
while (true) {
final String val = redis.get_plaintext(REDIS_KEY_DEVICE_SHOW_BLOCK_STATS + ip + ":" + fqdn);
if (val != null) return Boolean.parseBoolean(val);
final int dotPos = fqdn.indexOf('.');
if (dotPos == -1) return null;
fqdn = fqdn.substring(dotPos + 1);
if (fqdn.indexOf('.') == -1) return null;
}
}

public void showBlockStats (Device device) {


+ 18
- 0
bubble-server/src/main/resources/models/apps/bubble_block/bubbleApp_bubbleBlock_data.json 查看文件

@@ -0,0 +1,18 @@
[{
"name": "BubbleBlock",
"children": {
"AppData": [{
"site": "All_Sites",
"template": true,
"matcher": "BubbleBlockMatcher",
"key": "hideStats_amazon.com",
"data": "true"
}, {
"site": "All_Sites",
"template": true,
"matcher": "BubbleBlockMatcher",
"key": "hideStats_walmart.com",
"data": "true"
}]
}
}]

+ 2
- 1
bubble-server/src/main/resources/models/manifest-app-bubble-block.json 查看文件

@@ -1,4 +1,5 @@
[
"apps/bubble_block/bubbleApp_bubbleBlock",
"apps/bubble_block/bubbleApp_bubbleBlock_matchers"
"apps/bubble_block/bubbleApp_bubbleBlock_matchers",
"apps/bubble_block/bubbleApp_bubbleBlock_data"
]

正在加载...
取消
保存