From 6af05c61cfcf0aa38f128096463beb06b28472f9 Mon Sep 17 00:00:00 2001 From: Wesley Date: Tue, 12 Sep 2023 20:51:23 +1200 Subject: [PATCH] Update README --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f6aa3be..9da9d32 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,46 @@ [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity) [![GoReportCard example](https://goreportcard.com/badge/github.com/tuzzmaniandevil/caddy-dynamic-clientip)](https://goreportcard.com/report/github.com/tuzzmaniandevil/caddy-dynamic-clientip) ![GitHub](https://img.shields.io/github/license/tuzzmaniandevil/caddy-dynamic-clientip?_t=3145938) -`dynamic_client_ip` is a `client_ip` matcher clone that with one difference, instead of providing the IP ranges up front, You specify an `IPRangeSource` to allow the IP ranges to be dynamicly loaded per request. \ No newline at end of file +The `dynamic_client_ip` module is a clone of the `client_ip` matcher with one key difference: instead of providing IP ranges upfront, you specify an `IPRangeSource`. This allows IP ranges to be dynamically loaded per request. + +## Installation + +Build Caddy using [xcaddy](https://github.com/caddyserver/xcaddy): + +```shell +xcaddy build --with github.com/tuzzmaniandevil/caddy-dynamic-clientip +``` + +## Usage + +```caddyfile +:8880 { + @denied dynamic_client_ip my_dynamic_provider + abort @denied + + reverse_proxy localhost:8080 +} +``` + +Example using the built-in static provider (But why though?) +```caddyfile +:8880 { + @denied dynamic_client_ip static 12.34.56.0/24 1200:ab00::/32 + abort @denied + + reverse_proxy localhost:8080 +} +``` + +## Development + +Before diving into development, make sure to follow the [Extending Caddy](https://caddyserver.com/docs/extending-caddy#extending-caddy) guide. This ensures you're familiar with the Caddy development process and that your environment is set up correctly. + +To run Caddy with this module: +```shell +xcaddy run +``` + +## License + +The project is licensed under the [Apache License](LICENSE). \ No newline at end of file