浏览代码

v2raya: add options to support hook scripts

See https://v2raya.org/docs/manual/hook/ for details.

Signed-off-by: Tianling Shen <[email protected]>
Tianling Shen 2 年之前
父节点
当前提交
2863939087
共有 2 个文件被更改,包括 16 次插入0 次删除
  1. 13 0
      v2raya/files/v2raya.config
  2. 3 0
      v2raya/files/v2raya.init

+ 13 - 0
v2raya/files/v2raya.config

@@ -31,6 +31,19 @@ config v2raya 'config'
 	# Additional v2ray config directory, files in it will be combined with config generated by v2rayA
 	# Additional v2ray config directory, files in it will be combined with config generated by v2rayA
 	option v2ray_confdir ''
 	option v2ray_confdir ''
 
 
+	# The executable file to run in the transparent proxy life-cycle.
+	# v2rayA will pass in the --transparent-type (tproxy, redirect)
+	#   and --stage (pre-start, post-start, pre-stop, post-stop) arguments.
+	option transparent_hook ''
+
+	# The executable file to run in the v2ray-core life-cycle.
+	# v2rayA will pass in the --stage (pre-start, post-start, pre-stop, post-stop) argument.
+	option core_hook ''
+
+	# The executable file to run in the v2ray-core life-cycle.
+	# v2rayA will pass in the --stage (pre-start, post-start, pre-stop, post-stop) argument.
+	option plugin_manager ''
+
 	# Specify the certification path instead of automatically generating a self-signed certificate.
 	# Specify the certification path instead of automatically generating a self-signed certificate.
 	# Example: /etc/v2raya/grpc_certificate.crt,/etc/v2raya/grpc_private.key
 	# Example: /etc/v2raya/grpc_certificate.crt,/etc/v2raya/grpc_private.key
 	option vless_grpc_inbound_cert_key ''
 	option vless_grpc_inbound_cert_key ''

+ 3 - 0
v2raya/files/v2raya.init

@@ -48,6 +48,9 @@ start_service() {
 	append_env_arg "config" "log_max_days" "3"
 	append_env_arg "config" "log_max_days" "3"
 	append_env_arg "config" "v2ray_bin"
 	append_env_arg "config" "v2ray_bin"
 	append_env_arg "config" "v2ray_confdir"
 	append_env_arg "config" "v2ray_confdir"
+	append_env_arg "config" "transparent_hook"
+	append_env_arg "config" "core_hook"
+	append_env_arg "config" "plugin_manager"
 	append_env_arg "config" "vless_grpc_inbound_cert_key"
 	append_env_arg "config" "vless_grpc_inbound_cert_key"
 	append_env_bool "config" "log_disable_color"
 	append_env_bool "config" "log_disable_color"
 	append_env_bool "config" "log_disable_timestamp"
 	append_env_bool "config" "log_disable_timestamp"