Coder Social home page Coder Social logo

aniketpanjwani / chomper Goto Github PK

View Code? Open in Web Editor NEW
354.0 354.0 43.0 966 KB

Internet blocker for the Linux desktop.

Home Page: https://addictedto.tech/chomper/

License: GNU General Public License v3.0

Makefile 8.12% Python 82.31% Shell 9.57%
python

chomper's People

Contributors

aniketpanjwani avatar sarg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chomper's Issues

Make use of online blacklists

  • Do you want to request a feature or report a bug?
    I want to report feature.

  • What is the current behavior?
    Not present.

  • What is the expected behavior?
    Allow to set blacklist from online.

  • What is the motivation / use case for changing the behavior?
    Make chomper better.

Chomper gets in between SSL connections

Note: for support questions, please use Gitter. This repository's issues are reserved for feature requests and bug reports.

  • Do you want to request a feature or report a bug?
    Bug

  • What is the current behavior?

I installed chomper first with a installation guide I found via Google that was from February and was most likely out of date. After running in the first problems I found that there is now a installation script, so I worked with it. This might have lead to some mix-ups.
Chomper installed, executed fine, but it got in the way with SSL sites - which means nearly every site these days. Means: I can't access them at all.

I then realized my system lacked mitmproxy and I installed it. (The dependency should be mentioned on the install page). I deleted ~/.pyenv ~/.virtualenvs and ~/chomper and started the installation process again. This time it looked fine mitmproxy-wise at first glance.
Yet now the shell reports the error: pyenv: no such command `sh-activate'.

I still can't access SSL sites when chomper is running, despite mitmproxy is now installed.

  • What is the expected behavior?

Let me access SSL sites that are not blocked or whitelisted.

Chomper never unblocks, requires reboot

  • Do you want to request a feature or report a bug?

Report a bug.

  • What is the current behavior?

I ran chomper 60 to block me for an hour. Maybe because it was close to midnight, when it came to "release" time chomper told me it would unblock things at 23:59 of today. sudo make reset gave me this message, so I had to reboot:

sudo env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/sbin:/sbin /home/mrbig/.local/share/virtualenvs/chomper-tBlCykeL/bin/python3.6m /home/mrbig/chomper/chomper/reset.py
env: ‘/home/mrbig/.local/share/virtualenvs/chomper-tBlCykeL/bin/python3.6m’: No such file or directory
Makefile:23: recipe for target 'reset' failed
make: *** [reset] Error 127
  • What is the expected behavior?

Block me for 1 hour.

Runtime Environment

  • Chomper Release or Commit: e.g. 0.2.0
  • Browser: Google Chrome 71.0.3578.98
  • Operating System: MX Linux 17
  • My dotfiles

Update

Just tried again. Ran chomper coding 3 At 00:21. It's 00:28 and both Chrome and Firefox are giving me the following message:

Website blocked by Chomper! The coding rule is in effect until 2019-01-05 23:59:00.

Now I have to reboot again to send you this update :P

Incidentally, chomper did not create a hidden directory like in the docs, but a ~/chomper. Maybe that's relevant.

Update 2

Tested again with a blocklist (so I don't need to reboot every single time!) and the results were the same. I created the rule:

testing:
  - block_type:
      - blacklist
  - addresses:
      - lifehacker.com

And ran chomper testing 2. 10 minutes after the deadline, the domain remains inaccessible:

Website blocked by Chomper! The testing rule is in effect until 2019-01-06 00:59:00.

If you restart Chomper, settings get refreshed.

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)

Installation fails on Elementary OS

Steps to reproduce the problem:
  1. git clone https://github.com/aniketpanjwani/chomper.git
  2. cd chomper
  3. make init

Results:

Updating /home/datasc/.pyenv/plugins/pyenv-installer...
From https://github.com/pyenv/pyenv-installer
 * branch            master     -> FETCH_HEAD
Already up-to-date.
Updating /home/datasc/.pyenv/plugins/pyenv-update...
From https://github.com/pyenv/pyenv-update
 * branch            master     -> FETCH_HEAD
Already up-to-date.
Updating /home/datasc/.pyenv/plugins/pyenv-virtualenv...
From https://github.com/pyenv/pyenv-virtualenv
 * branch            master     -> FETCH_HEAD
Already up-to-date.
Updating /home/datasc/.pyenv/plugins/pyenv-which-ext...
From https://github.com/pyenv/pyenv-which-ext
 * branch            master     -> FETCH_HEAD
Already up-to-date.
pyenv install 3.6.4
Downloading Python-3.6.4.tar.xz...
-> https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
Installing Python-3.6.4...
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems


BUILD FAILED (elementary 0.4.1 using python-build 20160602)

Inspect or clean up the working tree at /tmp/python-build.20180316085627.17629
Results logged to /tmp/python-build.20180316085627.17629.log

Last 10 log lines:
                install|*) ensurepip="" ;; \
        esac; \
         ./python -E -m ensurepip \
                $ensurepip --root=/ ; \
fi
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-9.0.1 setuptools-28.8.0
make[1]: Leaving directory '/tmp/python-build.20180316085627.17629/Python-3.6.4'
Makefile:16: recipe for target 'init' failed
make: *** [init] Error 1

log:

/tmp/python-build.20180316085627.17629 ~/chomper
/tmp/python-build.20180316085627.17629/Python-3.6.4 /tmp/python-build.20180316085627$
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for python3.6... python3.6
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... linux
checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for a sed that does not truncate output... /bin/sed
checking for --with-cxx-main=<compiler>... no
checking for g++... no
configure:

  By default, distutils will build C++ extension modules with "g++".
  If this is not intended, then set CXX on the configure command line.

checking for the platform triplet based on compiler characteristics... x86_64-linux-$
checking for -Wl,--no-as-needed... yes
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
Any other comments? What have you tried so far?

Run sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev then tried make init again. Another error message was then ouput:

cryptography-2.1.4 enum34-1.1.6 idna-2.6 ipaddress-1.0.19 ordereddict-1.1 pathlib-1.0.1 pip-9.0.1 pipenv-11.8.0 pyOpenSSL-17.5.0 pycparser-2.18 requests-2.18.4 setuptools-38.6.0 six-1.11.0 urllib3-1.22 virtualenv-15.1.0 virtualenv-clone-0.3.0
pipenv install --dev --python 3.6.4 # Install packages
Creating a virtualenv for this project…
Using /home/datasc/anaconda3/bin/python3.6m (3.6.4) to create virtualenv…
⠋Running virtualenv with interpreter /home/datasc/anaconda3/bin/python3.6m
Using base prefix '/home/datasc/anaconda3'
New python executable in /home/datasc/.local/share/virtualenvs/chomper-rKYEYeN9/bin/python3.6m
Also creating executable in /home/datasc/.local/share/virtualenvs/chomper-rKYEYeN9/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /home/datasc/.local/share/virtualenvs/chomper-rKYEYeN9         Installing dependencies from Pipfile.lock (69728f)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 45/45 — 00:01:49
To activate this project's virtualenv, run the following:
 $ pipenv shell
pipenv run mitmdump & sleep 2 && kill -9 $! # Generate certificates
Proxy server listening at http://*:8080
openssl x509 -outform der -in /home/datasc/.mitmproxy/mitmproxy-ca.pem -out /home/datasc/.mitmproxy/mitmproxy-ca.crt
sudo cp /home/datasc/.mitmproxy/mitmproxy-ca.crt /usr/local/share/ca-certificates/mitmproxy-ca.crt # Install root certificates
sudo update-ca-certificates
Updating certificates in /etc/ssl/certs...
WARNING: mitmproxy-ca.pem does not contain a certificate or CRL: skipping
1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...

Adding debian:mitmproxy-ca.pem
done.
done.
sudo sh ./chomper/certs.sh # Make browsers recognize root certificates
./chomper/certs.sh: 32: ./chomper/certs.sh: certutil: not found
./chomper/certs.sh: 43: ./chomper/certs.sh: certutil: not found
./chomper/certs.sh: 43: ./chomper/certs.sh: certutil: not found
./chomper/certs.sh: 43: ./chomper/certs.sh: certutil: not found
Makefile:16: recipe for target 'init' failed
make: *** [init] Error 127
System information

Distro: 16.04.1-Ubuntu
Kernel: 4.13.0-37-generic
x86_64

Receive the following bug on running command.

Note: for support questions, please use Gitter. This repository's issues are reserved for feature requests and bug reports.

  • Do you want to request a feature or report a bug?
    A bug.

  • What is the current behavior?
    chomper latenight 2

Traceback (most recent call last):
  File "/home/dluxcru/chomper/chomper/block.py", line 144, in <module>
    main()
  File "/home/dluxcru/.local/share/virtualenvs/chomper-_VT078ST/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/dluxcru/.local/share/virtualenvs/chomper-_VT078ST/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/dluxcru/.local/share/virtualenvs/chomper-_VT078ST/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/dluxcru/.local/share/virtualenvs/chomper-_VT078ST/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/dluxcru/chomper/chomper/block.py", line 75, in main
    new_block_start, new_block_end)
  File "/home/dluxcru/chomper/chomper/block.py", line 110, in create_block_dict
    for key, value in yaml_import.items()}
  File "/home/dluxcru/chomper/chomper/block.py", line 110, in <dictcomp>
    for key, value in yaml_import.items()}
  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).

  • What is the expected behavior?
    I guess it should actually block something instead of throwing an error message, ya know.

  • What is the motivation / use case for changing the behavior?
    Gettting it to work.

  • Please tell us about your environment:

    • Chomper Release or Commit: I installed it this weekend, if that tells you something.
    • Browser: Chrome
    • Operating System: Ubuntu 18.10
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

Install failed?

Note: for support questions, please use Gitter. This repository's issues are reserved for feature requests and bug reports.

  • Do you want to request a feature or report a bug?
    bug

  • What is the current behavior?
    failed installation

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
    Use curl -sL https://raw.githubusercontent.com/aniketpanjwani/chomper_installers/master/debian.sh | bash && source ~/.bashrc

  • What is the expected behavior?
    Succesful Installation

  • What is the motivation / use case for changing the behavior?
    I did not change it

  • Please tell us about your environment:

    • Chomper Release or Commit: I think 0.2.1
    • Browser: e.g. Firefox canonical-00 -1.0 snap for Ubuntu , Chrome Version 90.0.4430.93 (Official Build) (64-bit)
    • Operating System: e.g. Ubuntu 18.04 LTS
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

See the video of my installation via terminal

Add sponsor button for yourself and the project

Note: for support questions, please use Gitter. This repository's issues are reserved for feature requests and bug reports.

  • Do you want to request a feature or report a bug?
    no

Dear Aniket,
This will help you in devoting more time to this wonderful project.

Add rule for word filtering in URL

  • Do you want to request a feature or report a bug?
    Feature

  • What is the current behavior?
    Not present

  • What is the expected behavior?
    I whould be able to block according to keywords in URL

  • What is the motivation / use case for changing the behavior?
    Make chomper more usable.

Problems with Makefile installation on Debian.

Steps to reproduce the problem:
  1. Run make init, and get errors with either pipenv installation or python path.
Any other comments? What have you tried so far?

For some reason, the previous issue (issue #26) which dealt with this problem got deleted. I have no idea how this occurred. I'm recreating this issue and leaving it open so that the people who were involved will be able to find it, but this issue was solved in 4afd3b2.

System information

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

Progressive block

Note: for support questions, please use Gitter. This repository's issues are reserved for feature requests and bug reports.

  • Do you want to request a feature or report a bug?
    I want to submit feature

  • What is the current behavior?
    Not present

  • What is the expected behavior?
    You install chomper, than you put password on su.
    Than as you browse sites, you can add via chomper sites to blacklist.
    (but you do not allow to remove existing sites)

  • What is the motivation / use case for changing the behavior?
    Motivation is to make chomper more bullet-proof

Site is down

Note: for support questions, please use Gitter. This repository's issues are reserved for feature requests and bug reports.

  • Do you want to request a feature or report a bug?

Website (https://addictedto.tech/chomper/) is down.

  • What is the current behavior?

image
Also, it has no HTTPS.

Site should be up! I miss Chomper :)

  • What is the motivation / use case for changing the behavior?

N/A

  • Please tell us about your environment:

    • Chomper Release or Commit: N/A
    • Browser: e.g. Firefox 85
    • Operating System: Windows 10
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc) N/A

Simplify Makefile.

Steps to reproduce the problem:

Makefile likely has some redundancies/can be written more succinctly.

Any other comments? What have you tried so far?

I feel like I'm defining too many variables in the beginning of the Makefile - not sure if all of them are necessary. I'm new to writing Makefiles, so any ideas of better ways of writing the Makefile are appreciated.

Make Chomper compatible with MacOS.

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?

Installer script?

Maybe we can work on an installer script to expedite the process and install chomper with a single ($ ./installer.sh) command? How's your shell scripting? I added comments, let me know what you think.

#!/bin/bash
    # make sure installer script isnt run as root
    if [ "$(id -u)" = "0" ]; then
	echo -e "\nThis script must not be run as root\n" 1>&2;
	exit 1;
	# debian usage warning
	if [[ $(lsb_release -is) != 'Debian' ]]; then
	    echo -e "\nThis script was designed for Debian. Press [Enter] to proceed. Otherwise, press Ctrl+c to exit installer.\n";
	    read;
	fi;
    fi;
    # update apt index
    sudo apt-get update;
   
    # make sure git is installed
    if ! [ -x "$(command -v git)" ]; then
	echo -e "\ngit not found. Installing...\n";
	sudo apt-get install git -y;
    fi;
    # check for chomper dir, in case script is run multiple times
    if [ -d ~/chomper ]; then
	echo -e "\nChomper directory detected. Remove the directory with '$ rm -rf ~/chomper' to use this script.\n";
	exit 1;
    else
	cd ~/ && git clone https://github.com/aniketpanjwani/chomper.git;
	cd chomper;
    fi;
    # shouldnt `export` and `source` come before the `make` command? you have it reversed in the README.md
    export PATH="/home/$USER/chomper/bin:$PATH" >> ~/.bashrc;
    source /home/$USER/.bashrc;
    make init

Automate steps 3-5 in readme of installation.

Steps to reproduce the problem:

Installation is a slight pain, and it shouldn't be that hard to make it easier.

Any other comments? What have you tried so far?
  1. In make init, add a pipenv shell line at the end.
  2. Figure out how to automatically add certificates from ~/.mitmproxy to Chrome/Firefox's respective certificate authorities, and add those lines in make init.
  3. Add the following two lines in make init:
  • sudo sysctl -w net.ipv4.ip_forward=1
  • sudo sysctl -w net.ipv6.conf.all_forwarding=1
    The only hard part is figuring out how to automate the certificate authorities.

Accessing mitmproxy

Hi there!

This is nor a feature or bug report. Chomper is working great for me and I just have a question regarding mitmproxy.

I'd like to access the admin interface for the mitmproxy instance and tinker with it (i.e to see what's being blocked, etc). Is it possible?

I tried the magic mitm.it domain, but by the looks of it, it says the requests are not going through the proxy, but they are right? I mean, the websites I blocked are being blocked :)

Thanks in advance!

Allow clicking links on whitelisted sites

When in whitelisting mode, it should also whitelist domains linked by whitelisted sites so I could click links on that page (i.e. following a citation on a SO answer) and load resources linked on other domains (i.e. static files on a CDN).

This would involve parsing the response when it's passing through the proxy and pulling domains referenced in link/a/etc tags and adding the domains to the in-memory whitelist.

YouTube not blocked on Chrome

Note: for support questions, please use Gitter. This repository's issues are reserved for feature requests and bug reports.

  • Do you want to request a feature or report a bug?
    bug

  • What is the current behavior?
    chomper is blocking sites on my blocklist, except for YouTube on Chrome. If I try to open youtube in incognito mode or Firefox, it is blocked, but for some reason, it isn't blocked in my regular chrome account. I tried disabling all of my extensions, but that didn't have an effect.
    I looked at the screen session running under sudo, and nothing is showing up for youtube.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
    chomper noyoutube 5
    Open youtube.com on Chrome in incognito mode and it is blocked. Open it in regular mode and it isn't blocked.

  • Please tell us about your environment:

    • Chomper Release or Commit: latest
    • Browser: Chrome Version 69.0.3497.100 (Official Build) (64-bit)
    • Operating System: Ubuntu 18.04.1
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

Thanks in advance for help!

Googler, how2, and socli command line tools don't work while Chomper is running.

Steps to reproduce the problem:
  1. Install googler, how2, and chomper.
  2. Execute chomper allon 10.
  3. Try to run googler python help.
  4. Try to run how2 -l python remove from list.
  5. Try to run socli python remove from list.

Step 3 gives [ERROR] Got HTTP 502: Bad Gateway at the terminal. In mitmproxy, you get

129.105.62.136:36544: clientconnect
129.105.62.136:36544: Cannot establish TLS with 74.125.127.105:443 (sni: None): TlsException('Cannot validate certificate hostname without SNI',)
129.105.62.136:36544: clientdisconnect

Step 4 returns at the terminal:

-Cannot connect to Google.
Error: Error on response:Error: tunneling socket could not be established, cause=connect EINVAL 0.0.31.144:80 - Local (0.0.0.0:0) : undefined

Step 5 returns Please check your internet connectivity... in the terminal. In mitmproxy, you get mitmproxy:

129.105.62.136:52310: clientconnect
129.105.62.136:52310: Client Handshake failed. The client may not trust the proxy's certificate for www.google.com.
129.105.62.136:52310: clientdisconnect
Any other comments? What have you tried so far?

Some thoughts:

  1. Maybe these command-line tools aren't finding certificates.
  2. The SNI error is weird - that seems like an upstream problem with googler.
  3. Maybe my root certificate isn't properly installed.
System information

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

installation problems: Usage: block.py [OPTIONS] Error: Invalid value for "--block_length": is not a valid integer

Note: for support questions, please use Gitter. This repository's issues are reserved for feature requests and bug reports.

  • Do you want to request a feature or report a bug?
    Reporting bug; installation fails

  • What is the current behavior?
    When I call chomper, bash gives me this:

    Usage: block.py [OPTIONS]
    Error: Invalid value for "--block_length": is not a valid integer

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).

  • Please tell us about your environment:

    • Chomper Release or Commit: 0.2.1
    • Browser: Chromium 67.0.3396.99
    • Operating System: Ubuntu 16.04

output of uname -a:
Linux elon-eats-my-shorts 4.15.0-29-generic #31~16.04.1-Ubuntu SMP Wed Jul 18 08:54:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
    Please let me know if there's anything more I can give to help. I will probably try a different self-control-esque service, but obviously if this is fixed quickly it will help not only me but others who encounter the same problem. Cheers!

ipv6 sites do not function from some networks

Description :octocat:

On some networks, I am unable to go to websites using ipv6.

Reproduction guide 🪲

  • Start Chomper with "allon" rule.
  • Clear Google Chrome cache.
  • Set A: reddit.com, linuxmint.com, espn.com.
  • Set B: facebook.com, instagram.com, google.com

Observed behaviour: 👀 💔
On some networks, you are able to go to both Set A and Set B. On other networks, you are only able to go to set A. On Set B websites, you receive a message from Chrome saying "ERR_CONNECTION_REFUSED".

If I look inside the screen process started by Chomper containing mitmdump, I see the following type of message:

Client connection was killed because allow_remote option is set to false, client IP was not a private IP and proxyauth was not set.
To allow remote connections set allow_remote option to true or set proxyauth option.
[2601:246:100:cefc:7da3:3d6c:6195:5f1f]:42868: Connection killed
[2601:246:100:cefc:7da3:3d6c:6195:5f1f]:42868: clientdisconnect

I observe this behavior on at least one Comcast/xFinity connection with two different routers.

Expected behaviour: ❤️ 😄
You should be able to go to both sets of websites on any network.

reset.py assumes iptables command is in PATH.

Operating system: Debian Sid
reset.py assumes that iptables is in the PATH.
This is not always true, because it requires that USER has /sbin in PATH.

Stacktrace

root@thinkpad:/home/sarg# crontab -l

26 8 27 2 * env PATH=/home/sarg/devel/bin:/home/sarg/.local/bin:/home/sarg/devel/android-sdk-linux/tools:/home/sarg/devel/android-sdk-linux/platform-tools:/home/sarg/devel/bin:/home/sarg/.local/bin:/home/sarg/devel/android-sdk-linux/tools:/home/sarg/devel/android-sdk-linux/platform-tools:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/sarg/.antigen/bundles/zsh-users/zsh-completions/src /home/sarg/.local/share/virtualenvs/chomper-LZFI31mM/bin/python /home/sarg/devel/chomper/chomper/reset.py # Chomper timer
root@thinkpad:/home/sarg# env PATH=/home/sarg/devel/bin:/home/sarg/.local/bin:/home/sarg/devel/android-sdk-linux/tools:/home/sarg/devel/android-sdk-linux/platform-tools:/home/sarg/devel/bin:/home/sarg/.local/bin:/home/sarg/devel/android-sdk-linux/tools:/home/sarg/devel/android-sdk-linux/platform-tools:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/sarg/.antigen/bundles/zsh-users/zsh-completions/src /home/sarg/.local/share/virtualenvs/chomper-LZFI31mM/bin/python /home/sarg/devel/chomper/chomper/reset.py 
Traceback (most recent call last):
  File "/home/sarg/devel/chomper/chomper/reset.py", line 15, in <module>
    main()
  File "/home/sarg/devel/chomper/chomper/reset.py", line 10, in main
    utils.reset_nat()
  File "/home/sarg/devel/chomper/chomper/utils.py", line 22, in reset_nat
    exec_command('iptables -t nat -F')
  File "/home/sarg/devel/chomper/chomper/utils.py", line 13, in exec_command
    p = subprocess.Popen(shlex.split(command))
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'iptables': 'iptables'

You were added to Awesome Humane Tech

This is just a FYI issue to notify that you were added to the curated awesome-humane-tech in the 'Mindfulness' category, and - if you like that - are now entitled to wear our badge:

Awesome Humane Tech

By adding this to the README:

[![Awesome Humane Tech](https://raw.githubusercontent.com/humanetech-community/awesome-humane-tech/main/humane-tech-badge.svg?sanitize=true)](https://github.com/humanetech-community/awesome-humane-tech)

https://github.com/humanetech-community/awesome-humane-tech

Reload configuration on SIGHUP

Daemons commonly reload their configuration from file when they receive a SIGHUP signal, which they won't receive in the normal course of events, as daemons aren't attached to a terminal. It would be great to be able to reload a changed config file without restarting so the current timers aren't reset (semi-related to #5).

Alternatives are USR1/USR2 but those are less common.

Combined blacklist and whitelist.

Note: for support questions, please use Gitter. This repository's issues are reserved for feature requests and bug reports.

  • Do you want to request a feature or report a bug?

Request a feature.

  • What is the current behavior?

Currently, you can only either create a whitelist or a blacklist.

You should have the ability to create a mixed whitelist/blacklist. For example, you can whitelist stackexchange.com, but within stackexchange.com, you can blacklist certain stackexchange subdomains. Alternatively, you can blacklist wikipedia.com, but allow yourself to read only certain pages.

  • What is the motivation / use case for changing the behavior?

This would be helpful for making more precise blocks of only the most addictive parts of certain websites.

  • Please tell us about your environment:

    • Chomper Release or Commit: 0.2.0
    • Browser: qutebrowser 1.1.1
    • Operating System: e.g. Linux Mint 18.3
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

Improved "blocked by..." page

It would be great to see some relevant information on the page when it's blocked. Most important would be which rule(s) are causing the page to be blocked to aid debugging. Other information is more than welcome too!

Inconsistencies with time in enacting block.

Steps to reproduce the problem:
  1. Install Chomper.
  2. Go to the ./bin directory and enter ./chomper coding 5.

If the time is currently 10:45:30, you'll get back a message saying the block will be lifted at 10:50:30. However, the block will in fact be lifted at 10:50:00. If you try to create a new block within 10:50:00 and 10:50:30, you will be told that you can't yet create a new block, because the old block is in effect.

Any other comments? What have you tried so far?

This problem is occurring because crontab does not allow for scheduling jobs at a particular second, only at a particular minute. The correct solution is to modify new_block_end in chomper/block.py to round down to the nearest minute.

System information

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

Arch Linux package (yay)

I have tried to create a package for Arch User Repository. but had a few issues with the build process.

First, it looks like markupsafe should be updated to 1.1 version

pallets/markupsafe#57

Second, I think we should target all python users from python3.6 and higher, no need to explicitly use python3.6?
Otherwise, it creates additional dependency which is pretty heavy.

Should we build with --dev flag?
pipenv install --dev --python 3.6.4

I think we should move requests and all other important libraries away from dev requirements and don't build anything with dev.

Other than that, the package is almost finished and I am willing to work on the issues I described previously if you think that they make sense.

What your thoughts?

Blacklist blocked all access to internet (kind of)

I use Linux 18.04. I installed chomper yesterday following these instructions. I got an issue at some point "Error: Couldn't install package: markupsafe", that I fixed (I guess?) by installing it from here. The rest of the install went smoothly. However, when I tried to blacklist some websites and start chomper from the CLI, nothing happened.

This morning I decided to give it a second chance. I read the documentation and used the advised command line instead of the manual installation:
curl -sL https://raw.githubusercontent.com/aniketpanjwani/chomper_installers/master/debian.sh | bash && source ~/.bashrc

I then followed the instructions on the terminal to remove the existing chomper directory and install it again. I got the error again that I was missing markupsafe (honestly I can't remember if I downloaded it again or if I forgot). I also got a message that it was skipping installing the certificate (mitmproxy-ca.pem) because it already existed. I didn't think much of it, maybe I should have? It seemed normal to me since I had already installed the program once, and I remembered manually adding the certificate to firefox.

I then modified the "allon" blacklist as instructed in the documentation, started it using the CLI (chomper allon 120), and I got a success message. Great success indeed. Everything was blocked (Firefox error code: ssl_error_rx_record_too_long). However, I was still receiving messages on Discord (desktop version), although I couldn't send anything myself. Luckily, the reset command worked like a charm.

Maybe I did something wrong, I don't know much about programming yet. I just thought that I should let you know that this happened.

Edit:

I think I might have had the same issue as this one, however I didn't test different configurations of chomper.

Bug: Error whon running block

I've done my best to install on ArcoLinux (arch) I went through the install script for debian and converted all commands that didn't for me and located the proper places to put files and the proper files to modify.

I am however getting an error when i run "chomper coding 30" (just trying to test if it worked)

iptables v1.8.3 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?) 
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/5.2.7-arch1-1-ARCH
ip6tables v1.8.3 (legacy): can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
iptables v1.8.3 (legacy): Couldn't load match `owner':No such file or directory
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.8.3 (legacy): Couldn't load match `owner':No such file or directory
Try `iptables -h' or 'iptables --help' for more information.
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/5.2.7-arch1-1-ARCH
ip6tables v1.8.3 (legacy): can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/5.2.7-arch1-1-ARCH
ip6tables v1.8.3 (legacy): can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
Did not enact new block. Old block still in effect until 2019-08-10 22:04:00.

I'm running the latest iptables from the arch repos, I've tried using iptables-nft instead
but then I just get

iptables/1.8.3 Failed to initialize nft: Protocol not supported
ip6tables/1.8.3 Failed to initialize nft: Protocol not supported
iptables/1.8.3 Failed to initialize nft: Protocol not supported
iptables/1.8.3 Failed to initialize nft: Protocol not supported
ip6tables/1.8.3 Failed to initialize nft: Protocol not supported
ip6tables/1.8.3 Failed to initialize nft: Protocol not supported
Did not enact new block. Old block still in effect until 2019-08-10 22:04:00.

As you can see from the last line, chomper thinks it's blocking me, but I can still browse freely. My guess is that the I can browse freely is because of the errors... so how do I fix them?
If it matters I'm using firefox

I'm a relative linux noob and amazed that I managed to get it running, even if not functioning, at all.

Long commands (>999 characters) don't get written to crontab.

Steps to reproduce the problem:
  1. Have a PATH variable sufficiently long so that the reset_command variable in set_block_length in ./chomper/block.py is more than 999 characters.
  2. Run chomper.
  3. Look at root crontab - reset_command will not be written to root's crontab.
Any other comments? What have you tried so far?

I was confused about why the cron jobs suddenly stopped working. It turns out this is due to my adding more things to my PATH variable. For now, I'm going to prune my PATH variable of unnecessary things, but there should be a better way of putting the normal user's PATH variable in the root user's environment.

System information

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

Make a walkthrough to the code.

It would probably also help potential contributors to have some sort of walkthrough to the code - what is the role of each file, etc.

Chomper blocks all non-browser https connections

Hi, thanks for the great program, I really like it. However, I ran in a serious issue when using chomper. Basically, it seems to block any non-browser based program from connecting to remote sites using https.

Specifically, when running a blacklist on standard time-wasting sites (i.e. facebook, twitter; see below), it seems that no https connection can be achieved outside Chrome. Indeed, chomper blocks apps like Github Desktop, InSync (google drive client) and https requests from custon R/python scritpts.

Running wget -p https://www.github.com in a terminal during an active block returns

-2018-05-13 11:32:34--  https://www.github.com/
Resolving www.github.com (www.github.com)... 192.30.253.112, 192.30.253.113
Connecting to www.github.com (www.github.com)|192.30.253.112|:443... connected.
ERROR: cannot verify www.github.com's certificate, issued by ‘O=mitmproxy,CN=mitmproxy’:
  Self-signed certificate encountered.
To connect to www.github.com insecurely, use `--no-check-certificate'.

Here is the active blacklist:

work:

  • block_type:

    • blacklist
  • addresses:

    • facebook.com
    • twitter.com
    • youtube.com
    • twitter.com
    • tumblr.com
    • pinterest.com
    • livejournal.com
    • digg.com
    • stumbleupon.com
    • reddit.com
    • kongregate.com
    • newgrounds.com
    • addictinggames.com
    • hulu.com
    • 9gag.com
    • xkcd.com
  • Chomper commit 5dfa430

  • Browser: Chrome

  • Operating System: Linux Mint 18.3

Thank you and please let me know if I any other info might be useful or if I am doing something wrong.

Need to be in ./bin in order to use chomper shell script.

Steps to reproduce the problem:
  1. Install Chomper.
  2. Do configuration for hardcore mode.
  3. Go to any directory other than ./bin.
  4. Try to call ./bin/chomper with any arguments.

You will get a request for the sudo password, which you should not get. This is annoying, because it also prevents you from putting chomper on path.

Any other comments? What have you tried so far?
System information

Operating system: Linux Mint 18

Deinstallation

Dear aniketpanjwani,
I would like to know how to cleanly remove the whole package. In the readme and the doc I couldn't find any suggestion...
Thx
bbuld

Better contributing guidelines.

The project currently has no contributing guidelines. It's important to add some to attract new contributors, make them feel welcome, and make sure they know how to make a contribution.

No virtualenv has been created for this project yet

Hello i am having a problem with chomper:
i installed it with the help of a great guide here: https://chomper.readthedocs.io/en/latest/

Title is the beginning of a terminal response to my command:
chomper public 1440

the whole response:
No virtualenv has been created for this project yet!
File "/location/chomper/chomper/block.py", line 33 def main(rules_path: str, settings_json_path: str, rule: str,
^
SyntaxError: invalid syntax

How do I uninstall?

Hello, I do not see the steps to uninstall the package in the documentation. Can the author provide the steps to remove it completely?

GUI Interface.

Steps to reproduce the problem:

There is no GUI interface.

Any other comments? What have you tried so far?

I've never created a GUI. The main options for potential frameworks are Toga, Kivy, and PyQt.

If you've got any thoughts on how to choose between them, I would greatly appreciate it.

System information

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

Chomper prevents me from accessing *any* webpage

  • Do you want to request a feature or report a bug?
    I am reporting what I think is a severe bug.

  • What is the current behavior?
    Regardless of what configurations I try in my black-list or white-list blocks, as soon as I execute chomper to activate a block, I can't access any website. More specifically, when trying to access the blocked ones, I receive the chomper message as expected.
    However, whenever I try to access any other sites, the web-browser (I tried Firefox, Chrome and Chromium) says that navigating to the requested page is not safe and does not allow me to continue (not even allowing me to say that I want to proceed under my own risk). It is reported also that the software preventing the access is "mitmproxy".
    This is, activating chomper effectively prevents me from navigating to any site.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    There is no possible reproducible example because this happens with any chomper configuration.

  • What is the expected behavior?
    Clearly, what should be expected is that the web-pages not black-listed should open.

  • Please tell us about your environment:

    • Chomper Release or Commit: the most current as of 10-16-2019
    • Browser: e.g. Firefox 69.0.2, Chromium 77.0.3865.90
    • Operating System: e.g. Linux Ubuntu 18.04 (64bits)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.