reject-data-source.ts 13 KB

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