mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
all: writing correct routers setup to config file
When running on routers, ctrld leverages default setup, let dnsmasq runs on port 53, and forward queries to ctrld listener on port 5354. However, this setup is not serialized to config file, causing confusion to users. Fixing this by writing the correct routers setup to config file. While at it, updating documentation to refelct that, and also adding note that changing default router setup could break things.
This commit is contained in:
committed by
Cuong Manh Le
parent
350d8355b1
commit
50bfed706d
@@ -69,7 +69,7 @@ func cleanupFirewalla() error {
|
||||
|
||||
// Restart dnsmasq service.
|
||||
if err := restartDNSMasq(); err != nil {
|
||||
return fmt.Errorf("cleaupFirewalla: restartDNSMasq: %w", err)
|
||||
return fmt.Errorf("cleanupFirewalla: restartDNSMasq: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -214,16 +214,21 @@ func Cleanup(svc *service.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ListenAddress returns the listener address of ctrld on router.
|
||||
func ListenAddress() string {
|
||||
// ListenIP returns the listener IP of ctrld on router.
|
||||
func ListenIP() string {
|
||||
return "127.0.0.1"
|
||||
}
|
||||
|
||||
// ListenPort returns the listener port of ctrld on router.
|
||||
func ListenPort() int {
|
||||
name := Name()
|
||||
switch name {
|
||||
case DDWrt, Firewalla, Merlin, OpenWrt, Synology, Tomato, Ubios:
|
||||
return "127.0.0.1:5354"
|
||||
return 5354
|
||||
case Pfsense:
|
||||
// On pfsense, we run ctrld as DNS resolver.
|
||||
}
|
||||
return ""
|
||||
return 53
|
||||
}
|
||||
|
||||
// Name returns name of the router platform.
|
||||
|
||||
Reference in New Issue
Block a user