From 1ad5c032b359c0febf46514ac87d31d22f5f8c9a Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 26 Dec 2024 16:16:37 +0800 Subject: [PATCH] fix: add missing proto --- venus-core/build.rs | 5 +-- venus-core/proto/config.proto | 63 +++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 venus-core/proto/config.proto diff --git a/venus-core/build.rs b/venus-core/build.rs index de9d0a4..ed3cdb2 100644 --- a/venus-core/build.rs +++ b/venus-core/build.rs @@ -13,8 +13,9 @@ fn main() -> Result<(), Box> { if entry.clone().file_type().is_dir() { continue; } - // warn!("{}", entry?.path().display()); - tonic_build::compile_protos(entry.path().to_str().unwrap())?; + tonic_build::configure() + .build_server(false) + .compile_protos(&[entry.path().to_str().unwrap()], &["proto"])?; } Ok(()) } diff --git a/venus-core/proto/config.proto b/venus-core/proto/config.proto new file mode 100644 index 0000000..8bcfd5f --- /dev/null +++ b/venus-core/proto/config.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; + +package v2ray.core; +option csharp_namespace = "V2Ray.Core"; +option go_package = "github.com/v2fly/v2ray-core/v5;core"; +option java_package = "com.v2ray.core"; +option java_multiple_files = true; + +import "google/protobuf/any.proto"; +import "transport/config.proto"; + +// Config is the master config of V2Ray. V2Ray takes this config as input and +// functions accordingly. +message Config { + // Inbound handler configurations. Must have at least one item. + repeated InboundHandlerConfig inbound = 1; + + // Outbound handler configurations. Must have at least one item. The first + // item is used as default for routing. + repeated OutboundHandlerConfig outbound = 2; + + reserved 3; + + // App is for configurations of all features in V2Ray. A feature must + // implement the Feature interface, and its config type must be registered + // through common.RegisterConfig. + repeated google.protobuf.Any app = 4; + + // Transport settings. + // Deprecated. Each inbound and outbound should choose their own transport + // config. Date to remove: 2020-01-13 + v2ray.core.transport.Config transport = 5 [deprecated = true]; + + // Configuration for extensions. The config may not work if corresponding + // extension is not loaded into V2Ray. V2Ray will ignore such config during + // initialization. + repeated google.protobuf.Any extension = 6; +} + +// InboundHandlerConfig is the configuration for inbound handler. +message InboundHandlerConfig { + // Tag of the inbound handler. The tag must be unique among all inbound + // handlers + string tag = 1; + // Settings for how this inbound proxy is handled. + google.protobuf.Any receiver_settings = 2; + // Settings for inbound proxy. Must be one of the inbound proxies. + google.protobuf.Any proxy_settings = 3; +} + +// OutboundHandlerConfig is the configuration for outbound handler. +message OutboundHandlerConfig { + // Tag of this outbound handler. + string tag = 1; + // Settings for how to dial connection for this outbound handler. + google.protobuf.Any sender_settings = 2; + // Settings for this outbound proxy. Must be one of the outbound proxies. + google.protobuf.Any proxy_settings = 3; + // If not zero, this outbound will be expired in seconds. Not used for now. + int64 expire = 4; + // Comment of this outbound handler. Not used for now. + string comment = 5; +}