reject-data-source.ts 16 KB

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