diff --git a/luci-app-mosdns/htdocs/luci-static/resources/view/mosdns/update.js b/luci-app-mosdns/htdocs/luci-static/resources/view/mosdns/update.js index 1bff070..b87ce6c 100644 --- a/luci-app-mosdns/htdocs/luci-static/resources/view/mosdns/update.js +++ b/luci-app-mosdns/htdocs/luci-static/resources/view/mosdns/update.js @@ -47,9 +47,20 @@ return view.extend({ }; o.default = 3; + o = s.option(form.ListValue, 'geoip_type', _('GeoIP Type'), + _('Little: only include Mainland China and Private IP addresses.') + + '
' + + _('Full: includes all Countries and Private IP addresses.') + ); + o.value('geoip', _('Full')); + o.value('geoip-only-cn-private', _('Little')); + o.rmempty = false; + o.default = 'geoip'; + o = s.option(form.Value, 'github_proxy', _('GitHub Proxy'), _('Update data files with GitHub Proxy, leave blank to disable proxy downloads.')); o.value('https://hub.gitmirror.com', _('https://hub.gitmirror.com')); + o.value('https://mirror.ghproxy.com', _('https://mirror.ghproxy.com')); o.rmempty = true; o.default = ''; diff --git a/luci-app-mosdns/po/zh_Hans/mosdns.po b/luci-app-mosdns/po/zh_Hans/mosdns.po index 3881946..72be238 100644 --- a/luci-app-mosdns/po/zh_Hans/mosdns.po +++ b/luci-app-mosdns/po/zh_Hans/mosdns.po @@ -140,6 +140,21 @@ msgstr "每周六" msgid "Every Sunday" msgstr "每周日" +msgid "GeoIP Type" +msgstr "GeoIP 类型" + +msgid "Little" +msgstr "轻量" + +msgid "Little: only include Mainland China and Private IP addresses." +msgstr "轻量:仅包含中国大陆和私有 IP 地址。" + +msgid "Full" +msgstr "全量" + +msgid "Full: includes all Countries and Private IP addresses." +msgstr "全量:包含所有国家和私有 IP 地址。" + msgid "GitHub Proxy" msgstr "GitHub 代理" diff --git a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh index 4f1667d..b0534da 100755 --- a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh +++ b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh @@ -106,12 +106,13 @@ geodat_update() ( TMPDIR=$(mktemp -d) || exit 1 [ -n "$(uci -q get mosdns.config.github_proxy)" ] && mirror="$(uci -q get mosdns.config.github_proxy)/" # geoip.dat - cn-private - echo -e "Downloading "$mirror"https://github.com/Loyalsoldier/geoip/releases/latest/download/geoip-only-cn-private.dat" - curl --connect-timeout 5 -m 60 --ipv4 -kfSLo "$TMPDIR/geoip.dat" ""$mirror"https://github.com/Loyalsoldier/geoip/releases/latest/download/geoip-only-cn-private.dat" + geoip_type=$(uci -q get mosdns.config.geoip_type || echo "geoip-only-cn-private") + echo -e "Downloading "$mirror"https://github.com/Loyalsoldier/geoip/releases/latest/download/"$geoip_type".dat" + curl --connect-timeout 5 -m 120 --ipv4 -kfSLo "$TMPDIR/geoip.dat" ""$mirror"https://github.com/Loyalsoldier/geoip/releases/latest/download/"$geoip_type".dat" [ $? -ne 0 ] && rm -rf "$TMPDIR" && exit 1 # checksum - geoip.dat - echo -e "Downloading "$mirror"https://github.com/Loyalsoldier/geoip/releases/latest/download/geoip-only-cn-private.dat.sha256sum" - curl --connect-timeout 5 -m 10 --ipv4 -kfSLo "$TMPDIR/geoip.dat.sha256sum" ""$mirror"https://github.com/Loyalsoldier/geoip/releases/latest/download/geoip-only-cn-private.dat.sha256sum" + echo -e "Downloading "$mirror"https://github.com/Loyalsoldier/geoip/releases/latest/download/"$geoip_type".dat.sha256sum" + curl --connect-timeout 5 -m 20 --ipv4 -kfSLo "$TMPDIR/geoip.dat.sha256sum" ""$mirror"https://github.com/Loyalsoldier/geoip/releases/latest/download/"$geoip_type".dat.sha256sum" [ $? -ne 0 ] && rm -rf "$TMPDIR" && exit 1 if [ "$(sha256sum "$TMPDIR/geoip.dat" | awk '{print $1}')" != "$(cat "$TMPDIR/geoip.dat.sha256sum" | awk '{print $1}')" ]; then echo -e "\e[1;31mgeoip.dat checksum error" @@ -125,7 +126,7 @@ geodat_update() ( [ $? -ne 0 ] && rm -rf "$TMPDIR" && exit 1 # checksum - geosite.dat echo -e "Downloading "$mirror"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat.sha256sum" - curl --connect-timeout 5 -m 10 --ipv4 -kfSLo "$TMPDIR/geosite.dat.sha256sum" ""$mirror"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat.sha256sum" + curl --connect-timeout 5 -m 20 --ipv4 -kfSLo "$TMPDIR/geosite.dat.sha256sum" ""$mirror"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat.sha256sum" [ $? -ne 0 ] && rm -rf "$TMPDIR" && exit 1 if [ "$(sha256sum "$TMPDIR/geosite.dat" | awk '{print $1}')" != "$(cat "$TMPDIR/geosite.dat.sha256sum" | awk '{print $1}')" ]; then echo -e "\e[1;31mgeosite.dat checksum error"