mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
When reading base64 config, either via command line or via custom config from Control D API, we do want new config entirely instead of mixing with old config. So new viper instance should be re-recreated before reading in new config. That also helps simplifying self-check process, because the config is now always set correctly, instead of watching change made by "ctrld run" command. However, log file and listener config need a special handling, because they could be changed/unset from Control D API: - Log file can change dynamically each time ctrld runs, so init logging process need to take care of re-initializing if log setup changed. - For listener setup, users could leave ip and port empty, and ctrld will pick a random loopback 127.0.0.x:53. However, on Linux systems which use systemd-resolved, the stub listener won't forward queries from its address 127.0.0.53 to 127.0.0.x, so ctrld will use the default router interface address instead.