From 7b8e2aca8ffe36df1cacc17840544f8e49e31ece Mon Sep 17 00:00:00 2001 From: sirpdboy Date: Sat, 15 May 2021 00:23:52 +0800 Subject: [PATCH] up eqot opentomcat --- https-dns-proxy/Makefile | 48 --- https-dns-proxy/files/README.md | 94 ------ https-dns-proxy/files/https-dns-proxy.config | 29 -- https-dns-proxy/files/https-dns-proxy.init | 232 -------------- https-dns-proxy/patches/010-ninja.patch | 33 -- https-dns-proxy/test.sh | 3 - luci-app-eqos/luasrc/controller/eqos.lua | 2 +- luci-app-turboacc/Makefile | 51 --- .../luasrc/controller/turboacc.lua | 39 --- .../luasrc/model/cbi/turboacc.lua | 87 ------ .../luasrc/view/turboacc/status.htm | 25 -- luci-app-turboacc/po/zh-cn/turboacc.po | 107 ------- luci-app-turboacc/root/etc/config/turboacc | 14 - luci-app-turboacc/root/etc/init.d/turboacc | 295 ------------------ .../root/etc/uci-defaults/turboacc | 10 - .../root/usr/share/dnscache/dnscache-while.sh | 31 -- .../share/rpcd/acl.d/luci-app-turboacc.json | 11 - .../files/30_luci-theme-opentomcat | 8 +- .../files/templates/header.htm | 2 +- 19 files changed, 6 insertions(+), 1115 deletions(-) delete mode 100644 https-dns-proxy/Makefile delete mode 100644 https-dns-proxy/files/README.md delete mode 100644 https-dns-proxy/files/https-dns-proxy.config delete mode 100644 https-dns-proxy/files/https-dns-proxy.init delete mode 100644 https-dns-proxy/patches/010-ninja.patch delete mode 100644 https-dns-proxy/test.sh delete mode 100644 luci-app-turboacc/Makefile delete mode 100644 luci-app-turboacc/luasrc/controller/turboacc.lua delete mode 100644 luci-app-turboacc/luasrc/model/cbi/turboacc.lua delete mode 100644 luci-app-turboacc/luasrc/view/turboacc/status.htm delete mode 100644 luci-app-turboacc/po/zh-cn/turboacc.po delete mode 100644 luci-app-turboacc/root/etc/config/turboacc delete mode 100644 luci-app-turboacc/root/etc/init.d/turboacc delete mode 100644 luci-app-turboacc/root/etc/uci-defaults/turboacc delete mode 100644 luci-app-turboacc/root/usr/share/dnscache/dnscache-while.sh delete mode 100644 luci-app-turboacc/root/usr/share/rpcd/acl.d/luci-app-turboacc.json diff --git a/https-dns-proxy/Makefile b/https-dns-proxy/Makefile deleted file mode 100644 index 990c495..0000000 --- a/https-dns-proxy/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=https-dns-proxy -PKG_VERSION:=2021-01-17 -PKG_RELEASE:=5 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy -PKG_SOURCE_DATE:=2021-01-17 -PKG_SOURCE_VERSION:=37511cc08712d7548978a4f6f1cc457b7594fb96 -PKG_MIRROR_HASH:=4e6a7dcb69e350d1df9f17570439b589e031e249da7f91f2ec7600a955e0aaa3 -PKG_MAINTAINER:=Stan Grishin -PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=LICENSE - -include $(INCLUDE_DIR)/package.mk -include ../../devel/ninja/ninja-cmake.mk - -CMAKE_OPTIONS += -DCLANG_TIDY_EXE= - -define Package/https-dns-proxy - SECTION:=net - CATEGORY:=Network - TITLE:=DNS Over HTTPS Proxy - URL:=https://docs.openwrt.melmac.net/https-dns-proxy/ - DEPENDS:=+libcares +libcurl +libev +ca-bundle - CONFLICTS:=https_dns_proxy -endef - -define Package/https-dns-proxy/description -https-dns-proxy is a light-weight DNS<-->HTTPS, non-caching translation proxy for the RFC 8484 DoH standard. -It receives regular (UDP) DNS requests and issues them via DoH. -Please see https://docs.openwrt.melmac.net/https-dns-proxy/ for more information. -endef - -define Package/https-dns-proxy/conffiles -/etc/config/https-dns-proxy -endef - -define Package/https-dns-proxy/install - $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d ${1}/etc/config - $(INSTALL_BIN) $(PKG_BUILD_DIR)/https_dns_proxy $(1)/usr/sbin/https-dns-proxy - $(INSTALL_BIN) ./files/https-dns-proxy.init $(1)/etc/init.d/https-dns-proxy - $(SED) "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(1)/etc/init.d/https-dns-proxy - $(INSTALL_CONF) ./files/https-dns-proxy.config $(1)/etc/config/https-dns-proxy -endef - -$(eval $(call BuildPackage,https-dns-proxy)) diff --git a/https-dns-proxy/files/README.md b/https-dns-proxy/files/README.md deleted file mode 100644 index f243549..0000000 --- a/https-dns-proxy/files/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# DNS Over HTTPS Proxy (https-dns-proxy) - -A lean RFC8484-compatible (no JSON API support) DNS-over-HTTPS (DoH) proxy service which supports DoH servers ran by AdGuard, CleanBrowsing, Cloudflare, Google, ODVR (nic.cz) and Quad9. Based on [@aarond10](https://github.com/aarond10)'s [https-dns-proxy](https://github.com/aarond10/https_dns_proxy). - -## Features - -- [RFC8484](https://tools.ietf.org/html/rfc8484)-compatible DoH Proxy. -- Compact size. -- Web UI (```luci-app-https-dns-proxy```) available. -- (By default) automatically updates DNSMASQ settings to use DoH proxy when it's started and reverts to old DNSMASQ resolvers when DoH proxy is stopped. - -## Screenshots (luci-app-https-dns-proxy) - -![screenshot](https://cdn.jsdelivr.net/gh/stangri/openwrt_packages@master/screenshots/https-dns-proxy/screenshot01.png "https-dns-proxy screenshot") - -## Requirements - -This proxy requires the following packages to be installed on your router: ```libc```, ```libcares```, ```libcurl```, ```libev```, ```ca-bundle```. They will be automatically installed when you're installing ```https-dns-proxy```. - -## Unmet Dependencies - -If you are running a development (trunk/snapshot) build of OpenWrt/LEDE Project on your router and your build is outdated (meaning that packages of the same revision/commit hash are no longer available and when you try to satisfy the [requirements](#requirements) you get errors), please flash either current LEDE release image or current development/snapshot image. - -## How To Install - -Install ```https-dns-proxy``` and ```luci-app-https-dns-proxy``` packages from Web UI or run the following in the command line: - -```sh -opkg update; opkg install https-dns-proxy luci-app-https-dns-proxy; -``` - -## Default Settings - -Default configuration has service enabled and starts the service with Google and Cloudflare DoH servers. In most configurations, you will keep the default ```DNSMASQ``` service installed to handle requests from devices in your local network and point ```DNSMASQ``` to use ```https-dns-proxy``` for name resolution. - -By default, the service will intelligently override existing ```DNSMASQ``` servers settings on start to use the DoH servers and restores original ```DNSMASQ``` servers on stop. See the [Configuration Settings](#configuration-settings) section below for more information and how to disable this behavior. - -## Configuration Settings - -Configuration contains the (named) "main" config section where you can configure which ```DNSMASQ``` settings the service will automatically affect and the typed (unnamed) https-dns-proxy instance settings. The original config file is included below: - -```text -config main 'config' - option update_dnsmasq_config '*' - -config https-dns-proxy - option bootstrap_dns '8.8.8.8,8.8.4.4' - option resolver_url 'https://dns.google/dns-query' - option listen_addr '127.0.0.1' - option listen_port '5053' - option user 'nobody' - option group 'nogroup' - -config https-dns-proxy - option bootstrap_dns '1.1.1.1,1.0.0.1' - option resolver_url 'https://cloudflare-dns.com/dns-query' - option listen_addr '127.0.0.1' - option listen_port '5054' - option user 'nobody' - option group 'nogroup' -``` - -The ```update_dnsmasq_config``` option can be set to dash (set to ```'-'``` to not change ```DNSMASQ``` server settings on start/stop), can be set to ```'*'``` to affect all ```DNSMASQ``` instance server settings or have a space-separated list of ```DNSMASQ``` instances to affect (like ```'0 4 5'```). If this option is omitted, the default setting is ```'*'```. - -Starting with ```https-dns-proxy``` version ```2019-12-03-3``` and higher, when the service is set to update the DNSMASQ servers setting on start/stop, it does not override entries which contain either ```#``` or ```/```, so the entries like listed below will be kept in use: - -```test - list server '/onion/127.0.0.1#65453' - list server '/openwrt.org/8.8.8.8' - list server '/pool.ntp.org/8.8.8.8' - list server '127.0.0.1#15353' - list server '127.0.0.1#55353' - list server '127.0.0.1#65353' -``` - -The https-dns-proxy instance settings are: - -|Parameter|Type|Default|Description| -| --- | --- | --- | --- | -|bootstrap_dns|IP Address||The non-encrypted DNS servers to be used to resolve the DoH server name on start.| -|listen_addr|IP Address|127.0.0.1|The local IP address to listen to requests.| -|listen_port|port|5053 and up|If this setting is omitted, the service will start the first https-dns-proxy instance on port 5053, second on 5054 and so on.| -|logfile|Full filepath||Full filepath to the file to log the instance events to.| -|resolver_url|URL||The https URL to the RFC8484-compatible resolver.| -|proxy_server|URL||Local proxy server to use when accessing resolvers.| -|user|String|nobody|Local user to run instance under.| -|group|String|nogroup|Local group to run instance under.| -|use_http1|Boolean|0|If set to 1, use HTTP/1 on installations with broken/outdated ```curl``` package. Included for posterity reasons, you will most likely not ever need it on OpenWrt.| -|verbosity|Integer|0|logging verbosity level. fatal = 0, error = 1, warning = 2, info = 3, debug = 4| -|use_ipv6_resolvers_only|Boolean|0|If set to 1, Forces IPv6 DNS resolvers instead of IPv4| - -## Thanks - -This OpenWrt package wouldn't have been possible without [@aarond10](https://github.com/aarond10)'s [https-dns-proxy](https://github.com/aarond10/https_dns_proxy) and his active participation in the OpenWrt package itself. Special thanks to [@jow-](https://github.com/jow-) for general package/luci guidance. diff --git a/https-dns-proxy/files/https-dns-proxy.config b/https-dns-proxy/files/https-dns-proxy.config deleted file mode 100644 index f9a352c..0000000 --- a/https-dns-proxy/files/https-dns-proxy.config +++ /dev/null @@ -1,29 +0,0 @@ -config main 'config' - option update_dnsmasq_config '-' - option force_dns '0' - list force_dns_port '53' - list force_dns_port '853' -# ports listed below are used by some -# of the dnscrypt-proxy v1 resolvers -# list force_dns_port '553' -# list force_dns_port '1443' -# list force_dns_port '4343' -# list force_dns_port '4434' -# list force_dns_port '5443' -# list force_dns_port '8443' - -config https-dns-proxy - option bootstrap_dns '1.1.1.1,1.0.0.1' - option resolver_url 'https://cloudflare-dns.com/dns-query' - option listen_addr '127.0.0.1' - option listen_port '5054' - option user 'nobody' - option group 'nogroup' - -config https-dns-proxy - option bootstrap_dns '8.8.8.8,8.8.4.4' - option resolver_url 'https://dns.google/dns-query' - option listen_addr '127.0.0.1' - option listen_port '5053' - option user 'nobody' - option group 'nogroup' diff --git a/https-dns-proxy/files/https-dns-proxy.init b/https-dns-proxy/files/https-dns-proxy.init deleted file mode 100644 index e83fafb..0000000 --- a/https-dns-proxy/files/https-dns-proxy.init +++ /dev/null @@ -1,232 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright 2019-2020 Stan Grishin (stangri@melmac.net) -# shellcheck disable=SC2039 -PKG_VERSION='dev-test' - -# shellcheck disable=SC2034 -START=80 -# shellcheck disable=SC2034 -USE_PROCD=1 - -if type extra_command 1>/dev/null 2>&1; then - extra_command 'version' 'Show version information' -else -# shellcheck disable=SC2034 - EXTRA_COMMANDS='version' -fi - -readonly PROG=/usr/sbin/https-dns-proxy -dnsmasqConfig=''; forceDNS=''; forceDNSPorts=''; - -version() { echo "$PKG_VERSION"; } - -xappend() { param="$param $1"; } - -append_bool() { - local section="$1" - local option="$2" - local value="$3" - local default="$4" - local _loctmp - [ -z "$default" ] && default="0" - config_get_bool _loctmp "$section" "$option" "$default" - [ "$_loctmp" != "0" ] && xappend "$value" -} - -append_parm() { - local section="$1" - local option="$2" - local switch="$3" - local default="$4" - local _loctmp - config_get _loctmp "$section" "$option" "$default" - [ -z "$_loctmp" ] && return 0 - xappend "$switch $_loctmp" -} - -start_instance() { - local cfg="$1" param listen_addr listen_port i - append_parm "$cfg" 'resolver_url' '-r' - append_parm "$cfg" 'polling_interval' '-i' - append_parm "$cfg" 'listen_addr' '-a' '127.0.0.1' - append_parm "$cfg" 'listen_port' '-p' "$p" - append_parm "$cfg" 'dscp_codepoint' '-c' - append_parm "$cfg" 'bootstrap_dns' '-b' - append_parm "$cfg" 'user' '-u' 'nobody' - append_parm "$cfg" 'group' '-g' 'nogroup' - append_parm "$cfg" 'proxy_server' '-t' - append_parm "$cfg" 'logfile' '-l' - append_bool "$cfg" 'use_http1' '-x' - config_get_bool ipv6_resolvers_only "$cfg" 'use_ipv6_resolvers_only' '0' - config_get verbosity "$cfg" 'verbosity' '0' - -# shellcheck disable=SC2086,SC2154 - for i in $(seq 1 $verbosity); do - xappend '-v' - done -# shellcheck disable=SC2154 - if [ "$ipv6_resolvers_only" = 0 ]; then - xappend '-4' - fi - - procd_open_instance -# shellcheck disable=SC2086 - procd_set_param command ${PROG} ${param} - procd_set_param stderr 1 - procd_set_param stdout 1 - procd_set_param respawn - procd_close_instance - - config_get listen_addr "$cfg" 'listen_addr' '127.0.0.1' - config_get listen_port "$cfg" 'listen_port' "$p" - - if [ "$dnsmasqConfig" = "*" ]; then - config_load 'dhcp' - config_foreach dnsmasq_add_doh_server 'dnsmasq' "${listen_addr}" "${listen_port}" - elif [ -n "$dnsmasqConfig" ]; then - for i in $dnsmasqConfig; do - dnsmasq_add_doh_server "@dnsmasq[${i}]" "${listen_addr}" "${listen_port}" - done - fi - p="$((p+1))" -} - -is_force_dns_active() { iptables-save | grep -q -w -- '--dport 53'; } - -start_service() { - local p=5053 c - config_load 'https-dns-proxy' - config_get dnsmasqConfig 'config' 'update_dnsmasq_config' '*' - config_get_bool forceDNS 'config' 'force_dns' '1' - config_get forceDNSPorts 'config' 'force_dns_port' '53 853' - dhcp_backup 'create' - config_load 'https-dns-proxy' - config_foreach start_instance 'https-dns-proxy' - if [ "$forceDNS" -ne 0 ]; then - procd_open_instance 'main' - procd_set_param command /bin/true - procd_set_param stdout 1 - procd_set_param stderr 1 - procd_open_data - json_add_array firewall - for c in $forceDNSPorts; do - if netstat -tuln | grep 'LISTEN' | grep ":${c}" >/dev/null 2>&1 || [ "$c" = "53" ]; then - json_add_object "" - json_add_string type redirect - json_add_string target DNAT - json_add_string src lan - json_add_string proto "tcp udp" - json_add_string src_dport "$c" - json_add_string dest_port "$c" - json_add_boolean reflection 0 - json_close_object - else - json_add_object "" - json_add_string type rule - json_add_string src lan - json_add_string dest "*" - json_add_string proto "tcp udp" - json_add_string dest_port "$c" - json_add_string target REJECT - json_close_object - fi - done - json_close_array - procd_close_data - procd_close_instance - fi - if [ -n "$(uci -q changes dhcp)" ]; then - uci -q commit dhcp - [ -x /etc/init.d/dnsmasq ] && /etc/init.d/dnsmasq restart >/dev/null 2>&1 - fi -} - -stop_service() { - config_load 'https-dns-proxy' - config_get dnsmasqConfig 'config' 'update_dnsmasq_config' '*' - dhcp_backup 'restore' - if [ -n "$(uci -q changes dhcp)" ]; then - uci -q commit dhcp - [ -x /etc/init.d/dnsmasq ] && /etc/init.d/dnsmasq restart >/dev/null 2>&1 - fi -} - -service_triggers() { - procd_add_config_trigger "config.change" "https-dns-proxy" /etc/init.d/https-dns-proxy reload -} - -service_started() { procd_set_config_changed firewall; } -service_stopped() { procd_set_config_changed firewall; } - -dnsmasq_add_doh_server() { - local cfg="$1" address="$2" port="$3" - case $address in - 0.0.0.0|::ffff:0.0.0.0) address='127.0.0.1';; - ::) address='::1';; - esac - uci -q del_list "dhcp.${cfg}.server=${address}#${port}" - uci -q add_list "dhcp.${cfg}.server=${address}#${port}" -} - -dnsmasq_create_server_backup() { - local cfg="$1" - local i - uci -q get "dhcp.${cfg}" >/dev/null || return 0 - if ! uci -q get "dhcp.${cfg}.doh_backup_noresolv" >/dev/null; then - if [ -z "$(uci -q get "dhcp.${cfg}.noresolv")" ]; then - uci -q set "dhcp.${cfg}.noresolv=1" - uci -q set "dhcp.${cfg}.doh_backup_noresolv=-1" - elif [ "$(uci -q get "dhcp.${cfg}.noresolv")" != "1" ]; then - uci -q set "dhcp.${cfg}.noresolv=1" - uci -q set "dhcp.${cfg}.doh_backup_noresolv=0" - fi - fi - if ! uci -q get "dhcp.${cfg}.doh_backup_server" >/dev/null; then - for i in $(uci -q get "dhcp.${cfg}.server"); do - uci -q add_list "dhcp.${cfg}.doh_backup_server=$i" - if [ "$i" = "${i//127.0.0.1}" ] && [ "$i" = "$(echo "$i" | tr -d /)" ]; then - uci -q del_list "dhcp.${cfg}.server=$i" - fi - done - fi -} - -dnsmasq_restore_server_backup() { - local cfg="$1" - local i - uci -q get "dhcp.${cfg}" >/dev/null || return 0 - if uci -q get "dhcp.${cfg}.doh_backup_noresolv" >/dev/null; then - if [ "$(uci -q get "dhcp.${cfg}.doh_backup_noresolv")" = "0" ]; then - uci -q set "dhcp.${cfg}.noresolv=0" - else - uci -q del "dhcp.${cfg}.noresolv" - fi - uci -q del "dhcp.${cfg}.doh_backup_noresolv" - fi - if uci -q get "dhcp.${cfg}.doh_backup_server" >/dev/null; then - uci -q del "dhcp.${cfg}.server" - for i in $(uci -q get "dhcp.${cfg}.doh_backup_server"); do - uci -q add_list "dhcp.${cfg}.server=$i" - done - uci -q del "dhcp.${cfg}.doh_backup_server" - fi -} - -dhcp_backup() { - local i - config_load 'dhcp' - case "$1" in - create) - if [ "$dnsmasqConfig" = "*" ]; then - config_foreach dnsmasq_create_server_backup 'dnsmasq' - elif [ -n "$dnsmasqConfig" ]; then - for i in $dnsmasqConfig; do - dnsmasq_create_server_backup "@dnsmasq[${i}]" - done - fi - ;; - restore) - config_foreach dnsmasq_restore_server_backup 'dnsmasq' - ;; - esac -} diff --git a/https-dns-proxy/patches/010-ninja.patch b/https-dns-proxy/patches/010-ninja.patch deleted file mode 100644 index 2f29bdb..0000000 --- a/https-dns-proxy/patches/010-ninja.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -5,7 +5,6 @@ set(CMAKE_BUILD_TYPE "Debug") - #set(CMAKE_BUILD_TYPE "Release") - - #set(CMAKE_C_FLAGS "-Wall -Wextra --pedantic -Wno-strict-aliasing") --set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(notdir $<)\"'") - set(CMAKE_C_FLAGS_DEBUG "-g") - set(CMAKE_C_FLAGS_RELEASE "-O2") - ---- a/src/logging.h -+++ b/src/logging.h -@@ -34,6 +34,20 @@ enum _LogSeverity { - LOG_FATAL = 4, - }; - -+#define STRIPPATH(s)\ -+ (sizeof(s) > 2 && (s)[sizeof(s)-2] == '/' ? (s) + sizeof(s) - 1 : \ -+ sizeof(s) > 3 && (s)[sizeof(s)-3] == '/' ? (s) + sizeof(s) - 2 : \ -+ sizeof(s) > 4 && (s)[sizeof(s)-4] == '/' ? (s) + sizeof(s) - 3 : \ -+ sizeof(s) > 5 && (s)[sizeof(s)-5] == '/' ? (s) + sizeof(s) - 4 : \ -+ sizeof(s) > 6 && (s)[sizeof(s)-6] == '/' ? (s) + sizeof(s) - 5 : \ -+ sizeof(s) > 7 && (s)[sizeof(s)-7] == '/' ? (s) + sizeof(s) - 6 : \ -+ sizeof(s) > 8 && (s)[sizeof(s)-8] == '/' ? (s) + sizeof(s) - 7 : \ -+ sizeof(s) > 9 && (s)[sizeof(s)-9] == '/' ? (s) + sizeof(s) - 8 : \ -+ sizeof(s) > 10 && (s)[sizeof(s)-10] == '/' ? (s) + sizeof(s) - 9 : \ -+ sizeof(s) > 11 && (s)[sizeof(s)-11] == '/' ? (s) + sizeof(s) - 10 : (s)) -+ -+#define __FILENAME__ STRIPPATH(__FILE__) -+ - // Debug, Info, Warning, Error logging. - #define DLOG(...) _log(__FILENAME__, __LINE__, LOG_DEBUG, __VA_ARGS__) - #define ILOG(...) _log(__FILENAME__, __LINE__, LOG_INFO, __VA_ARGS__) diff --git a/https-dns-proxy/test.sh b/https-dns-proxy/test.sh deleted file mode 100644 index 45469ed..0000000 --- a/https-dns-proxy/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -/etc/init.d/"$1" version 2>&1 | grep "$2" diff --git a/luci-app-eqos/luasrc/controller/eqos.lua b/luci-app-eqos/luasrc/controller/eqos.lua index 9a09f1e..f642162 100644 --- a/luci-app-eqos/luasrc/controller/eqos.lua +++ b/luci-app-eqos/luasrc/controller/eqos.lua @@ -6,5 +6,5 @@ function index() end entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false - entry({"admin", "control", "eqos"}, cbi("eqos"), "网络限速", 90).dependent = true + entry({"admin", "control", "eqos"}, cbi("eqos"), "网速限制", 90).dependent = true end diff --git a/luci-app-turboacc/Makefile b/luci-app-turboacc/Makefile deleted file mode 100644 index d060bdd..0000000 --- a/luci-app-turboacc/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2016 Openwrt.org -# -# This is free software, licensed under the Apache License, Version 2.0 . -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-app-turboacc -PKG_VERSION:=1.0 -PKG_RELEASE:=2 - -PKG_LICENSE:=GPLv3.0+ - -LUCI_TITLE:=LuCI support for Flow Offload / Shortcut-FE -LUCI_DEPENDS:=+pdnsd-alt \ - +PACKAGE_$(PKG_NAME)_INCLUDE_shortcut-fe:kmod-fast-classifier \ - +PACKAGE_$(PKG_NAME)_INCLUDE_flow-offload:kmod-ipt-offload \ - +PACKAGE_$(PKG_NAME)_INCLUDE_bbr-cca:kmod-tcp-bbr \ - +PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder:dnsforwarder -LUCI_PKGARCH:=all - -define Package/$(PKG_NAME)/config -config PACKAGE_$(PKG_NAME)_INCLUDE_shortcut-fe - bool "Include Shortcut-FE" - depends on PACKAGE_$(PKG_NAME)_INCLUDE_flow-offload=n - default y if LINUX_4_9 - default n - -config PACKAGE_$(PKG_NAME)_INCLUDE_flow-offload - bool "Include Flow Offload" - depends on !LINUX_4_9 - default y - -config PACKAGE_$(PKG_NAME)_INCLUDE_bbr-cca - bool "Include BBR CCA" - default y - -config PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder - bool "Include DNSForwarder" - default n -endef - -PKG_CONFIG_DEPENDS:= \ - CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_shortcut-fe \ - CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_flow-offload \ - CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_bbr-cca \ - CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-turboacc/luasrc/controller/turboacc.lua b/luci-app-turboacc/luasrc/controller/turboacc.lua deleted file mode 100644 index 259859f..0000000 --- a/luci-app-turboacc/luasrc/controller/turboacc.lua +++ /dev/null @@ -1,39 +0,0 @@ -module("luci.controller.turboacc", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/turboacc") then - return - end - local page - page = entry({"admin", "network", "turboacc"}, cbi("turboacc"), _("Turbo ACC Center"), 101) - page.i18n = "turboacc" - page.dependent = true - - entry({"admin", "network", "turboacc", "status"}, call("action_status")) -end - -local function fastpath_status() - return luci.sys.call("{ [ -e /sys/module/xt_FLOWOFFLOAD/refcnt ] && [ x$(cat /sys/module/xt_FLOWOFFLOAD/refcnt 2>/dev/null) != x0 ]; } || lsmod | grep -q fast_classifier") == 0 -end - -local function bbr_status() - return luci.sys.call("[ x$(cat /proc/sys/net/ipv4/tcp_congestion_control 2>/dev/null) = xbbr ]") == 0 -end - -local function fullconebat_status() - return luci.sys.call("[ -e /sys/module/xt_FULLCONENAT/refcnt ] && [ x$(cat /sys/module/xt_FULLCONENAT/refcnt 2>/dev/null) != x0 ]") == 0 -end - -local function dnscaching_status() - return luci.sys.call("pgrep dnscache >/dev/null") == 0 -end - -function action_status() - luci.http.prepare_content("application/json") - luci.http.write_json({ - fastpath_state = fastpath_status(), - bbr_state = bbr_status(), - fullconenat_state = fullconebat_status(), - dnscaching_state = dnscaching_status() - }) -end diff --git a/luci-app-turboacc/luasrc/model/cbi/turboacc.lua b/luci-app-turboacc/luasrc/model/cbi/turboacc.lua deleted file mode 100644 index a1aff62..0000000 --- a/luci-app-turboacc/luasrc/model/cbi/turboacc.lua +++ /dev/null @@ -1,87 +0,0 @@ -local kernel_version = luci.sys.exec("echo -n $(uname -r)") - -m = Map("turboacc") -m.title = translate("Turbo ACC Acceleration Settings") -m.description = translate("Opensource Flow Offloading driver (Fast Path or Hardware NAT)") - -m:append(Template("turboacc/status")) - -s = m:section(TypedSection, "turboacc", "") -s.addremove = false -s.anonymous = true - -if nixio.fs.access("/lib/modules/" .. kernel_version .. "/xt_FLOWOFFLOAD.ko") then -sw_flow = s:option(Flag, "sw_flow", translate("Software flow offloading")) -sw_flow.default = 0 -sw_flow.description = translate("Software based offloading for routing/NAT") -sw_flow:depends("sfe_flow", 0) -end - -if luci.sys.call("cat /proc/cpuinfo | grep -q MT76") == 0 then -hw_flow = s:option(Flag, "hw_flow", translate("Hardware flow offloading")) -hw_flow.default = 0 -hw_flow.description = translate("Requires hardware NAT support. Implemented at least for mt76xx") -hw_flow:depends("sw_flow", 1) -end - -if nixio.fs.access("/lib/modules/" .. kernel_version .. "/fast-classifier.ko") then -sfe_flow = s:option(Flag, "sfe_flow", translate("Shortcut-FE flow offloading")) -sfe_flow.default = 0 -sfe_flow.description = translate("Shortcut-FE based offloading for routing/NAT") -sfe_flow:depends("sw_flow", 0) -end - -sfe_bridge = s:option(Flag, "sfe_bridge", translate("Bridge Acceleration")) -sfe_bridge.default = 0 -sfe_bridge.description = translate("Enable Bridge Acceleration (may be functional conflict with bridge-mode VPN server)") -sfe_bridge:depends("sfe_flow", 1) - -if nixio.fs.access("/proc/sys/net/ipv6") then -sfe_ipv6 = s:option(Flag, "sfe_ipv6", translate("IPv6 Acceleration")) -sfe_ipv6.default = 0 -sfe_ipv6.description = translate("Enable IPv6 Acceleration") -sfe_ipv6:depends("sfe_flow", 1) -end - -if nixio.fs.access("/lib/modules/" .. kernel_version .. "/tcp_bbr.ko") then -bbr_cca = s:option(Flag, "bbr_cca", translate("BBR CCA")) -bbr_cca.default = 0 -bbr_cca.description = translate("Using BBR CCA can improve TCP network performance effectively") -end - -if nixio.fs.access("/lib/modules/" .. kernel_version .. "/xt_FULLCONENAT.ko") then -fullcone_nat = s:option(Flag, "fullcone_nat", translate("FullCone NAT")) -fullcone_nat.default = 0 -fullcone_nat.description = translate("Using FullCone NAT can improve gaming performance effectively") -end - -dns_acc = s:option(Flag, "dns_acc", translate("DNS Acceleration")) -dns_acc.default = 0 -dns_acc.rmempty = false -dns_acc.description = translate("Using optimized DNS records for GoogleHosts (Don't use under Clash Fake-IP mode)") - -dns_caching = s:option(Flag, "dns_caching", translate("DNS Caching")) -dns_caching.default = 0 -dns_caching.rmempty = false -dns_caching.description = translate("Enable DNS Caching and anti ISP DNS pollution") - -dns_caching_mode = s:option(ListValue, "dns_caching_mode", translate("Resolve DNS Mode"), translate("Only PDNSD and DNSForwarder is supported now")) -dns_caching_mode:value("1", translate("Using PDNSD to query and cache")) -if nixio.fs.access("/usr/bin/dnsforwarder") then -dns_caching_mode:value("2", translate("Using DNSForwarder to query and cache")) -end -dns_caching_mode.default = 1 -dns_caching_mode:depends("dns_caching", 1) - -dns_caching_v4_dns = s:option(Value, "dns_caching_v4_dns", translate("Upsteam IPv4 DNS Server")) -dns_caching_v4_dns.default = "114.114.114.114,223.5.5.5,223.6.6.6" -dns_caching_v4_dns.description = translate("Muitiple IPv4 DNS server can saperate with ','") -dns_caching_v4_dns:depends("dns_caching_mode", 1) -dns_caching_v4_dns:depends("dns_caching_mode", 2) - -dns_caching_v6_dns = s:option(Value, "dns_caching_v6_dns", translate("Upsteam IPv6 DNS Server")) -dns_caching_v6_dns.default = "2400:da00::6666,2400:3200:baba::1,240C::6644" -dns_caching_v6_dns.description = translate("Muitiple IPv6 DNS server can saperate with ','") -dns_caching_v6_dns:depends("dns_caching_mode", 2) - -return m diff --git a/luci-app-turboacc/luasrc/view/turboacc/status.htm b/luci-app-turboacc/luasrc/view/turboacc/status.htm deleted file mode 100644 index 9a83488..0000000 --- a/luci-app-turboacc/luasrc/view/turboacc/status.htm +++ /dev/null @@ -1,25 +0,0 @@ -
- <%:Running Status%> - - - - - -
<%:Flow Offloading%><%:Collecting data...%>
<%:BBR CCA%><%:Collecting data...%>
<%:FullCone NAT%><%:Collecting data...%>
<%:DNS Caching%><%:Collecting data...%>
-
- - diff --git a/luci-app-turboacc/po/zh-cn/turboacc.po b/luci-app-turboacc/po/zh-cn/turboacc.po deleted file mode 100644 index 5804123..0000000 --- a/luci-app-turboacc/po/zh-cn/turboacc.po +++ /dev/null @@ -1,107 +0,0 @@ -msgid "Turbo ACC Center" -msgstr "ACC网络加速" - -msgid "Turbo ACC Acceleration Settings" -msgstr "Turbo ACC 网络加速设置" - -msgid "Linux Flow Offload Forwarding Engine Settings" -msgstr "Linux Flow Offload Forwarding 转发加速引擎设置" - -msgid "Opensource Flow Offloading driver (Fast Path or Hardware NAT)" -msgstr "开源流量分载驱动 (支持 Fast Path 或者 硬件 NAT)" - -msgid "Software flow offloading" -msgstr "软件流量分载" - -msgid "Software based offloading for routing/NAT" -msgstr "基于软件的 Routing/NAT 分载" - -msgid "Hardware flow offloading" -msgstr "硬件流量分载" - -msgid "Requires hardware NAT support. Implemented at least for mt76xx" -msgstr "需要硬件 NAT 支持。目前 mt76xx 已实现" - -msgid "Shortcut-FE flow offloading" -msgstr "Shortcut-FE 流量分载" - -msgid "Shortcut-FE based offloading for routing/NAT" -msgstr "基于 Shortcut-FE 的 Routing/NAT 分载" - -msgid "Bridge Acceleration" -msgstr "桥接加速" - -msgid "Enable Bridge Acceleration (may be functional conflict with bridge-mode VPN server)" -msgstr "启用桥接加速 (可能会和路由器上桥接模式的VPN服务器冲突)" - -msgid "IPv6 Acceleration" -msgstr "IPv6 加速" - -msgid "Enable IPv6 Acceleration" -msgstr "启用 IPv6 加速" - -msgid "BBR CCA" -msgstr "BBR 拥塞控制算法" - -msgid "Using BBR CCA can improve TCP network performance effectively" -msgstr "使用 BBR 拥塞控制算法可以有效提升 TCP 网络性能" - -msgid "FullCone NAT" -msgstr "全锥形 NAT" - -msgid "Using FullCone NAT can improve gaming performance effectively" -msgstr "使用全锥形 NAT 可以有效提升游戏体验" - -msgid "DNS Acceleration" -msgstr "DNS 加速" - -msgid "Using optimized DNS records for GoogleHosts (Don't use under Clash Fake-IP mode)" -msgstr "使用来自 GoogleHosts 的优质 DNS 记录(请勿在 Clash Fake-IP 模式下使用)" - -msgid "DNS Caching" -msgstr "DNS 缓存" - -msgid "Enable DNS Caching and anti ISP DNS pollution" -msgstr "启用 DNS 多线程查询、缓存,并防止 ISP 的 DNS 广告和域名劫持" - -msgid "Resolve DNS Mode" -msgstr "DNS 解析方式" - -msgid "Only PDNSD and DNSForwarder is supported now" -msgstr "目前仅支持 PDNSD 和 DNSForwarder" - -msgid "Using PDNSD to query and cache" -msgstr "使用 PDNSD 解析" - -msgid "Using DNSForwarder to query and cache" -msgstr "使用 DNSForwarder 解析" - -msgid "Upsteam IPv4 DNS Server" -msgstr "上游 IPv4 DNS 服务器" - -msgid "Muitiple IPv4 DNS server can saperate with ','" -msgstr "多个上游 IPv4 DNS 服务器请用 ',' 分隔(注意用英文逗号)" - -msgid "Upsteam IPv6 DNS Server" -msgstr "上游 IPv6 DNS 服务器" - -msgid "Muitiple IPv6 DNS server can saperate with ','" -msgstr "多个上游 IPv6 DNS 服务器请用 ',' 分隔(注意用英文逗号)" - -msgid "Running Status" -msgstr "运行状态" - -msgid "Flow Offloading" -msgstr "流量分载" - -msgid "BBR CCA" -msgstr "BBR 拥塞控制算法" - -msgid "FullCone NAT" -msgstr "全锥型 NAT" - -msgid "DNS Caching" -msgstr "DNS 缓存" - -msgid "Open Web Interface" -msgstr "打开 Web 界面" diff --git a/luci-app-turboacc/root/etc/config/turboacc b/luci-app-turboacc/root/etc/config/turboacc deleted file mode 100644 index f9bf643..0000000 --- a/luci-app-turboacc/root/etc/config/turboacc +++ /dev/null @@ -1,14 +0,0 @@ - -config turboacc 'config' - option sw_flow '0' - option hw_flow '0' - option sfe_flow '0' - option sfe_bridge '0' - option sfe_ipv6 '0' - option bbr_cca '1' - option fullcone_nat '1' - option dns_acc '0' - option dns_caching '0' - option dns_caching_mode '1' - option dns_caching_v4_dns '114.114.114.114,223.5.5.5,180.76.76.76,119.29.29.29' - option dns_caching_v6_dns '2400:da00::6666,2400:3200:baba::1,240C::6644' diff --git a/luci-app-turboacc/root/etc/init.d/turboacc b/luci-app-turboacc/root/etc/init.d/turboacc deleted file mode 100644 index 3064f30..0000000 --- a/luci-app-turboacc/root/etc/init.d/turboacc +++ /dev/null @@ -1,295 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (c) 2011-2015 OpenWrt.org - -START=90 -STOP=10 - -restart_utils="true" - -inital_conf(){ - config_load "turboacc" - config_get "sw_flow" "config" "sw_flow" "0" - config_get "hw_flow" "config" "hw_flow" "0" - config_get "sfe_flow" "config" "sfe_flow" "0" - config_get "sfe_bridge" "config" "sfe_bridge" "0" - config_get "sfe_ipv6" "config" "sfe_ipv6" "0" - config_get "bbr_cca" "config" "bbr_cca" "0" - config_get "fullcone_nat" "config" "fullcone_nat" "0" - config_get "dns_acc" "config" "dns_acc" "0" - config_get "dns_caching" "config" "dns_caching" "0" - config_get "dns_caching_mode" "config" "dns_caching_mode" "0" - config_get "dns_caching_v4_dns" "config" "dns_caching_v4_dns" - config_get "dns_caching_v6_dns" "config" "dns_caching_v6_dns" - - [ ! -e "/lib/modules/$(uname -r)/xt_FLOWOFFLOAD.ko" ] && { sw_flow="0"; hw_flow="0"; } - [ ! -e "/lib/modules/$(uname -r)/fast-classifier.ko" ] && { sfe_flow="0"; sfe_bridge="0"; sfe_ipv6="0"; } - [ ! -e "/lib/modules/$(uname -r)/tcp_bbr.ko" ] && bbr_cca="0" - [ ! -e "/lib/modules/$(uname -r)/xt_FULLCONENAT.ko" ] && fullcone_nat="0" -} - -start_pdnsd() { - [ -d "/var/etc" ] || mkdir -p "/var/etc" - cat > "/var/etc/dnscache.conf" < "/var/dnscache/pdnsd.cache" - chown -R nobody.nogroup "/var/dnscache" - fi - - [ -d "/var/sbin" ] || mkdir -p "/var/sbin" && cp -a "/usr/sbin/pdnsd" "/var/sbin/dnscache" - /var/sbin/dnscache -c "/var/etc/dnscache.conf" & - echo "PDNSD: Start DNS Caching" -} - -start_dnsforwarder() { - mkdir -p "/var/run/dnscache" - cat > "/var/run/dnscache/dnscache.conf" <"/dev/null" - kill -9 $(ps | grep dnscache-while.sh | grep -v "grep" | awk '{print $1}') 2>"/dev/null" - rm -rf "/var/dnscache" "/var/run/dnscache" - echo "Stop DNS Caching" -} - -change_dns() { - uci -q delete dhcp.@dnsmasq[0].server - uci add_list dhcp.@dnsmasq[0].server="127.0.0.1#5333" - uci set dhcp.@dnsmasq[0].noresolv="1" - uci commit dhcp - -} - -revert_dns() { - uci -q del_list dhcp.@dnsmasq[0].server="127.0.0.1#5333" - uci set dhcp.@dnsmasq[0].resolvfile="/tmp/resolv.conf.d/resolv.conf.auto" - uci set dhcp.@dnsmasq[0].noresolv="0" - uci commit dhcp -} - -start(){ - inital_conf - - uci set firewall.@defaults[0].flow_offloading="${sw_flow}" - uci set firewall.@defaults[0].flow_offloading_hw="${hw_flow}" - uci set firewall.@defaults[0].fullcone="${fullcone_nat}" - uci commit firewall - - [ "${sw_flow}" -ne "1" ] && [ "${sfe_flow}" -eq "1" ] && { - lsmod | grep -q fast_classifier || modprobe fast_classifier 2>"/dev/null" - echo "${sfe_bridge}" > "/sys/fast_classifier/skip_to_bridge_ingress" 2>"/dev/null" - if [ "${sfe_ipv6}" -eq "1" ]; then - [ ! -e "/dev/sfe_ipv6" ] && mknod "/dev/sfe_ipv6" "c" "$(cat "/sys/sfe_ipv6/debug_dev")" "0" - else - rm -f "/dev/sfe_ipv6" - fi -} - - if [ "${bbr_cca}" -eq "1" ]; then - sysctl -w net.ipv4.tcp_congestion_control="bbr" - else - sysctl -w net.ipv4.tcp_congestion_control="cubic" - fi - - [ "${dns_acc}" -eq "1" ] && { - mkdir -p "/tmp/dnsmasq.d" - wget-ssl -q -t "20" -T "5" "https://cdn.jsdelivr.net/gh/googlehosts/hosts@master/hosts-files/dnsmasq.conf" -O "/tmp/dnsmasq.d/dnsmasq-googlehosts.conf" & -} - - if [ "${dns_caching}" -eq "1" ]; then - stop_dnscache - sleep 1 - rm -f "/var/log/dnscache.file" - if [ "${dns_caching_mode}" = "1" ]; then - start_pdnsd - elif [ "${dns_caching_mode}" = "2" ]; then - start_dnsforwarder - fi - change_dns - nohup "/usr/share/dnscache/dnscache-while.sh" > "/var/log/dnscache.file" 2>&1 & - else - stop_dnscache - revert_dns - fi - - if [ "${restart_utils}" = "true" ]; then - /etc/init.d/dnsmasq restart >/dev/null 2>&1 && echo "DNSMASQ change" - /etc/init.d/firewall restart >/dev/null 2>&1 - fi -} - -stop(){ - inital_conf - - uci set firewall.@defaults[0].flow_offloading="${sw_flow}" - uci set firewall.@defaults[0].flow_offloading_hw="${hw_flow}" - uci set firewall.@defaults[0].fullcone="${fullcone_nat}" - uci commit firewall - - [ "${sfe_flow}" -ne "1" ] && { - echo "0" > "/sys/fast_classifier/skip_to_bridge_ingress" 2>"/dev/null" - rm -f "/dev/sfe_ipv6" - rmmod "fast_classifier" 2>"/dev/null" -} - - [ "${dns_acc}" -eq "0" ] && rm -f "/tmp/dnsmasq.d/dnsmasq-googlehosts.conf" - - stop_dnscache - revert_dns - - if [ "${restart_utils}" = "true" ]; then - /etc/init.d/dnsmasq restart >/dev/null 2>&1 && echo "DNSMASQ revert" - /etc/init.d/firewall restart >/dev/null 2>&1 - fi -} - -restart(){ - restart_utils="false" - stop - start - /etc/init.d/dnsmasq restart >/dev/null 2>&1 && echo "DNSMASQ restart" - /etc/init.d/firewall restart >/dev/null 2>&1 -} diff --git a/luci-app-turboacc/root/etc/uci-defaults/turboacc b/luci-app-turboacc/root/etc/uci-defaults/turboacc deleted file mode 100644 index 37a556f..0000000 --- a/luci-app-turboacc/root/etc/uci-defaults/turboacc +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@turboacc[-1] - add ucitrack turboacc - set ucitrack.@turboacc[-1].init=turboacc - commit ucitrack -EOF - -exit 0 diff --git a/luci-app-turboacc/root/usr/share/dnscache/dnscache-while.sh b/luci-app-turboacc/root/usr/share/dnscache/dnscache-while.sh deleted file mode 100644 index f8952e8..0000000 --- a/luci-app-turboacc/root/usr/share/dnscache/dnscache-while.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -sleeptime=60 -logfile="/var/log/dnscache.file" -dns_caching="$(uci -q get turboacc.config.dns_caching)" -dns_caching_mode="$(uci -q get turboacc.config.dns_caching_mode 2>/dev/null)" - -clean_log(){ -logrow="$(grep -c "" "${logfile}")" -if [ "${logrow}" -ge "500" ];then - echo "${curtime} Log条数超限,清空处理!" > "${logfile}" -fi -} - -while [ "${dns_caching}" -eq "1" ]; -do - curtime="$(date "+%H:%M:%S")" - echo "${curtime} online!" - pidof dnscache>/dev/null || { - if [ "${dns_caching_mode}" = "1" ]; then - /var/sbin/dnscache -c "/var/etc/dnscache.conf" & - elif [ "${dns_caching_mode}" = "2" ]; then - /var/sbin/dnscache -f "/var/run/dnscache/dnscache.conf" & - fi - echo "${curtime} 重启服务!" >> ${logfile} -} - - clean_log - sleep "${sleeptime}" - continue -done diff --git a/luci-app-turboacc/root/usr/share/rpcd/acl.d/luci-app-turboacc.json b/luci-app-turboacc/root/usr/share/rpcd/acl.d/luci-app-turboacc.json deleted file mode 100644 index 5b2e313..0000000 --- a/luci-app-turboacc/root/usr/share/rpcd/acl.d/luci-app-turboacc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-turboacc": { - "description": "Grant UCI access for luci-app-turboacc", - "read": { - "uci": [ "turboacc" ] - }, - "write": { - "uci": [ "turboacc" ] - } - } -} diff --git a/luci-theme-opentomcat/files/30_luci-theme-opentomcat b/luci-theme-opentomcat/files/30_luci-theme-opentomcat index 23d39e0..29c3224 100644 --- a/luci-theme-opentomcat/files/30_luci-theme-opentomcat +++ b/luci-theme-opentomcat/files/30_luci-theme-opentomcat @@ -1,7 +1,7 @@ #!/bin/sh uci batch <<-EOF set luci.themes.opentomcat=/luci-static/opentomcat - commit luci - EOF -fi - + set luci.main.mediaurlbase=/luci-static/opentomcat + commit luci +EOF +exit 0 diff --git a/luci-theme-opentomcat/files/templates/header.htm b/luci-theme-opentomcat/files/templates/header.htm index b284eef..2d4d93a 100644 --- a/luci-theme-opentomcat/files/templates/header.htm +++ b/luci-theme-opentomcat/files/templates/header.htm @@ -222,7 +222,7 @@
- <%=boardinfo.hostname or "?"%> + Openwrt