From 16e453e4acc39eb0a3bc403f37697cd4083cdf14 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 16 Sep 2021 03:15:04 +0800 Subject: [PATCH] v2raya: Update to 1.5.3 - Added missing conffiles - Refreshed init srcipt to adapt the new arguments - Renamed package name to lowercase (suggestion from upstream) - Updated dependencies and license Signed-off-by: Tianling Shen --- net/v2raya/Makefile | 25 ++++++++++++++++--------- net/v2raya/files/v2raya.config | 22 +++++++++++++++------- net/v2raya/files/v2raya.init | 33 +++++++++++++++++++++------------ 3 files changed, 52 insertions(+), 28 deletions(-) diff --git a/net/v2raya/Makefile b/net/v2raya/Makefile index 76f8f18d9..f19259f3e 100644 --- a/net/v2raya/Makefile +++ b/net/v2raya/Makefile @@ -5,15 +5,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2rayA -PKG_VERSION:=1.5.2 +PKG_VERSION:=1.5.3 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/v2rayA/v2rayA/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=3611b9fa5a6e0421007f2a3ce9671847ffc39e82e1caa6782eff5db470e92fe0 +PKG_HASH:=0f6faeb297279dba138c2afc8525f090f965a0141a4f9d071165ea8500921a55 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/service -PKG_LICENSE:=GPL-3.0-only +PKG_LICENSE:=AGPL-3.0-only PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Tianling Shen @@ -22,7 +22,7 @@ PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 GO_PKG:=github.com/v2rayA/v2rayA -GO_PKG_LDFLAGS_X:=$(GO_PKG)/global.Version=$(PKG_VERSION) +GO_PKG_LDFLAGS_X:=$(GO_PKG)/conf.Version=$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk include ../../lang/golang/golang-package.mk @@ -30,13 +30,15 @@ include ../../lang/golang/golang-package.mk TAR_OPTIONS+= --strip-components 1 TAR_CMD=$(HOST_TAR) -C $(1)/.. $(TAR_OPTIONS) -define Package/v2rayA +define Package/v2raya TITLE:=A Linux web GUI client of Project V SECTION:=net CATEGORY:=Network SUBMENU:=Web Servers/Proxies DEPENDS:=$(GO_ARCH_DEPENDS) \ +ca-bundle \ + +iptables-mod-conntrack-extra \ + +iptables-mod-extra \ +iptables-mod-filter \ +iptables-mod-tproxy \ +kmod-ipt-nat6 \ @@ -44,11 +46,16 @@ define Package/v2rayA URL:=https://v2raya.org endef -define Package/v2rayA/description +define Package/v2raya/description v2rayA is a V2Ray Linux client supporting global transparent proxy, compatible with SS, SSR, Trojan(trojan-go), PingTunnel protocols. endef +define Package/v2raya/conffiles +/etc/v2raya/ +/etc/config/v2raya +endef + define Build/Compile ( \ pushd $(PKG_BUILD_DIR)/../gui ; \ @@ -59,7 +66,7 @@ define Build/Compile ) endef -define Package/v2rayA/install +define Package/v2raya/install $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR)) $(INSTALL_DIR) $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v2rayA $(1)/usr/bin/v2raya @@ -70,5 +77,5 @@ define Package/v2rayA/install $(INSTALL_BIN) $(CURDIR)/files/v2raya.init $(1)/etc/init.d/v2raya endef -$(eval $(call GoBinPackage,v2rayA)) -$(eval $(call BuildPackage,v2rayA)) +$(eval $(call GoBinPackage,v2raya)) +$(eval $(call BuildPackage,v2raya)) diff --git a/net/v2raya/files/v2raya.config b/net/v2raya/files/v2raya.config index 04b1a3f81..841b90a2a 100644 --- a/net/v2raya/files/v2raya.config +++ b/net/v2raya/files/v2raya.config @@ -8,11 +8,22 @@ config v2raya 'config' # v2rayA configuration directory option config '/etc/v2raya' - # force open ipv6 - option force_ipv6_on '0' + # Make sure your IPv6 network works fine before you turn it on. + # Optional values: auto, on, off. + option ipv6_support 'auto' - # ssr, pingTunnel, etc. - option plugin_listen_port '32346' + # Optional values: trace, debug, info, warn or error + option log_level 'info' + + # The path of log file + option log_file '/tmp/v2raya.log' + + # Maximum number of days to keep log files + option log_max_days '3' + + option log_disable_color '1' + + option log_disable_timestamp '0' # Executable v2ray binary path. Auto-detect if put it empty option v2ray_bin '' @@ -24,6 +35,3 @@ config v2raya 'config' # Example: /etc/v2raya/grpc_certificate.crt,/etc/v2raya/grpc_private.key option vless_grpc_inbound_cert_key '' - # Print detailed v2ray-core log to stdout - option verbose '0' - diff --git a/net/v2raya/files/v2raya.init b/net/v2raya/files/v2raya.init index 3a41479ae..cb8173711 100755 --- a/net/v2raya/files/v2raya.init +++ b/net/v2raya/files/v2raya.init @@ -9,7 +9,7 @@ PROG="/usr/bin/v2raya" is_enabled() { local enabled - config_get enabled "$1" "$2" "${3:-0}" + config_get_bool enabled "$1" "$2" "${3:-0}" if [ "$enabled" -eq "1" ]; then return 0 else @@ -18,13 +18,17 @@ is_enabled() { } append_param() { - procd_append_param command "--$1" $2 + procd_append_param command "$1" $2 } append_param_arg() { local value - config_get value "$1" "$2" $4 - [ -n "$value" ] && append_param "$3" "$value" + config_get value "$1" "$2" $3 + [ -n "$value" ] && append_param "--${2//_/-}" "$value" +} + +append_param_bool() { + is_enabled "$1" "$2" && append_param "--${2//_/-}" } start_service() { @@ -35,17 +39,22 @@ start_service() { procd_open_instance "$CONF" procd_set_param command "$PROG" - append_param_arg "config" "address" "address" "0.0.0.0:2017" - append_param_arg "config" "config" "config" "/etc/v2raya" - append_param_arg "config" "plugin_listen_port" "pluginlistenport" "32346" - append_param_arg "config" "v2ray_bin" "v2ray-bin" - append_param_arg "config" "v2ray_confdir" "v2ray-confdir" - append_param_arg "config" "vless_grpc_inbound_cert_key" "vless-grpc-inbound-cert-key" - is_enabled "config" "force_ipv6_on" && append_param "force-ipv6-on" - is_enabled "config" "verbose" && append_param "verbose" + append_param_arg "config" "address" "0.0.0.0:2017" + append_param_arg "config" "config" "/etc/v2raya" + append_param_arg "config" "ipv6_support" "auto" + append_param_arg "config" "log_level" "info" + append_param_arg "config" "log_file" "/tmp/v2raya.log" + append_param_arg "config" "log_max_days" "3" + append_param_arg "config" "v2ray_bin" + append_param_arg "config" "v2ray_confdir" + append_param_arg "config" "vless_grpc_inbound_cert_key" + append_param_bool "config" "log_disable_color" + append_param_bool "config" "log_disable_timestamp" procd_set_param limits core="unlimited" procd_set_param respawn + procd_set_param stdout 1 + procd_set_param stderr 1 procd_close_instance }