reject-data-source.ts 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  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_DOMAIN_LISTS_EXTRA: HostsSource[] = [
  77. [
  78. 'https://phishing-filter.pages.dev/phishing-filter-domains.txt',
  79. [
  80. 'https://malware-filter.pages.dev/phishing-filter-domains.txt',
  81. 'https://malware-filter.gitlab.io/phishing-filter/phishing-filter-domains.txt',
  82. 'https://malware-filter.gitlab.io/malware-filter/phishing-filter-domains.txt',
  83. 'https://curbengh.github.io/phishing-filter/phishing-filter-domains.txt'
  84. ],
  85. true, TTL.THREE_HOURS()
  86. ],
  87. [
  88. 'https://phishing.army/download/phishing_army_blocklist.txt',
  89. [],
  90. true, TTL.THREE_HOURS()
  91. ]
  92. ];
  93. export const PHISHING_HOSTS_EXTRA: HostsSource[] = [
  94. [
  95. 'https://raw.githubusercontent.com/durablenapkin/scamblocklist/master/hosts.txt',
  96. [],
  97. true, TTL.TWLVE_HOURS()
  98. ]
  99. ];
  100. type AdGuardFilterSource = [main: string, mirrors: string[] | null, ttl: number, allowThirdParty?: boolean];
  101. export const ADGUARD_FILTERS: AdGuardFilterSource[] = [
  102. // no coin list adguard list is more maintained than its hosts
  103. ['https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/nocoin.txt', [], TTL.TWO_WEEKS()],
  104. // EasyList
  105. [
  106. 'https://easylist.to/easylist/easylist.txt',
  107. [
  108. 'https://easylist-downloads.adblockplus.org/easylist.txt',
  109. 'https://secure.fanboy.co.nz/easylist.txt',
  110. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist.txt',
  111. 'https://ublockorigin.pages.dev/thirdparties/easylist.txt',
  112. 'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easylist.txt'
  113. ],
  114. TTL.TWLVE_HOURS()
  115. ],
  116. // EasyPrivacy
  117. [
  118. 'https://easylist.to/easylist/easyprivacy.txt',
  119. [
  120. 'https://easylist-downloads.adblockplus.org/easyprivacy.txt',
  121. 'https://secure.fanboy.co.nz/easyprivacy.txt',
  122. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easyprivacy.txt',
  123. 'https://ublockorigin.pages.dev/thirdparties/easyprivacy.txt',
  124. 'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easyprivacy.txt'
  125. ],
  126. TTL.TWLVE_HOURS()
  127. ],
  128. // AdGuard DNS Filter
  129. [
  130. 'https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt',
  131. [
  132. 'https://filters.adtidy.org/extension/ublock/filters/15_optimized.txt',
  133. 'https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt'
  134. ],
  135. TTL.TWLVE_HOURS()
  136. ],
  137. // AdGuard Base Filter
  138. ['https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt', null, TTL.THREE_HOURS()],
  139. // AdGuard Mobile AD
  140. ['https://filters.adtidy.org/extension/ublock/filters/11_optimized.txt', null, TTL.THREE_HOURS()],
  141. // AdGuard Tracking Protection
  142. ['https://filters.adtidy.org/extension/ublock/filters/3_optimized.txt', null, TTL.THREE_HOURS()],
  143. // AdGuard Chinese filter (EasyList China + AdGuard Chinese filter)
  144. ['https://filters.adtidy.org/extension/ublock/filters/224_optimized.txt', null, TTL.THREE_HOURS()],
  145. // GameConsoleAdblockList
  146. // Update almost once per 1 to 3 months, let's set a 10 days cache ttl
  147. ['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/GameConsoleAdblockList.txt', null, TTL.TEN_DAYS()],
  148. // PiHoleBlocklist
  149. // Update almost once per 3 months, let's set a 10 days cache ttl
  150. [
  151. 'https://perflyst.github.io/PiHoleBlocklist/SmartTV-AGH.txt',
  152. [
  153. 'https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt'
  154. ],
  155. TTL.TEN_DAYS()
  156. ],
  157. // uBlock Origin Unbreak
  158. [
  159. 'https://ublockorigin.github.io/uAssetsCDN/filters/unbreak.min.txt',
  160. [
  161. 'https://ublockorigin.pages.dev/filters/unbreak.min.txt'
  162. ],
  163. TTL.THREE_HOURS()
  164. ]
  165. ];
  166. export const ADGUARD_FILTERS_WHITELIST: AdGuardFilterSource[] = [
  167. [
  168. 'https://adguardteam.github.io/AdGuardSDNSFilter/Filters/exceptions.txt',
  169. [
  170. 'https://raw.githubusercontent.com/AdguardTeam/AdGuardSDNSFilter/master/Filters/exceptions.txt'
  171. ],
  172. TTL.THREE_HOURS()
  173. ],
  174. [
  175. 'https://adguardteam.github.io/AdGuardSDNSFilter/Filters/exclusions.txt',
  176. [
  177. 'https://raw.githubusercontent.com/AdguardTeam/AdGuardSDNSFilter/master/Filters/exclusions.txt'
  178. ],
  179. TTL.THREE_HOURS()
  180. ]
  181. ];
  182. export const ADGUARD_FILTERS_EXTRA: AdGuardFilterSource[] = [
  183. // AdGuard Annoyances filter
  184. ['https://filters.adtidy.org/extension/ublock/filters/14_optimized.txt', null, TTL.THREE_HOURS(), true],
  185. // AdGuard Cookie Notices, included in Annoyances filter
  186. // ['https://filters.adtidy.org/extension/ublock/filters/18_optimized.txt', null, TTL.THREE_HOURS(), true],
  187. // EasyList Germany filter, not even included in extra for now
  188. // [
  189. // 'https://easylist.to/easylistgermany/easylistgermany.txt',
  190. // [
  191. // 'https://easylist-downloads.adblockplus.org/easylistgermany.txt'
  192. // ],
  193. // TTL.TWLVE_HOURS()
  194. // ],
  195. // AdGuard Japanese filter
  196. ['https://filters.adtidy.org/extension/ublock/filters/7_optimized.txt', null, TTL.THREE_HOURS()],
  197. // uBlock Origin Filter List
  198. [
  199. 'https://ublockorigin.github.io/uAssetsCDN/filters/filters.min.txt',
  200. [
  201. 'https://ublockorigin.pages.dev/filters/filters.min.txt'
  202. ],
  203. TTL.THREE_HOURS()
  204. ],
  205. // AdGuard Popup Overlay - included in Annoyances filter
  206. // ['https://filters.adtidy.org/extension/ublock/filters/19_optimized.txt', null, TTL.THREE_HOURS(), true],
  207. // AdGuard Mobile Banner
  208. // almost all generic rule
  209. // ['https://filters.adtidy.org/extension/ublock/filters/20_optimized.txt', null, TTL.THREE_HOURS()],
  210. // uBlock Origin Badware Risk List
  211. [
  212. 'https://ublockorigin.github.io/uAssetsCDN/filters/badware.min.txt',
  213. [
  214. 'https://ublockorigin.pages.dev/filters/badware.min.txt'
  215. ],
  216. TTL.THREE_HOURS()
  217. ],
  218. // uBlock Origin Privacy List
  219. [
  220. 'https://ublockorigin.github.io/uAssetsCDN/filters/privacy.min.txt',
  221. [
  222. 'https://ublockorigin.pages.dev/filters/privacy.min.txt'
  223. ],
  224. TTL.THREE_HOURS()
  225. ],
  226. // uBlock Origin Resource Abuse: merged in uBlock Origin Privacy List
  227. // [
  228. // 'https://ublockorigin.github.io/uAssetsCDN/filters/resource-abuse.txt',
  229. // ['https://ublockorigin.pages.dev/filters/resource-abuse.txt']
  230. // ],
  231. // uBlock Origin Annoyances
  232. [
  233. 'https://ublockorigin.github.io/uAssetsCDN/filters/annoyances.min.txt',
  234. ['https://ublockorigin.pages.dev/filters/annoyances.min.txt'],
  235. TTL.THREE_HOURS()
  236. ],
  237. // EasyList Annoyances
  238. [
  239. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist-annoyances.txt',
  240. ['https://ublockorigin.pages.dev/thirdparties/easylist-annoyances.txt'],
  241. TTL.THREE_HOURS()
  242. ],
  243. // Dandelion Sprout's Annoyances
  244. ['https://filters.adtidy.org/extension/ublock/filters/250_optimized.txt', null, TTL.THREE_HOURS(), true],
  245. // EasyList - Newsletters
  246. [
  247. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist-newsletters.txt',
  248. ['https://ublockorigin.pages.dev/thirdparties/easylist-newsletters.txt'],
  249. TTL.THREE_HOURS()
  250. ],
  251. // EasyList - Notifications
  252. [
  253. 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-notifications.txt',
  254. ['https://ublockorigin.pages.dev/thirdparties/easylist-notifications.txt'],
  255. TTL.THREE_HOURS()
  256. ],
  257. // Fanboy Cookie Monster (EasyList Cookie List)
  258. [
  259. 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-cookies.txt',
  260. [
  261. 'https://ublockorigin.pages.dev/thirdparties/easylist-cookies.txt',
  262. 'https://secure.fanboy.co.nz/fanboy-cookiemonster_ubo.txt'
  263. ],
  264. TTL.TWLVE_HOURS()
  265. ]
  266. ];
  267. // In a hostile network like when an ad blocker is present, apps might be crashing, and these errors need to be
  268. // The reason for unblocking crashlytics is to not make developers life worse by breaking crash reporting.
  269. // In a hostile network like when an ad blocker is present, apps might be crashing, and these errors need to be
  270. // reported to devs, otherwise they won't learn about the issue and won't fix it.
  271. // Also, it is not a common third-party analytics tracker, Crashlytics is not used for collecting users' data.
  272. export const CRASHLYTICS_WHITELIST = [
  273. // VSCode Telemetry, see https://sts.online.visualstudio.com/api/swagger/index.html
  274. 'sts.online.visualstudio.com',
  275. // Sentry
  276. '.ingest.sentry.io',
  277. // bugsnag
  278. '.sessions.bugsnag.com',
  279. '.notify.bugsnag.com',
  280. // influxdata
  281. '.cloud.influxdata.com',
  282. '.cloud1.influxdata.com',
  283. '.cloud2.influxdata.com',
  284. // split.io A/B flag
  285. 'streaming.split.io',
  286. 'telemetry.split.io',
  287. 'sdk.split.io',
  288. // Google
  289. // -ds.metric.gstatic.com are specifically exempted from reject, but it could use secondary proxy policy
  290. '.metric.gstatic.com',
  291. // Misc
  292. 'telemetry.1passwordservices.com',
  293. 'events.tableplus.com',
  294. 'telemetry.nextjs.org',
  295. 'telemetry.vercel.com',
  296. 'stats.setapp.com',
  297. 'stats.setapp.macpaw.dev',
  298. '.app-analytics-services.com',
  299. '.telemetry.services.yofi.ai',
  300. '.cdn.pubnub.com',
  301. '.data.debugbear.com',
  302. '.cdn.applicationinsights.io',
  303. '.applicationinsights.azure.com',
  304. '.applicationinsights.azure.cn',
  305. '.api.loganalytics.io',
  306. '.bugly.qcloud.com',
  307. '.cdn.signalfx.com',
  308. '.crash-reports.browser.yandex.net',
  309. '.crashlytics2.l.google.com',
  310. '.crashlyticsreports-pa.googleapis.com',
  311. '.e.crashlytics.com',
  312. '.events.backtrace.io',
  313. 'auth.split.io',
  314. 'events.split.io',
  315. 'streaming.split.io',
  316. '.in.appcenter.ms',
  317. '.loggly.com',
  318. '.logz.io',
  319. '.opentelemetry.io',
  320. '.raygun.io', // dashboard lives at raygun.com
  321. '.rum.cronitor.io',
  322. '.settings.crashlytics.com',
  323. '.sny.monosnap.com',
  324. '.lr-ingest.com',
  325. '.cdn.rollbar.com',
  326. '.api.instabug.com',
  327. '.ensighten.com'
  328. ];
  329. export const PREDEFINED_WHITELIST = [
  330. ...CRASHLYTICS_WHITELIST,
  331. '.localhost',
  332. '.local',
  333. '.localhost.localdomain',
  334. '.broadcasthost',
  335. '.ip6-loopback',
  336. '.ip6-localnet',
  337. '.ip6-mcastprefix',
  338. '.ip6-allnodes',
  339. '.ip6-allrouters',
  340. '.ip6-allhosts',
  341. '.mcastprefix',
  342. '.skk.moe',
  343. '.cdn.cloudflare.net', // Surge/Clash doesn't support CNAME
  344. 'analytics.google.com',
  345. '.cloud.answerhub.com',
  346. 'ae01.alicdn.com',
  347. '.whoami.akamai.net',
  348. '.whoami.ds.akahelp.net',
  349. 'pxlk9.net.', // This one is malformed from EasyList, which I will manually add instead
  350. '.instant.page', // No, it doesn't violate anyone's privacy. I will whitelist it
  351. '.piwik.pro',
  352. 'mixpanel.com',
  353. 'cdn.mxpnl.com',
  354. '.heapanalytics.com',
  355. '.segment.com',
  356. '.segmentify.com',
  357. '.t.co', // pgl yoyo add t.co to the blacklist
  358. '.survicate.com', // AdGuardDNSFilter
  359. '.perfops.io', // AdGuardDNSFilter
  360. '.d2axgrpnciinw7.cloudfront.net', // ADGuardDNSFilter
  361. '.sb-cd.com', // AdGuard
  362. '.storage.yandexcloud.net', // phishing list
  363. '.login.microsoftonline.com', // phishing list
  364. 'api.xiaomi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  365. 'api.io.mi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  366. '.cdn.userreport.com', // https://github.com/AdguardTeam/AdGuardSDNSFilter/issues/1158
  367. '.ip-api.com',
  368. '.fastly-analytics.com',
  369. '.digitaloceanspaces.com',
  370. 's3.nl-ams.scw.cloud',
  371. '.geolocation-db.com',
  372. '.uploads.codesandbox.io',
  373. '.vlscppe.microsoft.com', // Affect Windows ISO download https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers.txt
  374. '.statsig.com', // OpenAI use this for A/B testing
  375. '.pstmrk.it', // Fuck Peter Lowe Hosts
  376. '.clicks.mlsend.com', // Fuck Peter Lowe Hosts
  377. 'email.accounts.bitly.com', // Fuck Peter Lowe Hosts
  378. 'adsense.google.com', // Fuck Peter Lowe Hosts
  379. 'api.vip.miui.com', // Fuck Goodbye Xiaomi Ads
  380. '.ai.api.xiaomi.com', // Fuck Goodbye Xiaomi Ads
  381. 'm.stripe.com', // EasyPrivacy only blocks m.stripe.com wwith $third-party,
  382. // yet stupid AdGuardDNSFilter blocks all of it. Stupid AdGuard
  383. '.w3s.link', // stupid phishing.army, introduce both "*.ipfs.w3s.link" and ".w3s.link" to the block list
  384. '.r2.dev', // Despite 5000+ r2 instances used for phishing, yet cloudflare refuse to do anything. we have no choice but whitelist this.
  385. 'mlsend.com', // Fuck Peter Lowe Hosts
  386. 'ab.chatgpt.com', // EasyPrivacy blocks this
  387. 'jnn-pa.googleapis.com', // ad-wars
  388. 'imasdk.googleapis.com', // ad-wars
  389. '.l.qq.com' // ad-wars
  390. ];