From 797f1026b4e7f1eed657fa8efc765a670af00807 Mon Sep 17 00:00:00 2001 From: Viet Huynh Date: Mon, 15 Apr 2024 02:47:54 +0700 Subject: [PATCH] lint and fix Markdown --- README.md | 23 ++++++++++------------- extended_guide.md | 22 ++++++++++++---------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index fc5bfca5..7c9e8c63 100644 --- a/README.md +++ b/README.md @@ -52,20 +52,16 @@ Please note that the GitHub Action downloads the recommended blocklists and whit 1. Create a new empty, private repository. Forking or public repositories are discouraged, but supported - although the script never leaks your API keys and GitHub Actions secrets are automatically redacted from the logs, it's better to be safe than sorry. 2. Create the following GitHub Actions secrets in your repository settings: - -- `CLOUDFLARE_API_TOKEN`: Your Cloudflare API Token with Zero Trust read and edit permissions -- `CLOUDFLARE_ACCOUNT_ID`: Your Cloudflare account ID -- `CLOUDFLARE_LIST_ITEM_LIMIT`: The maximum number of blocked domains allowed for your Cloudflare Zero Trust plan. Default to 300,000. Optional if you are using the free plan. -- `PING_URL`: /Optional/ The HTTP(S) URL to ping (using curl) after the GitHub Action has successfully updated your filters. Useful for monitoring. -- `DISCORD_WEBHOOK_URL`: /Optional/ The Discord (or similar) webhook URL to send notifications to. Good for monitoring as well. - + - `CLOUDFLARE_API_TOKEN`: Your Cloudflare API Token with Zero Trust read and edit permissions + - `CLOUDFLARE_ACCOUNT_ID`: Your Cloudflare account ID + - `CLOUDFLARE_LIST_ITEM_LIMIT`: The maximum number of blocked domains allowed for your Cloudflare Zero Trust plan. Default to 300,000. Optional if you are using the free plan. + - `PING_URL`: /Optional/ The HTTP(S) URL to ping (using curl) after the GitHub Action has successfully updated your filters. Useful for monitoring. + - `DISCORD_WEBHOOK_URL`: /Optional/ The Discord (or similar) webhook URL to send notifications to. Good for monitoring as well. 3. Create the following GitHub Actions variables in your repository settings if you desire: - -- `FAST_MODE`: Enable the scripts to send the requests simultaneously. Beware that there's a rate limit of 1200 requests per five minutes (https://developers.cloudflare.com/fundamentals/api/reference/limits/) so make sure you know what you are doing. -- `ALLOWLIST_URLS`: Uses your own allowlists. One URL per line. Recommended allowlists will be used if this variable is not provided. -- `BLOCKLIST_URLS`: Uses your own blocklists. One URL per line. Recommended blocklists will be used if this variable is not provided. -- `BLOCK_PAGE_ENABLED`: Enable showing block page if host is blocked. - + - `FAST_MODE`: Enable the scripts to send the requests simultaneously. Beware that there's a rate limit of 1200 requests per five minutes () so make sure you know what you are doing. + - `ALLOWLIST_URLS`: Uses your own allowlists. One URL per line. Recommended allowlists will be used if this variable is not provided. + - `BLOCKLIST_URLS`: Uses your own blocklists. One URL per line. Recommended blocklists will be used if this variable is not provided. + - `BLOCK_PAGE_ENABLED`: Enable showing block page if host is blocked. 4. Create a new file in the repository named `.github/workflows/main.yml` with the contents of `auto_update_github_action.yml` found in this repository. The default settings will update your filters every week at 3 AM UTC. You can change this by editing the `schedule` property. 5. Enable GitHub Actions in your repository settings. @@ -83,6 +79,7 @@ To see if e.g. your filter lists are valid without actually changing anything in **Warning:** This currently only works for `cf_list_create.js`. + ## Why not... ### Pi-hole or Adguard Home? diff --git a/extended_guide.md b/extended_guide.md index 8b22a19c..0b971484 100644 --- a/extended_guide.md +++ b/extended_guide.md @@ -1,22 +1,24 @@ -# Environment variables +# Extended Guide + +## Environment variables Environment variables are like a configuration file. They are stored in a file called `.env` in the same directory as the scripts. You have to create this file yourself (an example file is provided in the repository). Below is a list of the most important environment variables and their descriptions. -## Obtaining your Cloudflare credentials +### Obtaining your Cloudflare credentials -### `CLOUDFLARE_ACCOUNT_ID` +#### `CLOUDFLARE_ACCOUNT_ID` You can find your Cloudflare account ID in the [Cloudflare dashboard](https://dash.cloudflare.com/). Click on any domain you own, then on the "Overview" tab. Scroll down to the bottom of the page and you will see your account ID on the right side. Alternatively, you can copy the account ID from the URL of any page in the Cloudflare dashboard. The URL will look like this: -``` +```text https://dash.cloudflare.com/1234567890abcdef1234567890abcdef ``` In this example, `1234567890abcdef1234567890abcdef` is the account ID. -### `CLOUDFLARE_API_TOKEN` +#### `CLOUDFLARE_API_TOKEN` Cloudflare API Token can be created in your [Cloudflare profile](https://dash.cloudflare.com/profile/api-tokens): @@ -28,21 +30,21 @@ Cloudflare API Token can be created in your [Cloudflare profile](https://dash.cl ![Creating API Token](.github/images/create_api_token.png) -### `CLOUDFLARE_LIST_ITEM_LIMIT` +#### `CLOUDFLARE_LIST_ITEM_LIMIT` The Cloudflare list item limit is the maximum number of items (blocked domains) that can be added to Cloudflare. The default value of 300,000 is the maximum allowed by Cloudflare for free accounts. If you pay for Cloudflare Zero Trust, you might be able to increase this value. -## Other +### Other -### `DRY_RUN` +#### `DRY_RUN` Processes block/allow lists without actually adding/removing domains from Cloudflare. Avoid using this option unless you know what you are doing. -### `FAST_MODE` +#### `FAST_MODE` Sends requests much faster, but might cause rate limiting issues. Use with caution. -# Example usage +## Example usage These commands should be run in a terminal.