From 34c656501698d1787acfc81ae27c9a3cc7005395 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Sun, 7 May 2023 08:53:12 +0200 Subject: [PATCH] Some changes for IPv6 support in omr-bypass --- .../resources/view/services/omr-bypass.js | 39 +++++++++++++++++-- .../root/etc/uci-defaults/41_omr-bypass | 7 ++++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js b/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js index 3119d93f0..59efc4eec 100644 --- a/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js +++ b/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js @@ -23,6 +23,16 @@ return L.view.extend({ m = new form.Map('omr-bypass', _('OMR-Bypass'),_('OpenMPTCProuter IP must be used as DNS.')); + /* + s = m.section(form.TypedSection, 'global', _('Global settings')); + s.addremove = false; + s.anonymous = true; + + o = s.option(form.Flag, 'noipv6', _('Disable IPv6 AAAA DNS results for bypassed domains')); + o.default = o.disabled; + o.optional = true; + */ + s = m.section(form.GridSection, 'domains', _('Domains')); s.addremove = true; s.anonymous = true; @@ -42,6 +52,17 @@ return L.view.extend({ o = s.option(form.Value, 'note', _('Note')); o.rmempty = true; + o = s.option(form.ListValue, 'family', _('Restrict to address family')); + o.value('ipv4ipv6', _('IPv4 and IPv6')); + o.value('ipv4', _('IPv4 only')); + o.value('ipv4', _('IPv6 only')); + o.default = 'ipv4ipv6'; + o.modalonly = true + + o = s.option(form.Flag, 'noipv6', _('Disable AAAA IPv6 DNS')); + o.default = o.enabled; + o.modalonly = true + s = m.section(form.GridSection, 'ips', _('IPs and Networks')); s.addremove = true; s.anonymous = true; @@ -223,12 +244,24 @@ return L.view.extend({ o.noinactive = true; o.nocreate = true; - o = s.option(form.Flag, 'ndpi', _('Enable ndpi')); - o.default = o.enabled; - o = s.option(form.Value, 'note', _('Note')); o.rmempty = true; + o = s.option(form.ListValue, 'family', _('Restrict to address family')); + o.value('ipv4ipv6', _('IPv4 and IPv6')); + o.value('ipv4', _('IPv4 only')); + o.value('ipv4', _('IPv6 only')); + o.default = 'ipv4ipv6'; + o.modalonly = true + + o = s.option(form.Flag, 'noipv6', _('Disable AAAA IPv6 DNS')); + o.default = o.enabled; + o.modalonly = true + + o = s.option(form.Flag, 'ndpi', _('Enable ndpi')); + o.default = o.enabled; + o.modalonly = true + return m.render(); } }); diff --git a/luci-app-omr-bypass/root/etc/uci-defaults/41_omr-bypass b/luci-app-omr-bypass/root/etc/uci-defaults/41_omr-bypass index 9ced39f93..394829cc0 100755 --- a/luci-app-omr-bypass/root/etc/uci-defaults/41_omr-bypass +++ b/luci-app-omr-bypass/root/etc/uci-defaults/41_omr-bypass @@ -118,6 +118,13 @@ if [ "$(uci -q get omr-bypass.amazonvideo)" = "" ]; then commit omr-bypass EOF fi +#if [ "$(uci -q get omr-bypass.global)" = "" ]; then +# uci -q batch <<-EOF >/dev/null +# set omr-bypass.global=global +# set omr-bypass.global.noipv6='0' +# commit omr-bypass +# EOF +#fi if [ ! -f /etc/crontabs/root ] || [ "$(cat /etc/crontabs/root | grep bypass)" = "" ]; then echo "0 2 * * * /etc/init.d/omr-bypass bypass_asn" >> /etc/crontabs/root fi