From 04eaf0a43bf8547d712f50539626e0be8f16a25e Mon Sep 17 00:00:00 2001 From: gitea-action Date: Mon, 6 Jan 2025 13:30:15 +0800 Subject: [PATCH] luci-app-homeproxy: sync upstream last commit: https://github.com/immortalwrt/homeproxy/commit/23f78cd11d71c4454deedba3bbb0c6cf0d79366f --- .../resources/view/homeproxy/client.js | 6 ++--- luci-app-homeproxy/po/templates/homeproxy.pot | 6 ++--- luci-app-homeproxy/po/zh_Hans/homeproxy.po | 16 ++++++++------ luci-app-homeproxy/root/etc/init.d/homeproxy | 22 +++++++++++-------- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/luci-app-homeproxy/htdocs/luci-static/resources/view/homeproxy/client.js b/luci-app-homeproxy/htdocs/luci-static/resources/view/homeproxy/client.js index 206d15453..16e6b996f 100644 --- a/luci-app-homeproxy/htdocs/luci-static/resources/view/homeproxy/client.js +++ b/luci-app-homeproxy/htdocs/luci-static/resources/view/homeproxy/client.js @@ -156,7 +156,7 @@ return view.extend({ o.rmempty = false; o = s.taboption('routing', form.Value, 'dns_server', _('DNS server'), - _('Support UDP, TCP, DoH, DoT, DoQ. TCP protocol will be used if not specified.')); + _('Support UDP, TCP, DoH, DoQ, DoT. TCP protocol will be used if not specified.')); o.value('wan', _('WAN DNS (read from interface)')); o.value('1.1.1.1', _('CloudFlare Public DNS (1.1.1.1)')); o.value('208.67.222.222', _('Cisco Public DNS (208.67.222.222)')); @@ -194,7 +194,7 @@ return view.extend({ } o = s.taboption('routing', form.Value, 'china_dns_server', _('China DNS server'), - _('The dns server for resolving China domains. Support UDP, TCP, DoH, DoT, DoQ.')); + _('The dns server for resolving China domains. Support UDP, TCP, DoH, DoQ, DoT.')); o.value('wan', _('WAN DNS (read from interface)')); o.value('223.5.5.5', _('Aliyun Public DNS (223.5.5.5)')); o.value('210.2.4.8', _('CNNIC Public DNS (210.2.4.8)')); @@ -780,7 +780,7 @@ return view.extend({ so.editable = true; so = ss.option(form.Value, 'address', _('Address'), - _('The address of the dns server. Support UDP, TCP, DoH, DoT, DoQ and RCode.')); + _('The address of the dns server. Support UDP, TCP, DoH, DoQ, DoT and RCode.')); so.rmempty = false; so.validate = function(section_id, value) { if (section_id) { diff --git a/luci-app-homeproxy/po/templates/homeproxy.pot b/luci-app-homeproxy/po/templates/homeproxy.pot index 7f1af1f32..0a6379fe5 100644 --- a/luci-app-homeproxy/po/templates/homeproxy.pot +++ b/luci-app-homeproxy/po/templates/homeproxy.pot @@ -2054,7 +2054,7 @@ msgstr "" #: htdocs/luci-static/resources/view/homeproxy/client.js:159 msgid "" -"Support UDP, TCP, DoH, DoT, DoQ. TCP protocol will be used if not specified." +"Support UDP, TCP, DoH, DoQ, DoT. TCP protocol will be used if not specified." msgstr "" #: htdocs/luci-static/resources/view/homeproxy/client.js:298 @@ -2182,7 +2182,7 @@ msgstr "" #: htdocs/luci-static/resources/view/homeproxy/client.js:783 msgid "" -"The address of the dns server. Support UDP, TCP, DoH, DoT, DoQ and RCode." +"The address of the dns server. Support UDP, TCP, DoH, DoQ, DoT and RCode." msgstr "" #: htdocs/luci-static/resources/view/homeproxy/server.js:677 @@ -2220,7 +2220,7 @@ msgstr "" #: htdocs/luci-static/resources/view/homeproxy/client.js:197 msgid "" -"The dns server for resolving China domains. Support UDP, TCP, DoH, DoT, DoQ." +"The dns server for resolving China domains. Support UDP, TCP, DoH, DoQ, DoT." msgstr "" #: htdocs/luci-static/resources/view/homeproxy/client.js:842 diff --git a/luci-app-homeproxy/po/zh_Hans/homeproxy.po b/luci-app-homeproxy/po/zh_Hans/homeproxy.po index 760763f8e..59fc05e9a 100644 --- a/luci-app-homeproxy/po/zh_Hans/homeproxy.po +++ b/luci-app-homeproxy/po/zh_Hans/homeproxy.po @@ -2094,8 +2094,8 @@ msgstr "" #: htdocs/luci-static/resources/view/homeproxy/client.js:159 msgid "" -"Support UDP, TCP, DoH, DoT, DoQ. TCP protocol will be used if not specified." -msgstr "支持 UDP、TCP、DoH、DoT、DoQ。如未指定则使用 TCP 协议。" +"Support UDP, TCP, DoH, DoQ, DoT. TCP protocol will be used if not specified." +msgstr "支持 UDP、TCP、DoH、DoQ、DoT。如未指定则使用 TCP 协议。" #: htdocs/luci-static/resources/view/homeproxy/client.js:298 msgid "System" @@ -2226,8 +2226,8 @@ msgstr "" #: htdocs/luci-static/resources/view/homeproxy/client.js:783 msgid "" -"The address of the dns server. Support UDP, TCP, DoH, DoT, DoQ and RCode." -msgstr "DNS 服务器的地址。支持 UDP、TCP、DoH、DoT、DoQ 和 RCode。" +"The address of the dns server. Support UDP, TCP, DoH, DoQ, DoT and RCode." +msgstr "DNS 服务器的地址。支持 UDP、TCP、DoH、DoQ、DoT 和 RCode。" #: htdocs/luci-static/resources/view/homeproxy/server.js:677 msgid "" @@ -2278,8 +2278,8 @@ msgstr "" #: htdocs/luci-static/resources/view/homeproxy/client.js:197 msgid "" -"The dns server for resolving China domains. Support UDP, TCP, DoH, DoT, DoQ." -msgstr "用于解析国内域名的 DNS 服务器。支持 UDP、TCP、DoH、DoT、DoQ。" +"The dns server for resolving China domains. Support UDP, TCP, DoH, DoQ, DoT." +msgstr "用于解析国内域名的 DNS 服务器。支持 UDP、TCP、DoH、DoQ、DoT。" #: htdocs/luci-static/resources/view/homeproxy/client.js:842 msgid "The domain strategy for resolving the domain name in the address." @@ -2403,7 +2403,9 @@ msgstr "微步在线公共 DNS(117.50.10.10)" msgid "" "Timeout of rejected DNS response cache in seconds. 604800 (7d) " "is used by default." -msgstr "被拒绝的 DNS 响应缓存超时时间(单位:秒)。默认为 604800(7 天)。" +msgstr "" +"被拒绝的 DNS 响应缓存超时时间(单位:秒)。默认为 604800(7 天)。" #: htdocs/luci-static/resources/view/homeproxy/server.js:485 msgid "" diff --git a/luci-app-homeproxy/root/etc/init.d/homeproxy b/luci-app-homeproxy/root/etc/init.d/homeproxy index b6cecadd5..8b1b01020 100755 --- a/luci-app-homeproxy/root/etc/init.d/homeproxy +++ b/luci-app-homeproxy/root/etc/init.d/homeproxy @@ -150,7 +150,7 @@ start_service() { procd_add_jail "sing-box-c" log procfs procd_add_jail_mount "$RUN_DIR/sing-box-c.json" procd_add_jail_mount_rw "$RUN_DIR/sing-box-c.log" - procd_add_jail_mount_rw "$RUN_DIR/cache.db" + [ "$routing_mode" != "bypass_mainland_china" ] || procd_add_jail_mount_rw "$RUN_DIR/cache.db" procd_add_jail_mount "$HP_DIR/certs/" procd_add_jail_mount "/etc/ssl/" procd_add_jail_mount "/etc/localtime" @@ -216,20 +216,24 @@ start_service() { procd_set_param respawn procd_close_instance - # Prepare ruleset directory for custom routing mode - if [ "$routing_mode" = "custom" ]; then + case "$rouing_mode" in + "bypass_mainland_china") + # Prepare cache db + [ -e "$RUN_DIR/cache.db" ] || touch "$RUN_DIR/cache.db" + ;; + "custom") + # Prepare ruleset directory [ -d "$HP_DIR/ruleset" ] || mkdir -p "$HP_DIR/ruleset" - fi + ;; + esac - # Update permissions for ujail - if [ "$outbound_node" != "nil" ]; then - echo > "$RUN_DIR/sing-box-c.log" - chmod 0644 "$HP_DIR/resources/gfw_list.txt" - fi + [ "$outbound_node" = "nil" ] || echo > "$RUN_DIR/sing-box-c.log" if [ "$server_enabled" = "1" ]; then echo > "$RUN_DIR/sing-box-s.log" mkdir -p "$HP_DIR/certs" fi + + # Update permissions for ujail chown -R sing-box:sing-box "$RUN_DIR" # Setup firewall