Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/desuuuu/traefik-cloudflare-plugin
Traefik plugin to handle traffic coming from CloudFlare.
https://github.com/desuuuu/traefik-cloudflare-plugin
cloudflare traefik traefik-plugin
Last synced: 2 months ago
JSON representation
Traefik plugin to handle traffic coming from CloudFlare.
- Host: GitHub
- URL: https://github.com/desuuuu/traefik-cloudflare-plugin
- Owner: Desuuuu
- License: mit
- Created: 2022-09-17T10:18:26.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-20T22:43:49.000Z (about 2 years ago)
- Last Synced: 2024-11-23T08:09:20.792Z (2 months ago)
- Topics: cloudflare, traefik, traefik-plugin
- Language: Go
- Homepage:
- Size: 146 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# traefik-cloudflare-plugin
[![Tag Badge]][Tag] [![Go Version Badge]][Go Version] [![Build Badge]][Build] [![Go Report Card Badge]][Go Report Card]
Traefik plugin to handle traffic coming from Cloudflare.
## Features
* Only allow traffic originating from Cloudflare
* Rewrite requests `X-Forwarded-For` header with the user IP## Configuration
### Plugin options
| Key | Type | Default | Description |
|:-----------------------:|:---------------:|:-------:|:-----------------------------------------------------------------------------------------------------------------------------------------------:|
| `trustedCIDRs` | `[]string` | `[]` | Requests coming from a source not matching any of these CIDRs will be terminated with a 403. If empty, it is populated with Cloudflare's CIDRs. |
| `refreshInterval` | `time.Duration` | `24h` | When `trustedCIDRs` is empty, Cloudflare's CIDRs will be refreshed after this duration. Using a value of 0 seconds disables the refresh. |
| `overwriteForwardedFor` | `bool` | `true` | When `true`, the request's `X-Forwarded-For` header is replaced by the content of the `CF-Connecting-IP` header. |### Traefik static configuration
```yaml
experimental:
plugins:
cloudflare:
moduleName: github.com/Desuuuu/traefik-cloudflare-plugin
version: v1.0.0
```### Dynamic configuration
```yaml
http:
middlewares:
cloudflare:
plugin:
cloudflare:
trustedCIDRs: []
overwriteForwardedFor: truerouters:
foo-router:
rule: Path(`/foo`)
service: foo-service
entryPoints:
- web
middlewares:
- cloudflare
```[Tag]: https://github.com/Desuuuu/traefik-cloudflare-plugin/tags
[Tag Badge]: https://img.shields.io/github/v/tag/Desuuuu/traefik-cloudflare-plugin?sort=semver
[Go Version]: /go.mod
[Go Version Badge]: https://img.shields.io/github/go-mod/go-version/Desuuuu/traefik-cloudflare-plugin
[Build]: https://github.com/Desuuuu/traefik-cloudflare-plugin/actions/workflows/test.yml
[Build Badge]: https://img.shields.io/github/actions/workflow/status/Desuuuu/traefik-cloudflare-plugin/test.yml
[Go Report Card]: https://goreportcard.com/report/github.com/Desuuuu/traefik-cloudflare-plugin
[Go Report Card Badge]: https://goreportcard.com/badge/github.com/Desuuuu/traefik-cloudflare-plugin