agh1467 / plugins

OPNsense plugin collection
https://opnsense.org/
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

dnscrypt-proxy: Manual server configuration doesn't work #2

Open agh1467 opened 3 years ago

agh1467 commented 3 years ago

Describe the bug When setting up the plugin for the first time and using manual server selection, dnscrypt-proxy won't start.

To Reproduce Steps to reproduce the behavior:

  1. Install dnscrypt-proxy plugin (i.e. with no prior config)
  2. Configure dnscrypt-proxy
  3. Check the box for enabling manual server selection
  4. No servers display on the list for selection.

Starting dnscrypt-proxy results in a message from dnscrypt-proxy: [FATAL] No servers configured

Expected behavior dnscrypt-proxy has servers for selection on the menu.

Screenshots image image

Environment 2.0.45 r1

agh1467 commented 3 years ago

This is due to the fact that upon plugin installation, there are no sources or static servers configured. When the service goes to start, it doesn't have any sources, and no static servers configured and results in that error. So, without explicitly clicking the button to restore sources to default, these sources won't be set up.

Since these settings are within an array field, they don't work the same way as other fields which have "default value" settings. I think a solution will be to establish a "first-time setup" functionality which will pre-populate these values into the array the first time the settings page is loaded.

Another part of this is population of the server names list. This list comes from dnscrypt-proxy, and without sources or static servers configured, dnscrypt-proxy will always return an empty list. When the plugin is first installed, and before the first configuration save, these lists will be empty. Thus I think a solution will be to perform the first-time setup, and then force a re-configure of dnscrypt-proxy, which will use the default configurations (included in the example toml from the author). This will get at least a base functional dnscrypt-proxy which should return a valid list of servers.

I have a successful first-time setup, and preliminary testing shows it functions as expected, and populates the sources list, and also the server names lists. I need to do some more testing with a focus on a blank config as is the state upon first installation.