routedns icon indicating copy to clipboard operation
routedns copied to clipboard

RouteDNS exits when using an URL "source" that generates an error

Open cbuijs opened this issue 3 years ago • 11 comments

When using a source pointing to an URL, and the download fails (for example 404: Does not exist), RouteDNS exits.

Would it be possible to exit more gracefully, or have an option to ignore the error and retry again later? And stay running?

cbuijs avatar May 28 '21 13:05 cbuijs

I think you can download to local disk by a script, and load from local disk.

iamsurfing avatar May 28 '21 17:05 iamsurfing

It's possible to do that, just need to figure out a way to do it elegantly. This is already working if the file disappears, routedns will keep running and use the old content until it's able to refresh again. I deliberately wanted to make it fail if the blocklist isn't there on startup, but that could probably be made configurable.

folbricht avatar May 29 '21 17:05 folbricht

use the cache-dir statement, so in most caches it reverts to the local version when not expired. But sometimes when I start from scratch, and maybe made a typo in the URL, or it is unavailable due to whatever reason (404 for example, or timeout).

It might be handy indeed to have an option to "continue" anyway. The reload/refresh should still be done, but maybe at a shorter/definable interval in that case? In that case maybe a retry option makes sense as well.

Or to keep it closer to today, retry a couple of times before abort?

cbuijs avatar May 31 '21 06:05 cbuijs

Ping!

If we can make this configurable, to make it continue when an error happens on download? Perhaps with a fail-over/backup using multiple sources?

cbuijs avatar Dec 20 '21 20:12 cbuijs

Yup, I can get that in the next few days. Just been quite short on time.

folbricht avatar Dec 21 '21 13:12 folbricht

No hurries!

cbuijs avatar Dec 21 '21 14:12 cbuijs

Ping! :-)

cbuijs avatar May 23 '22 18:05 cbuijs

Pong? :-)

cbuijs avatar Aug 19 '22 07:08 cbuijs

@cbuijs I think I can work on it. Give me a couple of days but that will free up @folbricht's time

charlieporth1 avatar Aug 19 '22 08:08 charlieporth1

I whipped up a quick draft implementation in https://github.com/folbricht/routedns/pull/259 This only addresses the domain loader, not the other 2 yet. There's a new allow-fail-on-startup option on the list config.

blocklist-source = [
   {format = "domain", source = "https://raw.githubusercontent.com/cbuijs/accomplist/master/deugniets/routedns.blocklist.domain.list1", allow-fail-on-startup = true},

It's completely un-tested. @charlieporth1 Would you like to take care of the other loaders? You can see from that PR how I planned on dealing with it. Any suggestions are welcome. Feel free to push to the same branch.

folbricht avatar Aug 19 '22 08:08 folbricht

I would like to

charlieporth1 avatar Aug 19 '22 12:08 charlieporth1

Works.

cbuijs avatar Feb 14 '23 11:02 cbuijs

Reverting the first attempt in https://github.com/folbricht/routedns/pull/292

folbricht avatar Mar 22 '23 08:03 folbricht

Opened a new PR for this in https://github.com/folbricht/routedns/pull/293 but I'll likely abandon this attempt and instead simply add an option to a blocklist source like allow-load-failure = true or similar. It's a much cleaner implementation that way without some of the side-effects of https://github.com/folbricht/routedns/pull/293 Stay tuned

folbricht avatar Mar 22 '23 08:03 folbricht

This has been re-implemented on the issue-153-3 branch by adding a new allow-failure flag.

blocklist-source = [
   {format = "domain", source = "https://raw.githubusercontent.com/cbuijs/accomplist/master/deugniets/routedns.blocklist.domain.list", allow-failure = true},
]

Would you be able to try it out? This is a more flexible (and safe) way of doing this.

folbricht avatar Mar 25 '23 10:03 folbricht

Looking good, no issues so far, and it un-fails nicely when an URL is not available.

cbuijs avatar Mar 26 '23 07:03 cbuijs

Works.

cbuijs avatar Aug 22 '23 10:08 cbuijs