RequestPolicyContinued / subscriptions

subscriptions for RequestPolicyContinued
http://requestpolicycontinued.github.io/
Other
19 stars 8 forks source link

Subscriptions for RequestPolicy

Subscriptions for the RequestPolicyContinued Firefox addon.

Subscriptions are preset rules for RequestPolicy Continued. Subscriptions are configurable through the Preferences -> Manage Policies -> Subscriptions menu of the addon.

Enabling a subscription will load a preconfigured allow/deny policy for certain sites. For example, subscriptions can:


What is included in subscriptions

You can check what requests are affected by different subscriptions by manually inspecting the subscription files. On your computer, RequestPolicy downloads subscriptions to the following locations:

See How to read subscriptions files for information on the file format.


Contributing

If you have a question or remark about how RequestPolicy Continued handles subscriptions, check the main project issue tracker.

If you'd like a rule to be removed from the subscriptions, please file a new issue stating the reason why it should be removed.

If you want your rules added to the official subscriptions, please mind the following:

Adding rules

You can also help by adding your rules for sites you like (Example proper pull request/patch )

Adding rules to allow_sameorg.json

It is easier to add all rules in official_allow-functionality.json first. You can also help by adding rules to official_allow-sameorg.json, either directly, or by moving already existing rules from official_allow-functionality.json. In this case:

Tips

A few bash tricks that may help reviewing/building subscriptions:

function wh() { #get relevant info about domain owners
  whois "$1" | grep -i registrant
}

function rprule() {
        #generate a rule with proper syntax for inclusion in subscriptions, copy it to clipboard
        # usage: rprule [origin-domain] [destination-domain]
  echo "{\"o\":{\"h\":\"*.$1\"},\"d\":{\"h\":\"*.$2\"}}," | xclip -selection c
}

Improving the deny trackers list

Additions to the deny trackers list are also welcome.

Translating subscriptions titles and descriptions

Look at locale.json and feel free to add the translations for subscriptions titles and language there.


How to read subscriptions files

RequestPolicy Continued fetches available subscriptions from subscription lists. official.json is the default subscription list (the only list currently) Each subscription list lists several subscriptions, which contain the actual rules.

The subscriptions lists file format is the following (eg. official.json):

{
  "subscriptions":{ 
    "allow_embedded":{ <- short name of the subscription.
      "serial":1329159661, <- a serial number; RP compares your local file serial number to the one available online, and updates your file if it has a lower serial.
      "url":"https://raw.githubusercontent.com/RequestPolicyContinued/subscriptions/master/official-allow_embedded.json", <- the URL from which up-to-date subscription rules should be downloaded
      "title":"Your title here", <- the title of this subscription
      "description":"This subscription does this." <- a description of what purpose this subscription serves, how it works
      },
    "another_subscription_here": { ...

locale.json contains translations for each subscription's list and title.

The subscription file format is the following (eg. official-allow_functionality.json):

{
  "metadata":{
    "version":1,
    "serial":1334341442 <- a serial number; RP compares your local file serial number to the one available online, and updates your file if it has a lower serial.
  },
  "entries":{ <- this marks the begginning of the actual subscription rules
    "allow":[ <- rules in this section are requests that will be **allowed** by RequestPolicy
      {"o":{"h":"*.amazon.ca"},"d":{"h":"*.images-amazon.com"}},
      {"o":{"h":"*.amazon.ca"},"d":{"h":"*.ssl-images-amazon.com"}},
      {"o":{"h":"*.amazon.com"},"d":{"h":"*.amazonaws.com"}}
    ],
    "deny":[] <- rules in this section are requests that will be **denied** by RequestPolicy
  }
}

For each rule, "o:"{"h":"*.hostname.org"} is the origin host for the request, "d":{"h":"*.another.com"} is the destination host for this request. What action is applied to this particular requests depends on which section it is listed in ("allow":[ or "deny":[)