add config properties to the SyncResponse of the management gRpc service (#66)

* feature: add config properties to the SyncResponse of the management gRpc service
This commit is contained in:
Mikhail Bragin
2021-07-25 17:08:16 +02:00
committed by GitHub
parent 9e4aa4f1f1
commit 3b30beb567
4 changed files with 648 additions and 76 deletions

View File

@@ -31,13 +31,19 @@ message EncryptedMessage {
bytes body = 2;
}
message SyncRequest {
}
message SyncRequest {}
// SyncResponse represents a state that should be applied to the local peer (e.g. Wiretrustee servers config as well as local peer and remote peers configs)
message SyncResponse {
// A list of peers available
repeated string peers = 1;
// Global config
WiretrusteeConfig wiretrusteeConfig = 1;
PeerConfig peerConfig = 2;
repeated RemotePeerConfig remotePeers = 3;
// Deprecated: used for compatibility
repeated string peers = 4;
}
message RegisterPeerRequest {
@@ -48,9 +54,7 @@ message RegisterPeerRequest {
string setupKey = 2;
}
message RegisterPeerResponse {
}
message RegisterPeerResponse {}
message ServerKeyResponse {
// Server's Wireguard public key
@@ -59,6 +63,55 @@ message ServerKeyResponse {
google.protobuf.Timestamp expiresAt = 2;
}
message Empty {
message Empty {}
// WiretrusteeConfig is a common configuration of any Wiretrustee peer. It contains STUN, TURN, Signal and Management servers configurations
message WiretrusteeConfig {
// a list of STUN servers
repeated HostConfig stuns = 1;
// a list of TURN servers
repeated ProtectedHostConfig turns = 2;
// a Signal server config
HostConfig signal = 3;
}
// HostConfig describes connection properties of some server (e.g. STUN, Signal, Management)
message HostConfig {
string host = 1;
int32 port = 2;
Protocol protocol = 3;
enum Protocol {
PLAIN = 0;
TLS = 1;
DTLS = 2;
}
}
// ProtectedHostConfig is similar to HostConfig but has additional user and password
// Mostly used for TURN servers
message ProtectedHostConfig {
HostConfig hostConfig = 1;
string user = 2;
string password = 3;
}
// PeerConfig represents a configuration of a "our" peer.
// The properties are used to configure local Wireguard
message PeerConfig {
// Peer's virtual IP address within the Wiretrustee VPN (a Wireguard address config)
string address = 1;
// Wiretrustee DNS server (a Wireguard DNS config)
string dns = 2;
}
// RemotePeerConfig represents a configuration of a remote peer.
// The properties are used to configure Wireguard Peers sections
message RemotePeerConfig {
// A Wireguard public key of a remote peer
string wgPubKey = 1;
// Wireguard allowed IPs of a remote peer e.g. [10.30.30.1/32]
repeated string allowedIps = 2;
}