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";
|
2024-03-20 11:18:34 +01:00
|
|
|
import "google/protobuf/duration.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) {}
|
2024-04-23 14:42:53 +02:00
|
|
|
|
|
|
|
// List available network routes
|
|
|
|
rpc ListRoutes(ListRoutesRequest) returns (ListRoutesResponse) {}
|
|
|
|
|
|
|
|
// Select specific routes
|
|
|
|
rpc SelectRoutes(SelectRoutesRequest) returns (SelectRoutesResponse) {}
|
|
|
|
|
|
|
|
// Deselect specific routes
|
|
|
|
rpc DeselectRoutes(SelectRoutesRequest) returns (SelectRoutesResponse) {}
|
2024-04-26 17:20:10 +02:00
|
|
|
|
|
|
|
// DebugBundle creates a debug bundle
|
|
|
|
rpc DebugBundle(DebugBundleRequest) returns (DebugBundleResponse) {}
|
|
|
|
|
2024-05-24 13:27:41 +02:00
|
|
|
// GetLogLevel gets the log level of the daemon
|
|
|
|
rpc GetLogLevel(GetLogLevelRequest) returns (GetLogLevelResponse) {}
|
|
|
|
|
2024-04-26 17:20:10 +02:00
|
|
|
// SetLogLevel sets the log level of the daemon
|
|
|
|
rpc SetLogLevel(SetLogLevelRequest) returns (SetLogLevelResponse) {}
|
2022-03-08 14:47:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
message LoginRequest {
|
|
|
|
// setupKey wiretrustee setup key.
|
|
|
|
string setupKey = 1;
|
|
|
|
|
2024-01-19 10:30:41 +01:00
|
|
|
// This is the old PreSharedKey field which will be deprecated in favor of optionalPreSharedKey field that is defined as optional
|
|
|
|
// to allow clearing of preshared key while being able to persist in the config file.
|
2024-02-24 12:41:13 +01:00
|
|
|
string preSharedKey = 2 [deprecated = true];
|
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
|
|
|
|
2023-01-17 19:16:50 +01:00
|
|
|
// natExternalIPs map list of external IPs
|
|
|
|
repeated string natExternalIPs = 5;
|
|
|
|
|
|
|
|
// cleanNATExternalIPs clean map list of external IPs.
|
|
|
|
// This is needed because the generated code
|
|
|
|
// omits initialized empty slices due to omitempty tags
|
|
|
|
bool cleanNATExternalIPs = 6;
|
|
|
|
|
|
|
|
bytes customDNSAddress = 7;
|
|
|
|
|
2023-09-28 14:02:37 +02:00
|
|
|
bool isLinuxDesktopClient = 8;
|
2023-11-29 15:01:27 +01:00
|
|
|
|
|
|
|
string hostname = 9;
|
2024-01-08 12:25:35 +01:00
|
|
|
|
|
|
|
optional bool rosenpassEnabled = 10;
|
2024-01-15 15:53:23 +01:00
|
|
|
|
|
|
|
optional string interfaceName = 11;
|
|
|
|
|
|
|
|
optional int64 wireguardPort = 12;
|
|
|
|
|
2024-01-19 10:30:41 +01:00
|
|
|
optional string optionalPreSharedKey = 13;
|
2024-02-20 10:10:05 +01:00
|
|
|
|
|
|
|
optional bool disableAutoConnect = 14;
|
2024-02-20 11:13:27 +01:00
|
|
|
|
|
|
|
optional bool serverSSHAllowed = 15;
|
2024-02-21 17:23:17 +01:00
|
|
|
|
|
|
|
optional bool rosenpassPermissive = 16;
|
2024-03-28 09:56:41 +01:00
|
|
|
|
|
|
|
repeated string extraIFaceBlacklist = 17;
|
2024-05-07 18:50:34 +02:00
|
|
|
|
|
|
|
optional bool networkMonitor = 18;
|
2024-06-13 13:24:24 +02:00
|
|
|
|
|
|
|
optional google.protobuf.Duration dnsRouteInterval = 19;
|
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;
|
2023-11-29 15:01:27 +01:00
|
|
|
string hostname = 2;
|
2022-05-12 11:17:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2024-06-19 10:09:35 +02:00
|
|
|
|
|
|
|
string interfaceName = 6;
|
|
|
|
|
|
|
|
int64 wireguardPort = 7;
|
|
|
|
|
|
|
|
bool disableAutoConnect = 9;
|
|
|
|
|
|
|
|
bool serverSSHAllowed = 10;
|
|
|
|
|
|
|
|
bool rosenpassEnabled = 11;
|
|
|
|
|
|
|
|
bool rosenpassPermissive = 12;
|
2022-04-15 17:30:12 +02:00
|
|
|
}
|
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;
|
2024-01-22 12:20:24 +01:00
|
|
|
string remoteIceCandidateType = 8;
|
2022-11-26 13:29:50 +01:00
|
|
|
string fqdn = 9;
|
2024-01-22 12:20:24 +01:00
|
|
|
string localIceCandidateEndpoint = 10;
|
|
|
|
string remoteIceCandidateEndpoint = 11;
|
|
|
|
google.protobuf.Timestamp lastWireguardHandshake = 12;
|
|
|
|
int64 bytesRx = 13;
|
|
|
|
int64 bytesTx = 14;
|
2024-02-24 12:41:13 +01:00
|
|
|
bool rosenpassEnabled = 15;
|
2024-03-12 19:06:16 +01:00
|
|
|
repeated string routes = 16;
|
2024-03-20 11:18:34 +01:00
|
|
|
google.protobuf.Duration latency = 17;
|
2022-07-05 19:47:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// LocalPeerState contains the latest state of the local peer
|
|
|
|
message LocalPeerState {
|
|
|
|
string IP = 1;
|
|
|
|
string pubKey = 2;
|
2024-01-22 12:20:24 +01:00
|
|
|
bool kernelInterface = 3;
|
2022-11-26 13:29:50 +01:00
|
|
|
string fqdn = 4;
|
2024-02-24 12:41:13 +01:00
|
|
|
bool rosenpassEnabled = 5;
|
|
|
|
bool rosenpassPermissive = 6;
|
2024-03-12 19:06:16 +01:00
|
|
|
repeated string routes = 7;
|
2022-07-05 19:47:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// SignalState contains the latest state of a signal connection
|
|
|
|
message SignalState {
|
|
|
|
string URL = 1;
|
|
|
|
bool connected = 2;
|
2024-01-22 12:20:24 +01:00
|
|
|
string error = 3;
|
2022-07-05 19:47:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ManagementState contains the latest state of a management connection
|
|
|
|
message ManagementState {
|
|
|
|
string URL = 1;
|
|
|
|
bool connected = 2;
|
2024-01-22 12:20:24 +01:00
|
|
|
string error = 3;
|
2022-07-05 19:47:50 +02:00
|
|
|
}
|
2024-01-22 12:20:24 +01:00
|
|
|
|
|
|
|
// RelayState contains the latest state of the relay
|
|
|
|
message RelayState {
|
|
|
|
string URI = 1;
|
|
|
|
bool available = 2;
|
|
|
|
string error = 3;
|
|
|
|
}
|
|
|
|
|
2024-03-12 19:06:16 +01:00
|
|
|
message NSGroupState {
|
|
|
|
repeated string servers = 1;
|
|
|
|
repeated string domains = 2;
|
|
|
|
bool enabled = 3;
|
|
|
|
string error = 4;
|
|
|
|
}
|
|
|
|
|
2022-07-05 19:47:50 +02:00
|
|
|
// FullStatus contains the full state held by the Status instance
|
|
|
|
message FullStatus {
|
2024-01-22 12:20:24 +01:00
|
|
|
ManagementState managementState = 1;
|
|
|
|
SignalState signalState = 2;
|
|
|
|
LocalPeerState localPeerState = 3;
|
|
|
|
repeated PeerState peers = 4;
|
|
|
|
repeated RelayState relays = 5;
|
2024-03-12 19:06:16 +01:00
|
|
|
repeated NSGroupState dns_servers = 6;
|
2024-04-23 14:42:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message ListRoutesRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListRoutesResponse {
|
|
|
|
repeated Route routes = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SelectRoutesRequest {
|
|
|
|
repeated string routeIDs = 1;
|
|
|
|
bool append = 2;
|
|
|
|
bool all = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SelectRoutesResponse {
|
|
|
|
}
|
|
|
|
|
2024-06-13 13:24:24 +02:00
|
|
|
message IPList {
|
|
|
|
repeated string ips = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-04-23 14:42:53 +02:00
|
|
|
message Route {
|
|
|
|
string ID = 1;
|
|
|
|
string network = 2;
|
|
|
|
bool selected = 3;
|
2024-06-13 13:24:24 +02:00
|
|
|
repeated string domains = 4;
|
|
|
|
map<string, IPList> resolvedIPs = 5;
|
2024-04-26 17:20:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message DebugBundleRequest {
|
|
|
|
bool anonymize = 1;
|
|
|
|
string status = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DebugBundleResponse {
|
|
|
|
string path = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum LogLevel {
|
|
|
|
UNKNOWN = 0;
|
|
|
|
PANIC = 1;
|
|
|
|
FATAL = 2;
|
|
|
|
ERROR = 3;
|
|
|
|
WARN = 4;
|
|
|
|
INFO = 5;
|
|
|
|
DEBUG = 6;
|
|
|
|
TRACE = 7;
|
|
|
|
}
|
|
|
|
|
2024-05-24 13:27:41 +02:00
|
|
|
message GetLogLevelRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetLogLevelResponse {
|
|
|
|
LogLevel level = 1;
|
|
|
|
}
|
|
|
|
|
2024-04-26 17:20:10 +02:00
|
|
|
message SetLogLevelRequest {
|
|
|
|
LogLevel level = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SetLogLevelResponse {
|
2022-07-05 19:47:50 +02:00
|
|
|
}
|