nextdns
nextdns copied to clipboard
Sort config file when saving it on upgrade
Every upgrade of nextdns cli re-writes the config file. I keep the settings in the file sorted as they are easier to find and also match the output of nextdns run --help.
It would help to have the config file sorted on save.
What kind of sort should be preferred here? By alphabet or by the function?
I also found that the order inside the config file that generated by NextDNS cli is actually different from the output of nextdns config list 😆
$ nextdns config list
setup-router true
cache-size 10MB
cache-max-age 0s
discovery-dns
use-hosts true
listen localhost:53
control /var/run/nextdns.sock
config xxxxxx
auto-activate false
max-ttl 0s
report-client-info true
mdns all
bogus-priv true
max-inflight-requests 256
log-queries false
detect-captive-portals false
hardened-privacy false
timeout 5s
$ cat /etc/nextdns.conf
bogus-priv true
setup-router true
cache-size 10MB
mdns all
hardened-privacy false
report-client-info true
detect-captive-portals false
timeout 5s
listen localhost:53
control /var/run/nextdns.sock
use-hosts true
auto-activate false
config xxxxxx
cache-max-age 0s
discovery-dns
log-queries false
max-ttl 0s
max-inflight-requests 256
Alphabetical. Easier to visually find a setting in the file, easier to diff two versions of the config file. Same for nextdns config list, it should sort the output the same way.