aniketpanjwani / chomper

Internet blocker for the Linux desktop.
https://addictedto.tech/chomper/
GNU General Public License v3.0
353 stars 43 forks source link

Make Chomper compatible with MacOS. #2

Open aniketpanjwani opened 6 years ago

aniketpanjwani commented 6 years ago
Steps to reproduce the problem:

Chomper is not compatible with MacOS.

Any other comments? What have you tried so far?
  1. Do I need to replace screen in constants.py ?
  2. reset_nat and setup_nat in utils.py would need to be rewritten using the pf firewall.

Anyone have other ideas of what would need to be changed?

miheerdew commented 6 years ago

I am finally able to use pf to redirect traffic transparently to mitmproxy. MacOS has screen so that command probably doesn't need to change. Are reset_nat and setup_nat the only things that must be changed then?

aniketpanjwani commented 6 years ago

Awesome! I think a few other things would have to change:

  1. The Makefile init installation rule would need to be updated. I doubt that the automated certificate installation will work, since certificates are probably stored in different places in OSX. I think that the ip forwarding configuration also needs to be updated. As a note, if you want to work on modifying the init rule for OSX, you should look at the Makefile in the iss26 branch rather than on master.
  2. I'm not sure if the lock rule will work, simply because I'm not sure whether you can create a supplementary sudoers file in the same way that you can in Linux.
  3. In ./chomper/block.py, I interact with the root crontab through the set_block_length function. This is important for lifting blocks at the desired time. I don't know if cron works properly on OSX.
aniketpanjwani commented 6 years ago

I've largely finished automating installation on Debian-based Linuxes, and I've cleared 0.2.1. So, time to work on this issue! Here's a new order of operations:

jungle-boogie commented 6 years ago

The pf fiewall (called packet filter) originated from openBSD (my favorite OS), so if you have pf working on macOS, then it can also work on openBSD!

https://www.openbsd.org/faq/pf/ https://home.nuug.no/~peter/pf/ https://home.nuug.no/~peter/pftutorial/ https://nostarch.com/pf3