stangri / source.openwrt.melmac.net

OpenWrt Packages
GNU General Public License v3.0
144 stars 47 forks source link

Proposal: matching provider domain for providers which offer custom profiles #181

Closed aliicex closed 1 year ago

aliicex commented 1 year ago

@stangri apologies; not sure of the etiquette or decorum around proposals such as this.

Some DNS providers (e.g. ControlD and NextDNS) allow the creation of custom profiles. In such cases, unique DoH URLs are generated. E.g. a ControlD resolver looks like https://dns.controld.com/<profileid>

In such cases, 'Unknown Provider' is shown since the URL in the https-dns-proxy config does not match a resolver_url in the list of providers.

Therefore, I would like to propose that provider domains are also used to identify the DoH provider, rather than just the full resolver_url. Where custom profiles aren't available, I've simply set the value of provider_domain to "https.dns.proxy"

If this approach in this PR is useful, then I would be happy to continue along this path.

stangri commented 1 year ago

Thank you for your contribution.

However I'd be opposed to adding another field in the provider definition files when the domain can be derived from resolver_url already present in the provider definition file.

Having said that, if something like this is implemented, it will result in overwriting of the user's customization of the resolver_url with the default resolver for the provider when saved in WebUI. I believe it's a worse user experience that the current one.

The whole code is long overdue to be rewritten in javascript like I did for the other packages I maintain, I've been thinking about how to address this issue then.

aliicex commented 1 year ago

Thanks - your consideration appreciated, and I concur with the points which you have made. I will close this PR for now. If you need any assistance testing the JS rewrite, I'd be happy to oblige.