Repository navigation
Expand file tree
/
Copy pathconfig.ron
More file actions
125 lines (125 loc) · 3.61 KB
/
Copy pathconfig.ron
File metadata and controls
125 lines (125 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
(
proxy: (
tls: false,
upstreams: ["test-backend:8000"],
listen: "[::]:8080",
grace_period_seconds: 10,
graceful_shutdown_timeout_seconds: 5,
upstream_keepalive_pool_size: 256,
log_format: default,
trusted_proxies: ["docker", "proxies", "internal"],
health_check: Some((
addr: "test-backend",
method: "GET",
path: "/healthz",
port: None,
host: None,
tls: false,
headers: {},
failure_threshold: 3,
success_threshold: 1,
connection_timeout_seconds: 1,
read_timeout_seconds: 1,
reuse_connection: false,
frequency_seconds: 5,
)),
),
// Management service
management: (
enabled: true,
listen: "[::]:8081",
),
redis: (
url: "redis://redis:6379/0",
// Should requests be allowed if redis is unavailable?
fail_open: true,
// Timeout for redis operations
timeout_seconds: 0.5,
// Reconnect interval for redis when it is unavailable
reconnect_interval_seconds: 1,
// How often to refresh the in-memory blocklist from Redis
block_list_refresh_seconds: 2,
),
telemetry: (
otlp_endpoint: Some("http://alloy:4317"),
otlp_protocol: Grpc,
),
ip_sets: Some({
// Predefined IP sets (loaded from external sources)
"proxies": External([
CloudFront,
]),
"crawlers": External([
Google,
Bing,
]),
// Inline CIDR definitions
"internal": Inline([
"10.0.0.0/8",
// "192.168.0.0/16",
]),
"docker": Inline([
"172.17.0.0/16",
"172.18.0.0/16",
"172.19.0.0/16",
"172.20.0.0/14",
"172.24.0.0/14",
"172.28.0.0/14",
]),
"partners": Inline([
"203.0.113.0/24",
"198.51.100.0/24",
]),
}),
limits: {
"bad-bots": (
interval: 600,
max: 0,
algorithm: SlidingWindow,
keys: (
headers: (
names: ["X-Forwarded-For"],
),
),
matches: (
paths: Some((
match_any: ["/.*"],
)),
headers: Some((
match_any: [
(name: "User-Agent", pattern: ".*SiteAuditBot.*"),
(name: "User-Agent", pattern: "SEMrushBot"),
(name: "User-Agent", pattern: ".*SemrushBot.*"),
(name: "User-Agent", pattern: "pimeyes.com crawler"),
(name: "User-Agent", pattern: ".*SEOChecker.*"),
(name: "User-Agent", pattern: "DataForSeoBot/.*"),
(name: "User-Agent", pattern: ".*AhrefsBot.*"),
],
)),
),
excludes: None,
),
"global": (
interval: 10,
max: 5,
algorithm: Gcra,
keys: (
headers: (
names: ["Host", "X-Forwarded-For"],
),
),
matches: (
paths: Some((
match_any: ["/.*"],
)),
headers: None,
),
excludes: Some((
ip_sets: Some([
"internal",
"crawlers",
]),
)),
),
},
)