Browse Source

dnscrypt-proxy: Add custom resolver config support

This commit modifies the dnscrypt-proxy plugin's `dnscrypt-proxy.init`
script to allow specifying a custom dnscrypt resolver. Prior to this
commit users of the dnscrypt-proxy plugin are only able to choose from
a dnscrypt resolver that is present in the packaged `ResolversList` CSV
file.

To specify a custom resolver three new configuration parameters are
required[0]: `ProviderName`, `ProviderKey` and `ResolverAddress`.

The `dnscrypt-proxy.init` script now maps `providername`, `providerkey`,
and `resolveraddress` values (if present) from a `dnscrypt-proxy.config`
file into the generated DNSCrypt configuration file.

`PKG_RELEASE` is increased from 1 to 2 to reflect the new functionality.

[0]: 9eee474770/dnscrypt-proxy.conf (L28:L32)

Signed-off-by: Daniel McCarney <daniel@binaryparadox.net>
lilik-openwrt-22.03
Daniel 8 years ago
committed by Daniel
parent
commit
1ffd9b0343
No known key found for this signature in database GPG Key ID: 8FB2BFC470E75B4
2 changed files with 8 additions and 2 deletions
  1. +1
    -1
      net/dnscrypt-proxy/Makefile
  2. +7
    -1
      net/dnscrypt-proxy/files/dnscrypt-proxy.init

+ 1
- 1
net/dnscrypt-proxy/Makefile View File

@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dnscrypt-proxy
PKG_VERSION:=1.9.4
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://download.dnscrypt.org/dnscrypt-proxy


+ 7
- 1
net/dnscrypt-proxy/files/dnscrypt-proxy.init View File

@ -16,7 +16,7 @@ dnscrypt_instance() {
}
create_config_file() {
local address port resolver resolvers_list ephemeral_keys client_key syslog syslog_prefix local_cache query_log_file block_ipv6
local address port resolver resolvers_list ephemeral_keys client_key syslog syslog_prefix local_cache query_log_file block_ipv6 provider_name provider_key resolver_address
local config_path="$2"
[ ! -d "$CONFIG_DIR" ] && mkdir -p "$CONFIG_DIR"
@ -25,6 +25,9 @@ create_config_file() {
config_get address $1 'address' '127.0.0.1'
config_get port $1 'port' '5353'
config_get resolver $1 'resolver' ''
config_get provider_name $1 'providername' ''
config_get provider_key $1 'providerkey' ''
config_get resolver_address $1 'resolveraddress' ''
config_get resolvers_list $1 'resolvers_list' '/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'
config_get client_key $1 'client_key' ''
config_get syslog_prefix $1 'syslog_prefix' 'dnscrypt-proxy'
@ -36,6 +39,9 @@ create_config_file() {
append_param_not_empty "ResolverName" "$resolver" $config_path
append_param "ResolversList" "$resolvers_list" $config_path
append_param_not_empty "ProviderName" "$provider_name" $config_path
append_param_not_empty "ProviderKey" "$provider_key" $config_path
append_param_not_empty "ResolverAddress" "$resolver_address" $config_path
append_param "User" "$USER" $config_path
append_param "LocalAddress" "$address:$port" $config_path
append_param_not_empty "ClientKey" "$client_key" $config_path


Loading…
Cancel
Save