SelfControlApp / selfcontrol

:skull: Mac app to block your own access to distracting websites etc for a predetermined period of time. It can not be undone by the app or by a restart – you must wait for the timer to run out.
http://selfcontrolapp.com
GNU General Public License v3.0
4.07k stars 402 forks source link

SelfControl breaks Pow #265

Open radex opened 9 years ago

radex commented 9 years ago

When I have SelfControl turned on, Pow (http://pow.cx) stops working.

To give some context, Pow is a local web server that serves websites on *.dev domains. What I managed to figure out is that on Yosemite, Pow uses pf to redirect port 80 traffic on .dev to Pow-internal port 20559. SelfControl also uses pf configuration and something gets screwed up, and .dev domains stop working the same way blacklisted domains stop working.

If someone has a clue, please do @-ping me. I know Objective-C so I might be able to make a pull request if I know what to fix.

I'm using S.C. version 2.0.2.

jpowell commented 9 years ago

If this is occurring for me, anyone know how to disable the block enabled by self-control?

jpowell commented 9 years ago

nvm, just edit the /etc/hosts config file

jpowell commented 9 years ago

Actually, SelfControl rewrites the rules to /etc/hosts via some recurring job... going to dig deeper since I need to get some work done today...

shawnonthenet commented 9 years ago

@jpowell jpowell to get pow working again sudo vi /etc/pf.conf comment out the eyebeam lines then save and run sudo pfctl -f /etc/pf.conf Self control will still run and pow should work again.

dpmccabe commented 9 years ago

@shawnonthenet Is that something that needs to be done every time you start a block?

shawnonthenet commented 9 years ago

@dpmccabe you will have to rerun the pfctl command each time but you shouldn't have to edit the file again.

shawnonthenet commented 9 years ago

@dpmccabe I just restarted selfcontrol(I had a 1 year block previously so hadn't tried a new block just modifying it) and unfortunately you do need to make the edit each time as well.

This will do it for you as a oneliner to make it a bit quicker:

sudo sed -i -e '/[[:<:]]org.eyebeam[[:>:]]/ s/^/# /' /etc/pf.conf && sudo pfctl -f /etc/pf.conf

eightyfive commented 9 years ago

The exact same thing happens to me but on a tailored Apache configuration following this article: https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew

The 127.0.0.1:80 --> 8080 port forwarding is being broken/removed when starting a Block.

Here is the startup shell script doing the port forwarding:

rdr pass proto tcp from any to any port {80,8080} -> 127.0.0.1 port 8080" | pfctl -a "com.apple/260.HttpFwdFirewall" -Ef - && echo "rdr pass proto tcp from any to any port {443,8443} -> 127.0.0.1 port 8443" | pfctl -a "com.apple/261.HttpFwdFirewall" -Ef - && sysctl -w net.inet.ip.forwarding=1

Is there a way to prevent that issue?

Or maybe a workaround like the one given above for Pow users?

jakeonrails commented 9 years ago

Is there any way to use the whitelist feature to allow POW?

jzk commented 9 years ago

glad/sad to know I am not alone

paulleader commented 7 years ago

Did anyone come up with a long-term fix for this?