diff --git a/README.md b/README.md index e13d7af..7bd114e 100644 --- a/README.md +++ b/README.md @@ -4,140 +4,61 @@ Say Thanks

Easy to install, privacy protection browser setup. -A collection of best browser extensions and configurations to help you fight for your privacy. -**To install it, see the [Installation](#installation) section.** +A collection of best browser extensions and some configurations to help you fight for your privacy. The deeper you dig, more you find that we're [loosing privacy from corporations](https://github.com/jotyGill/privacy). You might even start to believe that there's nothing you can do about it. You can!. With the right information, tools and dedication, you can do a lot to protect your privacy and stand up for your basic human right. -There are brilliant, hard working people who spend countless hours to make these privacy protecting tools. This project is a collection and setup of the best privacy protecting browser tools that exist today. (if you have any suggestions, please create a github 'issue') +There are brilliant, hard working people who spend countless hours to make these privacy protecting tools. This project is a collection and setup of the best privacy protecting browser tools that exist today. +The basic setup installs the following addons and some [user.js configurations](https://github.com/jotyGill/privacy-fighter/blob/master/privacyfighter/profile/basic/basic-user.js) +1. [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/) +2. [Temporary Containers](https://addons.mozilla.org/en-US/firefox/addon/temporary-containers/) +3. [HTTPS Everywhere](https://addons.mozilla.org/en-US/firefox/addon/https-everywhere/) +4. [Canvas Blocker](https://addons.mozilla.org/en-US/firefox/addon/canvasblocker/) +5. [Decentraleyes](https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/) +6. [ClearURLs](https://addons.mozilla.org/en-US/firefox/addon/clearurls/) +7. [Terms of Service; Didn't Read](https://addons.mozilla.org/en-US/firefox/addon/terms-of-service-didnt-read/) -### Table of Contents -1. [Project Goals](#goals) -2. [Why Firefox?](#why) -3. [Disclaimer](#disclaimer) -4. [Installed/Configured Tools and Their Benefits](#tools) -5. [Security Improvements](#security) -6. [Installation](#installation) -7. [Post Installation](#post-installation) -8. [Known Inconveniences](#inconveniences) -9. [Advance Options](#advance) -10. [Troubleshooting](#troubleshooting) +**For further details about the project see [DOCS](https://github.com/jotyGill/privacy-fighter/tree/master/docs)** +**NOTE: From version 2.0 Privacy-Fighter is installed in a separate Firefox profile called "privacy-fighter". When upgrading from version 1.x to 2.x I recommend that you refresh your 'default' Firefox profile. +visit `about:support` and click "Refresh Firefox" (right corner)** -### 1.0 Project Goals -The goals of this project are following: -* To create the best privacy protecting browser setup for average internet users, that doesn't break much functionality. "The best" is highly subjective, it is a battle between, functionality vs privacy, for better privacy we have to disable/work around many functionalities. The project aims for a sweet spot to minimise breakage of sites while retaining good privacy level. -* The project aims to protect users from hidden background tracking mechanisms and the ["filter bubbles"](https://www.ted.com/talks/eli_pariser_beware_online_filter_bubbles) that most don't even know exist. While using this setup every new tab is a completely new session. If you don't log in on a website you should see the results without any personalization thus escaping the filter bubbles. (Note: It can't protect your identity or privacy when you use a service (e.g Youtube/Facebook) while you are logged in.) -* [**Everyone is uniquely identifiable on the web**](https://github.com/gautamkrishnar/nothing-private), even if you use privacy protecting extensions/configurations. (see section: []). The project aims to create a single configuration set that minimises entropy (uniquely identifiable information). When same setup is used by many, it would make our digital fingerprints less unique. -* To Create a simple Installation method that takes just a few minutes to setup and requires minimal intervention. So that average internet user can install and benefit from it. (something that took me dozens of hours research, tinkering with configs/tools) -* The goal is not to blindly gather extensions (addons) or disable as many browser functionalities (using Firefox preferences) as possible. Neither it is to spoof as many browser values as possible, as doing that in some cases (user agent, OS, screen size) increases entropy (uniquely identifiable information). In this project I aim to research about, evaluate, test configuration sets and compatibility among the extensions and configurations that can help protect our privacy while browsing the web. Suggestions, corrections from all are welcome. +### 1.0 Installation +Advance users can check out the [Advance Options](https://github.com/jotyGill/privacy-fighter/tree/master/docs#advance). For the basic setup just follow the following instructions. -### 2.0 Why Firefox? -**Requirement: Latest stable version of [Firefox](https://www.mozilla.org/en-US/firefox/new/): Currently 69** - -If you are using Chrome (even Chromium) or Edge with default settings, not only they don't provide any privacy protection from third parties on the web. -**These browsers themselves collect detailed stats about your online behaviour, including every single webpage you have ever visited, every single search query you have ever made.** -**The predominant browser Chrome tracks every webpage visit and periodically sends user location coordinates to Google. It also collects personal information(e.g. when a user completes online forms) and sends it to Google as part of the data synchronisation process. [c page 5, Google Data Collection Paper](https://digitalcontentnext.org/wp-content/uploads/2018/08/DCN-Google-Data-Collection-Paper.pdf)** -When you are logged into Chrome, all your browsing activity is without question linked to you. Even if you haven't logged in Chrome, Google still knows who you are with an extremely high precision. - -Firefox on the other hand is developed by the non profit organisation Mozilla. It is the only viable fully open source competitor of Chrome. Mozilla being a non profit organisation has a fundamentally different business model than Google, which is a company built on profiling users and monetising that information. - -### 3.0 Disclaimer -This project is a collection of configurations to setup Firefox preferences and to setup and install third party extensions/addons. These extensions have been carefully chosen. They are downloaded straight from the "Firefox Add-ons store". Each addon is fully open source and anyone can view the code. Each of the addon's developer has high reputation and multi thousand downloads in the addons store. Because these addons are not developed by me, use them at your own risk. - -### 4.0 Installed/Configured Tools and Their Benefits -This script installs and configures the following tools. A huge thanks to all the brilliant people behind these tools that have spent so much time and energy into making the world a better place. - -0. [Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/): Nothing like this would be possible without Firefox. "Firefox Containers" (Heavily utilised in this setup) is Mozilla's revolutionary approach to isolate online identities by containing cookies and local storage in multiple separate containers, allowing us to use the web with multiple identities or accounts simultaneously. - -1. [ghacks-user.js](https://github.com/ghacksuserjs/ghacks-user.js/) When installed using the "Advance Setup" ghacks-user.js is used to modify more than a hundred Firefox preferences in order to improve privacy protection and reduce fingerprintablity. - - Configuration: To minimise breakage, a custom user-overrides.js is used to relax the non critical preferences - -2. [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/): An efficient "wide-spectrum blocker", it blocks, ads, trackers and malware sites. [https://github.com/gorhill/uBlock] - -3. [Temporary containers](https://addons.mozilla.org/en-US/firefox/addon/temporary-containers/): Temporary Containers takes "Firefox Containers" to whole new level by making every new tab a different container. you may have heard of the advise to use multiple browsers. This pretty much makes every new tab a different, isolated (cookies, localstorage) browser, which gets deleted after it is closed. Eliminates long term tracking done using, cookies, storage caches, Etags.[https://github.com/stoically/temporary-containers] - - Configuration: Automatic mode enabled (every new tab opens in a new isolated container). Containers colour is set to random. - -Get in the habit of opening new tabs and closing old ones. Also to open links in new containers (right click on link > "Open link in new Temporary Container Tab" instead. - -4. [HTTPS Everywhere](https://addons.mozilla.org/en-US/firefox/addon/https-everywhere/): -HTTPS Everywhere is a Firefox extension by [EFF](https://www.eff.org/) to protect your communications by enabling HTTPS encryption automatically on sites that are known to support it. - -5. [Canvas Blocker](https://addons.mozilla.org/en-US/firefox/addon/canvasblocker/): Aims to prevent websites from using the some Javascript APIs to fingerprint users. resistFingerprinting takes preference to this, CanvasBlocker works as fallback for canvas fingerprinting. It also protects form fingerprinting the following APIs (by faking the values): -canvas 2d, webGL, audio, history, DOMRect [https://github.com/kkapsner/CanvasBlocker] - -6. [decentraleyes](https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/): Protects you against tracking through "free", centralized, Content Delivery Networks, by locally storing libraries instead of fetching them from the tracking CDNs. - -7. [clear_urls](https://gitlab.com/KevinRoebert/ClearUrls/): Protects your privacy by removing the tracking fields in URLs.[https://gitlab.com/KevinRoebert/ClearUrls/] - -8. [Terms of Service; Didn't Read](https://addons.mozilla.org/en-US/firefox/addon/terms-of-service-didnt-read/): Provides rating and extracts key points of the lengthy Terms and Conditions no one reads.[https://tosdr.org/] - -### 5.0 Security Improvements -Online ad networks are known to spread malware (malicious software: viruses, etc) [https://en.wikipedia.org/w/index.php?title=Ad_blocking§ion=5#Security]. Effective Adblocking alone is a huge -security improvement. There are other security benefits of this setup. HttpsEveryware: for example ensures secure connections to well known websites. Leaving no persistent cache/cookies and making every new tab an isolated container, protects against several attack vectors. - - -### 6.0 Installation -The installation procedure. +### 1.1 Installation Steps for Windows OS 1. If you don't have Firefox installed, First download and install [Firefox](https://www.mozilla.org/en-US/firefox/new/). +2. Download [Privacy-Fighter.exe](https://github.com/jotyGill/privacy-fighter/releases/latest/download/Privacy-Fighter.exe). +3. Close Firefox and run the downloaded file Privacy-Fighter.exe +4. **After the installation finishes, follow the ["Post Installation"](#post-installation) section.** -If you are an advance user see [Advance Options](#advance), otherwise continue. - -### 6.1 Installation Steps for Windows OS - -2. Close Firefox then download and run [Privacy Fighter.exe](https://github.com/jotyGill/privacy-fighter/releases/latest/download/Privacy-Fighter.exe). -3. Now follow the ["Post Installation"](#post-installation) section. - -### 6.2 Installation Steps for GNU/Linux or MacOS +### 1.2 Installation Steps for GNU/Linux and MacOS -2. If you have python3 with pip, The best option is to install it using pip. -``` bash -python3 -m pip install --user -U privacyfighter -``` -**Alternatively** - -2. You can download and run the [privacyfighter-linux-amd64](https://github.com/jotyGill/privacy-fighter/releases/latest/download/privacyfighter-linux-amd64) executable for GNU/Linux systems. +1. If you don't have Firefox installed, First download and install [Firefox](https://www.mozilla.org/en-US/firefox/new/). +2. Close Firefox. +3. ON GNU/LINUX: Download and run the [privacyfighter-linux-amd64](https://github.com/jotyGill/privacy-fighter/releases/latest/download/privacyfighter-linux-amd64). ``` bash wget https://github.com/jotyGill/privacy-fighter/releases/latest/download/privacyfighter-linux-amd64 chmod +x ./privacyfighter-linux-amd64 +./privacyfighter-linux-amd64 ``` +3. ON MACOS: Download and run the [privacyfighter-macos-amd64](https://github.com/jotyGill/privacy-fighter/releases/latest/download/privacyfighter-macos). +``` bash +wget https://github.com/jotyGill/privacy-fighter/releases/latest/download/privacyfighter-macos +chmod +x ./privacyfighter-macos +./privacyfighter-macos +``` +4. **After the installation finishes, follow the ["Post Installation"](#post-installation) section.** -3. Close Firefox then run `privacyfighter -m -a` or `~/.local/bin/privacyfighter -m -a` . (Note: shortcut `pf` instead of `privacyfighter` also works. eg. `pf -m -a`) -### 7.0 Post Installation +### 2.0 Post Installation 1. After installation is done, open Firefox then "addons" (press Ctr+Shift+A) and enable all of them and allow them in private windows. -2. Open **Bookmarks Manager (press Ctr+Shift+O)** > **"Import and Backup"** > **Import Data from Another Browser**, follow wizard to import your bookmarks and history from your existing browser (Chrome/Edge/Safari). -3. I recommend changing the default search engine from Google to DuckDuckGo or Startpage. +2. Open **Bookmarks Manager (press Ctr+Shift+O)** > **"Import and Backup"** (top menu item) > **Import Data from Another Browser**, follow wizard to import your bookmarks and history from your existing browser (Chrome/Edge/Safari). +3. You can change the default search engine from Google to DuckDuckGo. (Menu > Preferences > Search > Default Search Engine > DuckDuckGo) -### 8.0 Known Inconveniences -"I never said it would be easy". Ok I said the installation is easy. -* Firefox's internal window is smaller than usual. This is due to "privacy.resistFingerprinting" (RPF) protecting screen size (with letterboxing) in very clever way. It provides protections against screen size fingerprinting. -* You would have to fill google reCAPTCHA multiple times to confirm you are not robot. Have you noticed that these days you only have to check the reCAPTCHA box (reCAPTCHA v2) and don't need to fill any reCAPTCHA. And now v3 doesn't need any user interaction at all and you don't even know it's there. This works because [Google already knows exactly who you are](https://www.fastcompany.com/90369697/googles-new-recaptcha-has-a-dark-side) (on an average browser setup). **Google reCAPTCHA has become harsh to privacy aware users, you will have to fill it multiple times (3-8 times) and image squares will load very slowly. Google is abusing it's powerful position to deter users from using privacy protections [source](https://news.ycombinator.com/item?id=19623001) [discussion](https://github.com/ghacksuserjs/ghacks-user.js/issues/685).** I guess their approach is working when people start believing the problem is with the protection (privacy.resistFingerprinting) and the solution is to not use it [source](https://www.reddit.com/r/firefox/comments/a0dvrh/stuck_in_google_captcha_hell_try_disabling/). -* The reported time zone is set to UTC by RPF. All webapps (e.g your email site) would report UTC time. - -These are the prices we have to pay, if we choose to fight for our privacy. - -### 9.0 Advance Options -"--advance-setup": This mode installs ghacks-user.js to harden the profile and applies my user_overrides.js on it. -This mode provides better privacy protections but rarely some pages could break. To overcome those issues it is recommended to setup the 'alternative' profile and open those particular sites in it. - -"--setup-alt": Setup the 'alternative' profile, which is a basic profile that deletes locally stored data (cookies,caches) on exit. -To use this option first you have to create a new profile and name it 'alternative'. -Open Firefox, visit link [`about:profiles`](about:profiles). Click `Create New Profile`, name it `alternative`. - -"--profile": If you wish to setup PF in a different profile (other than 'default'). You can create a new profile and provide it's name. eg `~/.local/bin/privacyfighter -m -a -p your-new-profile-name` - -### 10.0 Troubleshooting -Breakage on some pages might (hopefully very rarely) happen. You can just open the sites that break in the 'alternative' Firefox profile. That profile is setup to get around any site issues without needing any other browser. -To open it, visit link `about:profiles` in Firefox. Under `Profile: alternative`, click `Launch Profile In New Browser` - -Or you can try troubleshooting the issue. -The steps to troubleshooting are -1. Disable UblockOrigin on that particular site (by clicking on it's icon then the blue power button) then reload the website and try again. -2. Temporarily disable ClearUrls (in Addons, Ctr+Shif+A) then reload the website and try again. -3. Please report any breakage bugs by filing an issue. +### 3.0 Usage And Troubleshooting +After installing and following post installation setups. Every time you open Firefox, it will ask you to choose a profile. +Select "privacy-fighter" profile. If you ever encounter a webpage breakage simple copy the link, close Firefox then open the link in "default-release" profile. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..afff862 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,144 @@ +# Privacy-Fighter +

+PyPi +Say Thanks

+ +Easy to install, privacy protection browser setup. +A collection of best browser extensions and some configurations to help you fight for your privacy. +**To install it, see the [Installation](#installation) section.** + +The deeper you dig, more you find that we're [loosing privacy from corporations](https://github.com/jotyGill/privacy). You might even start to believe that there's nothing you can do about it. You can!. With the right information, tools and dedication, you can do a lot to protect your privacy and stand up for your basic human right. +There are brilliant, hard working people who spend countless hours to make these privacy protecting tools. This project is a collection and setup of the best privacy protecting browser tools that exist today. (if you have any suggestions, please create a github 'issue') + + +### Table of Contents +1. [Project Goals](#goals) +2. [Why Firefox?](#why) +3. [Disclaimer](#disclaimer) +4. [Installed/Configured Tools and Their Benefits](#tools) +5. [Security Improvements](#security) +6. [Installation](#installation) +7. [Post Installation](#post-installation) +8. [Known Inconveniences](#inconveniences) +9. [Advance Options](#advance) +10. [Troubleshooting](#troubleshooting) + + +### 1.0 Project Goals +The goals of this project are following: +* To create the best privacy protecting browser setup for average internet users, that doesn't break much functionality. "The best" is highly subjective, it is a battle between, functionality vs privacy, for better privacy we have to disable/work around many functionalities. The project aims for a sweet spot to minimise breakage of sites while retaining good privacy level. +* The project aims to protect users from hidden background tracking mechanisms and the ["filter bubbles"](https://www.ted.com/talks/eli_pariser_beware_online_filter_bubbles) that most don't even know exist. While using this setup every new tab is a completely new session. If you don't log in on a website you should see the results without any personalization thus escaping the filter bubbles. (Note: It can't protect your identity or privacy when you use a service (e.g Youtube/Facebook) while you are logged in.) +* [**Everyone is uniquely identifiable on the web**](https://github.com/gautamkrishnar/nothing-private), even if you use privacy protecting extensions/configurations. (see section: []). The project aims to create a single configuration set that minimises entropy (uniquely identifiable information). When same setup is used by many, it would make our digital fingerprints less unique. +* To Create a simple Installation method that takes just a few minutes to setup and requires minimal intervention. So that average internet user can install and benefit from it. (something that took me dozens of hours research, tinkering with configs/tools) +* The goal is not to blindly gather extensions (addons) or disable as many browser functionalities (using Firefox preferences) as possible. Neither it is to spoof as many browser values as possible, as doing that in some cases (user agent, OS, screen size) increases entropy (uniquely identifiable information). In this project I aim to research about, evaluate, test configuration sets and compatibility among the extensions and configurations that can help protect our privacy while browsing the web. Suggestions, corrections from all are welcome. + +### 2.0 Why Firefox? +**Requirement: Latest stable version of [Firefox](https://www.mozilla.org/en-US/firefox/new/): Currently 69** + +If you are using Chrome (even Chromium) or Edge with default settings, not only they don't provide any privacy protection from third parties on the web. +**These browsers themselves collect detailed stats about your online behaviour.** +**The predominant browser Chrome tracks every webpage visit and periodically sends user location coordinates to Google. It also collects personal information(e.g. when a user completes online forms) and sends it to Google as part of the data synchronisation process. [c page 5, Google Data Collection Paper](https://digitalcontentnext.org/wp-content/uploads/2018/08/DCN-Google-Data-Collection-Paper.pdf)** +When you are logged into Chrome, all your browsing activity is without question linked to you. Even if you haven't logged in Chrome, Google still knows who you are with an extremely high precision. + +Firefox on the other hand is developed by the non profit organisation Mozilla. It is the only viable fully open source competitor of Chrome. Mozilla being a non profit organisation has a fundamentally different business model than Google, which is a company built on profiling users and monetising that information. + +### 3.0 Disclaimer +This project is a collection of configurations to setup Firefox preferences and to setup and install third party extensions/addons. These extensions have been carefully chosen. They are downloaded straight from the "Firefox Add-ons store". Each addon is fully open source and anyone can view the code. Each of the addon's developer has high reputation and multi thousand downloads in the addons store. Because these addons are not developed by me, use them at your own risk. + +### 4.0 Installed/Configured Tools and Their Benefits +This script installs and configures the following tools. A huge thanks to all the brilliant people behind these tools that have spent so much time and energy into making the world a better place. + +0. [Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/): Nothing like this would be possible without Firefox. "Firefox Containers" (Heavily utilised in this setup) is Mozilla's revolutionary approach to isolate online identities by containing cookies and local storage in multiple separate containers, allowing us to use the web with multiple identities or accounts simultaneously. + +1. [ghacks-user.js](https://github.com/ghacksuserjs/ghacks-user.js/) When installed using the "Advance Setup" ghacks-user.js is used to modify more than a hundred Firefox preferences in order to improve privacy protection and reduce fingerprintablity. + + Configuration: To minimise breakage, a custom user-overrides.js is used to relax the non critical preferences + +2. [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/): An efficient "wide-spectrum blocker", it blocks, ads, trackers and malware sites. [https://github.com/gorhill/uBlock] + +3. [Temporary containers](https://addons.mozilla.org/en-US/firefox/addon/temporary-containers/): Temporary Containers takes "Firefox Containers" to whole new level by making every new tab a different container. you may have heard of the advise to use multiple browsers. This pretty much makes every new tab a different, isolated (cookies, localstorage) browser, which gets deleted after it is closed. Eliminates long term tracking done using, cookies, storage caches, Etags.[https://github.com/stoically/temporary-containers] + + Configuration: Automatic mode enabled (every new tab opens in a new isolated container). Containers colour is set to random. + +Get in the habit of opening new tabs and closing old ones. Also to open links in new containers (right click on link > "Open link in new Temporary Container Tab" instead. + +4. [HTTPS Everywhere](https://addons.mozilla.org/en-US/firefox/addon/https-everywhere/): +HTTPS Everywhere is a Firefox extension by [EFF](https://www.eff.org/) to protect your communications by enabling HTTPS encryption automatically on sites that are known to support it. + +5. [Canvas Blocker](https://addons.mozilla.org/en-US/firefox/addon/canvasblocker/): Aims to prevent websites from using the some Javascript APIs to fingerprint users. resistFingerprinting takes preference to this, CanvasBlocker works as fallback for canvas fingerprinting. It also protects form fingerprinting the following APIs (by faking the values): +canvas 2d, webGL, audio, history, DOMRect [https://github.com/kkapsner/CanvasBlocker] + +6. [decentraleyes](https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/): Protects you against tracking through "free", centralized, Content Delivery Networks, by locally storing libraries instead of fetching them from the tracking CDNs. + +7. [clear_urls](https://gitlab.com/KevinRoebert/ClearUrls/): Protects your privacy by removing the tracking fields in URLs.[https://gitlab.com/KevinRoebert/ClearUrls/] + +8. [Terms of Service; Didn't Read](https://addons.mozilla.org/en-US/firefox/addon/terms-of-service-didnt-read/): Provides rating and extracts key points of the lengthy Terms and Conditions no one reads.[https://tosdr.org/] + +### 5.0 Security Improvements +Online ad networks are known to spread malware (malicious software: viruses, etc) [https://en.wikipedia.org/w/index.php?title=Ad_blocking§ion=5#Security]. Effective Adblocking alone is a huge +security improvement. There are other security benefits of this setup. HttpsEveryware: for example ensures secure connections to well known websites. Leaving no persistent cache/cookies and making every new tab an isolated container, protects against several attack vectors. + + +### 6.0 Installation +If you are an advance user check out the [Advance Options](#advance), otherwise continue. + +### 6.1 Installation Steps for Windows OS + +1. If you don't have Firefox installed, First download and install [Firefox](https://www.mozilla.org/en-US/firefox/new/). +2. Download [Privacy-Fighter.exe](https://github.com/jotyGill/privacy-fighter/releases/latest/download/Privacy-Fighter.exe). +3. Close Firefox and run the downloaded file Privacy-Fighter.exe +4. **After the installation finishes, follow the ["Post Installation"](#post-installation) section.** + +### 6.2 Installation Steps for GNU/Linux and MacOS + +1. If you don't have Firefox installed, First download and install [Firefox](https://www.mozilla.org/en-US/firefox/new/). +2. Close Firefox. +3. ON GNU/LINUX: Download and run the [privacyfighter-linux-amd64](https://github.com/jotyGill/privacy-fighter/releases/latest/download/privacyfighter-linux-amd64). +``` bash +wget https://github.com/jotyGill/privacy-fighter/releases/latest/download/privacyfighter-linux-amd64 +chmod +x ./privacyfighter-linux-amd64 +./privacyfighter-linux-amd64 +``` +3. ON MACOS: Download and run the [privacyfighter-macos-amd64](https://github.com/jotyGill/privacy-fighter/releases/latest/download/privacyfighter-macos-amd64). +``` bash +wget https://github.com/jotyGill/privacy-fighter/releases/latest/download/privacyfighter-macos-amd64 +chmod +x ./privacyfighter-macos-amd64 +./privacyfighter-macos-amd64 +``` +4. **After the installation finishes, follow the ["Post Installation"](#post-installation) section.** + + +### 7.0 Post Installation +1. After installation is done, open Firefox then "addons" (press Ctr+Shift+A) and enable all of them and allow them in private windows. +2. Open **Bookmarks Manager (press Ctr+Shift+O)** > **"Import and Backup"** > **Import Data from Another Browser**, follow wizard to import your bookmarks and history from your existing browser (Chrome/Edge/Safari). +3. You can change the default search engine from Google to DuckDuckGo. + (Menu > Preferences > Search > Default Search Engine > DuckDuckGo) + +### 8.0 Known Inconveniences +"I never said it would be easy". Ok I said the installation is easy. +* Firefox's internal window is smaller than usual. This is due to "privacy.resistFingerprinting" (RPF) protecting screen size (with letterboxing) in very clever way. It provides protections against screen size fingerprinting. +* You would have to fill google reCAPTCHA multiple times to confirm you are not robot. Have you noticed that these days you only have to check the reCAPTCHA box (reCAPTCHA v2) and don't need to fill any reCAPTCHA. And now v3 doesn't need any user interaction at all and you don't even know it's there. This works because [Google already knows exactly who you are](https://www.fastcompany.com/90369697/googles-new-recaptcha-has-a-dark-side) (on an average browser setup). **Google reCAPTCHA has become harsh to privacy aware users, you will have to fill it multiple times (3-8 times) and image squares will load very slowly. Google is abusing it's powerful position to deter users from using privacy protections [source](https://news.ycombinator.com/item?id=19623001) [discussion](https://github.com/ghacksuserjs/ghacks-user.js/issues/685).** I guess their approach is working when people start believing the problem is with the protection (privacy.resistFingerprinting) and the solution is to not use it [source](https://www.reddit.com/r/firefox/comments/a0dvrh/stuck_in_google_captcha_hell_try_disabling/). +* The reported time zone is set to UTC by RPF. All webapps (e.g your email site) would report UTC time. + +These are the prices we have to pay, if we choose to fight for our privacy. + +### 9.0 Advance Options +"--advance-setup": This mode installs ghacks-user.js to harden the profile and applies my user_overrides.js on it. +This mode provides better privacy protections but rarely some pages could break. To overcome those issues it is recommended to setup the 'alternative' profile and open those particular sites in it. + +"--setup-alt": Setup the 'alternative' profile, which is a basic profile that deletes locally stored data (cookies,caches) on exit. +To use this option first you have to create a new profile and name it 'alternative'. +Open Firefox, visit link [`about:profiles`](about:profiles). Click `Create New Profile`, name it `alternative`. + +"--profile": If you wish to setup PF in a different profile (other than 'default'). You can create a new profile and provide it's name. eg `~/.local/bin/privacyfighter -m -a -p your-new-profile-name` + +### 10.0 Troubleshooting +Breakage on some pages might (hopefully very rarely) happen. You can just open the sites that break in the 'alternative' Firefox profile. That profile is setup to get around any site issues without needing any other browser. +To open it, visit link `about:profiles` in Firefox. Under `Profile: alternative`, click `Launch Profile In New Browser` + +Or you can try troubleshooting the issue. + +The steps to troubleshooting are +1. Disable UblockOrigin on that particular site (by clicking on it's icon then the blue power button) then reload the website and try again. +2. Temporarily disable ClearUrls (in Addons, Ctr+Shif+A) then reload the website and try again. +3. Please report any breakage bugs by filing an issue. diff --git a/docs/build.md b/docs/build.md new file mode 100644 index 0000000..33ace65 --- /dev/null +++ b/docs/build.md @@ -0,0 +1,31 @@ +The project can be directly installed using pip without needing to build any binaries. + +`sudo pip3 install -U privacyfighter` + +OR + +`python3 -m pip install --user -U privacyfighter` + + +## GNU/Linux +Building binary in GNU/Linux. + +```bash +sudo apt install python3-pip +sudo pip3 install pyinstaller psutil requests +git clone https://github.com/jotyGill/privacy-fighter +cd privacy-fighter/privacyfighter +pyinstaller build-cli.spec --clean +``` + +## Windows with GUI +Uncomment lines in pf.py to 1. import 'gooey', 2. set gui_mode='True', 3. uncomment the gooey decorator + +Building binary in windows. + +```bash +pip3 install Gooey pyinstaller psutil requests +git clone https://github.com/jotyGill/privacy-fighter +cd privacy-fighter\privacyfighter +pyinstaller build.spec --clean +``` diff --git a/privacyfighter/build-cli.spec b/privacyfighter/build-cli.spec new file mode 100644 index 0000000..46c3900 --- /dev/null +++ b/privacyfighter/build-cli.spec @@ -0,0 +1,22 @@ + +a = Analysis(['pf.py'], + pathex=[''], + hiddenimports=[], + hookspath=None, + runtime_hooks=None, + ) +pyz = PYZ(a.pure) + +options = [('u', None, 'OPTION')] + +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + options, + name='privacy-fighter-linux', + debug=False, + strip=None, + upx=True, + console=False) diff --git a/privacyfighter/pf.py b/privacyfighter/pf.py index b66cb43..35837f2 100755 --- a/privacyfighter/pf.py +++ b/privacyfighter/pf.py @@ -1,106 +1,112 @@ #!/usr/bin/env python3 import argparse +import configparser import datetime import fileinput -import fnmatch import io import os import shutil import sys import tempfile import zipfile -from pathlib import Path, PurePath +from pathlib import Path import psutil import requests -# from gooey import Gooey # comment out when producing cli version +# GUI-SETUP, is a tag used to find lines to change, to produce the gui-version +# from gooey import Gooey # GUI-SETUP, comment out when producing cli version -# To produce gui installer with pyinstaller. also uncomment @Gooey decorator -gui_mode = False +gui_mode = False # GUI-SETUP, change to 'True' in gui-version -__version__ = "1.3.0.dev1" +__version__ = "2.0.0" __basefilepath__ = os.path.dirname(os.path.abspath(__file__)) +repo_location = "https://raw.githubusercontent.com/jotyGill/privacy-fighter/master/privacyfighter" + # temporary folder to download files in temp_folder = tempfile.mkdtemp() # progress bar steps -total_steps = 8 +total_steps = 9 # Create folders extensions_folder = os.path.join(temp_folder, "extensions") os.makedirs(extensions_folder, exist_ok=True) -# comment out the decorator @Gooey when in cli-mode +# GUI-SETUP, comment out the decorator @Gooey when in cli-mode # @Gooey( # progress_regex=r"^progress: (?P\d+)/(?P\d+)$", # progress_expr="current / total * 100", +# hide_progress_msg=True, # program_name="Privacy Fighter", # requires_shell=False, # tabbed_groups=True, # default_size=(900, 530), +# menu=[ +# { +# "name": "About", +# "items": [ +# { +# "type": "AboutDialog", +# "menuTitle": "About", +# "name": "Privacy Fighter", +# "description": "A Browser Setup To Protect Your Privacy", +# "version": __version__, +# "website": "https://github.com/jotyGill/privacy-fighter", +# "developer": "https://github.com/jotyGill", +# "license": "GNU General Public License v3 or later (GPLv3+)", +# }, +# {"type": "Link", "menuTitle": "Project Link", "url": "https://github.com/jotyGill/privacy-fighter"}, +# ], +# } +# ], # ) def main(): parser = argparse.ArgumentParser(description="Privacy-Fighter: A Browser Setup To Protect Your Privacy") if not gui_mode: parser.add_argument("-v", "--version", action="version", version="Privacy-Fighter " + __version__) install_tab = parser.add_argument_group( - "Install", + "Installation Info", "Please make sure:\n" "1. Firefox is installed but not running at the moment\n" "2. After this setup finishes, Remember to follow post installation instructions", ) - install_tab.add_argument( - "--show-post-installation-instructions", - dest="post_installation_instructions", - default="https://github.com/jotyGill/privacy-fighter/#70-post-installation", - help="You can copy this link and open it after installation", - type=str, - ) - install_tab.add_argument( - "-m", - "--setup-main", - dest="setup_main", - default=gui_mode, # True if in gui_mode - help="Setup the main Firefox profile for day-to-day browsing", - action="store_true", - ) + if gui_mode: + install_tab.add_argument( + "--show-post-installation-instructions", + dest="post_installation_instructions", + default="https://github.com/jotyGill/privacy-fighter/#70-post-installation", + help="You can copy this link and open it after installation", + type=str, + ) advance_options = parser.add_argument_group("Advance Options", "Advance Options for the geekz") advance_options.add_argument( - "-A", - "--advance-setup", - dest="advance_setup", - default=False, - help="Configure better protection with ghacksuserjs,\n" - "It is recommneded to install 'alternative' profile with it", - action="store_true", + "-p", + "--profile", + dest="profile_name", + default="privacy-fighter", + help="Firefox Profile to be configured with PF, default 'privacy-fighter'", + type=str, ) advance_options.add_argument( + "-A", "-a", - "--setup-alt", - dest="setup_alt", + "--advance-setup", + dest="advance_setup", default=False, - help="Setup the 'alternative' Firefox profile. (to get around any issues)", + help="Configure better protection with ghacks-user.js instead", action="store_true", ) - advance_options.add_argument( - "-p", - "--profile", - dest="profile_name", - default="default", - help="Firefox Profile to be configured with PF", - type=str, - ) advance_options.add_argument( "-u", "--user-overrides-url", dest="user_overrides_url", - default="https://raw.githubusercontent.com/jotyGill/privacy-fighter/master/privacyfighter/profile/user-overrides.js", - help="You can use your fork of user-overrides.js", + default=repo_location + "/profile/advance/user-overrides.js", + help="user-overrides.js to be applied over ghacks-user.js", type=str, ) advance_options.add_argument( @@ -110,46 +116,90 @@ def main(): help="Skip the installation/setup of extensions (NOT Recommended)", action="store_true", ) + advance_options.add_argument( + "-i", + "--import", + dest="import_profile", + default="default", + help="Import history, bookmarks, saved passwords from old firefox profile", + type=str, + ) + + if gui_mode: + install_tab.add_argument( + "--set-homepage", + dest="set_homepage", + default=True, + help="Set homepage to privacy respecting search engine (DuckDuckGo)", + action="store_false", + ) + advance_options.add_argument( + "--set-ui", + dest="set_ui", + default=True, + help="Customise Firefox UI elements to better fit Addons (Recommended)", + action="store_false", + ) + else: + install_tab.add_argument( + "--no-homepage", + dest="set_homepage", + default=False, + help="Don't change the homepage to duckduckgo", + action="store_true", + ) + advance_options.add_argument( + "--no-ui", dest="set_ui", default=False, help="Don't customise firefox UI elements", action="store_true", + ) + + set_homepage = not parser.parse_args().set_homepage + set_ui = not parser.parse_args().set_ui args = parser.parse_args() run( args.profile_name, args.user_overrides_url, args.skip_extensions, - args.setup_main, - args.setup_alt, + args.import_profile, args.advance_setup, + set_homepage, + set_ui, ) -def run(profile_name, user_overrides_url, skip_extensions, setup_main, setup_alt, advance_setup): - if not setup_main and not setup_alt: - if gui_mode: - print("ERROR: At Least One of the two, 'setup_main' or 'setup_alt' Option Is Required") - else: - print( - "ERROR: At Least One of the two, '--setup-main' or '--setup-alt' \n" - "Option Is Required. See 'privacyfighter -h' for help" - ) - sys.exit(1) - - if not latest_version(): - sys.exit(1) +def run(profile_name, user_overrides_url, skip_extensions, import_profile, advance_setup, set_homepage, set_ui): if firefox_is_running(): print("Firefox is currently running, please close firefox first then run Privacy Fighter again") sys.exit(1) + if not latest_version(): + sys.exit(1) - firefox_path = get_firefox_path() + # if advance_setup is used and no profile name is given, name it "privacy-fighter-advance" + if advance_setup and profile_name == "privacy-fighter": + profile_name = "privacy-fighter-advance" + + detected_os = sys.platform + + # path to firefox profiles + firefox_path = get_firefox_profiles_path(detected_os) + + firefox_ini_path = get_firefox_ini_path(detected_os) + firefox_ini_config = parse_firefox_ini_config(firefox_ini_path) + + if not pf_profile_exists(profile_name, firefox_ini_config): + create_pf_profile(profile_name, firefox_path, firefox_ini_path, firefox_ini_config, detected_os) + import_profile_data(import_profile, profile_name, firefox_path, firefox_ini_config) + setup_pf_profile( + profile_name, firefox_path, user_overrides_url, skip_extensions, advance_setup, set_homepage, set_ui + ) - if setup_main: - setup_main_profile(firefox_path, profile_name, user_overrides_url, skip_extensions, advance_setup) - if setup_alt: - setup_alt_profile(firefox_path) + # set firefox config to ask which profile to choose everytime you run firefox + dont_autoselect_profiles(firefox_ini_path, firefox_ini_config) # cleanup shutil.rmtree(temp_folder) - print("------------------DONE-------------------\n") + print("\n------------------DONE-------------------\n") # here subprocess.run("firefox -p -no-remote"), ask user to create another profile TEMP, https://github.com/mhammond/pywin32 print( "You can now close this and run Firefox :)\n\n" @@ -158,75 +208,119 @@ def run(profile_name, user_overrides_url, skip_extensions, setup_main, setup_alt ) -# The actual setup: if unless specified, the 'default' firefox profile will be setup with privacyfighter configs. -def setup_main_profile(firefox_path, profile_name, user_overrides_url, skip_extensions, advance_setup): - # list of profile_dir names under "firefox_path" - profile_dirs = [d for d in os.listdir(firefox_path) if os.path.isdir(os.path.join(firefox_path, d))] +# The actual setup: unless specified, a firefox profile with the name 'privacy-fighter' will be created and configured. +def setup_pf_profile( + profile_name, firefox_path, user_overrides_url, skip_extensions, advance_setup, set_homepage, set_ui +): + print("Setting up Firefox Profile '", profile_name, "'\n") - # Firefox sometimes creates profile "default-release", or after reset "default-release-1231212" - # When profile_name == "default" install PF in all profiles with "default" in their names - if profile_name == "default": - matches = fnmatch.filter(profile_dirs, "*{}*".format(profile_name)) - else: - matches = fnmatch.filter(profile_dirs, "*{}".format(profile_name)) - matches.extend(fnmatch.filter(profile_dirs, "*{}-*".format(profile_name))) - - if not matches: - print("ERROR: No Firefox Profile Found With The Name of '{}'. If Unsure Keep it 'default'".format(profile_name)) - sys.exit(1) - elif len(matches) > 1 and profile_name != "default": - print( - "ERROR: 'Profile Name' string matches more than one profile folders, ", - "please provide the full name with -p : ", - matches, - "\n", - ) - sys.exit(1) - else: - profiles = [os.path.join(firefox_path, d) for d in matches] - print("Firefox Profile to be secured/modified : ", profiles, "\n") - - # only setup ghacksuserjs, is specified in advance configs, otherwise simpler "my-user.js" + # only setup ghacks-user.js, in advance mode, otherwise setup the "basic-user.js" if advance_setup: - setup_ghacksuserjs(user_overrides_url) + setup_ghacks_userjs(user_overrides_url) else: - setup_myuserjs() + setup_basic_userjs() if not skip_extensions: setup_extensions(advance_setup) - for profile in profiles: - # firefox profile path on the os - firefox_p_path = os.path.join(firefox_path, profile) - backup_prefsjs(firefox_p_path) - print("\nModified Preferences (user.js) and Extensions will now be copied to {}".format(profile)) - recusive_copy(temp_folder, firefox_p_path) # copies modified user.js, extensions - apply_one_time_prefs(profile) # modifies "prefs.js" + # privacy-fighter profile path on the os + pf_profile_path = os.path.join(firefox_path, profile_name) + backup_prefsjs(pf_profile_path) + print("\nModified Preferences (user.js) and Extensions will now be copied to {}".format(pf_profile_path)) + recusive_copy(temp_folder, pf_profile_path) # copies modified user.js, extensions + if set_homepage: + # set homepage to duckduckgo.com + apply_one_time_prefs(pf_profile_path, repo_location + "/profile/set-homepage.json") + if set_ui: + # Customize Firefox UI to better fit all addons + apply_one_time_prefs(pf_profile_path, repo_location + "/profile/set-ui.json") -# The 'alternative' firefox profile. -def setup_alt_profile(firefox_path, profile_name="alternative"): - # list of profile_dir names under "firefox_path" - profile_dirs = [d for d in os.listdir(firefox_path) if os.path.isdir(os.path.join(firefox_path, d))] - # find *alternative and *alternative-* - matches = fnmatch.filter(profile_dirs, "*{}".format(profile_name)) - matches.extend(fnmatch.filter(profile_dirs, "*{}-*".format(profile_name))) +def parse_firefox_ini_config(firefox_ini_path): + config = configparser.ConfigParser() + config.optionxform = str # preserve string case - profiles = [os.path.join(firefox_path, d) for d in matches] + config.read(firefox_ini_path) + return config - if not profiles: - print( - "\nERROR: No Firefox Profile Found With The Name of '{}'.\n".format(profile_name), - "First Create It (visit 'about:profiles' in Firefox) Then Run This Again\n", - ) - else: - for profile in profiles: - print("Firefox Profile to be configured as an alternative : ", profile, "\n") - alt_userjs_path = os.path.join(firefox_path, profile, "user.js") - download_file( - "https://raw.githubusercontent.com/jotyGill/privacy-fighter/master/privacyfighter/profile/alternative-user.js", - alt_userjs_path, - ) + +def pf_profile_exists(profile_name, firefox_ini_config): + for section in firefox_ini_config.sections(): + try: + if firefox_ini_config.get(section, "Name") == profile_name: + return True + except configparser.NoOptionError: + pass + return False + + +def create_pf_profile(profile_name, firefox_path, firefox_ini_path, firefox_ini_config, detected_os): + all_sections = firefox_ini_config.sections() + # print(config.sections()) + + pf_profile_path = os.path.join(firefox_path, profile_name) + os.makedirs(pf_profile_path, exist_ok=True) + + # find the number of profiles setup in profiles.ini + existing_no_of_profiles = len([p for p in all_sections if "Profile" in p]) + + # choose new_profile's index to be same as len(existing profiles) + # as existing profiles start from index 0 to len, excluding len + new_profile = "Profile{!s}".format(existing_no_of_profiles) + + if detected_os == "linux": + firefox_ini_config[new_profile] = {"Name": profile_name, "IsRelative": "1", "Path": profile_name} + elif detected_os == "win32": + firefox_ini_config[new_profile] = { + "Name": profile_name, + "IsRelative": "1", + "Path": "Profiles/{}".format(profile_name), + } + elif detected_os == "darwin": + firefox_ini_config[new_profile] = { + "Name": profile_name, + "IsRelative": "1", + "Path": "Profiles/{}".format(profile_name), + } + firefox_ini_config.write(open(firefox_ini_path, "w"), space_around_delimiters=False) + + +def import_profile_data(import_profile, profile_name, firefox_path, firefox_ini_config): + all_sections = firefox_ini_config.sections() + # print(all_sections) + + import_profile_release = import_profile + "-release" + import_profile_path = "" + + # Files to copy that store bookmarks, passwords db, site prefs etc. + data_files = [ + "places.sqlite", + "favicons.sqlite", + "key4.db", + "logins.json", + "permissions.sqlite", + "formhistory.sqlite", + ] + + for section in all_sections: + try: + if import_profile_release in firefox_ini_config.get(section, "Name"): + import_profile_path = os.path.join(firefox_path, firefox_ini_config.get(section, "Path")) + except configparser.NoOptionError: + pass + # If "default-release" doesn't exist, find "default" + if not import_profile_path: + for section in all_sections: + try: + if firefox_ini_config.get(section, "Name") == import_profile: + # print(section) + import_profile_path = os.path.join(firefox_path, firefox_ini_config.get(section, "Path")) + # print(import_profile_path) + except configparser.NoOptionError: + pass + + for file in data_files: + shutil.copy2(os.path.join(import_profile_path, file), os.path.join(firefox_path, profile_name)) def resource_path(relative_path): @@ -240,9 +334,7 @@ def resource_path(relative_path): def setup_extensions(advance_setup): # Download the extensions list with their download links from the repo - ext_list = get_file( - "https://raw.githubusercontent.com/jotyGill/privacy-fighter/master/privacyfighter/profile/extensions.json" - ) + ext_list = get_file(repo_location + "/profile/extensions.json") extensions = ext_list.json()["extensions"] for index, ext in enumerate(extensions): @@ -253,14 +345,12 @@ def setup_extensions(advance_setup): # Download and save extension.xpi files extension_xpi = get_file(ext["url"]) open(os.path.join(extensions_folder, ext["id"]), "wb").write(extension_xpi.content) - - print("progress: {}/{}".format(index + 1, total_steps)) + if gui_mode: + print("progress: {}/{}".format(index + 1, total_steps)) sys.stdout.flush() # Download the "browser-extensions-data". these are extension's configuration files - extensions_configs = get_file( - "https://raw.githubusercontent.com/jotyGill/privacy-fighter/master/privacyfighter/profile/browser-extension-data.zip" - ) + extensions_configs = get_file(repo_location + "/profile/browser-extension-data.zip") with zipfile.ZipFile(io.BytesIO(extensions_configs.content)) as thezip: thezip.extractall(temp_folder) @@ -289,17 +379,14 @@ def download_file(url, dest): sys.exit(1) -# Installs the default mininal userjs -def setup_myuserjs(): - # Download the simpler my-user.js - download_file( - "https://raw.githubusercontent.com/jotyGill/privacy-fighter/master/privacyfighter/profile/my-user.js", - os.path.join(temp_folder, "user.js"), - ) +# Installs the default basic userjs +def setup_basic_userjs(): + # Download the simpler basic-user.js + download_file(repo_location + "/profile/basic/basic-user.js", os.path.join(temp_folder, "user.js")) # Installs the ghacks-user.js and applies the user_overrides -def setup_ghacksuserjs(user_overrides_url): +def setup_ghacks_userjs(user_overrides_url): # Download the ghacks user.js download_file( "https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js", @@ -355,17 +442,13 @@ def extract_user_overrides(): # apply some prefs directly to "pref.js", users can change these later. -def apply_one_time_prefs(profile): - print("\nApplying onetime preferences to 'prefs.js'") - +def apply_one_time_prefs(profile, prefjs): # prefs to be applied directly to 'prefs.js' instead of 'user.js' so end users can change these # contains 'exists' to change if found and turn 'exists' True. the ones not found will be later added # keep this in profile loop, so 'exists' True resets for next profile - # Download the "one time prefs" from the repo - r = get_file( - "https://raw.githubusercontent.com/jotyGill/privacy-fighter/master/privacyfighter/profile/one-time-prefs.json" - ) + # Download the config file containing preferences from the location + r = get_file(prefjs) one_time_prefs = r.json()["prefs"] prefsjs_file = os.path.join(profile, "prefs.js") @@ -394,9 +477,7 @@ def apply_one_time_prefs(profile): prefsjs.write(line) -def get_firefox_path(): - detected_os = sys.platform - +def get_firefox_profiles_path(detected_os): if detected_os == "linux": firefox_path = os.path.join(Path.home(), ".mozilla/firefox/") elif detected_os == "win32": @@ -412,8 +493,18 @@ def get_firefox_path(): return firefox_path +def get_firefox_ini_path(detected_os): + if detected_os == "linux": + firefox_ini_path = os.path.join(Path.home(), ".mozilla/firefox/profiles.ini") + elif detected_os == "win32": + firefox_ini_path = os.path.join(os.getenv("APPDATA"), "Mozilla\Firefox\profiles.ini") + elif detected_os == "darwin": + firefox_ini_path = os.path.join(Path.home(), "Library/Application Support/Firefox/profiles.ini") + + return firefox_ini_path + + def latest_version(): - # https://github.com/jotyGill/privacy-fighter/releases/latest/download/version.txt latest_version = get_file( "https://github.com/jotyGill/privacy-fighter/releases/latest/download/version.txt" ).text.strip() @@ -421,23 +512,26 @@ def latest_version(): return True print("Newer Privacy Fighter version = {} is available.".format(latest_version)) if gui_mode: - print("please download the latest version from https://github.com/jotyGill/privacy-fighter/releases/latest/") + print("Please download the latest version from https://github.com/jotyGill/privacy-fighter/releases/latest/") else: - print("please install the latest version with 'python3 -m pip install --user -U privacyfighter'") + print( + "Please download the latest version from " + "https://github.com/jotyGill/privacy-fighter/releases/latest/ or upgrade via pip" + ) return False -def backup_prefsjs(firefox_p_path): - prefsjs_path = os.path.join(firefox_p_path, "prefs.js") - prefsjs_backups_folder = os.path.join(firefox_p_path, "prefs-backups") +def backup_prefsjs(pf_profile_path): + prefsjs_path = os.path.join(pf_profile_path, "prefs.js") + prefsjs_backups_folder = os.path.join(pf_profile_path, "prefs-backups") prefsjs_backup_name = os.path.join( prefsjs_backups_folder, ("prefs-" + str(datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S") + ".js")) ) # create directory to store "prefs.js" backups # Changed in version 3.6: Accepts a path-like object. os.makedirs(prefsjs_backups_folder, exist_ok=True) - print("\nBacking up the current 'prefs.js' to '{}'".format(prefsjs_backup_name)) if os.path.exists(prefsjs_path): + print("\nBacking up the current 'prefs.js' to '{}'".format(prefsjs_backup_name)) shutil.move(prefsjs_path, prefsjs_backup_name) @@ -468,7 +562,7 @@ def recusive_copy(source_path, destination_path): # print("Copying: ", src_file) # create parent directory os.makedirs(os.path.dirname(dst_file_path), exist_ok=True) - shutil.copy(src_file_path, dst_file_path) + shutil.copy2(src_file_path, dst_file_path) def firefox_is_running(): @@ -485,5 +579,19 @@ def firefox_is_running(): return False +# set firefox config to ask which profile to choose everytime you run firefox +def dont_autoselect_profiles(firefox_ini_path, firefox_ini_config): + + try: + firefox_ini_config.get("General", "StartWithLastProfile") + firefox_ini_config["General"]["StartWithLastProfile"] = "0" + except configparser.NoSectionError: + firefox_ini_config["General"] = {"StartWithLastProfile": "0"} + except configparser.NoOptionError: + firefox_ini_config["General"]["StartWithLastProfile"] = "0" + + firefox_ini_config.write(open(firefox_ini_path, "w"), space_around_delimiters=False) + + if __name__ == "__main__": main() diff --git a/privacyfighter/profile/user-overrides.js b/privacyfighter/profile/advance/user-overrides.js similarity index 100% rename from privacyfighter/profile/user-overrides.js rename to privacyfighter/profile/advance/user-overrides.js diff --git a/privacyfighter/profile/alternative-user.js b/privacyfighter/profile/alternative-user.js deleted file mode 100644 index 970728b..0000000 --- a/privacyfighter/profile/alternative-user.js +++ /dev/null @@ -1,27 +0,0 @@ - - -/* PRIVACY FIGHTHER 'user.js' FOR 'alternative' PROFILE - -This setup only clears all types of persistent storage (cookies, caches, offline data) on shutdown. -To be used with the 'alternative' profile. Much better option than needing Chrome for rare occations when -a website breaks in the main profile. - -***/ - - -user_pref("privacyfighter.config.version", 69.0.0); // corresponds to firefox version, run PF again to fetch latest configuration sets - - -// enforce caches, cookies, ofline data to clear on shutdown -user_pref("privacy.sanitize.sanitizeOnShutdown", true); - -user_pref("privacy.clearOnShutdown.cache", true); -user_pref("privacy.clearOnShutdown.cookies", true); -user_pref("privacy.clearOnShutdown.offlineApps", true); // Offline Website Data -user_pref("privacy.clearOnShutdown.sessions", true); // Active Logins - -user_pref("privacy.clearOnShutdown.siteSettings", false); // Site Preferences -user_pref("privacy.clearOnShutdown.history", false); // Browsing & Download History -user_pref("privacy.clearOnShutdown.formdata", false); // Form & Search History -user_pref("privacy.clearOnShutdown.downloads", false); -user_pref("privacy.clearOnShutdown.openWindows", false); diff --git a/privacyfighter/profile/my-user.js b/privacyfighter/profile/basic/basic-user.js similarity index 100% rename from privacyfighter/profile/my-user.js rename to privacyfighter/profile/basic/basic-user.js diff --git a/privacyfighter/profile/extensions.json b/privacyfighter/profile/extensions.json index 772f35c..bf1da7b 100644 --- a/privacyfighter/profile/extensions.json +++ b/privacyfighter/profile/extensions.json @@ -1,14 +1,14 @@ { "extensions": [ - {"name": "decentraleyes", "id": "jid1-BoFifL9Vbdl2zQ@jetpack.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3423038/decentraleyes-2.0.13-an+fx.xpi"}, - {"name": "https_everywhere", "id": "https-everywhere@eff.org.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3060290/https_everywhere-2019.6.27-an+fx.xpi"}, - {"name": "ublock_origin", "id": "uBlock0@raymondhill.net.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3412681/ublock_origin-1.22.4-an+fx.xpi"}, - {"name": "canvas_blocker", "id": "CanvasBlocker@kkapsner.de.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3410720/canvasblocker-0.5.14-an+fx.xpi"}, - {"name": "clear_urls", "id": "{74145f27-f039-47ce-a470-a662b129930a}.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3429897/clearurls-1.9.0-an+fx.xpi"}, - {"name": "temporary_containers", "id": "{c607c8df-14a7-4f28-894f-29e8722976af}.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3366287/temporary_containers-1.2-fx.xpi"}, - {"name": "terms_of_service_didnt_read", "id": "jid0-3GUEt1r69sQNSrca5p8kx9Ezc3U@jetpack.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/1050617/terms_of_service_didnt_read-2.0.0-an+fx.xpi"}, - {"name": "enforce_browser_fonts", "id": "{83e08b00-32de-44e7-97bb-1bab84d1350f}.xpi", "advance_setup": "True", "url": "https://addons.mozilla.org/firefox/downloads/file/3364323/enforce_browser_fonts-0.3-fx.xpi"}, - {"name": "privacybadger", "id": "jid1-MnnxcxisBPnSXQ@jetpack.xpi", "advance_setup": "True", "url": "https://addons.mozilla.org/firefox/downloads/file/3420722/privacy_badger-2019.10.8-an+fx.xpi"} + {"name": "Decentraleyes", "id": "jid1-BoFifL9Vbdl2zQ@jetpack.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3423038/decentraleyes-2.0.13-an+fx.xpi"}, + {"name": "HTTPS Everywhere", "id": "https-everywhere@eff.org.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3442258/https_everywhere-2019.11.7-an+fx.xpi"}, + {"name": "uBlock Origin", "id": "uBlock0@raymondhill.net.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3452970/ublock_origin-1.24.2-an+fx.xpi"}, + {"name": "CanvasBlocker", "id": "CanvasBlocker@kkapsner.de.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3410720/canvasblocker-0.5.14-an+fx.xpi"}, + {"name": "ClearURLs", "id": "{74145f27-f039-47ce-a470-a662b129930a}.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3453790/clearurls-1.9.4-an+fx.xpi"}, + {"name": "Temporary Containers", "id": "{c607c8df-14a7-4f28-894f-29e8722976af}.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/3366287/temporary_containers-1.2-fx.xpi"}, + {"name": "Terms of Service; Didn’t Read", "id": "jid0-3GUEt1r69sQNSrca5p8kx9Ezc3U@jetpack.xpi", "advance_setup": "False", "url": "https://addons.mozilla.org/firefox/downloads/file/1050617/terms_of_service_didnt_read-2.0.0-an+fx.xpi"}, + {"name": "Enforce Browser Fonts", "id": "{83e08b00-32de-44e7-97bb-1bab84d1350f}.xpi", "advance_setup": "True", "url": "https://addons.mozilla.org/firefox/downloads/file/3364323/enforce_browser_fonts-0.3-fx.xpi"}, + {"name": "Privacy Badger", "id": "jid1-MnnxcxisBPnSXQ@jetpack.xpi", "advance_setup": "True", "url": "https://addons.mozilla.org/firefox/downloads/file/3448925/privacy_badger-2019.11.18-an+fx.xpi"} ] } diff --git a/privacyfighter/profile/set-homepage.json b/privacyfighter/profile/set-homepage.json new file mode 100644 index 0000000..34d9eb7 --- /dev/null +++ b/privacyfighter/profile/set-homepage.json @@ -0,0 +1,7 @@ +{ + "prefs": + [ + {"pref": "\"browser.startup.homepage\"", "value": "\"https://duckduckgo.com/?kak=-1&kax=-1\"", "exists": false}, + {"pref": "\"browser.startup.page\"", "value": "\"https://duckduckgo.com/?kak=-1&kax=-1\"", "exists": false} + ] +} diff --git a/privacyfighter/profile/one-time-prefs.json b/privacyfighter/profile/set-ui.json similarity index 85% rename from privacyfighter/profile/one-time-prefs.json rename to privacyfighter/profile/set-ui.json index 72de4ab..434dc94 100644 --- a/privacyfighter/profile/one-time-prefs.json +++ b/privacyfighter/profile/set-ui.json @@ -1,8 +1,6 @@ { "prefs": [ - {"pref": "\"browser.uiCustomization.state\"", "value": "\"{\\\"placements\\\":{\\\"widget-overflow-fixed-list\\\":[],\\\"nav-bar\\\":[\\\"back-button\\\",\\\"forward-button\\\",\\\"stop-reload-button\\\",\\\"home-button\\\",\\\"urlbar-container\\\",\\\"downloads-button\\\",\\\"library-button\\\",\\\"sidebar-button\\\",\\\"fxa-toolbar-menu-button\\\",\\\"canvasblocker_kkapsner_de-browser-action\\\",\\\"https-everywhere_eff_org-browser-action\\\",\\\"jid1-bofifl9vbdl2zq_jetpack-browser-action\\\",\\\"ublock0_raymondhill_net-browser-action\\\",\\\"_74145f27-f039-47ce-a470-a662b129930a_-browser-action\\\",\\\"_83e08b00-32de-44e7-97bb-1bab84d1350f_-browser-action\\\"],\\\"toolbar-menubar\\\":[\\\"menubar-items\\\"],\\\"TabsToolbar\\\":[\\\"tabbrowser-tabs\\\",\\\"new-tab-button\\\",\\\"alltabs-button\\\",\\\"_c607c8df-14a7-4f28-894f-29e8722976af_-browser-action\\\"],\\\"PersonalToolbar\\\":[\\\"personal-bookmarks\\\"]},\\\"seen\\\":[\\\"developer-button\\\",\\\"_c607c8df-14a7-4f28-894f-29e8722976af_-browser-action\\\",\\\"canvasblocker_kkapsner_de-browser-action\\\",\\\"https-everywhere_eff_org-browser-action\\\",\\\"jid1-bofifl9vbdl2zq_jetpack-browser-action\\\",\\\"ublock0_raymondhill_net-browser-action\\\",\\\"_74145f27-f039-47ce-a470-a662b129930a_-browser-action\\\",\\\"_83e08b00-32de-44e7-97bb-1bab84d1350f_-browser-action\\\"],\\\"dirtyAreaCache\\\":[\\\"nav-bar\\\",\\\"TabsToolbar\\\"],\\\"currentVersion\\\":16,\\\"newElementCount\\\":5}\"", "exists": false}, - {"pref": "\"browser.startup.homepage\"", "value": "\"https://duckduckgo.com/?kak=-1&kax=-1\"", "exists": false}, - {"pref": "\"browser.startup.page\"", "value": "\"https://duckduckgo.com/?kak=-1&kax=-1\"", "exists": false} + {"pref": "\"browser.uiCustomization.state\"", "value": "\"{\\\"placements\\\":{\\\"widget-overflow-fixed-list\\\":[],\\\"nav-bar\\\":[\\\"back-button\\\",\\\"forward-button\\\",\\\"stop-reload-button\\\",\\\"home-button\\\",\\\"urlbar-container\\\",\\\"downloads-button\\\",\\\"library-button\\\",\\\"sidebar-button\\\",\\\"fxa-toolbar-menu-button\\\",\\\"canvasblocker_kkapsner_de-browser-action\\\",\\\"https-everywhere_eff_org-browser-action\\\",\\\"jid1-bofifl9vbdl2zq_jetpack-browser-action\\\",\\\"ublock0_raymondhill_net-browser-action\\\",\\\"_74145f27-f039-47ce-a470-a662b129930a_-browser-action\\\",\\\"_83e08b00-32de-44e7-97bb-1bab84d1350f_-browser-action\\\"],\\\"toolbar-menubar\\\":[\\\"menubar-items\\\"],\\\"TabsToolbar\\\":[\\\"tabbrowser-tabs\\\",\\\"new-tab-button\\\",\\\"alltabs-button\\\",\\\"_c607c8df-14a7-4f28-894f-29e8722976af_-browser-action\\\"],\\\"PersonalToolbar\\\":[\\\"personal-bookmarks\\\"]},\\\"seen\\\":[\\\"developer-button\\\",\\\"_c607c8df-14a7-4f28-894f-29e8722976af_-browser-action\\\",\\\"canvasblocker_kkapsner_de-browser-action\\\",\\\"https-everywhere_eff_org-browser-action\\\",\\\"jid1-bofifl9vbdl2zq_jetpack-browser-action\\\",\\\"ublock0_raymondhill_net-browser-action\\\",\\\"_74145f27-f039-47ce-a470-a662b129930a_-browser-action\\\",\\\"_83e08b00-32de-44e7-97bb-1bab84d1350f_-browser-action\\\"],\\\"dirtyAreaCache\\\":[\\\"nav-bar\\\",\\\"TabsToolbar\\\"],\\\"currentVersion\\\":16,\\\"newElementCount\\\":5}\"", "exists": false} ] } diff --git a/privacyfighter/version.txt b/privacyfighter/version.txt index 26aaba0..227cea2 100644 --- a/privacyfighter/version.txt +++ b/privacyfighter/version.txt @@ -1 +1 @@ -1.2.0 +2.0.0 diff --git a/setup.py b/setup.py index a3f5d29..9dfac2d 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ # pf_location = os.path.join(os.path.abspath(os.path.dirname(__file__)), "privacyfighter") # exec(open(os.path.join(pf_location, "version.py")).read()) -__version__ = "1.3.0.dev1" +__version__ = "2.0.0" if sys.version_info < (3, 5): sys.stderr.write("ERROR: requires Python 3.5 or above." + "Install using 'pip3' instead of just 'pip' \n")