Skip to content

Commit

Permalink
Update words
Browse files Browse the repository at this point in the history
  • Loading branch information
shizunge committed Jan 22, 2024
1 parent 7a11fc6 commit a47f131
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ https://github.com/Perflyst/PiHoleBlocklist

*Lists downloader* reads this *source* file, downloads contents of these two lists, then concatenates them to a single file. The result file will have the same name `group-one.txt`, but it will go to the destination folder e.g. `/web/downloaded`.

Then You modify the blocky configuration file for `group-one` to read the aggregated list from the static file server of *lists downloader* instead of two separated lists.
Then You modify the blocky configuration file for `group-one` to read the aggregate list from the static file server of *lists downloader* instead of two separated lists.

```
blocking:
Expand Down Expand Up @@ -86,17 +86,17 @@ You can configure the most behaviors of *lists downloader* via environment varia
| Environment Variable | Default |Description |
|-----------------------|---------|------------|
| BLD_BLOCKY_URL | | Enable [refresh request](https://0xerr0r.github.io/blocky/swagger.html#operation--lists-refresh-post) to blocky. It should be the base URL of blocky. Use an empty string to disable refresh requests. |
| BLD_DESTINATION_FOLDER | /web/downloaded | The location of aggregated lists. This should be under `BLD_WEB_FOLDER` thus blocky can read the files via the static file server. |
| BLD_DESTINATION_FOLDER | /web/downloaded | The location of aggregate lists. This should be under `BLD_WEB_FOLDER` thus blocky can read the files via the static file server. |
| BLD_INITIAL_DELAY_SECONDS | 0 | Delay in seconds before the first download. |
| BLD_INTERVAL_SECONDS | 86400 | Interval between two downloads. Set to 0 disable periodically downloads, then downloads will occur only at *source* changes. |
| BLD_LOG_LEVEL | INFO | Control how many logs generated by Gantry. Valid values are `NONE`, `ERROR`, `WARN`, `INFO`, `DEBUG` (case sensitive). |
| BLD_NODE_NAME | | Add node name to logs. |
| BLD_NOTIFICATION_APPRISE_URL | | Enable notification after each refresh with [apprise](https://github.com/caronc/apprise-api). This must point to the notification endpoint (e.g. `http://apprise:8000/notify`). Use an empty string to disable notification. |
| BLD_POST_DOWNLOAD_CMD | | A command or function running after downloading an aggregated list. The first argument will be the path to the aggregated file, i.e. you command will be eval as `your_command <file_path>`. This can be used to fix problems in the lists before the upstream maintainer fixing it. |
| BLD_POST_DOWNLOAD_CMD | | A command or function running after downloading an aggregate list. The first argument will be the path to the aggregate file, i.e. you command will be eval as `your_command <file_path>`. This can be used to fix problems in the lists before the upstream maintainer fixing it. |
| BLD_SOURCES_FOLDER | /sources | The location to read sources lists. The files contains URLs where to download the lists of domains. Use an empty string to disable watching. |
| BLD_WATCH_FOLDER | /web/watch | The location of user defined lists of domains. *lists downloader* watches changes in this folder and send refresh requests to blocky. This should be under `BLD_WEB_FOLDER` thus blocky can read the files via the static file server. Use an empty string to disable watching. |
| BLD_WEB_FOLDER | /web | The location which the static file server services. Use an empty string to disable the web server. |
| BLD_WEB_PORT | 8080 | The port that static-web-server listens to. |
| BLD_WEB_FOLDER | /web | The location that the static file server serves. Use an empty string to disable the file server. |
| BLD_WEB_PORT | 8080 | The port that static file server listens to. |

## Caveats

Expand Down
5 changes: 3 additions & 2 deletions examples/blocky-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ blocking:
blackLists:
# Ask blocky to download lists from the static-web-server of the lists-downloader.
# The watch folder contains user defined lists.
# The downloaded folder contains aggregated lists for given sources files.
# The downloaded folder contains aggregate lists for given sources files.
my-lists:
- http://lists-downloader:8080/watch/blocked-list.txt
default-lists:
Expand All @@ -27,14 +27,15 @@ blocking:
blockType: zeroIp
blockTTL: 1h
loading:
# Disable build-in refreshing, only listens to lists downloader refreshing requests.
refreshPeriod: 0
downloads:
timeout: 5m
attempts: 60
cooldown: 5s
concurrency: 4
strategy: failOnError
# Forgive the errors in the aggregated lists. The aggregated one also contains all errors from all of lists.
# Forgive the errors in the aggregate lists. The aggregate one also contains all errors from all of lists.
maxErrorsPerSource: -1

upstreams:
Expand Down
2 changes: 1 addition & 1 deletion examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ services:
# These are shared volumes with blocky lists downloader.
- ./lists/sources:/srv/blocky/sources
- ./lists/watch:/src/blocky/watch
# To exam errors in the aggregated lists.
# To exam errors in the aggregate lists.
- blk-downloaded:/src/blocky/downloaded:ro

configs:
Expand Down
2 changes: 1 addition & 1 deletion src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ start_web_server() {
local WEB_FOLDER="${1}"
local WEB_PORT="${2:-8080}"
[ -z "${WEB_FOLDER}" ] && log INFO "Skip running web server. WEB_FOLDER is empty." && return 1
log INFO "Start static-web-server that services ${WEB_FOLDER}"
log INFO "Start static-web-server that serves ${WEB_FOLDER}"
static-web-server --port="${WEB_PORT}" --root="${WEB_FOLDER}" --log-level=warn --compression=false
}

Expand Down

0 comments on commit a47f131

Please sign in to comment.