-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathpingap.toml
319 lines (243 loc) · 11.2 KB
/
pingap.toml
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
[basic]
# Specify the application instance name, which is used to easily identify the application when sending notifications. Default `pingap`
# name = "pingap"
# Error response templates, which can be configured as HTML or JSON. The following characters in the template will be replaced.
# {{version}} - the version of the application
# {{error_type}} - the type of the error
# {{content}} - the content of the error
# Default `the content of error.html`
# error_template = ""
# Process id file. Default `/run/pingap.pid`
# pid_file = "/run/pingap.pid"
# Unix socket path used for application upgrades. Default `/tmp/pingap_upgrade.sock`
# upgrade_sock = "/tmp/pingap_upgrade.sock"
# After daemonization, this process will switch to the given user before starting to serve traffic. Default `none`
# user = ""
# Similar to `user`, the group this process should switch to. Default `none`
# group = ""
# Set the number of threads per server. If set to 0, it will match the CPU core count. Default `1`
# threads = 1
# Allow work stealing between threads of the same service. Default `true`.
# work_stealing = true
# Grace period before starting the final step of the graceful shutdown after signaling shutdown. Default `5m`
# grace_period = "5m"
# Timeout in seconds of the final step for the graceful shutdown. Default `5s`
# graceful_shutdown_timeout = "5s"
# Keepalive pool size for client connections to upstream. Default `128`
# upstream_keepalive_pool_size = 128
# HTTP webhook URL for notifications, default `none`
# webhook = "https://example.com/webhook"
# Webhook type, supports 'wecom', 'dingtalk' and 'normal' types. Default `none`
# webhook_type = "wecom"
# Available events: "backend_status" (upstream backend status changes), "lets_encrypt" (Let's Encrypt certificate operations),
# "diff_config" (configuration changes), "restart" (application restarts), "restart_fail" (application restart fails),
# "reload_config" (configuration reloads), "reload_config_fail" (configuration reload fails), "tls_validity" (TLS certificate validity changes),
# "service_discover_fail" (service discovery failures). Default `none`
# webhook_notifications = ["backend_status"]
# Set log level for application.
# Available levels: "debug", "info", "warn", "error"
# Default `None`
# log_level = "info"
# Specifies how much log data to buffer in memory before writing to disk.
# Larger buffer size can improve performance but uses more memory and may lose some logs if the application crashes.
# Default `None`
# log_buffered_size = "10MB"
# Enable json log format. Default `false`
# log_format_json = false
# Sentry connection URI for error tracking and monitoring.
# Enable this to track errors and exceptions in your application.
# It's available in the full feature release. Default `none`
# sentry = ""
# Pyroscope is a continuous profiling platform that helps you understand performance
# bottlenecks in your application. When configured, it will collect and analyze CPU profiles.
# Example value: "http://pyroscope:4040"
# It's available in the full feature release. Default `none`
# pyroscope = ""
# This setting controls how often Pingap checks for configuration file changes.
# When changes are detected, the process will automatically restart to apply the new configuration.
# Default `90s`
# auto_restart_check_interval = "90s"
# Set the file cache directory. Format: "/path/to/cache?reading_max=1000&writing_max=200&cache_max=100&cache_file_max_size=40960"
# - reading_max: maximum number of concurrent read operations
# - writing_max: maximum number of concurrent write operations
# - cache_max: maximum number of tinyufo items for file cache
# - cache_file_max_size: maximum size of file for tinyufo, if file size is greater than this value, it will be cached in file not tinyufo.
# cache_directory = ""
# Maximum size of the in-memory cache for file caching. This limit applies when no cache_directory is set.
# Increasing this value will allow more files to be cached but consume more memory. It is not limited for file cache.
# Default `100MB`
# cache_max_size = "100MB"
[upstreams.charts]
# Upstream address list
# Format: "address:port [weight]"
# weight is optional, default is 1
# Example: "127.0.0.1:5000" has weight 1
# "127.0.0.1:5001 10" has weight 10
addrs = ["127.0.0.1:5000", "127.0.0.1:5001 10"]
# Service discovery, support "dns", "docker", "common", "transparent".
# Default `none`
# discovery = ""
# How often to refresh the list of upstream servers when using service discovery.
# Format: duration string (e.g. "1m", "30s", "1h").
# It should be set when discovery is `dns` or `docker`. Default `none`
# update_frequency = "1m"
# Loadbalancer selection algorithm
# Supported algorithms:
# - "hash:url" - Consistent hashing based on request URL
# - "hash:ip" - Consistent hashing based on request IP
# - "hash:header:header_name" - Consistent hashing based on specified header
# - "hash:cookie:cookie_name" - Consistent hashing based on specified cookie
# - "hash:query:query_name" - Consistent hashing based on specified query
# - "hash" - Consistent hashing based on request path
# - "round_robin" - Simple round robin distribution
# Default `round_robin`
# algo = "hash:cookie:sid"
# Server Name Indication (SNI) for HTTPS upstream connections.
# Specify the hostname to be used in the TLS handshake when connecting to upstream HTTPS servers.
# Example: "example.com"
# It should be set if the upstream server is https. Default `none`
# sni = ""
# Whether to check if upstream' server cert is valid and validated
# Default `true`
# verify_cert = true
# Upstream http health check, if not set, tcp health check will be used.
# - http: `http://upstreamname/path?connection_timeout=3s&read_timeout=3s&check_frequency=10s&success=1&failure=2&reuse=true`
# - tcp: `tcp://upstreamname?connection_timeout=3s&read_timeout=3s&check_frequency=10s&success=1&failure=2&reuse=true`
# - grpc: `grpc://upstreamname/path?connection_timeout=3s&read_timeout=3s&check_frequency=10s&success=1&failure=2&reuse=true&tls=true&service=pingap`
# The default parameters are:
# - connection_timeout: 3s
# - read_timeout: 3s
# - check_frequency: 10s
# - success: 1
# - failure: 2
# - reuse: false
# - tls: false
# health_check = "http://charts/ping?connection_timeout=3s&read_timeout=3s"
# When set to true, forces upstream connections to only use IPv4 addresses,
# ignoring any IPv6 addresses even if available. Useful for environments
# where IPv6 connectivity is problematic or not supported.
# Default `false`
# ipv4_only = false
# Enable distributed tracing for upstream connections. When enabled, the connected connection will be traced.
# Default `false`
# enable_tracer = false
# Application-Layer Protocol Negotiation (ALPN) protocol for upstream connections.
# Supported values: "h1" (HTTP/1.1), "h2" (HTTP/2), "h2h1" (HTTP/2 over TLS with HTTP/1.1 fallback).
# This setting determines which protocol version to use when communicating with upstream servers.
# Default `h1`
# alpn = "h1"
# How long to wait before giving up establishing a TCP connection
# Default `none`
connection_timeout = "10s"
# How long to wait before giving up establishing a connection including TLS handshake time
# Default `none`
total_connection_timeout = "30s"
# How long to wait before each individual `read()` from upstream. The timer is reset after each `read()`
# Default `none`
read_timeout = "10s"
# How long to wait before closing a idle connection waiting for connection reuse
# Default `none`
idle_timeout = "2m"
# How long to wait before a `write()` to upstream finishes
# Default `none`
write_timeout = "10s"
# TCP keepalive idle time:
# - Duration a connection must be idle before TCP starts sending keepalive probes
# - Helps detect dead peer connections while minimizing unnecessary network traffic
# - Default: none (system default)
tcp_idle = "2m"
# TCP keepalive probe interval:
# - Time between consecutive keepalive probe attempts
# - Lower values detect connection failures faster but increase network overhead
# - Default: none (system default)
tcp_interval = "1m"
# TCP keepalive probe count:
# - Maximum number of failed probes before declaring connection dead
# - Higher values increase tolerance to temporary network issues
# - Lower values detect failures faster but may cause premature disconnections
# - Default: none (system default)
tcp_probe_count = 9
# TCP receive buffer size:
# - Size of the kernel buffer for receiving TCP packets
# - Larger values can improve throughput for high-bandwidth connections
# - Smaller values conserve memory but may impact performance
# - Default: none (system default)
tcp_recv_buf = "4kb"
# TCP Fast Open:
# - Enables TCP Fast Open (TFO) protocol for faster connection establishment
# - Reduces latency by sending data in the initial SYN packet
# - Requires kernel support and may not work with all clients/networks
# - Default: none (system default)
tcp_fast_open = true
[upstreams.diving]
addrs = ["127.0.0.1:5001"]
[locations.lo]
# upstream of location (default none)
upstream = "charts"
# location match path (default none)
path = "/"
# location match host, multiple domain names are separated by commas (default none)
host = ""
# set headers to request (default none)
includes = ["proxySetHeader"]
# add headers to request (default none)
proxy_add_headers = ["name:value"]
# rewrite the request path, e.g. `^/api/ /` replace prefix /api/ to / (default none)
rewrite = ""
# the weigh of location (default none)
weight = 1024
# client max body size limit (default none)
client_max_body_size = "1mb"
# plugin list for location
plugins = ["pingap:requestId", "stats"]
[servers.test]
# server linsten address, multiple addresses are separated by commas (default none)
addr = "0.0.0.0:6188"
# access log format (default none)
access_log = "tiny"
# the locations for server
locations = ["lo"]
# the threads count for server (default 1)
threads = 1
# tls certificate(pem) (default none)
# tls_cert = ""
# tle private key(pem) (default none)
# tls_key = ""
# the list of supported ciphers for protocols before TLSv1.3 (default none)
tls_cipher_list = ""
# the list of supported ciphers for protocols TLSv1.3 (default none)
tls_ciphersuites = ""
# tls min version (default none)
tls_min_version = ""
# tls max version (default none)
tls_max_version = ""
# get domain certificates from let's encrypt (default none)
# lets_encrypt = ""
# the file for save certificate (default none)
certificate_file = ""
# using global certificates (default false)
global_certificates = false
# enable http2 (default false)
enabled_h2 = false
# the time a connection needs to be idle before TCP
# begins sending out keep-alive probes (default none)
tcp_idle = "2m"
# duration between TCP keep-alive probes (default none)
tcp_interval = "1m"
# the maximum number of TCP keep-alive probes to send
# before giving up and killing the connection
tcp_probe_count = 9
# enable TCP fast open and set the backlog size of it (default none)
tcp_fast_open = 10
# enable prometheus metrics, it can be a push gateway url or pull metrics path (default none)
prometheus_metrics = ""
[plugins.stats]
value = "/stats"
category = "stats"
[storages.authToken]
category = "secret"
secret = "123123"
value = "PLpKJqvfkjTcYTDpauJf+2JnEayP+bm+0Oe60Jk="
[storages.proxySetHeader]
category = "config"
value = 'proxy_set_headers = ["name:value"]'