Skip to content

Commit

Permalink
Merge pull request #95 from hlqviet/upstream
Browse files Browse the repository at this point in the history
Lint and fix Markdown
  • Loading branch information
mrrfv authored Apr 15, 2024
2 parents 8b2fa7a + 797f102 commit 0ca25e7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<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.
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.

Expand All @@ -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`.

<!-- markdownlint-disable-next-line MD026 -->
## Why not...

### Pi-hole or Adguard Home?
Expand Down
22 changes: 12 additions & 10 deletions extended_guide.md
Original file line number Diff line number Diff line change
@@ -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):

Expand All @@ -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.

Expand Down

0 comments on commit 0ca25e7

Please sign in to comment.