reject-data-source.ts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. import { TTL } from '../lib/cache-filesystem';
  2. type HostsSource = [main: string, mirrors: string[] | null, includeAllSubDomain: boolean, ttl: number];
  3. export const HOSTS: HostsSource[] = [
  4. // have not been updated for more than a year, so we set a 14 days cache ttl
  5. ['https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt', null, true, TTL.TWO_WEEKS()],
  6. ['https://raw.githubusercontent.com/jerryn70/GoodbyeAds/master/Extension/GoodbyeAds-Xiaomi-Extension.txt', null, false, TTL.ONE_WEEK()],
  7. ['https://raw.githubusercontent.com/jerryn70/GoodbyeAds/master/Extension/GoodbyeAds-Huawei-AdBlock.txt', null, false, TTL.ONE_WEEK()],
  8. ['https://raw.githubusercontent.com/durablenapkin/block/master/luminati.txt', null, true, TTL.THREE_HOURS()],
  9. ['https://raw.githubusercontent.com/durablenapkin/block/master/tvstream.txt', null, true, TTL.THREE_HOURS()]
  10. ];
  11. export const HOSTS_EXTRA: HostsSource[] = [
  12. // This stupid hosts blocks t.co, so we determine that this is also bullshit, so it is also extra
  13. [
  14. 'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext',
  15. ['https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/thirdparties/pgl.yoyo.org/as/serverlist'],
  16. true,
  17. TTL.THREE_HOURS()
  18. ],
  19. // Dan Pollock's hosts file, 0.0.0.0 version is 30 KiB smaller
  20. ['https://someonewhocares.org/hosts/zero/hosts', null, true, TTL.THREE_HOURS()],
  21. // ad-wars is not actively maintained, so we set a 7 days cache ttl
  22. ['https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts', null, false, TTL.TWO_WEEKS()]
  23. ];
  24. export const DOMAIN_LISTS: HostsSource[] = [
  25. // CoinBlockerList
  26. // Although the hosts file is still actively maintained, the hosts_browser file is not updated since 2021-07, so we set a 14 days cache ttl
  27. ['https://zerodot1.gitlab.io/CoinBlockerLists/list_browser.txt', [], true, TTL.TWO_WEEKS()]
  28. ];
  29. export const DOMAIN_LISTS_EXTRA: HostsSource[] = [
  30. // BarbBlock
  31. // The barbblock list has never been updated since 2019-05, so we set a 14 days cache ttl
  32. [
  33. 'https://paulgb.github.io/BarbBlock/blacklists/domain-list.txt',
  34. ['https://raw.githubusercontent.com/paulgb/BarbBlock/refs/heads/main/blacklists/domain-list.txt'],
  35. true,
  36. TTL.TWO_WEEKS()
  37. ],
  38. // DigitalSide Threat-Intel - OSINT Hub
  39. // Update once per day
  40. ['https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt', [], true, TTL.ONE_DAY()],
  41. // AdGuard CNAME Filter Combined
  42. // Update on a 7 days basis, so we add a 3 hours cache ttl
  43. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_ads_justdomains.txt', [], true, TTL.THREE_DAYS()],
  44. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers_justdomains.txt', [], true, TTL.THREE_DAYS()],
  45. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_clickthroughs_justdomains.txt', [], true, TTL.THREE_DAYS()],
  46. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_microsites_justdomains.txt', [], true, TTL.THREE_DAYS()],
  47. // ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_mail_trackers_justdomains.txt', [], true, TTL.THREE_DAYS()],
  48. // Curben's PUP Domains Blocklist
  49. // The PUP filter has paused the update since 2023-05, so we set a 14 days cache ttl, and move it to extra
  50. // [
  51. // 'https://pup-filter.pages.dev/pup-filter-domains.txt',
  52. // [
  53. // // 'https://malware-filter.pages.dev/pup-filter-domains.txt',
  54. // // 'https://malware-filter.gitlab.io/malware-filter/pup-filter-domains.txt',
  55. // 'https://malware-filter.gitlab.io/pup-filter/pup-filter-domains.txt'
  56. // // 'https://curbengh.github.io/pup-filter/pup-filter-domains.txt',
  57. // // 'https://malware-filter.pages.dev/pup-filter-domains.txt'
  58. // ],
  59. // true, TTL.TWO_WEEKS()
  60. // ],
  61. // Curben's UrlHaus Malicious URL Blocklist
  62. [
  63. 'https://urlhaus-filter.pages.dev/urlhaus-filter-domains.txt',
  64. [
  65. 'https://malware-filter.pages.dev/urlhaus-filter-domains.txt',
  66. 'https://malware-filter.gitlab.io/urlhaus-filter/urlhaus-filter-domains.txt',
  67. 'https://malware-filter.gitlab.io/malware-filter/urlhaus-filter-domains.txt',
  68. 'https://curbengh.github.io/urlhaus-filter/urlhaus-filter-domains.txt'
  69. ],
  70. true, TTL.THREE_HOURS()
  71. ],
  72. // Spam404
  73. // Not actively maintained, let's use a 10 days cache ttl
  74. ['https://raw.githubusercontent.com/Spam404/lists/master/main-blacklist.txt', [], true, TTL.TEN_DAYS()]
  75. ];
  76. export const PHISHING_HOSTS_EXTRA: HostsSource[] = [
  77. ['https://raw.githubusercontent.com/durablenapkin/scamblocklist/master/hosts.txt', [], true, TTL.THREE_DAYS()]
  78. ];
  79. export const PHISHING_DOMAIN_LISTS_EXTRA: HostsSource[] = [
  80. [
  81. 'https://phishing-filter.pages.dev/phishing-filter-domains.txt',
  82. [
  83. 'https://malware-filter.pages.dev/phishing-filter-domains.txt',
  84. 'https://malware-filter.gitlab.io/phishing-filter/phishing-filter-domains.txt',
  85. 'https://malware-filter.gitlab.io/malware-filter/phishing-filter-domains.txt',
  86. 'https://curbengh.github.io/phishing-filter/phishing-filter-domains.txt'
  87. ],
  88. true, TTL.THREE_HOURS()
  89. ],
  90. [
  91. 'https://phishing.army/download/phishing_army_blocklist.txt',
  92. [],
  93. true, TTL.THREE_HOURS()
  94. ]
  95. ];
  96. type AdGuardFilterSource = [main: string, mirrors: string[] | null, ttl: number, allowThirdParty?: boolean];
  97. export const ADGUARD_FILTERS: AdGuardFilterSource[] = [
  98. // no coin list adguard list is more maintained than its hosts
  99. ['https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/nocoin.txt', [], TTL.TWO_WEEKS()],
  100. // EasyList
  101. [
  102. 'https://easylist.to/easylist/easylist.txt',
  103. [
  104. 'https://easylist-downloads.adblockplus.org/easylist.txt',
  105. 'https://secure.fanboy.co.nz/easylist.txt',
  106. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist.txt',
  107. 'https://ublockorigin.pages.dev/thirdparties/easylist.txt',
  108. 'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easylist.txt'
  109. ],
  110. TTL.TWLVE_HOURS()
  111. ],
  112. // EasyPrivacy
  113. [
  114. 'https://easylist.to/easylist/easyprivacy.txt',
  115. [
  116. 'https://easylist-downloads.adblockplus.org/easyprivacy.txt',
  117. 'https://secure.fanboy.co.nz/easyprivacy.txt',
  118. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easyprivacy.txt',
  119. 'https://ublockorigin.pages.dev/thirdparties/easyprivacy.txt',
  120. 'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easyprivacy.txt'
  121. ],
  122. TTL.TWLVE_HOURS()
  123. ],
  124. // AdGuard DNS Filter
  125. [
  126. 'https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt',
  127. [
  128. 'https://filters.adtidy.org/extension/ublock/filters/15_optimized.txt',
  129. 'https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt'
  130. ],
  131. TTL.TWLVE_HOURS()
  132. ],
  133. // AdGuard Base Filter
  134. ['https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt', null, TTL.THREE_HOURS()],
  135. // AdGuard Mobile AD
  136. ['https://filters.adtidy.org/extension/ublock/filters/11_optimized.txt', null, TTL.THREE_HOURS()],
  137. // AdGuard Tracking Protection
  138. ['https://filters.adtidy.org/extension/ublock/filters/3_optimized.txt', null, TTL.THREE_HOURS()],
  139. // AdGuard Chinese filter (EasyList China + AdGuard Chinese filter)
  140. ['https://filters.adtidy.org/extension/ublock/filters/224_optimized.txt', null, TTL.THREE_HOURS()],
  141. // GameConsoleAdblockList
  142. // Update almost once per 1 to 3 months, let's set a 10 days cache ttl
  143. ['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/GameConsoleAdblockList.txt', null, TTL.TEN_DAYS()],
  144. // PiHoleBlocklist
  145. // Update almost once per 3 months, let's set a 10 days cache ttl
  146. [
  147. 'https://perflyst.github.io/PiHoleBlocklist/SmartTV-AGH.txt',
  148. [
  149. 'https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt'
  150. ],
  151. TTL.TEN_DAYS()
  152. ],
  153. // uBlock Origin Unbreak
  154. [
  155. 'https://ublockorigin.github.io/uAssetsCDN/filters/unbreak.min.txt',
  156. [
  157. 'https://ublockorigin.pages.dev/filters/unbreak.min.txt'
  158. ],
  159. TTL.THREE_HOURS()
  160. ]
  161. ];
  162. export const ADGUARD_FILTERS_WHITELIST: AdGuardFilterSource[] = [
  163. [
  164. 'https://adguardteam.github.io/AdGuardSDNSFilter/Filters/exceptions.txt',
  165. [
  166. 'https://raw.githubusercontent.com/AdguardTeam/AdGuardSDNSFilter/master/Filters/exceptions.txt'
  167. ],
  168. TTL.THREE_HOURS()
  169. ],
  170. [
  171. 'https://adguardteam.github.io/AdGuardSDNSFilter/Filters/exclusions.txt',
  172. [
  173. 'https://raw.githubusercontent.com/AdguardTeam/AdGuardSDNSFilter/master/Filters/exclusions.txt'
  174. ],
  175. TTL.THREE_HOURS()
  176. ]
  177. ];
  178. export const ADGUARD_FILTERS_EXTRA: AdGuardFilterSource[] = [
  179. // AdGuard Annoyances filter
  180. ['https://filters.adtidy.org/extension/ublock/filters/14_optimized.txt', null, TTL.THREE_HOURS(), true],
  181. // AdGuard Cookie Notices, included in Annoyances filter
  182. // ['https://filters.adtidy.org/extension/ublock/filters/18_optimized.txt', null, TTL.THREE_HOURS(), true],
  183. // EasyList Germany filter, not even included in extra for now
  184. // [
  185. // 'https://easylist.to/easylistgermany/easylistgermany.txt',
  186. // [
  187. // 'https://easylist-downloads.adblockplus.org/easylistgermany.txt'
  188. // ],
  189. // TTL.TWLVE_HOURS()
  190. // ],
  191. // AdGuard Japanese filter
  192. ['https://filters.adtidy.org/extension/ublock/filters/7_optimized.txt', null, TTL.THREE_HOURS()],
  193. // uBlock Origin Filter List
  194. [
  195. 'https://ublockorigin.github.io/uAssetsCDN/filters/filters.min.txt',
  196. [
  197. 'https://ublockorigin.pages.dev/filters/filters.min.txt'
  198. ],
  199. TTL.THREE_HOURS()
  200. ],
  201. // AdGuard Popup Overlay - included in Annoyances filter
  202. // ['https://filters.adtidy.org/extension/ublock/filters/19_optimized.txt', null, TTL.THREE_HOURS(), true],
  203. // AdGuard Mobile Banner
  204. // almost all generic rule
  205. // ['https://filters.adtidy.org/extension/ublock/filters/20_optimized.txt', null, TTL.THREE_HOURS()],
  206. // uBlock Origin Badware Risk List
  207. [
  208. 'https://ublockorigin.github.io/uAssetsCDN/filters/badware.min.txt',
  209. [
  210. 'https://ublockorigin.pages.dev/filters/badware.min.txt'
  211. ],
  212. TTL.THREE_HOURS()
  213. ],
  214. // uBlock Origin Privacy List
  215. [
  216. 'https://ublockorigin.github.io/uAssetsCDN/filters/privacy.min.txt',
  217. [
  218. 'https://ublockorigin.pages.dev/filters/privacy.min.txt'
  219. ],
  220. TTL.THREE_HOURS()
  221. ],
  222. // uBlock Origin Resource Abuse: merged in uBlock Origin Privacy List
  223. // [
  224. // 'https://ublockorigin.github.io/uAssetsCDN/filters/resource-abuse.txt',
  225. // ['https://ublockorigin.pages.dev/filters/resource-abuse.txt']
  226. // ],
  227. // uBlock Origin Annoyances
  228. [
  229. 'https://ublockorigin.github.io/uAssetsCDN/filters/annoyances.min.txt',
  230. ['https://ublockorigin.pages.dev/filters/annoyances.min.txt'],
  231. TTL.THREE_HOURS()
  232. ],
  233. // EasyList Annoyances
  234. [
  235. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist-annoyances.txt',
  236. ['https://ublockorigin.pages.dev/thirdparties/easylist-annoyances.txt'],
  237. TTL.THREE_HOURS()
  238. ],
  239. // Dandelion Sprout's Annoyances
  240. ['https://filters.adtidy.org/extension/ublock/filters/250_optimized.txt', null, TTL.THREE_HOURS(), true],
  241. // EasyList - Newsletters
  242. [
  243. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist-newsletters.txt',
  244. ['https://ublockorigin.pages.dev/thirdparties/easylist-newsletters.txt'],
  245. TTL.THREE_HOURS()
  246. ],
  247. // EasyList - Notifications
  248. [
  249. 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-notifications.txt',
  250. ['https://ublockorigin.pages.dev/thirdparties/easylist-notifications.txt'],
  251. TTL.THREE_HOURS()
  252. ],
  253. // Fanboy Cookie Monster (EasyList Cookie List)
  254. [
  255. 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-cookies.txt',
  256. [
  257. 'https://ublockorigin.pages.dev/thirdparties/easylist-cookies.txt',
  258. 'https://secure.fanboy.co.nz/fanboy-cookiemonster_ubo.txt'
  259. ],
  260. TTL.TWLVE_HOURS()
  261. ]
  262. ];
  263. // In a hostile network like when an ad blocker is present, apps might be crashing, and these errors need to be
  264. // The reason for unblocking crashlytics is to not make developers life worse by breaking crash reporting.
  265. // In a hostile network like when an ad blocker is present, apps might be crashing, and these errors need to be
  266. // reported to devs, otherwise they won't learn about the issue and won't fix it.
  267. // Also, it is not a common third-party analytics tracker, Crashlytics is not used for collecting users' data.
  268. export const CRASHLYTICS_WHITELIST = [
  269. // VSCode Telemetry, see https://sts.online.visualstudio.com/api/swagger/index.html
  270. 'sts.online.visualstudio.com',
  271. // Sentry
  272. '.ingest.sentry.io',
  273. // bugsnag
  274. '.sessions.bugsnag.com',
  275. '.notify.bugsnag.com',
  276. // influxdata
  277. '.cloud.influxdata.com',
  278. '.cloud1.influxdata.com',
  279. '.cloud2.influxdata.com',
  280. // split.io A/B flag
  281. 'streaming.split.io',
  282. 'telemetry.split.io',
  283. 'sdk.split.io',
  284. // Google
  285. // -ds.metric.gstatic.com are specifically exempted from reject, but it could use secondary proxy policy
  286. '.metric.gstatic.com',
  287. // Misc
  288. 'telemetry.1passwordservices.com',
  289. 'events.tableplus.com',
  290. 'telemetry.nextjs.org',
  291. 'telemetry.vercel.com',
  292. 'stats.setapp.com',
  293. 'stats.setapp.macpaw.dev',
  294. '.app-analytics-services.com',
  295. '.telemetry.services.yofi.ai',
  296. '.cdn.pubnub.com',
  297. '.data.debugbear.com',
  298. '.cdn.applicationinsights.io',
  299. '.applicationinsights.azure.com',
  300. '.applicationinsights.azure.cn',
  301. '.api.loganalytics.io',
  302. '.bugly.qcloud.com',
  303. '.cdn.signalfx.com',
  304. '.crash-reports.browser.yandex.net',
  305. '.crashlytics2.l.google.com',
  306. '.crashlyticsreports-pa.googleapis.com',
  307. '.e.crashlytics.com',
  308. '.events.backtrace.io',
  309. 'auth.split.io',
  310. 'events.split.io',
  311. 'streaming.split.io',
  312. '.in.appcenter.ms',
  313. '.loggly.com',
  314. '.logz.io',
  315. '.opentelemetry.io',
  316. '.raygun.io', // dashboard lives at raygun.com
  317. '.rum.cronitor.io',
  318. '.settings.crashlytics.com',
  319. '.sny.monosnap.com',
  320. '.lr-ingest.com',
  321. '.cdn.rollbar.com',
  322. '.api.instabug.com',
  323. '.ensighten.com',
  324. 'api.crashguard.me'
  325. ];
  326. export const PREDEFINED_WHITELIST = [
  327. ...CRASHLYTICS_WHITELIST,
  328. '.localhost',
  329. '.local',
  330. '.localdomain',
  331. '.broadcasthost',
  332. '.ip6-loopback',
  333. '.ip6-localnet',
  334. '.ip6-mcastprefix',
  335. '.ip6-allnodes',
  336. '.ip6-allrouters',
  337. '.ip6-allhosts',
  338. '.mcastprefix',
  339. '.skk.moe',
  340. '.cdn.cloudflare.net', // Surge/Clash doesn't support CNAME
  341. 'analytics.google.com',
  342. '.cloud.answerhub.com',
  343. 'ae01.alicdn.com',
  344. '.whoami.akamai.net',
  345. '.whoami.ds.akahelp.net',
  346. 'pxlk9.net.', // This one is malformed from EasyList, which I will manually add instead
  347. '.instant.page', // No, it doesn't violate anyone's privacy. I will whitelist it
  348. '.piwik.pro',
  349. 'mixpanel.com',
  350. 'cdn.mxpnl.com',
  351. '.heapanalytics.com',
  352. '.segment.com',
  353. '.segmentify.com',
  354. '.t.co', // pgl yoyo add t.co to the blacklist
  355. '.survicate.com', // AdGuardDNSFilter
  356. '.perfops.io', // AdGuardDNSFilter
  357. '.d2axgrpnciinw7.cloudfront.net', // ADGuardDNSFilter
  358. '.sb-cd.com', // AdGuard
  359. '.storage.yandexcloud.net', // phishing list
  360. '.login.microsoftonline.com', // phishing list
  361. 'api.xiaomi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  362. 'api.io.mi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  363. '.cdn.userreport.com', // https://github.com/AdguardTeam/AdGuardSDNSFilter/issues/1158
  364. '.ip-api.com',
  365. '.fastly-analytics.com',
  366. '.digitaloceanspaces.com',
  367. 's3.nl-ams.scw.cloud',
  368. '.geolocation-db.com',
  369. '.uploads.codesandbox.io',
  370. '.vlscppe.microsoft.com', // Affect Windows ISO download https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers.txt
  371. '.statsig.com', // OpenAI use this for A/B testing
  372. '.pstmrk.it', // Fuck Peter Lowe Hosts
  373. '.clicks.mlsend.com', // Fuck Peter Lowe Hosts
  374. 'email.accounts.bitly.com', // Fuck Peter Lowe Hosts
  375. 'adsense.google.com', // Fuck Peter Lowe Hosts
  376. 'api.vip.miui.com', // Fuck Goodbye Xiaomi Ads
  377. 'api.comm.miui.com', // Xiaomi MIUI phone number database update URL
  378. '.ai.api.xiaomi.com', // Fuck Goodbye Xiaomi Ads
  379. 'm.stripe.com', // EasyPrivacy only blocks m.stripe.com wwith $third-party,
  380. // yet stupid AdGuardDNSFilter blocks all of it. Stupid AdGuard
  381. '.w3s.link', // stupid phishing.army, introduce both "*.ipfs.w3s.link" and ".w3s.link" to the block list
  382. '.r2.dev', // Despite 5000+ r2 instances used for phishing, yet cloudflare refuse to do anything. we have no choice but whitelist this.
  383. 'mlsend.com', // Fuck Peter Lowe Hosts
  384. 'ab.chatgpt.com', // EasyPrivacy blocks this
  385. 'jnn-pa.googleapis.com', // ad-wars
  386. 'imasdk.googleapis.com', // ad-wars
  387. '.l.qq.com', // ad-wars
  388. '.in-addr.arpa', // rDNS
  389. '.ip6.arpa', // rDNS
  390. '.clients.your-server.de', // rDNS .static.183.213.201.138.clients.your-server.de
  391. '.bc.googleusercontent.com', // rDNS 218.178.172.34.bc.googleusercontent.com
  392. '.host.secureserver.net', // rDNS .64.149.167.72.host.secureserver.net,
  393. '.ip.linodeusercontent.com', // rDNS 45-79-169-153.ip.linodeusercontent.com
  394. '.shoppy.gg' // Spam404
  395. ];