From efe197a189e069d588efb96ea0e72a7426728f8c Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Sat, 26 Aug 2017 22:20:24 +0500 Subject: [PATCH 1/6] Bump 0.0.1.4 --- .../chromium/runet-censorship-bypass/src/templates-data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/templates-data.js b/extensions/chromium/runet-censorship-bypass/src/templates-data.js index eac4931..b90218e 100644 --- a/extensions/chromium/runet-censorship-bypass/src/templates-data.js +++ b/extensions/chromium/runet-censorship-bypass/src/templates-data.js @@ -1,7 +1,7 @@ 'use strict'; const commonContext = { - version: '1.3', + version: '1.4', anticensorityPacUrls: [ // First official, shortened: 'https://rebrand.ly/ac-chrome-anticensority-pac', From ca0cc73df8d03c146bfb541accff34a628b1b771 Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Sat, 26 Aug 2017 22:44:42 +0500 Subject: [PATCH 2/6] Update with more up to date info --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2a09315..1b71006 100755 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This repo contains: 3. ~~PAC-scripts performance analyses of scripts generated~~ (doesn't take parse time into account) 4. Based on the research of step 3 [the final PAC-generator][pac-generator] was written as a Google App Script in JavaScript which is triggered every two hours to generate and publish PAC-script on Google Drive (don't use direct URL without extension, please, URL will be periodically changed to counter abuse). -[pac-generator]: https://script.google.com/d/1uKNRz6w-BbOef8bC9lsWpzYMJxczjFXfMKK8fq6nYTzyPcVxzjGB9ynb/edit?usp=sharing +[pac-generator]: https://script.google.com/d/1RlqqfUmYNpEhekySfOqdzJ8L4eV1GsHYDjPD1DexxEW0RcGvuCSQlWa0/edit?usp=sharing ## Why I do This @@ -29,9 +29,7 @@ I decided to write an anti-censorship extension for Chromium before they strike ## How it Works 0. PAC script is a JavaScript file, triggered on every URL request, which says browser which proxy to use if any for this particular URL. -1. The Chrome Extension sets PAC script in browser settings and keeps it synced with PAC script on the server (offering one on Google Drive, Antizapret or on Anticenz). -2. On every request PAC script checks if host is blocked OR if it's IP is blocked using `switch(..) {..}` trie-like structure (Google Drive PAC script). -Antizapret PAC script checks for IPs only with `indexOf`. -Anticenz PAC script checks for hosts and IPs with `indexOf`, but lacks some IPs. -3. If address is blocked PAC script returns proxy server to the browser: Antizapret, or Anticenz if the first one fails. -4. PAC scripts on servers are updated periodically from https://github.com/zapret-info/z-i +1. The Chrome Extension sets PAC script in browser settings and keeps it synced with PAC script on the server (offering Antizapret (hosted on a dedicated server) or Anticensority (hosted on GitHub + CloudFlare)). +2. On every request PAC script checks if host is blocked or if its IP is blocked. +3. If address is blocked PAC script returns proxy server to the browser, both Antizapret and Anticensority use Antizapret proxy servers. +4. PAC scripts on servers are updated periodically from https://github.com/zapret-info/z-i. From 5a4d52b0ada7c45cd884bdaa4995f6691fe80d3b Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Fri, 15 Sep 2017 19:41:00 +0500 Subject: [PATCH 3/6] Mend grep script --- extensions/chromium/runet-censorship-bypass/grep.sh | 1 + 1 file changed, 1 insertion(+) create mode 100755 extensions/chromium/runet-censorship-bypass/grep.sh diff --git a/extensions/chromium/runet-censorship-bypass/grep.sh b/extensions/chromium/runet-censorship-bypass/grep.sh new file mode 100755 index 0000000..f64f81d --- /dev/null +++ b/extensions/chromium/runet-censorship-bypass/grep.sh @@ -0,0 +1 @@ +grep -r $@ ./src --exclude-dir=vendor --exclude-dir=node_modules From e4dbdd3736c97668b611e12a331d106a760af0ac Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Fri, 15 Sep 2017 19:41:58 +0500 Subject: [PATCH 4/6] Take onlyOwnSites into account when updating --- .../37-sync-pac-script-with-pac-provider-api.tmpl.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js index 017ddf7..61fbd55 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js @@ -540,8 +540,10 @@ // UPDATE & MIGRATION console.log('Updating from ', oldStorage.version, 'to', antiCensorRu.version); const key = antiCensorRu._currentPacProviderKey; - if (key !== null) { - antiCensorRu._currentPacProviderKey = 'Антицензорити'; + if (oldStorage.version === ' 0.0.1.2') { + if (key !== null && key !== 'onlyOwnSites') { + antiCensorRu._currentPacProviderKey = 'Антицензорити'; + } } antiCensorRu.pushToStorageAsync(() => { From f14a2bee69816b9746baeeddb6adfe0d7ca5cb4b Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Fri, 15 Sep 2017 19:42:23 +0500 Subject: [PATCH 5/6] Remove old grep hint --- extensions/chromium/runet-censorship-bypass/grep.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 extensions/chromium/runet-censorship-bypass/grep.txt diff --git a/extensions/chromium/runet-censorship-bypass/grep.txt b/extensions/chromium/runet-censorship-bypass/grep.txt deleted file mode 100644 index 1b2534c..0000000 --- a/extensions/chromium/runet-censorship-bypass/grep.txt +++ /dev/null @@ -1 +0,0 @@ -grep -r addEvent ./ --exclude-dir=vendor --exclude-dir=node_modules From 8ac8fab30ec1d9f7ae4fdd89e28093c8e690aca3 Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Fri, 15 Sep 2017 19:42:53 +0500 Subject: [PATCH 6/6] Bump 0.0.1.5 --- .../chromium/runet-censorship-bypass/src/templates-data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/templates-data.js b/extensions/chromium/runet-censorship-bypass/src/templates-data.js index b90218e..d36c170 100644 --- a/extensions/chromium/runet-censorship-bypass/src/templates-data.js +++ b/extensions/chromium/runet-censorship-bypass/src/templates-data.js @@ -1,7 +1,7 @@ 'use strict'; const commonContext = { - version: '1.4', + version: '1.5', anticensorityPacUrls: [ // First official, shortened: 'https://rebrand.ly/ac-chrome-anticensority-pac',