-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: build
sukka_always_real_ip.sgmodule
w/ script
- Loading branch information
Showing
5 changed files
with
70 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import path from 'path'; | ||
import { task } from './lib/trace-runner'; | ||
import { compareAndWriteFile } from './lib/create-file'; | ||
|
||
const HOSTNAMES = [ | ||
// Intranet | ||
'*.lan', | ||
'*.localdomain', | ||
'*.localhost', | ||
'*.home.arpa', | ||
// Network Detection, Captive Portal | ||
'*.msftncsi.com', | ||
'*.msftconnecttest.com', | ||
'network-test.debian.org', | ||
'detectportal.firefox.com', | ||
'resolver1.opendns.com', | ||
// Handle SNAT conversation properly | ||
'*.srv.nintendo.net', | ||
'*.stun.playstation.net', | ||
'xbox.*.microsoft.com', | ||
'*.xboxlive.com', | ||
'*.turn.twilio.com', | ||
'*.stun.twilio.com', | ||
'stun.*.*', | ||
'stun.*.*.*', | ||
// NTP | ||
'time.*.com', 'time.*.gov, time.*.edu.cn, time.*.apple.com', 'time1.*.com', 'time2.*.com', 'time3.*.com', 'time4.*.com', 'time5.*.com', 'time6.*.com', 'time7.*.com', 'time8.*.com', 'time9.*.com, ntp.*.com, ntp1.*.com, ntp2.*.com, ntp3.*.com, ntp4.*.com, ntp5.*.com, ntp6.*.com, ntp7.*.com', 'time1.*.com', 'time2.*.com', 'time3.*.com', 'time4.*.com', 'time5.*.com', 'time6.*.com', 'time7.*.com', 'time8.*.com', 'ti me9.*.com', '*.time.edu.cn', '*.ntp.org.cn', '*.pool.ntp.org', 'time1.cloud.tencent.com', | ||
// AdGuard | ||
'local.adguard.org', | ||
'injections.adguard.org', | ||
// QQ Login | ||
'localhost.ptlogin2.qq.com', | ||
'localhost.sec.qq.com', | ||
'localhost.work.weixin.qq.com', | ||
// Microsoft Auto Discovery | ||
'PDC._msDCS.*.*', | ||
'DC._msDCS.*.*', | ||
'GC._msDCS.*.*' | ||
] as const; | ||
|
||
export const buildAlwaysRealIPModule = task(import.meta.path, async () => { | ||
return compareAndWriteFile( | ||
[ | ||
'#!name=[Sukka] Always Real IP Plus', | ||
`#!desc=Last Updated: ${new Date().toISOString()}`, | ||
'', | ||
'[General]', | ||
`always-real-ip = %APPEND% ${HOSTNAMES.join(', ')}` | ||
], | ||
path.resolve(import.meta.dir, '../Modules/sukka_common_always_realip.sgmodule') | ||
); | ||
}); | ||
|
||
if (import.meta.main) { | ||
buildAlwaysRealIPModule(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.