Skip to content

Commit

Permalink
feat(client): dns: Add options dns.independent_cache and dns.reverse_…
Browse files Browse the repository at this point in the history
…mapping
  • Loading branch information
muink committed Nov 22, 2023
1 parent 84a992c commit ae49bf2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions htdocs/luci-static/resources/view/homeproxy/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,15 @@ return view.extend({
so = ss.option(form.Flag, 'disable_cache_expire', _('Disable cache expire'));
so.default = so.disabled;
so.depends('disable_cache', '0');

so = ss.option(form.Flag, 'independent_cache', _('Independent cache per server'),
_('Make each DNS server\'s cache independent for special purposes. If enabled, will slightly degrade performance.'));
so.default = so.disabled;
so.depends('disable_cache', '0');

so = ss.option(form.Flag, 'reverse_mapping', _('Reverse mapping'),
_('Stores a reverse mapping of IP addresses after responding to a DNS query in order to provide domain names when routing.'));
so.default = so.disabled;
/* DNS settings end */

/* DNS servers start */
Expand Down
8 changes: 6 additions & 2 deletions root/etc/homeproxy/scripts/generate_client.uc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ else
const dns_port = uci.get(uciconfig, uciinfra, 'dns_port') || '5333';

let main_node, main_udp_node, dedicated_udp_node, default_outbound, sniff_override = '1',
dns_server, dns_default_strategy, dns_default_server, dns_disable_cache, dns_disable_cache_expire,
dns_server, dns_default_strategy, dns_default_server, dns_disable_cache, dns_disable_cache_expire, dns_independent_cache, dns_reverse_mapping,
direct_domain_list;

if (routing_mode !== 'custom') {
Expand All @@ -68,6 +68,8 @@ if (routing_mode !== 'custom') {
dns_default_server = uci.get(uciconfig, ucidnssetting, 'default_server');
dns_disable_cache = uci.get(uciconfig, ucidnssetting, 'disable_cache');
dns_disable_cache_expire = uci.get(uciconfig, ucidnssetting, 'disable_cache_expire');
dns_independent_cache = uci.get(uciconfig, ucidnssetting, 'independent_cache');
dns_reverse_mapping = uci.get(uciconfig, ucidnssetting, 'reverse_mapping');

/* Routing settings */
default_outbound = uci.get(uciconfig, uciroutingsetting, 'default_outbound') || 'nil';
Expand Down Expand Up @@ -307,7 +309,9 @@ config.dns = {
rules: [],
strategy: dns_default_strategy,
disable_cache: (dns_disable_cache === '1'),
disable_expire: (dns_disable_cache_expire === '1')
disable_expire: (dns_disable_cache_expire === '1'),
independent_cache: (dns_independent_cache === '1'),
reverse_mapping: (dns_reverse_mapping === '1')
};

if (!isEmpty(main_node)) {
Expand Down

0 comments on commit ae49bf2

Please sign in to comment.