Digitox is a self-hosted website blocker that allows you to block sites on all your devices without relying upon third-party services like Freedom.
- Block websites
- Schedule sessions
- Customize blocklists
-
Start Digitox container
docker run -d -p 3128:3128 -p 8080:8080 --name digitox jonathanfoster/digitox
-
Get access token
# Save access token in $DIGITOX_ACCESS_TOKEN curl "http://localhost:8080/oauth/token?grant_type=client_credentials&client_id=59f92849-b883-402c-b429-15a67663d4f3&client_secret=450a31ea-0c18-4925-97db-b9f981ca4a62&redirect_uri=http://localhost"
-
Create device
curl -s -X POST -d \ '{ "name": "digitox", "password": "Digitox123" }' \ "http://localhost:8080/devices/?access_token=$DIGITOX_ACCESS_TOKEN"
-
Create blocklist
# Save blocklist ID in DIGITOX_BLOCKLIST_ID curl -s -X POST -d \ '{ "name\": "HackerNews", "domains\": ["news.ycombinator.com"] }' \ "http://localhost:8080/blocklists/?access_token=$DIGITOX_ACCESS_TOKEN"
-
Create session
TODAY=$(date +%Y-%m-%d) curl -s -X POST -d \ "{ \"name\": \"No HackerNews after 8PM", \"starts\": \"${TODAY}T20:00:00Z\", \"ends\": \"${TODAY}T23:59:59Z\", \"blocklists\": [{\"id\":\"$DIGITOX_BLOCKLIST_ID\"}] }" \ "http://localhost:8080/sessions/?access_token=$DIGITOX_ACCESS_TOKEN"
-
Enjoy digital freedom
# Configure browser proxy to use locahost:3128 and digitox:Digitox123 curl -x digitox:Digitox123@localhost:3128 https://news.ycombinator.com
-
Clone this repo
git clone [email protected]:jonathanfoster/digitox.git $GOPATH/src/github.com/jonathanfoster/digitox cd $GOPATH/src/github.com/jonathanfoster/digitox
-
Code
-
Test
make lint make test make test-e2e
-
Run
docker-compose up -d