Skip to content

Commit adbb3a7

Browse files
committed
add plugin installation example
1 parent 7e8902d commit adbb3a7

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/CAJIO/allowiprequest
22

3-
go 1.19
3+
go 1.20

readme.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@ To use this plugin, you must configure it in your Traefik dynamic configuration.
2626
| `whitelistDuration` | `string` | `"24h"` | How long the IP remains whitelisted (e.g., "1h", "30m"). |
2727
| `allowedSubnets` | `[]string` | `["192.168.0.0/16", ...]` | List of CIDR ranges that bypass the knock check and can view the admin page. |
2828

29-
### Example Middleware Configuration
29+
### Add the plugin to Traefik
30+
```yaml
31+
experimental:
32+
plugins:
33+
allowiprequest:
34+
moduleName: github.com/CAJIO/allowiprequest
35+
version: v1.0.0
36+
```
3037
38+
### Middleware Configuration
3139
```yaml
3240
http:
3341
middlewares:
@@ -41,6 +49,16 @@ http:
4149
- "192.168.1.0/24"
4250
```
4351
52+
### Router Configuration
53+
```yaml
54+
http:
55+
routers:
56+
mydomain:
57+
rule: "Host(`example.com`)"
58+
middlewares:
59+
- my-ip-allowlist
60+
```
61+
4462
## How It Works
4563
4664
1. **Initial Access**: When an unknown user tries to access your service, they receive a `403 Forbidden` error.

0 commit comments

Comments
 (0)