chomper icon indicating copy to clipboard operation
chomper copied to clipboard

If you restart Chomper, settings get refreshed.

Open aniketpanjwani opened this issue 7 years ago • 4 comments

Steps to reproduce the problem:
  1. Install Chomper.
  2. Go to ./bin and enter ~./chomper coding 10.
  3. Within ten minutes, restart your computer.
  4. Networking configuration will be reset and you'll be able to browse all websites.
Any other comments? What have you tried so far?

When you install Chomper, there needs to be a cron job written to the root user's crontab which checks at boot whether there is a block_data.json file. If there is such a file, the cronjob should enact a block.

I tried writing such a cronjob, but was having trouble with it failing silently, so I ended up removing it from this first release of Chomper.

System information

Operating system: (e.g. Linux Mint 18)

aniketpanjwani avatar Feb 18 '18 06:02 aniketpanjwani

Put a file in /etc/cron.d and make sure to specify the user. The file will be owned by root, but run as the user, so paths should be found.

aniketpanjwani avatar Feb 18 '18 18:02 aniketpanjwani

Didn't work. Tried systemd - that didn't work either. Best solution right now is to install iptables-persistent, and save the NAT forwarding rules in /etc/iptables/rules.v4 and rules.v6. This will mean that when you restart your computer, you will not have internet access until the first time you run Chomper.

If you want internet access immediately after startup, you can just use ./chomper allon 1, and you'll have full Internet access, and after a minute, the proxy process will be killed. However, if you made a previous block which has not yet expired, you will be forced to stick to that block.

Unless someone can give a more sophisticated working solution, let's do this. I just need to think about whether it should be configured in make init, make lock, or elsewhere.

aniketpanjwani avatar Feb 18 '18 22:02 aniketpanjwani

Make chomper into a daemon which runs automatically at startup. The configuration should be in a file only writable by root (connected to #9).

miheerdew avatar Feb 20 '18 21:02 miheerdew

As I recall, I found this difficult, because @reboot tasks on the root crontab seemed to consistently be ignored, either because @reboot didn't work, or because I couldn't access the user's PATH variable. Pretty important feature though, so let's aim to make this part of 0.3.0.

aniketpanjwani avatar Mar 23 '18 02:03 aniketpanjwani