2022-03-08 14:47:55 +01:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
import "google/protobuf/descriptor.proto";
|
2022-07-05 19:47:50 +02:00
|
|
|
import "google/protobuf/timestamp.proto";
|
2022-03-08 14:47:55 +01:00
|
|
|
|
|
|
|
option go_package = "/proto";
|
|
|
|
|
|
|
|
package daemon;
|
|
|
|
|
|
|
|
service DaemonService {
|
|
|
|
// Login uses setup key to prepare configuration for the daemon.
|
|
|
|
rpc Login(LoginRequest) returns (LoginResponse) {}
|
|
|
|
|
2022-05-12 11:17:24 +02:00
|
|
|
// WaitSSOLogin uses the userCode to validate the TokenInfo and
|
|
|
|
// waits for the user to continue with the login on a browser
|
|
|
|
rpc WaitSSOLogin(WaitSSOLoginRequest) returns (WaitSSOLoginResponse) {}
|
|
|
|
|
2022-03-08 14:47:55 +01:00
|
|
|
// Up starts engine work in the daemon.
|
|
|
|
rpc Up(UpRequest) returns (UpResponse) {}
|
|
|
|
|
|
|
|
// Status of the service.
|
|
|
|
rpc Status(StatusRequest) returns (StatusResponse) {}
|
|
|
|
|
|
|
|
// Down engine work in the daemon.
|
|
|
|
rpc Down(DownRequest) returns (DownResponse) {}
|
2022-04-15 17:30:12 +02:00
|
|
|
|
|
|
|
// GetConfig of the daemon.
|
|
|
|
rpc GetConfig(GetConfigRequest) returns (GetConfigResponse) {}
|
2022-03-08 14:47:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
message LoginRequest {
|
|
|
|
// setupKey wiretrustee setup key.
|
|
|
|
string setupKey = 1;
|
|
|
|
|
2022-04-15 17:30:12 +02:00
|
|
|
// preSharedKey for wireguard setup.
|
|
|
|
string preSharedKey = 2;
|
2022-03-08 14:47:55 +01:00
|
|
|
|
|
|
|
// managementUrl to authenticate.
|
|
|
|
string managementUrl = 3;
|
2022-04-15 17:30:12 +02:00
|
|
|
|
|
|
|
// adminUrl to manage keys.
|
|
|
|
string adminURL = 4;
|
2022-05-05 20:02:15 +02:00
|
|
|
|
2022-03-08 14:47:55 +01:00
|
|
|
}
|
|
|
|
|
2022-05-12 11:17:24 +02:00
|
|
|
message LoginResponse {
|
|
|
|
bool needsSSOLogin = 1;
|
|
|
|
string userCode = 2;
|
|
|
|
string verificationURI = 3;
|
|
|
|
string verificationURIComplete = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WaitSSOLoginRequest {
|
|
|
|
string userCode = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WaitSSOLoginResponse {}
|
2022-03-08 14:47:55 +01:00
|
|
|
|
|
|
|
message UpRequest {}
|
|
|
|
|
|
|
|
message UpResponse {}
|
|
|
|
|
2022-07-05 19:47:50 +02:00
|
|
|
message StatusRequest{
|
|
|
|
bool getFullPeerStatus = 1;
|
|
|
|
}
|
2022-03-08 14:47:55 +01:00
|
|
|
|
|
|
|
message StatusResponse{
|
|
|
|
// status of the server.
|
|
|
|
string status = 1;
|
2022-07-05 19:47:50 +02:00
|
|
|
FullStatus fullStatus = 2;
|
2022-08-01 12:42:45 +02:00
|
|
|
// NetBird daemon version
|
|
|
|
string daemonVersion = 3;
|
2022-03-08 14:47:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message DownRequest {}
|
|
|
|
|
|
|
|
message DownResponse {}
|
2022-04-15 17:30:12 +02:00
|
|
|
|
|
|
|
message GetConfigRequest {}
|
|
|
|
|
|
|
|
message GetConfigResponse {
|
|
|
|
// managementUrl settings value.
|
|
|
|
string managementUrl = 1;
|
|
|
|
|
|
|
|
// configFile settings value.
|
|
|
|
string configFile = 2;
|
|
|
|
|
|
|
|
// logFile settings value.
|
|
|
|
string logFile = 3;
|
|
|
|
|
|
|
|
// preSharedKey settings value.
|
|
|
|
string preSharedKey = 4;
|
|
|
|
|
|
|
|
// adminURL settings value.
|
|
|
|
string adminURL = 5;
|
|
|
|
}
|
2022-07-05 19:47:50 +02:00
|
|
|
|
|
|
|
// PeerState contains the latest state of a peer
|
|
|
|
message PeerState {
|
|
|
|
string IP = 1;
|
|
|
|
string pubKey = 2;
|
|
|
|
string connStatus = 3;
|
|
|
|
google.protobuf.Timestamp connStatusUpdate = 4;
|
|
|
|
bool relayed = 5;
|
|
|
|
bool direct = 6;
|
|
|
|
string localIceCandidateType = 7;
|
|
|
|
string remoteIceCandidateType =8;
|
|
|
|
}
|
|
|
|
|
|
|
|
// LocalPeerState contains the latest state of the local peer
|
|
|
|
message LocalPeerState {
|
|
|
|
string IP = 1;
|
|
|
|
string pubKey = 2;
|
|
|
|
bool kernelInterface =3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SignalState contains the latest state of a signal connection
|
|
|
|
message SignalState {
|
|
|
|
string URL = 1;
|
|
|
|
bool connected = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ManagementState contains the latest state of a management connection
|
|
|
|
message ManagementState {
|
|
|
|
string URL = 1;
|
|
|
|
bool connected = 2;
|
|
|
|
}
|
|
|
|
// FullStatus contains the full state held by the Status instance
|
|
|
|
message FullStatus {
|
|
|
|
ManagementState managementState = 1;
|
|
|
|
SignalState signalState = 2;
|
|
|
|
LocalPeerState localPeerState = 3;
|
|
|
|
repeated PeerState peers = 4;
|
|
|
|
}
|