Skip to content

Commit e63c5e1

Browse files
committed
fix: update SingBox version handling in render-templates.service.ts
- Modified the SingBox case to use a fixed version '1.11.1' for the current configuration. - Added a new case for 'SINGBOX_LEGACY' to use version '1.10.0', ensuring backward compatibility. - Updated the regex for MIHOMO in config-types.ts to include 'Clash-nyanpasu'
1 parent 5464113 commit e63c5e1

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/modules/subscription-template/constants/config-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const SUBSCRIPTION_CONFIG_TYPES = {
22
MIHOMO: {
33
NAME: 'MIHOMO',
4-
REGEX: /^(FlClash|[Cc]lash-[Vv]erge|[Cc]lash-?[Mm]eta|[Mm]urge|[Cc]lashX [Mm]eta|[Mm]ihomo)/,
4+
REGEX: /^(FlClash|[Cc]lash-[Vv]erge|[Cc]lash-?[Mm]eta|[Mm]urge|[Cc]lashX [Mm]eta|[Mm]ihomo)|[Cc]lash-nyanpasu/,
55
CONTENT_TYPE: 'text/yaml',
66
BASE64: false,
77
},

src/modules/subscription-template/render-templates.service.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,19 @@ export class RenderTemplatesService {
135135
contentType: SUBSCRIPTION_CONFIG_TYPES.SING_BOX.CONTENT_TYPE,
136136
};
137137

138-
case 'SINGBOX_LEGACY':
139138
case 'SINGBOX':
140139
return {
141140
sub: await this.singBoxGeneratorService.generateConfig(
142141
formattedHosts,
143-
parseSingBoxVersion(userAgent),
142+
'1.11.1',
143+
),
144+
contentType: SUBSCRIPTION_CONFIG_TYPES.SING_BOX.CONTENT_TYPE,
145+
};
146+
case 'SINGBOX_LEGACY':
147+
return {
148+
sub: await this.singBoxGeneratorService.generateConfig(
149+
formattedHosts,
150+
'1.10.0',
144151
),
145152
contentType: SUBSCRIPTION_CONFIG_TYPES.SING_BOX.CONTENT_TYPE,
146153
};

0 commit comments

Comments
 (0)