From 31b9dfcb613bd94cf4e040318ae6d2485f183b1b Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Wed, 13 Jan 2021 12:32:15 +0800 Subject: [PATCH 01/13] Revert "ramips: mt7621 OC 1000 MHz" This hack is not stable and causes some devices against to boot, users should make oc via their u-boot but not kernel hacks. This reverts commit 5c6eeab752349cb641694b99fd501f8033e197ef. Signed-off-by: CN_SZTL --- .../102-mt7621-fix-cpu-clk-add-clkdev.patch | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/target/linux/ramips/patches-4.14/102-mt7621-fix-cpu-clk-add-clkdev.patch b/target/linux/ramips/patches-4.14/102-mt7621-fix-cpu-clk-add-clkdev.patch index e0143dd98e..e647a2f4c8 100644 --- a/target/linux/ramips/patches-4.14/102-mt7621-fix-cpu-clk-add-clkdev.patch +++ b/target/linux/ramips/patches-4.14/102-mt7621-fix-cpu-clk-add-clkdev.patch @@ -65,7 +65,7 @@ #define MT7621_GPIO_MODE_UART1 1 #define MT7621_GPIO_MODE_I2C 2 #define MT7621_GPIO_MODE_UART3_MASK 0x3 -@@ -113,49 +113,98 @@ static struct rt2880_pmx_group mt7621_pi +@@ -113,49 +113,89 @@ static struct rt2880_pmx_group mt7621_pi { 0 } }; @@ -152,16 +152,8 @@ - } else { - /* 20Mhz Xtal */ - cpu_clk = 20 * fbdiv * 1000 * 1000; +- } + pll = rt_memc_r32(MEMC_REG_CPU_PLL); -+ if ((pll & 0x7f0) == 0x2b0) { -+ volatile u32 i; -+ -+ pr_info("CPU Clock: 880MHz, start overclocking\n"); -+ pll &= ~0x7ff; -+ pll |= 0x312; -+ rt_memc_w32(pll, MEMC_REG_CPU_PLL); -+ for (i = 0; i < 1000; i++); - } + fbdiv = (pll >> CPU_PLL_FBDIV_SHIFT) & CPU_PLL_FBDIV_MASK; + prediv = (pll >> CPU_PLL_PREDIV_SHIFT) & CPU_PLL_PREDIV_MASK; + cpu_clk = ((fbdiv + 1) * xtal_clk) >> prediv_tbl[prediv]; From aa3c691da57c94439e543c557b93e5241c44abb7 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Mon, 7 Dec 2020 04:53:02 +0100 Subject: [PATCH 02/13] zstd: fix package source It looks like GitHub changed the URL path for release tarballs, thus the download for the zstd package was always falling back to the OpenWrt sources mirror. Fix the GitHub URL for one which works. The file hash remains unchanged. Signed-off-by: David Bauer --- tools/zstd/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile index ec85362544..4ec910d4ba 100644 --- a/tools/zstd/Makefile +++ b/tools/zstd/Makefile @@ -4,7 +4,8 @@ PKG_NAME:=zstd PKG_VERSION:=1.4.4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=@GITHUB/facebook/zstd/releases/download/v$(PKG_VERSION) +PKG_SOURCE_URL_FILE:=v$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/facebook/zstd/archive/ PKG_HASH:=a364f5162c7d1a455cc915e8e3cf5f4bd8b75d09bc0f53965b0c9ca1383c52c8 PKG_LICENSE:=BSD-3-Clause From 2b9026997c804f1973b37105931606d3a9aff921 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 11 Jan 2021 18:03:29 +0100 Subject: [PATCH 03/13] tools/fakeroot: fix build regression on macOS AT_EMPTY_PATH and AT_NO_AUTOMOUNT does not exist there Signed-off-by: Felix Fietkau --- tools/fakeroot/patches/100-portability.patch | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tools/fakeroot/patches/100-portability.patch b/tools/fakeroot/patches/100-portability.patch index 315a9e16bf..7ba12996be 100644 --- a/tools/fakeroot/patches/100-portability.patch +++ b/tools/fakeroot/patches/100-portability.patch @@ -25,7 +25,23 @@ #ifdef HAVE_SYS_ACL_H #include #endif /* HAVE_SYS_ACL_H */ -@@ -1911,7 +1918,7 @@ ssize_t fremovexattr(int fd, const char +@@ -188,6 +195,15 @@ extern int unsetenv (const char *name); + #undef __lxstat64 + #undef _FILE_OFFSET_BITS + ++ ++#ifndef AT_EMPTY_PATH ++#define AT_EMPTY_PATH 0 ++#endif ++ ++#ifndef AT_NO_AUTOMOUNT ++#define AT_NO_AUTOMOUNT 0 ++#endif ++ + /* + // next_wrap_st: + // this structure is used in next_wrap, which is defined in +@@ -1911,7 +1927,7 @@ ssize_t fremovexattr(int fd, const char } #endif /* HAVE_FREMOVEXATTR */ @@ -34,7 +50,7 @@ if (fakeroot_disabled) return next_setpriority(which, who, prio); next_setpriority(which, who, prio); -@@ -2520,3 +2527,19 @@ int sysinfo(int command, char *buf, long +@@ -2520,3 +2536,19 @@ int sysinfo(int command, char *buf, long } } #endif From a75ff31357f124ea9fa1c3fbe7ac14a03cbc230f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 24 Dec 2020 16:36:16 -0800 Subject: [PATCH 04/13] glibc: add arc700 patch glibc does not officially support ARC700 so this adds the missing pieces. I looked at uClibc-ng and a patch by Synopsis for glibc. ran make toolchain/glibc/refresh to clean up fuzz. Signed-off-by: Rosen Penev --- toolchain/glibc/common.mk | 2 +- ...use-of-DES-encryption-functions-in-n.patch | 93 +++++++------------ .../glibc/patches/100-fix_cross_rpcgen.patch | 1 + toolchain/glibc/patches/300-arc.patch | 55 +++++++++++ 4 files changed, 90 insertions(+), 61 deletions(-) create mode 100644 toolchain/glibc/patches/300-arc.patch diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index 8b81ae1974..d22098ea11 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=glibc PKG_VERSION:=2.32 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) diff --git a/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch b/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch index 002e7a1770..10d9f65d18 100644 --- a/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch +++ b/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch @@ -23,11 +23,9 @@ provides them. sunrpc/des_soft.c | 2 +- 13 files changed, 305 insertions(+), 90 deletions(-) -diff --git a/conform/data/stdlib.h-data b/conform/data/stdlib.h-data -index 6913828196..d8fcccc2fb 100644 --- a/conform/data/stdlib.h-data +++ b/conform/data/stdlib.h-data -@@ -149,6 +149,9 @@ function {unsigned short int*} seed48 (unsigned short int[3]) +@@ -149,6 +149,9 @@ function {unsigned short int*} seed48 (u #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 function int setenv (const char*, const char*, int) #endif @@ -37,8 +35,6 @@ index 6913828196..d8fcccc2fb 100644 #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 function {char*} setstate (char*) #endif -diff --git a/conform/data/unistd.h-data b/conform/data/unistd.h-data -index aa070528e8..ddf4f25132 100644 --- a/conform/data/unistd.h-data +++ b/conform/data/unistd.h-data @@ -437,6 +437,9 @@ function int chroot (const char*) @@ -61,8 +57,6 @@ index aa070528e8..ddf4f25132 100644 function int execl (const char*, const char*, ...) function int execle (const char*, const char*, ...) function int execlp (const char*, const char*, ...) -diff --git a/crypt/cert.c b/crypt/cert.c -index e070ca398d..80029e9078 100644 --- a/crypt/cert.c +++ b/crypt/cert.c @@ -10,22 +10,6 @@ @@ -102,8 +96,6 @@ index e070ca398d..80029e9078 100644 -} - -#endif -diff --git a/crypt/crypt-entry.c b/crypt/crypt-entry.c -index 502b5846f0..09332c690a 100644 --- a/crypt/crypt-entry.c +++ b/crypt/crypt-entry.c @@ -35,7 +35,6 @@ @@ -114,7 +106,7 @@ index 502b5846f0..09332c690a 100644 /* Prototypes for local functions. */ #ifndef __GNU_LIBRARY__ -@@ -177,7 +176,17 @@ crypt (const char *key, const char *salt) +@@ -177,7 +176,17 @@ crypt (const char *key, const char *salt return __crypt_r (key, salt, &_ufc_foobar); } @@ -134,8 +126,6 @@ index 502b5846f0..09332c690a 100644 + return crypt (key, salt); +} #endif -diff --git a/crypt/crypt.h b/crypt/crypt.h -index ca8ad456cc..7d0de95018 100644 --- a/crypt/crypt.h +++ b/crypt/crypt.h @@ -36,6 +36,14 @@ __BEGIN_DECLS @@ -168,8 +158,6 @@ index ca8ad456cc..7d0de95018 100644 #endif __END_DECLS -diff --git a/crypt/crypt_util.c b/crypt/crypt_util.c -index 4b2f0a89cb..b012cde6bd 100644 --- a/crypt/crypt_util.c +++ b/crypt/crypt_util.c @@ -34,7 +34,6 @@ @@ -196,7 +184,7 @@ index 4b2f0a89cb..b012cde6bd 100644 /* * This is the final -@@ -788,7 +785,6 @@ _ufc_output_conversion_r (ufc_long v1, ufc_long v2, const char *salt, +@@ -788,7 +785,6 @@ _ufc_output_conversion_r (ufc_long v1, u __data->crypt_3_buf[13] = 0; } @@ -204,7 +192,7 @@ index 4b2f0a89cb..b012cde6bd 100644 /* * UNIX encrypt function. Takes a bitvector -@@ -889,14 +885,12 @@ __encrypt_r (char *__block, int __edflag, +@@ -889,14 +885,12 @@ __encrypt_r (char *__block, int __edflag } } weak_alias (__encrypt_r, encrypt_r) @@ -219,7 +207,7 @@ index 4b2f0a89cb..b012cde6bd 100644 /* -@@ -921,15 +915,12 @@ __setkey_r (const char *__key, struct crypt_data * __restrict __data) +@@ -921,15 +915,12 @@ __setkey_r (const char *__key, struct cr _ufc_mk_keytab_r((char *) ktab, __data); } weak_alias (__setkey_r, setkey_r) @@ -235,11 +223,9 @@ index 4b2f0a89cb..b012cde6bd 100644 void __b64_from_24bit (char **cp, int *buflen, -diff --git a/manual/conf.texi b/manual/conf.texi -index f959b00bb6..51fb2f5aa1 100644 --- a/manual/conf.texi +++ b/manual/conf.texi -@@ -780,8 +780,6 @@ Inquire about the parameter corresponding to @code{_XOPEN_LEGACY}. +@@ -780,8 +780,6 @@ Inquire about the parameter correspondin @item _SC_XOPEN_CRYPT @standards{X/Open, unistd.h} Inquire about the parameter corresponding to @code{_XOPEN_CRYPT}. @@ -248,11 +234,9 @@ index f959b00bb6..51fb2f5aa1 100644 @item _SC_XOPEN_ENH_I18N @standards{X/Open, unistd.h} -diff --git a/manual/crypt.texi b/manual/crypt.texi -index af23dd7847..1b151f2d74 100644 --- a/manual/crypt.texi +++ b/manual/crypt.texi -@@ -16,8 +16,19 @@ subject to them, even if you do not use the functions in this chapter +@@ -16,8 +16,19 @@ subject to them, even if you do not use yourself. The restrictions vary from place to place and are changed often, so we cannot give any more specific advice than this warning. @@ -272,7 +256,7 @@ index af23dd7847..1b151f2d74 100644 * Unpredictable Bytes:: Randomness for cryptographic purposes. @end menu -@@ -190,6 +201,199 @@ unpredictable as possible; @pxref{Unpredictable Bytes}. +@@ -190,6 +201,199 @@ unpredictable as possible; @pxref{Unpred @include genpass.c.texi @end smallexample @@ -472,8 +456,6 @@ index af23dd7847..1b151f2d74 100644 The next program demonstrates how to verify a passphrase. It checks a hash hardcoded into the program, because looking up real users' hashed passphrases may require special privileges (@pxref{User Database}). -diff --git a/manual/string.texi b/manual/string.texi -index 23f516439a..5586b52dee 100644 --- a/manual/string.texi +++ b/manual/string.texi @@ -36,8 +36,8 @@ too. @@ -487,7 +469,7 @@ index 23f516439a..5586b52dee 100644 * Encode Binary Data:: Encoding and Decoding of Binary Data. * Argz and Envz Vectors:: Null-separated string vectors. @end menu -@@ -2426,73 +2426,73 @@ functionality under a different name, such as @code{explicit_memset}, +@@ -2426,73 +2426,73 @@ functionality under a different name, su systems it may be in @file{strings.h} instead. @end deftypefun @@ -538,22 +520,11 @@ index 23f516439a..5586b52dee 100644 -@node Obfuscating Data -@section Obfuscating Data --@cindex Rot13 +@node Trivial Encryption +@section Trivial Encryption +@cindex encryption - --The @code{memfrob} function reversibly obfuscates an array of binary --data. This is not true encryption; the obfuscated data still bears a --clear relationship to the original, and no secret key is required to --undo the obfuscation. It is analogous to the ``Rot13'' cipher used on --Usenet for obscuring offensive jokes, spoilers for works of fiction, --and so on, but it can be applied to arbitrary binary data. - --Programs that need true encryption---a transformation that completely --obscures the original and cannot be reversed without knowledge of a --secret key---should use a dedicated cryptography library, such as --@uref{https://www.gnu.org/software/libgcrypt/,,libgcrypt}. ++ ++ +The @code{memfrob} function converts an array of data to something +unrecognizable and back again. It is not encryption in its usual sense +since it is easy for someone to convert the encrypted data back to clear @@ -561,8 +532,20 @@ index 23f516439a..5586b52dee 100644 +method for obscuring offensive jokes from sensitive eyes and such. +Unlike Rot13, @code{memfrob} works on arbitrary binary data, not just +text. -+@cindex Rot13 + @cindex Rot13 +-The @code{memfrob} function reversibly obfuscates an array of binary +-data. This is not true encryption; the obfuscated data still bears a +-clear relationship to the original, and no secret key is required to +-undo the obfuscation. It is analogous to the ``Rot13'' cipher used on +-Usenet for obscuring offensive jokes, spoilers for works of fiction, +-and so on, but it can be applied to arbitrary binary data. +- +-Programs that need true encryption---a transformation that completely +-obscures the original and cannot be reversed without knowledge of a +-secret key---should use a dedicated cryptography library, such as +-@uref{https://www.gnu.org/software/libgcrypt/,,libgcrypt}. +- -Programs that need to @emph{destroy} data should use -@code{explicit_bzero} (@pxref{Erasing Sensitive Data}), or possibly -@code{strfry} (@pxref{Shuffling Bytes}). @@ -579,13 +562,14 @@ index 23f516439a..5586b52dee 100644 -beginning at @var{mem}, in place. Each byte is bitwise xor-ed with -the binary pattern 00101010 (hexadecimal 0x2A). The return value is -always @var{mem}. +- +-@code{memfrob} a second time on the same data returns it to +-its original state. +@code{memfrob} transforms (frobnicates) each byte of the data structure +at @var{mem}, which is @var{length} bytes long, by bitwise exclusive +oring it with binary 00101010. It does the transformation in place and +its return value is always @var{mem}. - --@code{memfrob} a second time on the same data returns it to --its original state. ++ +Note that @code{memfrob} a second time on the same data structure +returns it to its original state. + @@ -600,8 +584,6 @@ index 23f516439a..5586b52dee 100644 @end deftypefun @node Encode Binary Data -diff --git a/posix/unistd.h b/posix/unistd.h -index 32b8161619..6fac59999f 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -107,6 +107,9 @@ __BEGIN_DECLS @@ -614,7 +596,7 @@ index 32b8161619..6fac59999f 100644 /* The enhanced internationalization capabilities according to XPG4.2 are present. */ #define _XOPEN_ENH_I18N 1 -@@ -1129,17 +1132,25 @@ ssize_t copy_file_range (int __infd, __off64_t *__pinoff, +@@ -1129,17 +1132,25 @@ ssize_t copy_file_range (int __infd, __o extern int fdatasync (int __fildes); #endif /* Use POSIX199309 */ @@ -643,11 +625,9 @@ index 32b8161619..6fac59999f 100644 /* Swab pairs bytes in the first N bytes of the area pointed to by FROM and copy the result to TO. The value of TO must not be in the range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM -diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h -index 3aa27a9d25..67e5e66f94 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h -@@ -962,6 +962,12 @@ extern int getsubopt (char **__restrict __optionp, +@@ -962,6 +962,12 @@ extern int getsubopt (char **__restrict #endif @@ -660,11 +640,9 @@ index 3aa27a9d25..67e5e66f94 100644 /* X/Open pseudo terminal handling. */ #ifdef __USE_XOPEN2KXSI -diff --git a/sunrpc/des_crypt.c b/sunrpc/des_crypt.c -index 9b4bd2d5dd..a4d8b2936b 100644 --- a/sunrpc/des_crypt.c +++ b/sunrpc/des_crypt.c -@@ -86,9 +86,6 @@ common_crypt (char *key, char *buf, register unsigned len, +@@ -86,9 +86,6 @@ common_crypt (char *key, char *buf, regi return desdev == DES_SW ? DESERR_NONE : DESERR_NOHWDEVICE; } @@ -674,7 +652,7 @@ index 9b4bd2d5dd..a4d8b2936b 100644 /* * CBC mode encryption */ -@@ -105,7 +102,7 @@ cbc_crypt (char *key, char *buf, unsigned int len, unsigned int mode, +@@ -105,7 +102,7 @@ cbc_crypt (char *key, char *buf, unsigne COPY8 (dp.des_ivec, ivec); return err; } @@ -683,14 +661,12 @@ index 9b4bd2d5dd..a4d8b2936b 100644 /* * ECB mode encryption -@@ -118,4 +115,4 @@ ecb_crypt (char *key, char *buf, unsigned int len, unsigned int mode) +@@ -118,4 +115,4 @@ ecb_crypt (char *key, char *buf, unsigne dp.des_mode = ECB; return common_crypt (key, buf, len, mode, &dp); } -hidden_nolink (ecb_crypt, libc, GLIBC_2_1) +libc_hidden_nolink_sunrpc (ecb_crypt, GLIBC_2_1) -diff --git a/sunrpc/des_soft.c b/sunrpc/des_soft.c -index a87de96cc7..f884f8f21b 100644 --- a/sunrpc/des_soft.c +++ b/sunrpc/des_soft.c @@ -71,4 +71,4 @@ des_setparity (char *p) @@ -699,6 +675,3 @@ index a87de96cc7..f884f8f21b 100644 } -hidden_nolink (des_setparity, libc, GLIBC_2_1) +libc_hidden_nolink_sunrpc (des_setparity, GLIBC_2_1) --- -2.25.1 - diff --git a/toolchain/glibc/patches/100-fix_cross_rpcgen.patch b/toolchain/glibc/patches/100-fix_cross_rpcgen.patch index 6ee1e80424..9baed08139 100644 --- a/toolchain/glibc/patches/100-fix_cross_rpcgen.patch +++ b/toolchain/glibc/patches/100-fix_cross_rpcgen.patch @@ -33,3 +33,4 @@ +typedef char *caddr_t; # define __daddr_t_defined #endif + diff --git a/toolchain/glibc/patches/300-arc.patch b/toolchain/glibc/patches/300-arc.patch new file mode 100644 index 0000000000..66f7aeb3ef --- /dev/null +++ b/toolchain/glibc/patches/300-arc.patch @@ -0,0 +1,55 @@ +--- a/sysdeps/arc/atomic-machine.h ++++ b/sysdeps/arc/atomic-machine.h +@@ -64,6 +64,10 @@ typedef uintmax_t uatomic_max_t; + __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ + mem, new, old, __ATOMIC_ACQUIRE) + ++#ifdef __ARC700__ ++#define atomic_full_barrier() ({ asm volatile ("sync":::"memory"); }) ++#else + #define atomic_full_barrier() ({ asm volatile ("dmb 3":::"memory"); }) ++#endif + + #endif /* _ARC_BITS_ATOMIC_H */ +--- a/sysdeps/unix/sysv/linux/arc/syscall.S ++++ b/sysdeps/unix/sysv/linux/arc/syscall.S +@@ -24,8 +24,13 @@ ENTRY (syscall) + mov_s r1, r2 + mov_s r2, r3 + mov_s r3, r4 ++#ifdef __ARC700__ ++ mov r4, r5 ++ mov r5, r6 ++#else + mov_s r4, r5 + mov_s r5, r6 ++#endif + + ARC_TRAP_INSN + brhi r0, -4096, L (call_syscall_err) +--- a/sysdeps/unix/sysv/linux/arc/sysdep.h ++++ b/sysdeps/unix/sysv/linux/arc/sysdep.h +@@ -128,7 +128,11 @@ L (call_syscall_err): ASM_LINE_SEP \ + mov r8, __NR_##syscall_name ASM_LINE_SEP \ + ARC_TRAP_INSN ASM_LINE_SEP + ++# ifdef __ARC700__ ++# define ARC_TRAP_INSN trap0 ++# else + # define ARC_TRAP_INSN trap_s 0 ++# endif + + #else /* !__ASSEMBLER__ */ + +@@ -139,7 +143,11 @@ extern long int __syscall_error (long in + hidden_proto (__syscall_error) + # endif + ++# ifdef __ARC700__ ++# define ARC_TRAP_INSN "trap0 \n\t" ++# else + # define ARC_TRAP_INSN "trap_s 0 \n\t" ++#endif + + # undef INTERNAL_SYSCALL_NCS + # define INTERNAL_SYSCALL_NCS(number, nr_args, args...) \ From 0485ef53bce098b02c6e7c38c923fe2c1ccd7aa0 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sat, 9 Jan 2021 19:00:02 +0800 Subject: [PATCH 05/13] tinyfecVPN/tinyPortMapper: add packages --- package/ctcgfw/tinyfecvpn/Makefile | 58 ++++++++++++++++++++++++++ package/ctcgfw/tinyportmapper/Makefile | 57 +++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 package/ctcgfw/tinyfecvpn/Makefile create mode 100644 package/ctcgfw/tinyportmapper/Makefile diff --git a/package/ctcgfw/tinyfecvpn/Makefile b/package/ctcgfw/tinyfecvpn/Makefile new file mode 100644 index 0000000000..33457a8b6a --- /dev/null +++ b/package/ctcgfw/tinyfecvpn/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (c) 2017 Yu Wang +# +# This is free software, licensed under the MIT. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=tinyfecVPN +PKG_VERSION:=20180820.0 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/wangyu-/tinyfecVPN.git +PKG_SOURCE_VERSION:=e8364ba8ff94415ee3bedcbdb9557bfe5994a469 +PKG_MIRROR_HASH:=30fd808b0203c70e8e6cfe8ca55b907faaea6a8be12a7a7fef6658f4ddbb523c + +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz + +PKG_LICENSE:=MIT +PKG_MAINTAINER:=Yu Wang + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/tinyfecVPN + SECTION:=net + CATEGORY:=Network + SUBMENU:=VPN + TITLE:=A Network Improving Tool + URL:=https://github.com/wangyu-/tinyfecVPN + DEPENDS:=+libpthread +libstdcpp +kmod-tun +endef + +define Package/tinyfecVPN/description + A Lightweight VPN with Build-in Forward Error Correction Support (or A Network Improving Tool + which works at VPN mode). Improves your Network Quality on a High-latency Lossy Link. +endef + +MAKE_FLAGS += cross + +define Build/Prepare + $(PKG_UNPACK) + sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile + sed -i '/\*gitversion/d' $(PKG_BUILD_DIR)/makefile + echo 'const char *gitversion = "$(PKG_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h +endef + +define Package/tinyfecVPN/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tinyvpn_cross $(1)/usr/bin/tinyvpn +endef + +$(eval $(call BuildPackage,tinyfecVPN)) diff --git a/package/ctcgfw/tinyportmapper/Makefile b/package/ctcgfw/tinyportmapper/Makefile new file mode 100644 index 0000000000..b703e6693f --- /dev/null +++ b/package/ctcgfw/tinyportmapper/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (c) 2017 Yu Wang +# +# This is free software, licensed under the MIT. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=tinyPortMapper +PKG_VERSION:=20200818.0 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/wangyu-/tinyPortMapper.git +PKG_SOURCE_VERSION:=b6c5c05ba9a9db00571d185edcd534434f41b50a +PKG_MIRROR_HASH:=93946ec018ef515d0f443fd9a6e6510ce3ceb1be373a2393fe2daeeb5e7ced95 + +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz + +PKG_LICENSE:=MIT +PKG_MAINTAINER:=Yu Wang + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/tinyPortMapper + SECTION:=net + CATEGORY:=Network + TITLE:=A High-Performance Port Mapping/Forwarding Utility + URL:=https://github.com/wangyu-/tinyPortMapper + DEPENDS:=+libstdcpp +librt +endef + +define Package/tinyPortMapper/description + A Lightweight High-Performance Port Mapping/Forwarding Utility + using epoll/libev, supports IPv4 and IPv6 for both TCP and UDP. +endef + +MAKE_FLAGS += cross + +define Build/Prepare + $(PKG_UNPACK) + sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile + sed -i '/\*gitversion/d' $(PKG_BUILD_DIR)/makefile + echo 'const char *gitversion = "$(PKG_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h +endef + +define Package/tinyPortMapper/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tinymapper_cross $(1)/usr/bin/tinymapper +endef + +$(eval $(call BuildPackage,tinyPortMapper)) From 9b340aa3d4aee2c7a714c97e5bca98e651ce1044 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sun, 10 Jan 2021 19:06:08 +0800 Subject: [PATCH 06/13] treewide: drop packages which already in feeds --- package/ctcgfw/spdlog/Makefile | 65 --------- package/zxlhhyccc/syncthing/Makefile | 65 --------- package/zxlhhyccc/tvheadend/Config.in | 17 --- package/zxlhhyccc/tvheadend/Makefile | 132 ------------------ .../tvheadend/files/tvheadend.config | 13 -- .../zxlhhyccc/tvheadend/files/tvheadend.init | 71 ---------- .../tvheadend/patches/010-gcc10.patch | 28 ---- 7 files changed, 391 deletions(-) delete mode 100644 package/ctcgfw/spdlog/Makefile delete mode 100644 package/zxlhhyccc/syncthing/Makefile delete mode 100644 package/zxlhhyccc/tvheadend/Config.in delete mode 100644 package/zxlhhyccc/tvheadend/Makefile delete mode 100644 package/zxlhhyccc/tvheadend/files/tvheadend.config delete mode 100755 package/zxlhhyccc/tvheadend/files/tvheadend.init delete mode 100644 package/zxlhhyccc/tvheadend/patches/010-gcc10.patch diff --git a/package/ctcgfw/spdlog/Makefile b/package/ctcgfw/spdlog/Makefile deleted file mode 100644 index f2bff16610..0000000000 --- a/package/ctcgfw/spdlog/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -#### - # File: /spdlog/Makefile - # Project: ootoc-OpenWRT - # File Created: Thursday, 12th March 2020 11:09:54 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] -#### - -include $(TOPDIR)/rules.mk - -PKG_NAME:=spdlog -PKG_VERSION:=1.7.0 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/gabime/spdlog.git -PKG_MIRROR_HASH:=777dff5e8755d942159406c82d6e568f4fd5beda6c37a47eaf839222fdcd0e04 -PKG_SOURCE_VERSION:=616caa5d30172b65cc3a06800894c575d70cb8e6 -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz - -PKG_LICENSE:=GPLv3 -PKG_LICENSE_FILES:=LICENSE -PKG_MAINTAINER:=ElonH - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) - -PKG_INSTALL:=1 -PKG_USE_MIPS16:=0 -PKG_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -CMAKE_OPTIONS+= -DSPDLOG_BUILD_EXAMPLE:BOOL=OFF \ - -DSPDLOG_BUILD_TESTS:BOOL=OFF -DSPDLOG_BUILD_SHARED:BOOL=ON \ - -DSPDLOG_FMT_EXTERNAL:BOOL=ON -DSPDLOG_FMT_EXTERNAL_HO:BOOL=OFF - -define Package/spdlog - SECTION:=lib - CATEGORY:=Libraries - URL:=https://github.com/gabime/spdlog - TITLE:=Fast C++ logging library. - DEPENDS:=+libfmt - MENU:=1 -endef - -define Package/spdlog/description - Very fast, header-only/compiled, C++ logging library. -endef - - -define Build/InstallDev - $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/include/spdlog/fmt/bundled - $(CP) $(PKG_BUILD_DIR)/include/spdlog/fmt/bundled $(PKG_INSTALL_DIR)/usr/include/spdlog/fmt - $(Build/InstallDev/cmake) -endef - -define Package/spdlog/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspdlog.so* $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,spdlog)) diff --git a/package/zxlhhyccc/syncthing/Makefile b/package/zxlhhyccc/syncthing/Makefile deleted file mode 100644 index da4d5a383c..0000000000 --- a/package/zxlhhyccc/syncthing/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=syncthing -PKG_VERSION:=1.9.0 -PKG_RELEASE:=1 - -PKG_SOURCE:=syncthing-source-v$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERSION) -PKG_HASH:=a4e3e5997b2c4c76512ed9b32a067b2a90e26c0d445f8c3c62af65d2b93d4d8b - -PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME) - -PKG_MAINTAINER:=Paul Spooren -PKG_LICENSE:=MPL-2.0 -PKG_LICENSE_FILES:=LICENSE -PKG_CPE_ID:=cpe:/a:syncthing:syncthing - -PKG_BUILD_DEPENDS:=golang/host -PKG_BUILD_PARALLEL:=1 -PKG_USE_MIPS16:=0 - -GO_PKG:=github.com/syncthing/syncthing/ -GO_PKG_BUILD_PKG:=github.com/syncthing/syncthing/cmd/syncthing/ -GO_PKG_INSTALL_EXTRA:=^gui/ - -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk - -define Package/syncthing - SECTION:=net - CATEGORY:=Network - SUBMENU:=File Transfer - TITLE:=Continuous file synchronization program - URL:=https://syncthing.net - DEPENDS:=$(GO_ARCH_DEPENDS) -endef - -GO_PKG_LDFLAGS:= -s -w -GO_PKG_LDFLAGS_X:= \ - github.com/syncthing/syncthing/lib/build.Version=v$(PKG_VERSION) \ - github.com/syncthing/syncthing/lib/build.Stamp=$(SOURCE_DATE_EPOCH) \ - github.com/syncthing/syncthing/lib/build.User=ctcgfw \ - github.com/syncthing/syncthing/lib/build.Host=project-openwrt \ - github.com/syncthing/syncthing/lib/build.Program=syncthing -GO_PKG_TAGS:=noupgrade - -define Build/Compile - $(call GoPackage/Build/Compile) - $(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/syncthing -endef - -define Package/syncthing/description - Syncthing replaces proprietary sync and cloud services with something - open, trustworthy and decentralized. Your data is your data alone and - you deserve to choose where it is stored, if it is shared with some - third party and how it's transmitted over the Internet. -endef - -define Package/syncthing/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/syncthing $(1)/usr/bin/syncthing -endef - -$(eval $(call GoBinPackage,syncthing)) -$(eval $(call BuildPackage,syncthing)) diff --git a/package/zxlhhyccc/tvheadend/Config.in b/package/zxlhhyccc/tvheadend/Config.in deleted file mode 100644 index 5bc1a18bc6..0000000000 --- a/package/zxlhhyccc/tvheadend/Config.in +++ /dev/null @@ -1,17 +0,0 @@ -config TVHEADEND_NDMS_CWC_SUPPORT - bool "NewCamd support" - default y - -config TVHEADEND_NDMS_LINUXDVB_SUPPORT - bool "Linux DVB support" - default y - -config TVHEADEND_NDMS_DVBSCAN_SUPPORT - bool "Fetch DVB-scan data" - depends on TVHEADEND_NDMS_LINUXDVB_SUPPORT - default TVHEADEND_NDMS_LINUXDVB_SUPPORT - -config TVHEADEND_NDMS_AVAHI_SUPPORT - bool "Avahi client support" - select PACKAGE_libavahi-client - default n diff --git a/package/zxlhhyccc/tvheadend/Makefile b/package/zxlhhyccc/tvheadend/Makefile deleted file mode 100644 index b890f3dafd..0000000000 --- a/package/zxlhhyccc/tvheadend/Makefile +++ /dev/null @@ -1,132 +0,0 @@ -# -# Copyright (C) 2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=tvheadend -PKG_VERSION:=4.3 -PKG_RELEASE:=1 - -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=d91f71cfbe0016350dbb3853a42ac4b226d8d47b -# This is stable git version... -# PKG_SOURCE_VERSION:=1a0262f5870e4fabd6b9c70a7bf2ebe420bc956e -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/505575853/tvheadend.git -PKG_MIRROR_HASH:=2e6de0ddcad68da14a6b07217b06b233eea2e9440f2f3e7f136123fcfd6a5b7b -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) - -PKG_LICENSE:=GPL-3.0 -PKG_LICENSE_FILES:=LICENSE.md - -PKG_FIXUP:=autoreconf - -PKG_USE_MIPS16:=0 - -SHORT_GIT_VER:=$(shell echo $(PKG_SOURCE_VERSION) | cut -b -7) - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/nls.mk - -define Package/tvheadend - SECTION:=multimedia - CATEGORY:=Multimedia - TITLE:=Tvheadend is a TV streaming server for Linux - DEPENDS:=+libopenssl +librt +zlib +libpcre +libpcre2 +libdvbcsa +TVHEADEND_AVAHI_SUPPORT:libavahi-client $(ICONV_DEPENDS) - URL:=https://tvheadend.org - MAINTAINER:=Jan Čermák -endef - -define Package/tvheadend/description - Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android - supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, SAT>IP and HDHomeRun as input sources. - - Tvheadend offers the HTTP (VLC, MPlayer), HTSP (Kodi, Movian) and SAT>IP streaming. -endef - -define Package/tvheadend/config - menu "Configuration" - depends on PACKAGE_tvheadend - source "$(SOURCE)/Config.in" - endmenu -endef - -ifeq ($(CONFIG_TVHEADEND_CWC_SUPPORT),) - CONFIGURE_ARGS += --disable-cwc -endif - -ifeq ($(CONFIG_TVHEADEND_LINUXDVB_SUPPORT),) - CONFIGURE_ARGS += --disable-linuxdvb -endif - -ifeq ($(CONFIG_TVHEADEND_DVBSCAN_SUPPORT),) - CONFIGURE_ARGS += --disable-dvbscan -endif - -ifeq ($(CONFIG_TVHEADEND_AVAHI_SUPPORT),) - CONFIGURE_ARGS += --disable-avahi -else - CONFIGURE_ARGS += --enable-avahi -endif - -CONFIGURE_ARGS += \ - --arch=$(ARCH) \ - --disable-dbus_1 \ - --disable-libav \ - --enable-bundle \ - --enable-dvben50221 \ - --enable-tvhcsa \ - --enable-dvbcsa \ - --enable-inotify \ - --enable-epoll \ - --enable-trace \ - --nowerror \ - --disable-dvbscan \ - --disable-avahi \ - --disable-hdhomerun_static \ - --disable-pie \ - --disable-imagecache \ - --disable-ffmpeg_static \ - --disable-libx264 \ - --disable-libx264_static \ - --disable-libx265 \ - --disable-libx265_static \ - --disable-libvpx \ - --disable-libvpx_static \ - --disable-libtheora \ - --disable-libtheora_static \ - --disable-libvorbis \ - --disable-libvorbis_static \ - --disable-libfdkaac \ - --disable-libfdkaac_static \ - --disable-nvenc \ - --disable-libmfx_static \ - --disable-timeshift - - -define Build/Prepare - $(call Build/Prepare/Default) - echo 'Tvheadend $(shell echo $(PKG_VERSION)~$(SHORT_GIT_VER)-$(PKG_RELEASE))' \ - > $(PKG_BUILD_DIR)/debian/changelog -endef - -define Package/conffiles -/etc/config/tvheadend -endef - -define Package/tvheadend/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/tvheadend.init $(1)/etc/init.d/tvheadend - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/tvheadend.config $(1)/etc/config/tvheadend - - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/build.linux/tvheadend $(1)/usr/bin/ -endef - -$(eval $(call BuildPackage,tvheadend)) diff --git a/package/zxlhhyccc/tvheadend/files/tvheadend.config b/package/zxlhhyccc/tvheadend/files/tvheadend.config deleted file mode 100644 index 62c139de53..0000000000 --- a/package/zxlhhyccc/tvheadend/files/tvheadend.config +++ /dev/null @@ -1,13 +0,0 @@ -#config tvheadend service -# option nosyslog '0' -# option use_temp_epgdb '0' -# option config_path '/etc/tvheadend' - -config tvheadend server - option ipv6 '1' -# option bindaddr '0.0.0.0' -# option http_port '9981' -# option http_root '/tvheadend' -# option htsp_port '9982' -# option htsp_port2 '9983' -# option xspf '0' diff --git a/package/zxlhhyccc/tvheadend/files/tvheadend.init b/package/zxlhhyccc/tvheadend/files/tvheadend.init deleted file mode 100755 index 07d96a867e..0000000000 --- a/package/zxlhhyccc/tvheadend/files/tvheadend.init +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 -STOP=00 - -USE_PROCD=1 -PROG=/usr/bin/tvheadend - -TEMP_CONFIG=/tmp/tvheadend -PERSISTENT_CONFIG=/etc/tvheadend - -execute_first_run() { - "$PROG" -C "$1" -B -C -A >/dev/null 2>&1 -} - -ensure_config_exists() { - local config_path - - config_load tvheadend - config_get config_path service config_path - - if [ -z "$config_path" ]; then - [ -d "$PERSISTENT_CONFIG" ] || execute_first_run "$PERSISTENT_CONFIG" - else - # if the configuration directory is empty, empty config with grant-all ACL is created - [ -d "$config_path" ] && [ "$(ls -A $config_path)" ] || execute_first_run "$config_path" - fi - - # if use_temp_epgdb is enabled (default), most of the config is put to config_path - # (or /etc/config), except for epgdb.v2, which grows quite large and is write-heavy, - # so it's put into volatile tmpfs - # epgdb.v2 is created and symlinked to main config dir upon each start (if it doesn't exist) - config_get_bool use_temp_epgdb service use_temp_epgdb 1 - if [ "$use_temp_epgdb" == "1" ]; then - TEMP_EPG="${TEMP_CONFIG}/epgdb.v2" - [ ! -f "$TEMP_EPG" ] && mkdir -p "$TEMP_CONFIG" && touch "$TEMP_EPG" && chmod 700 "$TEMP_EPG" - [ -z "$config_path" ] && config_path="$PERSISTENT_CONFIG" - ln -sf "$TEMP_EPG" "${config_path}/epgdb.v2" - fi -} - -load_uci_config() { - config_load tvheadend - config_get config_path service config_path "$PERSISTENT_CONFIG" - [ -n "$config_path" ] && procd_append_param command -c "$config_path" - config_get_bool nosyslog service nosyslog 0 - [ "$nosyslog" -eq 1 ] && procd_append_param command --nosyslog - config_get_bool ipv6 server ipv6 0 - [ "$ipv6" -eq 1 ] && procd_append_param command --ipv6 - config_get bindaddr server bindaddr - [ -n "$bindaddr" ] && procd_append_param command --bindaddr "$bindaddr" - config_get http_port server http_port - [ -n "$http_port" ] && procd_append_param command --http_port "$http_port" - config_get http_root server http_root - [ -n "$http_root" ] && procd_append_param command --http_root "$http_root" - config_get htsp_port server htsp_port - [ -n "$htsp_port" ] && procd_append_param command --htsp_port "$htsp_port" - config_get htsp_port2 server htsp_port2 - [ -n "$htsp_port2" ] && procd_append_param command --htsp_port "$htsp_port2" - config_get xspf server xspf 0 - [ "$xspf" -eq 1 ] && procd_append_param command --xspf -} - -start_service() { - ensure_config_exists - procd_open_instance - procd_set_param file /etc/config/tvheadend - procd_set_param command "$PROG" -B -C - load_uci_config - procd_close_instance -} diff --git a/package/zxlhhyccc/tvheadend/patches/010-gcc10.patch b/package/zxlhhyccc/tvheadend/patches/010-gcc10.patch deleted file mode 100644 index b2ef7402ae..0000000000 --- a/package/zxlhhyccc/tvheadend/patches/010-gcc10.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/src/input.h b/src/input.h -index 516f850ef..378996a80 100644 ---- a/src/input.h -+++ b/src/input.h -@@ -129,8 +129,8 @@ void tvh_hardware_delete ( tvh_hardware_t *th ); - extern const idclass_t tvh_input_class; - extern const idclass_t tvh_input_instance_class; - --tvh_input_list_t tvh_inputs; --tvh_hardware_list_t tvh_hardware; -+extern tvh_input_list_t tvh_inputs; -+extern tvh_hardware_list_t tvh_hardware; - - #define TVH_INPUT_FOREACH(x) LIST_FOREACH(x, &tvh_inputs, ti_link) - #define TVH_HARDWARE_FOREACH(x) LIST_FOREACH(x, &tvh_hardware, th_link) -diff --git a/src/input/mpegts.h b/src/input/mpegts.h -index 9d29d56ca..fd46e4f9e 100644 ---- a/src/input/mpegts.h -+++ b/src/input/mpegts.h -@@ -1144,7 +1144,7 @@ typedef struct mpegts_listener - void (*ml_mux_delete) (mpegts_mux_t *mm, void *p); - } mpegts_listener_t; - --LIST_HEAD(,mpegts_listener) mpegts_listeners; -+static LIST_HEAD(,mpegts_listener) mpegts_listeners; - - #define mpegts_add_listener(ml)\ - LIST_INSERT_HEAD(&mpegts_listeners, ml, ml_link) From 47c5f0c98fd998e064eac8439ff9ebe3207acb22 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Tue, 14 Apr 2020 14:49:54 -1000 Subject: [PATCH 07/13] scripts: target-metadata don't add PROFILES twice Since 4ee3cf2b5a profiles with alternative vendor names may appear multiple times in `tmp/.targetinfo` or `.targetinfo` (for ImageBuilders). The `target-metadata.pl` script adds these profiles then twice to `PROFILE_NAMES` and the ImageBuilder show the profile twice when running `make info`. This patch removes duplicate profile IDs and only adds them once to `.profiles.mk`. Signed-off-by: Paul Spooren --- scripts/target-metadata.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index d880abef98..0ea66ebaa6 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -427,7 +427,8 @@ sub gen_profile_mk() { my @targets = parse_target_metadata($file); foreach my $cur (@targets) { next unless $cur->{id} eq $target; - print "PROFILE_NAMES = ".join(" ", map { $_->{id} } @{$cur->{profiles}})."\n"; + my @profile_ids_unique = do { my %seen; grep { !$seen{$_}++} map { $_->{id} } @{$cur->{profiles}}}; + print "PROFILE_NAMES = ".join(" ", @profile_ids_unique)."\n"; foreach my $profile (@{$cur->{profiles}}) { print $profile->{id}.'_NAME:='.$profile->{name}."\n"; print $profile->{id}.'_HAS_IMAGE_METADATA:='.$profile->{has_image_metadata}."\n"; From 461004d633c50f97b9185652af0a61a7f493baf0 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 13 Jan 2021 16:06:03 +0100 Subject: [PATCH 08/13] owipcalc: use v6 in cidr_parse6 function The cidr_parse6 function parses a string to an ipv6-address. The cidr struct contains a union called buf for the ipv4 and ipv6 address. Since it is a char pointer and the struct is initialized with the maximum size (so ipv6 string) it does not make any difference. However, we should access the buffer using the v6 name, since it could be confusing otherwise. Signed-off-by: Nick Hainke --- package/network/utils/owipcalc/Makefile | 2 +- package/network/utils/owipcalc/src/owipcalc.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/network/utils/owipcalc/Makefile b/package/network/utils/owipcalc/Makefile index fd193ea11f..1f4c98bb48 100644 --- a/package/network/utils/owipcalc/Makefile +++ b/package/network/utils/owipcalc/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=owipcalc -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_LICENSE:=Apache-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/owipcalc/src/owipcalc.c b/package/network/utils/owipcalc/src/owipcalc.c index f95280cd1c..c4df5c7450 100644 --- a/package/network/utils/owipcalc/src/owipcalc.c +++ b/package/network/utils/owipcalc/src/owipcalc.c @@ -361,11 +361,11 @@ static struct cidr * cidr_parse6(const char *s) if (!addr || (strlen(s) >= sizeof(addr->buf.v6))) goto err; - snprintf(addr->buf.v4, sizeof(addr->buf.v6), "%s", s); + snprintf(addr->buf.v6, sizeof(addr->buf.v6), "%s", s); addr->family = AF_INET6; - if ((p = strchr(addr->buf.v4, '/')) != NULL) + if ((p = strchr(addr->buf.v6, '/')) != NULL) { *p++ = 0; @@ -379,9 +379,9 @@ static struct cidr * cidr_parse6(const char *s) addr->prefix = 128; } - if (p == addr->buf.v4+1) + if (p == addr->buf.v6+1) memset(&addr->addr.v6, 0, sizeof(addr->addr.v6)); - else if (inet_pton(AF_INET6, addr->buf.v4, &addr->addr.v6) != 1) + else if (inet_pton(AF_INET6, addr->buf.v6, &addr->addr.v6) != 1) goto err; return addr; From b009692333d5027cb173d51c0fb220a976a92b83 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Fri, 15 Jan 2021 20:45:38 +0100 Subject: [PATCH 09/13] glibc: update to latest 2.32 commit (BZ #20019, BZ #27177, BZ #27130) 4c619b3eed x86: Check IFUNC definition in unrelocated executable [BZ #20019] 87450ecf8a x86: Set header.feature_1 in TCB for always-on CET [BZ #27177] 2b4f67c2b3 Update for [BZ #27130] fix 1a24bbd43e x86-64: Avoid rep movsb with short distance [BZ #27130] Signed-off-by: Hans Dedecker --- toolchain/glibc/common.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index d22098ea11..a32e375117 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -12,8 +12,8 @@ PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=0d9793e82a19bcef10ef7d73a26cd44b7ad30753 -PKG_MIRROR_HASH:=edb3e1f8792f3f10d6ade9ac35837e8b0b65ee12219f3580e1ac8ba363ef9e8f +PKG_SOURCE_VERSION:=4c619b3eed558172198790f842740abb9af1989d +PKG_MIRROR_HASH:=b662bceabc5a077c5be8a582aaf1567450fd774df5e31f91928272c1e4e572de PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz From 74ea455c1ddc1e051056bca223287f26e2bc58d7 Mon Sep 17 00:00:00 2001 From: jerrykuku Date: Thu, 14 Jan 2021 19:41:32 +0800 Subject: [PATCH 10/13] luci-app-vssr: bump to v1.21 Signed-off-by: CN_SZTL --- package/ctcgfw/luci-app-vssr/Makefile | 4 +- .../luasrc/model/cbi/vssr/socks5.lua | 36 ++++++ .../luci-app-vssr/luasrc/view/vssr/ssrurl.htm | 2 - .../luasrc/view/vssr/update_subscribe.htm | 9 +- package/ctcgfw/luci-app-vssr/po/zh-cn/vssr.po | 11 +- .../ctcgfw/luci-app-vssr/root/etc/config/vssr | 8 ++ .../ctcgfw/luci-app-vssr/root/etc/init.d/vssr | 118 ++++++++++-------- .../root/usr/share/vssr/genconfig_v2ray_s.lua | 38 ++++-- .../root/usr/share/vssr/subscribe.lua | 4 +- .../root/www/luci-static/vssr/css/vssr.css | 15 ++- 10 files changed, 171 insertions(+), 74 deletions(-) diff --git a/package/ctcgfw/luci-app-vssr/Makefile b/package/ctcgfw/luci-app-vssr/Makefile index 5a56797fbd..b68b9cf547 100644 --- a/package/ctcgfw/luci-app-vssr/Makefile +++ b/package/ctcgfw/luci-app-vssr/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-vssr -PKG_VERSION:=1.20 -PKG_RELEASE:=20201209 +PKG_VERSION:=1.21 +PKG_RELEASE:=20210114 include $(INCLUDE_DIR)/package.mk diff --git a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/socks5.lua b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/socks5.lua index d477e3adc1..68b146942d 100644 --- a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/socks5.lua +++ b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/socks5.lua @@ -1,3 +1,11 @@ +--[[ +Author: your name +Date: 2019-11-11 09:33:07 +LastEditTime: 2021-01-14 18:50:06 +LastEditors: Please set LastEditors +Description: In User Settings Edit +FilePath: \luci-app-vssr\luasrc\model\cbi\vssr\socks5.lua +--]] local vssr = 'vssr' local uci = luci.model.uci.cursor() local server_table = {} @@ -34,4 +42,32 @@ if nixio.fs.access('/usr/bin/v2ray/v2ray') or nixio.fs.access('/usr/bin/v2ray') o.rmempty = false end +-- [[ Http Proxy ]]-- +if nixio.fs.access('/usr/bin/v2ray/v2ray') or nixio.fs.access('/usr/bin/v2ray') or nixio.fs.access('/usr/bin/xray') or nixio.fs.access('/usr/bin/xray/xray') then + s = m:section(TypedSection, 'http_proxy', translate('V2ray HTTP Proxy')) + s.anonymous = true + + o = s:option(Flag, 'enable_server', translate('Enable Servers')) + o.rmempty = false + + o = s:option(Flag, 'enable_auth', translate('Enable Auth')) + o.rmempty = false + + o = s:option(Value, 'http_user', translate('HTTP user')) + o.default = 'user' + o.rmempty = true + o:depends('enable_auth', '1') + + o = s:option(Value, 'http_pass', translate('HTTP pass')) + o.default = 'password' + o.password = true + o.rmempty = true + o:depends('enable_auth', '1') + + o = s:option(Value, 'local_port', translate('Local Port')) + o.datatype = 'port' + o.default = 1088 + o.rmempty = false +end + return m diff --git a/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/ssrurl.htm b/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/ssrurl.htm index f6b5bff640..6ee2b76ed4 100644 --- a/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/ssrurl.htm +++ b/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/ssrurl.htm @@ -5,7 +5,6 @@ const GET_FLAG_URL = '<%=luci.dispatcher.build_url("admin", "services", "vssr","flag")%>'; var sid; - function getFlag(remark, hosts, sid) { XHR.get(GET_FLAG_URL, { host: hosts, remark: remark }, @@ -67,7 +66,6 @@ return document.getElementById('cbid.vssr.' + sid + id); } - function import_ssr_url(btn, urlname, sids) { sid = sids; var s = document.getElementById(urlname + '-status'); diff --git a/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/update_subscribe.htm b/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/update_subscribe.htm index 97ae38111b..412d6916b2 100644 --- a/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/update_subscribe.htm +++ b/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/update_subscribe.htm @@ -13,8 +13,8 @@ var _responseLen; var noChange = 0; - var modal = '
' + - '
' + + var modal = '
' + + '
' + '

<%:Subscription%>

' + '

<%:Subscribing,Please do not refresh!%>

' + '' + @@ -24,7 +24,10 @@ //显示并开始刷新订阅 function update_subscribe() { $("body").append(modal); - $(".modals-bg").show(); + $(".modals-bg").removeClass("hide"); + setTimeout(function(){ + $(".modals").removeClass("hide"); + }, 200); setTimeout("get_realtime_log();", 500); } //保存订阅按钮 diff --git a/package/ctcgfw/luci-app-vssr/po/zh-cn/vssr.po b/package/ctcgfw/luci-app-vssr/po/zh-cn/vssr.po index ba0b7b14e2..d39453b898 100644 --- a/package/ctcgfw/luci-app-vssr/po/zh-cn/vssr.po +++ b/package/ctcgfw/luci-app-vssr/po/zh-cn/vssr.po @@ -173,7 +173,10 @@ msgid "Alias" msgstr "别名" msgid "V2ray SOCKS5 Proxy" -msgstr "V2ray SOCKS5代理" +msgstr "V2ray SOCKS5 代理" + +msgid "V2ray HTTP Proxy" +msgstr "V2ray HTTP 代理" msgid "Server" msgstr "服务器" @@ -539,6 +542,12 @@ msgstr "用户名" msgid "Socks pass" msgstr "密码" +msgid "HTTP user" +msgstr "用户名" + +msgid "HTTP pass" +msgstr "密码" + msgid "Enable Servers" msgstr "开启服务" diff --git a/package/ctcgfw/luci-app-vssr/root/etc/config/vssr b/package/ctcgfw/luci-app-vssr/root/etc/config/vssr index 088a72a5c5..8db9e5a9ca 100755 --- a/package/ctcgfw/luci-app-vssr/root/etc/config/vssr +++ b/package/ctcgfw/luci-app-vssr/root/etc/config/vssr @@ -21,6 +21,14 @@ config socks5_proxy option Socks_user 'user' option Socks_pass 'password' +config http_proxy + option enable_server '0' + option local_port '1088' + option local_address '0.0.0.0' + option enable_auth '0' + option http_user 'user' + option http_pass 'password' + config access_control option wan_bp_list '/etc/vssr/china_ssr.txt' option lan_ac_mode 'b' diff --git a/package/ctcgfw/luci-app-vssr/root/etc/init.d/vssr b/package/ctcgfw/luci-app-vssr/root/etc/init.d/vssr index 028f6c1df1..b8175707e0 100755 --- a/package/ctcgfw/luci-app-vssr/root/etc/init.d/vssr +++ b/package/ctcgfw/luci-app-vssr/root/etc/init.d/vssr @@ -19,7 +19,12 @@ EXTRA_COMMANDS=rules CONFIG_FILE=/var/etc/${NAME}_t.json CONFIG_UDP_FILE=/var/etc/${NAME}_u.json CONFIG_SOCK5_FILE=/var/etc/${NAME}_s.json +CRON_FILE=/etc/crontabs/root +#定义可执行文件路径 +VSSR_RULES_BIN=/usr/bin/vssr-rules + +#初始化配置 server_count=0 redir_tcp=0 redir_udp=0 @@ -32,9 +37,10 @@ switch_enable=0 shunt_enable=0 switch_server=$1 MAXFD=32768 -CRON_FILE=/etc/crontabs/root threads=1 -scount=0 + + +#读取 uci 数据 uci_get_by_name() { local ret=$(uci get $NAME.$1.$2 2>/dev/null) echo ${ret:=$3} @@ -45,6 +51,24 @@ uci_get_by_type() { echo ${ret:=$3} } +run_mode=$(uci_get_by_type global run_mode) +is_xray=$(uci_get_by_type global use_xray) + +#查找可执行文件 +find_bin() { + case "$1" in + ss) ret="ss-redir" ;; + ss-local) ret="ss-local" ;; + ssr) ret="ssr-redir" ;; + ssr-local) ret="ssr-local" ;; + ssr-server) ret="ssr-server" ;; + v2ray | vless) [[ $is_xray = "1" ]] && ret="xray" || ret="v2ray" ;; + trojan) ret="trojan" ;; + esac + echo $(find /usr -perm /+x -type f -name $ret) +} + +#添加定时执行脚本 add_cron() { sed -i '/vssr.log/d' $CRON_FILE && echo '0 1 * * * echo "" > /tmp/vssr.log' >>$CRON_FILE [ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 $(uci_get_by_type server_subscribe auto_update_time) * * * /usr/bin/lua /usr/share/vssr/subscribe.lua" >>$CRON_FILE @@ -52,13 +76,16 @@ add_cron() { crontab $CRON_FILE } +#删除定时执行脚本 del_cron() { sed -i '/vssr/d' $CRON_FILE sed -i '/vssr.log/d' $CRON_FILE /etc/init.d/cron restart } + +#计算分流数量 count_shunt() { - scount=0 + snum=0 eval shunt_array1="youtube" eval shunt_array2="tw_video" eval shunt_array3="netflix" @@ -71,17 +98,16 @@ count_shunt() { local server_index=$(uci_get_by_type global ${a}_server) local server_type=$(uci_get_by_name $server_index type) if [ "$server_type" != "" ]; then - scount=$(($scount + 1)) + snum=$(($snum + 1)) fi done + echo $snum } -count_shunt -run_mode=$(uci_get_by_type global run_mode) -is_xray=$(uci_get_by_type global use_xray) + +#创建配置文件 gen_config_file() { local hostip=$(uci_get_by_name $1 server) - [ $2 = "0" -a $kcp_flag = "1" ] && hostip="127.0.0.1" if [ $2 = "0" ]; then @@ -93,17 +119,12 @@ gen_config_file() { config_file=$CONFIG_UDP_FILE server_obj=$UDP_RELAY_SERVER fi - if [ $(uci_get_by_name $1 fast_open 0) = "1" ]; then - fastopen="true" - else - fastopen="false" - fi + [[ $(uci_get_by_name $1 fast_open 0) = "1" ]] && fastopen="true" || fastopen="false" local stype=$(uci_get_by_name $1 type) local port=$(uci_get_by_name $1 local_port) - if [ "$stype" == "vless" ]; then - stype="v2ray" - fi + [[ "$stype" == "vless" ]] && stype="v2ray" + if [ "$stype" == "trojan" ]; then if [ "$re_type" == "udp" ]; then re_type="client" @@ -112,16 +133,19 @@ gen_config_file() { re_type="nat" fi fi + local mport=0 if [ $3 = "1" ]; then stype="v2ray" mport=1090 re_type="tcp" fi + lua /usr/share/vssr/genconfig_${stype}.lua ${server_obj} ${re_type} ${port} ${hostip} ${mport} >${config_file} sed -i 's/\\//g' $config_file } +#获取arg输出 get_arg_out() { case "$(uci_get_by_type access_control router_proxy 1)" in 1) echo "-o" ;; @@ -129,6 +153,7 @@ get_arg_out() { esac } +#启动规则 start_rules() { local server=$(uci_get_by_name $GLOBAL_SERVER server) #resolve name @@ -184,15 +209,12 @@ start_rules() { #deal gfw firewall rule local gfwmode="" - if [ "$run_mode" = "gfw" ]; then - gfwmode="-g" - elif [ "$run_mode" = "router" ]; then - gfwmode="-r" - elif [ "$run_mode" = "oversea" ]; then - gfwmode="-c" - elif [ "$run_mode" = "all" ]; then - gfwmode="-z" - fi + case "$run_mode" in + gfw) gfwmode="-g" ;; + router) gfwmode="-r" ;; + oversea) gfwmode="-c" ;; + all) gfwmode="-z" ;; + esac local dports=$(uci_get_by_type global dports 1) if [ $dports = "1" ]; then @@ -201,7 +223,7 @@ start_rules() { proxyport="-m multiport --dports 22,53,587,465,995,993,143,80,443 " fi - /usr/bin/vssr-rules \ + $VSSR_RULES_BIN \ -s "$server" \ -l "$local_port" \ -S "$udp_server" \ @@ -217,6 +239,7 @@ start_rules() { return $? } +#启动PDNSD start_pdnsd() { local usr_dns="$1" local usr_port="$2" @@ -264,24 +287,8 @@ start_pdnsd() { /usr/sbin/pdnsd -c /var/etc/pdnsd.conf -d } -find_bin() { - case "$1" in - ss) ret="/usr/bin/ss-redir" ;; - ss-local) ret="/usr/bin/ss-local" ;; - ssr) ret="/usr/bin/ssr-redir" ;; - ssr-local) ret="/usr/bin/ssr-local" ;; - ssr-server) ret="/usr/bin/ssr-server" ;; - v2ray | vless) - ret="/usr/bin/v2ray/v2ray" && [ ! -f "$ret" ] && ret="/usr/bin/v2ray" - if [ $is_xray = "1" ]; then - ret="/usr/bin/xray" && [ ! -f "$ret" ] && ret="/usr/bin/xray/xray" - fi - ;; - trojan) ret="/usr/sbin/trojan" ;; - esac - echo $ret -} -#分流节点 + +#开启分流 start_shunt() { eval shunt_type1="global" eval shunt_type2="youtube" @@ -359,8 +366,7 @@ start_redir() { local stype=$(uci_get_by_name $GLOBAL_SERVER type) sscmd=$(find_bin $stype) - local utype=$(uci_get_by_name $UDP_RELAY_SERVER type) - ucmd=$(find_bin $utype) + if [ "$(uci_get_by_type global threads 0)" = "0" ]; then threads=$(cat /proc/cpuinfo | grep 'processor' | wc -l) @@ -369,6 +375,7 @@ start_redir() { fi #转发TCP redir_tcp=1 + scount=$(count_shunt) if [ $scount == "0" ]; then local last_config_file=$CONFIG_FILE case "$stype" in @@ -407,6 +414,8 @@ start_redir() { #转发UDP if [ -n "$UDP_RELAY_SERVER" ]; then redir_udp=1 + local utype=$(uci_get_by_name $UDP_RELAY_SERVER type) + ucmd=$(find_bin $utype) gen_config_file $UDP_RELAY_SERVER 1 0 last_config_file=$CONFIG_UDP_FILE case "$stype" in @@ -466,11 +475,7 @@ start_redir() { } gen_service_file() { - if [ $(uci_get_by_name $1 fast_open) = "1" ]; then - fastopen="true" - else - fastopen="false" - fi + [[ $(uci_get_by_name $1 fast_open) = "1" ]] && fastopen="true" || fastopen="false" cat <<-EOF >$2 { "server": "0.0.0.0", @@ -503,6 +508,7 @@ start_service() { iptables -t filter -A SSR-SERVER-RULE -p udp --dport $(uci_get_by_name $1 server_port) -j ACCEPT return 0 } + gen_serv_include() { FWI=$(uci get firewall.vssr.path 2>/dev/null) [ -n "$FWI" ] || return 0 @@ -534,15 +540,17 @@ start_server() { } start_local() { - local local_server=$(uci_get_by_type socks5_proxy enable_server) + local socks_server=$(uci_get_by_type socks5_proxy enable_server) + local http_server=$(uci_get_by_type http_proxy enable_server) - [ "$local_server" = "0" ] && return 1 + if [ "$socks_server" = "0" -a "$http_server" = "0" ]; then + return 1 + fi mkdir -p /var/run /var/etc lua /usr/share/vssr/genconfig_v2ray_s.lua >$CONFIG_SOCK5_FILE sed -i 's/\\//g' $config_file socksbin=$(find_bin "v2ray") - echo $socksbin $socksbin -config $CONFIG_SOCK5_FILE >/dev/null 2>&1 & local_enable=1 } @@ -638,7 +646,7 @@ stop() { killall -q -9 ss-redir ss-local obfs-local ssr-redir ssr-local ssr-server v2ray v2ray-plugin xray trojan microsocks ipt2socks dns2socks pdnsd if [ -f "/tmp/dnsmasq.d/dnsmasq-ssr.conf" ]; then - rm -f /tmp/dnsmasq.d/dnsmasq-ssr.conf /tmp/dnsmasq.ssr /tmp/dnsmasq.oversea + rm -rf /tmp/dnsmasq.d/dnsmasq-ssr.conf /tmp/dnsmasq.ssr /tmp/dnsmasq.oversea /etc/init.d/dnsmasq restart >/dev/null 2>&1 fi del_cron diff --git a/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/genconfig_v2ray_s.lua b/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/genconfig_v2ray_s.lua index 17d7e7c8b9..beed53de26 100755 --- a/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/genconfig_v2ray_s.lua +++ b/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/genconfig_v2ray_s.lua @@ -2,25 +2,47 @@ local ucursor = require 'luci.model.uci'.cursor() local name = 'vssr' local json = require 'luci.jsonc' local proto = 'socks' +local socks_switch = ucursor:get_first(name, 'socks5_proxy', 'enable_server') local auth_type = ucursor:get_first(name, 'socks5_proxy', 'enable_auth') local local_port = ucursor:get_first(name, 'socks5_proxy', 'local_port') local Socks_user = ucursor:get_first(name, 'socks5_proxy', 'Socks_user') local Socks_pass = ucursor:get_first(name, 'socks5_proxy', 'Socks_pass') +local http_switch = ucursor:get_first(name, 'socks5_proxy', 'enable_server') +local auth_typeh = ucursor:get_first(name, 'http_proxy', 'enable_auth') +local local_porth = ucursor:get_first(name, 'http_proxy', 'local_port') +local http_user = ucursor:get_first(name, 'http_proxy', 'http_user') +local http_pass = ucursor:get_first(name, 'http_proxy', 'http_pass') + +function gen_inbound(sw, auth_type, local_port, user, pass, proto) + local bound = {} + if sw == 0 then + bound = nil + else + bound = { + port = local_port, + protocol = proto, + settings = { + auth = (auth_type == '1') and 'password' or 'noauth', + accounts = (auth_type == '1') and {{user = (auth_type == '1') and user, pass = pass}} or nil + } + } + end + return bound +end + +inbounds_table = {} + +table.insert(inbounds_table, gen_inbound(socks_switch, auth_type, local_port, Socks_user, Socks_pass, 'socks')) +table.insert(inbounds_table, gen_inbound(http_switch, auth_typeh, local_porth, http_user, http_pass, 'http')) + local v2ray = { log = { -- error = "/var/log/v2ray.log", loglevel = 'warning' }, -- 传入连接 - inbound = { - port = local_port, - protocol = proto, - settings = { - auth = (auth_type == '1') and 'password' or 'noauth', - accounts = (auth_type == '1') and {{user = (auth_type == '1') and Socks_user, pass = Socks_pass}} or nil - } - }, + inbounds = inbounds_table, -- 传出连接 outbound = {protocol = 'freedom'}, -- 额外传出连接 diff --git a/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/subscribe.lua b/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/subscribe.lua index 357f3ec6b7..6397a5b543 100644 --- a/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/subscribe.lua +++ b/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/subscribe.lua @@ -390,7 +390,7 @@ local execute = function() end -- diff do - assert(next(nodeResult), 'node result is empty') + assert(next(nodeResult), '获取不到节点信息,请检查路由器是否能够访问网络,或者订阅链接是否正确') local add, del = 0, 0 ucic:foreach( name, @@ -453,7 +453,7 @@ if subscribe_url and #subscribe_url > 0 then execute, function(e) log(e) - log(debug.traceback()) + -- log(debug.traceback()) log('发生错误, 正在恢复服务') log('END SUBSCRIBE') local firstServer = ucic:get_first(name, uciType) diff --git a/package/ctcgfw/luci-app-vssr/root/www/luci-static/vssr/css/vssr.css b/package/ctcgfw/luci-app-vssr/root/www/luci-static/vssr/css/vssr.css index a523425925..394ed97a77 100644 --- a/package/ctcgfw/luci-app-vssr/root/www/luci-static/vssr/css/vssr.css +++ b/package/ctcgfw/luci-app-vssr/root/www/luci-static/vssr/css/vssr.css @@ -622,7 +622,12 @@ footer.mobile-hide { left: 0; top: 0; background: rgba(255, 255, 255, 0.8); - display: none; + transition: all 0.2s; +} + +.modals-bg.hide{ + visibility: hidden; + opacity: 0; } .modals { @@ -642,6 +647,14 @@ footer.mobile-hide { /* Firefox */ -webkit-box-sizing: border-box; /* Safari */ + transition: all 0.3s ease-in-out; + transform: scale(1); +} + +.modals.hide{ + visibility: hidden; + opacity: 0; + transform: scale(0.5); } .modals h2 { From 58af1052e4abe403cc62ba4d42b7f563392eb1cc Mon Sep 17 00:00:00 2001 From: xiaorouji <60100640+xiaorouji@users.noreply.github.com> Date: Mon, 11 Jan 2021 22:16:29 +0800 Subject: [PATCH 11/13] luci-app-passwall: bump to 4-7 Signed-off-by: CN_SZTL --- package/lienol/luci-app-passwall/Makefile | 4 +- .../model/cbi/passwall/api/gen_xray.lua | 2 +- .../model/cbi/passwall/client/global.lua | 3 + .../luasrc/view/passwall/global/footer.htm | 4 + .../luasrc/view/passwall/global/status.htm | 62 +- .../luasrc/view/passwall/global/status2.htm | 78 +- .../view/passwall/node_list/node_list.htm | 40 +- .../root/etc/config/passwall | 1 + .../root/usr/share/passwall/app.sh | 14 +- .../root/usr/share/passwall/iptables.sh | 42 +- .../root/usr/share/passwall/rules/chnlist | 6408 ++++++----------- .../root/usr/share/passwall/rules/chnroute | 74 +- .../root/usr/share/passwall/rules/chnroute6 | 43 +- .../usr/share/passwall/rules/gfwlist.conf | 5972 +++++++-------- 14 files changed, 5346 insertions(+), 7401 deletions(-) diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile index 81094c77f3..f4e631b6d2 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:=4 -PKG_RELEASE:=6 -PKG_DATE:=20210104 +PKG_RELEASE:=7 +PKG_DATE:=20210111 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua index 63d823a3ab..0302032b64 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua @@ -174,7 +174,7 @@ if node_section then listen = "0.0.0.0", port = tonumber(socks_proxy_port), protocol = "socks", - settings = {auth = "noauth", udp = true, ip = "127.0.0.1"} + settings = {auth = "noauth", udp = true} }) network = "tcp,udp" end diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua index 24236c0d61..458a2dda94 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua @@ -322,6 +322,9 @@ o = s:taboption("tips", DummyValue, "") o.template = appname .. "/global/tips" -- [[ Socks Server ]]-- +o = s:taboption("Main", Flag, "socks_enabled", "Socks" .. translate("Main switch")) +o.rmempty = false + s = m:section(TypedSection, "socks", translate("Socks Config")) s.anonymous = true s.addremove = true diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/footer.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/footer.htm index 8e033c92aa..3fdc23c66d 100644 --- a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/footer.htm +++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/footer.htm @@ -72,6 +72,10 @@ local auto_switch = api.uci_get_type("auto_switch", "enable", 0) var socks = document.getElementById("cbi-passwall-socks"); if (socks) { + var socks_enabled_dom = document.getElementById(global_id + "-socks_enabled"); + socks_enabled_dom.parentNode.removeChild(socks_enabled_dom); + var descr = socks.getElementsByClassName("cbi-section-descr")[0]; + descr.outerHTML = socks_enabled_dom.outerHTML; rows = socks.getElementsByClassName("cbi-section-table-row"); for (var i = 0; i < rows.length; i++) { var row = rows[i]; diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm index 8d05751bb0..611644826e 100644 --- a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm +++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm @@ -12,7 +12,7 @@ Copyright 2013 Yahoo! Licensed under the BSD License. https://github.com/pure-css/pure/blob/master/LICENSE.md */ -.pure-g{letter-spacing:-.31em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){table .pure-g{display:block}}.opera-only :-o-prefocus,.pure-g{word-spacing:-.43em}.pure-u{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class*=pure-u]{font-family:sans-serif}.pure-u-1,.pure-u-1-1,.pure-u-1-12,.pure-u-1-2,.pure-u-1-24,.pure-u-1-3,.pure-u-1-4,.pure-u-1-5,.pure-u-1-6,.pure-u-1-8,.pure-u-10-24,.pure-u-11-12,.pure-u-11-24,.pure-u-12-24,.pure-u-13-24,.pure-u-14-24,.pure-u-15-24,.pure-u-16-24,.pure-u-17-24,.pure-u-18-24,.pure-u-19-24,.pure-u-2-24,.pure-u-2-3,.pure-u-2-5,.pure-u-20-24,.pure-u-21-24,.pure-u-22-24,.pure-u-23-24,.pure-u-24-24,.pure-u-3-24,.pure-u-3-4,.pure-u-3-5,.pure-u-3-8,.pure-u-4-24,.pure-u-4-5,.pure-u-5-12,.pure-u-5-24,.pure-u-5-5,.pure-u-5-6,.pure-u-5-8,.pure-u-6-24,.pure-u-7-12,.pure-u-7-24,.pure-u-7-8,.pure-u-8-24,.pure-u-9-24{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-u-1-24{width:4.1667%}.pure-u-1-12,.pure-u-2-24{width:8.3333%}.pure-u-1-8,.pure-u-3-24{width:12.5%}.pure-u-1-6,.pure-u-4-24{width:16.6667%}.pure-u-1-5{width:20%}.pure-u-5-24{width:20.8333%}.pure-u-1-4,.pure-u-6-24{width:25%}.pure-u-7-24{width:29.1667%}.pure-u-1-3,.pure-u-8-24{width:33.3333%}.pure-u-3-8,.pure-u-9-24{width:37.5%}.pure-u-2-5{width:40%}.pure-u-10-24,.pure-u-5-12{width:41.6667%}.pure-u-11-24{width:45.8333%}.pure-u-1-2,.pure-u-12-24{width:50%}.pure-u-13-24{width:54.1667%}.pure-u-14-24,.pure-u-7-12{width:58.3333%}.pure-u-3-5{width:60%}.pure-u-15-24,.pure-u-5-8{width:62.5%}.pure-u-16-24,.pure-u-2-3{width:66.6667%}.pure-u-17-24{width:70.8333%}.pure-u-18-24,.pure-u-3-4{width:75%}.pure-u-19-24{width:79.1667%}.pure-u-4-5{width:80%}.pure-u-20-24,.pure-u-5-6{width:83.3333%}.pure-u-21-24,.pure-u-7-8{width:87.5%}.pure-u-11-12,.pure-u-22-24{width:91.6667%}.pure-u-23-24{width:95.8333%}.pure-u-1,.pure-u-1-1,.pure-u-24-24,.pure-u-5-5{width:100%} +.pure-g{letter-spacing:-.31em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) {table .pure-g{display:block}}.opera-only :-o-prefocus,.pure-g{word-spacing:-.43em}.pure-u{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class*=pure-u]{font-family:sans-serif}.pure-u-1,.pure-u-1-1,.pure-u-1-12,.pure-u-1-2,.pure-u-1-24,.pure-u-1-3,.pure-u-1-4,.pure-u-1-5,.pure-u-1-6,.pure-u-1-8,.pure-u-10-24,.pure-u-11-12,.pure-u-11-24,.pure-u-12-24,.pure-u-13-24,.pure-u-14-24,.pure-u-15-24,.pure-u-16-24,.pure-u-17-24,.pure-u-18-24,.pure-u-19-24,.pure-u-2-24,.pure-u-2-3,.pure-u-2-5,.pure-u-20-24,.pure-u-21-24,.pure-u-22-24,.pure-u-23-24,.pure-u-24-24,.pure-u-3-24,.pure-u-3-4,.pure-u-3-5,.pure-u-3-8,.pure-u-4-24,.pure-u-4-5,.pure-u-5-12,.pure-u-5-24,.pure-u-5-5,.pure-u-5-6,.pure-u-5-8,.pure-u-6-24,.pure-u-7-12,.pure-u-7-24,.pure-u-7-8,.pure-u-8-24,.pure-u-9-24{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-u-1-24{width:4.1667%}.pure-u-1-12,.pure-u-2-24{width:8.3333%}.pure-u-1-8,.pure-u-3-24{width:12.5%}.pure-u-1-6,.pure-u-4-24{width:16.6667%}.pure-u-1-5{width:20%}.pure-u-5-24{width:20.8333%}.pure-u-1-4,.pure-u-6-24{width:25%}.pure-u-7-24{width:29.1667%}.pure-u-1-3,.pure-u-8-24{width:33.3333%}.pure-u-3-8,.pure-u-9-24{width:37.5%}.pure-u-2-5{width:40%}.pure-u-10-24,.pure-u-5-12{width:41.6667%}.pure-u-11-24{width:45.8333%}.pure-u-1-2,.pure-u-12-24{width:50%}.pure-u-13-24{width:54.1667%}.pure-u-14-24,.pure-u-7-12{width:58.3333%}.pure-u-3-5{width:60%}.pure-u-15-24,.pure-u-5-8{width:62.5%}.pure-u-16-24,.pure-u-2-3{width:66.6667%}.pure-u-17-24{width:70.8333%}.pure-u-18-24,.pure-u-3-4{width:75%}.pure-u-19-24{width:79.1667%}.pure-u-4-5{width:80%}.pure-u-20-24,.pure-u-5-6{width:83.3333%}.pure-u-21-24,.pure-u-7-8{width:87.5%}.pure-u-11-12,.pure-u-22-24{width:91.6667%}.pure-u-23-24{width:95.8333%}.pure-u-1,.pure-u-1-1,.pure-u-24-24,.pure-u-5-5{width:100%} .block { margin: 0.5rem; padding: 0; @@ -237,67 +237,35 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md var status_haproxy = document.getElementById('status_haproxy'); var status_kcptun = document.getElementById('status_kcptun'); if (data) { - var tcp_node_num = 1; - if (tcp_node_num >= 1) { + if (true) { var status_tcp_node = document.getElementById('status_tcp_node'); if (status_tcp_node) { var text = 'TCP
'; - if (tcp_node_num == 1) { - if (data["tcp_node_status"]) - text += '<%:RUNNING%>'; - else - text += '<%:NOT RUNNING%>'; - } else { - for(var i = 0; i < tcp_node_num; i++) { - var k = i + 1; - if (data["tcp_node" + k + "_status"]) - text += ''; - else - text += ' X'; - } - } + if (data["tcp_node_status"]) + text += '<%:RUNNING%>'; + else + text += '<%:NOT RUNNING%>'; status_tcp_node.innerHTML = text; } var status_kcptun = document.getElementById('status_kcptun'); if (status_kcptun) { var text = 'Kcptun
'; - if (tcp_node_num == 1) { - if (data["kcptun_tcp_node_status"]) - text += '<%:RUNNING%>'; - else - text += '<%:NOT RUNNING%>'; - } else { - for(var i = 0; i < tcp_node_num; i++) { - var k = i + 1; - if (data["kcptun_tcp_node" + k + "_status"]) - text += ''; - else - text += ' X'; - } - } + if (data["kcptun_tcp_node_status"]) + text += '<%:RUNNING%>'; + else + text += '<%:NOT RUNNING%>'; status_kcptun.innerHTML = text; } } - var udp_node_num = 1; - if (udp_node_num >= 1) { + if (true) { var status_udp_node = document.getElementById('status_udp_node'); if (status_udp_node) { var text = 'UDP
'; - if (udp_node_num == 1) { - if (data["udp_node_status"]) - text += '<%:RUNNING%>'; - else - text += '<%:NOT RUNNING%>'; - } else { - for(var i = 0; i < udp_node_num; i++) { - var k = i + 1; - if (data["udp_node" + k + "_status"]) - text += ''; - else - text += ' X'; - } - } + if (data["udp_node_status"]) + text += '<%:RUNNING%>'; + else + text += '<%:NOT RUNNING%>'; status_udp_node.innerHTML = text; } } diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm index 3dbab23185..05234f7f72 100644 --- a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm +++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm @@ -161,65 +161,33 @@ local status = api.uci_get_type("global_other", "status", "") if (x && x.status == 200) { var tcp_node_status = document.getElementById('_tcp_node_status'); if (tcp_node_status) { - var tcp_node_num = 1; - if (tcp_node_num >= 1) { + if (true) { var text = ''; - if (tcp_node_num == 1) { - if (json["tcp_node_status"]) - text += '<%:RUNNING%> ✓'; - else - text += '<%:NOT RUNNING%> X'; - } else { - for(var i = 0; i < tcp_node_num; i++) { - var k = i + 1; - if (json["tcp_node" + k + "_status"]) - text += ''; - else - text += ' X'; - } - } + if (json["tcp_node_status"]) + text += '<%:RUNNING%> ✓'; + else + text += '<%:NOT RUNNING%> X'; tcp_node_status.innerHTML = text; var kcptun_tcp_node_status = document.getElementById('_kcptun_tcp_node_status'); text = ""; - if (tcp_node_num == 1) { - if (json["kcptun_tcp_node_status"]) - text += '<%:RUNNING%> ✓'; - else - text += '<%:NOT RUNNING%> X'; - } else { - for(var i = 0; i < tcp_node_num; i++) { - var k = i + 1; - if (json["tcp_node" + k + "_status"]) - text += ''; - else - text += ' X'; - } - } - if(kcptun_tcp_node_status) + if (json["kcptun_tcp_node_status"]) + text += '<%:RUNNING%> ✓'; + else + text += '<%:NOT RUNNING%> X'; + if (kcptun_tcp_node_status) kcptun_tcp_node_status.innerHTML = text; } } var udp_node_status = document.getElementById('_udp_node_status'); if (udp_node_status) { - var udp_node_num = 1; - if (udp_node_num >= 1) { + if (true) { var text = ''; - if (udp_node_num == 1) { - if (json["udp_node_status"]) - text += '<%:RUNNING%> ✓'; - else - text += '<%:NOT RUNNING%> X'; - } else { - for(var i = 0; i < udp_node_num; i++) { - var k = i + 1; - if (json["udp_node" + k + "_status"]) - text += ''; - else - text += ' X'; - } - } + if (json["udp_node_status"]) + text += '<%:RUNNING%> ✓'; + else + text += '<%:NOT RUNNING%> X'; udp_node_status.innerHTML = text; } } @@ -251,20 +219,18 @@ local status = api.uci_get_type("global_other", "status", "") } else { color = "red"; } - //s.setAttribute("color", color); - btn.setAttribute("style","color: " + color + " !important"); - btn.value = use_time + " ms";; + s.setAttribute("color", color); + s.innerHTML = use_time + " ms"; } else if (rv.status) { - btn.setAttribute("style","color: green !important"); - btn.value = "<%:Working...%>"; + s.setAttribute("color", "green"); + s.innerHTML = "<%:Working...%>"; } else { - //s.setAttribute("color", "red"); - btn.setAttribute("style","color: red !important"); - btn.value = '<%:Problem detected!%> X'; + s.setAttribute("color", "red"); + s.innerHTML = '<%:Problem detected!%> X'; } } btn.disabled = false; - //btn.value = '<%:Check%>'; + btn.value = '<%:Check%>'; } ); return false; diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm index 77a31ed1f6..0079d4a43e 100644 --- a/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm +++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm @@ -2,8 +2,6 @@ -- Copyright (C) 2018-2020 L-WRT Team local api = require "luci.model.cbi.passwall.api.api" local dsp = require "luci.dispatcher" - - local nodes_display = api.uci_get_type("global_other", "nodes_display", "") -%>