reject-data-source.ts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  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://raw.githubusercontent.com/easylist/easylist/gh-pages/easylist.txt',
  91. 'https://secure.fanboy.co.nz/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. // AdGuard Annoyances filter
  125. ['https://filters.adtidy.org/android/filters/14_optimized.txt', null, TTL.THREE_HOURS()],
  126. // GameConsoleAdblockList
  127. // Update almost once per 1 to 3 months, let's set a 10 days cache ttl
  128. ['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/GameConsoleAdblockList.txt', null, TTL.TEN_DAYS()],
  129. // PiHoleBlocklist
  130. // Update almost once per 3 months, let's set a 10 days cache ttl
  131. [
  132. 'https://perflyst.github.io/PiHoleBlocklist/SmartTV-AGH.txt',
  133. [
  134. 'https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt'
  135. ],
  136. TTL.TEN_DAYS()
  137. ],
  138. // Spam404
  139. // Not actively maintained, let's use a 10 days cache ttl
  140. ['https://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt', null, TTL.TEN_DAYS()],
  141. // Brave First Party & First Party CNAME
  142. ['https://raw.githubusercontent.com/brave/adblock-lists/master/brave-lists/brave-firstparty.txt', null, TTL.ONE_DAY()]
  143. ] as const;
  144. export const ADGUARD_FILTERS_EXTRA: AdGuardFilterSource[] = [
  145. // EasyList Germany filter
  146. [
  147. 'https://easylist.to/easylistgermany/easylistgermany.txt',
  148. [
  149. 'https://easylist-downloads.adblockplus.org/easylistgermany.txt'
  150. ],
  151. TTL.TWLVE_HOURS()
  152. ],
  153. // AdGuard Japanese filter
  154. ['https://filters.adtidy.org/extension/ublock/filters/7_optimized.txt', null, TTL.THREE_HOURS()],
  155. // uBlock Origin Filter List
  156. [
  157. 'https://ublockorigin.github.io/uAssetsCDN/filters/filters.min.txt',
  158. [
  159. 'https://ublockorigin.pages.dev/filters/filters.min.txt'
  160. ],
  161. TTL.THREE_HOURS()
  162. ],
  163. // uBlock Origin Badware Risk List
  164. [
  165. 'https://ublockorigin.github.io/uAssetsCDN/filters/badware.min.txt',
  166. [
  167. 'https://ublockorigin.pages.dev/filters/badware.min.txt'
  168. ],
  169. TTL.THREE_HOURS()
  170. ],
  171. // uBlock Origin Privacy List
  172. [
  173. 'https://ublockorigin.github.io/uAssetsCDN/filters/privacy.min.txt',
  174. [
  175. 'https://ublockorigin.pages.dev/filters/privacy.min.txt'
  176. ],
  177. TTL.THREE_HOURS()
  178. ],
  179. // uBlock Origin Resource Abuse: merged in uBlock Origin Privacy List
  180. // [
  181. // 'https://ublockorigin.github.io/uAssetsCDN/filters/resource-abuse.txt',
  182. // [
  183. // 'https://ublockorigin.pages.dev/filters/resource-abuse.txt'
  184. // ]
  185. // ],
  186. // uBlock Origin Unbreak
  187. [
  188. 'https://ublockorigin.github.io/uAssetsCDN/filters/unbreak.min.txt',
  189. [
  190. 'https://ublockorigin.pages.dev/filters/unbreak.min.txt'
  191. ],
  192. TTL.THREE_HOURS()
  193. ]
  194. ];
  195. export const PREDEFINED_WHITELIST = [
  196. '.localhost',
  197. '.local',
  198. '.localhost.localdomain',
  199. '.broadcasthost',
  200. '.ip6-loopback',
  201. '.ip6-localnet',
  202. '.ip6-mcastprefix',
  203. '.ip6-allnodes',
  204. '.ip6-allrouters',
  205. '.ip6-allhosts',
  206. '.mcastprefix',
  207. '.skk.moe',
  208. 'analytics.google.com',
  209. '.cloud.answerhub.com',
  210. 'ae01.alicdn.com',
  211. '.whoami.akamai.net',
  212. '.whoami.ds.akahelp.net',
  213. 'pxlk9.net.', // This one is malformed from EasyList, which I will manually add instead
  214. '.instant.page', // No, it doesn't violate anyone's privacy. I will whitelist it
  215. '.piwik.pro',
  216. 'mixpanel.com',
  217. 'cdn.mxpnl.com',
  218. '.heapanalytics.com',
  219. '.segment.com',
  220. '.segmentify.com',
  221. '.t.co', // pgl yoyo add t.co to the blacklist
  222. '.survicate.com', // AdGuardDNSFilter
  223. '.perfops.io', // AdGuardDNSFilter
  224. '.d2axgrpnciinw7.cloudfront.net', // ADGuardDNSFilter
  225. '.sb-cd.com', // AdGuard
  226. '.storage.yandexcloud.net', // phishing list
  227. '.login.microsoftonline.com', // phishing list
  228. 'api.xiaomi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  229. 'api.io.mi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  230. '.cdn.userreport.com', // https://github.com/AdguardTeam/AdGuardSDNSFilter/issues/1158
  231. '.ip-api.com',
  232. '.fastly-analytics.com',
  233. '.digitaloceanspaces.com',
  234. 's3.nl-ams.scw.cloud',
  235. '.geolocation-db.com',
  236. '.uploads.codesandbox.io',
  237. '.vlscppe.microsoft.com', // Affect Windows ISO download https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers.txt
  238. '.statsig.com', // OpenAI use this for A/B testing
  239. '.pstmrk.it', // Fuck Peter Lowe Hosts
  240. '.clicks.mlsend.com', // Fuck Peter Lowe Hosts
  241. 'email.accounts.bitly.com', // Fuck Peter Lowe Hosts
  242. 'adsense.google.com', // Fuck Peter Lowe Hosts
  243. 'api.vip.miui.com', // Fuck Goodbye Xiaomi Ads
  244. 'staging.ai.api.xiaomi.com', // Fuck Goodbye Xiaomi Ads
  245. 'm.stripe.com', // EasyPrivacy only blocks m.stripe.com wwith $third-party,
  246. // yet stupid AdGuardDNSFilter blocks all of it. Stupid AdGuard
  247. '.w3s.link', // stupid phishing.army, introduce both "*.ipfs.w3s.link" and ".w3s.link" to the block list
  248. 'ipfs.io', // ipfs.io was blocked by DigitalSide Threat-Intel - OSINT Hub
  249. // stupid uBlock Origin blocking public cdn
  250. '.bootcdn.net',
  251. '.bootcss.com',
  252. '.staticfile.net',
  253. '.staticfile.org'
  254. ];
  255. export const PREDEFINED_ENFORCED_WHITELIST = [
  256. 'r2.dev',
  257. 'godaddysites.com',
  258. 'web.app',
  259. 'firebaseapp.com',
  260. 'ipfs.nftstorage.link',
  261. 'ipfs.4everland.io',
  262. 'ipfs.cf-ipfs.com',
  263. 'ipfs.dweb.link',
  264. 'ipfs.infura-ipfs.io',
  265. 'ipfs.fleek.cool',
  266. 'repl.co',
  267. 'w3s.link',
  268. 'translate.goog',
  269. 'backblazeb2.com',
  270. 'workers.dev',
  271. 'r2.dev',
  272. 'glitch.me',
  273. 'netlify.app',
  274. 'blogspot.com',
  275. 'appspot.com'
  276. ];