manager: datamodel: lower verbosity for network/listen configuration
Note: the examples don't reflect later changes in this MR.
Simplified configuration of network/listen
.
- list of values can be used for ip-address, interface or unix-socket (e.g.
ip-address: [127.0.0.1, ::1]
) -
@port
syntax can be used with ip-address and interface (e.g.::1@5353
,eth0@5353
) - advanced validation
Examples
network:
listen:
- unix-socket: /tmp/kresd-socket
- ip-address: 127.0.0.1
port: 5353
- ip-address: ["127.0.0.1@5353", "::1@5353"]
kind: dot
- ip-address: ["127.0.0.1", "::1"]
kind: dot
- interface: ["lo", "eth0"]
port: 5555
kind: doh2
- interface: ["lo@5555", "eth0@5656"]
kind: doh2
If port number is specified by port
option and @port
, the config is invalid.
network:
# this is all invalid
listen:
- ip-address: 127.0.0.1@5353
port: 5555
- ip-address: ["127.0.0.1@5353", "::1"] # invalid, @port must be specified for all values or for none
kind: dot
Closes #703 (closed)
Edited by Vladimír Čunát