reject-data-source.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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. ['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. ];
  67. export const PHISHING_DOMAIN_LISTS_EXTRA: [HostsSource, HostsSource] = [
  68. [
  69. 'https://curbengh.github.io/phishing-filter/phishing-filter-domains.txt',
  70. [
  71. 'https://phishing-filter.pages.dev/phishing-filter-domains.txt',
  72. 'https://malware-filter.gitlab.io/malware-filter/phishing-filter-domains.txt'
  73. ],
  74. true, TTL.THREE_HOURS()
  75. ],
  76. [
  77. 'https://phishing.army/download/phishing_army_blocklist.txt',
  78. [],
  79. true, TTL.THREE_HOURS()
  80. ]
  81. ];
  82. type AdGuardFilterSource = [main: string, mirrors: string[] | null, ttl: number, allowThirdParty?: boolean];
  83. export const ADGUARD_FILTERS: AdGuardFilterSource[] = [
  84. // EasyList
  85. [
  86. 'https://easylist.to/easylist/easylist.txt',
  87. [
  88. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist.txt',
  89. 'https://ublockorigin.pages.dev/thirdparties/easylist.txt',
  90. 'https://easylist-downloads.adblockplus.org/easylist.txt',
  91. 'https://secure.fanboy.co.nz/easylist.txt',
  92. 'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easylist.txt'
  93. ],
  94. TTL.TWLVE_HOURS()
  95. ],
  96. // EasyPrivacy
  97. [
  98. 'https://easylist.to/easylist/easyprivacy.txt',
  99. [
  100. 'https://secure.fanboy.co.nz/easyprivacy.txt',
  101. 'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easyprivacy.txt',
  102. 'https://easylist-downloads.adblockplus.org/easyprivacy.txt',
  103. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easyprivacy.txt',
  104. 'https://ublockorigin.pages.dev/thirdparties/easyprivacy.txt'
  105. ],
  106. TTL.TWLVE_HOURS()
  107. ],
  108. // AdGuard DNS Filter
  109. [
  110. 'https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt',
  111. [
  112. 'https://filters.adtidy.org/extension/ublock/filters/15_optimized.txt',
  113. 'https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt'
  114. ],
  115. TTL.TWLVE_HOURS()
  116. ],
  117. // AdGuard Base Filter
  118. ['https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt', null, TTL.THREE_HOURS()],
  119. // AdGuard Mobile AD
  120. ['https://filters.adtidy.org/extension/ublock/filters/11_optimized.txt', null, TTL.THREE_HOURS()],
  121. // AdGuard Tracking Protection
  122. ['https://filters.adtidy.org/extension/ublock/filters/3_optimized.txt', null, TTL.THREE_HOURS()],
  123. // AdGuard Chinese filter (EasyList China + AdGuard Chinese filter)
  124. ['https://filters.adtidy.org/extension/ublock/filters/224_optimized.txt', null, TTL.THREE_HOURS()],
  125. // GameConsoleAdblockList
  126. // Update almost once per 1 to 3 months, let's set a 10 days cache ttl
  127. ['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/GameConsoleAdblockList.txt', null, TTL.TEN_DAYS()],
  128. // PiHoleBlocklist
  129. // Update almost once per 3 months, let's set a 10 days cache ttl
  130. [
  131. 'https://perflyst.github.io/PiHoleBlocklist/SmartTV-AGH.txt',
  132. [
  133. 'https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt'
  134. ],
  135. TTL.TEN_DAYS()
  136. ],
  137. // Spam404
  138. // Not actively maintained, let's use a 10 days cache ttl
  139. ['https://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt', null, TTL.TEN_DAYS()],
  140. // Brave First Party & First Party CNAME
  141. ['https://raw.githubusercontent.com/brave/adblock-lists/master/brave-lists/brave-firstparty.txt', null, TTL.ONE_DAY()]
  142. ];
  143. export const ADGUARD_FILTERS_EXTRA: AdGuardFilterSource[] = [
  144. // AdGuard Annoyances filter
  145. ['https://filters.adtidy.org/android/filters/14_optimized.txt', null, TTL.THREE_HOURS(), true],
  146. // AdGuard Cookie Notices
  147. ['https://filters.adtidy.org/extension/ublock/filters/18_optimized.txt', null, TTL.THREE_HOURS(), true],
  148. // EasyList Germany filter
  149. [
  150. 'https://easylist.to/easylistgermany/easylistgermany.txt',
  151. [
  152. 'https://easylist-downloads.adblockplus.org/easylistgermany.txt'
  153. ],
  154. TTL.TWLVE_HOURS()
  155. ],
  156. // AdGuard Japanese filter
  157. ['https://filters.adtidy.org/extension/ublock/filters/7_optimized.txt', null, TTL.THREE_HOURS()],
  158. // uBlock Origin Filter List
  159. [
  160. 'https://ublockorigin.github.io/uAssetsCDN/filters/filters.min.txt',
  161. [
  162. 'https://ublockorigin.pages.dev/filters/filters.min.txt'
  163. ],
  164. TTL.THREE_HOURS()
  165. ],
  166. // AdGuard Popup Overlay
  167. ['https://filters.adtidy.org/extension/ublock/filters/19_optimized.txt', null, TTL.THREE_HOURS(), true],
  168. // AdGuard Mobile Banner
  169. // almost all generic rule
  170. // ['https://filters.adtidy.org/extension/ublock/filters/20_optimized.txt', null, TTL.THREE_HOURS()],
  171. // uBlock Origin Badware Risk List
  172. [
  173. 'https://ublockorigin.github.io/uAssetsCDN/filters/badware.min.txt',
  174. [
  175. 'https://ublockorigin.pages.dev/filters/badware.min.txt'
  176. ],
  177. TTL.THREE_HOURS()
  178. ],
  179. // uBlock Origin Privacy List
  180. [
  181. 'https://ublockorigin.github.io/uAssetsCDN/filters/privacy.min.txt',
  182. [
  183. 'https://ublockorigin.pages.dev/filters/privacy.min.txt'
  184. ],
  185. TTL.THREE_HOURS()
  186. ],
  187. // uBlock Origin Resource Abuse: merged in uBlock Origin Privacy List
  188. // [
  189. // 'https://ublockorigin.github.io/uAssetsCDN/filters/resource-abuse.txt',
  190. // [
  191. // 'https://ublockorigin.pages.dev/filters/resource-abuse.txt'
  192. // ]
  193. // ],
  194. // uBlock Origin Unbreak
  195. [
  196. 'https://ublockorigin.github.io/uAssetsCDN/filters/unbreak.min.txt',
  197. [
  198. 'https://ublockorigin.pages.dev/filters/unbreak.min.txt'
  199. ],
  200. TTL.THREE_HOURS()
  201. ],
  202. // uBlock Origin Annoyances
  203. [
  204. 'https://ublockorigin.github.io/uAssetsCDN/filters/annoyances.min.txt',
  205. [
  206. 'https://ublockorigin.pages.dev/filters/annoyances.min.txt'
  207. ],
  208. TTL.THREE_HOURS()
  209. ],
  210. // EasyList Annoyances
  211. [
  212. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist-annoyances.txt',
  213. [
  214. 'https://ublockorigin.pages.dev/thirdparties/easylist-annoyances.txt'
  215. ],
  216. TTL.THREE_HOURS()
  217. ],
  218. // EasyList - Newsletters
  219. [
  220. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist-newsletters.txt',
  221. [
  222. 'https://ublockorigin.pages.dev/thirdparties/easylist-newsletters.txt'
  223. ],
  224. TTL.THREE_HOURS()
  225. ],
  226. // EasyList - Notifications
  227. [
  228. 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-notifications.txt',
  229. [
  230. 'https://ublockorigin.pages.dev/thirdparties/easylist-notifications.txt'
  231. ],
  232. TTL.THREE_HOURS()
  233. ],
  234. // Fanboy Cookie Monster (EasyList Cookie List)
  235. [
  236. 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-cookies.txt',
  237. [
  238. 'https://ublockorigin.pages.dev/thirdparties/easylist-cookies.txt',
  239. 'https://secure.fanboy.co.nz/fanboy-cookiemonster_ubo.txt'
  240. ],
  241. TTL.TWLVE_HOURS()
  242. ]
  243. ];
  244. export const PREDEFINED_WHITELIST = [
  245. '.localhost',
  246. '.local',
  247. '.localhost.localdomain',
  248. '.broadcasthost',
  249. '.ip6-loopback',
  250. '.ip6-localnet',
  251. '.ip6-mcastprefix',
  252. '.ip6-allnodes',
  253. '.ip6-allrouters',
  254. '.ip6-allhosts',
  255. '.mcastprefix',
  256. '.skk.moe',
  257. 'analytics.google.com',
  258. '.cloud.answerhub.com',
  259. 'ae01.alicdn.com',
  260. '.whoami.akamai.net',
  261. '.whoami.ds.akahelp.net',
  262. 'pxlk9.net.', // This one is malformed from EasyList, which I will manually add instead
  263. '.instant.page', // No, it doesn't violate anyone's privacy. I will whitelist it
  264. '.piwik.pro',
  265. 'mixpanel.com',
  266. 'cdn.mxpnl.com',
  267. '.heapanalytics.com',
  268. '.segment.com',
  269. '.segmentify.com',
  270. '.t.co', // pgl yoyo add t.co to the blacklist
  271. '.survicate.com', // AdGuardDNSFilter
  272. '.perfops.io', // AdGuardDNSFilter
  273. '.d2axgrpnciinw7.cloudfront.net', // ADGuardDNSFilter
  274. '.sb-cd.com', // AdGuard
  275. '.storage.yandexcloud.net', // phishing list
  276. '.login.microsoftonline.com', // phishing list
  277. 'api.xiaomi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  278. 'api.io.mi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  279. '.cdn.userreport.com', // https://github.com/AdguardTeam/AdGuardSDNSFilter/issues/1158
  280. '.ip-api.com',
  281. '.fastly-analytics.com',
  282. '.digitaloceanspaces.com',
  283. 's3.nl-ams.scw.cloud',
  284. '.geolocation-db.com',
  285. '.uploads.codesandbox.io',
  286. '.vlscppe.microsoft.com', // Affect Windows ISO download https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers.txt
  287. '.statsig.com', // OpenAI use this for A/B testing
  288. '.pstmrk.it', // Fuck Peter Lowe Hosts
  289. '.clicks.mlsend.com', // Fuck Peter Lowe Hosts
  290. 'email.accounts.bitly.com', // Fuck Peter Lowe Hosts
  291. 'adsense.google.com', // Fuck Peter Lowe Hosts
  292. 'api.vip.miui.com', // Fuck Goodbye Xiaomi Ads
  293. 'staging.ai.api.xiaomi.com', // Fuck Goodbye Xiaomi Ads
  294. 'm.stripe.com', // EasyPrivacy only blocks m.stripe.com wwith $third-party,
  295. // yet stupid AdGuardDNSFilter blocks all of it. Stupid AdGuard
  296. '.w3s.link', // stupid phishing.army, introduce both "*.ipfs.w3s.link" and ".w3s.link" to the block list
  297. '.r2.dev', // Despite 5000+ r2 instances used for phishing, yet cloudflare refuse to do anything. we have no choice but whitelist this.
  298. 'mlsend.com', // Fuck Peter Lowe Hosts
  299. 'ab.chatgpt.com', // EasyPrivacy blocks this
  300. 'jnn-pa.googleapis.com', // ad-wars
  301. 'imasdk.googleapis.com', // ad-wars
  302. '.l.qq.com' // ad-wars
  303. ];