From 6ac928f1d554a13e131d93355281e28d58353eef Mon Sep 17 00:00:00 2001 From: ElonH Date: Sat, 6 Jun 2020 12:36:01 +0800 Subject: [PATCH 01/12] Rclone-OpenWRT: upgrade (#4737) * feat(rcloneng): an angular web application for rclone * feat(backup): backup rclone configuration files during system upgrade * :bug: luci-app-rclone: rclone service without bash * :mute: filter out duplicate log * :bug: luci-app-rclone: proxy work around * :page_facing_up: add license header * rclone: set /etc/rclone/rclone.conf as default config path --- package/lean/luci-app-rclone/Makefile | 4 +- .../luasrc/model/cbi/rclone.lua | 11 ++-- .../po/templates/luci-app-rclone.pot | 50 ++++++++-------- .../po/zh_Hans/luci-app-rclone.po | 50 ++++++++-------- .../luci-app-rclone/root/etc/init.d/rclone | 9 ++- package/lean/rclone-ng/Makefile | 58 +++++++++++++++++++ .../010-change-default-config-path.patch | 45 ++++++++++++++ ...ccess-Control-Allow-Origin-only-once.patch | 44 ++++++++++++++ 8 files changed, 216 insertions(+), 55 deletions(-) create mode 100644 package/lean/rclone-ng/Makefile create mode 100644 package/lean/rclone/patches/010-change-default-config-path.patch create mode 100644 package/lean/rclone/patches/020-Notice-Access-Control-Allow-Origin-only-once.patch diff --git a/package/lean/luci-app-rclone/Makefile b/package/lean/luci-app-rclone/Makefile index 5a02e53868..15e63a9944 100644 --- a/package/lean/luci-app-rclone/Makefile +++ b/package/lean/luci-app-rclone/Makefile @@ -10,10 +10,10 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for Rclone -LUCI_DEPENDS:=+rclone +rclone-webui-react +fuse-utils +LUCI_DEPENDS:=+rclone +rclone-webui-react +fuse-utils +rclone-ng LUCI_PKGARCH:=all PKG_NAME:=luci-app-rclone -PKG_VERSION:=1.3.21 +PKG_VERSION:=1.4.0 PKG_RELEASE:=1 PKG_LICENSE:=GPLv3.0+ PKG_MAINTAINER:=ElonH diff --git a/package/lean/luci-app-rclone/luasrc/model/cbi/rclone.lua b/package/lean/luci-app-rclone/luasrc/model/cbi/rclone.lua index aa9312aa0d..cd11dd0476 100644 --- a/package/lean/luci-app-rclone/luasrc/model/cbi/rclone.lua +++ b/package/lean/luci-app-rclone/luasrc/model/cbi/rclone.lua @@ -38,10 +38,13 @@ m = translate('Rclone ("rsync for cloud storage") is a command line program to sync root/usr/bin and directories to and from different cloud storage providers.') .. '

' .. translate('rclone state') .. ' : ' .. state_msg .. '

' .. address_msg .. - translate('Installed Web Interface') .. - '      

" + translate('Installed Web Interface') .. + '      " .. + '      

" ) s = m:section(TypedSection, 'global', translate('global')) diff --git a/package/lean/luci-app-rclone/po/templates/luci-app-rclone.pot b/package/lean/luci-app-rclone/po/templates/luci-app-rclone.pot index 7df760f2bc..984d16157c 100644 --- a/package/lean/luci-app-rclone/po/templates/luci-app-rclone.pot +++ b/package/lean/luci-app-rclone/po/templates/luci-app-rclone.pot @@ -1,7 +1,7 @@ msgid "" msgstr "Content-Type: text/plain; charset=UTF-8" -#: luasrc/model/cbi/rclone.lua:118 +#: luasrc/model/cbi/rclone.lua:121 msgid "FAQ" msgstr "" @@ -23,11 +23,15 @@ msgid "" "usr/bin and directories to and from different cloud storage providers." msgstr "" -#: luasrc/model/cbi/rclone.lua:75 +#: luasrc/model/cbi/rclone.lua:46 +msgid "RcloneNg" +msgstr "" + +#: luasrc/model/cbi/rclone.lua:78 msgid "Recommand: run" msgstr "" -#: luasrc/model/cbi/rclone.lua:127 +#: luasrc/model/cbi/rclone.lua:130 msgid "" "The content of the variable is protocol://server:port. The protocol value is " "commonly either http or socks5." @@ -37,63 +41,63 @@ msgstr "" msgid "Webui React" msgstr "" -#: luasrc/model/cbi/rclone.lua:61 +#: luasrc/model/cbi/rclone.lua:64 msgid "all address" msgstr "" -#: luasrc/model/cbi/rclone.lua:54 +#: luasrc/model/cbi/rclone.lua:57 msgid "configure" msgstr "" -#: luasrc/model/cbi/rclone.lua:80 +#: luasrc/model/cbi/rclone.lua:83 msgid "download" msgstr "" -#: luasrc/model/cbi/rclone.lua:79 +#: luasrc/model/cbi/rclone.lua:82 msgid "download configuration" msgstr "" -#: luasrc/model/cbi/rclone.lua:120 +#: luasrc/model/cbi/rclone.lua:123 msgid "enable proxy" msgstr "" -#: luasrc/model/cbi/rclone.lua:47 +#: luasrc/model/cbi/rclone.lua:50 msgid "global" msgstr "" -#: luasrc/model/cbi/rclone.lua:58 +#: luasrc/model/cbi/rclone.lua:61 msgid "listen address" msgstr "" -#: luasrc/model/cbi/rclone.lua:65 +#: luasrc/model/cbi/rclone.lua:68 msgid "listen port" msgstr "" -#: luasrc/model/cbi/rclone.lua:60 +#: luasrc/model/cbi/rclone.lua:63 msgid "local network address" msgstr "" -#: luasrc/model/cbi/rclone.lua:59 +#: luasrc/model/cbi/rclone.lua:62 msgid "localhost address" msgstr "" -#: luasrc/model/cbi/rclone.lua:129 +#: luasrc/model/cbi/rclone.lua:132 msgid "log" msgstr "" -#: luasrc/model/cbi/rclone.lua:108 +#: luasrc/model/cbi/rclone.lua:111 msgid "password" msgstr "" -#: luasrc/model/cbi/rclone.lua:133 +#: luasrc/model/cbi/rclone.lua:136 msgid "path" msgstr "" -#: luasrc/model/cbi/rclone.lua:114 +#: luasrc/model/cbi/rclone.lua:117 msgid "proxy" msgstr "" -#: luasrc/model/cbi/rclone.lua:123 +#: luasrc/model/cbi/rclone.lua:126 msgid "proxy address" msgstr "" @@ -101,7 +105,7 @@ msgstr "" msgid "rclone address" msgstr "" -#: luasrc/model/cbi/rclone.lua:71 +#: luasrc/model/cbi/rclone.lua:74 msgid "rclone configuration file path" msgstr "" @@ -117,18 +121,18 @@ msgstr "" msgid "rclone state" msgstr "" -#: luasrc/model/cbi/rclone.lua:51 +#: luasrc/model/cbi/rclone.lua:54 msgid "run Rclone as daemon" msgstr "" -#: luasrc/model/cbi/rclone.lua:77 +#: luasrc/model/cbi/rclone.lua:80 msgid "than updaload configuration to here." msgstr "" -#: luasrc/model/cbi/rclone.lua:77 +#: luasrc/model/cbi/rclone.lua:80 msgid "to setup configuration on pc," msgstr "" -#: luasrc/model/cbi/rclone.lua:103 +#: luasrc/model/cbi/rclone.lua:106 msgid "username" msgstr "" diff --git a/package/lean/luci-app-rclone/po/zh_Hans/luci-app-rclone.po b/package/lean/luci-app-rclone/po/zh_Hans/luci-app-rclone.po index 3afed25cc9..3e515c5293 100644 --- a/package/lean/luci-app-rclone/po/zh_Hans/luci-app-rclone.po +++ b/package/lean/luci-app-rclone/po/zh_Hans/luci-app-rclone.po @@ -11,7 +11,7 @@ msgstr "" "PO-Revision-Date: \n" "X-Generator: Poedit 2.0.6\n" -#: luasrc/model/cbi/rclone.lua:118 +#: luasrc/model/cbi/rclone.lua:121 msgid "FAQ" msgstr "常见问题" @@ -34,11 +34,15 @@ msgid "" msgstr "" "Rclone是一款的命令行工具,支持在不同对象存储、网盘间同步、上传、下载数据。" -#: luasrc/model/cbi/rclone.lua:75 +#: luasrc/model/cbi/rclone.lua:46 +msgid "RcloneNg" +msgstr "RcloneNg" + +#: luasrc/model/cbi/rclone.lua:78 msgid "Recommand: run" msgstr "建议: 在 PC 上运行" -#: luasrc/model/cbi/rclone.lua:127 +#: luasrc/model/cbi/rclone.lua:130 msgid "" "The content of the variable is protocol://server:port. The protocol value is " "commonly either http or socks5." @@ -50,63 +54,63 @@ msgstr "" msgid "Webui React" msgstr "Webui React" -#: luasrc/model/cbi/rclone.lua:61 +#: luasrc/model/cbi/rclone.lua:64 msgid "all address" msgstr "全部地址" -#: luasrc/model/cbi/rclone.lua:54 +#: luasrc/model/cbi/rclone.lua:57 msgid "configure" msgstr "配置" -#: luasrc/model/cbi/rclone.lua:80 +#: luasrc/model/cbi/rclone.lua:83 msgid "download" msgstr "下载" -#: luasrc/model/cbi/rclone.lua:79 +#: luasrc/model/cbi/rclone.lua:82 msgid "download configuration" msgstr "下载配置文件" -#: luasrc/model/cbi/rclone.lua:120 +#: luasrc/model/cbi/rclone.lua:123 msgid "enable proxy" msgstr "启用代理" -#: luasrc/model/cbi/rclone.lua:47 +#: luasrc/model/cbi/rclone.lua:50 msgid "global" msgstr "全局" -#: luasrc/model/cbi/rclone.lua:58 +#: luasrc/model/cbi/rclone.lua:61 msgid "listen address" msgstr "监听地址" -#: luasrc/model/cbi/rclone.lua:65 +#: luasrc/model/cbi/rclone.lua:68 msgid "listen port" msgstr "监听端口" -#: luasrc/model/cbi/rclone.lua:60 +#: luasrc/model/cbi/rclone.lua:63 msgid "local network address" msgstr "局域网地址" -#: luasrc/model/cbi/rclone.lua:59 +#: luasrc/model/cbi/rclone.lua:62 msgid "localhost address" msgstr "本机地址" -#: luasrc/model/cbi/rclone.lua:129 +#: luasrc/model/cbi/rclone.lua:132 msgid "log" msgstr "日志" -#: luasrc/model/cbi/rclone.lua:108 +#: luasrc/model/cbi/rclone.lua:111 msgid "password" msgstr "密码" -#: luasrc/model/cbi/rclone.lua:133 +#: luasrc/model/cbi/rclone.lua:136 msgid "path" msgstr "路径" -#: luasrc/model/cbi/rclone.lua:114 +#: luasrc/model/cbi/rclone.lua:117 msgid "proxy" msgstr "代理" -#: luasrc/model/cbi/rclone.lua:123 +#: luasrc/model/cbi/rclone.lua:126 msgid "proxy address" msgstr "代理地址" @@ -114,7 +118,7 @@ msgstr "代理地址" msgid "rclone address" msgstr "rclone 地址" -#: luasrc/model/cbi/rclone.lua:71 +#: luasrc/model/cbi/rclone.lua:74 msgid "rclone configuration file path" msgstr "rclone 配置文件地址" @@ -130,19 +134,19 @@ msgstr "rclone 运行中" msgid "rclone state" msgstr "rclone 状态" -#: luasrc/model/cbi/rclone.lua:51 +#: luasrc/model/cbi/rclone.lua:54 msgid "run Rclone as daemon" msgstr "启动 rclone 后台服务" -#: luasrc/model/cbi/rclone.lua:77 +#: luasrc/model/cbi/rclone.lua:80 msgid "than updaload configuration to here." msgstr "然后上传配置文件到这里" -#: luasrc/model/cbi/rclone.lua:77 +#: luasrc/model/cbi/rclone.lua:80 msgid "to setup configuration on pc," msgstr "命令设置 rclone 配置文件," -#: luasrc/model/cbi/rclone.lua:103 +#: luasrc/model/cbi/rclone.lua:106 msgid "username" msgstr "用户名" diff --git a/package/lean/luci-app-rclone/root/etc/init.d/rclone b/package/lean/luci-app-rclone/root/etc/init.d/rclone index 15205215ce..03f8fc39c4 100755 --- a/package/lean/luci-app-rclone/root/etc/init.d/rclone +++ b/package/lean/luci-app-rclone/root/etc/init.d/rclone @@ -1,4 +1,4 @@ -#!/bin/bash /etc/rc.common +#!/bin/sh /etc/rc.common # Copyright (C) 2019 ElonH USE_PROCD=1 @@ -32,6 +32,9 @@ init_config() { [ -f "$config_path" ] || touch "$config_path" + [ -d "/lib/upgrade/keep.d" ] || mkdir -p /lib/upgrade/keep.d/luci-app-rclone 2>/dev/null + echo "$config_path" > /lib/upgrade/keep.d/luci-app-rclone + log_dir=${log_path%/*} [ -d "$log_dir" ] || mkdir -p "$log_dir" 2>/dev/null && echo /dev/null > "$log_path" @@ -81,8 +84,8 @@ start_service() { procd_append_param command "--rc-allow-origin=*" procd_append_param command "--log-file=${log_path}" if [[ "${proxy_enable}" == "1" ]]; then - procd_set_param env all_proxy="$proxy_addr" https_proxy="$proxy_addr" http_proxy="$proxy_addr" - procd_set_param env ALL_PROXY="$proxy_addr" HTTPS_PROXY="$proxy_addr" HTTP_PROXY="$proxy_addr" + procd_set_param env all_proxy="$proxy_addr" https_proxy="$proxy_addr" http_proxy="$proxy_addr" + procd_append_param env ALL_PROXY="$proxy_addr" HTTPS_PROXY="$proxy_addr" HTTP_PROXY="$proxy_addr" fi procd_set_param stdout 1 procd_set_param stderr 1 diff --git a/package/lean/rclone-ng/Makefile b/package/lean/rclone-ng/Makefile new file mode 100644 index 0000000000..49e4384856 --- /dev/null +++ b/package/lean/rclone-ng/Makefile @@ -0,0 +1,58 @@ +#### + # File: /rclone-ng/Makefile + # Project: Rclone-OpenWrt + # File Created: Friday, 5th June 2020 12:37:26 am + # Author: ElonH[EH](elonhhuang@gmail.com) + # License: GNU General Public License v3.0 or later(http://www.gnu.org/licenses/gpl-3.0-standalone.html) + # Copyright (C) 2020 [ElonH] +#### + +include $(TOPDIR)/rules.mk + +PKG_NAME:=rclone-ng +PKG_VERSION:=0.2.4 +PKG_RELEASE:=1 + + +PKG_LICENSE:=GPLv3 +PKG_MAINTAINER:=ElonH + +include $(INCLUDE_DIR)/package.mk + +PKG_SOURCE:=RcloneNg-v$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/ElonH/RcloneNg/releases/download/v$(PKG_VERSION)/ +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_HASH:=3090a713253b17bfbb4d6a69b4b55b81d69e1768cf56d3abca8631e4a35f270b + +define Package/$(PKG_NAME) + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + SUBMENU:=Cloud Manager + TITLE:=An angular web application for rclone + URL:=https://github.com/ElonH/RcloneNg + PKGARCH:=all +endef + +define Package/$(PKG_NAME)/description + An angular web application for rclone +endef + +define Build/Prepare + mkdir -vp $(PKG_BUILD_DIR) + tar -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) +endef + +define Build/Configure +endef + +define Build/Compile + echo "$(PKG_NAME) Compile Skiped!" +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/www + $(CP) $(PKG_BUILD_DIR)/RcloneNg $(1)/www +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/package/lean/rclone/patches/010-change-default-config-path.patch b/package/lean/rclone/patches/010-change-default-config-path.patch new file mode 100644 index 0000000000..b1d381ecf2 --- /dev/null +++ b/package/lean/rclone/patches/010-change-default-config-path.patch @@ -0,0 +1,45 @@ +## +# File: /patches/010-change-default-config-path.patch +# Project: rclone +# File Created: Friday, 1st May 2020 10:54:31 pm +# Author: ElonH[EH](elonhhuang@gmail.com) +# License: GNU General Public License v3.0 or later(http://www.gnu.org/licenses/gpl-3.0-standalone.html) +# Copyright (C) 2020 [ElonH] +## +# set /etc/rclone/rclone.conf as default configuration path +diff --git a/fs/config/config.go b/fs/config/config.go +index 53d67ef03..cc5d6436b 100644 +--- a/fs/config/config.go ++++ b/fs/config/config.go +@@ -25,7 +25,6 @@ import ( + "unicode/utf8" + + "github.com/Unknwon/goconfig" +- homedir "github.com/mitchellh/go-homedir" + "github.com/pkg/errors" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/accounting" +@@ -133,21 +132,10 @@ func makeConfigPath() string { + } + + // Find user's home directory +- homeDir, err := homedir.Dir() ++ homeDir := "/etc" + +- // Find user's configuration directory. +- // Prefer XDG config path, with fallback to $HOME/.config. +- // See XDG Base Directory specification +- // https://specifications.freedesktop.org/basedir-spec/latest/), +- xdgdir := os.Getenv("XDG_CONFIG_HOME") + var cfgdir string +- if xdgdir != "" { +- // User's configuration directory for rclone is $XDG_CONFIG_HOME/rclone +- cfgdir = filepath.Join(xdgdir, "rclone") +- } else if homeDir != "" { +- // User's configuration directory for rclone is $HOME/.config/rclone +- cfgdir = filepath.Join(homeDir, ".config", "rclone") +- } ++ cfgdir = filepath.Join(homeDir, "rclone") + + // Use rclone.conf from user's configuration directory if already existing + var cfgpath string diff --git a/package/lean/rclone/patches/020-Notice-Access-Control-Allow-Origin-only-once.patch b/package/lean/rclone/patches/020-Notice-Access-Control-Allow-Origin-only-once.patch new file mode 100644 index 0000000000..5317aa56f6 --- /dev/null +++ b/package/lean/rclone/patches/020-Notice-Access-Control-Allow-Origin-only-once.patch @@ -0,0 +1,44 @@ +## +# File: /patches/020-Notice-Access-Control-Allow-Origin-only-once.patch +# Project: rclone +# File Created: Sunday, 3rd May 2020 1:44:22 pm +# Author: ElonH[EH](elonhhuang@gmail.com) +# License: GNU General Public License v3.0 or later(http://www.gnu.org/licenses/gpl-3.0-standalone.html) +# Copyright (C) 2020 [ElonH] +## +diff --git a/fs/rc/rcserver/rcserver.go b/fs/rc/rcserver/rcserver.go +index 4a2b5c71e..f00994e93 100644 +--- a/fs/rc/rcserver/rcserver.go ++++ b/fs/rc/rcserver/rcserver.go +@@ -14,6 +14,7 @@ import ( + "regexp" + "sort" + "strings" ++ "sync" + + "github.com/pkg/errors" + "github.com/rclone/rclone/cmd/serve/httplib" +@@ -29,6 +30,8 @@ import ( + "github.com/skratchdot/open-golang/open" + ) + ++var onlyOnce sync.Once ++ + // Start the remote control server if configured + // + // If the server wasn't configured the *Server returned may be nil +@@ -172,9 +175,11 @@ func (s *Server) handler(w http.ResponseWriter, r *http.Request) { + + allowOrigin := rcflags.Opt.AccessControlAllowOrigin + if allowOrigin != "" { +- if allowOrigin == "*" { +- fs.Logf(nil, "Warning: Allow origin set to *. This can cause serious security problems.") +- } ++ onlyOnce.Do(func() { ++ if allowOrigin == "*" { ++ fs.Logf(nil, "Warning: Allow origin set to *. This can cause serious security problems.") ++ } ++ }) + w.Header().Add("Access-Control-Allow-Origin", allowOrigin) + } else { + w.Header().Add("Access-Control-Allow-Origin", s.URL()) From f892bcdf96e59ca3d19501fafc2dcd6a4e9ce318 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sat, 6 Jun 2020 12:36:21 +0800 Subject: [PATCH 02/12] treewide: adjust sysupgrade script (#4720) This commit fix sysupgrade failed for bcm27xx. --- .../linux/apm821xx/base-files/lib/upgrade/wdbook.sh | 11 ++++++++--- .../linux/bcm27xx/base-files/lib/upgrade/platform.sh | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh b/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh index c191271149..2287e0619d 100644 --- a/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh +++ b/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh @@ -7,7 +7,7 @@ mbl_do_platform_check() { [ "$#" -gt 1 ] && return 1 - export_bootdevice && export_partdevice diskdev 0 || { + export_bootdevice && export_partdevice diskdev -2 || { echo "Unable to determine upgrade device" return 1 } @@ -36,7 +36,7 @@ mbl_do_platform_check() { mbl_do_upgrade() { local diskdev partdev diff - export_bootdevice && export_partdevice diskdev 0 || { + export_bootdevice && export_partdevice diskdev -2 || { echo "Unable to determine upgrade device" return 1 } @@ -70,6 +70,10 @@ mbl_do_upgrade() { #iterate over each partition from the image and write it to the boot disk while read part start size; do + # root is /dev/sd[a|b]2 and not /dev/sd[a|b] this causes some problem + # one of which is this offset, I'm not sure what's the best fix, so + # here's a WA. + let part=$((part - 2)) if export_partdevice partdev $part; then echo "Writing image to /dev/$partdev..." get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync @@ -86,7 +90,8 @@ mbl_do_upgrade() { mbl_copy_config() { local partdev - if export_partdevice partdev 1; then + # Same as above /dev/sd[a|b]2 is root, so /boot is -1 + if export_partdevice partdev -1; then mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt cp -af "$CONF_TAR" /mnt/ umount /mnt diff --git a/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh index 37e479272b..62eede53d3 100644 --- a/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh @@ -9,7 +9,7 @@ platform_check_image() { [ "$#" -gt 1 ] && return 1 - export_bootdevice && export_partdevice diskdev 0 || { + export_bootdevice && export_partdevice diskdev -2 || { echo "Unable to determine upgrade device" return 1 } @@ -38,7 +38,7 @@ platform_check_image() { platform_do_upgrade() { local diskdev partdev diff - export_bootdevice && export_partdevice diskdev 0 || { + export_bootdevice && export_partdevice diskdev -2 || { echo "Unable to determine upgrade device" return 1 } @@ -72,6 +72,10 @@ platform_do_upgrade() { #iterate over each partition from the image and write it to the boot disk while read part start size; do + # root is /dev/sd[a|b]2 and not /dev/sd[a|b] this causes some problem + # one of which is this offset, I'm not sure what's the best fix, so + # here's a WA. + let part=$((part - 2)) if export_partdevice partdev $part; then echo "Writing image to /dev/$partdev..." get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync @@ -88,7 +92,8 @@ platform_do_upgrade() { platform_copy_config() { local partdev - if export_partdevice partdev 1; then + # Same as above /dev/sd[a|b]2 is root, so /boot is -1 + if export_partdevice partdev -1; then mkdir -p /boot [ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime "/dev/$partdev" /boot cp -af "$CONF_TAR" /boot/ From 901efc2d12cbbd4665636a2d28741bc79a4dba20 Mon Sep 17 00:00:00 2001 From: Chuck Date: Sun, 7 Jun 2020 21:52:06 +0800 Subject: [PATCH 03/12] default-settings: i18n: add space between Chinese and English characters (#4616) --- .../lean/default-settings/i18n/default.zh-cn.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package/lean/default-settings/i18n/default.zh-cn.po b/package/lean/default-settings/i18n/default.zh-cn.po index 5cf797d2df..f6c36823c0 100644 --- a/package/lean/default-settings/i18n/default.zh-cn.po +++ b/package/lean/default-settings/i18n/default.zh-cn.po @@ -5,19 +5,19 @@ msgid "Architecture" msgstr "架构" msgid "CPU Temperature" -msgstr "CPU温度" +msgstr "CPU 温度" msgid "CPU Info" -msgstr "CPU信息" +msgstr "CPU 信息" msgid "CPU Model" msgstr "处理器型号" msgid "CPU frequency" -msgstr "CPU频率" +msgstr "CPU 频率" msgid "RAM frequency" -msgstr "RAM频率" +msgstr "RAM 频率" msgid "Flash Size" msgstr "闪存大小" @@ -44,7 +44,7 @@ msgid "ZRam Size" msgstr "ZRam 大小" msgid "Size of the ZRam device in megabytes" -msgstr "划分给ZRam 分区的内存大小(MB),推荐留空由系统自动管理" +msgstr "划分给 ZRam 分区的内存大小(MB),推荐留空由系统自动管理" msgid "Number of parallel threads used for compression" msgstr "用于压缩内存数据的CPU并发线程数" @@ -53,15 +53,15 @@ msgid "Swap" msgstr "虚拟内存" msgid "Force 40MHz mode" -msgstr "强制40MHz频宽" +msgstr "强制 40MHz 频宽" msgid "" "Always use 40MHz channels even if the secondary channel overlaps. Using this " "option does not comply with IEEE 802.11n-2009!" -msgstr "强制启用40MHz频宽并忽略辅助信道重叠。此选项可能不兼容某些无线硬件导致无法启用!" +msgstr "强制启用 40MHz 频宽并忽略辅助信道重叠。此选项可能不兼容某些无线硬件导致无法启用!" msgid "Disassociate On Low Acknowledgement" msgstr "弱信号剔除" msgid "Allow AP mode to disconnect STAs based on low ACK condition" -msgstr "允许AP模式基于低ACK条件判断剔除弱信号的客户端" +msgstr "允许 AP 模式基于低 ACK 条件判断剔除弱信号的客户端" From bae6e7fc28b8645e6f96df80a0b57ae2387cd847 Mon Sep 17 00:00:00 2001 From: hyird <31695447+hyird@users.noreply.github.com> Date: Tue, 9 Jun 2020 16:11:41 +0800 Subject: [PATCH 04/12] luci-app-frpc: add plugin "https2http" (#4754) * Update config.lua * Update frp * Update frp.po --- .../luasrc/model/cbi/frp/config.lua | 21 +++++++++++++++++++ package/lean/luci-app-frpc/po/zh-cn/frp.po | 17 ++++++++++++++- .../lean/luci-app-frpc/root/etc/init.d/frp | 16 ++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/package/lean/luci-app-frpc/luasrc/model/cbi/frp/config.lua b/package/lean/luci-app-frpc/luasrc/model/cbi/frp/config.lua index b015ff7ad4..039d1ae40c 100644 --- a/package/lean/luci-app-frpc/luasrc/model/cbi/frp/config.lua +++ b/package/lean/luci-app-frpc/luasrc/model/cbi/frp/config.lua @@ -105,6 +105,27 @@ e:depends("type","http") e = t:taboption("other",Value, "host_header_rewrite", translate("Host Header"), translate("The Host header will be rewritten to match the hostname portion of the forwarding address.")) e.default = "dev.yourdomain.com" e:depends("enable_host_header_rewrite",1) +e=t:taboption("other",Flag,"enable_https_plugin",translate("Use Plugin")) +e.default="0" +e:depends("type","https") +e=t:taboption("other",ListValue,"https_plugin",translate("Choose Plugin"),translate("If plugin is defined, local_ip and local_port is useless, plugin will handle connections got from frps.")) +e:value("https2http",translate("https2http")) +e:depends("enable_https_plugin",1) +e=t:taboption("other",Value,"plugin_local_addr",translate("Plugin_Local_Addr")) +e.default="127.0.0.1:80" +e:depends("https_plugin","https2http") +e=t:taboption("other",Value,"plugin_crt_path",translate("plugin_crt_path")) +e.default="./server.crt" +e:depends("https_plugin","https2http") +e=t:taboption("other",Value,"plugin_key_path",translate("plugin_key_path")) +e.default="./server.key" +e:depends("https_plugin","https2http") +e=t:taboption("other",Value,"plugin_host_header_rewrite",translate("plugin_host_header_rewrite")) +e.default="127.0.0.1" +e:depends("https_plugin","https2http") +e=t:taboption("other",Value,"plugin_header_X_From_Where",translate("plugin_header_X-From-Where")) +e.default="frp" +e:depends("https_plugin","https2http") e = t:taboption("base",ListValue, "proxy_protocol_version", translate("Proxy-Protocol Version"), translate("Proxy Protocol to send user's real IP to local services.")) e.default = "disable" e:value("disable",translate("Disable")) diff --git a/package/lean/luci-app-frpc/po/zh-cn/frp.po b/package/lean/luci-app-frpc/po/zh-cn/frp.po index 13f7f9adde..17f775a70a 100644 --- a/package/lean/luci-app-frpc/po/zh-cn/frp.po +++ b/package/lean/luci-app-frpc/po/zh-cn/frp.po @@ -252,4 +252,19 @@ msgid "STCP Server Name is Service Remark Name of STCP Server" msgstr "STCP服务器别名" msgid "Please ensure the remark name is unique." -msgstr "确保备注名唯一" \ No newline at end of file +msgstr "确保备注名唯一" + +msgid "Plugin_Local_Addr" +msgstr "插件本地地址(格式 IP:Port)" + +msgid "plugin_crt_path" +msgstr "插件证书路径" + +msgid "plugin_key_path" +msgstr "插件私钥路径" + +msgid "plugin_host_header_rewrite" +msgstr "插件 Host Header 重写" + +msgid "plugin_header_X-From-Where" +msgstr "插件X-From-Where请求头" diff --git a/package/lean/luci-app-frpc/root/etc/init.d/frp b/package/lean/luci-app-frpc/root/etc/init.d/frp index cde1c0ebea..53fee3ba3a 100755 --- a/package/lean/luci-app-frpc/root/etc/init.d/frp +++ b/package/lean/luci-app-frpc/root/etc/init.d/frp @@ -32,6 +32,7 @@ conf_proxy_add() { local enable type domain_type custom_domains remote_port local_ip local_port enable_http_auth enable_host_header_rewrite host_header_rewrite local subdomain proxy_protocol_version use_encryption use_compression http_user http_pwd remark locations local enable_plugin plugin plugin_http_user plugin_http_passwd plugin_unix_path stcp_role stcp_secretkey stcp_servername + local enable_https_plugin https_plugin plugin_local_addr plugin_crt_path plugin_key_path plugin_host_header_rewrite plugin_header_X_From_Where config_get_bool enable "$cfg" enable 1 [ "$enable" -gt 0 ] || return 1 @@ -55,6 +56,12 @@ conf_proxy_add() { config_get stcp_secretkey "$cfg" stcp_secretkey config_get stcp_servername "$cfg" stcp_servername config_get proxy_protocol_version "$cfg" proxy_protocol_version + config_get https_plugin "$cfg" https_plugin + config_get plugin_local_addr "$cfg" plugin_local_addr + config_get plugin_crt_path "$cfg" plugin_crt_path + config_get plugin_key_path "$cfg" plugin_key_path + config_get plugin_host_header_rewrite "$cfg" plugin_host_header_rewrite + config_get plugin_header_X_From_Where "$cfg" plugin_header_X_From_Where [ -n "$remark" ] && [ -n "$type" ] || return 1 @@ -99,6 +106,15 @@ conf_proxy_add() { fi } + [ -n "$https_plugin" ] && echo "plugin=$https_plugin" >>$tmpconf + [ -n "$plugin_local_addr" ] && echo "plugin_local_addr=$plugin_local_addr" >>$tmpconf + [ -n "$plugin_crt_path" -a -n "$plugin_key_path" ] && { + echo "plugin_crt_path=$plugin_crt_path" >>$tmpconf + echo "plugin_key_path=$plugin_key_path" >>$tmpconf + } + [ -n "$plugin_host_header_rewrite" ] && echo "plugin_host_header_rewrite=$plugin_host_header_rewrite" >>$tmpconf + [ -n "$plugin_header_X_From_Where" ] && echo "plugin_header_X_From_Where=$plugin_header_X_From_Where" >>$tmpconf + frp_write_bool use_encryption $cfg 1 frp_write_bool use_compression $cfg 1 From e0c345df71ee9555f20235a6eaa35fd70b0ab3eb Mon Sep 17 00:00:00 2001 From: HiGarfield <32226909+HiGarfield@users.noreply.github.com> Date: Tue, 9 Jun 2020 16:14:26 +0800 Subject: [PATCH 05/12] ppp: syncppp: further fix grep's regex match (#4623) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /etc/config/network这个文件里的写法可以各种各样,pppoe外面可以有引号,也可以没引号。proto与pppoe之间可以有不同类型、不同数量的空格(或Tab)。用uci show,可以把输出格式统一掉,省得考虑配置文件不同写法的区别。 --- package/network/services/ppp/files/ppp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index eea4220a34..78e8c32136 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -233,8 +233,8 @@ proto_pppoe_setup() { #By 蝈蝈:并发拨号同步的前期准备 syncppp_option="" - [ "$(uci get syncdial.config.enabled)" == "1" ] && { - ppp_if_cnt=$(cat /etc/config/network | grep -E -c "proto\s+?'pppoe'") + [ "$(uci get syncdial.config.enabled)" -eq "1" ] && { + ppp_if_cnt=$(uci show network | grep -c "\.proto=\'pppoe\'$") syncppp_option="syncppp $ppp_if_cnt" shellsync $ppp_if_cnt 10 } From 23699790539fb8b30b29c2ef5fff8a57af73dade Mon Sep 17 00:00:00 2001 From: ElonH Date: Wed, 10 Jun 2020 13:10:29 +0800 Subject: [PATCH 06/12] RcloneNg: bump version to 0.3.0 (#4757) --- package/lean/rclone-ng/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/rclone-ng/Makefile b/package/lean/rclone-ng/Makefile index 49e4384856..5e1e09ca2d 100644 --- a/package/lean/rclone-ng/Makefile +++ b/package/lean/rclone-ng/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rclone-ng -PKG_VERSION:=0.2.4 +PKG_VERSION:=0.3.0 PKG_RELEASE:=1 @@ -22,7 +22,7 @@ include $(INCLUDE_DIR)/package.mk PKG_SOURCE:=RcloneNg-v$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/ElonH/RcloneNg/releases/download/v$(PKG_VERSION)/ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) -PKG_HASH:=3090a713253b17bfbb4d6a69b4b55b81d69e1768cf56d3abca8631e4a35f270b +PKG_HASH:=b6f7254fcb82d380ad621859a216fbf510059c95ad2df0e27bcf2872892f7c6f define Package/$(PKG_NAME) SECTION:=net From 4798e5314b8b4a328f9f4b6469af135804d630b4 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 10 Jun 2020 16:01:15 +0800 Subject: [PATCH 07/12] luci-app-unblockmusic: fix update version display --- package/lean/luci-app-unblockmusic/Makefile | 2 +- .../root/usr/share/UnblockNeteaseMusic/update_core.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/luci-app-unblockmusic/Makefile b/package/lean/luci-app-unblockmusic/Makefile index b1b84517ef..9de04a6ba7 100644 --- a/package/lean/luci-app-unblockmusic/Makefile +++ b/package/lean/luci-app-unblockmusic/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-unblockmusic PKG_VERSION:=2.3.5 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_CONFIG_DEPENDS := \ CONFIG_UnblockNeteaseMusic_Go \ diff --git a/package/lean/luci-app-unblockmusic/root/usr/share/UnblockNeteaseMusic/update_core.sh b/package/lean/luci-app-unblockmusic/root/usr/share/UnblockNeteaseMusic/update_core.sh index 65953b9353..eea7b08ca8 100755 --- a/package/lean/luci-app-unblockmusic/root/usr/share/UnblockNeteaseMusic/update_core.sh +++ b/package/lean/luci-app-unblockmusic/root/usr/share/UnblockNeteaseMusic/update_core.sh @@ -49,7 +49,7 @@ function update_core(){ exit 1 else echo -e "${latest_ver}" > /usr/share/UnblockNeteaseMusic/local_ver - cat /usr/share/UnblockNeteaseMusic/package-lock.json | grep version |awk -F ':' '{print $2}' | cut -c3-8 > /usr/share/UnblockNeteaseMusic/core_ver + cat /usr/share/UnblockNeteaseMusic/package.json | grep version |awk -F ':' '{print $2}' | cut -c3-8 > /usr/share/UnblockNeteaseMusic/core_ver fi echo -e "Succeeded in updating core." >/tmp/unblockmusic_update.log From 4676dd368cb7c970c4ffcbfa01d337d3deac9448 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 10 Jun 2020 16:03:00 +0800 Subject: [PATCH 08/12] luci-app-unblockmusic: allow revert to <320Kbps mp3 --- package/lean/luci-app-unblockmusic/Makefile | 2 +- package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package/lean/luci-app-unblockmusic/Makefile b/package/lean/luci-app-unblockmusic/Makefile index 9de04a6ba7..9ef04f6ec4 100644 --- a/package/lean/luci-app-unblockmusic/Makefile +++ b/package/lean/luci-app-unblockmusic/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-unblockmusic PKG_VERSION:=2.3.5 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_CONFIG_DEPENDS := \ CONFIG_UnblockNeteaseMusic_Go \ diff --git a/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic b/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic index 9389ab2d26..b3de31158c 100755 --- a/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic +++ b/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic @@ -176,6 +176,8 @@ start() fi if [ $FORCE -eq 1 ]; then sed -i '/item.code != 200/ { s/item.code != 200 || item.freeTrialInfo/item.br < 320000/g; }' /usr/share/UnblockNeteaseMusic/src/hook.js + else + sed -i '/item.br < 320000/ { s/item.br < 320000/item.code != 200 || item.freeTrialInfo/g; }' /usr/share/UnblockNeteaseMusic/src/hook.js fi node /usr/share/UnblockNeteaseMusic/app.js -e http://music.163.com -p 5200 $musictype >>/tmp/unblockmusic.log 2>&1 & node /usr/share/UnblockNeteaseMusic/app.js -e https://music.163.com -p 5203:5201 $musictype >>/tmp/unblockmusic.log 2>&1 & From e707c9fb1b755cc7d7981a3f33b03978c4341369 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Wed, 10 Jun 2020 23:33:17 +0800 Subject: [PATCH 09/12] verysync: update to 1.4.1 (#4765) --- package/lean/verysync/Makefile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/package/lean/verysync/Makefile b/package/lean/verysync/Makefile index 296143fabe..5a96495a44 100644 --- a/package/lean/verysync/Makefile +++ b/package/lean/verysync/Makefile @@ -19,21 +19,18 @@ ifeq ($(ARCH),i386) PKG_ARCH_VERYSYNC:=386 endif ifeq ($(ARCH),arm) - PKG_ARCH_VERYSYNC:=arm7 -endif -ifeq ($(BOARD),bcm53xx) - PKG_ARCH_VERYSYNC:=arm6 -endif -ifeq ($(BOARD),kirkwood) PKG_ARCH_VERYSYNC:=arm endif ifeq ($(ARCH),aarch64) PKG_ARCH_VERYSYNC:=arm64 endif +ifeq ($(ARCH),powerpc64) + PKG_ARCH_VERYSYNC:=ppc64 +endif PKG_NAME:=verysync -PKG_VERSION:=v1.3.1 -PKG_RELEASE:=2 +PKG_VERSION:=v1.4.1 +PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-linux-$(PKG_ARCH_VERYSYNC)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://releases-cdn.verysync.com/releases/$(PKG_VERSION)/ From 468b3f56533cbc5af82ce61cd6ecf001c651d78a Mon Sep 17 00:00:00 2001 From: barton0426 Date: Thu, 11 Jun 2020 11:33:36 +0800 Subject: [PATCH 10/12] Update v2ray version to v4.24.2 (#4771) --- package/lean/v2ray/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/v2ray/Makefile b/package/lean/v2ray/Makefile index ec1b6726fc..a54e2fbe16 100644 --- a/package/lean/v2ray/Makefile +++ b/package/lean/v2ray/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray -PKG_VERSION:=4.23.4 +PKG_VERSION:=4.24.2 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/v2ray-core-$(PKG_VERSION) PKG_SOURCE:=v2ray-core-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=726dd98d674bd73150158b1d4c8bc0d59dbb672ba10096ac61548d6278213c78 +PKG_HASH:=ad8a042a334586f9456eccdbe074d4c3b4dad9b5a39c6ee390a5e631d1c389ae PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE From 8bf7ff91685d181d39d02667eca646cee0e1c41f Mon Sep 17 00:00:00 2001 From: Jun Liu Date: Thu, 11 Jun 2020 17:18:52 +0800 Subject: [PATCH 11/12] V2ray hash fix (#4773) --- package/lean/v2ray/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/lean/v2ray/Makefile b/package/lean/v2ray/Makefile index a54e2fbe16..89a58cc226 100644 --- a/package/lean/v2ray/Makefile +++ b/package/lean/v2ray/Makefile @@ -15,7 +15,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/v2ray-core-$(PKG_VERSION) PKG_SOURCE:=v2ray-core-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=ad8a042a334586f9456eccdbe074d4c3b4dad9b5a39c6ee390a5e631d1c389ae +PKG_HASH:=b58b4477020034b67a7649341fae65ea7bdc81851cad47ae7e4a591c0663e4c9 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE From 299da0ae6c1523b0ae7836302bde98b98b31887e Mon Sep 17 00:00:00 2001 From: hyird <31695447+hyird@users.noreply.github.com> Date: Thu, 11 Jun 2020 17:19:12 +0800 Subject: [PATCH 12/12] Update Makefile (#4776) --- package/lean/verysync/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/lean/verysync/Makefile b/package/lean/verysync/Makefile index 5a96495a44..a0d469b714 100644 --- a/package/lean/verysync/Makefile +++ b/package/lean/verysync/Makefile @@ -29,7 +29,7 @@ ifeq ($(ARCH),powerpc64) endif PKG_NAME:=verysync -PKG_VERSION:=v1.4.1 +PKG_VERSION:=v1.4.3 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-linux-$(PKG_ARCH_VERYSYNC)-$(PKG_VERSION).tar.gz