Skip to content

Commit

Permalink
Include LAN domains in SSPanel profile build
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Jun 15, 2024
1 parent d7a2476 commit 6ee6e43
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Build/build-sspanel-appprofile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const removeNoResolved = (line: string) => line.replace(',no-resolve', '');
*/
export const buildSSPanelUIMAppProfile = task(import.meta.main, import.meta.path)(async (span) => {
const [
domesticDomains,
[domesticDomains, directDomains, lanDomains],
appleCdnDomains,
microsoftCdnDomains,
appleCnDomains,
Expand All @@ -46,7 +46,11 @@ export const buildSSPanelUIMAppProfile = task(import.meta.main, import.meta.path
] = await Promise.all([
// domestic - domains
getDomesticAndDirectDomainsRulesetPromise()
.then(data => data.flatMap(surgeRulesetToClashClassicalTextRuleset)),
.then(
data => (
data.map(surgeRulesetToClashClassicalTextRuleset)
) as [string[], string[], string[]]
),
getAppleCdnDomainsPromise().then(domains => domains.map(domain => `DOMAIN-SUFFIX,${domain}`)),
getMicrosoftCdnRulesetPromise().then(surgeRulesetToClashClassicalTextRuleset),
readFileIntoProcessedArray(path.resolve(import.meta.dir, '../Source/non_ip/apple_cn.conf')),
Expand Down Expand Up @@ -97,6 +101,10 @@ export const buildSSPanelUIMAppProfile = task(import.meta.main, import.meta.path
...globalDomains,
...telegramDomains
],
[
...directDomains,
...lanDomains
],
domesticCidrs,
streamCidrs,
[
Expand All @@ -121,6 +129,7 @@ function generateAppProfile(
steamDomains: string[],
globalDomains: string[],

lanDomains: string[],
directCidrs: string[],
streamCidrs: string[],
globalCidrs: string[],
Expand Down Expand Up @@ -189,6 +198,8 @@ function generateAppProfile(
// global - domains
...globalDomains.map(line => ` '${line},Global',`),
// microsoft & apple - ip cidr (nope)
// lan - domains
...lanDomains.map(line => ` '${line},DIRECT',`),
// stream - ip cidr
...streamCidrs.map(line => ` '${line},Stream',`),
// global - ip cidr
Expand Down

0 comments on commit 6ee6e43

Please sign in to comment.