mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 10:14:35 +00:00
Feat/web (Patchset 4) (#460)
support basic functions in frontend 1. create/del network 2. inspect network running status
This commit is contained in:
@@ -4,6 +4,24 @@ import "error.proto";
|
||||
|
||||
package common;
|
||||
|
||||
message FlagsInConfig {
|
||||
string default_protocol = 1;
|
||||
string dev_name = 2;
|
||||
bool enable_encryption = 3;
|
||||
bool enable_ipv6 = 4;
|
||||
uint32 mtu = 5;
|
||||
bool latency_first = 6;
|
||||
bool enable_exit_node = 7;
|
||||
bool no_tun = 8;
|
||||
bool use_smoltcp = 9;
|
||||
string foreign_network_whitelist = 10;
|
||||
bool disable_p2p = 11;
|
||||
bool relay_all_peer_rpc = 12;
|
||||
bool disable_udp_hole_punching = 13;
|
||||
string ipv6_listener = 14;
|
||||
bool multi_thread = 15;
|
||||
}
|
||||
|
||||
message RpcDescriptor {
|
||||
// allow same service registered multiple times in different domain
|
||||
string domain_name = 1;
|
||||
@@ -45,8 +63,10 @@ message RpcPacket {
|
||||
message Void {}
|
||||
|
||||
message UUID {
|
||||
uint64 high = 1;
|
||||
uint64 low = 2;
|
||||
uint32 part1 = 1;
|
||||
uint32 part2 = 2;
|
||||
uint32 part3 = 3;
|
||||
uint32 part4 = 4;
|
||||
}
|
||||
|
||||
enum NatType {
|
||||
|
||||
@@ -7,13 +7,21 @@ include!(concat!(env!("OUT_DIR"), "/common.rs"));
|
||||
impl From<uuid::Uuid> for Uuid {
|
||||
fn from(uuid: uuid::Uuid) -> Self {
|
||||
let (high, low) = uuid.as_u64_pair();
|
||||
Uuid { low, high }
|
||||
Uuid {
|
||||
part1: (high >> 32) as u32,
|
||||
part2: (high & 0xFFFFFFFF) as u32,
|
||||
part3: (low >> 32) as u32,
|
||||
part4: (low & 0xFFFFFFFF) as u32,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Uuid> for uuid::Uuid {
|
||||
fn from(uuid: Uuid) -> Self {
|
||||
uuid::Uuid::from_u64_pair(uuid.high, uuid.low)
|
||||
uuid::Uuid::from_u64_pair(
|
||||
(u64::from(uuid.part1) << 32) | u64::from(uuid.part2),
|
||||
(u64::from(uuid.part3) << 32) | u64::from(uuid.part4),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,42 @@ import "cli.proto";
|
||||
|
||||
package web;
|
||||
|
||||
enum NetworkingMethod {
|
||||
PublicServer = 0;
|
||||
Manual = 1;
|
||||
Standalone = 2;
|
||||
}
|
||||
|
||||
message NetworkConfig {
|
||||
optional string instance_id = 1;
|
||||
|
||||
optional bool dhcp = 2;
|
||||
optional string virtual_ipv4 = 3;
|
||||
optional int32 network_length = 4;
|
||||
optional string hostname = 5;
|
||||
optional string network_name = 6;
|
||||
optional string network_secret = 7;
|
||||
optional NetworkingMethod networking_method = 8;
|
||||
|
||||
optional string public_server_url = 9;
|
||||
repeated string peer_urls = 10;
|
||||
|
||||
repeated string proxy_cidrs = 11;
|
||||
|
||||
optional bool enable_vpn_portal = 12;
|
||||
optional int32 vpn_portal_listen_port = 13;
|
||||
optional string vpn_portal_client_network_addr = 14;
|
||||
optional int32 vpn_portal_client_network_len = 15;
|
||||
|
||||
optional bool advanced_settings = 16;
|
||||
|
||||
repeated string listener_urls = 17;
|
||||
optional int32 rpc_port = 18;
|
||||
optional bool latency_first = 19;
|
||||
|
||||
optional string dev_name = 20;
|
||||
}
|
||||
|
||||
message MyNodeInfo {
|
||||
common.Ipv4Addr virtual_ipv4 = 1;
|
||||
string hostname = 2;
|
||||
@@ -52,10 +88,11 @@ service WebServerService {
|
||||
}
|
||||
|
||||
message ValidateConfigRequest {
|
||||
string config = 1;
|
||||
NetworkConfig config = 1;
|
||||
}
|
||||
|
||||
message ValidateConfigResponse {
|
||||
string toml_config = 1;
|
||||
}
|
||||
|
||||
message RunNetworkInstanceRequest {
|
||||
|
||||
Reference in New Issue
Block a user