feat(sub): add dummy info node and status configs for subscriptions (#6412)

* feat(settings): add subInfoNodeEnable and status template settings

* feat(sub): add dummy info node and status configs for raw links

* feat(sub): support dummy info node in clash and json subscriptions

* feat(ui): add subscription info node switch and status templates to settings

* style: apply gofumpt formatting

* fix(sub): address review feedback on subscription info node

- Restore GetSubs contract to avoid unintended remark expansions on non-subscription-body calls.
- Exclude dummy info node from Clash PROXY select group when active server nodes exist.
- Track hasEnabledClient and set traffic.Enable in JSON and Clash paths so status tokens evaluate correctly.
- Deterministically sort client emails across subscriptions before selecting primaryEmail.
- Consolidate duplicated info-node evaluation logic into resolveInfoNodeRemark helper.
- Remove redundant pure-getter test from setting_sub_info_node_test.go.

Co-Authored-By: Claude Code <noreply@anthropic.com>

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
This commit is contained in:
Rouzbeh†andClaude Code authored and GitHub committed 2026-09-08 17:14:01 +02:00 Unverified
1 parent b8597314f8
commit 9f76a66dcf
33 files changed
+1374 -35

No files matched your search

+24
View File
@@ -217,6 +217,9 @@
"subEncrypt": {
"type": "boolean"
},
"subExpiredTemplate": {
"type": "string"
},
"subHideSettings": {
"type": "boolean"
},
@@ -226,6 +229,9 @@
"subIncyRoutingRules": {
"type": "string"
},
"subInfoNodeEnable": {
"type": "boolean"
},
"subJsonAlwaysArray": {
"type": "boolean"
},
@@ -288,6 +294,9 @@
"subTitle": {
"type": "string"
},
"subTrafficDepletedTemplate": {
"type": "string"
},
"subURI": {
"type": "string"
},
@@ -433,9 +442,11 @@
"subEnable",
"subEnableRouting",
"subEncrypt",
"subExpiredTemplate",
"subHideSettings",
"subIncyEnableRouting",
"subIncyRoutingRules",
"subInfoNodeEnable",
"subJsonAlwaysArray",
"subJsonAutoDetect",
"subJsonEnable",
@@ -456,6 +467,7 @@
"subSupportUrl",
"subThemeDir",
"subTitle",
"subTrafficDepletedTemplate",
"subURI",
"subUpdates",
"tgBotAPIServer",
@@ -696,6 +708,9 @@
"subEncrypt": {
"type": "boolean"
},
"subExpiredTemplate": {
"type": "string"
},
"subHideSettings": {
"type": "boolean"
},
@@ -705,6 +720,9 @@
"subIncyRoutingRules": {
"type": "string"
},
"subInfoNodeEnable": {
"type": "boolean"
},
"subJsonAlwaysArray": {
"type": "boolean"
},
@@ -767,6 +785,9 @@
"subTitle": {
"type": "string"
},
"subTrafficDepletedTemplate": {
"type": "string"
},
"subURI": {
"type": "string"
},
@@ -919,9 +940,11 @@
"subEnable",
"subEnableRouting",
"subEncrypt",
"subExpiredTemplate",
"subHideSettings",
"subIncyEnableRouting",
"subIncyRoutingRules",
"subInfoNodeEnable",
"subJsonAlwaysArray",
"subJsonAutoDetect",
"subJsonEnable",
@@ -942,6 +965,7 @@
"subSupportUrl",
"subThemeDir",
"subTitle",
"subTrafficDepletedTemplate",
"subURI",
"subUpdates",
"tgBotAPIServer",
+24
View File
@@ -217,6 +217,9 @@
"subEncrypt": {
"type": "boolean"
},
"subExpiredTemplate": {
"type": "string"
},
"subHideSettings": {
"type": "boolean"
},
@@ -226,6 +229,9 @@
"subIncyRoutingRules": {
"type": "string"
},
"subInfoNodeEnable": {
"type": "boolean"
},
"subJsonAlwaysArray": {
"type": "boolean"
},
@@ -288,6 +294,9 @@
"subTitle": {
"type": "string"
},
"subTrafficDepletedTemplate": {
"type": "string"
},
"subURI": {
"type": "string"
},
@@ -433,9 +442,11 @@
"subEnable",
"subEnableRouting",
"subEncrypt",
"subExpiredTemplate",
"subHideSettings",
"subIncyEnableRouting",
"subIncyRoutingRules",
"subInfoNodeEnable",
"subJsonAlwaysArray",
"subJsonAutoDetect",
"subJsonEnable",
@@ -456,6 +467,7 @@
"subSupportUrl",
"subThemeDir",
"subTitle",
"subTrafficDepletedTemplate",
"subURI",
"subUpdates",
"tgBotAPIServer",
@@ -696,6 +708,9 @@
"subEncrypt": {
"type": "boolean"
},
"subExpiredTemplate": {
"type": "string"
},
"subHideSettings": {
"type": "boolean"
},
@@ -705,6 +720,9 @@
"subIncyRoutingRules": {
"type": "string"
},
"subInfoNodeEnable": {
"type": "boolean"
},
"subJsonAlwaysArray": {
"type": "boolean"
},
@@ -767,6 +785,9 @@
"subTitle": {
"type": "string"
},
"subTrafficDepletedTemplate": {
"type": "string"
},
"subURI": {
"type": "string"
},
@@ -919,9 +940,11 @@
"subEnable",
"subEnableRouting",
"subEncrypt",
"subExpiredTemplate",
"subHideSettings",
"subIncyEnableRouting",
"subIncyRoutingRules",
"subInfoNodeEnable",
"subJsonAlwaysArray",
"subJsonAutoDetect",
"subJsonEnable",
@@ -942,6 +965,7 @@
"subSupportUrl",
"subThemeDir",
"subTitle",
"subTrafficDepletedTemplate",
"subURI",
"subUpdates",
"tgBotAPIServer",
+6
View File
@@ -58,9 +58,11 @@ export const EXAMPLES: Record<string, unknown> = {
"subEnable": false,
"subEnableRouting": false,
"subEncrypt": false,
"subExpiredTemplate": "",
"subHideSettings": false,
"subIncyEnableRouting": false,
"subIncyRoutingRules": "",
"subInfoNodeEnable": false,
"subJsonAlwaysArray": false,
"subJsonAutoDetect": false,
"subJsonEnable": false,
@@ -81,6 +83,7 @@ export const EXAMPLES: Record<string, unknown> = {
"subSupportUrl": "",
"subThemeDir": "",
"subTitle": "",
"subTrafficDepletedTemplate": "",
"subURI": "",
"subUpdates": 0,
"tgBotAPIServer": "",
@@ -172,9 +175,11 @@ export const EXAMPLES: Record<string, unknown> = {
"subEnable": false,
"subEnableRouting": false,
"subEncrypt": false,
"subExpiredTemplate": "",
"subHideSettings": false,
"subIncyEnableRouting": false,
"subIncyRoutingRules": "",
"subInfoNodeEnable": false,
"subJsonAlwaysArray": false,
"subJsonAutoDetect": false,
"subJsonEnable": false,
@@ -195,6 +200,7 @@ export const EXAMPLES: Record<string, unknown> = {
"subSupportUrl": "",
"subThemeDir": "",
"subTitle": "",
"subTrafficDepletedTemplate": "",
"subURI": "",
"subUpdates": 0,
"tgBotAPIServer": "",
Loaded 3 of 33 files, more files were not shown because too many files have changed in this diff. Show more