-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.yml
More file actions
317 lines (289 loc) · 8.95 KB
/
settings.yml
File metadata and controls
317 lines (289 loc) · 8.95 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
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
# Supported types:
# scalar: string, bool, int, int8, int16, int32, int64,
# uint, uint8, uint16, uint32, uint64,
# float (alias for float32), float32, float64, duration
# array: []string, []bool, []int, []int64, []uint, []uint64,
# []float32, []float64, []duration
# enum: add "enum: [val1, val2, ...]" — generates uint16 const type
# (type field is optional for enums)
# []enum: array of enum values
# map: map[string]any, map[string][]string — JSON on CLI, native in config files
# trigger: true — CLI-only bool flag, not saved/parsed from config files
# Config file redirect chain:
# When a config file contains a non-empty "config" field, it acts as a pure
# redirect — all other fields in that file are ignored and the referenced
# file is loaded instead. Chains are followed up to 32 hops; circular
# references are detected and rejected.
# Relative paths are resolved from the directory of the referring file.
# The "config" field is never written to generated config files.
config:
type: string
usage: "path to config file (json/yml/yaml/hjson/conf)"
# ==== #
go:
usage: "executable commands"
trigger: true
key:
usage: "key utilities"
gen:
type: duration
usage: "mine a private key with max leading zeros for the given duration (e.g. 10s, 1m; recommended ≥10s, enforced min 100ms)"
addr:
type: string
usage: "show Yggdrasil IPv6 address and subnet for a given key (hex private 128 chars, hex public 64 chars, or PEM file path)"
to_pem:
type: string
usage: "convert hex private key (128 chars) to PEM file; value is output file path"
from_pem:
type: string
usage: "convert PEM file to hex private key; value is input file path"
conf:
usage: "configuration utilities"
generate:
usage: "generate a default ratatoskr config file"
path:
type: string
usage: "output directory path (file is always ratatoskr-config.{format})"
format:
usage: "output file format (default: yml)"
enum: &conf_format [ yml, json, conf ]
preset:
usage: "config preset (default: basic)"
enum: [ basic, medium, full ]
import:
usage: "convert Yggdrasil config to ratatoskr format"
from:
type: string
usage: "input Yggdrasil config file path"
to:
type: string
usage: "output directory path"
format:
usage: "output file format (default: yml)"
enum: *conf_format
export:
usage: "convert ratatoskr config to Yggdrasil format"
from:
type: string
usage: "input ratatoskr config file path"
to:
type: string
usage: "output directory path"
format:
usage: "output file format (default: json)"
enum: *conf_format
peer_info:
usage: "probe peers and report status"
peer: &peer_list
type: "[]string"
usage: "yggdrasil peer URIs (e.g. tcp://1.2.3.4:5678)"
timeout:
type: duration
usage: "probe timeout per peer (default: 10s)"
format: &output_format_block
usage: "output format (default: text)"
enum: &output_format [ text, json ]
ask:
usage: "query remote node's NodeInfo"
addr:
type: string
usage: "target address (64-char hex, <hex>.pk.ygg, [ipv6]:port, or bare IPv6)"
peer: *peer_list
timeout:
type: duration
usage: "response timeout (default: 30s)"
format: *output_format_block
forward:
usage: "port forwarding through Yggdrasil"
from:
type: string
usage: "local listen address (e.g. 127.0.0.1:8080)"
to:
type: string
usage: "remote Yggdrasil address:port (e.g. [200:abc::1]:8080)"
proto:
usage: "protocol (default: tcp)"
enum: [ tcp, udp ]
peer: *peer_list
probe:
scan:
type: bool
usage: "BFS network topology scan"
trace:
type: string
usage: "trace route to target public key (64-char hex)"
ping:
type: string
usage: "ping a node by public key and measure RTT (64-char hex)"
peer:
<<: *peer_list
usage: "yggdrasil peer URIs (e.g. tcp://1.2.3.4:5678); when multiple are given, each is tried sequentially until one connects; the total timeout is shared across all attempts"
timeout:
type: duration
usage: "context timeout (default: 5m, min: 100ms)"
max_depth:
type: uint16
usage: "BFS max depth for scan (default: 3)"
concurrency:
type: int
usage: "parallel workers for scan (default: 64)"
count:
type: int
usage: "number of pings (default: 4)"
format: *output_format_block
# ==== #
yggdrasil:
usage: "Yggdrasil network node configuration"
gen_interface: true
key:
usage: "node private key; empty → auto-generated; if both set, path takes priority"
text:
type: string
usage: "hex-encoded Ed25519 private key (128 hex chars)"
path:
type: string
usage: "path to private key file in PEM format (alternative to private_key)"
listen:
type: "[]string"
usage: "listener addresses for incoming connections (e.g. tls://0.0.0.0:0)"
inputs:
type: "[]string"
usage: "real externally reachable addresses (e.g. public IPs); optional, for internal use"
peers:
usage: "peer connections"
url:
type: "[]string"
usage: "outbound peer URIs (e.g. tls://a.b.c.d:e, tcp://1.2.3.4:5678)"
interface:
type: "map[string][]string"
usage: "outbound peers bound to network interfaces"
manager:
usage: "smart peer manager (replaces standard Yggdrasil peering)"
enable:
type: bool
value: true
usage: "when disabled, all peer URLs are passed directly to Yggdrasil Peers"
probe_timeout:
type: duration
value: "10s"
usage: "probe connection timeout"
refresh_interval:
type: duration
usage: "re-evaluation interval (0 → startup only)"
max_per_proto:
type: int
usage: "best peers per protocol (0/1 → one, -1 → passive mode)"
batch_size:
type: int
usage: "probing batch size (0/1 → all at once, ≥2 → sliding window)"
allowed_public_keys:
type: "[]string"
usage: "hex-encoded public keys allowed for incoming peering; empty → allow all"
admin_listen:
type: string
value: "none"
usage: "admin socket listen address; 'none' to disable"
if:
usage: "TUN adapter"
name:
type: string
value: "none"
usage: "TUN interface name; 'auto', 'none', or specific name"
mtu:
type: uint64
value: 65535
usage: "TUN interface MTU (min 1280)"
node:
usage: "node identity and metadata"
info:
type: "map[string]any"
usage: "node metadata visible to the network"
privacy:
type: bool
usage: "hide default nodeinfo (platform, architecture, version)"
auto:
type: bool
value: true
usage: "auto-populate NodeInfo; merges with info if set; returns error on key conflicts"
log_lookups:
type: bool
usage: "log address lookups"
core_stop_timeout:
type: duration
value: "5s"
usage: "core.Stop() timeout (0 → unlimited)"
rst_queue_size:
type: int
value: 100
usage: "RST packet deferred queue size"
multicast:
usage: "multicast peer discovery"
regex:
type: string
value: ".*"
usage: "interface name regex for multicast discovery"
beacon:
type: bool
value: true
usage: "advertise presence via multicast"
listen:
type: bool
value: true
usage: "listen for multicast advertisements"
port:
type: uint16
usage: "multicast port (0 → default)"
priority:
type: uint16
usage: "peer priority (lower = preferred)"
password:
type: string
usage: "multicast peering password"
socks:
usage: "SOCKS5 proxy configuration"
addr:
type: string
usage: "listen address (TCP '127.0.0.1:1080' or Unix '/tmp/ygg.sock')"
max_connections:
type: int
usage: "max simultaneous connections (0 → unlimited)"
# ==== #
log:
usage: "logging configuration"
compress:
type: bool
value: true
usage: "compress rotated log files"
file_path:
type: string
usage: "log file path (auto-detected if empty)"
format:
value: "text"
usage: "console format"
enum: *output_format
level:
usage: "log level thresholds"
console:
value: "debug"
usage: "console log level"
enum: &log_levels [ debug, info, warn, error, fatal, panic, disabled ]
file:
value: "info"
usage: "file log level"
enum: *log_levels
max_age:
type: int
value: 30
usage: "log file max age (days)"
max_backups:
type: int
value: 3
usage: "log file max backups"
max_size:
type: int
value: 32
usage: "log file max size (MB)"
output:
value: "both"
usage: "log output mode"
enum: [ console, file, both ]