Skip to content

Incorrect Filtering of Subscription-Generated Groups and Non-Subscription Outbounds in extra_groups Configuration #48

Description

@Delay7184

Problem Description

When using extra_groups in templates:

  1. Subscription-generated groups ignore the filter, causing them to be added to every non-subscription type group.
  2. Outbounds other than subscriptions are not filtered.

Steps to Reproduce

  1. Configure outbounds:
"outbounds": [
  {
    "type": "shadowsocks",
    "tag": "香港 自建"
  }
],
"subscriptions": [
  {
    "name": "sub",
    "url": "suburl",
    "generate_selector": true
  }
]
  1. Configure extra_groups as follows:
"extra_groups": [
  {
    "tag": "Hong Kong",
    "type": "selector",
    "filter": "(?i)🇭🇰|香港|hk"
  }
]
  1. The generated configuration is:
{
  "type": "selector",
  "tag": "Hong Kong",
  "outbounds": [
    "sub",
    "香港 01",
    "香港 02"
  ]
}

Expected Behavior

  1. The filter in extra_groups should only match outbounds that satisfy the filter condition. Subscription-generated groups should not be added to all selector groups disregarding the filter.
  2. The filter in extra_groups should apply to all outbounds, not just subsciptions.

The result should be something like:

{
  "type": "selector",
  "tag": "Hong Kong",
  "outbounds": [
    "香港 01",
    "香港 02",
    "香港 自建"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions