mimugmail / opn-repo

OPNsense repo by mimugmail
Other
325 stars 24 forks source link

Adguard home and tailscaled. #219

Open stepanovdg opened 1 month ago

stepanovdg commented 1 month ago

Hi, sorry but I have no idea left - maybe you help. Right now I have installed both adguardhome and tailscaled (another topic - but maybe it could be added to your plugins list) After reboot adguardhome fail to start as I am also specifying to listen on tailscale ip (100.x.x.x):

2024/05/31 00:15:04.880859 [info] dnsproxy: creating udp server socket 100.x.x.x:53
2024/05/31 00:15:04.891119 [error] querylog: closing: flushing log buffer: nothing to write to a file
2024/05/31 00:15:04.891227 [fatal] couldn't start forwarding DNS server: starting listeners: listening on udp addr 100.x.x.x:53: listening to udp socket: listen udp 100.x.x.x:53: bind: can't assign requested address

I tried using 0.0.0.0 - but in this case only endpoints available on the moment of start are used (and it not working with VIP (virtual ip) registered ( I am running HA mode with pfsync). Ex: 10.0.0.1 (vip) 10.0.0.2 (actual ip) - so adguard listen only on 10.0.0.2.

So I am specifying all possible ips. And as adguard fail depending on tailscale ip. I tried to set in .../rc.d/adguardhome

#!/bin/sh
# PROVIDE: adguardhome 
# REQUIRE: tailscaled
....

But it still fail the same ip not available. But if I manually start service as soon as web gui is up or ssh (service adguardhome start). Everything working.

What would be the correct phase to start adguard in such scenario? Any dependency/hook can be added to rc script?

Creating issue here as wasnt able to find the source code of rc.

Thank you.