[client] Error out on netbird expose when block inbound is enabled (#5818)

This commit is contained in:
Viktor Liu
2026-04-07 23:55:35 +08:00
committed by GitHub
parent 0588d2dbe1
commit aba5d6f0d2
3 changed files with 12 additions and 2 deletions

View File

@@ -1359,6 +1359,10 @@ func (s *Server) ExposeService(req *proto.ExposeServiceRequest, srv proto.Daemon
return gstatus.Errorf(codes.FailedPrecondition, "engine not initialized")
}
if engine.IsBlockInbound() {
return gstatus.Errorf(codes.FailedPrecondition, "expose requires inbound connections but 'block inbound' is enabled, disable it first")
}
mgr := engine.GetExposeManager()
if mgr == nil {
return gstatus.Errorf(codes.Internal, "expose manager not available")