From e8110e771369b3dc1fc8699bcad176d7368aed05 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Thu, 1 Oct 2020 22:08:55 +0800 Subject: [PATCH 1/5] luci-app-unblockneteasemusic-mini: bump to 1.2-9 --- .../ctcgfw/luci-app-unblockneteasemusic-mini/Makefile | 2 +- .../luasrc/model/cbi/unblockneteasemusic-mini.lua | 3 +-- .../root/etc/init.d/unblockneteasemusic-mini | 10 +++------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package/ctcgfw/luci-app-unblockneteasemusic-mini/Makefile b/package/ctcgfw/luci-app-unblockneteasemusic-mini/Makefile index 88e9183dc7..7d0de70af3 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic-mini/Makefile +++ b/package/ctcgfw/luci-app-unblockneteasemusic-mini/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-unblockneteasemusic-mini PKG_VERSION:=1.2 -PKG_RELEASE:=8 +PKG_RELEASE:=9 LUCI_TITLE:=LuCI support for UnblockNeteaseMusic(-Go) LUCI_DEPENDS:=+busybox +dnsmasq-full +ipset +iptables +wget LUCI_PKGARCH:=all diff --git a/package/ctcgfw/luci-app-unblockneteasemusic-mini/luasrc/model/cbi/unblockneteasemusic-mini.lua b/package/ctcgfw/luci-app-unblockneteasemusic-mini/luasrc/model/cbi/unblockneteasemusic-mini.lua index 5766603581..f3bddc4021 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic-mini/luasrc/model/cbi/unblockneteasemusic-mini.lua +++ b/package/ctcgfw/luci-app-unblockneteasemusic-mini/luasrc/model/cbi/unblockneteasemusic-mini.lua @@ -17,8 +17,7 @@ enable.rmempty = false select_server = s:option(ListValue, "select_server", translate("服务器位置")) select_server:value("tencent_shanghai_nodejs", translate("[CTCGFW] 腾讯云上海(高音质)")) -select_server:value("aliyun_beijing_nodejs", translate("[hyird] 阿里云北京(高音质)")) -select_server:value("aliyun_beijing_nodejs_2", translate("[Sunsky] 阿里云北京(高音质)")) +select_server:value("ucloud_guangzhou_nodejs", translate("[CTCGFW] UCloud广州(高音质)")) select_server.description = translate("请合理使用本插件与各个服务器,请勿滥用") select_server.default = "tencent_shanghai_nodejs" select_server.rmempty = false diff --git a/package/ctcgfw/luci-app-unblockneteasemusic-mini/root/etc/init.d/unblockneteasemusic-mini b/package/ctcgfw/luci-app-unblockneteasemusic-mini/root/etc/init.d/unblockneteasemusic-mini index 6a98a8f53f..7c6455bfc8 100755 --- a/package/ctcgfw/luci-app-unblockneteasemusic-mini/root/etc/init.d/unblockneteasemusic-mini +++ b/package/ctcgfw/luci-app-unblockneteasemusic-mini/root/etc/init.d/unblockneteasemusic-mini @@ -13,13 +13,9 @@ if [ "${select_server}" = "tencent_shanghai_nodejs" ]; then [ -z "${unblock_server_ip}" ] && unblock_server_ip="122.51.88.18" unblock_server_http_port="30000" unblock_server_https_port="30001" -elif [ "${select_server}" = "aliyun_beijing_nodejs" ]; then - unblock_server_ip="$(ping "hyird.xyz" -c 1 | sed '1{s/[^(]*(//;s/).*//;q}')" - [ -z "${unblock_server_ip}" ] && unblock_server_ip="182.92.84.98" - unblock_server_http_port="30000" - unblock_server_https_port="30001" -elif [ "${select_server}" = "aliyun_beijing_nodejs_2" ]; then - unblock_server_ip="39.96.56.58" +elif [ "${select_server}" = "ucloud_guangzhou_nodejs" ]; then + unblock_server_ip="$(ping "uc-gz.service.project-openwrt.eu.org" -c 1 | sed '1{s/[^(]*(//;s/).*//;q}')" + [ -z "${unblock_server_ip}" ] && unblock_server_ip="106.75.156.183" unblock_server_http_port="30000" unblock_server_https_port="30001" fi From 6828ea441a5f4e4ee15e42c226d85700eab58e66 Mon Sep 17 00:00:00 2001 From: Beginner <70857188+Beginner-Go@users.noreply.github.com> Date: Fri, 2 Oct 2020 10:45:40 +0800 Subject: [PATCH 2/5] v2ray: update v4.30.0 --- 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 786de910e3..016e939b46 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.29.0 +PKG_VERSION:=4.30.0 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:=cc8cb22b616c218a6de9de0bee80651f502344a907b696008ae7bd467ba05a17 +PKG_HASH:=ee7f615193708dcc5f0499c1918a3806b8dfb0a4aaada0dc3df62229c28220ed PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE From 0a7b738e090d501ecb25ef1a6a14d85f39317ef8 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 3 Oct 2020 01:14:39 +0800 Subject: [PATCH 3/5] kernel: bump 4.9 to 4.9.238 Refreshed all patches. Signed-off-by: CN_SZTL --- include/kernel-version.mk | 4 ++-- .../403-mtd_fix_cfi_cmdset_0002_status_check.patch | 14 +++++++------- .../411-mtd-cfi_cmdset_0002-force-word-write.patch | 6 +++--- .../patches-4.9/910-unaligned_access_hacks.patch | 2 +- ...softlimit-and-delta-fields-from-struct-ub.patch | 4 ++-- ...irty_writeback_interval-value-for-wbuf-ti.patch | 2 +- ..._alloc_page_frag-to-page_frag_alloc-and-_.patch | 2 +- .../hack-4.9/702-phy_add_aneg_done_function.patch | 2 +- .../linux/generic/hack-4.9/721-phy_packets.patch | 4 ++-- .../linux/generic/hack-4.9/902-debloat_proc.patch | 2 +- .../460-mtd-cfi_cmdset_0002-no-erase_suspend.patch | 2 +- ..._cmdset_0002-add-buffer-write-cmd-timeout.patch | 2 +- .../pending-4.9/601-add-kernel-imq-support.patch | 2 +- .../generic/pending-4.9/655-increase_skb_pad.patch | 2 +- .../generic/pending-4.9/834-ledtrig-libata.patch | 10 +++++----- .../ixp4xx/patches-4.9/160-delayed_uart_io.patch | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 51a39e8094..9a3fe2e518 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,11 +6,11 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-4.9 = .237 +LINUX_VERSION-4.9 = .238 LINUX_VERSION-4.14 = .200 LINUX_VERSION-4.19 = .149 -LINUX_KERNEL_HASH-4.9.237 = 81ec5792c0ccdc244faff9dbb3d9c97857d9df4cb1f0c1c3db6bc4031faf861f +LINUX_KERNEL_HASH-4.9.238 = b1eaf60b771ec4df0546d2b7539e164355008ea2f680a0642ae430e9cb134a3f LINUX_KERNEL_HASH-4.14.200 = 5d404a0224a34b5379f1871cc46825487d557c2660459d2b5c3cd4871d699a38 LINUX_KERNEL_HASH-4.19.149 = d9cdcb9a66942a56b91c8d4b273d15a3c5b8e59fad44b79e03362cfffaa62a00 diff --git a/target/linux/ar71xx/patches-4.9/403-mtd_fix_cfi_cmdset_0002_status_check.patch b/target/linux/ar71xx/patches-4.9/403-mtd_fix_cfi_cmdset_0002_status_check.patch index 5fc15589b8..09d0d129e8 100644 --- a/target/linux/ar71xx/patches-4.9/403-mtd_fix_cfi_cmdset_0002_status_check.patch +++ b/target/linux/ar71xx/patches-4.9/403-mtd_fix_cfi_cmdset_0002_status_check.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c -@@ -1637,7 +1637,7 @@ static int __xipram do_write_oneword(str +@@ -1636,7 +1636,7 @@ static int __xipram do_write_oneword(str } if (chip_good(map, adr, datum)) @@ -9,7 +9,7 @@ /* Latency issues. Drop the lock, wait a while and retry */ UDELAY(map, chip, adr, 1); -@@ -1654,6 +1654,8 @@ static int __xipram do_write_oneword(str +@@ -1653,6 +1653,8 @@ static int __xipram do_write_oneword(str goto retry; } } @@ -18,7 +18,7 @@ xip_enable(map, chip, adr); op_done: if (mode == FL_OTP_WRITE) -@@ -2236,7 +2238,6 @@ static int cfi_amdstd_panic_write(struct +@@ -2235,7 +2237,6 @@ static int cfi_amdstd_panic_write(struct return 0; } @@ -26,7 +26,7 @@ /* * Handle devices with one erase region, that only implement * the chip erase command. -@@ -2304,7 +2305,7 @@ static int __xipram do_erase_chip(struct +@@ -2303,7 +2304,7 @@ static int __xipram do_erase_chip(struct } if (chip_good(map, adr, map_word_ff(map))) @@ -35,7 +35,7 @@ if (time_after(jiffies, timeo)) { printk(KERN_WARNING "MTD %s(): software timeout\n", -@@ -2328,6 +2329,7 @@ static int __xipram do_erase_chip(struct +@@ -2327,6 +2328,7 @@ static int __xipram do_erase_chip(struct } } @@ -43,7 +43,7 @@ chip->state = FL_READY; xip_enable(map, chip, adr); DISABLE_VPP(map); -@@ -2401,7 +2403,7 @@ static int __xipram do_erase_oneblock(st +@@ -2400,7 +2402,7 @@ static int __xipram do_erase_oneblock(st if (chip_good(map, adr, map_word_ff(map))) { xip_enable(map, chip, adr); @@ -52,7 +52,7 @@ } if (time_after(jiffies, timeo)) { -@@ -2427,6 +2429,7 @@ static int __xipram do_erase_oneblock(st +@@ -2426,6 +2428,7 @@ static int __xipram do_erase_oneblock(st } } diff --git a/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch b/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch index 7b375ab0fa..84fba8b7d7 100644 --- a/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch +++ b/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch @@ -35,7 +35,7 @@ /* Atmel chips don't use the same PRI format as AMD chips */ static void fixup_convert_atmel_pri(struct mtd_info *mtd) -@@ -1796,6 +1800,7 @@ static int cfi_amdstd_write_words(struct +@@ -1795,6 +1799,7 @@ static int cfi_amdstd_write_words(struct /* * FIXME: interleaved mode not tested, and probably not supported! */ @@ -43,7 +43,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, unsigned long adr, const u_char *buf, int len) -@@ -1928,7 +1933,6 @@ static int __xipram do_write_buffer(stru +@@ -1927,7 +1932,6 @@ static int __xipram do_write_buffer(stru return ret; } @@ -51,7 +51,7 @@ static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) { -@@ -2003,6 +2007,7 @@ static int cfi_amdstd_write_buffers(stru +@@ -2002,6 +2006,7 @@ static int cfi_amdstd_write_buffers(stru return 0; } diff --git a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch index 90dd27f709..43c3e58c98 100644 --- a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch @@ -316,7 +316,7 @@ for (p = *head; p; p = p->next) { --- a/net/ipv4/route.c +++ b/net/ipv4/route.c -@@ -459,7 +459,7 @@ static struct neighbour *ipv4_neigh_look +@@ -460,7 +460,7 @@ static struct neighbour *ipv4_neigh_look else if (skb) pkey = &ip_hdr(skb)->daddr; diff --git a/target/linux/generic/backport-4.9/030-01-ubifs-Drop-softlimit-and-delta-fields-from-struct-ub.patch b/target/linux/generic/backport-4.9/030-01-ubifs-Drop-softlimit-and-delta-fields-from-struct-ub.patch index 8e1f312a0b..c1367074bd 100644 --- a/target/linux/generic/backport-4.9/030-01-ubifs-Drop-softlimit-and-delta-fields-from-struct-ub.patch +++ b/target/linux/generic/backport-4.9/030-01-ubifs-Drop-softlimit-and-delta-fields-from-struct-ub.patch @@ -21,7 +21,7 @@ Signed-off-by: Richard Weinberger --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c -@@ -452,16 +452,22 @@ static enum hrtimer_restart wbuf_timer_c +@@ -464,16 +464,22 @@ static enum hrtimer_restart wbuf_timer_c */ static void new_wbuf_timer_nolock(struct ubifs_wbuf *wbuf) { @@ -48,7 +48,7 @@ Signed-off-by: Richard Weinberger HRTIMER_MODE_REL); } -@@ -1059,10 +1065,6 @@ int ubifs_wbuf_init(struct ubifs_info *c +@@ -1071,10 +1077,6 @@ int ubifs_wbuf_init(struct ubifs_info *c hrtimer_init(&wbuf->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); wbuf->timer.function = wbuf_timer_callback_nolock; diff --git a/target/linux/generic/backport-4.9/030-02-ubifs-Use-dirty_writeback_interval-value-for-wbuf-ti.patch b/target/linux/generic/backport-4.9/030-02-ubifs-Use-dirty_writeback_interval-value-for-wbuf-ti.patch index 96fa441132..9ddaf89730 100644 --- a/target/linux/generic/backport-4.9/030-02-ubifs-Use-dirty_writeback_interval-value-for-wbuf-ti.patch +++ b/target/linux/generic/backport-4.9/030-02-ubifs-Use-dirty_writeback_interval-value-for-wbuf-ti.patch @@ -35,7 +35,7 @@ Signed-off-by: Richard Weinberger --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c -@@ -452,11 +452,11 @@ static enum hrtimer_restart wbuf_timer_c +@@ -464,11 +464,11 @@ static enum hrtimer_restart wbuf_timer_c */ static void new_wbuf_timer_nolock(struct ubifs_wbuf *wbuf) { diff --git a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch b/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch index e646efd640..30b9fea42c 100644 --- a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch +++ b/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch @@ -52,7 +52,7 @@ Signed-off-by: Linus Torvalds #define free_page(addr) free_pages((addr), 0) --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2477,7 +2477,7 @@ static inline struct sk_buff *netdev_all +@@ -2489,7 +2489,7 @@ static inline struct sk_buff *netdev_all static inline void skb_free_frag(void *addr) { diff --git a/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch index ab8b8647ec..32bd9ce4dc 100644 --- a/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch @@ -15,7 +15,7 @@ --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1320,6 +1320,9 @@ int genphy_update_link(struct phy_device +@@ -1321,6 +1321,9 @@ int genphy_update_link(struct phy_device { int status; diff --git a/target/linux/generic/hack-4.9/721-phy_packets.patch b/target/linux/generic/hack-4.9/721-phy_packets.patch index 9c088b7d37..13078c18e4 100644 --- a/target/linux/generic/hack-4.9/721-phy_packets.patch +++ b/target/linux/generic/hack-4.9/721-phy_packets.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2359,6 +2359,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2371,6 +2371,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2479,16 +2483,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2491,16 +2495,6 @@ static inline struct sk_buff *dev_alloc_ } diff --git a/target/linux/generic/hack-4.9/902-debloat_proc.patch b/target/linux/generic/hack-4.9/902-debloat_proc.patch index b6555ca9de..b755528640 100644 --- a/target/linux/generic/hack-4.9/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.9/902-debloat_proc.patch @@ -394,7 +394,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/route.c +++ b/net/ipv4/route.c -@@ -421,6 +421,9 @@ static struct pernet_operations ip_rt_pr +@@ -422,6 +422,9 @@ static struct pernet_operations ip_rt_pr static int __init ip_rt_proc_init(void) { diff --git a/target/linux/generic/pending-4.9/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch b/target/linux/generic/pending-4.9/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch index c52d7de762..74cded8de8 100644 --- a/target/linux/generic/pending-4.9/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch +++ b/target/linux/generic/pending-4.9/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c -@@ -807,7 +807,7 @@ static int get_chip(struct map_info *map +@@ -806,7 +806,7 @@ static int get_chip(struct map_info *map return 0; case FL_ERASING: diff --git a/target/linux/generic/pending-4.9/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch b/target/linux/generic/pending-4.9/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch index f78667994c..c2d6185cd8 100644 --- a/target/linux/generic/pending-4.9/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch +++ b/target/linux/generic/pending-4.9/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch @@ -7,7 +7,7 @@ Signed-off-by: George Kashperko 1 file changed, 1 insertion(+) --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c -@@ -1835,6 +1835,7 @@ static int __xipram do_write_buffer(stru +@@ -1834,6 +1834,7 @@ static int __xipram do_write_buffer(stru /* Write Buffer Load */ map_write(map, CMD(0x25), cmd_adr); diff --git a/target/linux/generic/pending-4.9/601-add-kernel-imq-support.patch b/target/linux/generic/pending-4.9/601-add-kernel-imq-support.patch index 0841b87a17..1263da96e0 100644 --- a/target/linux/generic/pending-4.9/601-add-kernel-imq-support.patch +++ b/target/linux/generic/pending-4.9/601-add-kernel-imq-support.patch @@ -1525,7 +1525,7 @@ extern struct kmem_cache *skbuff_head_cache; void kfree_skb_partial(struct sk_buff *skb, bool head_stolen); -@@ -3628,6 +3647,10 @@ static inline void __nf_copy(struct sk_b +@@ -3640,6 +3659,10 @@ static inline void __nf_copy(struct sk_b if (copy) dst->nfctinfo = src->nfctinfo; #endif diff --git a/target/linux/generic/pending-4.9/655-increase_skb_pad.patch b/target/linux/generic/pending-4.9/655-increase_skb_pad.patch index be14a3d49e..655e69d366 100644 --- a/target/linux/generic/pending-4.9/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-4.9/655-increase_skb_pad.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2323,7 +2323,7 @@ static inline int pskb_network_may_pull( +@@ -2335,7 +2335,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/target/linux/generic/pending-4.9/834-ledtrig-libata.patch b/target/linux/generic/pending-4.9/834-ledtrig-libata.patch index 062e9fac72..cde478f3bb 100644 --- a/target/linux/generic/pending-4.9/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-4.9/834-ledtrig-libata.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle /** * ata_build_rw_tf - Build ATA taskfile for given read/write request * @tf: Target ATA taskfile -@@ -4996,6 +5009,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -4999,6 +5012,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (tag < 0) return NULL; } @@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle qc = __ata_qc_from_tag(ap, tag); qc->tag = tag; -@@ -5897,6 +5913,9 @@ struct ata_port *ata_port_alloc(struct a +@@ -5902,6 +5918,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -5918,6 +5937,12 @@ static void ata_host_release(struct devi +@@ -5923,6 +5942,12 @@ static void ata_host_release(struct devi kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -6364,7 +6389,23 @@ int ata_host_register(struct ata_host *h +@@ -6369,7 +6394,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } @@ -134,7 +134,7 @@ Signed-off-by: Daniel Golle /* * Define if arch has non-standard setup. This is a _PCI_ standard -@@ -888,6 +891,12 @@ struct ata_port { +@@ -889,6 +892,12 @@ struct ata_port { #ifdef CONFIG_ATA_ACPI struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ #endif diff --git a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch index 41a7c06b16..7565901ac4 100644 --- a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch +++ b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch @@ -105,7 +105,7 @@ case UPIO_AU: p->serial_out(p, offset, value); p->serial_in(p, UART_LCR); /* safe, no side-effects */ -@@ -2766,6 +2786,7 @@ static int serial8250_request_std_resour +@@ -2780,6 +2800,7 @@ static int serial8250_request_std_resour case UPIO_MEM32BE: case UPIO_MEM16: case UPIO_MEM: @@ -113,7 +113,7 @@ if (!port->mapbase) break; -@@ -2804,6 +2825,7 @@ static void serial8250_release_std_resou +@@ -2818,6 +2839,7 @@ static void serial8250_release_std_resou case UPIO_MEM32BE: case UPIO_MEM16: case UPIO_MEM: From 9837f0b55724aa12e800b815308c3e57139daf69 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 3 Oct 2020 21:09:16 +0800 Subject: [PATCH 4/5] luci-app-unblockneteasemusic: bump to 2.8-8 --- .../luci-app-unblockneteasemusic/Makefile | 2 +- .../root/etc/init.d/unblockneteasemusic | 71 ++++++++++-------- ...remote_qq_server.sh => gen_qq_provider.sh} | 68 +++++------------- .../share/unblockneteasemusic/log_check.sh | 6 +- .../usr/share/unblockneteasemusic/update.sh | 72 ++++++++++--------- 5 files changed, 100 insertions(+), 119 deletions(-) rename package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/{gen_remote_qq_server.sh => gen_qq_provider.sh} (71%) diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/Makefile b/package/ctcgfw/luci-app-unblockneteasemusic/Makefile index bea1e329f7..788accc7e0 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic/Makefile +++ b/package/ctcgfw/luci-app-unblockneteasemusic/Makefile @@ -12,7 +12,7 @@ LUCI_DEPENDS:=+bash +busybox +coreutils +coreutils-nohup +curl +dnsmasq-full +ip LUCI_PKGARCH:=all PKG_NAME:=luci-app-unblockneteasemusic PKG_VERSION:=2.8 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_MAINTAINER:=[CTCGFW]Project-OpenWrt diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic index 71ec7a393e..efca9ac4f8 100755 --- a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic +++ b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic @@ -184,47 +184,52 @@ start() [ "${enable}" -ne "1" ] && exit 0 - sed -i '/unblockneteasemusic/d' /etc/crontabs/root - [ "${auto_update}" -eq "1" ] && echo "0 ${update_time} * * * /usr/share/unblockneteasemusic/update.sh update_core" >> "/etc/crontabs/root" - echo "*/5 * * * * /usr/share/unblockneteasemusic/log_check.sh" >> "/etc/crontabs/root" + sed -i "/$NAME/d" /etc/crontabs/root + [ "${auto_update}" -eq "1" ] && echo "0 ${update_time} * * * /usr/share/$NAME/update.sh update_core" >> "/etc/crontabs/root" + echo "*/5 * * * * /usr/share/$NAME/log_check.sh" >> "/etc/crontabs/root" /etc/init.d/cron restart > "/dev/null" 2>&1 - [ ! -e "/usr/share/unblockneteasemusic/core/app.js" ] && { rm -f "/usr/share/unblockneteasemusic/local_ver"; bash "/usr/share/unblockneteasemusic/update.sh" "update_core_non_restart"; } - [ ! -e "/usr/share/unblockneteasemusic/core/app.js" ] && { echo "Core Not Found, please download it before starting." >> "/tmp/unblockneteasemusic.log"; exit 1; } + [ ! -e "/usr/share/$NAME/core/app.js" ] && { rm -f "/usr/share/$NAME/local_ver"; bash "/usr/share/$NAME/update.sh" "update_core_non_restart"; } + [ ! -e "/usr/share/$NAME/core/app.js" ] && { echo "Core Not Found, please download it before starting." >> "/tmp/$NAME.log"; exit 1; } [ "${use_remote_qq_server}" -ne "1" ] && qq_server_mode="local" || qq_server_mode="remote" - bash "/usr/share/unblockneteasemusic/gen_remote_qq_server.sh" "${qq_server_mode}" "${enable_flac}" > "/usr/share/unblockneteasemusic/core/src/provider/qq.js" + bash "/usr/share/$NAME/gen_qq_provider.sh" "${qq_server_mode}" "${enable_flac}" > "/usr/share/$NAME/core/src/provider/qq.js" [ -n "${neteasemusic_cookie}" ] && { - ub_cookie_line="$(sed -n -e "/netease.path.includes('song\/enhance')/=" "/usr/share/unblockneteasemusic/core/src/hook.js")"; - [ -n "${ub_cookie_line}" ] && { let ub_cookie_endline="ub_cookie_line+6"; sed -i "${ub_cookie_line},${ub_cookie_endline}d" "/usr/share/unblockneteasemusic/core/src/hook.js"; } - sed -i "/netease.path == '\/api\/song\/enhance\/download\/url'/i\\\t\\t\\t\\tif (netease.path.includes('song\/enhance')) {" "/usr/share/unblockneteasemusic/core/src/hook.js" - sed -i "/if (netease.path.includes('song\/enhance')) {/a\\\t\\t\\t\\t\\treq.headers.cookie = [" "/usr/share/unblockneteasemusic/core/src/hook.js" - sed -i "/req.headers.cookie = \[/a\\\t\\t\\t\\t\\t\\t'MUSIC_U=${neteasemusic_cookie}'," "/usr/share/unblockneteasemusic/core/src/hook.js" - sed -i "/'MUSIC_U=${neteasemusic_cookie}',/a\\\t\\t\\t\\t\\t\\treq.headers.cookie.replace(\/\\\s*MUSIC_\\\w=[^\\\s;]+;*\/g, '')" "/usr/share/unblockneteasemusic/core/src/hook.js" - sed -i "/req.headers.cookie.replace(\/\\\s\\*MUSIC_\\\w=[^\\\s;]\\+/a\\\t\\t\\t\\t\\t].filter(line => line).join('; ')" "/usr/share/unblockneteasemusic/core/src/hook.js" - sed -i "/].filter(line => line).join('; ')/a\\\t\\t\\t\\t}\\n" "/usr/share/unblockneteasemusic/core/src/hook.js" + ub_cookie_line="$(sed -n -e "/netease.path.includes('song\/enhance')/=" "/usr/share/$NAME/core/src/hook.js")"; + [ -n "${ub_cookie_line}" ] && { let ub_cookie_endline="ub_cookie_line+6"; sed -i "${ub_cookie_line},${ub_cookie_endline}d" "/usr/share/$NAME/core/src/hook.js"; } + sed -i "/netease.path == '\/api\/song\/enhance\/download\/url'/i\\\t\\t\\t\\tif (netease.path.includes('song\/enhance')) {" "/usr/share/$NAME/core/src/hook.js" + sed -i "/if (netease.path.includes('song\/enhance')) {/a\\\t\\t\\t\\t\\treq.headers.cookie = [" "/usr/share/$NAME/core/src/hook.js" + sed -i "/req.headers.cookie = \[/a\\\t\\t\\t\\t\\t\\t'MUSIC_U=${neteasemusic_cookie}'," "/usr/share/$NAME/core/src/hook.js" + sed -i "/'MUSIC_U=${neteasemusic_cookie}',/a\\\t\\t\\t\\t\\t\\treq.headers.cookie.replace(\/\\\s*MUSIC_\\\w=[^\\\s;]+;*\/g, '')" "/usr/share/$NAME/core/src/hook.js" + sed -i "/req.headers.cookie.replace(\/\\\s\\*MUSIC_\\\w=[^\\\s;]\\+/a\\\t\\t\\t\\t\\t].filter(line => line).join('; ')" "/usr/share/$NAME/core/src/hook.js" + sed -i "/].filter(line => line).join('; ')/a\\\t\\t\\t\\t}\\n" "/usr/share/$NAME/core/src/hook.js" } - quality_check_line="$(awk "/target == 0 \|\| item.id == target/{print NR}" "/usr/share/unblockneteasemusic/core/src/hook.js")" - sed -i "${quality_check_line}d" "/usr/share/unblockneteasemusic/core/src/hook.js" + quality_check_line="$(awk "/target == 0 \|\| item.id == target/{print NR}" "/usr/share/$NAME/core/src/hook.js")" + sed -i "${quality_check_line}d" "/usr/share/$NAME/core/src/hook.js" if [ "${replace_music_source}" = "dont_replace" ]; then - sed -i -e "${quality_check_line}i \\\t\\tif ((item.code != 200 || item.freeTrialInfo) && (target == 0 || item.id == target)) {" "/usr/share/unblockneteasemusic/core/src/hook.js" + sed -i -e "${quality_check_line}i \\\t\\tif ((item.code != 200 || item.freeTrialInfo) && (target == 0 || item.id == target)) {" "/usr/share/$NAME/core/src/hook.js" elif [ "${replace_music_source}" = "lower_than_192kbps" ]; then - sed -i -e "${quality_check_line}i \\\t\\tif ((item.code != 200 || item.freeTrialInfo || item.br < 192000) && (target == 0 || item.id == target)) {" "/usr/share/unblockneteasemusic/core/src/hook.js" + sed -i -e "${quality_check_line}i \\\t\\tif ((item.code != 200 || item.freeTrialInfo || item.br < 192000) && (target == 0 || item.id == target)) {" "/usr/share/$NAME/core/src/hook.js" elif [ "${replace_music_source}" = "lower_than_320kbps" ]; then - sed -i -e "${quality_check_line}i \\\t\\tif ((item.code != 200 || item.freeTrialInfo || item.br < 320000) && (target == 0 || item.id == target)) {" "/usr/share/unblockneteasemusic/core/src/hook.js" + sed -i -e "${quality_check_line}i \\\t\\tif ((item.code != 200 || item.freeTrialInfo || item.br < 320000) && (target == 0 || item.id == target)) {" "/usr/share/$NAME/core/src/hook.js" elif [ "${replace_music_source}" = "lower_than_999kbps" ]; then - sed -i -e "${quality_check_line}i \\\t\\tif ((item.code != 200 || item.freeTrialInfo || item.br < 999000) && (target == 0 || item.id == target)) {" "/usr/share/unblockneteasemusic/core/src/hook.js" + sed -i -e "${quality_check_line}i \\\t\\tif ((item.code != 200 || item.freeTrialInfo || item.br < 999000) && (target == 0 || item.id == target)) {" "/usr/share/$NAME/core/src/hook.js" elif [ "${replace_music_source}" = "replace_all" ]; then - sed -i -e "${quality_check_line}i \\\t\\tif (target == 0 || item.id == target) {" "/usr/share/unblockneteasemusic/core/src/hook.js" + sed -i -e "${quality_check_line}i \\\t\\tif (target == 0 || item.id == target) {" "/usr/share/$NAME/core/src/hook.js" fi - { [ -f "${self_issue_cert_crt}" ] && [ -f "${self_issue_cert_key}" ]; } && { ln -sf "${self_issue_cert_crt}" "/usr/share/unblockneteasemusic/core/server.crt"; ln -sf "${self_issue_cert_key}" "/usr/share/unblockneteasemusic/core/server.key"; } + { [ -f "${self_issue_cert_crt}" ] && [ -f "${self_issue_cert_key}" ]; } && { + { [ "${self_issue_cert_crt}" != "/usr/share/$NAME/core/server.crt" ] && [ "${self_issue_cert_key}" != "/usr/share/$NAME/core/server.key" ]; } && { + ln -sf "${self_issue_cert_crt}" "/usr/share/$NAME/core/server.crt" + ln -sf "${self_issue_cert_key}" "/usr/share/$NAME/core/server.key" + } + } [ "${hijack_ways}" = "use_hosts" ] && { http_port="80"; https_port="443"; } [ "${music_source}" = "default" ] && music_source="" || music_source="-o ${music_source}" - nohup node "/usr/share/unblockneteasemusic/core/app.js" -a "${addr}" -p "${http_port}":"${https_port}" ${music_source} -e "${endpoint_url}" ${netease_server_ip} ${proxy_server_ip} ${strict_mode} >> "/tmp/$NAME.log" 2>&1 & + nohup node "/usr/share/$NAME/core/app.js" -a "${addr}" -p "${http_port}":"${https_port}" ${music_source} -e "${endpoint_url}" ${netease_server_ip} ${proxy_server_ip} ${strict_mode} >> "/tmp/$NAME.log" 2>&1 & set_type="start" if [ "${hijack_ways}" = "use_ipset" ]; then @@ -237,16 +242,24 @@ start() stop() { - { ps |grep "unblockneteasemusic" |grep "app.js" |grep -v "grep" |awk '{print $1}' |xargs kill -9; } > "/dev/null" 2>&1 + { ps |grep "$NAME" |grep "app.js" |grep -v "grep" |awk '{print $1}' |xargs kill -9; } > "/dev/null" 2>&1 - sed -i '/unblockneteasemusic/d' "/etc/crontabs/root" + sed -i "/$NAME/d" "/etc/crontabs/root" /etc/init.d/cron restart > "/dev/null" 2>&1 [ ! -f "${UPGRADE_CONF}" ] && touch "${UPGRADE_CONF}" - sed -i '/unblockneteasemusic\/core/d;/unblockneteasemusic\/local_ver/d' "${UPGRADE_CONF}" - [ "${keep_core_when_upgrade}" -eq "1" ] && { echo "/usr/share/unblockneteasemusic/core/" >> "${UPGRADE_CONF}"; echo "/usr/share/unblockneteasemusic/local_ver" >> "${UPGRADE_CONF}"; } - [ -f "${self_issue_cert_crt}" ] && { sed -i "/${self_issue_cert_crt//\//\\/}/d"; echo "${self_issue_cert_crt}" >> "${UPGRADE_CONF}"; } - [ -f "${self_issue_cert_key}" ] && { sed -i "/${self_issue_cert_key//\//\\/}/d"; echo "${self_issue_cert_key}" >> "${UPGRADE_CONF}"; } + sed -i "/$NAME\/core/d;/$NAME\/local_ver/d" "${UPGRADE_CONF}" + [ "${keep_core_when_upgrade}" -eq "1" ] && { echo "/usr/share/$NAME/core/" >> "${UPGRADE_CONF}"; echo "/usr/share/$NAME/local_ver" >> "${UPGRADE_CONF}"; } + + { [ -f "${self_issue_cert_crt}" ] && [ -f "${self_issue_cert_key}" ]; } && { + { [ "${self_issue_cert_crt}" != "/usr/share/$NAME/core/server.crt" ] && [ "${self_issue_cert_key}" != "/usr/share/$NAME/core/server.key" ]; } && { + sed -i "/${self_issue_cert_crt//\//\\/}/d" + echo "${self_issue_cert_crt}" >> "${UPGRADE_CONF}" + + sed -i "/${self_issue_cert_key//\//\\/}/d" + echo "${self_issue_cert_key}" >> "${UPGRADE_CONF}" + } + } rm -f "/tmp/$NAME.log" diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/gen_remote_qq_server.sh b/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/gen_qq_provider.sh similarity index 71% rename from package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/gen_remote_qq_server.sh rename to package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/gen_qq_provider.sh index c015762317..e8fae9dbaf 100755 --- a/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/gen_remote_qq_server.sh +++ b/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/gen_qq_provider.sh @@ -2,20 +2,16 @@ # Created By [CTCGFW]Project OpenWRT # https://github.com/project-openwrt -if [ "$1" == "local" ] -then echo -e "// local_mode -const cache = require('../cache') +header="const cache = require('../cache') const insure = require('./insure') const select = require('./select') const request = require('../request') const headers = { - 'origin': 'http://y.qq.com/', - 'referer': 'http://y.qq.com/', - 'cookie': process.env.QQ_COOKIE || null // 'uin=; qm_keyst=', -} + 'origin': 'http://y.qq.com/', + 'referer': 'http://y.qq.com/'," -const playable = song => { +body="const playable = song => { const switchFlag = song['switch'].toString(2).split('') switchFlag.pop() switchFlag.reverse() @@ -36,7 +32,7 @@ const search = info => { const url = 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp?' + 'ct=24&qqmusic_ver=1298&new_json=1&remoteplace=txt.yqq.center&' + - 't=0&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=1&n=20&w=' + 't=0&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=1&n=20&w=' + encodeURIComponent(info.keyword) + '&' + 'g_tk=5381&jsonpCallback=MusicJsonCallback10005317669353331&loginUin=0&hostUin=0&' + 'format=jsonp&inCharset=utf8&outCharset=utf-8¬ice=0&platform=yqq&needNewCode=0' @@ -48,8 +44,16 @@ const search = info => { const matched = select(list, info) return matched ? matched.id : Promise.reject() }) +}" + +if [ "$1" == "local" ] +then echo -e "// local_mode +${header} + 'cookie': process.env.QQ_COOKIE || null // 'uin=; qm_keyst=', } +${body} + const single = (id, format) => { const uin = ((headers.cookie || '').match(/uin=(\d+)/) || [])[1] || '0' @@ -101,51 +105,11 @@ module.exports = {check, track}" elif [ "$1" == "remote" ] then [ "$2" == "1" ] && { flac_quality="'flac', "; loop_times="4"; } || loop_times="3" echo -e "// remote_mode -const cache = require('../cache') -const insure = require('./insure') -const select = require('./select') -const request = require('../request') - -const headers = { - 'origin': 'http://y.qq.com/', - 'referer': 'http://y.qq.com/', +${header} 'cookie': null } -const playable = song => { - const switchFlag = song['switch'].toString(2).split('') - switchFlag.pop() - switchFlag.reverse() - const playFlag = switchFlag[0] - const tryFlag = switchFlag[13] - return ((playFlag == 1) || ((playFlag == 1) && (tryFlag == 1))) -} - -const format = song => ({ - id: {song: song.mid, file: song.file.media_mid}, - name: song.name, - duration: song.interval * 1000, - album: {id: song.album.mid, name: song.album.name}, - artists: song.singer.map(({mid, name}) => ({id: mid, name})) -}) - -const search = info => { - const url = - 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp?' + - 'ct=24&qqmusic_ver=1298&new_json=1&remoteplace=txt.yqq.center&' + - 't=0&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=1&n=20&w=' + - encodeURIComponent(info.keyword) + '&' + - 'g_tk=5381&jsonpCallback=MusicJsonCallback10005317669353331&loginUin=0&hostUin=0&' + - 'format=jsonp&inCharset=utf8&outCharset=utf-8¬ice=0&platform=yqq&needNewCode=0' - - return request('GET', url) - .then(response => response.jsonp()) - .then(jsonBody => { - const list = jsonBody.data.song.list.map(format) - const matched = select(list, info) - return matched ? matched.id : Promise.reject() - }) -} +${body} const track = id => { const typeObj = [${flac_quality}'320', '128', 'm4a'] @@ -164,7 +128,7 @@ const track = id => { if (res === 100) { let songUrl = jsonBody.data return songUrl - } else if (i === 3) { + } else if (i === $[${loop_times}-1]) { return Promise.reject() } else { return diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/log_check.sh b/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/log_check.sh index 74bb2fd290..4d51a68b00 100755 --- a/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/log_check.sh +++ b/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/log_check.sh @@ -2,10 +2,12 @@ # Created By [CTCGFW]Project OpenWRT # https://github.com/project-openwrt +NAME="unblockneteasemusic" + log_max_size="4" #使用KB计算 -log_file="/tmp/unblockneteasemusic.log" +log_file="/tmp/$NAME.log" (( log_size = "$(ls -l "${log_file}" | awk -F ' ' '{print $5}')" / "1024" )) (( "${log_size}" >= "${log_max_size}" )) && echo "" > "${log_file}" -[ "*$(uci get unblockneteasemusic.@unblockneteasemusic[0].daemon_enable 2>/dev/null)*" == "*1*" ] && { [ -z "$(ps |grep "unblockneteasemusic" |grep "app.js" |grep -v "grep")" ] && /etc/init.d/unblockneteasemusic restart; } \ No newline at end of file +[ "*$(uci get $NAME.@$NAME[0].daemon_enable 2>/dev/null)*" == "*1*" ] && { [ -z "$(ps |grep "$NAME" |grep "app.js" |grep -v "grep")" ] && /etc/init.d/$NAME restart; } diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/update.sh b/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/update.sh index 986d8ae098..1ad10f4aee 100755 --- a/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/update.sh +++ b/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/update.sh @@ -2,36 +2,38 @@ # Created By [CTCGFW]Project OpenWRT # https://github.com/project-openwrt +NAME="unblockneteasemusic" + function check_core_if_already_running(){ - running_tasks="$(ps |grep "unblockneteasemusic" |grep "update.sh" |grep "update_core" |grep -v "grep" |awk '{print $1}' |wc -l)" - [ "${running_tasks}" -gt "2" ] && { echo -e "\nA task is already running." >> "/tmp/unblockneteasemusic.log"; exit 2; } + running_tasks="$(ps |grep "$NAME" |grep "update.sh" |grep "update_core" |grep -v "grep" |awk '{print $1}' |wc -l)" + [ "${running_tasks}" -gt "2" ] && { echo -e "\nA task is already running." >> "/tmp/$NAME.log"; exit 2; } } function check_luci_if_already_running(){ - running_tasks="$(ps |grep "unblockneteasemusic" |grep "update.sh" |grep "update_luci" |grep -v "grep" |awk '{print $1}' |wc -l)" - [ "${running_tasks}" -gt "2" ] && { echo -e "\nA task is already running." >> "/tmp/unblockneteasemusic.log"; exit 2; } + running_tasks="$(ps |grep "$NAME" |grep "update.sh" |grep "update_luci" |grep -v "grep" |awk '{print $1}' |wc -l)" + [ "${running_tasks}" -gt "2" ] && { echo -e "\nA task is already running." >> "/tmp/$NAME.log"; exit 2; } } function clean_log(){ - echo "" > "/tmp/unblockneteasemusic.log" + echo "" > "/tmp/$NAME.log" } function check_luci_latest_version(){ luci_latest_ver="$(curl -s 'https://github.com/project-openwrt/luci-app-unblockneteasemusic/releases/latest'| grep -Eo '[0-9\.]+\-[0-9]+')" - [ -z "${luci_latest_ver}" ] && { echo -e "\nFailed to check latest LuCI version, please try again later." >> "/tmp/unblockneteasemusic.log"; exit 1; } + [ -z "${luci_latest_ver}" ] && { echo -e "\nFailed to check latest LuCI version, please try again later." >> "/tmp/$NAME.log"; exit 1; } if [ "$(opkg info "luci-app-unblockneteasemusic" |sed -n "2p" |tr -d "Version: ")" != "${luci_latest_ver}" ]; then clean_log - echo -e "Local LuCI version: $(opkg info "luci-app-unblockneteasemusic" |sed -n "2p" |tr -d "Version: "), cloud LuCI version: ${luci_latest_ver}." >> "/tmp/unblockneteasemusic.log" + echo -e "Local LuCI version: $(opkg info "luci-app-unblockneteasemusic" |sed -n "2p" |tr -d "Version: "), cloud LuCI version: ${luci_latest_ver}." >> "/tmp/$NAME.log" update_luci else - echo -e "\nLocal LuCI version: $(opkg info "luci-app-unblockneteasemusic" |sed -n "2p" |tr -d "Version: "), cloud LuCI version: ${luci_latest_ver}." >> "/tmp/unblockneteasemusic.log" - echo -e "You're already using the latest LuCI version." >> "/tmp/unblockneteasemusic.log" + echo -e "\nLocal LuCI version: $(opkg info "luci-app-unblockneteasemusic" |sed -n "2p" |tr -d "Version: "), cloud LuCI version: ${luci_latest_ver}." >> "/tmp/$NAME.log" + echo -e "You're already using the latest LuCI version." >> "/tmp/$NAME.log" exit 3 fi } function update_luci(){ - echo -e "Updating LuCI..." >> "/tmp/unblockneteasemusic.log" + echo -e "Updating LuCI..." >> "/tmp/$NAME.log" mkdir -p "/tmp" > "/dev/null" 2>&1 @@ -41,59 +43,59 @@ function update_luci(){ rm -rf "/tmp/luci-indexcache" "/tmp/luci-modulecache" if [ "$(opkg info 'luci-app-unblockneteasemusic' |sed -n '2p' |tr -d 'Version: ')" != "${luci_latest_ver}" ]; then - echo -e "Failed to update LuCI." >> "/tmp/unblockneteasemusic.log" + echo -e "Failed to update LuCI." >> "/tmp/$NAME.log" exit 1 else - touch "/usr/share/unblockneteasemusic/update_luci_successfully" + touch "/usr/share/$NAME/update_luci_successfully" /etc/init.d/firewall restart > "/dev/null" 2>&1 fi - echo -e "Succeeded in updating LuCI." > "/tmp/unblockneteasemusic.log" - echo -e "Current LuCI version: ${luci_latest_ver}.\n" >> "/tmp/unblockneteasemusic.log" + echo -e "Succeeded in updating LuCI." > "/tmp/$NAME.log" + echo -e "Current LuCI version: ${luci_latest_ver}.\n" >> "/tmp/$NAME.log" } function check_core_latest_version(){ core_latest_ver="$(curl -s https://github.com/nondanee/UnblockNeteaseMusic/commits/master |tr -d '\n' |grep -Eo 'commit\/[0-9a-z]+' |sed -n 1p |sed 's#commit/##g')" - [ -z "${core_latest_ver}" ] && { echo -e "\nFailed to check latest core version, please try again later." >> "/tmp/unblockneteasemusic.log"; exit 1; } - if [ ! -e "/usr/share/unblockneteasemusic/core_local_ver" ]; then + [ -z "${core_latest_ver}" ] && { echo -e "\nFailed to check latest core version, please try again later." >> "/tmp/$NAME.log"; exit 1; } + if [ ! -e "/usr/share/$NAME/core_local_ver" ]; then clean_log - echo -e "Local version: NOT FOUND, cloud version: ${core_latest_ver}." >> "/tmp/unblockneteasemusic.log" + echo -e "Local version: NOT FOUND, cloud version: ${core_latest_ver}." >> "/tmp/$NAME.log" update_core else - if [ "$(cat /usr/share/unblockneteasemusic/core_local_ver)" != "${core_latest_ver}" ]; then + if [ "$(cat /usr/share/$NAME/core_local_ver)" != "${core_latest_ver}" ]; then clean_log - echo -e "Local core version: $(cat /usr/share/unblockneteasemusic/core_local_ver 2>"/dev/null"), cloud core version: ${core_latest_ver}." >> "/tmp/unblockneteasemusic.log" + echo -e "Local core version: $(cat /usr/share/$NAME/core_local_ver 2>"/dev/null"), cloud core version: ${core_latest_ver}." >> "/tmp/$NAME.log" update_core else - echo -e "\nLocal core version: $(cat /usr/share/unblockneteasemusic/core_local_ver 2>"/dev/null"), cloud core version: ${core_latest_ver}." >> "/tmp/unblockneteasemusic.log" - echo -e "You're already using the latest core version." >> "/tmp/unblockneteasemusic.log" + echo -e "\nLocal core version: $(cat /usr/share/$NAME/core_local_ver 2>"/dev/null"), cloud core version: ${core_latest_ver}." >> "/tmp/$NAME.log" + echo -e "You're already using the latest core version." >> "/tmp/$NAME.log" exit 3 fi fi } function update_core(){ - echo -e "Updating core..." >> "/tmp/unblockneteasemusic.log" + echo -e "Updating core..." >> "/tmp/$NAME.log" - mkdir -p "/usr/share/unblockneteasemusic/core" > "/dev/null" 2>&1 - rm -rf /usr/share/unblockneteasemusic/core/* > "/dev/null" 2>&1 + mkdir -p "/usr/share/$NAME/core" > "/dev/null" 2>&1 + rm -rf /usr/share/$NAME/core/* > "/dev/null" 2>&1 - curl -sL "https://github.com/nondanee/UnblockNeteaseMusic/archive/master.tar.gz" -o "/usr/share/unblockneteasemusic/core/core.tar.gz" > "/dev/null" 2>&1 - tar -zxf "/usr/share/unblockneteasemusic/core/core.tar.gz" -C "/usr/share/unblockneteasemusic/core/" > "/dev/null" 2>&1 - mv /usr/share/unblockneteasemusic/core/UnblockNeteaseMusic-master/* "/usr/share/unblockneteasemusic/core/" - rm -rf "/usr/share/unblockneteasemusic/core/core.tar.gz" "/usr/share/unblockneteasemusic/core/UnblockNeteaseMusic-master" > "/dev/null" 2>&1 + curl -sL "https://github.com/nondanee/UnblockNeteaseMusic/archive/master.tar.gz" -o "/usr/share/$NAME/core/core.tar.gz" > "/dev/null" 2>&1 + tar -zxf "/usr/share/$NAME/core/core.tar.gz" -C "/usr/share/$NAME/core/" > "/dev/null" 2>&1 + mv /usr/share/$NAME/core/UnblockNeteaseMusic-master/* "/usr/share/$NAME/core/" + rm -rf "/usr/share/$NAME/core/core.tar.gz" "/usr/share/$NAME/core/UnblockNeteaseMusic-master" > "/dev/null" 2>&1 - if [ ! -e "/usr/share/unblockneteasemusic/core/app.js" ]; then - echo -e "Failed to download core." >> "/tmp/unblockneteasemusic.log" + if [ ! -e "/usr/share/$NAME/core/app.js" ]; then + echo -e "Failed to download core." >> "/tmp/$NAME.log" exit 1 else - [ "${update_core_from_luci}" == "y" ] && touch "/usr/share/unblockneteasemusic/update_core_successfully" - echo -e "${core_latest_ver}" > "/usr/share/unblockneteasemusic/core_local_ver" - [ "${non_restart}" != "y" ] && /etc/init.d/unblockneteasemusic restart + [ "${update_core_from_luci}" == "y" ] && touch "/usr/share/$NAME/update_core_successfully" + echo -e "${core_latest_ver}" > "/usr/share/$NAME/core_local_ver" + [ "${non_restart}" != "y" ] && /etc/init.d/$NAME restart fi - echo -e "Succeeded in updating core." > "/tmp/unblockneteasemusic.log" - echo -e "Current core version: ${core_latest_ver}.\n" >> "/tmp/unblockneteasemusic.log" + echo -e "Succeeded in updating core." > "/tmp/$NAME.log" + echo -e "Current core version: ${core_latest_ver}.\n" >> "/tmp/$NAME.log" } case "$1" in From c841c4900a0e474dbfcb6a550299584c7f530a53 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 4 Oct 2020 00:04:53 +0800 Subject: [PATCH 5/5] luci-app-passwall: bump to 3.9-9-65 --- package/lienol/luci-app-passwall/Makefile | 4 +- .../luasrc/model/cbi/passwall/api/api.lua | 7 +- .../model/cbi/passwall/api/gen_v2ray.lua | 21 ++-- .../model/cbi/passwall/client/node_config.lua | 101 ++++++++++-------- .../model/cbi/passwall/server/api/v2ray.lua | 56 +++++++--- .../model/cbi/passwall/server/index.lua | 10 ++ .../luasrc/model/cbi/passwall/server/user.lua | 47 ++++---- .../luci-app-passwall/po/zh-cn/passwall.po | 7 +- 8 files changed, 155 insertions(+), 98 deletions(-) diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile index 38a616747b..c1097a4eea 100644 --- a/package/lienol/luci-app-passwall/Makefile +++ b/package/lienol/luci-app-passwall/Makefile @@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=3.9 -PKG_RELEASE:=64 -PKG_DATE:=20200925 +PKG_RELEASE:=65 +PKG_DATE:=20201003 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua index 6a44a4cf4b..2693c35c34 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua @@ -14,8 +14,11 @@ command_timeout = 300 LEDE_BOARD = nil DISTRIB_TARGET = nil -function gen_uuid() - local uuid = string.gsub(sys.exec("echo -n $(cat /proc/sys/kernel/random/uuid)"), "-", "") +function gen_uuid(format) + local uuid = sys.exec("echo -n $(cat /proc/sys/kernel/random/uuid)") + if format == nil then + uuid = string.gsub(uuid, "-", "") + end return uuid end diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua index e5e9278cda..5b5f0222bd 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua @@ -42,7 +42,7 @@ local function gen_outbound(node, tag) node.stream_security = "none" end - if node.transport == "mkcp" or node.transport == "ds" or node.transport == "quic" then + if node.transport == "mkcp" or node.transport == "quic" then node.stream_security = "none" end @@ -54,23 +54,26 @@ local function gen_outbound(node, tag) concurrency = (node.mux_concurrency) and tonumber(node.mux_concurrency) or 8 }, -- 底层传输配置 - streamSettings = (node.protocol == "vmess" or node.protocol == "vless" or node.protocol == "socks" or node.protocol == "shadowsocks") and { + streamSettings = (node.protocol == "vmess" or node.protocol == "vless" or node.protocol == "socks" or node.protocol == "shadowsocks" or node.protocol == "trojan") and { network = node.transport, security = node.stream_security, + xtlsSettings = (node.stream_security == "xtls") and { + serverName = node.tls_serverName, + allowInsecure = (node.tls_allowInsecure == "1") and true or false + } or nil, tlsSettings = (node.stream_security == "tls") and { - disableSessionResumption = node.sessionTicket ~= "1" and true or false, serverName = node.tls_serverName, allowInsecure = (node.tls_allowInsecure == "1") and true or false } or nil, tcpSettings = (node.transport == "tcp" and node.protocol ~= "socks") and { header = { type = node.tcp_guise, - request = { + request = (node.tcp_guise == "http") and { path = node.tcp_guise_http_path or {"/"}, headers = { Host = node.tcp_guise_http_host or {} } - } or {} + } or nil } } or nil, kcpSettings = (node.transport == "mkcp") and { @@ -110,19 +113,19 @@ local function gen_outbound(node, tag) id = node.uuid, alterId = tonumber(node.alter_id), level = node.level and tonumber(node.level) or 0, - security = node.security, - encryption = node.encryption or "none" + security = (node.protocol == "vmess") and node.security or nil, + encryption = node.encryption or "none", + flow = (node.stream_security == "xtls") and node.flow or nil } } } } or nil, - servers = (node.protocol == "socks" or node.protocol == "http" or node.protocol == "shadowsocks") and { + servers = (node.protocol == "socks" or node.protocol == "http" or node.protocol == "shadowsocks" or node.protocol == "trojan") and { { address = node.address, port = tonumber(node.port), method = node.method or nil, password = node.password or "", - ota = node.ota == '1' and true or false, users = (node.username and node.password) and {{user = node.username, pass = node.password}} or nil } diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua index c0165429a6..18e620a89d 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua @@ -106,6 +106,7 @@ protocol:value("vless", translate("VLESS")) protocol:value("http", translate("HTTP")) protocol:value("socks", translate("Socks")) protocol:value("shadowsocks", translate("Shadowsocks")) +protocol:value("trojan", translate("Trojan")) protocol:value("_balancing", translate("Balancing")) protocol:value("_shunt", translate("Shunt")) protocol:depends("type", "V2ray") @@ -176,16 +177,17 @@ address.rmempty = false address:depends("type", "Socks") address:depends("type", "SS") address:depends("type", "SSR") -address:depends({ type = "V2ray", protocol = "vmess" }) -address:depends({ type = "V2ray", protocol = "vless" }) -address:depends({ type = "V2ray", protocol = "http" }) -address:depends({ type = "V2ray", protocol = "socks" }) -address:depends({ type = "V2ray", protocol = "shadowsocks" }) address:depends("type", "Brook") address:depends("type", "Trojan") address:depends("type", "Trojan-Plus") address:depends("type", "Trojan-Go") address:depends("type", "Naiveproxy") +address:depends({ type = "V2ray", protocol = "vmess" }) +address:depends({ type = "V2ray", protocol = "vless" }) +address:depends({ type = "V2ray", protocol = "http" }) +address:depends({ type = "V2ray", protocol = "socks" }) +address:depends({ type = "V2ray", protocol = "shadowsocks" }) +address:depends({ type = "V2ray", protocol = "trojan" }) --[[ use_ipv6 = s:option(Flag, "use_ipv6", translate("Use IPv6")) @@ -193,15 +195,16 @@ use_ipv6.default = 0 use_ipv6:depends("type", "Socks") use_ipv6:depends("type", "SS") use_ipv6:depends("type", "SSR") +use_ipv6:depends("type", "Brook") +use_ipv6:depends("type", "Trojan") +use_ipv6:depends("type", "Trojan-Plus") +use_ipv6:depends("type", "Trojan-Go") use_ipv6:depends({ type = "V2ray", protocol = "vmess" }) use_ipv6:depends({ type = "V2ray", protocol = "vless" }) use_ipv6:depends({ type = "V2ray", protocol = "http" }) use_ipv6:depends({ type = "V2ray", protocol = "socks" }) use_ipv6:depends({ type = "V2ray", protocol = "shadowsocks" }) -use_ipv6:depends("type", "Brook") -use_ipv6:depends("type", "Trojan") -use_ipv6:depends("type", "Trojan-Plus") -use_ipv6:depends("type", "Trojan-Go") +use_ipv6:depends({ type = "V2ray", protocol = "trojan" }) --]] port = s:option(Value, "port", translate("Port")) @@ -210,22 +213,23 @@ port.rmempty = false port:depends("type", "Socks") port:depends("type", "SS") port:depends("type", "SSR") -port:depends({ type = "V2ray", protocol = "vmess" }) -port:depends({ type = "V2ray", protocol = "vless" }) -port:depends({ type = "V2ray", protocol = "http" }) -port:depends({ type = "V2ray", protocol = "socks" }) -port:depends({ type = "V2ray", protocol = "shadowsocks" }) port:depends("type", "Brook") port:depends("type", "Trojan") port:depends("type", "Trojan-Plus") port:depends("type", "Trojan-Go") port:depends("type", "Naiveproxy") +port:depends({ type = "V2ray", protocol = "vmess" }) +port:depends({ type = "V2ray", protocol = "vless" }) +port:depends({ type = "V2ray", protocol = "http" }) +port:depends({ type = "V2ray", protocol = "socks" }) +port:depends({ type = "V2ray", protocol = "shadowsocks" }) +port:depends({ type = "V2ray", protocol = "trojan" }) username = s:option(Value, "username", translate("Username")) username:depends("type", "Socks") username:depends("type", "Naiveproxy") -username:depends("protocol", "http") -username:depends("protocol", "socks") +username:depends({ type = "V2ray", protocol = "http" }) +username:depends({ type = "V2ray", protocol = "socks" }) password = s:option(Value, "password", translate("Password")) password.password = true @@ -237,9 +241,10 @@ password:depends("type", "Trojan") password:depends("type", "Trojan-Plus") password:depends("type", "Trojan-Go") password:depends("type", "Naiveproxy") -password:depends("protocol", "http") -password:depends("protocol", "socks") -password:depends("protocol", "shadowsocks") +password:depends({ type = "V2ray", protocol = "http" }) +password:depends({ type = "V2ray", protocol = "socks" }) +password:depends({ type = "V2ray", protocol = "shadowsocks" }) +password:depends({ type = "V2ray", protocol = "trojan" }) ss_encrypt_method = s:option(ListValue, "ss_encrypt_method", translate("Encrypt Method")) for a, t in ipairs(ss_encrypt_method_list) do ss_encrypt_method:value(t) end @@ -263,11 +268,11 @@ end security = s:option(ListValue, "security", translate("Encrypt Method")) for a, t in ipairs(security_list) do security:value(t) end -security:depends("protocol", "vmess") +security:depends({ type = "V2ray", protocol = "vmess" }) encryption = s:option(Value, "encryption", translate("Encrypt Method")) encryption.default = "none" -encryption:depends("protocol", "vless") +encryption:depends({ type = "V2ray", protocol = "vless" }) v_ss_encrypt_method = s:option(ListValue, "v_ss_encrypt_method", translate("Encrypt Method")) for a, t in ipairs(v_ss_encrypt_method_list) do v_ss_encrypt_method:value(t) end @@ -279,16 +284,6 @@ function v_ss_encrypt_method.write(self, section, value) m:set(section, "method", value) end -ss_ota = s:option(Flag, "ss_ota", translate("OTA"), translate("When OTA is enabled, V2Ray will reject connections that are not OTA enabled. This option is invalid when using AEAD encryption.")) -ss_ota.default = "0" -ss_ota:depends("protocol", "shadowsocks") -function ss_ota.cfgvalue(self, section) - return m:get(section, "ota") -end -function ss_ota.write(self, section, value) - m:set(section, "ota", value) -end - ssr_protocol = s:option(ListValue, "ssr_protocol", translate("Protocol")) for a, t in ipairs(ssr_protocol_list) do ssr_protocol:value(t) end ssr_protocol:depends("type", "SSR") @@ -367,25 +362,28 @@ kcp_opts:depends("use_kcp", "1") uuid = s:option(Value, "uuid", translate("ID")) uuid.password = true -uuid:depends("protocol", "vmess") -uuid:depends("protocol", "vless") +uuid:depends({ type = "V2ray", protocol = "vmess" }) +uuid:depends({ type = "V2ray", protocol = "vless" }) alter_id = s:option(Value, "alter_id", translate("Alter ID")) alter_id:depends("protocol", "vmess") level = s:option(Value, "level", translate("User Level")) level.default = 1 -level:depends("protocol", "vmess") -level:depends("protocol", "vless") +level:depends({ type = "V2ray", protocol = "vmess" }) +level:depends({ type = "V2ray", protocol = "vless" }) +level:depends({ type = "V2ray", protocol = "trojan" }) -stream_security = s:option(ListValue, "stream_security", translate("Transport Layer Encryption"), translate('Whether or not transport layer encryption is enabled, the supported options are "none" for unencrypted and "TLS" for using TLS.')) +stream_security = s:option(ListValue, "stream_security", translate("Transport Layer Encryption"), translate('Whether or not transport layer encryption is enabled, "none" for unencrypted, "tls" for using TLS, "xtls" for using XTLS.')) stream_security:value("none", "none") stream_security:value("tls", "tls") +stream_security:value("xtls", "xtls") stream_security.default = "tls" -stream_security:depends("protocol", "vmess") -stream_security:depends("protocol", "vless") -stream_security:depends("protocol", "socks") -stream_security:depends("protocol", "shadowsocks") +stream_security:depends({ type = "V2ray", protocol = "vmess" }) +stream_security:depends({ type = "V2ray", protocol = "vless" }) +stream_security:depends({ type = "V2ray", protocol = "socks" }) +stream_security:depends({ type = "V2ray", protocol = "shadowsocks" }) +stream_security:depends({ type = "V2ray", protocol = "trojan" }) stream_security:depends("type", "Trojan") stream_security:depends("type", "Trojan-Plus") stream_security:depends("type", "Trojan-Go") @@ -396,10 +394,18 @@ stream_security.validate = function(self, value) return value end +flow = s:option(Value, "flow", translate("flow")) +flow.default = "xtls-rprx-origin" +flow:value("xtls-rprx-origin") +flow:value("xtls-rprx-origin-udp443") +flow:depends("stream_security", "xtls") + -- [[ TLS部分 ]] -- tls_sessionTicket = s:option(Flag, "tls_sessionTicket", translate("Session Ticket")) tls_sessionTicket.default = "0" -tls_sessionTicket:depends("stream_security", "tls") +tls_sessionTicket:depends({ type = "Trojan", stream_security = "tls" }) +tls_sessionTicket:depends({ type = "Trojan-Plus", stream_security = "tls" }) +tls_sessionTicket:depends({ type = "Trojan-Go", stream_security = "tls" }) -- [[ Trojan TLS ]]-- trojan_force_fp = s:option(ListValue, "fingerprint", translate("Finger Print")) @@ -409,10 +415,12 @@ trojan_force_fp:depends({ type = "Trojan-Go", stream_security = "tls" }) tls_serverName = s:option(Value, "tls_serverName", translate("Domain")) tls_serverName:depends("stream_security", "tls") +tls_serverName:depends("stream_security", "xtls") tls_allowInsecure = s:option(Flag, "tls_allowInsecure", translate("allowInsecure"), translate("Whether unsafe connections are allowed. When checked, Certificate validation will be skipped.")) tls_allowInsecure.default = "0" tls_allowInsecure:depends("stream_security", "tls") +tls_allowInsecure:depends("stream_security", "xtls") -- [[ Trojan Cert ]]-- trojan_cert_path = s:option(Value, "trojan_cert_path", translate("Trojan Cert Path")) @@ -456,17 +464,18 @@ transport:value("ws", "WebSocket") transport:value("h2", "HTTP/2") transport:value("ds", "DomainSocket") transport:value("quic", "QUIC") -transport:depends("protocol", "vmess") -transport:depends("protocol", "vless") -transport:depends("protocol", "socks") -transport:depends("protocol", "shadowsocks") +transport:depends({ type = "V2ray", protocol = "vmess" }) +transport:depends({ type = "V2ray", protocol = "vless" }) +transport:depends({ type = "V2ray", protocol = "socks" }) +transport:depends({ type = "V2ray", protocol = "shadowsocks" }) +transport:depends({ type = "V2ray", protocol = "trojan" }) --[[ ss_transport = s:option(ListValue, "ss_transport", translate("Transport")) ss_transport:value("ws", "WebSocket") ss_transport:value("h2", "HTTP/2") ss_transport:value("h2+ws", "HTTP/2 & WebSocket") -ss_transport:depends("protocol", "shadowsocks") +ss_transport:depends({ type = "V2ray", protocol = "shadowsocks" }) ]]-- -- [[ TCP部分 ]]-- diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/v2ray.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/v2ray.lua index 924512ebfc..1a974c4fc6 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/v2ray.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/v2ray.lua @@ -14,6 +14,7 @@ function gen_config(user) for i = 1, #user.uuid do clients[i] = { id = user.uuid[i], + flow = (user.stream_security == "xtls") and user.flow or nil, level = tonumber(user.level), alterId = tonumber(user.alter_id) } @@ -48,9 +49,21 @@ function gen_config(user) method = user.method, password = user.password, level = tonumber(user.level) or 1, - network = user.ss_network or "TCP,UDP", - ota = (user.ss_ota == '1') and true or false + network = user.ss_network or "TCP,UDP" } + elseif user.protocol == "trojan" then + if user.uuid then + local clients = {} + for i = 1, #user.uuid do + clients[i] = { + password = user.uuid[i], + level = tonumber(user.level) + } + end + settings = { + clients = clients + } + end elseif user.protocol == "mtproto" then settings = { users = { @@ -76,7 +89,7 @@ function gen_config(user) if user.transit_node and user.transit_node ~= "nil" then local node = ucic:get_all("passwall", user.transit_node) if node and node ~= "nil" and node.type and node.type == "V2ray" then - if node.transport == "mkcp" or node.transport == "ds" or node.transport == "quic" then + if node.transport == "mkcp" or node.transport == "quic" then node.stream_security = "none" end local transit_node = { @@ -90,6 +103,10 @@ function gen_config(user) streamSettings = { network = node.transport, security = node.stream_security, + xtlsSettings = (node.stream_security == "xtls") and { + serverName = node.tls_serverName, + allowInsecure = (node.tls_allowInsecure == "1") and true or false + } or nil, tlsSettings = (node.stream_security == "tls") and { disableSessionResumption = node.sessionTicket ~= "1" and true or false, serverName = node.tls_serverName, @@ -98,12 +115,12 @@ function gen_config(user) tcpSettings = (node.transport == "tcp") and { header = { type = node.tcp_guise, - request = { + request = (node.tcp_guise == "http") and { path = node.tcp_guise_http_path or {"/"}, headers = { Host = node.tcp_guise_http_host or {} } - } or {} + } or nil } } or nil, kcpSettings = (node.transport == "mkcp") and { @@ -143,19 +160,19 @@ function gen_config(user) id = node.uuid, alterId = tonumber(node.alter_id), level = node.level and tonumber(node.level) or 0, - security = node.security, - encryption = node.encryption or "none" + security = (node.protocol == "vmess") and node.security or nil, + encryption = node.encryption or "none", + flow = (node.stream_security == "xtls") and node.flow or nil } } } } or nil, - servers = (node.protocol == "http" or node.protocol == "socks" or node.protocol == "shadowsocks") and { + servers = (node.protocol == "http" or node.protocol == "socks" or node.protocol == "shadowsocks" or node.protocol == "trojan") and { { address = node.address, port = tonumber(node.port), method = node.v_ss_encrypt_method, password = node.password or "", - ota = (node.ss_ota == '1') and true or false, users = (node.username and node.password) and { { @@ -185,10 +202,18 @@ function gen_config(user) settings = settings, streamSettings = { network = user.transport, - security = (user.stream_security == 'tls') and "tls" or "none", + security = user.stream_security, + xtlsSettings = (user.stream_security == 'xtls') and { + --alpn = {"http/1.1"}, + disableSystemRoot = false, + certificates = { + { + certificateFile = user.tls_certificateFile, + keyFile = user.tls_keyFile + } + } + } or nil, tlsSettings = (user.stream_security == 'tls') and { - disableSessionResumption = user.sessionTicket ~= "1" and true or false, - allowInsecure = false, disableSystemRoot = false, certificates = { { @@ -200,12 +225,12 @@ function gen_config(user) tcpSettings = (user.transport == "tcp") and { header = { type = user.tcp_guise, - request = { + request = (user.tcp_guise == "http") and { path = user.tcp_guise_http_path or {"/"}, headers = { Host = user.tcp_guise_http_host or {} } - } or {} + } or nil } } or nil, kcpSettings = (user.transport == "mkcp") and { @@ -220,6 +245,7 @@ function gen_config(user) header = {type = user.mkcp_guise} } or nil, wsSettings = (user.transport == "ws") and { + acceptProxyProtocol = false, headers = (user.ws_host) and {Host = user.ws_host} or nil, path = user.ws_path } or nil, @@ -242,7 +268,7 @@ function gen_config(user) routing = routing } - if user.transport == "mkcp" or user.transport == "ds" or user.transport == "quic" then + if user.transport == "mkcp" or user.transport == "quic" then config.inbounds[1].streamSettings.security = "none" config.inbounds[1].streamSettings.tlsSettings = nil end diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua index 905588edda..2825a30fb7 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua @@ -44,6 +44,16 @@ e.width = "15%" ---- Type e = t:option(DummyValue, "type", translate("Type")) +e.cfgvalue = function(t, n) + local v = Value.cfgvalue(t, n) + if v then + if v == "V2ray" then + local protocol = m:get(n, "protocol") + return v .. " -> " .. protocol + end + return v + end +end e = t:option(DummyValue, "port", translate("Port")) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua index 32d9a0a61a..75bcb5479b 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua @@ -102,6 +102,7 @@ protocol:value("vless", "VLESS") protocol:value("http", "HTTP") protocol:value("socks", "Socks") protocol:value("shadowsocks", "Shadowsocks") +protocol:value("trojan", "Trojan") protocol:value("mtproto", "MTProto") protocol:depends("type", "V2ray") @@ -133,9 +134,9 @@ username.validate = function(self, value, t) end return value end -username:depends("protocol", "http") -username:depends("protocol", "socks") username:depends("type", "Socks") +username:depends({ type = "V2ray", protocol = "http" }) +username:depends({ type = "V2ray", protocol = "socks" }) password = s:option(Value, "password", translate("Password")) password.password = true @@ -169,7 +170,7 @@ end decryption = s:option(Value, "decryption", translate("Encrypt Method")) decryption.default = "none" -decryption:depends("protocol", "vless") +decryption:depends({ type = "V2ray", protocol = "vless" }) ss_encrypt_method = s:option(ListValue, "ss_encrypt_method", translate("Encrypt Method")) for a, t in ipairs(ss_encrypt_method_list) do ss_encrypt_method:value(t) end @@ -193,7 +194,7 @@ end v_ss_encrypt_method = s:option(ListValue, "v_ss_encrypt_method", translate("Encrypt Method")) for a, t in ipairs(v_ss_encrypt_method_list) do v_ss_encrypt_method:value(t) end -v_ss_encrypt_method:depends("protocol", "shadowsocks") +v_ss_encrypt_method:depends({ type = "V2ray", protocol = "shadowsocks" }) function v_ss_encrypt_method.cfgvalue(self, section) return m:get(section, "method") end @@ -206,17 +207,7 @@ ss_network.default = "tcp,udp" ss_network:value("tcp", "TCP") ss_network:value("udp", "UDP") ss_network:value("tcp,udp", "TCP,UDP") -ss_network:depends("protocol", "shadowsocks") - -ss_ota = s:option(Flag, "ss_ota", translate("OTA"), translate("When OTA is enabled, a connection that is not OTA enabled is rejected. This option is invalid when using AEAD encryption.")) -ss_ota.default = "0" -ss_ota:depends("protocol", "shadowsocks") -function ss_ota.cfgvalue(self, section) - return m:get(section, "ota") -end -function ss_ota.write(self, section, value) - m:set(section, "ota", value) -end +ss_network:depends({ type = "V2ray", protocol = "shadowsocks" }) ssr_protocol = s:option(ListValue, "ssr_protocol", translate("Protocol")) for a, t in ipairs(ssr_protocol_list) do ssr_protocol:value(t) end @@ -258,12 +249,13 @@ udp_forward.default = "1" udp_forward.rmempty = false udp_forward:depends("type", "SSR") -uuid = s:option(DynamicList, "uuid", translate("ID")) +uuid = s:option(DynamicList, "uuid", translate("ID") .. "/" .. translate("Password")) for i = 1, 3 do - uuid:value(api.gen_uuid()) + uuid:value(api.gen_uuid(1)) end uuid:depends({ type = "V2ray", protocol = "vmess" }) uuid:depends({ type = "V2ray", protocol = "vless" }) +uuid:depends({ type = "V2ray", protocol = "trojan" }) uuid:depends("type", "Trojan-Go") alter_id = s:option(Value, "alter_id", translate("Alter ID")) @@ -275,16 +267,19 @@ level.default = 1 level:depends({ type = "V2ray", protocol = "vmess" }) level:depends({ type = "V2ray", protocol = "vless" }) level:depends({ type = "V2ray", protocol = "shadowsocks" }) +level:depends({ type = "V2ray", protocol = "trojan" }) level:depends({ type = "V2ray", protocol = "mtproto" }) -stream_security = s:option(ListValue, "stream_security", translate("Transport Layer Encryption"), translate('Whether or not transport layer encryption is enabled, the supported options are "none" for unencrypted and "TLS" for using TLS.')) +stream_security = s:option(ListValue, "stream_security", translate("Transport Layer Encryption"), translate('Whether or not transport layer encryption is enabled, "none" for unencrypted, "tls" for using TLS, "xtls" for using XTLS.')) stream_security:value("none", "none") stream_security:value("tls", "tls") +stream_security:value("xtls", "xtls") stream_security.default = "none" stream_security:depends({ type = "V2ray", protocol = "vmess" }) stream_security:depends({ type = "V2ray", protocol = "vless" }) stream_security:depends({ type = "V2ray", protocol = "socks" }) stream_security:depends({ type = "V2ray", protocol = "shadowsocks" }) +stream_security:depends({ type = "V2ray", protocol = "trojan" }) stream_security:depends("type", "Trojan") stream_security:depends("type", "Trojan-Plus") stream_security:depends("type", "Trojan-Go") @@ -294,24 +289,37 @@ stream_security.validate = function(self, value) end return value end + +flow = s:option(Value, "flow", translate("flow")) +flow.default = "xtls-rprx-origin" +flow:value("xtls-rprx-origin") +flow:value("xtls-rprx-origin-udp443") +flow:depends("stream_security", "xtls") + -- [[ TLS部分 ]] -- tls_sessionTicket = s:option(Flag, "tls_sessionTicket", translate("Session Ticket")) tls_sessionTicket.default = "0" -tls_sessionTicket:depends("stream_security", "tls") +tls_sessionTicket:depends({ type = "Trojan", stream_security = "tls" }) +tls_sessionTicket:depends({ type = "Trojan-Plus", stream_security = "tls" }) +tls_sessionTicket:depends({ type = "Trojan-Go", stream_security = "tls" }) tls_serverName = s:option(Value, "tls_serverName", translate("Domain")) tls_serverName:depends("stream_security", "tls") +tls_serverName:depends("stream_security", "xtls") tls_allowInsecure = s:option(Flag, "tls_allowInsecure", translate("allowInsecure"), translate("Whether unsafe connections are allowed. When checked, Certificate validation will be skipped.")) tls_allowInsecure.default = "0" tls_allowInsecure:depends("stream_security", "tls") +tls_allowInsecure:depends("stream_security", "xtls") tls_certificateFile = s:option(Value, "tls_certificateFile", translate("Public key absolute path"), translate("as:") .. "/etc/ssl/fullchain.pem") tls_certificateFile:depends("stream_security", "tls") +tls_certificateFile:depends("stream_security", "xtls") tls_keyFile = s:option(Value, "tls_keyFile", translate("Private key absolute path"), translate("as:") .. "/etc/ssl/private.key") tls_keyFile:depends("stream_security", "tls") +tls_keyFile:depends("stream_security", "xtls") transport = s:option(ListValue, "transport", translate("Transport")) transport:value("tcp", "TCP") @@ -324,6 +332,7 @@ transport:depends({ type = "V2ray", protocol = "vmess" }) transport:depends({ type = "V2ray", protocol = "vless" }) transport:depends({ type = "V2ray", protocol = "socks" }) transport:depends({ type = "V2ray", protocol = "shadowsocks" }) +transport:depends({ type = "V2ray", protocol = "trojan" }) trojan_transport = s:option(ListValue, "trojan_transport", translate("Transport")) trojan_transport:value("original", "Original") diff --git a/package/lienol/luci-app-passwall/po/zh-cn/passwall.po b/package/lienol/luci-app-passwall/po/zh-cn/passwall.po index fcb300726a..bdfaff2b91 100644 --- a/package/lienol/luci-app-passwall/po/zh-cn/passwall.po +++ b/package/lienol/luci-app-passwall/po/zh-cn/passwall.po @@ -931,8 +931,8 @@ msgstr "伪装类型" msgid "Transport Layer Encryption" msgstr "传输层加密" -msgid "Whether or not transport layer encryption is enabled, the supported options are \"none\" for unencrypted and \"TLS\" for using TLS." -msgstr "是否启入传输层加密,支持的选项有 \"none\" 表示不加密,\"tls\" 表示使用 TLS。" +msgid "Whether or not transport layer encryption is enabled, \"none\" for unencrypted, \"tls\" for using TLS, \"xtls\" for using XTLS." +msgstr "是否启入传输层加密,支持的选项有 \"none\" 表示不加密,\"tls\" 表示使用 TLS,\"xtls\" 表示使用 XTLS。" msgid "'none' not supported for original Trojan, please choose 'tls'." msgstr "原版Trojan不支持'none',请选择TLS。" @@ -1003,9 +1003,6 @@ msgstr "当你隐藏后想再次显示,地址栏输入例:" msgid "The MTProto protocol must be 32 characters and can only contain characters from 0 to 9 and a to f." msgstr "MTProto 协议必须为 32 个字符,仅可包含 0 到 9 和 a 到 f 之间的字符。" -msgid "When OTA is enabled, a connection that is not OTA enabled is rejected. This option is invalid when using AEAD encryption." -msgstr "开启 OTA 后,将拒绝未启用 OTA 的连接。当使用 AEAD 加密时,该选项无效。" - msgid "transit node" msgstr "中转到此节点"