Skip to content

ShobanChiddarth/vscode-privacy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Script to increase and decrease privacy in vscode

Important Notice (for Windows Users)

  • Command execution: You Windows users should open command prompt in admin mode and run the commands mentioned here without the sudo part.

  • Privacy Concerns: It is well known that Microsoft collects your data even if you don't use VSCode.

  • Recommendation: Like every other Linux user, I am suggesting you to switch to Linux, for enhanced privacy.

  • Alternative Option: However if it is impossible at the moment, like if you are in a school computer,

    to stop the data collection (not a foolproof way but works to some extent). I have visited and tested what is said in the links myself and it works fine. I recommend you too try doing it and test it with Wireshark if you want to.

  • Host file location: Your hosts file is at C:\Windows\System32\drivers\etc\hosts

  • Error Handling: If Python throws errors while trying to open your hosts file, or if you are unable to open it manually and you are not even able to do it even after taking full ownership,

    1. Copy the file C:\Windows\System32\drivers\etc\hosts.backup to your desktop.
    2. Rename it to hosts
    3. Follow the guides linked above and update the file in your desktop accordingly
    4. Delete the original host file
    5. Copy the file in your desktop to the original location. Now you will be able to update it or edit it.
  • Note: You can't stop it 100% because Windows is proprietary spyware and that's why you should switch to Linux.

Who is this for?

This script is for those

  1. Who care about Microsoft collecting your data through VS Code telemetry without consent | Archived
  2. Can't use VSCodium because you have to use propertiary extensions / features like sync and etc
  3. And don't want Microsoft to collect your data while you are not using the features

USAGE [TL;DR]

  1. Open up vscode-privacy.py and edit SETTINGS_DOT_JSON and HOSTS_FILE to their respective paths in your computer
  2. (Optional) To create a copy of hosts file and settings.json file without changing anything, run
    sudo python3 vscode-privacy.py
  3. To increase privacy, run
    sudo python3 vscode-privacy.py --increase-privacy
  4. To decrease privacy, run
    sudo python3 vscode-privacy.py --decrease-privacy
  5. (Optional) To wipe out the copies of hosts file and settings.json file, run
    sudo python3 vscode-privacy.py --wipe

USAGE [In detail]

When this script "increases" your privacy, it appends few lines to host file and edits some settings in vscode's settings.json. They can be found in hosts_increase_privacy and settings_increase_privacy.json respectively. Alternatively, when this script "decreases" your privacy, it reverts back to what they were before you ran this script.

The few lines appended to hosts file block the vscode domains by redirecting them to localhost. And the settings edit turns off all telemetry possible. So if you want to sign in to enable sync, or install any extensions, or use any extensions that require connecting those services, make sure you aren't already blocing those domains (settings.json is not a problem initially) run

sudo python3 vscode-privacy.py --decrease-privacy

and do what you want to do.

After your job of connecting VSCode to the internet is done, run

sudo python3 vscode-privacy.py --increase-privacy

This script is for automating the process of editing host file and settings file for those who constantly need to run services that cost your privacy in vscode.

Requirements

  • Python 3.x (I used 3.11.2 while writing this script)

About

Script to increase and decrease privacy in VSCode as per your need

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages