OSDN Git Service

v2raya: add options to support hook scripts
authorTianling Shen <cnsztl@immortalwrt.org>
Sat, 22 Oct 2022 08:03:05 +0000 (16:03 +0800)
committerTianling Shen <cnsztl@immortalwrt.org>
Sat, 22 Oct 2022 08:03:05 +0000 (16:03 +0800)
See https://v2raya.org/docs/manual/hook/ for details.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
v2raya/files/v2raya.config
v2raya/files/v2raya.init

index fbda474..d9ff365 100644 (file)
@@ -31,6 +31,19 @@ config v2raya 'config'
        # Additional v2ray config directory, files in it will be combined with config generated by v2rayA
        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.
        # Example: /etc/v2raya/grpc_certificate.crt,/etc/v2raya/grpc_private.key
        option vless_grpc_inbound_cert_key ''
index 9c207f7..4120e90 100755 (executable)
@@ -48,6 +48,9 @@ start_service() {
        append_env_arg "config" "log_max_days" "3"
        append_env_arg "config" "v2ray_bin"
        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_bool "config" "log_disable_color"
        append_env_bool "config" "log_disable_timestamp"