Improve network tags for external requests

This commit is contained in:
Daniel
2022-10-04 12:53:04 +02:00
parent c22fb3316b
commit f329e40da7

View File

@@ -13,8 +13,8 @@ func init() {
} }
const ( const (
netName = "Network" netName = "Network"
netTagKey = "net" netIPTagKey = "ip"
) )
// NetworkHandler handles AppImage processes on Unix systems. // NetworkHandler handles AppImage processes on Unix systems.
@@ -30,9 +30,9 @@ func (h *NetworkHandler) Name() string {
func (h *NetworkHandler) TagDescriptions() []process.TagDescription { func (h *NetworkHandler) TagDescriptions() []process.TagDescription {
return []process.TagDescription{ return []process.TagDescription{
{ {
ID: netTagKey, ID: netIPTagKey,
Name: "Things on the Network", Name: "IP Address",
Description: "Other (virtual) devices that make requests to Portmaster, if enabled in Portmaster.", Description: "The remote IP address of external requests to Portmaster, if enabled.",
}, },
} }
} }
@@ -46,7 +46,7 @@ func (h *NetworkHandler) AddTags(p *process.Process) {
// Returns nil to skip. // Returns nil to skip.
func (h *NetworkHandler) CreateProfile(p *process.Process) *profile.Profile { func (h *NetworkHandler) CreateProfile(p *process.Process) *profile.Profile {
for _, tag := range p.Tags { for _, tag := range p.Tags {
if tag.Key == netTagKey { if tag.Key == netIPTagKey {
return profile.New(&profile.Profile{ return profile.New(&profile.Profile{
Source: profile.SourceLocal, Source: profile.SourceLocal,
Name: p.Name, Name: p.Name,