basic express server for adding websites to a blocklist
- basic API
- block a website
- add url or domain name, depending on config option, to blocklist.txt
- sort alphabetically and remove duplicates
- add a commented header specified in config to the top
- get blocklist
- convert it to hosts format (
0.0.0.0 example.com
# Comment
) - convert it to ABP/uBo format (
||example.com^
,! Comment
)
- convert it to hosts format (
- block a website
- config validation
- make a frontend. i'm keeping it simple, why not fork it and add one yourself? 😉
docker run -d \
-p 3000:80 \
-e API_KEY=2266d1f5f188a50f \
-v ./ezblocklist:/data \
reeseovine/ezblocklist:latest
services:
ezblocklist:
image: reeseovine/ezblocklist:latest
restart: unless-stopped
ports:
- 3000:80
volumes:
- ./ezblocklist:/data
environment:
API_KEY: 2266d1f5f188a50f # generate a strong secret with `openssl rand -hex 32`
# these variables are optional, and the defaults are provided for reference.
PORT: 80
BLOCKLIST_ROOT: /data
BLOCK_TYPE: hostname
BLOCKLIST_HEADER: |
generated by ezblocklist
(https://github.com/reeseovine/ezblocklist)
variable | description |
---|---|
API_KEY | The password needed to be able to add URLs to block. Fetching the list is, for now, not protected by this key. |
PORT | The port within the container that the server runs on. |
BLOCKLIST_ROOT | Where to store the blocklist within the Docker container. |
BLOCK_TYPE | What to block from the given URL. Valid options are hostname to use the FQDN or IP address (default) and exact to use the full URL. |
BLOCKLIST_HEADER | A descriptive header to add to the top of the file. Comment characters are automatically prepended to each line. |
- Copy the bookmarklet code from the logs and replace
<SERVER_ADDRESS>
with the IP address or domain name. - Create a new bookmark in your browser (in the bookmarks bar for easy access, perhaps) and set the URL to the bookmarklet code.
- Go to an article that you want to save, click the bookmark, et voila!
- Install HTTP Shortcuts from F-Droid or the Play Store.
- Download
readerss_http_shortcut.json
from this repo to your device. - Open HTTP Shortcuts, tap the vertical 3 dots in the top right corner, tap "Import/Export", then tap "Import from file". Select the json file you downloaded earlier.
- Go back to the main page, tap the 3 dot button again, then tap "Variables", and edit the values of
readerss_instance
andreaderss_api_key
to match those of your instance. - Try using the share button on an app. A new item "Send to..." should appear on the share sheet. You can also save an article by tapping the shortcut inside the HTTP Shortcuts app itself.
The RSS feed URL is <SERVER_ADDRESS>/feed?key=<API_KEY>
. Replace the placeholders with your proper values and add it to your feed reader of choice. If it doesn't work in your reader, open an issue and I will try my best to fix it!