mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
feat: Add uc wg show command to inspect a machine's uncloud wireguard network (#161)
* feat: Add `uc wg show` command to inspect a machine's uncloud wireguard network (draft / work in progress) * Compile proto files with `make proto-mise` * Fix lint errors * Output peers in tabwriter table * Lookup machine name for wireguard peer public key * Add --machine flag to `uc wg show` to proxy call to specific machine * Small refactor to move wg show logic out into a separate function
This commit is contained in:
@@ -5,6 +5,7 @@ package api;
|
||||
option go_package = "github.com/psviderski/uncloud/internal/machine/api/pb";
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "internal/machine/api/pb/common.proto";
|
||||
|
||||
service Machine {
|
||||
@@ -21,6 +22,8 @@ service Machine {
|
||||
rpc Reset(ResetRequest) returns (google.protobuf.Empty);
|
||||
|
||||
rpc InspectService(InspectServiceRequest) returns (InspectServiceResponse);
|
||||
|
||||
rpc GetWireGuardDevice(google.protobuf.Empty) returns (GetWireGuardDeviceResponse);
|
||||
}
|
||||
|
||||
message MachineInfo {
|
||||
@@ -105,3 +108,19 @@ message InspectServiceRequest {
|
||||
message InspectServiceResponse {
|
||||
Service service = 1;
|
||||
}
|
||||
|
||||
message GetWireGuardDeviceResponse {
|
||||
string name = 1;
|
||||
string public_key = 2;
|
||||
int32 listen_port = 3;
|
||||
repeated WireGuardPeer peers = 4;
|
||||
}
|
||||
|
||||
message WireGuardPeer {
|
||||
string public_key = 1;
|
||||
string endpoint = 2;
|
||||
google.protobuf.Timestamp last_handshake_time = 3;
|
||||
int64 receive_bytes = 4;
|
||||
int64 transmit_bytes = 5;
|
||||
repeated string allowed_ips = 6;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user