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