[{
  "name": "BubbleBlock",
  "description": "Block Adware, Malware and More",
  "url": "https://getbubblenow.com/apps/bblock",
  "template": true,
  "enabled": true,
  "priority": 200,
  "canPrime": true,
  "dataConfig": {
    "dataDriver": "bubble.app.bblock.BubbleBlockAppDataDriver",
    "presentation": "app",
    "fields": [
      {"name": "ctime", "customFormat": true},
      {"name": "device"},
      {"name": "fqdn"},
      {"name": "uri"},
      {"name": "data"}
    ],
    "params": [
      {"name": "device", "required": false, "index": 10}
    ],
    "views": [
      {"name": "last_24_hours"},
      {"name": "last_7_days"},
      {"name": "last_30_days"}
    ],
    "configDriver": "bubble.app.bblock.BubbleBlockAppConfigDriver",
    "configFields": [
      {"name": "name"},
      {"name": "description", "control": "textarea"},
      {"name": "url", "type": "http_url"},
      {"name": "tags"},
      {"name": "tagString"},
      {"name": "enabled", "type": "flag", "mode": "readOnly"},
      {"name": "rule"},
      {"name": "ruleType", "mode": "readOnly"},
      {"name": "testUrl", "type": "http_url"},
      {"name": "testUserAgent", "required": false},
      {"name": "testUrlPrimary", "type": "flag"},
      {"name": "urlRegex", "required": false},
      {"name": "userAgentRegex"}
    ],
    "configViews": [{
      "name": "manageLists",
      "scope": "app",
      "root": "true",
      "fields": ["name", "description", "url", "enabled", "tagString"],
      "actions": [
        {"name": "enableList", "when": "!item.enabled", "index": 10},
        {"name": "disableList", "when": "item.enabled", "index": 20},
        {"name": "manageList", "view": "manageList", "index": 30},
        {"name": "manageRules", "view": "manageRules", "when": "item.url === \\'\\'", "index": 40},
        {"name": "removeList", "index": 50, "when": "item.url !== ''"},
        {
          "name": "createList", "scope": "app", "view": "manageList", "index": 10,
          "params": ["url"],
          "button": "createList"
        },
        {
          "name": "testUrl", "scope": "app", "index": 20,
          "params": ["testUrl", "testUrlPrimary"],
          "button": "testUrl",
          "successMessage": "decisionType"
        }
      ]
    }, {
      "name": "manageList",
      "scope": "item",
      "fields": ["name", "description", "url", "tagString", "enabled"],
      "actions": [
        {"name": "updateList", "index": 10, "successView": "manageLists"},
        {"name": "enableList", "when": "!item.enabled", "index": 20},
        {"name": "disableList", "when": "item.enabled", "index": 30},
        {"name": "manageRules", "view": "manageRules", "when": "item.url === ''", "index": 40},
        {"name": "removeList", "index": 50, "when": "item.url !== ''", "successView": "manageLists"}
      ]
    }, {
      "name": "manageRules",
      "scope": "item",
      "fields": ["rule"],
      "actions": [
        {"name": "removeRule", "index": 10},
        {
          "name": "createRule", "scope": "app", "index": 10,
          "params": ["rule"],
          "button": "createRule"
        },
        {
          "name": "testUrl", "scope": "app", "index": 20,
          "params": ["testUrl", "testUserAgent", "testUrlPrimary"],
          "button": "testUrl",
          "successMessage": "decisionType"
        }
      ]
    }, {
      "name": "manageUserAgents",
      "scope": "app",
      "root": "true",
      "fields": ["userAgentRegex", "urlRegex"],
      "actions": [
        {"name": "removeUserAgentBlock", "index": 10},
        {
          "name": "createUserAgentBlock", "scope": "app", "index": 10,
          "params": ["userAgentRegex", "urlRegex"],
          "button": "createUserAgentBlock"
        },
        {
          "name": "testUrl", "scope": "app", "index": 20,
          "params": ["testUrl", "testUserAgent", "testUrlPrimary"],
          "button": "testUrl",
          "successMessage": "decisionType"
        }
      ]
    }]
  },
  "children": {
    "AppSite": [{
      "name": "All_Sites",
      "url": "*",
      "description": "All websites",
      "template": true
    }],
    "AppRule": [{
      "name": "bubble_block",
      "template": true,
      "driver": "BubbleBlockRuleDriver",
      "priority": -1000,
      "config": {
        "blockLists": [
          {
            "name": "EasyList",
            "id": "easylist",
            "url": "https://v.firebog.net/hosts/Easylist.txt",
            "description": "EasyList is the primary filter list that removes most adverts from international web pages, including unwanted frames, images, and objects. It is the most popular list used by many ad blockers and forms the basis of over a dozen combination and supplementary filter lists.",
            "tags": ["ads"]
          },
          {
            "name": "Dandelion Sprout's Anti-Malware List",
            "id": "dandelion_sprouts_anti_malware_list",
            "url": "https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareABP.txt",
            "description": "Most anti-malware lists are pretty big and can cover a 5- or 6-digit amount of specific domains. But my list hereby claims to remove more than 25% of all known malware sites with just a 2-digit amount of entries. This is mostly done by blocking top-level domains that have become devastatingly abused by spammers, usually because they allowed for free and uncontrolled domain registrations. There's also additional categories that cover unusual malware and phishing domains that very few other lists seem to cover.",
            "tags": ["malware", "phishing"]
          },
          {
            "name": "Bubble Ads/Tracking List",
            "id": "bubble_ads_and_trackers1",
            "url": "https://raw.githubusercontent.com/getbubblenow/bubble-filter-lists/master/ads_and_trackers1.txt",
            "description": "Blocks lots of ads and trackers, with a focus on ads and trackers used in native mobile apps",
            "tags": ["ads", "privacy"]
          },
          {
            "name": "Bubble Custom List",
            "id": "local",
            "url": "",
            "description": "A place to maintain your own block rules for this Bubble.",
            "tags": ["custom"]
          }
        ]
      }
    }],
    "AppMessage": [{
      "locale": "en_US",
      "messages": [
        {"name": "name", "value": "Block Party!"},
        {"name": "icon", "value": "classpath:models/apps/bubble_block/blockparty-icon.svg"},
        {"name": "summary", "value": "Network Filter"},
        {"name": "description", "value": "Block adware, malware, phishing/scam sites, and much more"},
        {"name": "field.ctime", "value": "When"},
        {"name": "field.fqdn", "value": "URL"},
        {"name": "field.device", "value": "Device"},
        {"name": "field.uri", "value": "Path"},
        {"name": "field.data", "value": "Count"},
        {"name": "view.last_24_hours", "value": "Last 24 Hours"},
        {"name": "view.last_24_hours.ctime.format", "value": "{{MMM}} {{d}} @ {{h}}{{a}}"},
        {"name": "view.last_7_days", "value": "Last 7 Days"},
        {"name": "view.last_7_days.ctime.format", "value": "{{MMM}} {{d}}, {{YYYY}}"},
        {"name": "view.last_30_days", "value": "Last 30 Days"},
        {"name": "view.last_30_days.ctime.format", "value": "{{MMM}} {{d}}, {{YYYY}}"},

        {"name": "config.view.manageLists", "value": "Manage Filter Lists"},
        {"name": "config.view.manageList", "value": "Manage Filter List"},
        {"name": "config.view.manageRules", "value": "Manage Filter Rules"},
        {"name": "config.view.manageUserAgents", "value": "Manage User-Agents"},

        {"name": "config.field.name", "value": "Name"},
        {"name": "config.field.description", "value": "Description"},
        {"name": "config.field.url", "value": "URL"},
        {"name": "config.field.url.description", "value": "URL of the Filter List"},
        {"name": "config.field.tagString", "value": "Tags"},
        {"name": "config.field.tagString.description", "value": "A comma-separated list of tags"},
        {"name": "config.field.tags", "value": "Tags"},
        {"name": "config.field.enabled", "value": "Enabled"},
        {"name": "config.field.rule", "value": "Rule"},
        {"name": "config.field.rule.description", "value": "Enter a rule. Can be a hostname, or use AdBlockPlus format"},
        {"name": "config.field.ruleType", "value": "Rule Type"},
        {"name": "config.field.testUrl", "value": "Test URL"},
        {"name": "config.field.testUrl.description", "value": "URL to check against filters"},
        {"name": "config.field.testUserAgent", "value": "Test User-Agent"},
        {"name": "config.field.testUserAgent.description", "value": "User-Agent to check against filters"},
        {"name": "config.field.testUrlPrimary", "value": "Primary"},
        {"name": "config.field.testUrlPrimary.description", "value": "A primary request will receive either an ALLOW or BLOCK decision from your Bubble. A non-primary request (for example a request for a webpage) may additionally receive a FILTER decision. This means the request will be permitted, but the response will be instrumented with Bubble filters to remove ads, malware and blocked elements."},
        {"name": "config.field.urlRegex", "value": "URL"},
        {"name": "config.field.urlRegex.description", "value": "A regular expression to match against the URL"},
        {"name": "config.field.userAgentRegex", "value": "User-Agent"},
        {"name": "config.field.userAgentRegex.description", "value": "A regular expression to match against the User-Agent"},

        {"name": "config.action.enableList", "value": "Enable"},
        {"name": "config.action.disableList", "value": "Disable"},
        {"name": "config.action.manageList", "value": "Edit"},
        {"name": "config.action.removeList", "value": "Remove"},
        {"name": "config.action.createList", "value": "Add New"},
        {"name": "config.button.createList", "value": "Add"},
        {"name": "config.action.updateList", "value": "Update"},
        {"name": "config.action.manageRules", "value": "Rules"},
        {"name": "config.action.manageUserAgents", "value": "User-Agents"},
        {"name": "config.action.removeRule", "value": "Remove Rule"},
        {"name": "config.action.createRule", "value": "Add New Rule"},
        {"name": "config.button.createRule", "value": "Add"},
        {"name": "config.action.createUserAgentBlock", "value": "Add New User-Agent Rule"},
        {"name": "config.button.createUserAgentBlock", "value": "Add"},
        {"name": "config.action.removeUserAgentBlock", "value": "Remove Rule"},
        {"name": "config.button.removeUserAgentBlock", "value": "Remove"},
        {"name": "config.action.testUrl", "value": "Test URL"},
        {"name": "config.button.testUrl", "value": "Test"},
        {"name": "config.response.block", "value": "Block"},
        {"name": "config.response.block.description", "value": "Requests to this URL would be blocked by your Bubble"},
        {"name": "config.response.allow", "value": "Allow"},
        {"name": "config.response.allow.description", "value": "Requests to this URL would be allowed by your Bubble, and would not be filtered"},
        {"name": "config.response.filter", "value": "Filter"},
        {"name": "config.response.filter.description", "value": "Requests to this URL would be allowed by your Bubble, but would be filtered"}
      ]
    }]
  }
}]