reject-data-source.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. // no coin list is not actively maintained, but it updates daily when being maintained, so we set a 3 days cache ttl
  5. ['https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt', null, true, TTL.THREE_DAYS()],
  6. // have not been updated for more than a year, so we set a 14 days cache ttl
  7. ['https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt', null, true, TTL.TWO_WEEKS()],
  8. ['https://raw.githubusercontent.com/jerryn70/GoodbyeAds/master/Extension/GoodbyeAds-Xiaomi-Extension.txt', null, false, TTL.THREE_DAYS()],
  9. ['https://raw.githubusercontent.com/jerryn70/GoodbyeAds/master/Extension/GoodbyeAds-Huawei-AdBlock.txt', null, false, TTL.THREE_DAYS()],
  10. ['https://raw.githubusercontent.com/durablenapkin/block/master/luminati.txt', null, true, TTL.THREE_HOURS()]
  11. ] as const;
  12. export const HOSTS_EXTRA: HostsSource[] = [
  13. // This stupid hosts blocks t.co, so we determine that this is also bullshit, so it is also extra
  14. [
  15. 'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext',
  16. ['https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/thirdparties/pgl.yoyo.org/as/serverlist'],
  17. true,
  18. TTL.THREE_HOURS()
  19. ],
  20. // Dan Pollock's hosts file, 0.0.0.0 version is 30 KiB smaller
  21. ['https://someonewhocares.org/hosts/zero/hosts', null, true, TTL.THREE_HOURS()],
  22. // ad-wars is not actively maintained, so we set a 7 days cache ttl
  23. ['https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts', null, false, TTL.ONE_WEEK()]
  24. ];
  25. export const DOMAIN_LISTS: HostsSource[] = [
  26. // CoinBlockerList
  27. // 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
  28. ['https://zerodot1.gitlab.io/CoinBlockerLists/list_browser.txt', [], true, TTL.TWO_WEEKS()],
  29. // Curben's UrlHaus Malicious URL Blocklist
  30. [
  31. 'https://curbengh.github.io/urlhaus-filter/urlhaus-filter-domains.txt',
  32. [
  33. 'https://urlhaus-filter.pages.dev/urlhaus-filter-domains.txt',
  34. 'https://malware-filter.gitlab.io/malware-filter/urlhaus-filter-domains.txt'
  35. ],
  36. true, TTL.THREE_HOURS()
  37. ]
  38. ] as const;
  39. export const DOMAIN_LISTS_EXTRA: HostsSource[] = [
  40. // BarbBlock
  41. // The barbblock list has never been updated since 2019-05, so we set a 14 days cache ttl
  42. ['https://paulgb.github.io/BarbBlock/blacklists/domain-list.txt', [], true, TTL.TWO_WEEKS()],
  43. // DigitalSide Threat-Intel - OSINT Hub
  44. // Update once per day
  45. ['https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt', [], true, TTL.ONE_DAY()],
  46. // AdGuard CNAME Filter Combined
  47. // Update on a 7 days basis, so we add a 3 hours cache ttl
  48. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_ads_justdomains.txt', [], true, TTL.THREE_DAYS()],
  49. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers_justdomains.txt', [], true, TTL.THREE_DAYS()],
  50. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_clickthroughs_justdomains.txt', [], true, TTL.THREE_DAYS()],
  51. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_microsites_justdomains.txt', [], true, TTL.THREE_DAYS()],
  52. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_mail_trackers_justdomains.txt', [], true, TTL.THREE_DAYS()],
  53. // Curben's PUP Domains Blocklist
  54. // 'https://curbengh.github.io/pup-filter/pup-filter-agh.txt'
  55. // 'https://pup-filter.pages.dev/pup-filter-agh.txt'
  56. // The PUP filter has paused the update since 2023-05, so we set a 14 days cache ttl, and move it to extra
  57. [
  58. 'https://curbengh.github.io/pup-filter/pup-filter-domains.txt',
  59. [
  60. 'https://pup-filter.pages.dev/pup-filter-domains.txt',
  61. 'https://malware-filter.gitlab.io/pup-filter/pup-filter-domains.txt'
  62. ],
  63. true, TTL.TWO_WEEKS()
  64. ]
  65. ];
  66. export const PHISHING_DOMAIN_LISTS_EXTRA: [HostsSource, HostsSource] = [
  67. [
  68. 'https://curbengh.github.io/phishing-filter/phishing-filter-domains.txt',
  69. [
  70. 'https://phishing-filter.pages.dev/phishing-filter-domains.txt',
  71. 'https://malware-filter.gitlab.io/malware-filter/phishing-filter-domains.txt'
  72. ],
  73. true, TTL.THREE_HOURS()
  74. ],
  75. [
  76. 'https://phishing.army/download/phishing_army_blocklist.txt',
  77. [],
  78. true, TTL.THREE_HOURS()
  79. ]
  80. ] as const;
  81. type AdGuardFilterSource = [main: string, mirrors: string[] | null, ttl: number];
  82. export const ADGUARD_FILTERS: AdGuardFilterSource[] = [
  83. // EasyList
  84. [
  85. 'https://easylist.to/easylist/easylist.txt',
  86. [
  87. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist.txt',
  88. 'https://ublockorigin.pages.dev/thirdparties/easylist.txt',
  89. 'https://easylist-downloads.adblockplus.org/easylist.txt',
  90. 'https://secure.fanboy.co.nz/easylist.txt',
  91. 'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easylist.txt'
  92. ],
  93. TTL.TWLVE_HOURS()
  94. ],
  95. // EasyPrivacy
  96. [
  97. 'https://easylist.to/easylist/easyprivacy.txt',
  98. [
  99. 'https://secure.fanboy.co.nz/easyprivacy.txt',
  100. 'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easyprivacy.txt',
  101. 'https://easylist-downloads.adblockplus.org/easyprivacy.txt',
  102. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easyprivacy.txt',
  103. 'https://ublockorigin.pages.dev/thirdparties/easyprivacy.txt'
  104. ],
  105. TTL.TWLVE_HOURS()
  106. ],
  107. // AdGuard DNS Filter
  108. [
  109. 'https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt',
  110. [
  111. 'https://filters.adtidy.org/extension/ublock/filters/15_optimized.txt',
  112. 'https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt'
  113. ],
  114. TTL.TWLVE_HOURS()
  115. ],
  116. // AdGuard Base Filter
  117. ['https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt', null, TTL.THREE_HOURS()],
  118. // AdGuard Mobile AD
  119. ['https://filters.adtidy.org/extension/ublock/filters/11_optimized.txt', null, TTL.THREE_HOURS()],
  120. // AdGuard Tracking Protection
  121. ['https://filters.adtidy.org/extension/ublock/filters/3_optimized.txt', null, TTL.THREE_HOURS()],
  122. // AdGuard Chinese filter (EasyList China + AdGuard Chinese filter)
  123. ['https://filters.adtidy.org/extension/ublock/filters/224_optimized.txt', null, TTL.THREE_HOURS()],
  124. // GameConsoleAdblockList
  125. // Update almost once per 1 to 3 months, let's set a 10 days cache ttl
  126. ['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/GameConsoleAdblockList.txt', null, TTL.TEN_DAYS()],
  127. // PiHoleBlocklist
  128. // Update almost once per 3 months, let's set a 10 days cache ttl
  129. [
  130. 'https://perflyst.github.io/PiHoleBlocklist/SmartTV-AGH.txt',
  131. [
  132. 'https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt'
  133. ],
  134. TTL.TEN_DAYS()
  135. ],
  136. // Spam404
  137. // Not actively maintained, let's use a 10 days cache ttl
  138. ['https://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt', null, TTL.TEN_DAYS()],
  139. // Brave First Party & First Party CNAME
  140. ['https://raw.githubusercontent.com/brave/adblock-lists/master/brave-lists/brave-firstparty.txt', null, TTL.ONE_DAY()]
  141. ] as const;
  142. export const ADGUARD_FILTERS_EXTRA: AdGuardFilterSource[] = [
  143. // AdGuard Annoyances filter
  144. ['https://filters.adtidy.org/android/filters/14_optimized.txt', null, TTL.THREE_HOURS()],
  145. // AdGuard Cookie Notices
  146. ['https://filters.adtidy.org/extension/ublock/filters/18_optimized.txt', null, TTL.THREE_HOURS()],
  147. // EasyList Germany filter
  148. [
  149. 'https://easylist.to/easylistgermany/easylistgermany.txt',
  150. [
  151. 'https://easylist-downloads.adblockplus.org/easylistgermany.txt'
  152. ],
  153. TTL.TWLVE_HOURS()
  154. ],
  155. // AdGuard Japanese filter
  156. ['https://filters.adtidy.org/extension/ublock/filters/7_optimized.txt', null, TTL.THREE_HOURS()],
  157. // uBlock Origin Filter List
  158. [
  159. 'https://ublockorigin.github.io/uAssetsCDN/filters/filters.min.txt',
  160. [
  161. 'https://ublockorigin.pages.dev/filters/filters.min.txt'
  162. ],
  163. TTL.THREE_HOURS()
  164. ],
  165. // AdGuard Popup Overlay
  166. ['https://filters.adtidy.org/extension/ublock/filters/19_optimized.txt', null, TTL.THREE_HOURS()],
  167. // AdGuard Mobile Banner
  168. ['https://filters.adtidy.org/extension/ublock/filters/20_optimized.txt', null, TTL.THREE_HOURS()],
  169. // uBlock Origin Badware Risk List
  170. [
  171. 'https://ublockorigin.github.io/uAssetsCDN/filters/badware.min.txt',
  172. [
  173. 'https://ublockorigin.pages.dev/filters/badware.min.txt'
  174. ],
  175. TTL.THREE_HOURS()
  176. ],
  177. // uBlock Origin Privacy List
  178. [
  179. 'https://ublockorigin.github.io/uAssetsCDN/filters/privacy.min.txt',
  180. [
  181. 'https://ublockorigin.pages.dev/filters/privacy.min.txt'
  182. ],
  183. TTL.THREE_HOURS()
  184. ],
  185. // uBlock Origin Resource Abuse: merged in uBlock Origin Privacy List
  186. // [
  187. // 'https://ublockorigin.github.io/uAssetsCDN/filters/resource-abuse.txt',
  188. // [
  189. // 'https://ublockorigin.pages.dev/filters/resource-abuse.txt'
  190. // ]
  191. // ],
  192. // uBlock Origin Unbreak
  193. [
  194. 'https://ublockorigin.github.io/uAssetsCDN/filters/unbreak.min.txt',
  195. [
  196. 'https://ublockorigin.pages.dev/filters/unbreak.min.txt'
  197. ],
  198. TTL.THREE_HOURS()
  199. ],
  200. // uBlock Origin Annoyances
  201. [
  202. 'https://ublockorigin.github.io/uAssetsCDN/filters/annoyances.min.txt',
  203. [
  204. 'https://ublockorigin.pages.dev/filters/annoyances.min.txt'
  205. ],
  206. TTL.THREE_HOURS()
  207. ],
  208. // EasyList Annoyances
  209. [
  210. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist-annoyances.txt',
  211. [
  212. 'https://ublockorigin.pages.dev/thirdparties/easylist-annoyances.txt'
  213. ],
  214. TTL.THREE_HOURS()
  215. ],
  216. // EasyList - Newsletters
  217. [
  218. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist-newsletters.txt',
  219. [
  220. 'https://ublockorigin.pages.dev/thirdparties/easylist-newsletters.txt'
  221. ],
  222. TTL.THREE_HOURS()
  223. ],
  224. // EasyList - Notifications
  225. [
  226. 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-notifications.txt',
  227. [
  228. 'https://ublockorigin.pages.dev/thirdparties/easylist-notifications.txt'
  229. ],
  230. TTL.THREE_HOURS()
  231. ],
  232. // Fanboy Cookie Monster (EasyList Cookie List)
  233. [
  234. 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-cookies.txt',
  235. [
  236. 'https://ublockorigin.pages.dev/thirdparties/easylist-cookies.txt',
  237. 'https://secure.fanboy.co.nz/fanboy-cookiemonster_ubo.txt'
  238. ],
  239. TTL.TWLVE_HOURS()
  240. ]
  241. ];
  242. export const PREDEFINED_WHITELIST = [
  243. '.localhost',
  244. '.local',
  245. '.localhost.localdomain',
  246. '.broadcasthost',
  247. '.ip6-loopback',
  248. '.ip6-localnet',
  249. '.ip6-mcastprefix',
  250. '.ip6-allnodes',
  251. '.ip6-allrouters',
  252. '.ip6-allhosts',
  253. '.mcastprefix',
  254. '.skk.moe',
  255. 'analytics.google.com',
  256. '.cloud.answerhub.com',
  257. 'ae01.alicdn.com',
  258. '.whoami.akamai.net',
  259. '.whoami.ds.akahelp.net',
  260. 'pxlk9.net.', // This one is malformed from EasyList, which I will manually add instead
  261. '.instant.page', // No, it doesn't violate anyone's privacy. I will whitelist it
  262. '.piwik.pro',
  263. 'mixpanel.com',
  264. 'cdn.mxpnl.com',
  265. '.heapanalytics.com',
  266. '.segment.com',
  267. '.segmentify.com',
  268. '.t.co', // pgl yoyo add t.co to the blacklist
  269. '.survicate.com', // AdGuardDNSFilter
  270. '.perfops.io', // AdGuardDNSFilter
  271. '.d2axgrpnciinw7.cloudfront.net', // ADGuardDNSFilter
  272. '.sb-cd.com', // AdGuard
  273. '.storage.yandexcloud.net', // phishing list
  274. '.login.microsoftonline.com', // phishing list
  275. 'api.xiaomi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  276. 'api.io.mi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  277. '.cdn.userreport.com', // https://github.com/AdguardTeam/AdGuardSDNSFilter/issues/1158
  278. '.ip-api.com',
  279. '.fastly-analytics.com',
  280. '.digitaloceanspaces.com',
  281. 's3.nl-ams.scw.cloud',
  282. '.geolocation-db.com',
  283. '.uploads.codesandbox.io',
  284. '.vlscppe.microsoft.com', // Affect Windows ISO download https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers.txt
  285. '.statsig.com', // OpenAI use this for A/B testing
  286. '.pstmrk.it', // Fuck Peter Lowe Hosts
  287. '.clicks.mlsend.com', // Fuck Peter Lowe Hosts
  288. 'email.accounts.bitly.com', // Fuck Peter Lowe Hosts
  289. 'adsense.google.com', // Fuck Peter Lowe Hosts
  290. 'api.vip.miui.com', // Fuck Goodbye Xiaomi Ads
  291. 'staging.ai.api.xiaomi.com', // Fuck Goodbye Xiaomi Ads
  292. 'm.stripe.com', // EasyPrivacy only blocks m.stripe.com wwith $third-party,
  293. // yet stupid AdGuardDNSFilter blocks all of it. Stupid AdGuard
  294. '.w3s.link', // stupid phishing.army, introduce both "*.ipfs.w3s.link" and ".w3s.link" to the block list
  295. 'ipfs.io', // ipfs.io was blocked by DigitalSide Threat-Intel - OSINT Hub
  296. '.r2.dev', // Despite 5000+ r2 instances used for phishing, yet cloudflare refuse to do anything. we have no choice but whitelist this.
  297. 'mlsend.com', // Fuck Peter Lowe Hosts
  298. 'ab.chatgpt.com' // EasyPrivacy blocks this
  299. ];